MASITransfer - MOARdV/AvionicsSystems GitHub Wiki

MASITransfer.cs

Contents

The MASITransfer module does calculations to find phase angles and ejection angles for Hohmann transfer orbits. It provides functionality equivalent to the Protractor mod, but focused strictly on computations involving the current vessel and a target (either another vessel or a Celestial Body).

Note that MASITransfer assumes the target has a small relative inclination. It will generate erroneous results for high inclination and retrograde relative orbits.

In addition to providing orbital transfer information, the MASITransfer module can create maneuver nodes for basic orbital operations (changing Ap or Pe, circularizing at a specific altitude, plotting Hohmann transfers, etc).


Transfer Delta-V Category

The Delta-V section provides information on the amount of velocity change needed to change orbits. This information can be computed based on the current target, or a target altitude, depending on the specific method called.

These values are estimates based on circular orbits, assuming no plane change is required. Eccentric orbits, or non-coplanar orbits, will not reflect the total ΔV required.

transfer.DeltaVFinal()

Returns: The ΔV in m/s to finialize the transfer.

Returns an estimate of the ΔV required to circularize a Hohmann transfer at the target's orbit.

Negative values indicate a retrograde burn. Positive values indicate a prograde burn.

transfer.DeltaVFinal(double destinationAltitude)

  • destinationAltitude: Destination altitude, in meters.

Returns: ΔV in m/s to circularize at the requested altitude, or 0 if the vessel is not in flight.

Returns and estimate of the ΔV required to circularize the vessel's orbit at the altitude provided.

Negative values indicate a retrograde burn. Positive values indicate a prograde burn.

transfer.DeltaVInitial()

Returns: The ΔV in m/s to start the transfer.

Returns an estimate of the ΔV required to start a Hohmann transfer to the target's orbit.

Negative values indicate a retrograde burn. Positive values indicate a prograde burn.

transfer.DeltaVInitial(double destinationAltitude)

  • destinationAltitude: Destination altitude, in meters.

Returns: ΔV in m/s to reach the requested altitude, or 0 if the vessel is not in flight.

Returns and estimate of the ΔV required to change the vessel's orbit to the altitude provided.

Negative values indicate a retrograde burn. Positive values indicate a prograde burn.


Transfer Ejection Angle Category

The Ejection Angle region provides information on the ejection angle. The ejection angle is used on interplanetary transfers to determine when the vessel should start its burn to escape the world it currently orbits.

When the vessel is orbiting a moon in preparation for an interplanetary transfer, the target ejection angle will reflect the ejection angle required to take advantage of the Oberth effect during the ejection.

transfer.CurrentEjectionAngle()

Returns: Current ejection angle in degrees, or 0 if there is no ejection angle.

Reports the vessel's current ejection angle. When this value matches the transfer ejection angle, it is time to start an interplanetary burn.

This angle is a measurement of the vessel from the planet's prograde direction.

transfer.EjectionVelocity()

Returns: ΔV in m/s, or 0 if there is no exit velocity required.

The ΔV required to reach the correct exit velocity for an interplanetary transfer.

transfer.RelativeEjectionAngle()

Returns: Relative ejection angle in degrees, or 0 if there is no ejection angle.

Reports the difference between the vessel's current ejection angle and the transfer ejection angle. When this value is 0, it is time to start an interplanetary burn.

transfer.TimeUntilEjection()

Returns: Time until the relative ejection angle is 0, in seconds, or 0 if there is no ejection angle.

Provides the time until the vessel reaches the transfer ejection angle.

transfer.TransferEjectionAngle()

Returns: Transfer ejection angle in degrees, or 0 if there is no ejection angle.

Reports the ejection angle when an interplanetary Hohmann transfer orbit should begin. This is of use for transfers from one planet to another - once the transfer phase angle has been reached, the vessel should launch when the next transfer ejection angle is reached.


Transfer Maneuver Planning Category

The Maneuver Planning region provides functions that can be used to generate maneuver nodes to accomplish basic orbital tasks. This capability does not include autopilot functionality - it is simply a set of helper functions to create maneuver nodes.

The MAS Maneuver Planner is not as full-featured as MechJeb - it does not work with parabolic / hyperbolic orbits, for instance.

transfer.ChangeApoapsis(double newAltitude)

  • newAltitude: The new altitude for the apoapsis, in meters.

Returns: 1 if a valid maneuver node was created, 0 if it was not.

Raise or lower the altitude of the apoapsis. The maneuver node is placed at periapsis to minimize fuel requirements. If an invalid apoapsis is supplied (either by being below the periapsis, or above the SoI of the planet), this function does nothing.

transfer.ChangeInclination(double newInclination)

  • newInclination: The new inclination, in degrees.

Returns: 1 if the maneuver was scheduled, 0 if it could not be scheduled.

Change the inclination of the orbit. The change will be scheduled at either the AN or DN of the orbit, whichever results in a less expensive maneuver.

transfer.ChangePeriapsis(double newAltitude)

  • newAltitude: The new altitude for the periapsis, in meters.

Returns: 1 if a valid maneuver node was created, 0 if it was not.

Raise or lower the altitude of the periapsis. The maneuver node is placed at apoapsis to minimize fuel requirements. If an invalid periapsis is supplied (either by being above the apoapsis, or lower than the center of the planet, or if the current orbit is hyperbolic), this function does nothing.

transfer.CircularizeAltitude(double newAltitude)

  • newAltitude: The altitude at which the orbit will be circularized, in meters.

Returns: 1 if a node was created, 0 otherwise.

Circularize the vessel's orbit at the specified altitude, in meters. This new altitude must be between the current periapsis and apoapsis, and the current orbit must not be hyperbolic.

transfer.HohmannTransfer()

Returns: Returns 1 if a transfer was successfully plotted, 0 otherwise.

Generate a maneuver to conduct a Hohmann transfer to the current target. If there is no target, or the transfer is not a simple transfer to a nearly co-planar target, nothing happens.

Results are best when both the vessel and the target are in low-eccentricity orbits.

transfer.MatchPlane()

Returns: 1 if a maneuver was plotted, 0 otherwise.

Match the plane of the target's orbit. If there is no target, or the target is in a different sphere of influence, this operation has no effect.

transfer.MatchVelocities()

Returns: 1 if a maneuver was plotted, 0 otherwise.

Match velocities with the target at the moment of closest approach. If there is no target, or the target is in a different sphere of influence, the operation has no effect.

transfer.ReturnFromMoon(double newAltitude)

  • newAltitude: Altitude of the desired orbit around the parent world, in meters.

Returns: 1 if the maneuver was plotted, 0 otherwise.

Return from a moon with a resulting altitude over the planet of 'newAltitude', in meters. If the vessel is orbiting the Sun, this command has no effect.

This maneuver may be used to eject from Kerbin (or any other planet) to a solar orbit with a specified altitude over the sun.


Transfer Oberth Effect Category

The Oberth Effect region provides information specific to taking advantage of the Oberth Effect when transferring from a moon to another planet. These fields assume the vessel will eject from the moon to the OberthAltitude over the planet, from which it will fire the interplanetary ejection burn.

If the vessel is not in a situtation where the Oberth Effect would be applicable, these fields all return 0.

transfer.CurrentOberthEjectionAngle()

Returns: Current ejection angle over the moon in degrees, or 0.

The current ejection angle for the moon in degrees. When this value matches TransferOberthEjectionAngle(), it is time to do the moon ejection burn.

transfer.OberthAltitude()

Returns: Altitude in meters, or 0.

The preferred altitude over the parent planet for the interplanetary ejection burn, in meters. If the vessel's target is not another world, or the vessel does not currently orbit a moon, returns 0.

transfer.OberthEjectionDeltaV()

Returns: ΔV in m/s or 0.

Returns the ΔV in m/s required for the Oberth effect transfer ejection burn. The vessel's altitude orbiting the moon's parent should match OberthAltitude() after this burn. If the vessel's target is not another world, or the vessel does not currently orbit a moon, returns 0.

transfer.RelativeOberthEjectionAngle()

Returns: Relative angle in degrees, or 0.

Returns the relative ejection angle for an Oberth effect tranfers. When this value reaches 0, it is time to burn. If the vessel's target is not another world, or the vessel does not currently orbit a moon, returns 0.

transfer.TimeUntilOberthEjectionAngle()

Returns: Time in seconds until the burn, or 0.

Returns the time until the ejection burn must begin for an Oberth effect tranfer, in seconds. If the vessel's target is not another world, or the vessel does not currently orbit a moon, returns 0.

transfer.TransferOberthEjectionAngle()

Returns: Required ejection angle in degrees, or 0.

Returns the ejection angle required to initiate an ejection from the moon's orbit to the moon's parent world for an interplanetary transfer. If the vessel's target is not another world, or the vessel does not currently orbit a moon, returns 0.


Transfer Phase Angle Category

The Phase Angle section provides measurements of the phase angle, the measure of the angle created by drawing lines from the body being orbited to the vessel and to the target. This angle shows relative position of the two objects, and it is continuously changing as long as the craft are not in the same orbit.

To do a Hohmann transfer between orbits, the vessel should initiate a burn when its current phase angle reaches the transfer phase angle. Alternatively, when the relative phase angle reaches 0, initiate a burn.

transfer.CurrentPhaseAngle()

Returns: Current phase angle in degrees, from 0 to 360.

Returns the current phase angle between the vessel and its target.

transfer.RelativePhaseAngle()

Returns: The difference between the transfer phase angle and the current phase angle in degrees, ranging from 0 to 360.

Returns the difference (in degrees) between the current phase angle and the transfer phase angle. When this value reaches 0, it is time to start the transfer burn. If there is no valid target, this value is 0.

transfer.TimeUntilPhaseAngle()

Returns: Time until transfer, in seconds, or 0 if there is no solution.

Returns the time in seconds until the vessel reaches the correct phase angle for initiating a burn to transfer to the target.

transfer.TransferPhaseAngle()

Returns: Required phase angle in degrees (always betweeen 0 and 180).

Returns the phase angle required to initiate a Hohmann transfer orbit. This is the absolute phase angle, so it does not vary over time when comparing two stable orbits. Use fc.RelativePhaseAngle() to count down to a transfer.

Returns 0 if there is no active target.


This documentation was automatically generated from source code at 12:51 UTC on 16/Jun/2018.