Tutorial 11 - Missions#
Welcome to this tutorial outlining the mission creation process in RCAIDE. This guide will walk you through the code, explain its components, and highlight where modifications can be made to customize the simulation for different vehicle designs. It breaks down tutorial 01 into smaller sections, although the reader is encouraged to subsequently refer to tutorial 01 for the full context.
1. Header and Imports#
The Imports section is divided into two parts: general-purpose Python libraries and simulation-specific libraries. Here, only the numpy Library, general RCAIDE, and the Units module are imported.
[1]:
import RCAIDE
from RCAIDE.Framework.Core import Units
import numpy as np
Matplotlib created a temporary cache directory at /var/folders/r4/4h9x29hj6f95kyhjsltxc6_00000gn/T/matplotlib-i1geoih0 because the default path (/Users/aidanmolloy/.matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
Fontconfig warning: ignoring UTF-8: not a valid region tag
Matplotlib is building the font cache; this may take a moment.
Missions Setup#
The ``setup`` function creates a missions container that holds a single mission profile. This container allows for the bundling of multiple missions, but only includes the base mission in this tutorial. To add additional missions, define the mission in a function similar to ``mission_setup`` and then append it to the missions container with a new tag.
If multiple missions are added here, they still must be called individually for evaluation.
Note the distinction between mission and missions here. The mission is the actual mission profile, while missions is a container that holds the individual mission profiles. Missions container is subsequently returned by the ``setup`` function.
[2]:
def setup(analyses):
# ------------------------------------------------------------------
# Base Mission
# ------------------------------------------------------------------
mission = mission_setup(analyses)
missions = RCAIDE.Framework.Mission.Missions()
mission.tag = 'base'
missions.append(mission)
return missions
Mission Setup#
The ``mission_setup`` function defines the baseline mission profile used to compute the aircraft’s performance. A mission profile consists of sequential segments that represent different phases of flight, such as climb, cruise, and descent.
Mission Profile and Conditions#
A mission profile is made up of individual flight segments. Each segment specifies the aircraft’s flight conditions, such as:
Altitude
Speed
Range
Time
A segment can also include dynamic flight conditions, including among others:
Acceleration
Climb Rate
Pitch Rate
Roll Rate
These segments are simulated sequentially, allowing for a detailed performance analysis of the vehicle across all phases of flight.
Segments in the Mission Profile#
Common segments in a mission profile include:
Taxi: Ground movement of the aircraft before takeoff and after landing.
Takeoff: Acceleration and lift-off phase with high-lift devices deployed.
Climb: Gradual ascent to cruise altitude, often with reduced flap/slat deployment.
Cruise: Level flight at a constant altitude and speed for fuel-efficient operation.
Descent: Controlled reduction in altitude as the aircraft prepares for landing.
Landing: Final phase of flight with maximum flap and slat deployment for touchdown.
Each segment defines specific performance conditions and parameters, such as speed, altitude, and duration. Selected segments are explained in more detail below, but for more information on the types of segments available, refer to the RCAIDE documentation under RCAIDE/Library/Mission/Segments.
[3]:
def mission_setup(analyses):
"""This function defines the baseline mission that will be flown by the aircraft in order
to compute performance."""
# ------------------------------------------------------------------
# Initialize the Mission
# ------------------------------------------------------------------
mission = RCAIDE.Framework.Mission.Sequential_Segments()
mission.tag = 'the_mission'
Segments = RCAIDE.Framework.Mission.Segments
base_segment = Segments.Segment()
# ------------------------------------------------------------------------------------------------------------------------------------
# Takeoff Roll
# ------------------------------------------------------------------------------------------------------------------------------------
segment = Segments.Ground.Takeoff(base_segment)
segment.tag = "Takeoff"
segment.analyses.extend( analyses.takeoff )
segment.velocity_start = 10.* Units.knots
segment.velocity_end = 125.0 * Units['m/s']
segment.friction_coefficient = 0.04
segment.altitude = 0.0
mission.append_segment(segment)
# ------------------------------------------------------------------
# First Climb Segment: Constant Speed Constant Rate
# ------------------------------------------------------------------
segment = Segments.Climb.Constant_Speed_Constant_Rate(base_segment)
segment.tag = "climb_1"
segment.analyses.extend( analyses.takeoff )
segment.altitude_start = 0.0 * Units.km
segment.altitude_end = 3.0 * Units.km
segment.air_speed = 125.0 * Units['m/s']
segment.climb_rate = 6.0 * Units['m/s']
# define flight dynamics to model
segment.flight_dynamics.force_x = True
segment.flight_dynamics.force_z = True
# define flight controls
segment.assigned_control_variables.throttle.active = True
segment.assigned_control_variables.throttle.assigned_propulsors = [['starboard_propulsor','port_propulsor']]
segment.assigned_control_variables.pitch_angle.active = True
mission.append_segment(segment)
# ------------------------------------------------------------------
# Second Climb Segment: Constant Speed Constant Rate
# ------------------------------------------------------------------
segment = Segments.Climb.Constant_Speed_Constant_Rate(base_segment)
segment.tag = "climb_2"
segment.analyses.extend( analyses.cruise )
segment.altitude_end = 8.0 * Units.km
segment.air_speed = 190.0 * Units['m/s']
segment.climb_rate = 6.0 * Units['m/s']
# define flight dynamics to model
segment.flight_dynamics.force_x = True
segment.flight_dynamics.force_z = True
# define flight controls
segment.assigned_control_variables.throttle.active = True
segment.assigned_control_variables.throttle.assigned_propulsors = [['starboard_propulsor','port_propulsor']]
segment.assigned_control_variables.pitch_angle.active = True
mission.append_segment(segment)
# ------------------------------------------------------------------
# Third Climb Segment: Constant Speed Constant Rate
# ------------------------------------------------------------------
segment = Segments.Climb.Constant_Speed_Constant_Rate(base_segment)
segment.tag = "climb_3"
segment.analyses.extend( analyses.cruise )
segment.altitude_end = 10.5 * Units.km
segment.air_speed = 226.0 * Units['m/s']
segment.climb_rate = 3.0 * Units['m/s']
# define flight dynamics to model
segment.flight_dynamics.force_x = True
segment.flight_dynamics.force_z = True
# define flight controls
segment.assigned_control_variables.throttle.active = True
segment.assigned_control_variables.throttle.assigned_propulsors = [['starboard_propulsor','port_propulsor']]
segment.assigned_control_variables.pitch_angle.active = True
mission.append_segment(segment)
# ------------------------------------------------------------------
# Cruise Segment: Constant Speed Constant Altitude
# ------------------------------------------------------------------
segment = Segments.Cruise.Constant_Speed_Constant_Altitude(base_segment)
segment.tag = "cruise"
segment.analyses.extend( analyses.cruise )
segment.altitude = 10.668 * Units.km
segment.air_speed = 230.412 * Units['m/s']
segment.distance = 1000 * Units.nmi
# define flight dynamics to model
segment.flight_dynamics.force_x = True
segment.flight_dynamics.force_z = True
# define flight controls
segment.assigned_control_variables.throttle.active = True
segment.assigned_control_variables.throttle.assigned_propulsors = [['starboard_propulsor','port_propulsor']]
segment.assigned_control_variables.pitch_angle.active = True
mission.append_segment(segment)
# ------------------------------------------------------------------
# First Descent Segment: Constant Speed Constant Rate
# ------------------------------------------------------------------
segment = Segments.Descent.Constant_Speed_Constant_Rate(base_segment)
segment.tag = "descent_1"
segment.analyses.extend( analyses.cruise )
segment.altitude_start = 10.5 * Units.km
segment.altitude_end = 8.0 * Units.km
segment.air_speed = 220.0 * Units['m/s']
segment.descent_rate = 4.5 * Units['m/s']
# define flight dynamics to model
segment.flight_dynamics.force_x = True
segment.flight_dynamics.force_z = True
# define flight controls
segment.assigned_control_variables.throttle.active = True
segment.assigned_control_variables.throttle.assigned_propulsors = [['starboard_propulsor','port_propulsor']]
segment.assigned_control_variables.pitch_angle.active = True
mission.append_segment(segment)
# ------------------------------------------------------------------
# Second Descent Segment: Constant Speed Constant Rate
# ------------------------------------------------------------------
segment = Segments.Descent.Constant_Speed_Constant_Rate(base_segment)
segment.tag = "descent_2"
segment.analyses.extend( analyses.cruise )
segment.altitude_end = 6.0 * Units.km
segment.air_speed = 195.0 * Units['m/s']
segment.descent_rate = 5.0 * Units['m/s']
# define flight dynamics to model
segment.flight_dynamics.force_x = True
segment.flight_dynamics.force_z = True
# define flight controls
segment.assigned_control_variables.throttle.active = True
segment.assigned_control_variables.throttle.assigned_propulsors = [['starboard_propulsor','port_propulsor']]
segment.assigned_control_variables.pitch_angle.active = True
mission.append_segment(segment)
# ------------------------------------------------------------------
# Third Descent Segment: Constant Speed Constant Rate
# ------------------------------------------------------------------
segment = Segments.Descent.Constant_Speed_Constant_Rate(base_segment)
segment.tag = "descent_3"
segment.analyses.extend( analyses.cruise )
segment.altitude_end = 4.0 * Units.km
segment.air_speed = 170.0 * Units['m/s']
segment.descent_rate = 5.0 * Units['m/s']
# define flight dynamics to model
segment.flight_dynamics.force_x = True
segment.flight_dynamics.force_z = True
# define flight controls
segment.assigned_control_variables.throttle.active = True
segment.assigned_control_variables.throttle.assigned_propulsors = [['starboard_propulsor','port_propulsor']]
segment.assigned_control_variables.pitch_angle.active = True
mission.append_segment(segment)
# ------------------------------------------------------------------
# Fourth Descent Segment: Constant Speed Constant Rate
# ------------------------------------------------------------------
segment = Segments.Descent.Constant_Speed_Constant_Rate(base_segment)
segment.tag = "descent_4"
segment.analyses.extend( analyses.cruise )
segment.altitude_end = 2.0 * Units.km
segment.air_speed = 150.0 * Units['m/s']
segment.descent_rate = 5.0 * Units['m/s']
# define flight dynamics to model
segment.flight_dynamics.force_x = True
segment.flight_dynamics.force_z = True
# define flight controls
segment.assigned_control_variables.throttle.active = True
segment.assigned_control_variables.throttle.assigned_propulsors = [['starboard_propulsor','port_propulsor']]
segment.assigned_control_variables.pitch_angle.active = True
mission.append_segment(segment)
# ------------------------------------------------------------------
# Fifth Descent Segment:Constant Speed Constant Rate
# ------------------------------------------------------------------
segment = Segments.Descent.Constant_Speed_Constant_Rate(base_segment)
segment.tag = "descent_5"
segment.analyses.extend( analyses.landing )
segment.altitude_end = 0.0 * Units.km
segment.air_speed = 145.0 * Units['m/s']
segment.descent_rate = 3.0 * Units['m/s']
# define flight dynamics to model
segment.flight_dynamics.force_x = True
segment.flight_dynamics.force_z = True
# define flight controls
segment.assigned_control_variables.throttle.active = True
segment.assigned_control_variables.throttle.assigned_propulsors = [['starboard_propulsor','port_propulsor']]
segment.assigned_control_variables.pitch_angle.active = True
mission.append_segment(segment)
return mission