Skip to content

Commit 3651539

Browse files
committed
MAINT: rewrite jacobian in a slightly faster way.
1 parent b435e4f commit 3651539

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

rocketpy/motors/solid_motor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,8 @@ def geometry_jacobian(t, y):
494494
factor = volume_diff / (2 * np.pi * (rO**2 - rI**2 + rI * h) ** 2)
495495
drI_dot_drI = factor * (h - 2 * rI)
496496
drI_dot_dh = factor * rI
497-
dh_dot_drI = -2 * factor * (h - 2 * rI)
498-
dh_dot_dh = -2 * factor * rI
497+
dh_dot_drI = -2 * drI_dot_drI
498+
dh_dot_dh = -2 * drI_dot_dh
499499

500500
return [[drI_dot_drI, drI_dot_dh], [dh_dot_drI, dh_dot_dh]]
501501

0 commit comments

Comments
 (0)