fastoad.models.performances.mission.segments.base module¶
Base classes for simulating flight segments.
-
class
fastoad.models.performances.mission.segments.base.
FlightSegment
(target: fastoad.model_base.flight_point.FlightPoint, propulsion: fastoad.model_base.propulsion.IPropulsion, polar: fastoad.models.performances.mission.polar.Polar, reference_area: float, time_step: float = 0.2, engine_setting: fastoad.constants.EngineSetting = <EngineSetting.CLIMB: 2>, altitude_bounds: tuple = (-500.0, 40000.0), mach_bounds: tuple = (0.0, 5.0), name: str = '', interrupt_if_getting_further_from_target: bool = True)[source]¶ Bases:
fastoad.models.performances.mission.base.IFlightPart
Base class for flight path segment.
As a dataclass, attributes can be set at instantiation.
-
target
: fastoad.model_base.flight_point.FlightPoint¶ A FlightPoint instance that provides parameter values that should all be reached at the end of
compute_from()
. Possible parameters depend on the current segment. A parameter can also be set toCONSTANT_VALUE
to tell that initial value should be kept during all segment.
-
propulsion
: fastoad.model_base.propulsion.IPropulsion¶ A IPropulsion instance that will be called at each time step.
-
polar
: fastoad.models.performances.mission.polar.Polar¶ The Polar instance that will provide drag data.
-
time_step
: float = 0.2¶ Used time step for computation (actual time step can be lower at some particular times of the flight path).
-
engine_setting
: fastoad.constants.EngineSetting = 2¶ The EngineSetting value associated to the segment. Can be used in the propulsion model.
-
altitude_bounds
: tuple = (-500.0, 40000.0)¶ Minimum and maximum authorized altitude values. If computed altitude gets beyond these limits, computation will be interrupted and a warning message will be issued in logger.
-
mach_bounds
: tuple = (0.0, 5.0)¶ Minimum and maximum authorized mach values. If computed Mach gets beyond these limits, computation will be interrupted and a warning message will be issued in logger.
-
interrupt_if_getting_further_from_target
: bool = True¶ If True, computation will be interrupted if a parameter stops getting closer to target between two iterations (which can mean the provided thrust rate is not adapted).
-
CONSTANT_VALUE
= 'constant'¶ Using this value will tell to keep the associated parameter constant.
-
compute_from
(start: fastoad.model_base.flight_point.FlightPoint) → pandas.core.frame.DataFrame[source]¶ Computes the flight path segment from provided start point.
Computation ends when target is attained, or if the computation stops getting closer to target. For instance, a climb computation with too low thrust will only return one flight point, that is the provided start point.
- Parameters
start – the initial flight point, defined for altitude, mass and speed (true_airspeed, equivalent_airspeed or mach). Can also be defined for time and/or ground_distance.
- Returns
a pandas DataFrame where columns names match fields of
FlightPoint()
-
compute_next_flight_point
(flight_points: List[fastoad.model_base.flight_point.FlightPoint], time_step: float) → fastoad.model_base.flight_point.FlightPoint[source]¶ Computes time, altitude, speed, mass and ground distance of next flight point.
- Parameters
flight_points – previous flight points
time_step – time step for computing next point
- Returns
the computed next flight point
-
complete_flight_point
(flight_point: fastoad.model_base.flight_point.FlightPoint)[source]¶ Computes data for provided flight point.
Assumes that it is already defined for time, altitude, mass, ground distance and speed (TAS, EAS, or Mach).
- Parameters
flight_point – the flight point that will be completed in-place
-
-
class
fastoad.models.performances.mission.segments.base.
ManualThrustSegment
(target: fastoad.model_base.flight_point.FlightPoint, propulsion: fastoad.model_base.propulsion.IPropulsion, polar: fastoad.models.performances.mission.polar.Polar, reference_area: float, time_step: float = 0.2, engine_setting: fastoad.constants.EngineSetting = <EngineSetting.CLIMB: 2>, altitude_bounds: tuple = (-500.0, 40000.0), mach_bounds: tuple = (0.0, 5.0), name: str = '', interrupt_if_getting_further_from_target: bool = True, thrust_rate: float = 1.0)[source]¶ Bases:
fastoad.models.performances.mission.segments.base.FlightSegment
,abc.ABC
Base class for computing flight segment where thrust rate is imposed.
- Variables
thrust_rate – used thrust rate. Can be set at instantiation using a keyword argument.
-
class
fastoad.models.performances.mission.segments.base.
RegulatedThrustSegment
(*args, **kwargs)[source]¶ Bases:
fastoad.models.performances.mission.segments.base.FlightSegment
,abc.ABC
Base class for computing flight segment where thrust rate is adjusted on drag.
-
class
fastoad.models.performances.mission.segments.base.
FixedDurationSegment
(target: fastoad.model_base.flight_point.FlightPoint, propulsion: fastoad.model_base.propulsion.IPropulsion, polar: fastoad.models.performances.mission.polar.Polar, reference_area: float, time_step: float = 60.0, engine_setting: fastoad.constants.EngineSetting = <EngineSetting.CLIMB: 2>, altitude_bounds: tuple = (-500.0, 40000.0), mach_bounds: tuple = (0.0, 5.0), name: str = '', interrupt_if_getting_further_from_target: bool = True)[source]¶ Bases:
fastoad.models.performances.mission.segments.base.FlightSegment
,abc.ABC
Class for computing phases where duration is fixed.
Target duration is provide as target.time. When using
compute_from()
, if start.time is not 0, end time will be start.time + target.time.-
time_step
: float = 60.0¶ Used time step for computation (actual time step can be lower at some particular times of the flight path).
-
compute_from
(start: fastoad.model_base.flight_point.FlightPoint) → pandas.core.frame.DataFrame[source]¶ Computes the flight path segment from provided start point.
Computation ends when target is attained, or if the computation stops getting closer to target. For instance, a climb computation with too low thrust will only return one flight point, that is the provided start point.
- Parameters
start – the initial flight point, defined for altitude, mass and speed (true_airspeed, equivalent_airspeed or mach). Can also be defined for time and/or ground_distance.
- Returns
a pandas DataFrame where columns names match fields of
FlightPoint()
-