WOLFRAM SYSTEM MODELER
IntroductionIntroduction to the theory for modeling the flight of an aircraft and to the contents of the Aircraft library |
SystemModel["Aircraft.Physical.FixedWing.Introduction"]
With the Wolfram System Modeler Aircraft library, you can model and simulate the flight of an aircraft through the atmosphere. The aircraft that can be modeled are fixed-wing aircraft with conventional wing configuration. The user may model existing aircraft designs, for which the geometry, aerodynamic properties and mass properties are well known in detail. Additionally, due to the embedded estimation methods for estimating mass and aerodynamic properties, this library is also well suited for testing aircraft designs in their early design stages when many fewer properties are known.
The motion of the aircraft is modeled for a rigid body with six degrees of freedom, and it includes the flight mechanics phenomena coupling the different linear and angular motions along and around different axes to each other, as well as the dynamics between control actuators and the motion of the aircraft. The library contains two different implementations of these 6DOF flight mechanics models: the state space model consisting of linearized state space models for longitudinal and lateral motions around given reference flight conditions, and the physical model using the Modelica Standard Library Mechanics MultiBody components.
The Aircraft library provides a versatile tool for studying the flight mechanics, controllability of an aircraft and the performance of an aircraft when it comes to fuel efficiency and maneuverability. The parametric nature of the aircraft models serves well for a quick testing of how the changes in some aircraft parameters affect their performance and characteristics. By having this rather quick and easy method for creating a model for aircraft dynamics, studying and designing autopilots for different aircraft designs for different flight conditions are also possible with the library. The drag-and-drop modeling environment also enables setting up multiple different flight scenarios, ranging from modeling an engine failure to a winch launch of a glider aircraft up in the air.
This guide contains a brief introduction of the features in the Aircraft library, its structure, and a very short introduction to the theory behind the aircraft dynamics modeled in the library. The documentation of each component in the library gives a more detailed explanation of its features and relevant theory.
This section includes only a short description of the theory behind the models. To be able to use the Aircraft library and create your own aircraft designs and simulate their flights does not require extensive knowledge about flight dynamics and aerodynamics. However, the standard terminology used in these fields is indeed very helpful to understand the language used in the library. The resources used to create the models are listed in the references, and they work well if one wants to gain more extensive knowledge of the theory applied here.
Aircraft can fly at a large range of altitudes where atmospheric properties vary substantially. Aerodynamic forces and thrust available are functions of air density. Additionally, the local speed of sound influences the flow properties and thereby the aerodynamic forces. Therefore, it is necessary to model the atmospheric properties for a range of altitudes. In the Aircraft library, a static atmosphere as a function of altitude is modeled according to U.S. Standard Atmosphere, 1976 [1], which generates values for atmospheric properties from sea level up to 86,000 m (282,152 ft).
There are two coordinate systems of interest when modeling and simulating a flight: world frame and body frame. The world frame is the inertial coordinate fixed to the Earth and is mostly used to describe the aircraft's position and velocity for navigation. The local body frame, which is fixed to the center of mass of the aircraft, is used in the equations of motion, as it is more convenient for resolving the aerodynamic forces and moments in the body frame. The translation between these axis systems is defined by the position vector r_{0} from world frame origin to body frame origin resolved in the world frame. Figure 1 shows the orientation of the coordinate systems that are followed throughout the library.
Figure 1: The position vector r_{0} from world frame origin to body frame origin.
The Euler angles for roll (φ), pitch (θ) and yaw (ψ) define the rotations between the coordinate systems. The sequence of Euler angle rotations from world frame to body frame is first ψ around world frame z axis, then θ around the rotated y axis and lastly φ around the rotated x axis, as shown in Figure 2.
Figure 2: Sequences of Euler angle rotations from world frame to body frame and the directions of positive Euler angles.
These rotations result in a transformation matrix between the Euler rates (φ dot, θ dot and ψ dot) and the angular velocities of the aircraft resolved in the body frame, namely the roll rate (ṗ), pitch rate (q̇) and yaw rate (ṙ). There is also a transformation matrix between the velocity components in the world frame (v_{x}, v_{y} and v_{z}) and in the body frame (u, v, w). These transformation matrices and their derivations are described further in Reference [2] on pp. 101–103.
Additionally, a third coordinate system fixed to a fixed point in the aircraft geometry and parallel with the body frame is normally used to describe the position of different components in the aircraft. In this library, that fixed point is the fuselage reference point, which is located at the center of the fuselage, as shown in Figure 3.
Figure 3: Location of the fuselage reference point.
The basis of the aircraft dynamics calculations is Newton's second law for linear and angular motion. For linear motion it states that the aerodynamic forces gravity and thrust acting on the aircraft equal the time rate of change of the aircraft's momentum, whereas for angular motion the moments created by aerodynamic forces and thrust acting on the aircraft need to be equal to the time rate of change in angular momentum. These equations for each linear and angular motion are solved using body the frame of reference, and the stability and control derivatives are used to couple the effects between different motions and control actions as well as to describe the damping effects. Chapter 3 in Reference [2] has the complete derivation of aircraft equations of motion for a rigid 6DOF body.
The aircraft models are based on the given physical and aerodynamic properties. For the physical and state space aircraft models, there are a number of components in their respective Physical.FixedWing.Parts and StateSpace.FixedWing.Blocks packages, which are used to create the complete aircraft models to be used in their respective modeling environments, namely the Physical.FixedWing.Interfaces.AircraftBase and StateSpace.FixedWing.DefaultAircraft base models. The base aircraft models are without the parameter values, and thus they are extended by the complete aircraft models with the parameter values for a specific aircraft design.
Several parameters describing the aircraft geometry, propulsion, aerodynamic properties and mass properties are required to model the aircraft. Due to the many couplings between the properties of different aircraft components, almost all parameters are declared at the top-level aircraft models, from where they are propagated down to the components models where they are needed. The amount and the level of detail of the parameters vary between the state space and physical modeling environments. For example, the state space aircraft models require zero lift drag coefficient of the entire aircraft and lift curve slopes of the entire wings as input parameters, whereas the physical aircraft models estimate the values of both properties based on aircraft geometry and the lift curve slopes of the 2D airfoils used in the wings. Furthermore, the physical aircraft model includes an embedded weight estimation method, which may be used to estimate the mass properties, and thus the number of required parameters is reduced much more.
In both aircraft models, the parameters are divided into different categories, which are represented by the parameter tabs, to help fill them. The categories differ slightly between the state space and physical aircraft models. In the state space model, a category called Derived Properties estimates the values of some properties that are by default estimated based on other parameters. These can be overwritten and thus bypass the estimation equations if more information is available on the model. In the case of physical fixed wing, these estimated parameters appear in their respective tabs.
The initialization for position, orientation and velocity is declared for both aircraft models as parameters in the Initialization parameter tab. For the state space model, only the position, total velocity and flight path angle are initialized by the user, and the initial pitch angle for trimmed condition is calculated by the model. All other angles and angular velocities always start from zero in the state space model. For the physical model, the orientation, position and angular velocities, as well as the orientation of the total velocity, are all initialized by the user.
In order to test an aircraft for a flight mission, a controller is required to steer the control actuators for keeping the aircraft on the assigned flight trajectory. This library includes autopilot models in the Autopilots package, which will translate the signals of the desired flight altitude, flight speed and track angle into command signals for elevator, ailerons, rudder and throttle with feedback of flight data from the aircraft. Thus, the aircraft performance can be tested for a large range of different flight missions.
While the state space model is a linear model of the flight dynamics and is accurate only near the reference flight conditions, the physical model is a nonlinear model built with the Modelica Standard Library MultiBody components, and it models the flight dynamics accurately in a much broader domain. The flight dynamics in the physical model are also based on the stability and control coefficients (and consequently their corresponding dimensional derivatives) as they are presented by Nelson [2]. However, most of their effects emerge naturally when using the MultiBody components and thus are not present inside the equations in the physical model components. One such example is the coefficient for pitch moment due to elevator deflection (C_{m,δ}_{e}), as the change in the aerodynamic forces of the horizontal tail automatically creates a pitch moment due to its translation from the aircraft center of mass.
The physical aircraft model consists of three submodels for the mass properties, aerodynamic forces and the propulsion, which are described in this section. Additionally, the embedded weight estimation method in the physical model for modeling an aircraft with fewer known parameters is presented in this section.
If the weight estimation method is not used, and the known mass properties of the aircraft are entered as parameters to the aircraft model, the aircraft without the contribution from the variable fuel mass is modeled as a one rigid body, for which the Physical.FixedWing.Parts.Bodies.Body model is used. For aircraft with combustion engines, the variable mass properties of the fuel are modeled in the tank system model, which is described further in the propulsion section.
If the weight estimation method is used, the mass properties of each component are estimated in their respective models, meaning that only the mass properties of the fuselage structure, the systems installed onboard, payload and landing gear are estimated in the Body model.
The Body model also generates the cylinder shape for visualizing the fuselage in animations. Additionally, the deviation of the gravitational acceleration from its value at sea level to its value at flight altitude and the consequent change in gravitational force is modeled in the Body model as a force acting upward along the world z axis on the aircraft center of mass.
The aerodynamic forces are modeled for wing-body (combination of main wing and fuselage), ailerons, horizontal tail and vertical tail in their respective models in the Physical.FixedWing.Parts.Surfaces.Components package. From these models, the entire aerodynamic model is compiled in the Physical.FixedWing.Parts.Surfaces.Conventional model for the aerodynamic forces with a conventional wing configuration. The translations of the aerodynamic centers of each surface from the fuselage reference point are adjusted automatically based on the Geometry parameters given in the top-level aircraft model. Similarly, the geometry parameters are used inside the surface models to define roughly the shapes of main wing, tail and control surfaces for animation. In the animation, the control surfaces will also deflect according to their actual deflection angle values.
The magnitude and orientation of the aerodynamic forces acting on each surface are based on the aerodynamic properties of the 2D airfoils and the geometry of the surfaces given in the aircraft model as parameters, the angle of attack α (sideslip angle β for vertical tail) and the properties of the free stream. Stall is also modeled for the main wing and horizontal tail, and the stall model is explained in detail in the documentation for Physical.FixedWing.Parts.Surfaces.Components.WingBody and Physical.FixedWing.Parts.Surfaces.Components.HorizontalTail models. The changes in relative velocities and angles of the free stream seen by the different surfaces due to angular velocities of the aircraft are considered to model the flight mechanics phenomena coupling the different motions of the aircraft.
One such example is illustrated in Figure 4, showing the induced axial velocities (Δu) seen by the main wing and induced sideslip angle (Δβ) due to induced side velocity (Δv) seen by the vertical tail due to yaw rate (r). The consequent differential lift in the main wing will cause a positive roll moment. The consequent side force in the vertical tail will damp the yaw motion while contributing to the positive roll moment. The stability coefficient used in the Physical.FixedWing.Parts.Surfaces.Components.WingBody model for this motion coupling is C_{l,r} (roll moment due to r). However, C_{l,r} also includes the vertical tail contribution to the coupling and that is thus removed in the WingBody model. In the Physical.FixedWing.Parts.Surfaces.Components.VerticalTail model, Δβ is calculated first and then added to β. When this summed sideslip angle is multiplied by C_{y,β} (side force due to β) among the other multipliers to resolve the side force magnitude, the contribution to both roll and yaw moments occurs automatically due to the translation of the vertical tail aerodynamic center from the aircraft center of mass.
Figure 4: Induced axial velocities (Δu) seen by the main wing and induced sideslip angle (Δβ) seen by the vertical tail due to yaw rate (r).
To be precise, the induced side force of the vertical tail also creates a pitch down moment, as the side force does not act purely along the y_{b }axis but by being an aerodynamic force, it always acts perpendicular to the freestream, thus also having a component along the positive x_{b }axis. This creates another coupling between the longitudinal and lateral motions (although a very small one) that does not exist in the state space model.
For the horizontal and vertical tail models, the contributions from control surfaces, i.e. elevator and rudder, are integrated into the calculations of their aerodynamic forces, whereas the ailerons have their dedicated model to calculate their contribution to the aerodynamic forces.
The propulsion component of the complete physical aircraft model is a replaceable model, which is first to be redeclared as the correct propulsion type listed in the Physical.FixedWing.Parts.Propulsions package based on the engine type (turbofan, turbojet, turboprop, piston and electric engines). Additionally, a custom propulsion combining different engine types can be created, as is done in the model for Hawker Siddeley HS-121 Trident 3B. However, if the number of engines set in the aircraft model is zero, the entire propulsion component is disabled.
The propulsion models for different engine types compile a propulsion model using that engine type in all engines, but each engine can be individually set to any engine model within the set engine type. The position and orientation around the y_{b }axis of the engines is defined by the Propulsion parameters in the propulsion models. Figure 5 shows the diagram view of the propulsion component with the Propulsion parameters for Boeing 737-800.
Figure 5: The diagram view of the propulsion component for the Boeing 737-800 model.
On an engine level, each engine model calculates the thrust available as a function of the parameter for the engine's static thrust at sea level, the atmospheric properties at current altitude and flight speed. The net thrust force of each engine is then the product of thrust available and throttle position, which ranges from 0 to 1. The input control signal for the throttle position adjusts its dimension to match the number of engines, and thus each engine may be controlled individually. The engine models also calculate their fuel (or electric energy for electric engines) consumption based on the given parameters for efficiency.
The propulsion model includes a model for the energy storage, which is either a Physical.FixedWing.Parts.Propulsions.EnergyStorages.TankSystem model for aircraft with combustion engines or a Physical.FixedWing.Parts.Propulsions.EnergyStorages.BatterySystem model for electric aircraft. For the tank system model, the mass and inertia tensors vary with the consumed fuel mass, and its center of mass location and inertia tensor are estimated regardless of whether the weight estimation method is used or not. Both energy storage models calculate the total gross power used by all engines.
If the mass properties of an aircraft design are not known, the weight estimation method triggered by the weightEst parameter in the physical aircraft model may be used to estimate the mass properties (mass, center of mass location and inertia tensor) component by component. For estimating the mass properties of different components, empirical relationships are used to derive the mass properties from aircraft geometry and a few design variables. The empirical relationships are presented in more detail in the documentation for the corresponding components and in Chapter 3 in Reference [3].
The physical aircraft model supports the use of the weight estimation method. The weightEst parameter in the Mass and Inertia tab of the newly created aircraft model, which extends the Physical.FixedWing.Interfaces.AircraftBase model, can be used to enable the weight estimation method. The method uses empirical relationships to estimate the mass properties based on the aircraft geometry and a few design variables.
The mass properties are estimated component by component, including the engines. However, if an engine model with a known mass is used, its mass is not estimated; the known value is used instead. The Engine parameter in the propulsion component may be set to one of the unparameterized models according to the chosen propulsion type to let the weight estimation method also estimate the engine mass properties based on the given static thrust (Tstatic) or power at sea level (Psealevel) parameter value.
The design variable parameters to be entered when using the weight estimation method include design maximum takeoff mass (m_{mto,des}, MTOMdes), number of passengers (nPax), design payload mass (mPLdes), design Mach number (machDes) and a parameter for indicating whether composite materials are used in the structures or not (compMat). Additionally, constraints for maximum dynamic pressure (qMax) and maximum load factor (nMax) are required.
Figure 6 shows the proposed workflow to be followed when using the weight estimation method in aircraft sizing. As the aircraft library currently does not guide the user in creating an aircraft geometry from scratch, it is advised to be generated by using other tools, or by entering and later adjusting the geometry of an existing aircraft with similar characteristics to the aircraft design to be modeled. After the design variables, constraints and geometry parameters are entered into the model, a flight mission for the desired maximum range should be generated. To enter a flight mission for the Autopilots models, timetables of altitudes, flight speeds and track angles are required, for which, for example, the historic flight data of real flights found in different flight tracking services may be used. Creating a model to simulate a flight controlled by an autopilot is described in the next section.
The results from the simulation are used in an iterative process to adjust the parameters such that the four conditions shown in Figure 6 are satisfied. An example of using the weight estimation method in the Aircraft library for aircraft sizing is presented in section 3.7 in Reference [3]. Additionally, in the WeightEstimation example, the effect of adjusting the design variables and constraints to aircraft mass can be explored.
Figure 6: Proposed workflow to be followed when using weight estimation method in aircraft sizing. [3]
With the weight estimation method, the aircraft is modeled as a rigid MultiBody system with each component represented by its dedicated MultiBody component, in which the Newton–Euler equations are solved. There is a possibility to overwrite the equations for estimating any mass property of any component by entering a known value in the Estimated Properties parameter tab in the respective component. To solve the values of the mass properties of the entire aircraft, the equations to do so are written in the Physical.FixedWing.Interfaces.AircraftBase model.
The state space model consists of two independent linear state space models for longitudinal and lateral motions resolved in the local body frame. The linearization is done over reference flight conditions, and the states, inputs and outputs are perturbations from the reference flight conditions. The state space model is suitable for studying the responses to small perturbations in control surface deflections and throttle position. Additionally, by being a linearized model, it is a practical environment to design autopilots and other control systems.
The state space representations for both longitudinal and lateral motions are in the following form:
where x is the state vector and η is the control vector consisting of different perturbation components, which are described in Table 1. The matrices A and B contain the stability and control derivatives, respectively. The output vector y consists of the three first components of x in Table 1. The stability and control derivatives are products of the nondimensional stability and control coefficients and various combinations of the aircraft, reference velocity and the freestream properties, which are all time invariant in the linearized model. Their derivations are described in detail in Chapter 3 in Reference [2].
Table 1: Perturbation components of state and control vectors in state space representation of longitudinal and lateral motions.
Vector | Longitudinal motion | Lateral motion |
x | Δu axial velocity | Δv side velocity |
Δw normal velocity | Δp roll rate | |
Δq pitch rate | Δr yaw angle | |
Δθ pitch angle | Δφ roll angle | |
η | Δδ_{e} elevator deflection | Δδ_{a} ailerons deflection |
Δδ_{T} throttle position | Δδ_{r} rudder deflection |
The process of deriving the stability and control derivatives, compiling the state space representations of longitudinal and lateral motions and solving for the aerodynamic forces and moments in the state space aircraft model is described in the documentation for the StateSpace.FixedWing.DefaultAircraft model.
As mentioned in the previous sections, the linearization of the state space representations is done around the reference flight conditions. In the state space model, these conditions are the trimmed flight conditions for steady flight, and they are calculated inside the StateSpace.FixedWing.Blocks.TrimCalculator block for any given total velocity (V_{tot}), altitude (h) and climb angle (γ) for the aircraft to be modeled. The outputs from the TrimCalculator block are the reference values for the state and control vectors x and η, around which the perturbations are defined.
The StateSpace.FixedWing.Blocks.PositionAndOrientation block does the conversion from velocity perturbations in the body frame (Δu, Δv, Δw, Δp, Δq and Δr) and the reference flight conditions into absolute values of all velocities resolved in both coordinate systems, as well as calculates the position and orientation of the aircraft. The StateSpace.FixedWing.Blocks.Body2Fixed component inside the PositionAndOrientation block contains calculations with the transformation matrices mentioned in the Coordinate Systems section to resolve the Euler angles (φ, θ and ψ) and velocities in world frame (v_{x}, v_{y} and v_{z}) from the absolute linear (u, v, w) and angular velocities (p, q, r) resolved in the body frame.
The strength of this library is indeed its realistic modeling of the flight mechanics and the ease of testing early aircraft designs with few known properties for a range of different flight missions. However, there are some simplifications, which narrow down the domain in which the models work realistically and accurately.
The air compressibility effects are considered in the calculations for aerodynamic forces, but they are realistic only in the subsonic regime (≤ Mach 0.8). Beyond Mach 0.8, the fidelity of the model is compromised, and currently supersonic speeds cannot be modeled at all. In flight dynamics, the effects of the time derivatives of velocities, of which the most important is the axial acceleration (u̇), are not modeled. This is, however, not that significant in passenger aircraft or gliders where the accelerations are not that high.
The library currently has no models for the secondary controls, i.e. flaps, slats and spoilers. The landing gear is not modeled, thus takeoffs and landings cannot be simulated
These simplifications affect the accuracy and the allowable test scenarios of the models, but there are also some limitations that constrain the type of aircraft that can be modeled with this library. Currently, only fixed-wing aircraft with conventional wing configuration can be modeled. The shape of the wings is constrained to simple trapezoids with constant incidence angles along the span, and no dihedral angle can be applied for the horizontal tail. Furthermore, the incidence angle of the horizontal tail is also fixed and cannot be trimmed during flight.
The state space model is much more limited than the physical model. First, it lacks the features that would not be relevant in a linearized model, namely the model for variable mass properties as the fuel gets burned, and the model for varying lift and drag coefficients with Mach number. Furthermore, the state space model lacks the equations to estimate aerodynamic coefficients from aircraft geometry and the properties of the 2D airfoils, so the lift coefficient and zero lift drag coefficients of the entire aircraft need to be entered instead. The weight estimation method is also not available in the state space model.
[1] United States National Oceanic and Atmospheric Administration and United States Air Force. (1976). U.S. Standard Atmosphere 1976 (Vol. 76, No. 1562). National Oceanic and Atmospheric Administration. Available at: https://www.ngdc.noaa.gov/stp/space-weather/online-publications/miscellaneous/us-standard-atmosphere-1976.
[2] Nelson, R. C. (1998). Flight Stability and Automatic Control. 2nd ed. McGraw-Hill
[3] Erä-Esko, N. (2022). Development and Use of System Modeler 6DOF Flight Mechanics Model in Aircraft Conceptual Design. Available at: modelica://Aircraft/Resources/Documents/EraeEskoThesis.pdf.
[4] Cook, M. A. (2012). Flight Dynamics Principles. 2nd ed. Butterworth Heinemann.