Main Content

Aero.FixedWing.State Class

Namespace: Aero

Define condition of Aero.FixedWing aircraft at time instant

Since R2021a

Description

Use the Aero.FixedWing.State class to define the condition of an Aero.FixedWing aircraft at a time instant. The Aero.FixedWing.State object contains the information about the current state of an aircraft at a single instance in time. A subclass can inherit the Aero.FixedWing.State.

  • To get dependent properties defined by subclass, use the getState method.

  • To set dependent properties, use the setState method.

  • To use custom state properties within the Aero.FixedWing object methods, create a subclass.

Class Attributes

Sealed
false

For information on class attributes, see Class Attributes.

Creation

Description

Aero.FixedWing.State creates a single Aero.FixedWing.State object with default property values..

Aero.FixedWing.State(N) creates an N-by-N matrix of Aero.FixedWing.State.

Aero.FixedWing.State(M,N,P,...) or Aero.FixedWing.State([M N P ...]) creates an M-by-N-by-P-by-... array of Aero.FixedWing.State.

Aero.FixedWing.State(size(A)) creates an Aero.FixedWing.State object that is the same size as A and all Aero.FixedWing.State objects.

Aero.FixedWing.State(__,property,propertyValue) creates an array of Aero.FixedWing.State objects with property, propertyValue pairs applied to each of the Aero.FixedWing array objects. For a list of properties, see Properties.

example

Input Arguments

expand all

Number of fixed-wing objects, specified as a scalar.

Number of fixed-wing objects, specified as a scalar.

Number of fixed-wing objects, specified as a scalar.

Size of fixed-wing object, specified as a scalar.

Properties

expand all

Public Properties

Unit system, specified as a scalar string or character vector.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Angle system, specified as 'Radians' or 'Degrees'.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Temperature system, specified as 'Kelvin', 'Celsius', 'Rankine', or 'Fahrenheit'.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Fixed-wing aircraft mass, specified as a scalar numeric, in the units:

UnitUnit System

newtons (N)

'Metric'

slugs (slug)

'English (kts)' and 'English (ft/s)'

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Inertial matrix of aircraft, specified as a 3-by-3 table of numeric values specifying the body in this matrix form:

 XYZ
XIxxIxyIxz
YIyxIyyIyz
ZIzxIzyIzz

The matrix has these units:

UnitUnit System

kilogram meters squared (kg m^2)

'Metric'

slug feet squared (slug ft^2)

'English (kts)' and 'English (ft/s)'

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Location of center of gravity on the fixed-wing aircraft in the body frame, specified as a three-element vector in these units:

UnitUnit System

Meters (m)

'Metric'

Feet (ft)

'English (kts)' and 'English (ft/s)'

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Location of center of pressure on the fixed-wing aircraft in the body frame, specified as a three-element vector, in these units:

UnitUnit System

Meters (m)

'Metric'

Feet (ft)

'English (kts)' and 'English (ft/s)'

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Altitude above sea level, specified as a scalar numeric, in these units:

UnitUnit System

Meters (m)

'Metric'

Feet (ft)

'English (kts)' and 'English (ft/s)'

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Ground height above sea level, specified as a scalar numeric in these units:

UnitUnit System

Meters (m)

'Metric'

Feet (ft)

'English (kts)' and 'English (ft/s)'

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

North position of fixed-wing aircraft, specified as a scalar numeric in these units:

UnitUnit System

Meters (m)

'Metric'

Feet (ft)

'English (kts)' and 'English (ft/s)'

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

East position of fixed-wing aircraft, specified as a scalar numeric in these units:

UnitUnit System

Meters (m)

'Metric'

Feet (ft)

'English (kts)' and 'English (ft/s)'

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Forward component of ground velocity, specified as a scalar numeric in these units:

UnitUnit System

Meters per second (m/s)

'Metric'

Feet per second (ft/s)

'English (kts)'

Knots (kts)

'English (ft/s)'

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Side component of ground velocity, specified as a scalar numeric in these units:

UnitUnit System

Meters per second (m/s)

'Metric'

Feet per second (ft/s)

'English (kts)'

Knots (kts)

'English (ft/s)'

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Downward component of ground velocity, specified as a scalar numeric in these units:

UnitUnit System

Meters per second (m/s)

'Metric'

Feet per second (ft/s)

'English (kts)'

Knots (kts)

'English (ft/s)'

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Euler roll angle, specified as a scalar numeric in units of radians or degrees depending on the AngleSystem property.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Euler pitch angle, specified as a scalar numeric in units of radians or degrees depending on the AngleSystem property.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Euler yaw angle, specified as a scalar numeric in units of radians or degrees depending on the AngleSystem property.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Body roll rate, specified as a scalar numeric in units of radians per second or degrees per second depending on the AngleSystem property.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Body pitch rate, specified as a scalar numeric in units of radians per second or degrees per second depending on the AngleSystem property.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Body yaw rate, specified as a scalar numeric in units of radians per second or degrees per second depending on the AngleSystem property.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Angle of attack rate on fixed-wing aircraft, specified as a scalar numeric in units of radians per second or degrees per second depending on the AngleSystem property.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Angle of sideslip rate on the fixed-wing aircraft, specified as a scalar numeric in units of radians per second or degrees per second depending on the AngleSystem property.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Current control state values, specified as a vector.

You cannot set effective control variables created with asymmetric control surfaces.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Definition of current environment, contained in an Aero.Aircraft.Environment object, specified as a scalar.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Protected Properties

Fixed-wing aircraft weight, specified as a scalar numeric, in these units:

UnitUnit System

newtons (N)

'Metric'

pound-force (lbf)

'English (kts)' and 'English (ft/s)'

Weight depends on the values of the Mass and Gravity properties of the Aero.Aircraft.Environment object, with the equation

Weight = Mass * Environment.Gravity.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Altitude above ground level, specified as a scalar numeric value in these units:

UnitUnit System

meters (m)

'Metric'

feet (ft)

'English (kts)' and 'English (ft/s)'

AltitudeAGL depends on the values of the AltitudeMSL and GroundHeight public properties, with the equation:

AltitudeAGL = AltitudeMSL - GroundHeight.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Down position of fixed-wing aircraft, specified as a scalar numeric in these units:

UnitUnit System

Meters (m)

'Metric'

Feet (ft)

'English (kts)' and 'English (ft/s)'

XD depends on the value of the AltitudeMSL public property, with the equation

XD = -1 * AltitudeMSL.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Current airspeed of fixed-wing aircraft, specified as a scalar numeric in these units:

UnitUnit System

Meters/sec (m/s)

'Metric'

Feet/sec (ft/s)

'English (ft/s)'

knots (kts)

'English (kts)'

Airspeed depends on the values of the Ur, Vr, and Wr public properties, with the equation

Airspeed = sqrt(Ur2 + Vr2+Wr2).

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Current ground speed of fixed-wing aircraft, specified as a three-element vector in these units:

UnitUnit System

Meters/sec (m/s)

'Metric'

Feet/sec (ft/s)

'English (ft/s)'

knots (kts)

'English (kts)'

Groundspeed depends on the values of the U, V, and R public properties, with the equation

Groundspeed = [U, V, W].

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Mach number of fixed-wing aircraft, specified as a numeric scalar.

MachNumber depends on the values of the AirSpeed and SpeedOfSound public properties, with the equation

MachNumber = AirSpeed/Environment.SpeedOfSound.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Body velocity of fixed-wing aircraft, specified as a three-element vector.

BodyVelocity depends on the values of the GroundSpeed, Phi, Theta, and Psi public properties, with the equation

BodyVelocity = GroundVelocity - InertialToBodyMatrix * Environment.WindVelocity.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Ground velocity of the fixed-wing aircraft, specified as a three-element vector, defined with the equation

GroundVelocity = [U, V, W].

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

X component of body velocity, specified as scalar numeric. Ur depends on BodyVelocity.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Y component of body velocity, specified as scalar numeric. Ur depends on BodyVelocity.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Z component of body velocity, specified as scalar numeric. Ur depends on BodyVelocity.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Flight path angle, specified as a scalar numeric in units of radians or degrees depending on the AngleSystem property. FlightPathAngle is defined with the equation:

FlightPathAngle = atan2(W,U).

.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Course angle, specified as a scalar numeric in units of radians or degrees depending on the AngleSystem property. CourseAngle depends on V and U with the equation

CourseAngle = atan2(V,U).

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Angle of attack, specified as a scalar numeric in units of radians or degrees depending on the AngleSystem property. Alpha depends on Wr and Ur with the equation:

Alpha = atan2(Wr,Ur).

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Angle of side slip, specified as a scalar numeric in units of radians or degrees depends on the AngleSystem property. Beta depends on Vr and Airspeed with the equation:

Beta = asin(Vr/Airspeed).

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Inertial to body axes transformation matrix, specified as a 3-by-3 matrix to convert stability axes to body axes. This property depends on the Phi, Theta, and Psi properties.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Body axes to stability axes transformation matrix, specified as a 3-by-3 matrix to convert stability axes to body axes. This property depends on the Phi, Theta, and Psi properties.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Body to wind axes transformation matrix, specified as a 3-by-3 matrix to convert body axes to wind axes. This property depends on the Alpha and Beta properties.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Wind to body axes transformation matrix, specified as a 3-by-3 matrix to convert wind axes to the body axes. This property depends on the Alpha and Beta properties.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Body axes to stability axes transformation matrix, specified as a 3-by-3 matrix. For a definition of BodyToStabilityMatrix, see Algorithms.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: string | char

Stability axes to body matrix axes transformation matrix, specified as a 3-by-3 matrix. For a definition of StabilityToBodyMatrix, see Algorithms.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: string | char

Dynamic pressure at current state, specified as a scalar numeric in these units:

UnitUnit System

Pascals (Pa)

'Metric'

pounds per foot squared (lbf/ft2)

'English (ft/s)' and 'English (kts)'

This property is defined with the equation

DynamicPressure = 0.5 * Environment.Density * Airspeed2.

Attributes:

GetAccess
Restricts access
SetAccess
protected

Data Types: double

Methods

expand all

Examples

collapse all

Create and set up dynamic behavior and the current state for the fixed-wing object aircraft.

Create a fixed-wing object.

aircraft = Aero.FixedWing()
aircraft = 
  FixedWing with properties:

        ReferenceArea: 0
        ReferenceSpan: 0
      ReferenceLength: 0
         Coefficients: [1x1 Aero.FixedWing.Coefficient]
     DegreesOfFreedom: "6DOF"
             Surfaces: [1x0 Aero.FixedWing.Surface]
              Thrusts: [1x0 Aero.FixedWing.Thrust]
          AspectRatio: NaN
           Properties: [1x1 Aero.Aircraft.Properties]
           UnitSystem: "Metric"
    TemperatureSystem: "Kelvin"
          AngleSystem: "Radians"

To define the aircraft dynamic behavior, set a coefficient for it.

aircraft = setCoefficient(aircraft, "CD", "Zero", 0.27)
aircraft = 
  FixedWing with properties:

        ReferenceArea: 0
        ReferenceSpan: 0
      ReferenceLength: 0
         Coefficients: [1x1 Aero.FixedWing.Coefficient]
     DegreesOfFreedom: "6DOF"
             Surfaces: [1x0 Aero.FixedWing.Surface]
              Thrusts: [1x0 Aero.FixedWing.Thrust]
          AspectRatio: NaN
           Properties: [1x1 Aero.Aircraft.Properties]
           UnitSystem: "Metric"
    TemperatureSystem: "Kelvin"
          AngleSystem: "Radians"

Define the aircraft's current state.

state = Aero.FixedWing.State("Mass", 500)
state = 
  State with properties:

                    Alpha: 0
                     Beta: 0
                 AlphaDot: 0
                  BetaDot: 0
                     Mass: 500
                  Inertia: [3x3 table]
          CenterOfGravity: [0 0 0]
         CenterOfPressure: [0 0 0]
              AltitudeMSL: 0
             GroundHeight: 0
                       XN: 0
                       XE: 0
                       XD: 0
                        U: 50
                        V: 0
                        W: 0
                      Phi: 0
                    Theta: 0
                      Psi: 0
                        P: 0
                        Q: 0
                        R: 0
                   Weight: 4905
              AltitudeAGL: 0
                 Airspeed: 50
              GroundSpeed: 50
               MachNumber: 0.1469
             BodyVelocity: [50 0 0]
           GroundVelocity: [50 0 0]
                       Ur: 50
                       Vr: 0
                       Wr: 0
          FlightPathAngle: 0
              CourseAngle: 0
     InertialToBodyMatrix: [3x3 double]
     BodyToInertialMatrix: [3x3 double]
         BodyToWindMatrix: [3x3 double]
         WindToBodyMatrix: [3x3 double]
    BodyToStabilityMatrix: [3x3 double]
    StabilityToBodyMatrix: [3x3 double]
          DynamicPressure: 1.5312e+03
              Environment: [1x1 Aero.Aircraft.Environment]
            ControlStates: [1x0 Aero.Aircraft.ControlState]
         OutOfRangeAction: "Limit"
         DiagnosticAction: "Warning"
               Properties: [1x1 Aero.Aircraft.Properties]
               UnitSystem: "Metric"
        TemperatureSystem: "Kelvin"
              AngleSystem: "Radians"

Calculate the forces and moments on the aircraft.

[F, M] = forcesAndMoments(aircraft, state)
F = 3×1

           0
           0
        4905

M = 3×1

     0
     0
     0

Algorithms

The BodyToStabilityMatrix transformation is defined by this matrix:

BodyToStabilityMatrix = 
[cos(Alpha),  0, sin(Alpha)]
[     0,      1,      0    ]
[-sin(Alpha), 0, cos(Alpha)]

The StabilityToBodyMatrix transformation is the transpose of BodyToStabilityMatrix transformation:

StabilityToBodyMatrix = BodyToStabilityMatrix'

Version History

Introduced in R2021a