Get Started with Fixed-Wing Aircraft
This example shows how to create and use fixed-wing aircraft in MATLAB®.
For an example of setting realistic coefficients on an aircraft and calculating static stability, see Determine Static Stability of Fixed-Wing Aircraft.
For an example of importing coefficients from Digital DATCOM analysis and linearizing to a state-space model, see Analyze State-Space Model for Linear Control and Static Stability Analysis.
For an example of creating custom states, see Customize Fixed-Wing Aircraft with Additional Aircraft States.
What Is a Fixed-Wing Aircraft?
A fixed-wing aircraft generates lift using stationary wings and requires forward motion, typically provided by a propeller or jet engine, for flight. Standard configurations include a main wing and stabilizers for control and stability.
Fixed-Wing Aircraft Construction Workflow
The construction of a fixed-wing aircraft model requires these components:
Aircraft configuration definition (aerodynamic and control surfaces, thrust)
Numerical model specification (coefficients)
Current state setting (mass, speed, etc.)
This example follows this workflow to illustrate how to construct a fixed-wing aircraft application for numerical analysis in MATLAB.
Fixed-Wing Aircraft Configuration
This example constructs a standard-configuration aircraft with ailerons, elevators, and a rudder using the fixedWingSurface function. Each surface object specifies properties such as controllability, symmetry, and deflection limits. A surface can also include nested surfaces.
For this aircraft, the aileron is defined as an asymmetric control surface with deflection limits of -20 to 20 degrees.
aileron = fixedWingSurface("aileron", "on", "Asymmetric", [-20, 20])
aileron =
Surface with properties:
Surfaces: [1×0 Aero.FixedWing.Surface]
Coefficients: [1×1 Aero.FixedWing.Coefficient]
MaximumValue: 20
MinimumValue: -20
Controllable: on
Symmetry: "Asymmetric"
ControlVariables: ["aileron_1" "aileron_2"]
Properties: [1×1 Aero.Aircraft.Properties]
Elevator and rudder surfaces are similarly defined, but as symmetric control surfaces.
elevator = fixedWingSurface("elevator", "on", "Symmetric", [-20, 20]); rudder = fixedWingSurface("rudder", "on", "Symmetric", [-20, 20])
rudder =
Surface with properties:
Surfaces: [1×0 Aero.FixedWing.Surface]
Coefficients: [1×1 Aero.FixedWing.Coefficient]
MaximumValue: 20
MinimumValue: -20
Controllable: on
Symmetry: "Symmetric"
ControlVariables: "rudder"
Properties: [1×1 Aero.Aircraft.Properties]
In addition to control surfaces, define a thrust vector using the fixedWingThrust function. Here, a single symmetric thrust vector (e.g., propeller) is assumed, with a control range from 0 to 0.75. Note that thrust objects are controllable by default, while surface objects are not.
propeller = fixedWingThrust("propeller","on","Symmetric",[0, 0.75])
propeller =
Thrust with properties:
Coefficients: [1×1 Aero.FixedWing.Coefficient]
MaximumValue: 0.7500
MinimumValue: 0
Controllable: on
Symmetry: "Symmetric"
ControlVariables: "propeller"
Properties: [1×1 Aero.Aircraft.Properties]
Next, create the aircraft object with reference area, span, and length set to 3, 2, and 1, respectively. The reference quantities dimensionalize nondimensional coefficients in the analysis methods.
aircraft = fixedWingAircraft("MyAircraft", 3,2,1);Attach the defined surfaces and thrust vector to the aircraft.
aircraft.Surfaces = [aileron, elevator, rudder]; aircraft.Thrusts = propeller
aircraft =
FixedWing with properties:
ReferenceArea: 3
ReferenceSpan: 2
ReferenceLength: 1
Coefficients: [1×1 Aero.FixedWing.Coefficient]
DegreesOfFreedom: "6DOF"
Surfaces: [1×3 Aero.FixedWing.Surface]
Thrusts: [1×1 Aero.FixedWing.Thrust]
AspectRatio: 1.3333
Properties: [1×1 Aero.Aircraft.Properties]
UnitSystem: "Metric"
TemperatureSystem: "Kelvin"
AngleSystem: "Radians"
At this stage, the aircraft structure is complete, but it uses default numerical coefficients that are set to zero. To perform meaningful analysis, assign appropriate aerodynamic and thrust coefficients in the next step.
Fixed-Wing Aircraft Numerical Modeling
To perform numerical modeling using the fixed-wing aircraft object, define coefficients that represent the aircraft dynamic behavior at various operating states.
Obtain coefficients through various methods, such as Digital DATCOM, CFD analysis, or first-principle calculations. If using Digital DATCOM, you can convert its output directly with datcomToFixedWing. Alternatively, you can manually assign coefficients to the aircraft and its components.
Coefficients are stored at multiple levels:
Aircraft body for baseline aerodynamics
Each control surface for control-induced effects
Each thrust vector for propulsion effects
All these contributions are summed to determine the total forces and moments, which drive the aircraft dynamics.
Use the fixedWingCoefficient function to define coefficient properties, such as the reference frame (e.g., "Body" or "Wind"), dimensionality, and state variable dependencies.
Set and retrieve coefficient values using setCoefficient and getCoefficient. For example, to set the lift coefficient slope with respect to angle of attack:
CL_alpha = 0.2; aircraft = setCoefficient(aircraft, "CL", "Alpha", CL_alpha);
To view or retrieve coefficients:
getCoefficient(aircraft, "CL", "Alpha")
ans = 0.2000
aircraft.Coefficients.Table
ans=6×9 table
Zero U Alpha AlphaDot Q Beta BetaDot P R
____ _ _____ ________ _ ____ _______ _ _
CD 0 0 0 0 0 0 0 0 0
CY 0 0 0 0 0 0 0 0 0
CL 0 0 0.2 0 0 0 0 0 0
Cl 0 0 0 0 0 0 0 0 0
Cm 0 0 0 0 0 0 0 0 0
Cn 0 0 0 0 0 0 0 0 0
You can also assign coefficients to specific components by name. For example, to set the zero-lift elevator coefficient:
CL_0_elevator = 0.15; aircraft = setCoefficient(aircraft, "CL", "Zero", CL_0_elevator, Component="elevator"); aircraft.Surfaces(2).Coefficients.Table
ans=6×1 table
Zero
____
CD 0
CY 0
CL 0.15
Cl 0
Cm 0
Cn 0
You can also define coefficients as functions of multiple state variables.
coeff = fixedWingCoefficient(["Alpha", "Beta"]); coeff = setCoefficient(coeff, "CL", "Alpha", 5); coeff = setCoefficient(coeff, "CY", "Beta", 2); coeff.Table
ans=6×2 table
Alpha Beta
_____ ____
CD 0 0
CY 0 2
CL 5 0
Cl 0 0
Cm 0 0
Cn 0 0
After setting the necessary coefficients, you can proceed to define the aircraft’s current state for further analysis.
Fixed-Wing Aircraft States
The current state of a fixed-wing aircraft describes properties that can change during flight, such as mass, inertia, airspeed, altitude, and control surface deflections. By separating state from configuration, you can analyze the same aircraft model under different flight conditions without redefining its structure.
Define fixed-wing aircraft states using the fixedWingState function.
state = fixedWingState(aircraft, "Mass", 500, "AltitudeMSL", 2000, "Airspeed", 70)
state =
State with properties:
Mass: 500
Inertia: [3×3 table]
CenterOfGravity: [0 0 0]
CenterOfPressure: [0 0 0]
AltitudeMSL: 2000
GroundHeight: 0
XN: 0
XE: 0
XD: -2000
U: 70
V: 0
W: 0
Airspeed: 70
Phi: 0
Theta: 0
Psi: 0
P: 0
Q: 0
R: 0
Alpha: 0
Beta: 0
AlphaDot: 0
BetaDot: 0
Weight: 4905
AltitudeAGL: 2000
GroundSpeed: 70
MachNumber: 0.2057
BodyVelocity: [70 0 0]
GroundVelocity: [70 0 0]
Ug: 70
Vg: 0
Wg: 0
FlightPathAngle: 0
CourseAngle: 0
InertialToBodyMatrix: [3×3 double]
BodyToInertialMatrix: [3×3 double]
BodyToWindMatrix: [3×3 double]
WindToBodyMatrix: [3×3 double]
BodyToStabilityMatrix: [3×3 double]
StabilityToBodyMatrix: [3×3 double]
DynamicPressure: 3.0012e+03
Environment: [1×1 Aero.Aircraft.Environment]
ControlStates: [1×6 Aero.Aircraft.ControlState]
OutOfRangeAction: "Limit"
DiagnosticAction: "Warning"
Properties: [1×1 Aero.Aircraft.Properties]
UnitSystem: "Metric"
TemperatureSystem: "Kelvin"
AngleSystem: "Radians"
State properties correspond to the variable names used in the coefficient definitions (e.g., Alpha, Beta, P, Q, R). When MultiplyStateVariables is enabled, each coefficient is automatically multiplied by the corresponding property in the state.
Some state properties might depend on environmental conditions, such as atmospheric model or altitude. You can define the environment using the aircraftEnvironment function and assign it to the state:
environment = aircraftEnvironment(aircraft, "ISA", 0)environment =
Environment with properties:
WindVelocity: [0 0 0]
Density: 1.2250
Temperature: 288.1500
Pressure: 101325
SpeedOfSound: 340.2940
Gravity: 9.8100
Properties: [1×1 Aero.Aircraft.Properties]
state.Environment = environment;
Ensure that the environment and state use consistent units.
To analyze the aircraft over a range of conditions, you can create arrays of state objects. For example, to sweep mass values while holding airspeed constant:
mass = num2cell(1000:50:1500);
state = fixedWingState(aircraft, Airspeed=100);
states = repmat(state, size(mass));
[states.Mass] = mass{:}states=1×11 State array with properties:
Mass
Inertia
CenterOfGravity
CenterOfPressure
AltitudeMSL
GroundHeight
XN
XE
XD
U
V
W
Airspeed
Phi
Theta
Psi
P
Q
R
Alpha
Beta
AlphaDot
BetaDot
Weight
AltitudeAGL
GroundSpeed
MachNumber
BodyVelocity
GroundVelocity
Ug
Vg
Wg
FlightPathAngle
CourseAngle
InertialToBodyMatrix
BodyToInertialMatrix
BodyToWindMatrix
WindToBodyMatrix
BodyToStabilityMatrix
StabilityToBodyMatrix
DynamicPressure
Environment
ControlStates
OutOfRangeAction
DiagnosticAction
Properties
UnitSystem
TemperatureSystem
AngleSystem
Similarly, you can generate states at multiple altitudes with a standard atmosphere model:
statesH = fixedWingState(aircraft, aircraftEnvironment(aircraft, "ISA", [0, 1000, 2000]))statesH=1×3 State array with properties:
Mass
Inertia
CenterOfGravity
CenterOfPressure
AltitudeMSL
GroundHeight
XN
XE
XD
U
V
W
Airspeed
Phi
Theta
Psi
P
Q
R
Alpha
Beta
AlphaDot
BetaDot
Weight
AltitudeAGL
GroundSpeed
MachNumber
BodyVelocity
GroundVelocity
Ug
Vg
Wg
FlightPathAngle
CourseAngle
InertialToBodyMatrix
BodyToInertialMatrix
BodyToWindMatrix
WindToBodyMatrix
BodyToStabilityMatrix
StabilityToBodyMatrix
DynamicPressure
Environment
ControlStates
OutOfRangeAction
DiagnosticAction
Properties
UnitSystem
TemperatureSystem
AngleSystem
Fixed-Wing Analysis Methods
Once the aircraft and its states are defined, you can perform various analyses, including:
Force and moment calculation
Nonlinear dynamics simulation
Static stability assessment
System linearization for state-space modeling
For example, to compute forces, moments, and nonlinear dynamics across a range of states:
F = zeros(numel(states), 3); M = zeros(numel(states), 3); dydt = zeros(numel(states), 12); for i = 1:numel(states) [F(i,:), M(i,:)] = forcesAndMoments(aircraft, states(i)); dydt(i,:) = nonlinearDynamics(aircraft, states(i)); end
The fixed-wing object can also serve as a container for the aircraft definition, making it easy to integrate into Simulink lookup tables or custom MATLAB analysis workflows.
In summary, MATLAB fixed-wing aircraft offer a streamlined approach for modeling, simulating, and analyzing aircraft behavior within a unified framework.
See Also
fixedWingAircraft | fixedWingCoefficient | fixedWingState | fixedWingSurface | aircraftEnvironment | fixedWingThrust