API reference
ISA (atmosphere.jl)
#
FlightMechanics.atmosphere_f16
— Method.
atmosphere_f16(height)
Standard Atmosphere implemented in Stevens F16 model.
Arguments
- alt: altitude [m].
Returns
- T: temperature [K].
- P: pressure [Pa].
- RHO: density [kg/m³].
- a: Speed of sound [m/s].
Notes
- This model is implemented just for F16 complete model validation purposes.
- For ISA 1978 atmospheric model, use atmosphere_isa.
- Note limited precision in tests against
atmosphere_isa
.
References
- [1] Stevens, B. L., Lewis, F. L., & Johnson, E. N. (2015). Aircraft control
and simulation: dynamics, controls design, and autonomous systems. John Wiley & Sons. (page 715)
#
FlightMechanics.atmosphere_isa
— Method.
atmosphere_isa(height)
Calculate temperature, pressure, density and sound velocity for the given geopotential height according to International Standard Atmosphere 1976.
References
- [1] U.S. Standard Atmosphere, 1976, U.S. Government Printing Office, Washington, D.C., 1976
From: https://en.wikipedia.org/wiki/U.S.StandardAtmosphere
Layer | h (m) | p (Pa) | T (K) | $α$ (K/m) |
---|---|---|---|---|
0 | 0 | 101325 | 288.15 | -0.0065 |
1 | 11000 | 22632.1 | 216.65 | 0 |
2 | 20000 | 5474.89 | 216.65 | 0.001 |
3 | 32000 | 868.019 | 228.65 | 0.0028 |
4 | 47000 | 110.906 | 270.65 | 0 |
5 | 51000 | 66.9389 | 270.65 | -0.0028 |
6 | 71000 | 3.95642 | 214.65 | -0.002 |
Coordinates Systems (coordinates.jl)
#
FlightMechanics.body2ecef
— Method.
body2ecef(xb, yb, zb, lat, lon, psi, theta, phi)
Transform body coordinates to ECEF coordinates.
Arguments
xb, yb, zb
: body coordinates.lat
: geodetic latitude (rad).lon
: longitude (rad).psi, theta, phi
: Euler angles. Yaw, pitch, roll (rad).
#
FlightMechanics.body2ecef
— Method.
body2ecef(xb, yb, zb, lat, lon, q0, q1, q2, q3)
Transform body coordinates to ECEF coordinates.
Arguments
xb, yb, zb
: body coordinates.lat
: geodetic latitude (rad).lon
: longitude (rad).q0, q1, q2, q3
: quaternions.
#
FlightMechanics.body2hor
— Method.
body2hor(xb, yb, zb, psi, theta, phi)
Transform body coordinates to local horizon.
Arguments
xb, yb, zb
: body coordinates.psi, theta, phi
: Euler angles. Yaw, pitch, roll (rad).
#
FlightMechanics.body2hor
— Method.
body2hor(xb, yb, zb, q0, q1, q2, q3)
Transform body coordinates to local horizon.
Arguments
xb, yb, zb
: body coordinates.q0, q1, q2, q3
: quaternions.
#
FlightMechanics.body2wind
— Method.
body2wind(xb, yb, zb, alpha, beta)
Transform body coordinates to wind.
Arguments
xb, yb, zb
: body coordinates.alpha, beta
: Aerodynamic angles. Angle of attack, angle of side-slip (rad).
#
FlightMechanics.ecef2body
— Method.
ecef2body(xecef, yecef, zecef, lat, lon, psi, theta, phi)
Transform ECEF coordinates to body coordinates.
Arguments
xecef, yecef, zecef
: ECEF (Earth Centered Earth Fixed) coordinates.lat
: geodetic latitude (rad).lon
: longitude (rad).psi, theta, phi
: Euler angles. Yaw, pitch, roll (rad).
#
FlightMechanics.ecef2body
— Method.
ecef2body(xecef, yecef, zecef, lat, lon, q0, q1, q2, q3)
Transform ECEF coordinates to body coordinates.
Arguments
xecef, yecef, zecef
: ECEF (Earth Centered Earth Fixed) coordinates.lat
: geodetic latitude (rad).lon
: longitude (rad).q0, q1, q2, q3
: quaternions.
#
FlightMechanics.ecef2hor
— Method.
ecef2hor(xecef, yecef, zecef, lat, lon)
Transform ECEF (Earth Fixed Earth Centered) coordinates to local horizon coordinates using geodetic latitude and longitude.
Arguments
xecef, yecef, zecef
: ECEF coordinates.lat
: geodetic latitude (rad).lon
: longitude (rad).
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (page 36, formula 1.4-9)
Notes
X, Y, Z ECEF are defined in a different way in [1]. In order to reproduce this transformation substitute in [1] Y->X, Z->Y, X->Z
[1] Only defines the opposite transformation. However this must be the transpose of hor2ecef.
#
FlightMechanics.ecef2llh
— Method.
ecef2llh(xecef, yecef, zecef; ellipsoid=WGS84)
Transform ECEF coordinates to geodetic latitude, longitude and ellipsoidal height for the given ellipsoid (default ellipsoid is WGS84)
References
- [1] Bowring, B. R. (1976). Transformation from spatial to geographical
coordinates. Survey review, 23(181), 323-327.
- [2] Bowring, B. R. (1985). The accuracy of geodetic latitude and height
equations. Survey Review, 28(218), 202-206.
Notes
- The transformation is direct without iterations as [1] introduced the need to
iterate for near Earth positions.
- [2] is an updated of increased accuracy of [1]. The former is used in this
implementation although the latter implementation is commented in the code.
- Model becomes unstable if latitude is close to 90º. An alternative equation
can be found in [2] equation (16) but has not been implemented.
#
FlightMechanics.euler2quaternion
— Method.
euler2quaternion(psi, theta, phi)
Transform Euler angles orientation to quaternion orientation.
Arguments
psi, theta, phi
: Euler angles. Yaw, pitch, roll (rad).
References
- [1] Zipfel, P. H. (2007). Modeling and simulation of aerospace vehicle
dynamics. American Institute of Aeronautics and Astronautics. (page 126, formula 4.78)
#
FlightMechanics.hor2body
— Method.
hor2body(xh, yh, zh, psi, theta, phi)
Transform local horizon coordinates to body.
Arguments
xh, yh, zh
: local horizon coordinates.psi, theta, phi
: Euler angles. Yaw, pitch, roll (rad).
#
FlightMechanics.hor2body
— Method.
hor2body(xb, yb, zb, q0, q1, q2, q3)
Transform local horizon corrdinates to body coordinates.
Arguments
xh, yh, zh
: local horizon coordinates.q0, q1, q2, q3
: quaternions.
#
FlightMechanics.hor2ecef
— Method.
hor2ecef(xh, yh, zh, lat, lon)
Transform local horizon coordinates to ECEF (Earth Centered Earth Fixed) coordinates using geodetic latitude and longitude.
Arguments
xh, yh, zh
: local horizon coordinates.lat
: geodetic latitude (rad).lon
: longitude (rad).
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (page 36, formula 1.4-9)
Notes
X, Y, Z ECEF are defined in a different way in [1]. In order to reproduce this transformation substitute in [1] Y->X, Z->Y, X->Z
#
FlightMechanics.hor2wind
— Method.
hor2wind(xh, yh, zh, chi, gamma, mu)
Transform local horizon coordinates to wind.
Arguments
xh, yh, zh
: local horizon coordinates.chi, gamma, mu
: Velocity angles. Yaw (azimuth), pitch(elevation), roll (rad).
#
FlightMechanics.llh2ecef
— Method.
llh2ecef(lat, lon, height; ellipsoid=WGS84)
Transform geodetic latitude, longitude and ellipsoidal height to ECEF for the given ellipsoid (default ellipsoid is WGS84)
References
- [1] Rogers, R. M. (2007). Applied mathematics in integrated navigation
systems. American Institute of Aeronautics and Astronautics. (Page 75, equations 4.20, 4.21, 4.22)
#
FlightMechanics.quaternion2euler
— Method.
quaternion2euler(q0, q1, q2, q3)
Transform quaternion orientation to Euler angles orientation.
Arguments
q0, q1, q2, q3
: quaternions.
References
- [1] Zipfel, P. H. (2007). Modeling and simulation of aerospace vehicle
dynamics. American Institute of Aeronautics and Astronautics. (page 127, formula 4.82)
#
FlightMechanics.rot_matrix_body2ecef
— Method.
rot_matrix_body2ecef(lat, lon, psi, theta, phi)
Rotation matrix to transform from body to ECEF
Arguments
lat
: geodetic latitude (rad).lon
: longitude (rad).psi, theta, phi
: Euler angles. Yaw, pitch, roll (rad).
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (page 37, formula 1.4-11)
#
FlightMechanics.rot_matrix_body2ecef
— Method.
rot_matrix_body2ecef(lat, lon, q0, q1, q2, q3)
Rotation matrix to transform from body to ECEF
Arguments
lat
: geodetic latitude (rad).lon
: longitude (rad).q0, q1, q2, q3
: quaternions.
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (page 37, formula 1.4-11)
#
FlightMechanics.rot_matrix_body2hor
— Method.
rot_matrix_body2hor(q0, q1, q2, q3)
Rotation matrix to transform from body to local horizon.
Arguments
q0, q1, q2, q3
: quaternions.
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (page 41, formula 1.4-23)
#
FlightMechanics.rot_matrix_body2hor
— Method.
rot_matrix_body2hor(psi, theta, phi)
Rotation matrix from body to local horizon
Arguments
psi, theta, phi
: Euler angles. Yaw, pitch, roll (rad).
#
FlightMechanics.rot_matrix_ecef2body
— Method.
rot_matrix_ecef2body(lat, lon, psi, theta, phi)
Rotation matrix to transform from ECEF to body
Arguments
lat
: geodetic latitude (rad).lon
: longitude (rad).psi, theta, phi
: Euler angles. Yaw, pitch, roll (rad).
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (page 37, formula 1.4-11)
#
FlightMechanics.rot_matrix_ecef2body
— Method.
rot_matrix_ecef2body(lat, lon, q0, q1, q2, q3)
Rotation matrix to transform from ECEF to body
Arguments
lat
: geodetic latitude (rad).lon
: longitude (rad).q0, q1, q2, q3
: quaternions.
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (page 37, formula 1.4-11)
#
FlightMechanics.rot_matrix_ecef2hor
— Method.
rot_matrix_ecef2hor(lat, lon)
Rotation matrix to transform from ECEF to local horizon.
Arguments
lat, lon
: geodetic latitude and longitude (rad)
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (page 36, formula 1.4-9)
Notes
X, Y, Z ECEF are defined in a different way in [1]. In order to reproduce this transformation substitute in [1] Y->X, Z->Y, X->Z
#
FlightMechanics.rot_matrix_hor2body
— Method.
rot_matrix_hor2body(q0, q1, q2, q3)
Rotation matrix to transform from local horizon to body.
Arguments
q0, q1, q2, q3
: quaternions.
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (page 41, formula 1.4-23)
#
FlightMechanics.rot_matrix_hor2body
— Method.
rot_matrix_hor2body(psi, theta, phi)
Rotation matrix from body to local horizon
Arguments
psi, theta, phi
: Euler angles. Yaw, pitch, roll (rad).
#
FlightMechanics.rot_matrix_hor2ecef
— Method.
rot_matrix_hor2ecef(lat, lon)
Rotation matrix to transform from local horizon to ECEF.
Arguments
lat, lon
: geodetic latitude and longitude (rad)
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (page 36, formula 1.4-9)
Notes
X, Y, Z ECEF are defined in a different way in [1]. In order to reproduce this transformation substitute in [1] Y->X, Z->Y, X->Z
#
FlightMechanics.wind2body
— Method.
wind2body(xw, yw, zw, alpha, beta)
Transform body coordinates to wind.
Arguments
xw, yw, zw
: wind coordinates.alpha, beta
: Aerodynamic angles. Angle of attack, angle of side-slip (rad).
#
FlightMechanics.wind2hor
— Method.
wind2hor(xw, yw, zw, chi, gamma, mu)
Transform wind coordinates to local horizon.
Arguments
xw, yw, zw
: wind coordinates.chi, gamma, mu
: Velocity angles. Yaw (azimuth), pitch(elevation), roll (rad).
Anemometry (anemometry.jl)
#
FlightMechanics.cas2eas
— Method.
cas2eas(cas, ρ, p)
Calculate equivalent airspeed from calibrated airspeed, density (ρ) and pressure (p) at the current altitude.
#
FlightMechanics.cas2tas
— Method.
cas2tas(cas, ρ, p)
Calculate true airspeed from calibrated airspeed, density (ρ) and pressure (p) at the current altitude.
#
FlightMechanics.compressible_qinf
— Method.
compressible_qinf(tas, p, a)
Calculate compressible dynamic pressure from Mach number and static pressure (p)
Two different models are used depending on the Mach number:
- Subsonic case: Bernouilli's equation compressible form.
- Supersonic case: to be implemented.
References
- [1] Ward, D. T. (1993). Introduction to flight test engineering. Elsevier Science Ltd. (page 12)
- [2] Fundamentals of Aerdynamics, 5th edition, J.D.Anderson Jr (page 550)
#
FlightMechanics.eas2cas
— Method.
eas2cas(eas, ρ, p)
Calculate calibrated airspeed from equivalent airspeed, density (ρ) and pressure (p) at the current altitude.
#
FlightMechanics.eas2tas
— Method.
eas2tas(qc, ρ)
Calculate true airspeed from equivalent airspeed and density at current altitude (ρ).
References
- [1] Ward, D. T. (1993). Introduction to flight test engineering. Elsevier Science Ltd. (page 13, formula 2.15)
#
FlightMechanics.incompressible_qinf
— Method.
incompressible_qinf(tas, ρ)
Calculate incompressible dynamic pressure from true airspeed (tas) and density (ρ) at current altitude.
References
- [1] Ward, D. T. (1993). Introduction to flight test engineering. Elsevier Science Ltd. (page 13, formula 2.14)
#
FlightMechanics.qc2cas
— Method.
qc2cas(qc)
Calculate calibrated airspeed from ASI (Air Speed indicator), differential pressure between impact pressure and static pressure. qc = pt - ps
References
- [1] Ward, D. T. (1993). Introduction to flight test engineering. Elsevier Science Ltd. (page 13, formula 2.13)
#
FlightMechanics.qc2eas
— Method.
qc2eas(qc, p)
Calculate equivalent airspeed from ASI (Air Speed indicator), differential pressure between impact pressure and static pressure (qc = pt - ps) and p.
References
- [1] Ward, D. T. (1993). Introduction to flight test engineering. Elsevier Science Ltd.
#
FlightMechanics.qc2tas
— Method.
qc2tas(qc, ρ, p)
Calculate true airspeed from ASI (Air Speed indicator), differential pressure between impact pressure and static pressure (qc = pt - ps), rho and p.
References
- [1] Ward, D. T. (1993). Introduction to flight test engineering. Elsevier Science Ltd. (page 12, based on formula 2.11)
#
FlightMechanics.tas2cas
— Method.
tas2cas(cas, ρ, p)
Calculate true airspeed from calibrated airspeed, density (ρ) and pressure (p) at the current altitude.
#
FlightMechanics.tas2eas
— Method.
tas2eas(tas, ρ)
Calculate equivalent airspeed from true airspeed and density at current altitude (ρ).
References
- [1] Ward, D. T. (1993). Introduction to flight test engineering. Elsevier Science Ltd. (page 13, formula 2.15)
#
FlightMechanics.tas_alpha_beta_from_uvw
— Method.
tas_alpha_beta_from_uvw(u, v, w)
Calculate true air speed (TAS), angle of attack (α) and angle of side-slip (β) from aerodynamic velocity expressed in body axis.
References
- [1] Etkin, B. (2005). Dynamics of atmospheric flight. Dover Publications (page 114, formulas 4.3,2 and 4.3,3)
Kinematics (kinematics.jl)
#
FlightMechanics.rigid_body_velocity
— Method.
rigid_body_velocity(vel_P, ω, r_PQ)
Calculate the velocity of a point Q of a rigid solid given the velocity of a point P (vel_P), the rotational velocity of the solid (ω) and the relative position of Q wrt P.
If the reference frame 1 is attached to the solid and the velocity is calculated with respect to reference frame 0:
$v_{10}^{Q} = v_{10}^{P} + \omega_{10} \times r^{PQ}$
being:
- $v_{10}^{Q}$ the velocity of point Q, fixed to 1, wrt 0
- $\omega_{10}$ the angular velocity of the solid 1 wrt 0
- $r^{PQ}$ the position of Q wrt P ($r^{Q}-r^{P}$)
Every vector needs to be expressed in the same coordinate system.
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (Section 1.3, page 26)
#
FlightMechanics.rigid_body_acceleration
— Method.
rigid_body_acceleration(acc_P, ω, ω_dot, r_PQ)
Calculate the acceleration of a point Q of a rigid solid given the acceleration of a point P (accP), the rotational velocity of the solid (ω), the rotational acceleration of the solid (ωdot) and the relative position of Q wrt P.
$a_{10}^{Q} = a_{10}^{P} + \omega_{10} \times (\omega_{10} \times r^{PQ}) + \dot{\omega}_{10} \times r^{PQ}$
being:
- $a_{10}^{Q}$ the acceleration of point Q, fixed to 1, wrt 0
- $\omega_{10}$ the angular velocity of the solid 1 wrt 0
- $\dot{\omega}_{10}$ the angular acceleration of the solid 1 wrt 0
- $r^{PQ}$ the position of Q wrt P ($r^{Q}-r^{P}$)
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (Section 1.3, Formaula 1.3-14c, page 26)
6 Degrees of Freedom dynamic models (dynamics/)
#
FlightMechanics.six_dof_euler_fixed_mass
— Function.
six_dof_euler_fixed_mass(state, mass, inertia, forces, moments,
h=[0.0, 0.0, 0.0])
Six degrees of freedom dynamic system using Euler angles for attitude representation and assuming fixed mass.
Flat Earth hypothesis is applied and Earth reference frame is considered inertial.
It is considered that the aircraft xb-zb plane is a plane of symmetry so that Jxy and Jyz cross-product of inertia are zero and will not be taken into account.
The effects of the angular momentum produced by spinning rotors is taken into account with the optional argument h
.
Arguments
state::12-element Array{Number,1}
: state vector. u, v, w: inertial linear velocity expressed in body axis. (m/s) p, q, r: inertial rotatinal velocity expressed in body axis. (rad/s) ψ, θ, ϕ: attitude given by Euler angles (zyx). Yaw, pitch, roll. (rad) xe, ye, ze: position wrt the inertial system origin expressed in Earth Axis. (m)mass::Number
: total mass of the aircraft (kg)inertia::3×3 Array{Number,2}
: inertia tensor (kg·m²)forces::3-element Array{Number,1}
: total forces expressed in body axis. (N)moments::3-element Array{Number,1}
: total moments expressed in body axis.(N·m)h::3-element Array{Number,1}
: Additional angular momentum contributions such as those coming from spinning rotors (kg·m²/s).
Returns
state_dot
: state vector derivative according to the equation of motion, inertial properties and applied forces and moments.
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (Section 1.5, equations 1.5-4, page 46)
- [2] Etkin, B. (2005). Dynamics of atmospheric flight. Dover Publications
(Section 5.8, page 148, formulas 5.8,1 to 5.8,7)
- [3] Zipfel, P. H. (2007). Modeling and simulation of aerospace vehicle
dynamics. American Institute of Aeronautics and Astronautics. (page 368, figure 10.2, not taking into account quaternions in angular kinematic equations)
#
FlightMechanics.six_dof_quaternion_fixed_mass
— Function.
six_dof_quaternion_fixed_mass(state, mass, inertia, forces, moments,
h=[0.0, 0.0, 0.0], k=0.0)
Six degrees of freedom dynamic system using quaternions for attitude representation and assuming fixed mass.
Flat Earth hypothesis is applied and Earth reference frame is considered inertial.
It is considered that the aircraft xb-zb plane is a plane of symmetry so that Jxy and Jyz cross-product of inertia are zero and will not be taken into account.
The effects of the angular momentum produced by spinning rotors is taken into account with the optional argument h
.
Arguments
state::12-element Array{Number,1}
: state vector. u, v, w: inertial linear velocity expressed in body axis. (m/s) p, q, r: inertial rotatinal velocity expressed in body axis. (rad/s) q0, q1, q2, q3: attitude given by quaternions. xe, ye, ze: position wrt the inertial system origin expressed in Earth Axis. (m)mass::Number
: total mass of the aircraft (kg)inertia::3×3 Array{Number,2}
: inertia tensor (kg·m²)forces::3-element Array{Number,1}
: total forces expressed in body axis. (N)moments::3-element Array{Number,1}
: total moments expressed in body axis.(N·m)h::3-element Array{Number,1}
: Additional angular momentum contributions such as those coming from spinning rotors (kg·m²/s).k::Number
: orthonormality error factor.
Returns
state_dot
: state vector derivative according to the equation of motion, inertial properties and applied forces and moments.
Notes
- See 1 or 2 for more information on quaternions <-> Euler angles conversions.
- Orthonormality error factor is related to a numerical stability artifact used in angular kinematic equations. Let λ = k * (1 - q0² - q1² - q2² - q3²) be the orthonormality error. The term k·λ·q is added to the angular kinematic equations in order to reduce the numerical integration error. According to reference [2] k·Δt ≤ 1. See 2 for more information on orthonormality error factor.
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (Section 1.5, equations 1.5-4, page 46)
- [2] Zipfel, P. H. (2007). Modeling and simulation of aerospace vehicle
dynamics. American Institute of Aeronautics and Astronautics. (page 368, figure 10.2)
#
FlightMechanics.six_dof_ecef_quaternion_fixed_mass
— Function.
six_dof_ecef_quaternion_fixed_mass(state, mass, inertia, forces, moments,
h=[0.0, 0.0, 0.0], k=0.0, ellipsoid=WGS84)
Six degrees of freedom dynamic system using quaternions for attitude representation and assuming fixed mass.
Ellipsoidal Earth Model is used and the ECEF reference frame is considered inertial.
The effects of the angular momentum produced by spinning rotors is taken into account with the optional argument h
.
Arguments
state::12-element Array{Number,1}
: state vector. u, v, w: inertial linear velocity expressed in body axis. (m/s) p, q, r: inertial rotatinal velocity expressed in body axis. (rad/s) q0, q1, q2, q3: attitude given by quaternions. xe, ye, ze: position wrt the inertial system origin expressed in Earth Axis. (m)mass::Number
: total mass of the aircraft (kg)inertia::3×3 Array{Number,2}
: inertia tensor (kg·m²)forces::3-element Array{Number,1}
: total forces expressed in body axis. (N)moments::3-element Array{Number,1}
: total moments expressed in body axis.(N·m)h::3-element Array{Number,1}
: Additional angular momentum contributions such as those coming from spinning rotors (kg·m²/s).k::Number
: orthonormality error factor.ellipsoid::Ellipsoid
: ellipsoid model to be used.
Returns
state_dot
: state vector derivative according to the equation of motion, inertial properties and applied forces and moments.
Notes
- See 1 or 2 for more information on quaternions <-> Euler angles conversions.
- Orthonormality error factor is related to a numerical stability artifact used in angular kinematic equations. Let λ = k * (1 - q0² - q1² - q2² - q3²) be the orthonormality error. The term k·λ·q is added to the angular kinematic equations in order to reduce the numerical integration error. According to reference [2] k·Δt ≤ 1. See 2 for more information on orthonormality error factor.
- Implementation based on [1]. However, [2] can also be read.
References
- [1] Stevens, B. L., Lewis, F. L., (1992). Aircraft control and simulation:
dynamics, controls design, and autonomous systems. John Wiley & Sons. (page 45, formula 1.5-1)
- [2] Zipfel, P. H. (2007). Modeling and simulation of aerospace vehicle
dynamics. American Institute of Aeronautics and Astronautics. (page 396, figure 10.6)