mirror of
https://github.com/gwm17/spspy.git
synced 2024-11-22 10:18:49 -05:00
Fix a bug in the kinematics calculation where angle was converted from degrees to radians twice
This commit is contained in:
parent
3a3c6aa28d
commit
36123b0639
|
@ -58,8 +58,10 @@ class Reaction:
|
|||
if beamRxnEnergy < threshold:
|
||||
return INVALID_KINETIC_ENERGY
|
||||
|
||||
term1 = sqrt(self.params.projectile.mass * self.params.ejectile.mass * beamRxnEnergy) / (self.params.ejectile.mass + self.residual.mass) * cos(angleRads * self.DEG2RAD)
|
||||
term1 = sqrt(self.params.projectile.mass * self.params.ejectile.mass * beamRxnEnergy) / (self.params.ejectile.mass + self.residual.mass) * cos(angleRads)
|
||||
term2 = (beamRxnEnergy * (self.residual.mass - self.params.projectile.mass) + self.residual.mass * rxnQ) / (self.params.ejectile.mass + self.residual.mass)
|
||||
if(term1**2.0 + term2) < 0:
|
||||
return INVALID_KINETIC_ENERGY
|
||||
|
||||
ke1 = term1 + sqrt(term1**2.0 + term2)
|
||||
ke2 = term1 + sqrt(term1**2.0 + term2)
|
||||
|
|
Loading…
Reference in New Issue
Block a user