@startuml
start
:get particle weighting,
mass, momentum, charge <
-> use single particle values;
:calculate COMS momentum;
:calculate s12 param
----
kinematics <-- Perez; statistics <- Higginson;
:calculate relative COMS velocity;
:calculate maximal s12 value (s12max)
----
low temp correction
kinematics <-- Perez, statistics <- Higginson,
needs densities;
if( s12<s12max) then (yes )
:use s12;
else( no )
:use s12max;
endif
:calculate collision angle distribution from s12;
:get random angle from the distribution;
:choose randomly 2nd angle
----
even distribution over [0, 2pi);
:calculate final COMS momentum;
:calculate corrected weights (w0, w1)
----
divided by duplication number
for this pair;
if(w0 > w1) then (yes)
:convert final momentum
COMS to Lab
for the 1st particle;
:apply new momentum (1st particle);
:U = random float from [0,1];
if( w1/w2 - U > 0 ) then (yes)
:do the same for 2nd particle;
else (no)
endif
else (no )
:convert final momentum
COMS to Lab
for the 2st particle;
:apply new momentum (2nd particle);
:U = random float from [0,1];
if( w2/w1 - U > 0 ) then (yes)
:do the same for 1st particle;
else ( no )
endif
endif
stop
@enduml
