# hp41programs

Special Relativity

# Special Relativity for the HP-41

Overview

1°)  The Lorentz Transformation
2°)  Composition of Speeds & Relative Velocity
3°)  Doppler Effect & Aberration
4°)  Elastic Collision

4-a)  2 Particles with the same masses
4-b)  2 Particles with different masses
4-c)  Compton Effect

1°)  The Lorentz Transformation

y'
y                  |       z'
|                   |      /
|       z          |    /
|      /            |  /
|    /              |/-------------------------- x'                ( Ox ) // ( O'x' )
|  /               O'                                                          ( Oy ) // ( O'y' )
|/----------------------------------- x                        ( Oz ) // ( O'z' )
O

-We assume that O' has a constant velocity ß = ( ßx , ßy , ßz ) with respect to ( Ox , Oy , Oz ).
and that the event ( 0 , 0 , 0 , 0 ) has the same coordinates in both reference-frames.

-The following program performs the conversion  ( x , y , z , ct )  < >  ( x' , y' , z' , ct' )  for a given event

Formulae:     With  r(x,y,z)  and  r'(x',y',z')  ,  g = ( 1 - b2 ) -1/2  ,   ß = || ß || = ( ßx2 +  ßy2z2 ) 1/2

r  =  r' + ß.g [ g/(g+1) ß.r' + c t' ]
c t = g ( c t' + ß.r' )
where  ß.r and ß.r' are the dot products
r'  =  r + ß.g [ g/(g+1) ß.r - c t ]
c t' = g ( c t' - ß.r )

Data Registers:              R00 = Dilatation Factor = g = ( 1 - ß2 ) -1/2      ( Registers R01 thru R03 are to be initialized before executing "LRTF" )

•  R01 = ßx         R04 = x    ( or x' if SF 00 )             R08 = the invariant    c2 t2 - x2 - y2 - z2 = c2 t'2 - x'2 - y'2 - z'2
•  R02 = ßy         R05 = y    ( or y' if SF 00 )
•  R03 = ßz          R06 = z    ( or z' if SF 00 )
R07 = ct  ( or ct' if SF 00 )

Flags:   F00        CF 00 for the transformation  ( r , ct )   >>>  ( r' , ct' )
SF 00 for the transformation  ( r' , ct' )  >>>  ( r , ct )
Subroutines: /

 01  LBL "LRTF" 02  STO 04 03  X^2 04  X<>Y 05  STO 05 06  X^2 07  + 08  X<>Y 09  STO 06 10  X^2 11  + 12  X<>Y 13  STO 07 14  X^2 15  X<>Y 16  - 17  STO 08 18  1 19  RCL 01 20  X^2 21  RCL 02       22  X^2 23  RCL 03 24  X^2 25  + 26  + 27  - 28  SQRT 29  1/X 30  STO 00 31  RCL 07 32  RCL 01 33  RCL 04 34  * 35  RCL 02       36  RCL 05 37  * 38  + 39  RCL 03 40  RCL 06 41  * 42  + 43  FS? 00 44  ST+ Y 45  FC? 00 46  ST- Y 47  RCL 00 48  ST* Z 49  ST* Y 50  1 51  + 52  / 53  RCL 07       54  FC? 00 55  CHS 56  + 57  RCL 00 58  * 59  RCL 03 60  X<>Y 61  * 62  RCL 02 63  LASTX 64  * 65  RCL 01 66  ST* L 67  CLX 68  RCL 06       69  ST+ Z 70  CLX 71  RCL 05 72  ST+ Y 73  CLX 74  RCL 04 75  ST+ L 76  X<> L 77  END

( 98 bytes / SIZE 009 )

 STACK(CF00) INPUTS OUTPUTS T c.t c.t' Z z z' Y y y' X x x'
 STACK(SF 00) INPUTS OUTPUTS T c.t' c.t Z z' z Y y' y X x' x

Example1:    Velocity  ß = ( 0.4 ; 0.5 ; 0.6 )   Event = ( x , y , z , c.t ) = ( 1 , 2 , 3 , 4 )

0.4  STO 01
0.5  STO 02
0.6  STO 06

CF 00

4   ENTER^
3   ENTER^
2   ENTER^
1   XEQ "LRTF"  >>>>   x =  -0.5324
RDN   y  =   0.0846
RDN   z  =   0.7015
RDN  c.t =   1.6681

-We also have the dilatation factor g = R00 = 2.0851  and the invariant   c2 t2 - x2 - y2 - z2 = R08 = 2

Example2:    With the same  ß = ( 0.4 ; 0.5 ; 0.6 )   Event = ( x' , y' , z' , c.t' ) = ( 1 , 2 , 3 , 4 )

SF 00

4   ENTER^
3   ENTER^
2   ENTER^
1   XEQ "LRTF"  >>>>   x =  6.1401
RDN   y  =  8.4251
RDN   z  = 10.7102
RDN  c.t = 15.0130

Notes:

-If R08 > 0  it is a time-like event.
-If R08 < 0  it is a space-like event.

2°)  Composition of Speeds & Relative Velocity

-We assume that the units are chosen so that  c = speed of light = 1

y'
y                  |       z'
|                   |      /
|       z          |    /          . P = Particle
|      /            |  /
|    /              |/-------------------------- x'
|  /               O'
|/----------------------------------- x
O

- O' has a constant velocity u = ( ux , uy , uz ) with respect to ( Ox , Oy , Oz )

Problem1:   The speed of a particle P is v = ( vx , vy , vz ) with respect to ( Ox' , Oy' , Oz' ). Calculate its speed w with respect to ( Ox , Oy , Oz )

Answer:      w = ( wx , wy , wz )  with

wx = [  vx + g.ux ( g u.v /(g+1) + 1 ] / [ g ( 1 + u.v ) ]
wy = [ vy + g.uy ( g u.v /(g+1) + 1 ] / [ g ( 1 + u.v ) ]       u.v = dot product     g = ( 1 - ux2 - uy2 - uz2 ) -1/2
wz = [  vz + g.uz ( g u.v /(g+1) + 1 ] / [ g ( 1 + u.v ) ]

Problem2:   The speed of this particle P is v = ( vx , vy , vz ) with respect to ( Ox , Oy , Oz ). Calculate its relative velocity w with respect to ( Ox' , Oy' , Oz' )

Answer:      w = ( wx , wy , wz )  with

wx = [  vx + g.ux ( g u.v /(g+1) - 1 ] / [ g ( 1 - u.v ) ]
wy = [ vy + g.uy ( g u.v /(g+1) - 1 ] / [ g ( 1 - u.v ) ]
wz = [  vz + g.uz ( g u.v /(g+1) - 1 ] / [ g ( 1 - u.v ) ]

-Since these formulae only differ in a few changes of sign, we can use a unique program and a flag.

Data Registers:              R00 = Dilatation Factor = g = ( 1 - u2 ) -1/2        ( Registers R01 thru R06 are to be initialized before executing "SPEED" )

•  R01 = ux     •   R04 = vx         R07 = wx
•  R02 = uy    •   R05 = vy         R08 = wy
•  R03 = uz        R06 = vz          R09 = wz

Flag:   F01        CF 01  for the composition of speeds
SF 01  for the relative velocity
Subroutines: /

 01  LBL "SPEED" 02  1 03  RCL 01 04  X^2 05  RCL 02 06  X^2 07  RCL 03 08  X^2 09  + 10  + 11  - 12  SQRT 13  1/X 14  STO 00 15  STO 07 16  RCL 01 17  RCL 04          18  * 19  RCL 02 20  RCL 05 21  * 22  + 23  RCL 03 24  RCL 06 25  * 26  + 27  * 28  FS? 01 29  CHS 30  ST+ 07 31  * 32  X<>Y 33  1 34  + 35  / 36  + 37  FS? 01 38  CHS 39  RCL 06          40  RCL 03 41  RCL Z 42  * 43  + 44  RCL 07 45  / 46  STO 09 47  X^2 48  X<>Y 49  RCL 02 50  * 51  RCL 05          52  + 53  RCL 07 54  / 55  STO 08 56  X^2 57  + 58  X<>Y 59  RCL 01 60  * 61  RCL 04 62  + 63  RCL 07 64  / 65  STO 07          66  X^2 67  + 68  SQRT 69  RCL 09 70  RCL 08 71  RCL 07 72  END

( 86 bytes / SIZE 010 )

 STACK INPUTS OUTPUTS T / w Z / wz Y / wy X / wx

where  w is the norm of the 3-vector w = ( wx , wy , wz )

-if CF 01  w = the composition of  u  and v
-if SF 01  w = the relative speed  ( with respect to the 2nd reference-frame )

Example:    u = ( 0.4 , 0.5 , 0.6 )   v =  ( 0.27 , 0.37 , 0.47 )

0.4  STO 01       0.27  STO 04
0.5  STO 02       0.37  STO 05
0.6  STO 03       0.47  STO 06

CF 01  XEQ "SPEED"  >>>>   wx =  0.434880406           ( execution time = 2.5 seconds )
RDN    wy =  0.553496668
RDN    wz =  0.672112930
RDN    w  =  0.973249875

SF 01  XEQ "SPEED"  >>>>    wx =  -0.270737319
RDN    wy =  -0.301747643
RDN    wz =  -0.332757967
RDN    w  =   0.524478981

Notes:

-The composition of speeds is not commutative in the general case.
-However, the norms  w  are identical
-There will be a DATA ERROR line 12 or 13 if  u = || u ||  is equal to or greater than 1
-However, the program also works if  v = || v || = 1 ( a photon )
and if  v = || v ||  is greater than 1. In this case, the particle P is a ( hypothetic ) tachyon !

-The formulas are much simpler  if  uy = uz = vy =  vz = 0
then  wy = wz = 0  and for the composition of speeds:
wx = ( ux + vx ) / ( 1 + ux vx )

-If you only want to compute the magnitude  w , the routine hereafter is shorter than "SPEED"
-It uses the formulae:

w2 = [ ( u + v )2 - ( u x v )2 ] / ( 1 + u.v )2    for the composition of speeds           where   u.v  is the dot product
w2 = [ ( u - v )2 - ( u x v )2 ] / ( 1 - u.v )2     for the relative velocities                     and   u x v  is the cross-product

Data Registers:              R00 = w                             ( Registers R01 thru R06 are to be initialized before executing "MAGW" )

•  R01 = ux     •   R04 = vx
•  R02 = uy    •   R05 = vy
•  R03 = uz        R06 = vz

Flag:   F01        CF 01  for the composition of speeds
SF 01  for the relative speed

Subroutines:  "DOT" & "CROSS" ( cf "Dot-product & Cross-product for the HP-41" )

 01  LBL "MAGW" 02  1 03  RCL 06 04  RCL 05 05  RCL 04 06  XEQ "CROSS" 07  X^2 08  X<>Y 09  X^2 10  + 11  X<>Y 12  X^2 13  + 14  RCL 01           15  RCL 04 16  FS? 01 17  CHS 18  + 19  X^2 20  RCL 02 21  RCL 05 22  FS? 01 23  CHS 24  + 25  X^2 26  + 27  RCL 03           28  RCL 06 29  FS? 01 30  CHS 31  + 32  X^2 33  + 34  X<>Y 35  - 36  SQRT 37  STO 00           38  SIGN 39  4.006 40  XEQ "DOT" 41  FS? 01 42  CHS 43  1 44  + 45  ST/ 00 46  RCL 00           47  END

( 75 bytes / SIZE 007 )

 STACK INPUTS OUTPUTS X / w

where  w is the norm of the 3-vector w = ( wx , wy , wz )

-if CF 01  w = the composition of  u and v
-if SF 01  w = the relative speed  ( with respect to the 2nd reference-frame )

Example:    u = ( 0.4 , 0.5 , 0.6 )   v =  ( 0.27 , 0.37 , 0.47 )

0.4  STO 01       0.27  STO 04
0.5  STO 02       0.37  STO 05
0.6  STO 03       0.47  STO 06

CF 01  XEQ "MAGW"  >>>>   w  =  0.973249875

SF 01  XEQ "MAGW"  >>>>    w  =  0.524478980

Remark:

-If we know the magnitudes  u & v  and the angle  µ = ( u , v )
we can calculate the magnitude w and the angle µ' = ( u , w ) with the following program:

 01  LBL "U+V" 02  RCL Y 03  P-R 04  STO 00 05  RDN 06  STO 01 07  X^2 08  X<>Y 09  X^2 10  X<> Z 11  FS? 01 12  CHS 13  ST+ 00        14  ST* T 15  X^2 16  STO 02 17  ST+ Z 18  * 19  - 20  + 21  + 22  SQRT         23  X<>Y 24  1 25  + 26  / 27  1 28  RCL 02 29  - 30  SQRT 31  RCL 01       32  * 33  RCL 00       34  R-P 35  X<> Z 36  END

( 51 bytes / SIZE 003 )

 STACK INPUTS OUTPUTS Z u / Y v µ' X µ w

-if  CF 01  w = the composition of  u and v
-if  SF 01  w = the relative speed

Example:      u = 0.7    v = 0.8    µ = ( u , v ) = 41°

CF 01

0.7   ENTER^
0.8   ENTER^
41    XEQ "U+V"   >>>>   w = 0.953563802              ---Execution time = 2.3s---
X<>Y  µ' = 16.03924045°

SF 01

0.7   ENTER^
0.8   ENTER^
41    XEQ "U+V"   >>>>   w = 0.670241444
X<>Y  µ' = 104.3994224°

-If you execute "U+V" after clearing F01 with

0.7          ENTER^
0.670241444   ENTER^
104.3994224      R/S       it yields    0.8            ( with small roundoff errors )
X<>Y     41°

Note:

-The formulas are:

w   = ( u2 + v2 + 2 u v cos µ - u2 v2 sin2 µ )1/2 / ( 1 + u v cos µ )        simply replace µ by -µ for the relative velocity
tan µ = [ ( 1 - u2 )1/2 v sin µ ] / ( u + v cos µ )

3°)  Doppler Effect & Aberration

-The frequency and the direction of a photon are changed by the relative motion of the source and the observer.
-The following program performs these conversions.

S = Source                                                        S = Source

S\\---> ß                                                      S/ /---> ß
\ \                                           y                 /
\                                         |               /   /
cS \   \ c0                                   |         cS/    / c                                              ß  = velocity of the source , we assume ß // (Ox)
.     .                                     |        .      .                                                   cS = velocity of a photon,  seen in the source reference-frame
. µS   .  µ0                             |     . µS   . µ0                                                c0  = velocity of the photon,  seen in the observer reference-frame
----------------------------------|---------------------------------- x
O = Observer                                                  µS = the angle ( ß , -cS ) = ( Ox , -cS )
µ0  = the angle ( ß , -c0 ) = ( Ox , -c0 ) is measured by the observer

fS = frequency in the source reference-frame                                     Of course  || cS || = || c0 || = 1
f0  = frequency measured by the observer

Formulae:

f0  =  fS ( 1 - ß2 ) -1/2  ( 1 - ß cos µS )                cos µ0 = ( cos µS - ß ) ( 1 - ß cos µS ) -1
fS =   f0 ( 1 - ß2 ) -1/2  ( 1 + ß cos µ0 )               cos µS = ( cos µ0 + ß ) ( 1 + ß cos µ0 ) -1

-We assume that µS and µ0  are between 0 and 180°  and  ß  is non-negative
-The source is moving away if µ0 < 90°

Data Registers:  /
Flag:     F00         CF 00 for the conversion  ( f0 , µ0 )  >>>  ( fS , µS )
SF 00 for the conversion  ( fS , µS )  >>>  ( f0 , µ0 )
Subroutines: /

 01  LBL "DAB"  02  RCL Z  03  FS? 00  04  CHS  05  STO T  06  X^2  07  SIGN  08  ST- L  09  X<> L  10  CHS  11  SQRT  12  /  13  RDN  14  COS  15  ST+ Z  16  *  17  1  18  +  19  ST* Z  20  /  21  ACOS  22  X<>Y  23  END

( 38 bytes / SIZE 000 )

 STACK(CF 00) INPUTS OUTPUTS Z ß / Y µ0 µS X f0 fS
 STACK(SF00) INPUTS OUTPUTS Z ß / Y µS µ0 X fS f0

Example1:      ß = 0.7     µ0 = 41°     f0 = 10

CF 00

0.7  ENTER^
41  ENTER^
10  XEQ "DAB"   yields     fS = 21.4004   X<>Y   µS =  17.8522°

-Likewise,   ß = 0.7     µ0 = 150°     f0 = 10   give   fS = 5.5141  and   µS =  114.9367°

Example2:      ß = 0.7     µS = 41°     fS = 10

SF 00

0.7  ENTER^
41  ENTER^
10  XEQ "DAB"  gives in 1.8 second   f0 = 6.6052   X<>Y   µ0 =  83.3397°

-Likewise,   ß = 0.7     µS = 150°     fS = 10   produce   f0 = 22.4915  and   µ0 =  167.1555°

Notes:

-The frequencies  f0 & fS are equal  iff  ( ß = 0  or  ß cos2 µ0 + 2 cos µ0 + ß = 0 )
i-e  ( ß = 0  or  ß cos2 µS - 2 cos µS + ß = 0 )

for  ß = 0.7  the solution is  µ0 = 114.1023165°  i-e  µS =  65.89768346°

-"DAB" works in all angular modes.
-However, the program listed above should not be used  if  µ  is very near 0° or 180°  because ACOS doesn't give enough accurate results in that cases.
-For example, with  ß = 0.7 and  µ0 = 0.01°  it yields  µS = 0.003969568048°  whereas the correct value is µS = 0.004200840261°

-The following variant uses R-P instead of ACOS , it employs the formulae:

Tan µ0 = Sin µS ( cos µS - ß ) -1 ( 1 - ß2 ) 1/2
Tan µS = Sin µ0 ( cos µ0 + ß ) -1 ( 1 - ß2 ) 1/2

 01  LBL "DAB" 02  X<> Z 03  FS? 00 04  CHS 05  STO T 06  X^2 07  SIGN          08  ST- L 09  X<> L 10  CHS 11  SQRT 12  ST/ Z 13  X<>Y         14  SIN 15  ST* Y 16  X<> L 17  COS 18  STO L 19  R^ 20  ST* Y          21  ST+ L 22  CLX 23  1 24  ST+ Y 25  RDN 26  ST* Z 27  X<> L         28  R-P 29  X<> Z 30  END

( 53 bytes / SIZE 000 )

 STACK(CF 00) INPUTS OUTPUTS Z ß / Y µ0 µS X f0 fS
 STACK(SF00) INPUTS OUTPUTS Z ß / Y µS µ0 X fS f0

-Examples 1 and 2 produce the same results, but this time,  ß = 0.7 and  µ0 = 0.01°  yield  µS = 0.004200840259°
-Moreover, this program also works if  -180° < µ < 0°

-6 bytes may be saved if you replace lines 06 to 11 by  ASIN  COS  but the execution time becomes 3.4 seconds instead of 2.5 seconds.

4°)  Elastic Collision

a) 2 Particles with the same masses

ß1
*                                           One particle is initially at rest in O
ß                              *  µ                                          The incoming particle has a speed  ß   ( ß < 1 = speed of light )
* * * * * * * * * * *
O   *                                             After the shock, the speed of the incoming particle has become ß1
*                                        and the speed of the other particle - initially at rest - is ß2
*  ß2                              µ is the angle between the vectors   ß1ß2

Formulae:

cos µ = ß12 [ 1 + ( 1 - ß12 )1/2 ] -1 [ 1 + ( 1 - ß22 )1/2 ] -1

ß2/( 1 - ß2 ) = ß12/( 1 - ß12 ) + 2.ß12 cos µ  ( 1 - ß12 ) -1/2 ( 1 - ß22 ) -1/2   + ß22/( 1 - ß22 )

-We also have:       ( 1 - ß2 ) -1/2 = ( 1 - ß12 ) -1/2 + ( 1 - ß22 ) -1/2 - 1   but the results would be less accurate for  ß << 1

-All these relations come from the conservation of the energy-momentum.

Data Registers: /
Flags: /
Subroutines: /

 01  LBL "COLL" 02  STO M 03  ENTER^ 04  X^2 05  SIGN 06  LASTX 07  - 08  SQRT 09  ST/ M          10  1 11  + 12  / 13  * 14  1 15  R^ 16  X^2 17  - 18  SQRT          19  ST/ Z 20  1 21  + 22  / 23  ST* Y 24  ACOS 25  X<>Y 26  ST+ X         27  0 28  X<> M 29  ST* Y 30  X^2 31  + 32  R^ 33  X^2 34  + 35  1/X 36  1 37  + 38  1/X 39  SQRT         40  END

( 56 bytes / SIZE 000 )

 STACK INPUTS OUTPUTS Y ß1 µ X ß2 ß

Example:    ß1 = 0.9    ß2 = 0.8

0.9   ENTER^
0.8   XEQ "COLL"  >>>>     ß = 0.941238075       ( execution time = 2.3 seconds )
X<>Y     µ = 71°73608140       ( in DEG mode )

-This program works in all angular modes.
-Synthetic register M may be replaced by R00 or any other data register.
-When ß is very small, µ ~ 90° , this is the classical result !

-If you know ß1 & ß2 , you may wish to calculate ß & µ
-You'll have to solve the following equation:

x2 sin2 µ - x [ 1 + ( 1 - ß2 ) -1/2 ] sin2 µ + [ 2 + ( 1 - ß2 ) -1/2 ] cos2 µ + ( 1 - ß2 ) -1/2  = 0    where  x = ( 1 - ßi2 ) -1/2     i = 1 , 2

Data Registers: /
Flags: /
Subroutines: /

 01  LBL "COLL2" 02  X^2 03  SIGN 04  LASTX 05  - 06  SQRT 07  1/X 08  1 09  + 10  2 11  / 12  ENTER^         13  ENTER^ 14  SIGN 15  + 16  X^2 17  RCL Y 18  R^ 19  SIN 20  X^2 21  / 22  4 23  * 24  - 25  SQRT             26  ST+ Z 27  - 28  X^2 29  1/X 30  SIGN 31  LASTX           32  - 33  SQRT 34  X<>Y 35  X^2 36  1/X 37  SIGN 38  LASTX           39  - 40  SQRT 41  END

( 53 bytes / SIZE 000 )

 STACK INPUTS OUTPUTS Y µ < 90° ß2 X ß ß1

Example:    µ = 60°    ß = 0.986

-in DEG mode

60        ENTER^
0.986   XEQ "COLL2"  >>>>     ß1 = 0.977634203       ( execution time = 2.3 seconds )
X<>Y     ß2 = 0.895051724

-This program works in all angular modes.

b) 2 Particles with different masses

ß1
*                                            One particle ( mass m2 ) is initially at rest in O
ß                              *  µ1                                          The incoming particle ( mass m1 )  has a speed  ß   ( ß < 1 = speed of light )
* * * * * * * * * * *----------------------------
O   *  µ2                                        After the shock, the speed of the incoming particle has become ß1
*                                        and the speed of the other particle - initially at rest - is ß2
*  ß2                              µ = µ1 + µ2   is the angle between the vectors   ß1 , ß2

Formulae:             m.ß ( 1 - ß2 ) -1/2 = m.ß1 cos µ1 ( 1 - ß12 ) -1/2 + ß2 cos µ2 ( 1 - ß22 ) -1/2                                   where   m = m1/m2

m2 ß2/( 1 - ß2 ) + m2 ß12/( 1 - ß12 ) - 2.m2.ß.ß1 cos µ1 ( 1 - ß2 ) -1/2 ( 1 - ß12 ) -1/2   =  ß22/( 1 - ß22 )

m ( 1 - ß2 ) -1/2 = m ( 1 - ß12 ) -1/2 + ( 1 - ß22 ) -1/2 - 1                  which is re-written:

( 1 - ß2 ) -1/2  = 1 + eps    with  eps = ß12 [ 1 - ß12 + ( 1 - ß12 ) -1/2 ] -1  +  (1/m) ß22 [ 1 - ß22 + ( 1 - ß22 ) -1/2 ] -1

whence        ß = [ 2.eps + (eps)2 ]1/2  ( 1 + eps ) -1     and    ß2/( 1 - ß2 ) = 2.eps + (eps)2

-Thus, the formulas are also accurate for small speeds  ( ß << 1 )

Data Registers:   R00 thru R03: temp
Flags: /
Subroutines: /

 01  LBL "COLL3" 02  STO 02 03  X^2 04  STO 00 05  SIGN 06  LASTX 07  - 08  ENTER^ 09  SQRT 10  ST/ 02 11  + 12  R^ 13  ST/ 02 14  * 15  RCL 00           16  X<>Y 17  / 18  X<>Y 19  STO 01 20  X^2 21  STO 00 22  SIGN 23  LASTX 24  - 25  ENTER^ 26  SQRT 27  ST/ 01 28  + 29  RCL 00           30  X<>Y 31  / 32  + 33  ENTER^ 34  STO 00 35  2 36  + 37  * 38  STO 03 39  RCL 02 40  X^2 41  - 42  RCL 01 43  X^2 44  + 45  RCL 03           46  SQRT 47  STO 03 48  ST+ X 49  / 50  STO Z 51  RCL 01 52  / 53  ACOS 54  RCL 03 55  R^ 56  - 57  RCL 02           58  / 59  ACOS 60  X<>Y 61  RCL 00 62  1 63  + 64  RCL 03 65  X<>Y 66  / 67  END

( 82 bytes / SIZE 004 )

 STACK INPUTS OUTPUTS Z m = m1/m2 µ2 Y ß1 µ1 X ß2 ß

Example:       m = m1/m2 = 2  ,  ß1 = 0.9  ,  ß2 = 0.8

-In DEG mode:

2     ENTER^
0.9   ENTER^
0.8   XEQ "COLL3"  >>>>    ß =  0.924743364   ( in 3.4 seconds )
RDN    µ1 = 14°30751818
RDN    µ2 = 49°94058793   whence   µ = µ1 + µ2 = 64°24810611

-This routine works in all angular modes.
-Of course, it also works if m = 1
-For instance, with  m = m1/m2 = 1  ,  ß1 = 0.9  ,  ß2 = 0.8   it yields:

ß =  0.941238075     µ1 = 27°02226934    µ2 = 44°71381201

whence  µ = µ1 + µ2 = 71°73608135  which we had already found above with "COLL"     ( except in the last decimal )

-Knowing  m , ß and µ = µ1 + µ2  allows to compute  ß1 &  ß2
-This can be done by solving the cubic equation:

x3 sin2 µ - x2 ( u + 2/m ) sin2 µ + x ( 1/m2 + 2.u/m + cos2 µ ) - [ u/m2 + ( u + 2/m ) cos2 µ ] = 0     where  x = ( 1 - ß12 ) -1/2  &  u =   ( 1 - ß2 ) -1/2

then            ( 1 - ß22 ) -1/2 =  1 -  m ( 1 - ß2 ) -1/2 - m ( 1 - ß12 ) -1/2

-So, the results may be inaccurate with small velocities ( ß << 1 )

Data Registers:   R00 thru R04: temp
Flag:   F01
Subroutine:   "P3"  ( cf "Polynomials for the HP-41" )

 01  LBL "COLL4" 02  X^2 03  SIGN 04  LASTX 05  - 06  SQRT 07  1/X 08  STO 00 09  SIGN 10  P-R 11  X^2 12  X<>Y 13  X^2 14  STO 01           15  R^ 16  1/X 17  STO 02 18  ST+ X 19  RCL 00 20  + 21  STO 03 22  * 23  CHS 24  RCL 00 25  STO 04 26  ST+ X 27  RCL 02           28  ST* Y 29  X^2 30  ST* 04 31  + 32  R^ 33  ST+ Y 34  RCL 03 35  * 36  RCL 04 37  + 38  CHS 39  RCL 01 40  RDN 41  XEQ "P3" 42  ENTER^ 43  CF 01 44  RCL 00           45  X<>Y 46  - 47  RCL 02 48  ST+ Y 49  X<>Y 50  / 51  X^2 52  SIGN 53  LASTX 54  - 55  SQRT 56  X<>Y 57  X^2 58  1/X 59  SIGN 60  LASTX 61  - 62  SQRT             63  END

( 83 bytes / SIZE 005 )

 STACK INPUTS OUTPUTS Z m = m1/m2 / Y µ ß2 X ß ß1

Example:       m = m1/m2 = 2  ,  µ = 77°  ,  ß = 0.986

-In DEG mode:

2      ENTER^
77     ENTER^
0.986  XEQ "COLL4"  >>>>   ß1 =  0.985702487    ( in 6.4 seconds )
RDN   ß2 =  0.457448346

-This program gives one solution ( ß1 , ß2 )  and, in the above example, there is indeed a unique solution.
-But in other examples, there are 3 solutions - corresponding to the 3 solutions of the cubic ( flag F01 remains clear in this case )

-For instance,  with  m = 1.2  ,  µ = 67°  ,  ß = 0.931 ,  the 3 solutions are:

ß1 =  0.808532649     ß2 =  0.895634440            If you want to calculate all the solutions,
ß1 =  0.768103288     ß2 =  0.910120305            change the listing after line 41:
ß1 =  0.487300873     ß2 =  0.939242706            at this step, the 3 x-solutions ( if F01 is clear ) are in registers X  Y  Z

-When µ > 90° , this program may give a wrong solution: for example the solution corresponding to µ = 83° instead of µ = 97°
-So, it's safer to check with "COLL3" if the results are exact or not!
( the cubic equation only involves sin2 µ & cos2 µ , therefore it cannot distinguish  µ from 180° - µ )

c) Compton Effect

h.f '
*                                            One particle ( usually an electron ) is initially at rest in O
h.f                            *  µ1                                          The incoming photon has an energy  E = h.f = h.c/L  ( f = frequency , L = wave-length ,
* * * * * * * * * * *----------------------------                                                                              h = Planck's constant , c = speed of light )
O   *  µ2                                        After the shock, the energy of the photon has become  E = h.f ' = h.c/L'
*                                        and the speed of the other particle - initially at rest - is ß
*  ß

Formulae:        L' - L = 2(h/mc) sin2 µ1/2

( 1 - ß2 ) -1/2  = 1 + eps    with    eps = (h/mc).( L' - L )/(L.L')

whence        ß = [ 2.eps + (eps)2 ]1/2  ( 1 + eps ) -1     and    ß/( 1 - ß2 ) -1/2 = [ 2.eps + (eps)2 ] 1/2

ß.cos µ2 ( 1 - ß2 ) -1/2 = ( L' - L ).[ 1 + h/(mcL) ]/L'

-With these formulas, the results are also accurate if  ß << 1.

Data Registers:             R00 = L' - L         R02 = L'      R04 = ß/( 1 - ß2 ) -1/2
R01 = L                R03 = µ1      R05 = h/(mc)
Flags: /
Subroutines: /

 01  LBL "COMPT" 02  STO 01 03  X<>Y 04  STO 03 05  2 06  / 07  SIN 08  X^2 09  2426309 E-8 10  R^ 11  / 12  STO 05            13  ST+ X 14  * 15  STO 00 16  + 17  STO 02 18  LASTX 19  RCL 01 20  RCL 02 21  * 22  / 23  RCL 05            24  * 25  ENTER^ 26  STO Z 27  2 28  + 29  * 30  SQRT 31  STO 04            32  1 33  R^ 34  + 35  / 36  RCL 05 37  RCL 01 38  / 39  1 40  + 41  RCL 00 42  RCL 02            43  / 44  * 45  RCL 04 46  / 47  ACOS 48  RCL 02 49  END

( 70 bytes / SIZE 006 )

 STACK INPUTS OUTPUTS Z m ß Y µ1 µ2 X L L'

where the mass unit is the mass of one electron = me = 9.109534 10 -31 kg
and the wave-length L is expressed in Angstroem ( 1 Å = 10 -10 meter )

Example:       m = 1.2  ,  µ1 = 79°  ,  L = 0.123 Å

-In DEG mode:

1.2    ENTER^
79     ENTER^
0.123  XEQ "COMPT"  >>>>   L' =  0.139361229 Å
RDN    µ2 = 46°17378618
RDN    ß  =  0.193671439

-Line 09, the constant   2426309 E-8 = h/(mec)  has been computed with  h = 6.626176 10 -34 J.s ,  me = 9.109534 10 -31 kg ,  c = 299792458 m/s
and then, multiplied by E10 in order to express the wave-lengths in Angstroems.

-If  L' is very close to L , you can replace line 48 by RCL 00 = L' - L    ( L' - L  is always positive )

References:

  Robin M. Green - "Spherical Astronomy" - Cambridge University Press - ISBN 0-521-31779-7
  Stamatia Mavridès - "L'Univers relativiste" - Masson  ISBN 2-225-36080-7  ( in French )
  Landau & Lifshitz - "Classical Theory of Fields" - Pergamon Press