fastoad.models.performances.mission.segments.altitude_change module

Classes for climb/descent segments.

class fastoad.models.performances.mission.segments.altitude_change.AltitudeChangeSegment(name: str = '', target: ~fastoad.model_base.flight_point.FlightPoint = <object object>, isa_offset: float = 0.0, propulsion: ~fastoad.model_base.propulsion.IPropulsion = <object object>, polar: ~fastoad.models.performances.mission.polar.Polar = <object object>, reference_area: float = <object object>, time_step: float = 2.0, altitude_bounds: tuple = (-500.0, 40000.0), mach_bounds: tuple = (0.0, 5.0), interrupt_if_getting_further_from_target: bool = True, engine_setting: ~fastoad.constants.EngineSetting = EngineSetting.CLIMB, thrust_rate: float = 1.0, maximum_flight_level: float = 500.0)[source]

Bases: AbstractManualThrustSegment

Computes a flight path segment where altitude is modified with constant speed.


Setting speed

Constant speed may be:

  • constant true airspeed (TAS)

  • constant equivalent airspeed (EAS)

  • constant Mach number

Target should have "constant" as definition for one parameter among true_airspeed, equivalent_airspeed or mach. All computed flight points will use the corresponding start value. The two other speed values will be computed accordingly.

If not “constant” parameter is set, constant TAS is assumed.


Setting target

Target can be an altitude, or a speed:

  • Target altitude can be a float value (in meters), or can be set to:

    • OPTIMAL_ALTITUDE: in that case, the target altitude will be the altitude where maximum lift/drag ratio is achieved for target speed, depending on current mass.

    • OPTIMAL_FLIGHT_LEVEL: same as above, except that altitude will be rounded to the nearest flight level (multiple of 100 feet).

  • For a speed target, as explained above, one value TAS, EAS or Mach must be "constant". One of the two other ones can be set as target.

In any case, the achieved value will be capped so it respects maximum_flight_level.

time_step: float = 2.0

Used time step for computation (actual time step can be lower at some particular times of the flight path).

maximum_flight_level: float = 500.0

The maximum allowed flight level (i.e. multiple of 100 feet).

OPTIMAL_ALTITUDE = 'optimal_altitude'

Using this value will tell to target the altitude with max lift/drag ratio.

OPTIMAL_FLIGHT_LEVEL = 'optimal_flight_level'

Using this value will tell to target the nearest flight level to altitude with max lift/drag ratio.

compute_from_start_to_target(start: FlightPoint, target: FlightPoint) DataFrame[source]

Here should come the implementation for computing flight points between start and target flight points.

  • start

  • target – Definition of segment target


a pandas DataFrame where column names match fields of FlightPoint

get_distance_to_target(flight_points: List[FlightPoint], target: FlightPoint) float[source]

Computes a “distance” from last flight point to target.

Computed does not need to have a real meaning. The important point is that it must be signed so that algorithm knows on which “side” of the target we are. And of course, it should be 0. if flight point is on target.

  • flight_points – list of all currently computed flight_points

  • target – segment target (will not contain relative values)


  1. if target is attained, a non-null value otherwise

get_gamma_and_acceleration(flight_point: FlightPoint) Tuple[float, float][source]

Computes slope angle (gamma) and acceleration.


flight_point – parameters after propulsion model has been called (i.e. mass, thrust and drag are available)


slope angle in radians and acceleration in m**2/s

property target: FlightPoint

The most base type