Hi all,
I recently started using the Orekit Python wrapper and wanted to model an impulsive Hohmann trasfer. After going trough different examples in the official wrapper repository and checking different code snippets in this forum, I was able to understand the logic behind how ImpulsiveManeuver instances are applied.
However, I am not sure how can I define the deltaV vectors aligned with local velocity in both periapsis and apoapsis of the orbit. The following code shows my current implementation of the Hohmann impulsive transfer, which is expected to output two instances of the ImpulsiveManeuver class, being the first one the apogee raising and the second one for orbit circularization:
def hohmann(k, r0_vec, v0_vec, r_f, ISP=300):
""" Computes required impulses for a Hohmann transfer """
# Initial position and velocity magnitude
r0_norm, v0_vec = [norm(vec) for vec in (r0_vec, v0_vec)]
a_trans = (r0_norm + rf_norm) / 2
# Compute the magnitude of Hohmann's deltaV vectors
dv_a = np.sqrt(2 * k / r0_norm - k / a_trans) - np.sqrt(k / r0_norm)
dv_b = np.sqrt(k / rf_norm) - np.sqrt(2 * k / rf_norm - k / a_trans)
# Transform previous magnitudes into vectors aligned with local velocity
# in the local orbital frame
?? ?? ?? ??
# Define the events which trigger the impulses
at_periapsis = PositionAngleDetector(orekit_ss, PositionAngle.TRUE, 0)
at_apoapsis = PositionAngleDetector(orekit_ss, PositionAngle.TRUE, np.pi)
# Build the impulses
imp_A = ImpulseManeuver(at_periapsis, dVa_vec, ISP)
imp_B = ImpulseManeuver(at_apoapsis, dVb_vec, ISP)
return imp_A, imp_B
I know there is a LOFType
class, but I am not sure how to properly add it to previous algorithm… On the other hand, a similar procedure could be applied for Bi-elliptic transfers.
Thanks for this amazing software and its open-source nature!