Aerospace Toolbox II
Aerospace Toolbox II
Aerospace Toolbox II
Users Guide
R2013b
How to Contact MathWorks
www.mathworks.com Web
comp.soft-sys.matlab Newsgroup
www.mathworks.com/contact_TS.html Technical Support
[email protected] Product enhancement suggestions
[email protected] Bug reports
[email protected] Documentation error reports
[email protected] Order status, license renewals, passcodes
[email protected] Sales, pricing, and general information
508-647-7000 (Phone)
508-647-7001 (Fax)
The MathWorks, Inc.
3 Apple Hill Drive
Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site.
Aerospace Toolbox Users Guide
COPYRIGHT 20062013 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used
or copied only under the terms of the license agreement. No part of this manual may be photocopied or
reproduced in any form without prior written consent from The MathWorks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation
by, for, or through the federal government of the United States. By accepting delivery of the Program
or Documentation, the government hereby agrees that this software or documentation qualifies as
commercial computer software or commercial computer software documentation as such terms are used
or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and
conditions of this Agreement and only those rights specified in this Agreement, shall pertain to and govern
the use, modification, reproduction, release, performance, display, and disclosure of the Program and
Documentation by the federal government (or other entity acquiring for or through the federal government)
and shall supersede any conflicting contractual terms or conditions. If this License fails to meet the
governments needs or is inconsistent in any respect with federal procurement law, the government agrees
to return the Program and Documentation, unused, to The MathWorks, Inc.
Trademarks
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand
names may be trademarks or registered trademarks of their respective holders.
Patents
MathWorks products are protected by one or more U.S. patents. Please see
www.mathworks.com/patents for more information.
Revision History
September 2006 Online only New for Version 1.0 (Release 2006b)
March 2007 Online only Revised for Version 1.1 (Release 2007a)
September 2007 First printing Revised for Version 2.0 (Release 2007b)
March 2008 Online only Revised for Version 2.1 (Release 2008a)
October 2008 Online only Revised for Version 2.2 (Release 2008b)
March 2009 Online only Revised for Version 2.3 (Release 2009a)
September 2009 Online only Revised for Version 2.4 (Release 2009b)
March 2010 Online only Revised for Version 2.5 (Release 2010a)
September 2010 Online only Revised for Version 2.6 (Release 2010b)
April 2011 Online only Revised for Version 2.7 (Release 2011a)
September 2011 Online only Revised for Version 2.8 (Release 2011b)
March 2012 Online only Revised for Version 2.9 (Release 2012a)
September 2012 Online only Revised for Version 2.10 (Release 2012b)
March 2013 Online only Revised for Version 2.11 (Release 2013a)
September 2013 Online only Revised for Version 2.12 (Release 2013b)
Contents
Getting Started
1
Aerospace Toolbox Product Description . . . . . . . . . . . . . 1-2
Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Aerospace Toolbox and Aerospace Blockset . . . . . . . . . . 1-3
Using Aerospace Toolbox
2
Defining Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . 2-2
Fundamental Coordinate System Concepts . . . . . . . . . . . . 2-2
Coordinate Systems for Modeling . . . . . . . . . . . . . . . . . . . . 2-4
Coordinate Systems for Navigation . . . . . . . . . . . . . . . . . . . 2-7
Coordinate Systems for Display . . . . . . . . . . . . . . . . . . . . . . 2-10
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Aerospace Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
Digital DATCOM Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Digital DATCOM Data Overview . . . . . . . . . . . . . . . . . . . . . 2-14
USAF Digital DATCOM File . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Data from DATCOM Files . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
Imported DATCOM Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
Missing DATCOM Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
Aerodynamic Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22
3-D Flight Data Playback . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-26
Aerospace Toolbox Animation Objects . . . . . . . . . . . . . . . . . 2-26
Aero.Animation Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
Running the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
v
Simulated and Actual Flight Data . . . . . . . . . . . . . . . . . . . . 2-27
Aero.VirtualRealityAnimation Objects . . . . . . . . . . . . . . . 2-37
Running the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-37
Visualize Aircraft Takeoff via Virtual Reality Animation
Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38
Aero.FlightGearAnimation Objects . . . . . . . . . . . . . . . . . . 2-57
About the FlightGear Interface . . . . . . . . . . . . . . . . . . . . . . 2-57
Configuring Your Computer for FlightGear . . . . . . . . . . . . 2-58
Install and Start FlightGear . . . . . . . . . . . . . . . . . . . . . . . . 2-62
Flight Simulator Interface Example . . . . . . . . . . . . . . . . . . 2-63
Running the Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-65
Flight Trajectory Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-66
Alphabetical List
3
AC3D Files and Thumbnails
A
AC3D Files and Thumbnails Overview . . . . . . . . . . . . . . . A-2
Index
vi Contents
1
Getting Started
Aerospace Toolbox Product Description on page 1-2
Aerospace Toolbox and Aerospace Blockset on page 1-3
1 Getting Started
Aerospace Toolbox Product Description
Aerospace reference standards, environmental models, and
aerodynamic coefficient importing
Aerospace Toolbox provides reference standards, environmental models,
and aerodynamic coefficient importing for performing advanced aerospace
analysis to develop and evaluate your designs. Options for visualizing vehicle
dynamics include a six-degrees-of-freedom MATLAB
3D Animation
software. These options let you visualize flight data in a three-dimensional
(3-D) environment and reconstruct behavioral anomalies in flight-test results.
Key Features
Includes standards-based environmental models for atmosphere, gravity,
geoid height, wind, and magnetic field
Converts units and transforms coordinate systems and spatial
representations
Implements predefined utilities for aerospace parameter calculations, time
calculations, and quaternion math
Imports aerodynamic coefficients from the U.S. Air Force Digital Data
Compendium (Datcom)
Provides options for visualizing vehicle dynamics in a 3-D environment,
including an interface to FlightGear flight simulator
1-2
Aerospace Toolbox and Aerospace Blockset
Aerospace Toolbox and Aerospace Blockset
The Aerospace product family includes the Aerospace Toolbox and Aerospace
Blockset products. The toolbox provides static data analysis capabilities,
while the blockset provides an environment for dynamic modeling and
vehicle component modeling and simulation. The Aerospace Blockset
software uses part of the functionality of the toolbox as an engine. Use these
products together to model aerospace systems in the MATLAB and Simulink
environments.
1-3
1 Getting Started
1-4
2
Using Aerospace Toolbox
Defining Coordinate Systems on page 2-2
Aerospace Units on page 2-12
Digital DATCOM Data on page 2-14
3-D Flight Data Playback on page 2-26
Aero.Animation Objects on page 2-27
Aero.VirtualRealityAnimation Objects on page 2-37
Aero.FlightGearAnimation Objects on page 2-57
2 Using Aerospace Toolbox
Defining Coordinate Systems
In this section...
Fundamental Coordinate System Concepts on page 2-2
Coordinate Systems for Modeling on page 2-4
Coordinate Systems for Navigation on page 2-7
Coordinate Systems for Display on page 2-10
References on page 2-11
Fundamental Coordinate System Concepts
Coordinate systems allow you to keep track of an aircraft or spacecrafts
position and orientation in space. The Aerospace Toolbox coordinate systems
are based on these underlying concepts from geodesy, astronomy, and physics.
Definitions
The Aerospace Toolbox software uses right-handed (RH) Cartesian coordinate
systems. The right-hand rule establishes the x-y-z sequence of coordinate
axes.
An inertial frame is a nonaccelerating motion reference frame. Loosely
speaking, acceleration is defined with respect to the distant cosmos. In an
inertial frame, Newtons second law (force = mass X acceleration) holds.
Strictly defined, an inertial frame is a member of the set of all frames not
accelerating relative to one another. A noninertial frame is any frame
accelerating relative to an inertial frame. Its acceleration, in general, includes
both translational and rotational components, resulting in pseudoforces
(pseudogravity, as well as Coriolis and centrifugal forces).
The toolbox models the Earths shape (the geoid) as an oblate spheroid, a
special type of ellipsoid with two longer axes equal (defining the equatorial
plane) and a third, slightly shorter (geopolar) axis of symmetry. The equator
is the intersection of the equatorial plane and the Earths surface. The
geographic poles are the intersection of the Earths surface and the geopolar
axis. In general, the Earths geopolar and rotation axes are not identical.
2-2
Defining Coordinate Systems
Latitudes parallel the equator. Longitudes parallel the geopolar axis. The
zero longitude or prime meridian passes through Greenwich, England.
Approximations
The Aerospace Toolbox software makes three standard approximations in
defining coordinate systems relative to the Earth.
The Earths surface or geoid is an oblate spheroid, defined by its longer
equatorial and shorter geopolar axes. In reality, the Earth is slightly
deformed with respect to the standard geoid.
The Earths rotation axis and equatorial plane are perpendicular, so that
the rotation and geopolar axes are identical. In reality, these axes are
slightly misaligned, and the equatorial plane wobbles as the Earth rotates.
This effect is negligible in most applications.
The only noninertial effect in Earth-fixed coordinates is due to the Earths
rotation about its axis. This is a rotating, geocentric system. The toolbox
ignores the Earths motion around the Sun, the Suns motion in the Galaxy,
and the Galaxys motion through cosmos. In most applications, only the
Earths rotation matters.
This approximation must be changed for spacecraft sent into deep space,
i.e., outside the Earth-Moon system, and a heliocentric system is preferred.
Motion with Respect to Other Planets
The Aerospace Toolbox software uses the standard WGS-84 geoid to model
the Earth. You can change the equatorial axis length, the flattening, and
the rotation rate.
You can represent the motion of spacecraft with respect to any celestial body
that is well approximated by an oblate spheroid by changing the spheroid
size, flattening, and rotation rate. If the celestial body is rotating westward
(retrogradely), make the rotation rate negative.
2-3
2 Using Aerospace Toolbox
Coordinate Systems for Modeling
Modeling aircraft and spacecraft is simplest if you use a coordinate system
fixed in the body itself. In the case of aircraft, the forward direction is
modified by the presence of wind, and the crafts motion through the air is
not the same as its motion relative to the ground.
Body Coordinates
The noninertial body coordinate system is fixed in both origin and orientation
to the moving craft. The craft is assumed to be rigid.
The orientation of the body coordinate axes is fixed in the shape of body.
The x-axis points through the nose of the craft.
The y-axis points to the right of the x-axis (facing in the pilots direction of
view), perpendicular to the x-axis.
The z-axis points down through the bottom of the craft, perpendicular to
the x-y plane and satisfying the RH rule.
Translational Degrees of Freedom. Translations are defined by moving
along these axes by distances x, y, and z from the origin.
Rotational Degrees of Freedom. Rotations are defined by the Euler angles
P, Q, R or , , . They are
P or : Roll about the x-axis
Q or : Pitch about the y-axis
R or : Yaw about the z-axis
2-4
Defining Coordinate Systems
Wind Coordinates
The noninertial wind coordinate system has its origin fixed in the rigid
aircraft. The coordinate system orientation is defined relative to the crafts
velocity V.
The orientation of the wind coordinate axes is fixed by the velocity V.
The x-axis points in the direction of V.
The y-axis points to the right of the x-axis (facing in the direction of V),
perpendicular to the x-axis.
The z-axis points perpendicular to the x-y plane in whatever way needed to
satisfy the RH rule with respect to the x- and y-axes.
Translational Degrees of Freedom. Translations are defined by moving
along these axes by distances x, y, and z from the origin.
2-5
2 Using Aerospace Toolbox
Rotational Degrees of Freedom. Rotations are defined by the Euler
angles , , . They are
: Bank angle about the x-axis
: Flight path about the y-axis
: Heading angle about the z-axis
2-6
Defining Coordinate Systems
Coordinate Systems for Navigation
Modeling aerospace trajectories requires positioning and orienting the aircraft
or spacecraft with respect to the rotating Earth. Navigation coordinates are
defined with respect to the center and surface of the Earth.
Geocentric and Geodetic Latitudes
The geocentric latitude on the Earths surface is defined by the angle
subtended by the radius vector from the Earths center to the surface point
with the equatorial plane.
The geodetic latitude on the Earths surface is defined by the angle
subtended by the surface normal vector n and the equatorial plane.
2-7
2 Using Aerospace Toolbox
NED Coordinates
The north-east-down (NED) system is a noninertial system with its origin
fixed at the aircraft or spacecrafts center of gravity. Its axes are oriented
along the geodetic directions defined by the Earths surface.
The x-axis points north parallel to the geoid surface, in the polar direction.
The y-axis points east parallel to the geoid surface, along a latitude curve.
The z-axis points downward, toward the Earths surface, antiparallel to the
surfaces outward normal n.
Flying at a constant altitude means flying at a constant z above the Earths
surface.
2-8
Defining Coordinate Systems
ECI Coordinates
The Earth-centered inertial (ECI) system is a mixed inertial system. It is
oriented with respect to the Sun. Its origin is fixed at the center of the Earth.
The z-axis points northward along the Earths rotation axis.
The x-axis points outward in the Earths equatorial plane exactly at the
Sun. (This rule ignores the Suns oblique angle to the equator, which varies
with season. The actual Sun always remains in the x-z plane.)
The y-axis points into the eastward quadrant, perpendicular to the x-z
plane so as to satisfy the RH rule.
Earth-Centered Coordinates
2-9
2 Using Aerospace Toolbox
ECEF Coordinates
The Earth-center, Earth-fixed (ECEF) system is a noninertial system that
rotates with the Earth. Its origin is fixed at the center of the Earth.
The z-axis points northward along the Earths rotation axis.
The x-axis points outward along the intersection of the Earths equatorial
plane and prime meridian.
The y-axis points into the eastward quadrant, perpendicular to the x-z
plane so as to satisfy the RH rule.
Coordinate Systems for Display
The Aerospace Toolbox software lets you use FlightGear coordinates for
rendering motion.
FlightGear is an open-source, third-party flight simulator with an interface
supported by the Aerospace Toolbox product.
Flight Simulator Interface Example on page 2-63 discusses the toolbox
interface to FlightGear.
See the FlightGear documentation at www.flightgear.org for complete
information about this flight simulator.
The FlightGear coordinates form a special body-fixed system, rotated from the
standard body coordinate system about the y-axis by -180 degrees:
The x-axis is positive toward the back of the vehicle.
The y-axis is positive toward the right of the vehicle.
The z-axis is positive upward, e.g., wheels typically have the lowest z
values.
2-10
Defining Coordinate Systems
References
Recommended Practice for Atmospheric and Space Flight Vehicle Coordinate
Systems, R-004-1992, ANSI/AIAA, February 1992.
Mapping Toolbox documentation, The MathWorks, Inc., Natick,
Massachusetts. Mapping Toolbox.
Rogers, R. M., Applied Mathematics in Integrated Navigation Systems, AIAA,
Reston, Virginia, 2000.
Stevens, B. L., and F. L. Lewis, Aircraft Control and Simulation, 2nd ed.,
Wiley-Interscience, New York, 2003.
Thomson, W. T., Introduction to Space Dynamics, John Wiley & Sons, New
York, 1961/Dover Publications, Mineola, New York, 1986.
World Geodetic System 1984 (WGS 84),
http://earth-info.nga.mil/GandG/wgs84.
2-11
2 Using Aerospace Toolbox
Aerospace Units
The Aerospace Toolbox functions support standard measurement systems.
The Unit Conversion functions provide means for converting common
measurement units from one system to another, such as converting velocity
from feet per second to meters per second and vice versa.
The unit conversion functions support all units listed in this table.
Quantity MKS (SI) English
Acceleration meters/second
2
(m/s
2
),
kilometers/second
2
(km/s
2
),
(kilometers/hour)/second
(km/h-s), g-unit (g)
inches/second
2
(in/s
2
),
feet/second
2
(ft/s
2
),
(miles/hour)/second
(mph/s), g-unit (g)
Angle radian (rad), degree
(deg), revolution
radian (rad), degree
(deg), revolution
Angular acceleration radians/second
2
(rad/s
2
),
degrees/second
2
(deg/s
2
)
radians/second
2
(rad/s
2
),
degrees/second
2
(deg/s
2
)
Angular velocity radians/second (rad/s),
degrees/second (deg/s),
revolutions/minute
(rpm),
revolutions/second (rps)
radians/second (rad/s),
degrees/second (deg/s),
revolutions/minute
(rpm), revolutions/second
(rps)
Density kilogram/meter
3
(kg/m
3
) pound mass/foot
3
(lbm/ft
3
), slug/foot
3
(slug/ft
3
), pound
mass/inch
3
(lbm/in
3
)
Force newton (N) pound (lb)
Inertia kilogram-meter
2
(kg-m
2
) slug-foot
2
(slug-ft
2
)
Length meter (m) inch (in), foot (ft), mile
(mi), nautical mile (nm)
Mass kilogram (kg) slug (slug), pound mass
(lbm)
2-12
Aerospace Units
Quantity MKS (SI) English
Pressure pascal (Pa) pound/inch
2
(psi),
pound/foot
2
(psf),
atmosphere (atm)
Temperature kelvin (K), degrees
Celsius (
o
C)
degrees Fahrenheit (
o
F),
degrees Rankine (
o
R)
Torque newton-meter (N-m) pound-feet (lb-ft)
Velocity meters/second (m/s),
kilometers/second
(km/s), kilometers/hour
(km/h)
inches/second (in/sec),
feet/second (ft/sec),
feet/minute (ft/min),
miles/hour (mph), knots
2-13
2 Using Aerospace Toolbox
Digital DATCOM Data
In this section...
Digital DATCOM Data Overview on page 2-14
USAF Digital DATCOM File on page 2-14
Data from DATCOM Files on page 2-15
Imported DATCOM Data on page 2-15
Missing DATCOM Data on page 2-17
Aerodynamic Coefficients on page 2-22
Digital DATCOM Data Overview
The Aerospace Toolbox product enables bringing United States Air Force
(USAF) Digital DATCOM files into the MATLAB environment by using
the datcomimport function. For more information, see the datcomimport
function reference page. This section explains how to import data from a
USAF Digital DATCOM file.
The example used in the following topics is available as an Aerospace Toolbox
example. You can run the example by entering astimportddatcom in the
MATLAB Command Window.
USAF Digital DATCOM File
The following is a sample input file for USAF Digital DATCOM for a
wing-body-horizontal tail-vertical tail configuration running over five alphas,
two Mach numbers, and two altitudes and calculating static and dynamic
derivatives. You can also view this file by entering type astdatcom.in in the
MATLAB Command Window.
$FLTCON NMACH=2.0,MACH(1)=0.1,0.2$
$FLTCON NALT=2.0,ALT(1)=5000.0,8000.0$
$FLTCON NALPHA=5.,ALSCHD(1)=-2.0,0.0,2.0,
ALSCHD(4)=4.0,8.0,LOOP=2.0$
$OPTINS SREF=225.8,CBARR=5.75,BLREF=41.15$
$SYNTHS XCG=7.08,ZCG=0.0,XW=6.1,ZW=-1.4,ALIW=1.1,XH=20.2,
ZH=0.4,ALIH=0.0,XV=21.3,ZV=0.0,VERTUP=.TRUE.$
2-14
Digital DATCOM Data
$BODY NX=10.0,
X(1)=-4.9,0.0,3.0,6.1,9.1,13.3,20.2,23.5,25.9,
R(1)=0.0,1.0,1.75,2.6,2.6,2.6,2.0,1.0,0.0$
$WGPLNF CHRDTP=4.0,SSPNE=18.7,SSPN=20.6,CHRDR=7.2,SAVSI=0.0,CHSTAT=0.25,
TWISTA=-1.1,SSPNDD=0.0,DHDADI=3.0,DHDADO=3.0,TYPE=1.0$
NACA-W-6-64A412
$HTPLNF CHRDTP=2.3,SSPNE=5.7,SSPN=6.625,CHRDR=0.25,SAVSI=11.0,
CHSTAT=1.0,TWISTA=0.0,TYPE=1.0$
NACA-H-4-0012
$VTPLNF CHRDTP=2.7,SSPNE=5.0,SSPN=5.2,CHRDR=5.3,SAVSI=31.3,
CHSTAT=0.25,TWISTA=0.0,TYPE=1.0$
NACA-V-4-0012
CASEID SKYHOGG BODY-WING-HORIZONTAL TAIL-VERTICAL TAIL CONFIG
DAMP
NEXT CASE
The output file generated by USAF Digital DATCOM for the same
wing-body-horizontal tail-vertical tail configuration running over five alphas,
two Mach numbers, and two altitudes can be viewed by entering type
astdatcom.out in the MATLAB Command Window.
Data from DATCOM Files
Use the datcomimport function to bring the Digital DATCOM data into the
MATLAB environment.
alldata = datcomimport('astdatcom.out', true, 0);
Imported DATCOM Data
The datcomimport function creates a cell array of structures containing the
data from the Digital DATCOM output file.
data = alldata{1}
data =
case: 'SKYHOGG BODY-WING-HORIZONTAL TAIL-VERTICAL TAIL CONFIG'
mach: [0.1000 0.2000]
alt: [5000 8000]
alpha: [-2 0 2 4 8]
nmach: 2
2-15
2 Using Aerospace Toolbox
nalt: 2
nalpha: 5
rnnub: []
hypers: 0
loop: 2
sref: 225.8000
cbar: 5.7500
blref: 41.1500
dim: 'ft'
deriv: 'deg'
stmach: 0.6000
tsmach: 1.4000
save: 0
stype: []
trim: 0
damp: 1
build: 1
part: 0
highsym: 0
highasy: 0
highcon: 0
tjet: 0
hypeff: 0
lb: 0
pwr: 0
grnd: 0
wsspn: 18.7000
hsspn: 5.7000
ndelta: 0
delta: []
deltal: []
deltar: []
ngh: 0
grndht: []
config: [1x1 struct]
cd: [5x2x2 double]
cl: [5x2x2 double]
cm: [5x2x2 double]
cn: [5x2x2 double]
ca: [5x2x2 double]
2-16
Digital DATCOM Data
xcp: [5x2x2 double]
cla: [5x2x2 double]
cma: [5x2x2 double]
cyb: [5x2x2 double]
cnb: [5x2x2 double]
clb: [5x2x2 double]
qqinf: [5x2x2 double]
eps: [5x2x2 double]
depsdalp: [5x2x2 double]
clq: [5x2x2 double]
cmq: [5x2x2 double]
clad: [5x2x2 double]
cmad: [5x2x2 double]
clp: [5x2x2 double]
cyp: [5x2x2 double]
cnp: [5x2x2 double]
cnr: [5x2x2 double]
clr: [5x2x2 double]
Missing DATCOM Data
By default, missing data points are set to 99999 and data points are set to
NaN where no DATCOM methods exist or where the method is not applicable.
It can be seen in the Digital DATCOM output file and examining the imported
data that
C
Y
,
C
n
,
C
lq
, and
C
mq
have data only in the first alpha value.
Here are the imported data values.
data.cyb
ans(:,:,1) =
1.0e+004 *
-0.0000 -0.0000
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
2-17
2 Using Aerospace Toolbox
ans(:,:,2) =
1.0e+004 *
-0.0000 -0.0000
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
data.cnb
ans(:,:,1) =
1.0e+004 *
0.0000 0.0000
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
ans(:,:,2) =
1.0e+004 *
0.0000 0.0000
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
data.clq
ans(:,:,1) =
1.0e+004 *
0.0000 0.0000
9.9999 9.9999
9.9999 9.9999
2-18
Digital DATCOM Data
9.9999 9.9999
9.9999 9.9999
ans(:,:,2) =
1.0e+004 *
0.0000 0.0000
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
data.cmq
ans(:,:,1) =
1.0e+004 *
-0.0000 -0.0000
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
ans(:,:,2) =
1.0e+004 *
-0.0000 -0.0000
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
9.9999 9.9999
The missing data points will be filled with the values for the first alpha, since
these data points are meant to be used for all alpha values.
aerotab = {'cyb' 'cnb' 'clq' 'cmq'};
2-19
2 Using Aerospace Toolbox
for k = 1:length(aerotab)
for m = 1:data.nmach
for h = 1:data.nalt
data.(aerotab{k})(:,m,h) = data.(aerotab{k})(1,m,h);
end
end
end
Here are the updated imported data values.
data.cyb
ans(:,:,1) =
-0.0035 -0.0035
-0.0035 -0.0035
-0.0035 -0.0035
-0.0035 -0.0035
-0.0035 -0.0035
ans(:,:,2) =
-0.0035 -0.0035
-0.0035 -0.0035
-0.0035 -0.0035
-0.0035 -0.0035
-0.0035 -0.0035
data.cnb
ans(:,:,1) =
1.0e-003 *
0.9142 0.8781
0.9142 0.8781
0.9142 0.8781
0.9142 0.8781
0.9142 0.8781
2-20
Digital DATCOM Data
ans(:,:,2) =
1.0e-003 *
0.9190 0.8829
0.9190 0.8829
0.9190 0.8829
0.9190 0.8829
0.9190 0.8829
data.clq
ans(:,:,1) =
0.0974 0.0984
0.0974 0.0984
0.0974 0.0984
0.0974 0.0984
0.0974 0.0984
ans(:,:,2) =
0.0974 0.0984
0.0974 0.0984
0.0974 0.0984
0.0974 0.0984
0.0974 0.0984
data.cmq
ans(:,:,1) =
-0.0892 -0.0899
-0.0892 -0.0899
-0.0892 -0.0899
-0.0892 -0.0899
-0.0892 -0.0899
ans(:,:,2) =
2-21
2 Using Aerospace Toolbox
-0.0892 -0.0899
-0.0892 -0.0899
-0.0892 -0.0899
-0.0892 -0.0899
-0.0892 -0.0899
Aerodynamic Coefficients
You can now plot the aerodynamic coefficients:
Plotting Lift Curve Moments on page 2-22
Plotting Drag Polar Moments on page 2-23
Plotting Pitching Moments on page 2-24
Plotting Lift Curve Moments
h1 = figure;
figtitle = {'Lift Curve' ''};
for k=1:2
subplot(2,1,k)
plot(data.alpha,permute(data.cl(:,k,:),[1 3 2]))
grid
ylabel(['Lift Coefficient (Mach =' num2str(data.mach(k)) ')'])
title(figtitle{k});
end
xlabel('Angle of Attack (deg)')
2-22
Digital DATCOM Data
Plotting Drag Polar Moments
h2 = figure;
figtitle = {'Drag Polar' ''};
for k=1:2
subplot(2,1,k)
plot(permute(data.cd(:,k,:),[1 3 2]),permute(data.cl(:,k,:),[1 3 2]))
grid
ylabel(['Lift Coefficient (Mach =' num2str(data.mach(k)) ')'])
title(figtitle{k})
end
xlabel('Drag Coefficient')
2-23
2 Using Aerospace Toolbox
Plotting Pitching Moments
h3 = figure;
figtitle = {'Pitching Moment' ''};
for k=1:2
subplot(2,1,k)
plot(permute(data.cm(:,k,:),[1 3 2]),permute(data.cl(:,k,:),[1 3 2]))
grid
ylabel(['Lift Coefficient (Mach =' num2str(data.mach(k)) ')'])
title(figtitle{k})
end
xlabel('Pitching Moment Coefficient')
2-24
Digital DATCOM Data
2-25
2 Using Aerospace Toolbox
3-D Flight Data Playback
Aerospace Toolbox Animation Objects
To visualize flight data in the Aerospace Toolbox environment, you can
use the following animation objects and their associated methods. These
animation objects use the MATLAB time series object, timeseries to
visualize flight data.
Aero.Animation Visualize flight data without any other tool or toolbox.
The following objects support this object.
- Aero.Body
- Aero.Camera
- Aero.Geometry
For more information, see Aero.Animation Objects on page 2-27.
Aero.VirtualRealityAnimation Visualize flight data with the
Simulink 3D Animation product. The following objects support this object.
- Aero.Node
- Aero.Viewpoint
For more information, see Aero.VirtualRealityAnimation Objects on page
2-37.
Aero.FlightGearAnimation Visualize flight data with the FlightGear
simulator. For more information, see Aero.FlightGearAnimation Objects
on page 2-57.
2-26
Aero.Animation Objects
Aero.Animation Objects
The toolbox interface to animation objects uses the Handle Graphics
,
]
]
]
,
,
]
]
]
,
,
]
]
]
cos sin
sin cos
where ( ) is the angle in degrees clockwise between the x-axis and
north.
To convert the North and East coordinates to geodetic latitude and
longitude, the estimation uses the radius of curvature in the prime
vertical (R
N
) and the radius of curvature in the meridian (R
M
). (R
N
) and
(R
M
) are defined by the following relationships:
3-200
flat2lla
R
R
f f
R R
f f
f f
N
M N
1 2
1 2
1 2
2 2
0
2
2 2
0
( ) sin
( )
( ) sin
j
(
,
\
,
(
j
(
,
\
,
(
atan
atan
1
1
cos
The output latitude and longitude are the initial latitude and longitude
plus the small changes in latitude and longitude.
+
+
0
0
d
d
The altitude is the negative flat Earth z-axis value minus the reference
height (h
ref
).
h p h
z ref
References Etkin, B., Dynamics of Atmospheric Flight. NewYork: John Wiley &
Sons, 1972.
Stevens, B. L., and F. L. Lewis, Aircraft Control and Simulation, 2nd
ed. New York: John Wiley & Sons, 2003.
3-201
flat2lla
See Also lla2flat
3-202
flowfanno
Purpose Fanno line flow relations
Syntax [mach, T, P, rho, velocity, P0, fanno] = flowfanno(gamma,
fanno_flow, mtype)
Description [mach, T, P, rho, velocity, P0, fanno] = flowfanno(gamma,
fanno_flow, mtype) returns an array for each Fanno line flow
relation. This function calculates the arrays for a given set of specific
heat ratios (gamma), and any one of the Fanno flow types. You select
the Fanno flow type with mtype.
This function uses Fanno variables given by the following. F is the
Fanno parameter given by F = f*L/D. f is the friction coefficient. L is
the length of constant area duct required to achieve sonic flow. D is
the hydraulic diameter of the duct.
This function assumes that variables vary in one dimension only. It also
assumes that the main mechanism for the change of flow variables is
the change of cross-sectional area of the flow stream tubes.
If the temperature experiences large fluctuations, the perfect gas
assumption might be invalid. If the stagnation temperature is above
1500 K, do not assume constant specific heats. In this case, the medium
ceases to be a calorically perfect gas. Consider it a thermally perfect gas.
See 2 for thermally perfect gas correction factors. If the temperature is
so high that molecules dissociate and ionize (static temperature 5000 K
for air), you cannot assume a perfect gas.
Input
Arguments
gamma
Array of N specific heat ratios. gamma must be either a scalar or an array
of N real numbers greater than 1. gamma must be a real, finite scalar
greater than 1 for the following input modes: subsonic total pressure
ratio, supersonic total pressure ratio, subsonic Fanno parameter, and
supersonic Fanno parameter.
fanno_flow
3-203
flowfanno
Array of real numerical values for one Fanno flow. This argument can
be one of the following:
Array of Mach numbers. flow_fanno must be a scalar or an array of
N real numbers greater than or equal to 0. If flow_fanno and gamma
are arrays, they must be the same size.
Use flow_fanno with the mtype value 'mach'. Because 'mach' is the
default of mtype, mtype is optional when this array is the input mode.
Array of temperature ratios. The temperature ratio is the local static
temperature over the reference static temperature for sonic flow.
This array must be a scalar or array of N real numbers:
- Greater than or equal to 0 (as the Mach number approaches
infinity)
- Less than or equal to (gamma+1)/2 (at Mach number equal 0)
Use flow_fanno with mtype value 'temp'.
Array of pressure ratios. The pressure ratio is the local static
pressure over the reference static pressure for sonic flow. flow_fanno
must be a scalar or array of real numbers greater than or equal to 0.
If flow_fanno and gamma are arrays, they must be the same size.
Use flow_fanno with mtype value 'pres'.
Array of density ratios. The density ratio is the local density over the
reference density for sonic flow. flow_fanno must be a scalar or array
of real numbers. These numbers must be greater than or equal to:
sqrt((gamma-1)/(gamma+1)) (as the Mach number approaches infinity).
If flow_fanno and gamma are arrays, they must be the same size.
Use flow_fanno with mtype value 'dens'.
Array of velocity ratios. The velocity ratio is the local velocity over
the reference velocity for sonic flow. flow_fanno must be a scalar
or an array of N of real numbers:
- Greater than or equal to 0
3-204
flowfanno
- Less than or equal to sqrt((gamma+1)/(gamma-1)) (as the Mach
number approaches infinity)
If flow_fanno and gamma are both arrays, they must be the same size.
Use flow_fanno with mtype value 'velo'.
Scalar value of total pressure ratio. The total pressure ratio is the
local total pressure over the reference total pressure for sonic flow.
flow_fanno must be greater than or equal to 1.
Use flow_fanno with mtype values 'totalp' and 'totalpsup'.
Scalar value for Fanno parameter. The Fanno parameter is
flow_fanno= f*L/D. f is the friction coefficient. L is the length of
constant area duct required to achieve sonic flow. D is the hydraulic
diameter of the duct. In subsonic mode, flow_fanno must be greater
than or equal to 0. In supersonic mode, flow_fanno must be:
- Greater than or equal to 0 (at Mach number equal 1)
- Less than or equal to
(gamma+1)/(2*gamma)*log((gamma+1)/(gamma-1))-1/gamma (as Mach
number approaches infinity)
Use flow_fanno with mtype values 'fannosub' and 'fannosup'.
mtype
A string that defines the input mode for the type of Fanno flow in
fanno_flow.
Type Description
'mach' Default Mach number
'temp' Temperature ratio
'pres' Pressure ratio
'dens' Density ratio
'velo' Velocity ratio
3-205
flowfanno
Type Description
'totalpsub' Subsonic total pressure ratio
'totalpsup' Supersonic total pressure ratio
'fannosub' Subsonic Fanno parameter
'fannosup' Supersonic Fanno parameter
Output
Arguments
All outputs are the same size as the array inputs. If there are no array
inputs, all outputs are scalars.
mach
Array of Mach numbers.
T
Array of temperature ratios. The temperature ratio is the local static
temperature over the reference static temperature for sonic flow.
P
Array of pressure ratios. The pressure ratio is the local static pressure
over the reference static pressure for sonic flow.
rho
Array of density ratio. The density ratio is the local density over the
reference density for sonic flow.
velocity
Array of velocity ratios. The velocity ratio is the local velocity over the
reference velocity for sonic flow.
P0
Array of stagnation (total) pressure ratio. The total pressure ratio is the
local total pressure over the reference total pressure for sonic flow.
3-206
flowfanno
fanno
Array of Fanno parameters. The Fanno parameter is F = f*L/D. f is the
friction coefficient. L is the length of constant area duct required to
achieve sonic flow. D is the hydraulic diameter of the duct.
Examples Calculate the Fanno line flow relations for air (gamma = 1.4) for subsonic
Fanno parameter 1.2. The following returns scalar values for mach, T,
P, rho, velocity, P0, and fanno.
[mach, T, P, rho, velocity, P0, fanno] = flowfanno(1.4, 1.2, 'fannosub')
Calculate the Fanno line flow relations for gases with specific heat
ratios given in the following 1 x 4 row array for the Mach number 0.5.
The following yields a 1 x 4 row array for mach, T, P, rho, velocity,
P0, and fanno.
gamma = [1.3, 1.33, 1.4, 1.67];
[mach, T, P, rho, velocity, P0, fanno] = flowfanno(gamma, 0.5)
Calculate the Fanno line flow relations for a specific heat ratio of 1.4
and range of temperature ratios from 0.40 to 0.70 in increments of
0.10. The following returns a 4 x 1 column array for mach, T, P, rho,
velocity, P0, and fanno.
[mach, T, P, rho, velocity, P0, fanno] = flowfanno(1.4, [1.1 1.2], 'temp')
Calculate the Fanno line flow relations for gases with specific heat ratio
and velocity ratio combinations as shown. The following returns a 1 x 2
array for mach, T, P, rho, velocity, P0, and fanno each. The elements
of each array correspond to the inputs element-wise.
gamma = [1.3, 1.4];
V = [0.53, 0.49];
3-207
flowfanno
[MACH, T, P, RHO, V, P0, F] = flowfanno(gamma, V, 'velo')
References 1. James, J. E. A., Gas Dynamics, Second Edition, Allyn and Bacon,
Inc, Boston, 1984.
2. NACA Technical Report 1135, 1953, National Advisory Committee on
Aeronautics, Ames Research Staff, Moffett Field, Calif. Pages 667671.
See Also flowisentropic | flownormalshock | flowprandtlmeyer |
flowrayleigh
3-208
flowisentropic
Purpose Isentropic flow ratios
Syntax [mach, T, P, rho, area] = flowisentropic(gamma,
flow, mtype)
Description [mach, T, P, rho, area] = flowisentropic(gamma, flow,
mtype) returns an array. This array contains an isentropic flow Mach
number (mach), temperature ratio (T), pressure ratio (P), density ratio
(rho), and area ratio (area). This function calculates these arrays given
a set of specific heat ratios (gamma), and any one of the isentropic flow
types. You select the isentropic flow with mtype.
This function assumes that variables vary in one dimension only. It also
assumes that the main mechanism for the change of flow variables is
the change of cross-sectional area of the flow stream tubes.
This function assumes that the environment is a perfect gas. In
the following instances, the function cannot assume a perfect gas
environment. If there is a large change in either temperature or
pressure without a proportionally large change in the other, the
function cannot assume a perfect gas environment. . If the stagnation
temperature is above 1500 K, do not assume that constant specific
heats. In this case, the medium ceases to be a calorically perfect
gas. Consider it a thermally perfect gas. See 2 for thermally perfect
gas correction factors. If the temperature is so high that molecules
dissociate and ionize (static temperature 5000 K for air), you cannot
assume a calorically or thermally perfect gas.
Input
Arguments
gamma
Array of N specific heat ratios. gamma must be a scalar or array of N
real numbers greater than 1. For subsonic area ratio input mode and
supersonic area ratio input mode, gamma must be a real, finite scalar
greater than 1.
flow
3-209
flowisentropic
Array of real numerical values for one of the isentropic flow relations.
This argument can be one of the following:
Array of Mach numbers. flow must be a scalar or an array of N real
numbers greater than or equal to 0. If flow and gamma are arrays,
they must be the same size.
Use flow with the mtype value 'mach'. Because 'mach' is the default
of mtype, mtype is optional when this array is the input mode.
Array of temperature ratios. The temperature ratio is the local static
temperature over the stagnation temperature. flow must be a scalar
or an array of real numbers:
- Greater than or equal to 0 (as the Mach number approaches
infinity)
- Less than or equal to 1 (at Mach number equal 0)
If flow and gamma are both arrays, they must be the same size.
Use flow with mtype value 'temp'.
Array of pressure ratios. The pressure ratio is the local static
pressure over the stagnation pressure. flow must be a scalar or an
array of real numbers:
- Greater than or equal to 0 (as the Mach number approaches
infinity)
- Less than or equal to 1 (at Mach number equal 0)
If flow and gamma are both arrays, they must be the same size.
Use flow with mtype value 'pres'.
Array of density ratios. The density ratio is the local density over
the stagnation density. flow must be a scalar or an array of real
numbers:
- Greater than or equal to 0 (as the Mach number approaches
infinity)
- Less than or equal to 1 (at Mach number equal 0)
3-210
flowisentropic
If flow and gamma are both arrays, they must be the same size.
Use flow with mtype value 'dens'.
Scalar value of area ratio. flow must be a real value greater than or
equal to 1.
Use flow with mtype value 'sup'.
mtype
A string that defines the input mode for the isentropic flow in flow.
Type Description
'mach' Default. Mach number.
'temp' Temperature ratio.
'pres' Pressure ratio.
'dens' Density ratio.
'sub' Subsonic area ratio. The subsonic area ratio is the local
subsonic stream tube area over the reference stream tube
area for sonic conditions.
'sup' Supersonic area ratio. The supersonic area ratio is the
local supersonic stream tube area over the reference
stream tube area for sonic conditions.
Output
Arguments
All outputs are the same size as the array inputs. If there are no array
inputs, all outputs are scalars.
mach
Array of Mach numbers.
T
Array of temperature ratios. The temperature ratio is the local static
temperature over the stagnation temperature.
3-211
flowisentropic
P
Array of pressure ratios. The pressure ratio is the local static pressure
over the stagnation pressure.
rho
Array of density ratios. The density ratio is the local density over the
stagnation density.
area
Array of area ratios. The area ratio is the local stream tube area over
the reference stream tube area for sonic conditions.
Examples Calculate the isentropic flow relations for air (gamma = 1.4) for a design
subsonic area ratio of 1.255. This example returns scalar values for
mach, T, P, rho, and area.
[mach, T, P, rho, area] = flowisentropic(1.4, 1.255, 'sub')
Calculate the isentropic flow relations for gases with specific heat ratios
given in the following 1 x 4 row array for the Mach number 0.5. This
example following returns a 1 x 4 row array for mach, T, P, rho, and area.
gamma = [1.3, 1.33, 1.4, 1.67];
[mach, T, P, rho, area] = flowisentropic(gamma, 0.5)
Calculate the isentropic flow relations for a specific heat ratio of
1.4. Also calculate range of temperature ratios from 0.40 to 0.70 in
increments of 0.10. This example returns a 4 x 1 column array for mach,
T, P, rho, and area.
[mach, T, P, rho, area] = flowisentropic(1.4, (0.40:0.10:0.70)', 'temp')
3-212
flowisentropic
Calculate the isentropic flow relations for gases with provided specific
heat ratio and density ratio combinations. This example returns a 1 x 2
array for mach, T, P, rho, and area each. The elements of each vector
correspond to the inputs element-wise.
gamma = [1.3, 1.4];
rho = [0.13, 0.9];
[mach, T, P, rho, area] = flowisentropic(gamma, rho , 'dens')
References 1. James, J. E. A., Gas Dynamics, Second Edition, Allyn and Bacon,
Inc, Boston, 1984.
2. NACA Technical Report 1135, 1953, National Advisory Committee on
Aeronautics, Ames Research Staff, Moffett Field, Calif. Pages 667671.
See Also flownormalshock | flowprandtlmeyer | flowfanno | flowrayleigh
3-213
flownormalshock
Purpose Normal shock relations
Syntax [mach, T, P, rho, downstream_mach, P0,
P1] = flownormalshock(gamma, normal_shock_relations,
mtype)
Description [mach, T, P, rho, downstream_mach, P0, P1] =
flownormalshock(gamma, normal_shock_relations,
mtype) produces an array for each normal shock relation
(normal_shock_relations). This function calculates these arrays for
a given set of specific heat ratios (gamma) and any one of the normal
shock relations (normal_shock_relations). mtype selects the normal
shock relations that normal_shock_relations represents. All ratios
are downstream value over upstream value. Consider upstream to be
before or ahead of the shock; downstream is after or behind the shock.
This function assumes that the medium is a calorically perfect gas. It
assumes that the flow is frictionless and adiabatic. It assumes that
the flow variables vary in one dimension only. It assumes that the
main mechanism for the change of flow variables is the change of
cross-sectional area of the flow stream tubes.
If the temperature experiences large fluctuations, the perfect gas
assumption might be invalid. If the stagnation temperature is above
1500 K, do not assume constant specific heats. In this case, the medium
ceases to be a calorically perfect gas. You must then consider it a
thermally perfect gas. See 2 for thermally perfect gas correction factors.
If the temperature is so high that molecules dissociate and ionize (static
temperature 5000 K for air), you cannot assume a perfect gas.
Input
Arguments
gamma
Array of N specific heat ratios. gamma must be either a scalar or an array
of N real numbers greater than 1. For temperature ratio, total pressure
ratio, and Rayleigh-Pitot ratio input modes, gamma must be a real, finite
scalar greater than 1.
normal_shock_relations
3-214
flownormalshock
Array of real numerical values for one of the normal shock relations.
This argument can be one of the following:
Array of upstream Mach numbers. This array must be a scalar
or an array of N real numbers greater than or equal to 1. If
normal_shock_relations and gamma are arrays, they must be the
same size.
Use normal_shock_relations with mtype value 'mach'. Because
'mach' is the default of mtype, mtype is optional when this array
is the input mode.
Scalar value of temperature ratio. The temperature ratio is the static
temperature downstream of the shock over the static temperature
upstream of the shock. normal_shock_relations must be a real
scalar greater than or equal to 1.
Use normal_shock_relations with mtype value 'temp'.
Array of pressure ratios. The pressure ratio is the static pressure
downstream of the shock over the static pressure upstream of the
shock. normal_shock_relations must be a scalar or array of real
numbers greater than or equal to 1. If normal_shock_relations and
gamma are arrays, they must be the same size.
Use normal_shock_relations with mtype value 'pres'.
Array of density ratios. The density ratio is the density of the fluid
downstream of the shock over the density upstream of the shock.
normal_shock_relations must a scalar or array of real numbers be:
- Greater than or equal to 1 (at Mach number equal 1)
- Less than or equal to (gamma+1)/(gamma-1) (as the Mach number
approaches infinity)
If normal_shock_relations and gamma are arrays, they must be the
same size. Use normal_shock_relations with mtype value 'dens'.
Array of downstream Mach numbers. normal_shock_relations
must be scalar or array of real numbers:
3-215
flownormalshock
- Greater than or equal to 0 (as the Mach number approaches
infinity)
- Less than or equal to sqrt((gamma-1)/(2*gamma)) (at Mach number
equal 1)
If normal_shock_relations and gamma are arrays, they must be the
same size. Use normal_shock_relations with mtype value 'down'.
Scalar value of total pressure ratio. The total pressure ratio is the
total pressure downstream of the shock over the total pressure
upstream of the shock. normal_shock_relations must be:
- Greater than or equal to 0 (as the Mach number approaches
infinity)
- Less than or equal to 1 (at Mach number equal 1)
If normal_shock_relations and gamma are both arrays, they must
be the same size. Use normal_shock_relations with mtype value
'totalp'.
Scalar value of Rayleigh-Pitot ratio. The Rayleigh-Pitot ratio is
the static pressure upstream of the shock over the total pressure
downstream of the shock. normal_shock_relations must be:
- Real scalar greater than or equal to 0 (as the Mach number
approaches infinity)
- Less than or equal to ((gamma+1)/2)^(-gamma/(gamma-1)) (at Mach
number equal 1)
If normal_shock_relations and gamma are both arrays, they must
be the same size. Use normal_shock_relations with mtype value
'pito'.
mtype
A string that defines the input mode for the normal shock relations in
normal_shock_relations.
3-216
flownormalshock
Type Description
'mach' Default. Mach number.
'temp' Temperature ratio.
'pres' Pressure ratio.
'dens' Density ratio.
'velo' Velocity ratio.
'totalp' Total pressure ratio.
'pito' Rayleigh-Pitot ratio.
Output
Arguments
mach
Array of upstream Mach numbers.
P
Array of pressure ratios. The pressure ratio is the static pressure
downstream of the shock over the static pressure upstream of the shock.
T
Array of temperature ratios. The temperature ratio is the static
temperature downstream of the shock over the static temperature
upstream of the shock.
rho
Array of density ratios. The density ratio is the density of the fluid
downstream of the shock over the density upstream of the shock.
downstream_mach
Array of downstream Mach numbers.
P0
3-217
flownormalshock
Array of total pressure ratios. The total pressure ratio is the total
pressure downstream of the shock over the total pressure upstream
of the shock.
P1
Array of Rayleigh-Pitot ratios. The Rayleigh-Pitot ratio is the static
pressure upstream of the shock over the total pressure downstream
of the shock.
Examples Calculate the normal shock relations for air (gamma = 1.4) for total
pressure ratio of 0.61. The following returns scalar values for mach, T, P,
rho, downstream_mach, P0, and P1.
[mach, T, P, rho, downstream_mach, P0, P1] = flownormalshock(1.4, 0.61, 'totalp')
Calculate the normal shock relations for gases with specific heat ratios
given in the following 1 x 4 row array for upstream Mach number 1.5.
The follow yields a 1 x 4 array for mach, T, P, rho, downstream_mach,
P0, and P1.
gamma = [1.3, 1.33, 1.4, 1.67];
[mach, T, P, rho, downstream_mach, P0, P1] = flownormalshock(gamma, 1.5)
Calculate the normal shock relations for a specific heat ratio of
1.4 and range of density ratios from 2.40 to 2.70 in increments of
0.10. The following returns a 4 x 1 column array for mach, T, P, rho,
downstream_mach, P0, and P1.
[mach, T, P, rho, downstream_mach, P0, P1] = flownormalshock(1.4,...
(2.4:.1:2.7)', 'dens')
Calculate the normal shock relations for gases with specific heat ratio
and downstream Mach number combinations as shown. The following
3-218
flownormalshock
example returns a 1 x 2 array for mach, T, P, rho, downstream_mach,
P0, and P1 each, where the elements of each vector corresponds to the
inputs element-wise.
gamma = [1.3, 1.4];
downstream_mach = [.34, .49];
[mach, T, P, rho, downstream_mach, P0, P1] = flownormalshock(gamma,...
downstream_mach, 'down')
References 1. James, J. E. A., Gas Dynamics, Second Edition, Allyn and Bacon,
Inc, Boston, 1984.
2. NACA Technical Report 1135, 1953, National Advisory Committee on
Aeronautics, Ames Research Staff, Moffett Field, Calif. Pages 667671.
See Also flowisentropic | flowprandtlmeyer | flowfanno | flowrayleigh
3-219
flowprandtlmeyer
Purpose Calculate Prandtl-Meyer functions for expansion waves
Syntax [mach, nu, mu] = flowprandtlmeyer(gamma,
prandtlmeyer_array,
mtype)
Description [mach, nu, mu] = flowprandtlmeyer(gamma,
prandtlmeyer_array, mtype) calculates the following: array of Mach
numbers, mach, Prandtl-Meyer angles (nu in degrees) and Mach angles
(mu in degrees). flowprandtlmeyer calculates these arrays for a given
set of specific heat ratios, gamma, and any one of the Prandtl-Meyer
types. You select the Prandtl-Meyer type with mtype.
The function assumes that the flow is two-dimensional. The function
also assumes a smooth and gradual change in flow properties through
the expansion fan.
Note, this function assumes that the environment is a perfect gas. In
the following instances, it cannot assume a perfect gas environment.
If there is a large change in either temperature or pressure without a
proportionally large change in the other, it cannot assume a perfect
gas environment. If the stagnation temperature is above 1500 K, the
function cannot assume constant specific heats. In this case, you must
consider it a thermally perfect gas. See 2 for thermally perfect gas
correction factors. The local static temperature might be so high that
molecules dissociate and ionize (static temperature 5000 K for air). In
this case, you cannot assume a calorically or thermally perfect gas.
Input
Arguments
gamma
Array of N specific heat ratios. gamma must be a scalar or array of N
real numbers greater than 1. For subsonic area ratio input mode and
supersonic area ratio input mode, gamma must be a real, finite scalar
greater than 1.
prandtlmeyer_array
3-220
flowprandtlmeyer
Array of real numerical values for one of the Prandtl-Meyer types. This
argument can be one of the following:
Array of Mach numbers. This array must be a scalar or an array of N
real numbers greater than or equal to 0. If prandtlmeyer_array and
gamma are arrays, they must be the same size.
Use prandtlmeyer_array with mtype value 'mach'. Note, because
'mach' is the default of mtype, mtype is optional when this array
is the input mode.
Scalar value for Prandtl-Meyer angle in degrees. This value is the
angle change required for a Mach 1 flow to achieve a given Mach
number after expansion. prandtlmeyer_array must be:
- Real scalar greater than or equal to 0 (at Mach number equal 1)
- Less than or equal to 90 * (sqrt((gamma+1)/(gamma-1)) - 1) (as the
Mach number approaches infinity).
Use prandtlmeyer_array with mtype value 'nu'.
Array of Mach angles in degrees. These values are the angles
between the flow direction and the lines of pressure disturbance
caused by supersonic motion. The Mach angle is a function of Mach
number only. prandtlmeyer_array must be a scalar or array of
N real numbers that are:
- Greater than or equal to 0 (as the Mach number approaches
infinity).
- Less than or equal to 90 (at Mach number equal 1).
Use prandtlmeyer_array with mtype value 'mu'.
mtype
A string for selecting the isentropic flow variable represented by
prandtlmeyer_array.
3-221
flowprandtlmeyer
Type Description
'mach' Default. Mach number..
'nu' Prandtl-Meyer angle
'mu' Mach angle.
Output
Arguments
mach
Array of Mach numbers. In Prandtl-Meyer angle input mode, mach
outputs are the same size as the array input or array inputs. If there
are no array inputs, mach is a scalar.
nu
Array of Prandtl-Meyer angles. The Prandtl-Meyer angle is the angle
change required for a Mach 1 flow to achieve a given Mach number
after expansion.
mu
Array of Mach angles. The Mach angle is between the flow direction
and the lines of pressure disturbance caused by supersonic motion.
Examples Calculate the Prandtl-Meyer relations for air (gamma = 1.4) for
Prandtl-Meyer angle 61 degrees. The following returns a scalar for
mach, nu, and mu.
[mach, nu, mu] = flowprandtlmeyer(1.4, 61, 'nu')
Calculate the Prandtl-Meyer functions for gases with specific heat
ratios. The following yields a 1 x 4 array for nu, but only a scalar for
mach and mu.
gamma = [1.3, 1.33, 1.4, 1.67];
[mach, nu, mu] = flowprandtlmeyer(gamma, 1.5)
3-222
flowprandtlmeyer
Calculate the Prandtl-Meyer angles for a specific heat ratio of 1.4 and
range of Mach angles from 40 degrees to 70 degrees. This example uses
increments of 10 degrees. The following returns a 4 x 1 column array
for mach, nu, and mu.
[mach, nu, mu] = flowprandtlmeyer(1.4, (40:10:70)', 'mu')
Calculate the Prandtl-Meyer relations for gases with specific heat ratio
and Mach number combinations as shown. The following returns a 1 x 2
array for nu and mu each, where the elements of each vector correspond
to the inputs element-wise.
gamma = [1.3, 1.4];
prandtlmeyer_array = [1.13, 9];
[mach, nu, mu] = flowprandtlmeyer(gamma,prandtlmeyer_array)
References 1. James, J. E. A., Gas Dynamics, Second Edition, Allyn and Bacon,
Inc, Boston, 1984.
2. NACA Technical Report 1135, 1953, National Advisory Committee on
Aeronautics, Ames Research Staff, Moffett Field, Calif. Pages 667671.
See Also flowisentropic | flownormalshock | flowrayleigh | flowfanno
3-223
flowrayleigh
Purpose Rayleigh line flow relations
Syntax [mach, T, P, rho, velocity, T0, P0] = flowrayleigh(gamma,
rayleigh_flow, mtype)
Description [mach, T, P, rho, velocity, T0, P0] = flowrayleigh(gamma,
rayleigh_flow, mtype) returns an array for each Rayleigh line flow
relation. This function calculates these arrays for a given set of specific
heat ratios (gamma), and any one of the Rayleigh line flow types. You
select the Rayleigh flow type with mtype.
This function assumes that the medium is a calorically perfect gas in
a constant area duct. It assumes that the flow is steady, frictionless,
and one dimensional. It also assumes that the main mechanism for the
change of flow variables is heat transfer.
This function assumes that the environment is a perfect gas. In the
following instances, it cannot assume a perfect gas environment. If
there is a large change in either temperature or pressure without a
proportionally large change in the other, it cannot assume a perfect gas
environment. If the stagnation temperature is above 1500 K, do not
assume constant specific heats. In this case, the medium ceases to be
a calorically perfect gas; you must then consider it a thermally perfect
gas. See 2 for thermally perfect gas correction factors. The local static
temperature might be so high that molecules dissociate and ionize
(static temperature 5000 K for air). In this case, you cannot assume a
calorically or thermally perfect gas.
Input
Arguments
gamma
Array of N specific heat ratios. gamma must be either a scalar or an array
of N real numbers greater than 1. gamma must be a real, finite scalar
greater than 1 for the following input modes: low speed temperature
ratio, high speed temperature ratio, subsonic total temperature,
supersonic total temperature, subsonic total pressure, and supersonic
total pressure.
rayleigh_flow
3-224
flowrayleigh
Array of real numerical values for one Rayleigh line flow. This
argument can be one of the following:
Array of Mach numbers. This array must be a scalar or an array of
N real numbers greater than or equal to 0. If rayleigh_flow and
gamma are arrays, they must be the same size.
Use rayleigh_flow with mtype value 'mach'. Because 'mach' is the
default of mtype, mtype is optional when this array is the input mode.
Scalar value of temperature ratio. The temperature ratio is the local
static temperature over the reference static temperature for sonic
flow. rayleigh_flow must be a real scalar:
- Greater than or equal to 0 (at the Mach number equal 0 for low
speeds or as Mach number approaches infinity for high speeds)
- Less than or equal to 1/4*(gamma+1/gamma)+1/2 (at mach =
1/sqrt(gamma))
Use rayleigh_flow with mtype values 'templo' and 'temphi'.
Array of pressure ratios. The pressure ratio is the local static pressure
over the reference static pressure for sonic flow. rayleigh_flow
must be a scalar or array of real numbers less than or equal to
gamma+1 (at the Mach number equal 0). If rayleigh_flow and gamma
are arrays, they must be the same size.
Use rayleigh_flow with mtype value 'pres'.
Array of density ratios. The density ratio is the local density over the
reference density for sonic flow. rayleigh_flow must be a scalar
or array of real numbers. These numbers must be greater than or
equal to:
gamma/(gamma+1) (as Mach number approaches infinity)
If rayleigh_flow and gamma are arrays, they must be the same size.
Use rayleigh_flow with mtype value 'dens'.
3-225
flowrayleigh
Array of velocity ratios. The velocity ratio is the local velocity over
the reference velocity for sonic flow. rayleigh_flow must be a scalar
or an array of N real numbers:
- Greater than or equal to 0
- Less than or equal to (gamma+1)/gamma (as Mach number
approaches infinity)
If rayleigh_flow and gamma are both arrays, they must be the same
size.
Use rayleigh_flow with mtype value 'velo'.
Scalar value of total temperature ratio. The total temperature ratio
is the local stagnation temperature over the reference stagnation
temperature for sonic flow. In subsonic mode, rayleigh_flow must
be a real scalar:
- Greater than or equal to 0 (at the Mach number equal 0)
- Less than or equal to 1 (at the Mach number equal 1)
In supersonic mode, rayleigh_flow must be a real scalar:
- Greater than or equal to
(gamma+1)^2*(gamma-1)/2/(gamma^2*(1+(gamma-1)/2))) (as Mach
number approaches infinity)
- Less than or equal to 1 (at the Mach number equal 1)
Use rayleigh_flow with the mtype values 'totaltsub' and
'totaltsup'.
Scalar value of total pressure ratio. The total pressure ratio is the
local stagnation pressure over the reference stagnation pressure for
sonic flow. In subsonic mode, rayleigh_flow must be a real scalar.
- Greater than or equal to 1 (at the Mach number equal 1)
- Less than or equal to (1+gamma)*(1+(gamma-1)/2)^(-gamma/(gamma-1))
(at Mach number equal 0)
3-226
flowrayleigh
In supersonic mode, rayleigh_flow must be a real scalar greater
than or equal to 1.
Use rayleigh_flow with mtype values 'totalpsub' and
'totalpsup'.
mtype
A string that defines the input mode for the Rayleigh flow in
rayleigh_flow.
Type Description
'mach' Default. Mach number.
'templo' Low speed static temperature ratio. The low speed
temperature ratio is the local static temperature
over the reference sonic temperature. This ratio for
when the Mach number of the upstream flow is less
than the critical Mach number of 1/sqrt(gamma).
'temphi' High speed static temperature ratio. The high speed
temperature ratio is the local static temperature
over the reference sonic temperature. This ratio
is for when the Mach number of the upstream
flow is greater than the critical Mach number of
1/sqrt(gamma).
'pres' Pressure ratio.
'dens' Density ratio.
'velo' Velocity ratio.
'totaltsub' Subsonic total temperature ratio.
'totaltsup' Supersonic total temperature ratio.
'totalpsub' Subsonic total pressure ratio.
'totalpsup' Supersonic total pressure ratio.
3-227
flowrayleigh
Output
Arguments
All output ratios are static conditions over the sonic conditions. All
outputs are the same size as the array inputs. If there are no array
inputs, all outputs are scalars.
mach
Array of Mach numbers.
T
Array of temperature ratios. The temperature ratio is the local static
temperature over the reference static temperature for sonic flow.
P
Array of pressure ratios. The pressure ratio is the local static pressure
over the reference static pressure for sonic flow.
rho
Array of density ratio. The density ratio is the local density over the
reference density for sonic flow.
velocity
Array of velocity ratios. The velocity ratio is the local velocity over the
reference velocity for sonic flow.
T0
Array of total temperature ratios. The temperature ratio is the local
static temperature over the reference static temperature for sonic flow.
P0
Array of total pressure ratios. The total pressure ratio is the local
stagnation pressure over the reference stagnation pressure for sonic
flow.
3-228
flowrayleigh
Examples Calculate Rayleigh Line Flow Relations Given Air
Calculate the Rayleigh line flow relations for air (gamma = 1.4) for
supersonic total pressure ratio 1.2.
[mach,T,P,rho,velocity,T0,P0] =
flowrayleigh(1.4,1.2,'totalpsup')
mach =
1.6397
T =
0.6823
P =
0.5038
rho =
0.7383
velocity =
1.3545
T0 =
0.8744
P0 =
1.2000
This example returns scalar values for mach, T, P, rho, velocity, T0,
and P0.
3-229
flowrayleigh
Calculate Rayleigh Line Flow Relations for Specific Heat
Ratios in Array
Calculate the Rayleigh line flow relations for gases with specific heat
ratios given in the following 1 x 4 row array for the Mach number 0.5.
gamma = [1.3,1.33,1.4,1.67];
[mach,T,P,rho,velocity,T0,P0] = flowrayleigh(gamma,0.5)
mach =
0.5000 0.5000 0.5000 0.5000
T =
0.7533 0.7644 0.7901 0.8870
P =
1.7358 1.7486 1.7778 1.8836
rho =
2.3043 2.2876 2.2500 2.1236
velocity =
0.4340 0.4371 0.4444 0.4709
T0 =
0.6796 0.6832 0.6914 0.7201
P0 =
1.1111 1.1121 1.1141 1.1202
3-230
flowrayleigh
This example returns a 1 x 4 row array for mach, T, P, rho, velocity,
T0, and P0.
Calculate Rayleigh Line Flow Relations for Specific Heat
Ratios and High Speed Temperature
Calculate the Rayleigh line flow relations for a specific heat ratio of 1.4
and high speed temperature ratio 0.70.
[mach,T,P,rho,velocity,T0,P0] =
flowrayleigh(1.4,0.70,'temphi')
mach =
1.6035
T =
0.7000
P =
0.5218
rho =
0.7454
velocity =
1.3416
T0 =
0.8833
P0 =
3-231
flowrayleigh
1.1777
This example returns scalar values for mach, T, P, rho, velocity, T0,
and P0.
Calculate Rayleigh Line Flow Relations for Gases with
Specific Heat Ratio and Static Pressure
Calculate the Rayleigh line flow relations for gases with specific heat
ratio and static pressure ratio combinations as shown.
gamma = [1.3,1.4];
P = [0.13,1.7778];
[mach,T,P,rho,velocity,T0,P0] =
flowrayleigh(gamma,P,'pres')
mach =
3.5833 0.5000
T =
0.2170 0.7901
P =
0.1300 1.7778
rho =
0.5991 2.2501
velocity =
1.6692 0.4444
T0 =
3-232
flowrayleigh
0.5521 0.6913
P0 =
7.4381 1.1141
This example returns a 1 x 2 array for mach, T, P, rho, velocity, T0,
and P0 each. The elements of each array correspond to the inputs
element-wise.
References 1. James, J. E. A., Gas Dynamics, Second Edition, Allyn and Bacon,
Inc, Boston, 1984.
2. NACA Technical Report 1135, 1953, National Advisory Committee on
Aeronautics, Ames Research Staff, Moffett Field, Calif. Pages 667671.
See Also flowisentropic | flownormalshock | flowprandtlmeyer | flowfanno
3-233
generatePatches (Aero.Body)
Purpose Generate patches for body with loaded face, vertex, and color data
Syntax generatePatches(h, ax)
h.generatePatches(ax)
Description generatePatches(h, ax) and h.generatePatches(ax) generate
patches for the animation body object h using the loaded face, vertex,
and color data in ax.
Examples Generate patches for b using the axes, ax.
b=Aero.Body;
b.load('pa24-250_orange.ac','Ac3d');
f = figure;
ax = axes;
b.generatePatches(ax);
See Also load
3-234
GenerateRunScript (Aero.FlightGearAnimation)
Purpose Generate run script for FlightGear flight simulator
Syntax GenerateRunScript(h)
h.GenerateRunScript
Description GenerateRunScript(h) and h.GenerateRunScript generate a run
script for FlightGear flight simulator using the following FlightGear
animation object properties:
OutputFileName Specify the name of the output
file. The file name is the name
of the command you will use to
start FlightGear with these initial
parameters. The default value is
'runfg.bat'.
FlightGearBaseDirectory Specify the name of your
FlightGear installation
folder. The default value is
'D:\Applications\FlightGear'.
GeometryModelName Specify the name of the
folder containing the desired
model geometry in the
FlightGear\data\Aircraft
folder. The default value is
'HL20'.
DestinationIpAddress Specify your destination IP
address. The default value is
'127.0.0.1'.
DestinationPort Specify your network flight
dynamics model (fdm) port. This
destination port should be an
unused port that you can use
when you launch FlightGear. The
default value is '5502'.
3-235
GenerateRunScript (Aero.FlightGearAnimation)
AirportId Specify the airport ID. The list of
supported airports is available in
the FlightGear interface, under
Location. The default value is
'KSFO'.
RunwayId Specify the runway ID. The default
value is '10L'.
InitialAltitude Specify the initial altitude of the
aircraft, in feet. The default value
is 7224 feet.
InitialHeading Specify the initial heading of the
aircraft, in degrees. The default
value is 113 degrees.
OffsetDistance Specify the offset distance of the
aircraft from the airport, in miles.
The default value is 4.72 miles.
OffsetAzimuth Specify the offset azimuth of the
aircraft, in degrees. The default
value is 0 degrees.
Architecture Specify the architecture on
which the FlightGear software is
running.
Examples Create a run script, runfg.bat, to start FlightGear flight simulator
using the default object settings:
h = fganimation
GenerateRunScript(h)
Create a run script, myscript.bat, to start FlightGear flight simulator
using the default object settings:
h = fganimation
h.OutputFileName = 'myscript.bat'
3-236
GenerateRunScript (Aero.FlightGearAnimation)
GenerateRunScript(h)
See Also initialize | play | update
3-237
geoc2geod
Purpose Convert geocentric latitude to geodetic latitude
Syntax geodeticLatitude = geoc2geod(geocentricLatitude, radii)
geodeticLatitude = geoc2geod(geocentricLatitude, radii,
model)
geodeticLatitude = geoc2geod(geocentricLatitude, radii,
flattening, equatorialRadius)
Description geodeticLatitude = geoc2geod(geocentricLatitude, radii)
converts an array of m-by-1 geocentric latitudes and an array of radii
from the center of the planet into an array of m-by-1 geodetic latitudes.
geodeticLatitude = geoc2geod(geocentricLatitude, radii,
model) converts for a specific ellipsoid planet.
geodeticLatitude = geoc2geod(geocentricLatitude, radii,
flattening, equatorialRadius) converts for a custom ellipsoid
planet defined by flattening and the equatorial radius.
The function uses geometric relationships to calculate the geodetic
latitude in this noniterative method.
This function has the limitation that this implementation generates a
geodetic latitude that lies between 90 degrees.
Input
Arguments
geocentricLatitude
Array of m-by-1 geocentric latitudes, in degrees. This value must be
between +90 and -90.
radii
Array of radii from the center of the planet, in meters.
model
Specific ellipsoid planet specified as a string. This function supports
only 'WGS84'.
flattening
3-238
geoc2geod
Custom ellipsoid planet defined by flattening.
equatorialRadius
Equatorial radius, in meters.
Output
Arguments
geodeticLatitude
Array of m-by-1 geodetic latitudes, in degrees.
Examples Determine geodetic latitude given a geocentric latitude and radius:
gd = geoc2geod(45, 6379136)
gd =
45.1921
Determine geodetic latitude at multiple geocentric latitudes, given a
radius, and specifying WGS84 ellipsoid model:
gd = geoc2geod([0 45 90], 6379136, 'WGS84')
gd =
0 45.1921 90.0000
Determine geodetic latitude at multiple geocentric latitudes, given a
radius, and specifying custom ellipsoid model:
f = 1/196.877360;
Re = 3397000;
gd = geoc2geod([0 45 90], 6379136, f, Re)
3-239
geoc2geod
gd =
0 45.1550 90.0000
References Jackson, E.B., Manual for a Workstation-based Generic Flight
Simulation Program (LaRCsim) Version 1.4, NASA TM 110164, April
1995
Hedgley, D. R., Jr., An Exact Transformation from Geocentric to Geodetic
Coordinates for Nonzero Altitudes, NASA TR R-458, March, 1976
Clynch, J. R., Radius of the Earth Radii Used
in Geodesy, Naval Postgraduate School, 2002,
http://www.oc.nps.navy.mil/oc2902w/geodesy/radiigeo.pdf
Stevens, B. L., and F. L. Lewis, Aircraft Control and Simulation, John
Wiley & Sons, New York, NY, 1992
Edwards, C. H., and D. E. Penny, Calculus and Analytical Geometry,
2nd Edition, Prentice-Hall, Englewood Cliffs, NJ, 1986
See Also geod2geoc | ecef2lla | lla2ecef
3-240
geocradius
Purpose Estimate radius of ellipsoid planet at geocentric latitude
Syntax r = geocradius(lambda)
r = geocradius(lambda, model)
r = geocradius(lambda, f, Re)
Description r = geocradius(lambda) estimates the radius, r, of an ellipsoid planet
at a particular geocentric latitude, lambda. lambda is in degrees. r is in
meters. The default ellipsoid planet is WGS84.
r = geocradius(lambda, model) is an alternate method for
estimating the radius for a specific ellipsoid planet. Currently only
'WGS84' is supported for model.
r = geocradius(lambda, f, Re) is another alternate method for
estimating the radius for a custom ellipsoid planet defined by flattening,
f, and the equatorial radius, Re, in meters.
Examples Determine radius at 45 degrees latitude:
r = geocradius(45)
r =
6.3674e+006
Determine radius at multiple latitudes:
r = geocradius([0 45 90])
r =
1.0e+006 *
6.3781 6.3674 6.3568
3-241
geocradius
Determine radius at multiple latitudes, specifying WGS84 ellipsoid
model:
r = geocradius([0 45 90], 'WGS84')
r =
1.0e+006 *
6.3781 6.3674 6.3568
Determine radius at multiple latitudes, specifying custom ellipsoid
model:
f = 1/196.877360;
Re = 3397000;
r = geocradius([0 45 90], f, Re)
r =
1.0e+006 *
3.3970 3.3883 3.3797
References Stevens, B. L., and F. L. Lewis, Aircraft Control and Simulation, John
Wiley & Sons, New York, NY, 1992
Zipfel, P. H., and D. E. Penny, Modeling and Simulation of Aerospace
Vehicle Dynamics, AIAA Education Series, Reston, VA, 2000
See Also geoc2geod | geod2geoc
3-242
geod2geoc
Purpose Convert geodetic latitude to geocentric latitude
Syntax gc = geod2geoc(gd, h)
gc = geod2geoc(gd, h, model)
gc = geod2geoc(gd, h, f, Re)
Description gc = geod2geoc(gd, h) converts an array of m geodetic latitudes, gd,
and an array of mean sea level altitudes, h, into an array of m geocentric
latitudes, gc. Both gc and gd are in degrees and must be between +90
and -90. h is in meters.
gc = geod2geoc(gd, h, model) is an alternate method for converting
from geodetic to geocentric latitude for a specific ellipsoid planet.
Currently only 'WGS84' is supported for model.
gc = geod2geoc(gd, h, f, Re) is another alternate method for
converting from geodetic to geocentric latitude for a custom ellipsoid
planet defined by flattening, f, and the equatorial radius, Re, in meters.
Examples Determine geocentric latitude given a geodetic latitude and altitude:
gc = geod2geoc(45, 1000)
gc =
44.8076
Determine geocentric latitude at multiple geodetic latitudes and
altitudes, specifying WGS84 ellipsoid model:
gc = geod2geoc([0 45 90], [1000 0 2000], 'WGS84')
gc =
0
44.8076
3-243
geod2geoc
90.0000
Determine geocentric latitude at multiple geodetic latitudes, given an
altitude and specifying custom ellipsoid model:
f = 1/196.877360;
Re = 3397000;
gc = geod2geoc([0 45 90], 2000, f, Re)
gc =
0
44.7084
90.0000
Assumptions
and
Limitations
This implementation generates a geocentric latitude that lies between
90 degrees.
References Stevens, B. L., and F. L. Lewis, Aircraft Control and Simulation, John
Wiley & Sons, New York, NY, 1992
See Also geoc2geod | ecef2lla | lla2ecef
3-244
geoidegm96
Purpose Calculate geoid height as determined from EGM96 Geopotential Model
Note geoidegm96 will be removed in a future version. Use
geoidheight instead.
Syntax N = geoidegm96(lat, long)
N = geoidegm96(lat, long, action)
Description N = geoidegm96(lat, long) calculates the geoid height as determined
from the EGM96 Geopotential Model. It calculates geoid heights to 0.01
meters. This function interpolates geoid heights from a 15-minute grid
of point values in the tide-free system, using the EGM96 Geopotential
Model to the degree and order 360. The geoid undulations are relative
to the WGS84 ellipsoid.
N = geoidegm96(lat, long, action) calculates the geoid height
as determined from the EGM96 Geopotential Model. This function
performs action if latitude or longitude are out of range.
Inputs required by geoidegm96:
lat An array of m geocentric latitudes,
in degrees, where north latitude is
positive and south latitude is negative.
lat must be of type single or double.
If lat is not within the range -90 to
90, inclusive, this function wraps the
value to be within the range.
long An array of m geocentric longitudes,
in degrees, where east longitude
is positive and west longitude is
negative. long must be of type single
or double. If long is not within the
range 0 to 360 inclusive, this function
3-245
geoidegm96
wraps the value to be within the
range.
action A string to determine action
for out-of-range input. Specify
if out-of-range input invokes a
'Warning', 'Error', or no action
('None'). The default is 'Warning'.
Examples Calculate the geoid height at 42.4 degrees N latitude and 71.0 degrees
E longitude.
N = geoidegm96( 42.4, 71.0)
Calculate the geoid height at two different locations, with out-of-range
actions generating warnings.
N = geoidegm96( [39.3,33.4], [-77.2, 36.5])
Calculate the geoid height with latitude wrapping, with out-of-range
actions displaying no warnings.
N = geoidegm96(100,150,'None')
Limitations This function has the limitations of the 1996 Earth
Geopotential Model. For more information, see
http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html.
The WGS84 EGM96 geoid undulations have an error range of +/-0.5 to
+/-1.0 meters worldwide.
References NIMA TR8350.2: Department of Defense World Geodetic System 1984,
Its Definition and Relationship with Local Geodetic Systems.
NASA/TP-1998-206861: The Development of the Joint NASA GSFC
and NIMA Geopotential Model EGM96
National Geospatial-Intelligence Agency Website:
http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html
3-246
geoidegm96
See Also gravitywgs84
3-247
geoidheight
Purpose Calculate geoid height
Syntax N = geoidheight(latitude,longitude)
N = geoidheight(latitude, longitude, modelname)
N = geoidheight(latitude, longitude, action)
N = geoidheight(latitude, longitude, modelname, action)
N = geoidheight(latitude, longitude, 'Custom', datafile)
N = geoidheight(latitude, longitude, 'Custom', datafile,
action)
Description N = geoidheight(latitude,longitude) calculates the geoid height
using the EGM96 Geopotential Model. For this model, it calculates
these geoid heights to an accuracy of 0.01 m. It interpolates an array
of m geoid heights at m geocentric latitudes, latitude, and m geocentric
longitudes, longitude.
N = geoidheight(latitude, longitude, modelname) calculates the
geoid height using the model, modelname.
N = geoidheight(latitude, longitude, action) calculates the
geoid height using the EGM96 Geopotential Model. This function
performs action if latitude or longitude are out of range.
N = geoidheight(latitude, longitude, modelname, action)
calculates the geoid height using modelname.
N = geoidheight(latitude, longitude, 'Custom', datafile)
calculates the geoid height using a custom model that datafile defines.
N = geoidheight(latitude, longitude, 'Custom', datafile,
action) calculates the geoid height using the custom model. This
function performs action if latitude or longitude are out of range.
Tips This function interpolates geoid heights from a grid of point values in
the tide-free system.
When using the EGM96 Model, this function has the limitations of
the 1996 Earth Geopotential Model.
3-248
geoidheight
When using the EGM2008 Model, this function has the limitations of
the 2008 Earth Geopotential Model.
The interpolation scheme wraps over the poles to allow for geoid
height calculations at and near pole locations.
The geoid undulations for the EGM96 and EGM2008 models are
relative to the WGS84 ellipsoid.
The WGS84 EGM96 geoid undulations have an error range of +/ 0.5
to +/ 1.0 m worldwide.
Input
Arguments
latitude
An array of m geocentric latitudes, in degrees, where north latitude is
positive and south latitude is negative. latitude must be of type single
or double. If latitude is not within the range 90 to 90, inclusive, this
function wraps the value to be within the range.
longitude
An array of m geocentric longitudes, in degrees, where east longitude
is positive and west longitude is negative. longitude must be of type
single or double. If longitude is not within the range 0 to 360 inclusive,
this function wraps the value to be within the range.
model
String that specifies the geopotential model.
3-249
geoidheight
Geopotential
Model
Description
'EGM96' EGM96 Geopotential Model to degree and order 360.
This model uses a 15-minute grid of point values in
the tide-free system. This function calculates geoid
heights to an accuracy of 0.01 m for this model.
'EGM2008' EGM2008 Geopotential Model to degree and order
2159. This model uses a 2.5-minute grid of point
values in the tide-free system. This function
calculates geoid heights to an accuracy of 0.001 m
for this model.
'Custom' Custom geopotential model that you define in
datafile. This function calculates geoid heights to
an accuracy of 0.01 m for custom models.
Note To deploy a custom geopotential model,
explicitly include the custom data and reader files
to the MATLAB Compiler (mcc) command at
compilation. For example:
mcc -m mycustomsgeoidheightfunction...
-a customDataFile -a customReaderFile
For other geopotential models, use the MATLAB
Compiler as usual.
Default: EGM96
datafile
Optional file that contains definitions for a custom geopotential model.
Provide this file only if you specify 'Custom' for the model argument.
For an example of file content, see aerogmm2b.mat.
3-250
geoidheight
This file must contain the following variables.
Variable Description
'latbp' Array of geocentric latitude breakpoints.
'lonbp' Array of geocentric longitude breakpoints.
'grid' Table of geoid height values.
'windowSize' Even integer scalar greater than 2 for the number of
interpolation points.
action
String that defines action for out-of-range input. Specify one:
'Error'
'Warning'
'None'
Default: Warning
Output
Arguments
N
An array of M geoid heights in meters. The values in this array have
the same data type as latitude.
Examples Calculate the EGM96 geoid height at 42.4 degrees N latitude and 71.0
degrees W longitude with warning actions:
N = geoidheight( 42.4, -71.0 )
Calculate the EGM2008 geoid height at two different locations with
error actions.
N = geoidheight( [39.3, 33.4], [77.2, 36.5], 'egm2008', ...
'error')
3-251
geoidheight
Calculate a custom geoid height at two different locations with no
actions.
N = geoidheight( [39.3, 33.4], [-77.2, 36.5], 'custom', ...
'geoidegm96grid','none')
References Vallado, D. A. Fundamentals of Astrodynamics and Applications.
McGraw-Hill, New York, 1997.
NIMA TR8350.2: "Department of Defense World Geodetic System 1984,
Its Definition and Relationship with Local Geodetic Systems."
See Also gravitywgs84 | gravitysphericalharmonic
Related
Links
National Geospatial-Intelligence Agency Web site:
http://earth-info.nga.mil/GandG/publications/vertdatum.html
3-252
Geometry (Aero.Geometry)
Purpose Construct 3-D geometry for use with animation object
Syntax h = Aero.Geometry
Description h = Aero.Geometry defines a 3-D geometry for use with an animation
object.
See Aero.Geometry for further details.
See Also Aero.Geometry
3-253
gravitycentrifugal
Purpose Implement centrifugal effect of planetary gravity
Syntax [gx gy gz] = gravitycentrifugal(planet_coordinates)
[gx gy gz] = gravitycentrifugal(planet_coordinates, model )
[gx gy gz] = gravitycentrifugal(planet_coordinates,
'Custom',
rotational_rate)
Description [gx gy gz] = gravitycentrifugal(planet_coordinates)
implements the mathematical representation of centrifugal effect for
planetary gravity based on planetary rotation rate. This function
calculates arrays of N gravity values in the x-axis, y-axis, and z-axis
of the Planet-Centered Planet-Fixed coordinates for the planet. It
performs these calculations using planet_coordinates, an M-by-3
array of Planet-Centered Planet-Fixed coordinates. You use centrifugal
force in rotating or noninertial coordinate systems. Gravity centrifugal
effect values are greatest at the equator of a planet.
[gx gy gz] = gravitycentrifugal(planet_coordinates, model )
implements the mathematical representation of centrifugal effect based
on planetary gravitational potential for the planetary model, model.
[gx gy gz] = gravitycentrifugal(planet_coordinates,
'Custom', rotational_rate) implements the mathematical
representation of centrifugal effect based on planetary gravitational
potential using the custom rotational rate, rotational_rate.
Input
Arguments
planet_coordinates
M-by-3 array of Planet-Centered Planet-Fixed coordinates in meters.
The z-axis is positive toward the North Pole. If model is 'Earth', the
planet coordinates are ECEF coordinates.
model
String that specifies the planetary model. Default is 'Earth'. Specify
one:
'Mercury'
3-254
gravitycentrifugal
'Venus'
'Earth'
'Moon'
'Mars'
'Jupiter'
'Saturn'
'Uranus'
'Neptune'
'Custom'
'Custom' requires that you specify your own planetary model using
the rotational_rate parameter.
rotational_rate
Scalar value that specifies the planetary rotational rate in radians per
second. Specify this parameter only if model has the value 'Custom'.
Output
Arguments
gx
Array of M gravity values in the x-axis of the Planet-Centered
Planet-Fixed coordinates in meters per second squared (m/s
2
).
gy
Array of M gravity values in the y-axis of the Planet-Centered
Planet-Fixed coordinates in meters per second squared (m/s
2
).
gz
Array of M gravity values in the z-axis of the Planet-Centered
Planet-Fixed coordinates in meters per second squared (m/s
2
).
Examples Calculate the centrifugal effect of Earth gravity in the x-axis at the
equator on the surface of Earth:
3-255
gravitycentrifugal
gx = gravitycentrifugal( [-6378.1363e3 0 0] )
Calculate the centrifugal effect of Mars gravity at 15000 m over the
equator and 11000 m over the North Pole:
p = [2412.648e3 -2412.648e3 0; 0 0 3376.2e3]
[gx, gy, gz] = gravitycentrifugal( p, 'Mars' )
Calculate the precessing centrifugal effect of gravity for Earth at 15000
m over the equator and 11000 m over the North Pole. This example
uses a custom planetary model at Julian date 2451545:
p = [2412.648e3 -2412.648e3 0; 0 0 3376e3]
% Set julian date to January 1, 2000 at noon GMT
JD = 2451545
% Calculate precession rate in right ascension in meters
pres_RA = 7.086e-12 + 4.3e-15*(JD - 2451545)/36525
% Calculate the rotational rate in a precessing reference
% frame
Omega = 7.2921151467e-5 + pres_RA
[gx, gy, gz] = gravitycentrifugal( p, 'custom', Omega )
See Also gravitywgs84 | gravitysphericalharmonic | gravityzonal
3-256
gravitysphericalharmonic
Purpose Implement spherical harmonic representation of planetary gravity
Syntax [gx gy gz] = gravitysphericalharmonic(planet_coordinates)
[gx gy gz] = gravitysphericalharmonic(planet_coordinates,
model)
[gx gy gz] = gravitysphericalharmonic(planet_coordinates,
degree)
[gx gy gz] = gravitysphericalharmonic(planet_coordinates,
model, degree)
[gx gy gz] = gravitysphericalharmonic(planet_coordinates,
model, degree, action)
[gx gy gz] = gravitysphericalharmonic(planet_coordinates,
'Custom', degree, {datafile dfreader}, action)
Description [gx gy gz] = gravitysphericalharmonic(planet_coordinates)
implements the mathematical representation of spherical harmonic
planetary gravity based on planetary gravitational potential. This
function calculates arrays of N gravity values in the x-axis, y-axis, and
z-axis of the Planet-Centered Planet-Fixed coordinates for the planet.
It performs these calculations using planet_coordinates, an M-by-3
array of Planet-Centered Planet-Fixed coordinates. By default, this
function assumes 120th degree and order spherical coefficients for the
'EGM2008' (Earth) planetary model.
[gx gy gz] = gravitysphericalharmonic(planet_coordinates,
model) implements the mathematical representation for the planetary
model, model.
[gx gy gz] = gravitysphericalharmonic(planet_coordinates,
degree) uses the degree and order that degree specifies.
[gx gy gz] = gravitysphericalharmonic(planet_coordinates,
model, degree) uses the degree and order that degree specifies. model
specifies the planetary model.
[gx gy gz] = gravitysphericalharmonic(planet_coordinates,
model, degree, action) uses the specified action when input is out
of range.
3-257
gravitysphericalharmonic
[gx gy gz] = gravitysphericalharmonic(planet_coordinates,
'Custom', degree, {datafile dfreader}, action) implements
the mathematical representation for a custom model planet. datafile
defines the planetary model. dfreader specifies the reader for
datafile.
This function has the following limitations:
The function excludes the centrifugal effects of planetary rotation,
and the effects of a precessing reference frame.
Spherical harmonic gravity model is valid for radial positions greater
than the planet equatorial radius. Minor errors might occur for
radial positions near or at the planetary surface. The spherical
harmonic gravity model is not valid for radial positions less than
planetary surface.
Tips When inputting a large PCPF array and a high degree value, you
might receive an out-of-memory error. For more information about
avoiding out-of-memory errors in the MATLAB environment, see
Memory Usage.
When inputting a large PCPF array, you might receive a maximum
matrix size limitation. To determine the largest matrix or array that
you can create in the MATLAB environment for your platform, see
Memory Usage.
Input
Arguments
planet_coordinates
M-by-3 array of Planet-Centered Planet-Fixed coordinates in meters.
The z-axis is positive toward the North Pole. If model is 'EGM2008' or
'EGM96' (Earth), the planet coordinates are ECEF coordinates.
model
String that specifies the planetary model. Default is 'EGM2008'. Specify
one:
3-258
gravitysphericalharmonic
Planetary
Model
Planet
'EGM2008' Earth Gravitational Model 2008
'EGM96' Earth Gravitational Model 1996
'LP100K' 100th degree Moon model
'LP165P' 165th degree Moon model
'GMM2B' Goddard Mars model 2B
'Custom' Custom planetary model that you define in datafile
Note To deploy a custom planetary model,
explicitly include the custom data and reader
files to the MATLAB Compiler (mcc) command at
compilation. For example:
mcc -m mycustomsphericalgravityfunction...
-a customDataFile -a customReaderFile
For other planetary models, use the MATLAB
Compiler as usual.
'EIGENGL04C' Combined Earth gravity field model EIGEN-GL04C.
When inputting a large PCPF array and a high degree value, you might
receive an out-of-memory error. For more information about avoiding
out-of-memory errors in the MATLAB environment, see Memory
Usage.
When inputting a large PCPF array, you might receive a maximum
matrix size limitation. To determine the largest matrix or array that
you can create in the MATLAB environment for your platform, see
Memory Usage.
degree
3-259
gravitysphericalharmonic
Scalar value that specifies the degree and order of the harmonic gravity
model.
Planetary
Model
Degree and Order
'EGM2008' Maximum degree and order is 2159.
Default degree and order are 120.
'EGM96' Maximum degree and order is 360.
Default degree and order are 70.
'LP100K' Maximum degree and order is 100.
Default degree and order are 60.
'LP165P' Maximum degree and order is 165.
Default degree and order are 60.
'GMM2B' Maximum degree and order is 80.
Default degree and order are 60.
'Custom' Maximum degree is default degree and order.
'EIGENGL04C' Maximum degree and order is 360.
Default degree and order are 70.
When inputting a large PCPF array and a high degree value, you might
receive an out-of-memory error. For more information about avoiding
out-of-memory errors in the MATLAB environment, see Memory
Usage.
When inputting a large PCPF array, you might receive a maximum
matrix size limitation. To determine the largest matrix or array that
you can create in the MATLAB environment for your platform, see
Memory Usage.
action
String that defines action for out-of-range input. Specify one:
3-260
gravitysphericalharmonic
'Error'
'Warning' (default)
'None'
Custom
String that specifies that datafile contains definitions for a custom
planetary model.
datafile
File that contains definitions for a custom planetary model. For an
example of file content, see aerogmm2b.mat.
This file must contain the following variables.
Variable Description
Re Scalar of planet equatorial radius in meters (m)
GM Scalar of planetary gravitational parameter in meters
cubed per second squared (m
3
/s
2
)
degree Scalar of maximum degree
C (degree+1)-by-(degree+1) matrix containing normalized
spherical harmonic coefficients matrix, C
S (degree+1)-by-(degree+1) matrix containing normalized
spherical harmonic coefficients matrix, S
This parameter requires that you specify a program in the dfreader
parameter to read the data file.
dfreader
Specify a MATLAB function to read datafile. The reader file that you
specify depends on the file type of datafile.
3-261
gravitysphericalharmonic
Data File
Type
Description
MATLAB
file
Specify the MATLAB load function, for example, @load.
Other file
type
Specify a custom MATLAB reader function.
For examples of custom reader functions, see
astReadSHAFile.m and astReadEGMFile.m. Note the
output variable order in these files.
Output
Arguments
gx
Array of N gravity values in the x-axis of the Planet-Centered
Planet-Fixed coordinates in meters per second squared (m/s
2
).
gy
Array of N gravity values in the y-axis of the Planet-Centered
Planet-Fixed coordinates in meters per second squared (m/s
2
).
gz
Array of N gravity values in the z-axis of the Planet-Centered
Planet-Fixed coordinates in meters per second squared (m/s
2
).
Examples Calculate the gravity in the x-axis at the equator on the surface of
Earth. This example uses the default 120 degree model of EGM2008
with default warning actions:
gx = gravitysphericalharmonic( [-6378.1363e3 0 0] )
Calculate the gravity at 25000 m over the south pole of Earth. This
example uses the 70 degree model of EGM96 with error actions:
[gx, gy, gz] = gravitysphericalharmonic( [0 0 -6381.751e3], 'EGM96', 'Error' )
3-262
gravitysphericalharmonic
Calculate the gravity at 15000 m over the equator and 11000 m over
the North Pole. This example uses a 30th order GMM2B Mars model
with warning actions:
p = [2412.648e3 -2412.648e3 0; 0 0 3376.2e3]
[gx, gy, gz] = gravitysphericalharmonic( p, 'GMM2B', 30, 'Warning' )
Calculate the gravity at 15000 m over the equator and 11000 m over
the North Pole. This example uses a 60th degree custom planetary
model with no actions:
p = [2412.648e3 -2412.648e3 0; 0 0 3376e3]
[gx, gy, gz] = gravitysphericalharmonic( p, 'custom', 60, ...
{'GMM2BC80_SHA.txt' @astReadSHAFile}, 'None' )
Calculate the gravity at 25000 meters over the south pole of Earth using
a 120th order EIGEN-GL04C Earth model with warning actions:
p = [0 0 -6381.751e3]
[gx, gy, gz] = gravitysphericalharmonic( p, 'EIGENGL04C', ...
120, 'Warning' )
Gottlieb, R. G., Fast Gravity, Gravity Partials, Normalized Gravity,
Gravity Gradient Torque and Magnetic Field: Derivation, Code and
Data, Technical Report NASA Contractor Report 188243,NASA
Lyndon B. Johnson Space Center, Houston, TX, February 1993
References
[1] Gottlieb, R. G., Fast Gravity, Gravity Partials, Normalized Gravity,
Gravity Gradient Torque and Magnetic Field: Derivation, Code and
Data, Technical Report NASA Contractor Report 188243, NASA
Lyndon B. Johnson Space Center, Houston, Texas, February 1993.
3-263
gravitysphericalharmonic
[2] Vallado, D. A., Fundamentals of Astrodynamics and Applications,
McGraw-Hill, New York, 1997.
[3] NIMA TR8350.2: Department of Defense World Geodetic System
1984, Its Definition and Relationship with Local Geodetic Systems.
[4] Konopliv, A. S., S. W. Asmar, E. Carranza, W. L. Sjogen, D. N.
Yuan., Recent Gravity Models as a Result of the Lunar Prospector
Mission, Icarus, Vol. 150, no. 1, pp 118, 2001.
[5] Lemoine, F. G., D. E. Smith, D.D. Rowlands, M.T. Zuber, G. A.
Neumann, and D. S. Chinn, An improved solution of the gravity field of
Mars (GMM-2B) from Mars Global Surveyor, Journal Of Geophysical
Research, Vol. 106, No. E10, pp 23359-23376, October 25, 2001.
[6] Kenyon S., J. Factor, N. Pavlis, and S. Holmes, Towards the Next
Earth Gravitational Model, Society of Exploration Geophysicists 77th
Annual Meeting, San Antonio, Texas, September 2328, 2007.
[7] Pavlis, N.K., S.A. Holmes, S.C. Kenyon, and J.K. Factor, An Earth
Gravitational Model to Degree 2160: EGM2008, presented at the 2008
General Assembly of the European Geosciences Union, Vienna, Austria,
April 1318, 2008.
[8] Grueber, T., and A. Khl, Validation of the EGM2008 Gravity Field
with GPS-Leveling and Oceanographic Analyses, presented at the IAG
International Symposium on Gravity, Geoid & Earth Observation 2008,
Chania, Greece, June 2327, 2008.
[9] Frste, C., Flechtner, F., Schmidt, R., Knig, R., Meyer, U.,
Stubenvoll, R., Rothacher, M., Barthelmes, F., Neumayer, H.,
Biancale, R., Bruinsma, S., Lemoine, J.M., Loyer, S., A Mean Global
Gravity Field Model From the Combination of Satellite Mission and
Altimetry/Gravmetry Surface Data - EIGEN-GL04C, Geophysical
Research Abstracts, Vol. 8, 03462, 2006.
See Also gravitywgs84 | gravitycentrifugal | gravityzonal | geoidegm96
3-264
gravitywgs84
Purpose Implement 1984 World Geodetic System (WGS84) representation of
Earths gravity
Syntax g = gravitywgs84(h, lat)
g = gravitywgs84(h, lat, lon, method, [noatm, nocent, prec,
jd], action)
gt = gravitywgs84(h, lat, lon, 'Exact', [noatm, nocent, prec,
jd], action)
[g gn] = gravitywgs84(h, lat, lon, 'Exact', [noatm, nocent,
prec, jd], action)
Description g = gravitywgs84(h, lat) implements the mathematical
representation of the geocentric equipotential ellipsoid of WGS84.
Using h, an array of m altitudes in meters, and lat, an array of m
geodetic latitudes in degrees, calculates g, an array of m gravity values
in the direction normal to the Earths surface at a specific location.
The default calculation method is Taylor Series. Gravity precision is
controlled via the method parameter.
g = gravitywgs84(h, lat, lon, method, [noatm, nocent, prec,
jd], action) lets you specify both latitude and longitude, as well as
other optional inputs, when calculating gravity values in the direction
normal to the Earths surface. In this format, method can be either
'CloseApprox'or'Exact'.
gt = gravitywgs84(h, lat, lon, 'Exact', [noatm, nocent,
prec, jd], action) calculates an array of total gravity values in the
direction normal to the Earths surface.
[g gn] = gravitywgs84(h, lat, lon, 'Exact', [noatm, nocent,
prec, jd], action) calculates gravity values in the direction both
normal and tangential to the Earths surface.
Inputs for gravitywgs84 are:
3-265
gravitywgs84
h An array of m altitudes, in meters
lat An array of m geodetic latitudes, in degrees,
where north latitude is positive, and south
latitude is negative
lon An array of m geodetic longitudes, in
degrees, where east longitude is positive,
and west longitude is negative. This input
is available only with method specified as
'CloseApprox'or'Exact'.
method A string specifying the method to calculate
gravity: 'TaylorSeries', 'CloseApprox', or
'Exact'. The default is 'TaylorSeries'.
noatm A logical value specifying the exclusion of
Earths atmosphere. Set to true for the Earths
gravitational field to exclude the mass of
the atmosphere. Set to false for the value
for the Earths gravitational field to include
the mass of the atmosphere. This option
is available only with method specified as
'CloseApprox'or'Exact'. The default is
false.
nocent A logical value specifying the removal of
centrifugal effects. Set to true to calculate
gravity based on pure attraction resulting from
the normal gravitational potential. Set to false
to calculate gravity including the centrifugal
force resulting from the Earths angular
velocity. This option is available only with
method specified as 'CloseApprox'or'Exact'.
The default is false.
3-266
gravitywgs84
prec A logical value specifying the presence of a
precessing reference frame. Set to true for the
angular velocity of the Earth to be calculated
using the International Astronomical Union
(IAU) value of the Earths angular velocity
and the precession rate in right ascension. To
obtain the precession rate in right ascension,
Julian Centuries from Epoch J2000.0 is
calculated using the Julian date, jd. If set to
false, the angular velocity of the Earth used
is the value of the standard Earth rotating
at a constant angular velocity. This option
is available only with method specified as
'CloseApprox'or'Exact'. The default is
false.
jd A scalar value specifying Julian date used to
calculate Julian Centuries from Epoch J2000.0.
This input is available only with method
specified as 'CloseApprox'or'Exact'.
action A string to determine action for out-of-range
input. Specify if out-of-range input invokes a
'Warning', 'Error', or no action ('None'). The
default is 'Warning'.
Outputs calculated for the Earths gravity include:
3-267
gravitywgs84
g An array of m gravity values in the direction
normal to the Earths surface at a specific
lat lon location. A positive value indicates a
downward direction.
gt An array of m total gravity values in the
direction normal to the Earths surface at a
specific lat lon location. A positive value
indicates a downward direction. This option is
available only with method specified as'Exact'.
gn An array of m gravity values in the direction
tangential to the Earths surface at a specific
lat lon location. A positive value indicates a
northward direction. This option is available
only with method specified as'Exact'.
Examples Calculate the normal gravity at 5000 meters and 55 degrees latitude
using the Taylor Series approximation method with errors for
out-of-range inputs:
g = gravitywgs84( 5000, 55, 'TaylorSeries', 'Error' )
g =
9.7997
Calculate the normal gravity at 15,000 meters, 45 degrees latitude,
and 120 degrees longitude using the Close Approximation method with
atmosphere, centrifugal effects, and no precessing, with warnings for
out-of-range inputs:
g = gravitywgs84( 15000, 45, 120, 'CloseApprox' )
g =
3-268
gravitywgs84
9.7601
Calculate the normal and tangential gravity at 1000 meters, 0 degrees
latitude, and 20 degrees longitude using the Exact method with
atmosphere, centrifugal effects, and no precessing, with warnings for
out-of-range inputs:
[g, gt] = gravitywgs84( 1000, 0, 20, 'Exact' )
g =
9.7772
gt =
0
Calculate the normal and tangential gravity at 1000 meters, 0 degrees
latitude, and 20 degrees longitude and 11,000 meters, 30 degrees
latitude, and 50 degrees longitude using the Exact method with
atmosphere, centrifugal effects, and no precessing, with no actions for
out-of-range inputs:
h = [1000; 11000];
lat = [0; 30];
lon = [20; 50];
[g, gt] = gravitywgs84( h, lat, lon, 'Exact', 'None' )
g =
9.7772
9.7594
3-269
gravitywgs84
gt =
1.0e-004 *
0
-0.7751
Calculate the normal gravity at 15,000 meters, 45 degrees latitude,
and 120 degrees longitude and 5000 meters, 55 degrees latitude, and
100 degrees longitude using the Close Approximation method with
atmosphere, no centrifugal effects, and no precessing, with warnings for
out-of-range inputs:
h = [15000 5000];
lat = [45 55];
lon = [120 100];
g = gravitywgs84( h, lat, lon, 'CloseApprox', [false true false 0] )
g =
9.7771 9.8109
Calculate the normal and tangential gravity at 1000 meters, 0 degrees
latitude, and 20 degrees longitude using the Exact method with
atmosphere, centrifugal effects, and precessing at Julian date 2451545,
with warnings for out-of-range inputs:
[g, gt] = gravitywgs84( 1000, 0, 20, 'Exact', ...
[ false false true 2451545 ], 'Warning' )
g =
9.7772
3-270
gravitywgs84
gt =
0
Calculate the normal gravity at 15,000 meters, 45 degrees latitude, and
120 degrees longitude using the Close Approximation method with no
atmosphere, with centrifugal effects, and with precessing at Julian date
2451545, with errors for out-of-range inputs:
g = gravitywgs84( 15000, 45, 120, 'CloseApprox', ...
[ true false true 2451545 ], 'Error' )
g =
9.7601
Calculate the total normal gravity at 15,000 meters, 45 degrees latitude,
and 120 degrees longitude using the Exact method with no atmosphere,
with centrifugal effects, and with precessing at Julian date 2451545,
with errors for out-of-range inputs:
g = gravitywgs84( 15000, 45, 120, 'Exact', ...
[ true false true 2451545 ], 'Error' )
g =
9.7601
Assumptions
and
Limitations
The WGS84 gravity calculations are based on the assumption of a
geocentric equipotential ellipsoid of revolution. Since the gravity
potential is assumed to be the same everywhere on the ellipsoid, there
must be a specific theoretical gravity potential that can be uniquely
determined from the four independent constants defining the ellipsoid.
3-271
gravitywgs84
Use of the WGS84 Taylor Series model should be limited to low geodetic
heights. It is sufficient near the surface when submicrogal precision is
not necessary. At medium and high geodetic heights, it is less accurate.
Use of the WGS84 Close Approximation model should be limited to a
geodetic height of 20,000.0 meters (approximately 65,620.0 feet). Below
this height, it gives results with submicrogal precision.
To predict and determine a satellite orbit with high accuracy, use the
EGM96 through degree and order 70.
References NIMA TR8350.2: Department of Defense World Geodetic System 1984,
Its Definition and Relationship with Local Geodetic Systems.
3-272
gravityzonal
Purpose Implement zonal harmonic representation of planetary gravity
Syntax [gravityXcoord gravityYcoord,
gravityZcoord] = gravityzonal(planetCoord)
[gravityXcoord gravityYcoord,
gravityZcoord] = gravityzonal(planetCoord,
degreeGravityModel)
[gravityXcoord gravityYcoord,
gravityZcoord] = gravityzonal(planetCoord,
planetModel)
[gravityXcoord gravityYcoord,
gravityZcoord] = gravityzonal(planetCoord,
planetModel,
degreeGravityModel)
[gravityXcoord gravityYcoord,
gravityZcoord] = gravityzonal(planetCoord,
planetModel,
degreeGravityModel, action)
[gravityXcoord gravityYcoord,
gravityZcoord] = gravityzonal(planetCoord,
'Custom', equatorialRadius, planetaryGravitional,
zonalHarmonicCoeff, action)
Description [gravityXcoord gravityYcoord, gravityZcoord] =
gravityzonal(planetCoord) implements the mathematical
representation of zonal harmonic planetary gravity based on planetary
gravitational potential. For input, it takes an m-by-3 matrix that
contains planet-centered planet-fixed coordinates from the center of the
planet in meters. This function calculates the arrays of m gravity values
in the x-, y-, and z-axes of the planet-centered planet-fixed coordinates.
It uses the fourth order zonal coefficients for Earth by default.
[gravityXcoord gravityYcoord, gravityZcoord] =
gravityzonal(planetCoord, degreeGravityModel) uses the degree
of harmonic model.
[gravityXcoord gravityYcoord, gravityZcoord] =
gravityzonal(planetCoord, planetModel) uses the planetary model.
3-273
gravityzonal
[gravityXcoord gravityYcoord, gravityZcoord] =
gravityzonal(planetCoord, planetModel, degreeGravityModel)
uses the degree of harmonic model and planetary model.
[gravityXcoord gravityYcoord, gravityZcoord] =
gravityzonal(planetCoord, planetModel, degreeGravityModel,
action) specifies the action for out-of-range input.
[gravityXcoord gravityYcoord, gravityZcoord] =
gravityzonal(planetCoord, 'Custom', equatorialRadius,
planetaryGravitional, zonalHarmonicCoeff, action) uses the
equatorial radius, planetary gravitational parameter, and zonal
harmonic coefficients for the custom planetary model.
This function does not include the potential due planet rotation, which
excludes the centrifugal effects of planetary rotation and the effects
of a precessing reference frame.
Input
Arguments
planetCoord
m-by-3 matrix that contains planet-centered planet-fixed coordinates
from the center of the planet in meters. If planetModel has a value
of 'Earth', this matrix contains Earth-centered Earth-fixed (ECEF)
coordinates.
planetModel
String that specifies the planetary model. Enter one:
'Mercury'
'Venus'
'Earth'
'Moon'
'Mars'
'Jupiter'
'Saturn'
3-274
gravityzonal
'Uranus'
'Neptune'
'Custom'
'Custom' requires you to specify your own planetary model using the
equatorialRadius, planetaryGravitional, and zonalHarmonicCoeff
parameters.
Default: 'Earth'
degreeGravityModel
Degree of harmonic model.
2 Second degree, J2. Most significant or largest spherical
harmonic term, which accounts for the oblateness of a planet. 2 is
default if planetModel is 'Mercury', 'Venus', 'Moon', 'Uranus',
or 'Neptune'.
3 Third degree, J3. 3 is default if planetModel is 'Mars'.
4 Fourth degree, J4 (default). Default is 4 if planetModel is
'Earth, 'Jupiter', 'Saturn' or 'Custom'.
Default:
equatorialRadius
Planetary equatorial radius in meters. Use this parameter only if you
specify planetModel as 'Custom'.
planetaryGravitional
Planetary gravitational parameter in meters cubed per second squared.
Use this parameter only if you specify planetModel as 'Custom'.
zonalHarmonicCoeff
3-275
gravityzonal
3-element array defining the zonal harmonic coefficients that the
function uses to calculate zonal harmonics planetary gravity. Use this
parameter only if you specify planetModel as 'Custom'.
action
String that defines action for out-of-range input. Specify one:
'Error'
'Warning'
'None' (default)
Output
Arguments
gravityXcoord
Array of m gravity values in the x-axis of the planet-centered
planet-fixed coordinates in meters per second squared.
gravityYcoord
Array of m gravity values in the y-axis of the planet-centered
planet-fixed coordinates in meters per second squared.
gravityZcoord
Array of m gravity values in the z-axis of the planet-centered
planet-fixed coordinates in meters per second squared.
Examples Calculate the gravity in the x-axis at the equator on the surface of Earth
using the fourth degree model with no warning actions:
gx = gravityzonal( [-6378.1363e3 0 0] )
gx =
9.8142
Calculate the gravity using the close approximation method at 100 m
over the geographic South Pole of Earth with error actions:
3-276
gravityzonal
[gx, gy, gz] = gravityzonal( [0 0 -6356.851e3], 'Error' )
gx =
0
gy =
0
gz =
9.8317
Calculate the gravity at 15000 m over the equator and 11000 m over the
geographic North Pole using a second order Mars model with warning
actions:
p = [2412.648e3 -2412.648e3 0; 0 0 3376.2e3]
[gx, gy, gz] = gravityzonal( p, 'Mars', 2, 'Warning' )
p =
2412648 -2412648 0
0 0 3376200
gx =
-2.6224
0
gy =
2.6224
0
gz =
3-277
gravityzonal
0
-3.7542
Calculate the gravity at 15000 m over the equator and 11000 m over the
geographic North Pole using a custom planetary model with no actions:
p= [2412.648e3 -2412.648e3 0; 0 0 3376e3]
GM = 42828.371901e9 % m^3/s^2
Re = 3397e3 % m
Jvalues = [1.95545367944545e-3 3.14498094262035e-5 ...
-1.53773961526397e-5]
[gx, gy, gz] = gravityzonal( p, 'custom', Re, GM, ...
Jvalues, 'None' )
Algorithms gravityzonal is implemented using the following planetary parameter
values for each planet:
Planet Equatorial
Radius (Re) in
Meters
Gravitational
Parameter (GM) in
m
3
/s
2
Zonal Harmonic Coefficients
(J Values)
Earth 6378.1363e3 3.986004415e14 [ 0.0010826269 -0.0000025323
-0.0000016204 ]
Jupiter 71492.e3 1.268e17 [0.01475 0 -0.00058]
Mars 3397.2e3 4.305e13 [ 0.001964 0.000036 ]
Mercury 2439.0e3 2.2032e13 0.00006
Moon 1738.0e3 4902.799e9 0.0002027
Neptune 24764e3 6.809e15 0.004
Saturn 60268.e3 3.794e16 [0.01645 0 -0.001]
Uranus 25559.e3 5.794e15 0.012
Venus 6052.0e3 3.257e14 0.000027
3-278
gravityzonal
References Vallado, D. A., Fundamentals of Astrodynamics and Applications,
McGraw-Hill, New York, 1997.
Fortescue, P., J. Stark, G. Swinerd, (Eds.). Spacecraft Systems
Engineering, Third Edition, Wiley & Sons, West Sussex, 2003.
Tewari, A., Atmospheric and Space Flight Dynamics Modeling and
Simulation with MATLAB and Simulink, Birkhuser, Boston, 2007.
Alternatives Zonal Harmonic Gravity Model block
See Also gravitywgs84 | geoidegm96
3-279
Aero.Animation.hide
Purpose Hide animation figure
Syntax hide(h)
h.hide
Description hide(h) and h.hide hide (close) the figure for the animation object h.
Use Aero.Animation.show to redisplay the animation object figure.
Input
Arguments
h Animation object.
Examples Hide the animation object figure that the Aero.Animation.show
method displays.
h=Aero.Animation;
h.show;
h.hide;
3-280
igrf11magm
Purpose Calculate Earths magnetic field using 11th generation of International
Geomagnetic Reference Field
Syntax [mag_field_vector, hor_intensity, declination, inclination,
total_intensity, mag_field_sec_variation,
sec_variation_horizontal, sec_variation_declination,
sec_variation_inclination,
sec_variation_total] = igrf11magm(height, latitude,
longitude, decimal_year)
Description [mag_field_vector, hor_intensity, declination,
inclination, total_intensity, mag_field_sec_variation,
sec_variation_horizontal, sec_variation_declination,
sec_variation_inclination, sec_variation_total] =
igrf11magm(height, latitude, longitude, decimal_year)
calculates the Earths magnetic field and the secular variation at a
specific location and time. This function uses the 11th generation of the
International Geomagnetic Reference Field (IGRF-11).
Tips The igrf11magm function is valid between the heights of 1000
meters to 600000 meters.
The igrf11magm function is valid between the years of 1900 and 2015.
This function has the limitations of the International Geomagnetic
Reference Field (IGRF).
Input
Arguments
height
Scalar distance, in meters, from the surface of the Earth.
latitude
Scalar geodetic latitude, in degrees. North latitude is positive, south
latitude is negative.
longitude
3-281
igrf11magm
Scalar geodetic longitude, in degrees. East longitude is positive, west
longitude is negative.
decimal_year
Scalar year, in decimal format. This value is the desired year to include
any fraction of the year that has already passed.
Output
Arguments
mag_field_vector
Magnetic field vector, in nanotesla (nT). Z is the vertical component
(+ve down).
hor_intensity
Horizontal intensity, in nanotesla (nT).
declination
Declination, in degrees (+ve east).
inclination
Inclination, in degrees (+ve down).
total_intensity
Total intensity, in nanotesla (nT).
mag_field_sec_variation
Secular variation in magnetic field vector, in nT/year. Z is the vertical
component (+ve down).
sec_variation_horizontal
Secular variation in horizontal intensity, in nT/year.
sec_variation_declination
Secular variation in declination, in minutes/year (+ve east).
3-282
igrf11magm
sec_variation_inclination
Secular variation in inclination, in minutes/year (+ve down).
sec_variation_total
Secular variation in total intensity, in nT/year.
Examples Calculate the magnetic model 1000 meters over Natick, Massachusetts
on July 4, 2005 using IGRF-11:
[XYZ, H, DEC, DIP, F] = igrf11magm(1000, 42.283, -71.35, ...
decyear(2005,7,4))
XYZ =
1.0e+004 *
1.8982 -0.5176 4.9558
H =
1.9675e+004
DEC =
-15.2524
DIP =
68.3467
F =
5.3320e+004
3-283
igrf11magm
References Lowes, F. J. The International Geomagnetic
Reference Field: A Health Warning. January, 2010.
http://www.ngdc.noaa.gov/IAGA/vmod/igrfhw.html
Blakely, R. J. Potential Theory in Gravity & Magnetic Applications,
Cambridge, UK: Cambridge University Press, 1996.
3-284
Aero.Animation.initialize
Purpose Create animation object figure and axes and build patches for bodies
Syntax initialize(h)
h.initialize
Description initialize(h) and h.initialize create a figure and axes for the
animation object h, and builds patches for the bodies associated with
the animation object. If there is an existing figure, this function
1 Clears out the old figure and its patches.
2 Creates a new figure and axes with default values.
3 Repopulates the axes with new patches using the surface to patch
data from each body.
Input
Arguments
h Animation object.
Examples Initialize the animation object, h.
h = Aero.Animation;
h.initialize();
3-285
initialize (Aero.FlightGearAnimation)
Purpose Set up FlightGear animation object
Syntax initialize(h)
h.initialize
Description initialize(h) and h.initialize set up the FlightGear version, IP
address, and socket for the FlightGear animation object h.
Examples Initialize the animation object, h.
h = Aero.FlightGearAnimation;
h.initialize();
See Also delete | play | GenerateRunScript | update
3-286
initialize (Aero.VirtualRealityAnimation)
Purpose Create and populate virtual reality animation object
Syntax initialize(h)
h.initialize
Description initialize(h) and h.initialize create a virtual reality animation
world and populate the virtual reality animation object h. If a previously
initialized virtual reality animation object existgs, and that object has
user-specified data, this function saves the previous object to be reset
after the initialization.
Examples Initialize the virtual reality animation object, h.
h = Aero.VirtualRealityAnimation;
h.VRWorldFilename = [matlabroot,'/toolbox/aero/astdemos/asttkoff.wrl'];
copyfile(h.VRWorldFilename,[tempdir,'asttkoff.wrl'],'f');
h.VRWorldFilename = [tempdir,'asttkoff.wrl'];
h.initialize();
See Also delete | play
3-287
Aero.Animation.initIfNeeded
Purpose Initialize animation graphics if needed
Syntax initIfNeeded(h)
h.initIfNeeded
Description initIfNeeded(h) and h.initIfNeeded initialize animation object
graphics if necessary.
Input
Arguments
h Animation object.
Examples Initialize the animation object graphics of h as needed.
h=Aero.Animation;
h.initIfNeeded;
3-288
juliandate
Purpose Julian date calculator
Syntax jd = juliandate(v)
jd = juliandate(s,f)
jd = juliandate(y,mo,d)
jd = juliandate([y,mo,d])
jd = juliandate(y,mo,d,h,mi,s)
jd = juliandate([y,mo,d,h,mi,s])
Description jd = juliandate(v) converts one or more date vectors, v, into Julian
date, jd. Input v can be an m-by-6 or m-by-3 matrix containing m full or
partial date vectors, respectively. juliandate returns a column vector
of m Julian dates, which are the number of days and fractions since
noon Universal Time on January 1, 4713 BCE.
A date vector contains six elements, specifying year, month, day,
hour, minute, and second. A partial date vector has three elements,
specifying year, month, and day. Each element of v must be a positive
double-precision number.
jd = juliandate(s,f) converts one or more date strings, s, into
Julian date, jd, using format string f. s can be a character array,
where each row corresponds to one date string, or a one-dimensional
cell array of strings. juliandate returns a column vector of m Julian
dates, where m is the number of strings in s.
All of the date strings in s must have the same format f, composed of
the same date format symbols as datestr. juliandate does not accept
formats containing the letter Q.
If the format does not contain enough information to compute a date
number, then:
Hours, minutes, and seconds default to 0.
Days default to 1.
Months default to January.
Years default to the current year.
3-289
juliandate
Date strings with two-character years are interpreted to be within 100
years of the current year.
jd = juliandate(y,mo,d) and jd = juliandate([y,mo,d])
return the decimal year for corresponding elements of the y,mo,d
(year,month,day) arrays. Specify y, mo, and d as one-dimensional arrays
of the same length or scalar values.
jd = juliandate(y,mo,d,h,mi,s) and jd =
juliandate([y,mo,d,h,mi,s]) return the Julian
dates for corresponding elements of the y,mo,d,h,mi,s
(year,month,day,hour,minute,second) arrays. Specify the six input
arguments as either one-dimensional arrays of the same length or
scalar values.
Examples Calculate Julian date for May 24, 2005:
jd = juliandate('24-May-2005','dd-mmm-yyyy')
jd =
2.4535e+006
Calculate Julian date for December 19, 2006:
jd = juliandate(2006,12,19)
jd =
2.4541e+006
Calculate Julian date for October 10, 2004, at 12:21:00 p.m.:
jd = juliandate(2004,10,10,12,21,0)
jd =
2.4533e+006
3-290
juliandate
Assumptions
and
Limitations
This function is valid for all common era (CE) dates in the Gregorian
calendar.
The calculation of Julian date does not take into account leap seconds.
See Also decyear | leapyear | mjuliandate
3-291
leapyear
Purpose Determine leap year
Syntax ly = leapyear(year)
Description ly = leapyear(year) determines whether one or more years are leap
years or not. The output, ly, is a logical array. year should be numeric.
Examples Determine whether 2005 is a leap year:
ly = leapyear(2005)
ly =
0
Determine whether 2000, 2005, and 2020 are leap years:
ly = leapyear([2000 2005 2020])
ly =
1 0 1
Assumptions
and
Limitations
The determination of leap years is done by Gregorian calendar rules.
See Also decyear | juliandate | mjuliandate
3-292
lla2ecef
Purpose Convert geodetic coordinates to Earth-centered Earth-fixed (ECEF)
coordinates
Syntax p = lla2ecef(lla)
p = lla2ecef(lla, model)
p = lla2ecef(lla, f, Re)
Description p = lla2ecef(lla) converts an m-by-3 array of geodetic coordinates
(latitude, longitude and altitude), lla, to an m-by-3 array of ECEF
coordinates, p. lla is in [degrees degrees meters]. p is in meters. The
default ellipsoid planet is WGS84.
p = lla2ecef(lla, model) is an alternate method for converting the
coordinates for a specific ellipsoid planet. Currently only 'WGS84' is
supported for model.
p = lla2ecef(lla, f, Re) is another alternate method for converting
the coordinates for a custom ellipsoid planet defined by flattening, f,
and the equatorial radius, Re, in meters.
Examples Determine ECEF coordinates at a latitude, longitude, and altitude:
p = lla2ecef([0 45 1000])
p =
1.0e+006 *
4.5107 4.5107 0
Determine ECEF coordinates at multiple latitudes, longitudes, and
altitudes, specifying WGS84 ellipsoid model:
p = lla2ecef([0 45 1000; 45 90 2000], 'WGS84')
p =
3-293
lla2ecef
1.0e+006 *
4.5107 4.5107 0
0.0000 4.5190 4.4888
Determine ECEF coordinates at multiple latitudes, longitudes, and
altitudes, specifying custom ellipsoid model:
f = 1/196.877360;
Re = 3397000;
p = lla2ecef([0 45 1000; 45 90 2000], f, Re)
p =
1.0e+006 *
2.4027 2.4027 0
0.0000 2.4096 2.3852
See Also ecef2lla | geoc2geod | geod2geoc
3-294
lla2flat
Purpose Estimate flat Earth position from geodetic latitude, longitude, and
altitude
Syntax flatearth_pos = lla2flat(lla, llo, psio, href)
flatearth_pos = lla2flat(lla, llo, psio, href,
ellipsoidModel)
flatearth_pos = lla2flat(lla, llo, psio, href, flattening,
equatorialRadius)
Description flatearth_pos = lla2flat(lla, llo, psio, href) estimates an
array of flat Earth coordinates, flatearth_pos, from an array of
geodetic coordinates, lla. This function estimates the flatearth_pos
value with respect to a reference location that llo, psio, and href
define.
flatearth_pos = lla2flat(lla, llo, psio, href,
ellipsoidModel) estimates the coordinates for a specific ellipsoid
planet.
flatearth_pos = lla2flat(lla, llo, psio, href, flattening,
equatorialRadius) estimates the coordinates for a custom ellipsoid
planet defined by flattening and equatorialRadius.
Tips This function assumes that the flight path and bank angle are zero.
This function assumes that the flat Earth z-axis is normal to the
Earth only at the initial geodetic latitude and longitude. This
function has higher accuracy over small distances from the initial
geodetic latitude and longitude. It also has higher accuracy at
distances closer to the equator. The function calculates a longitude
with higher accuracy when the variations in latitude are smaller.
Additionally, longitude is singular at the poles.
Input
Arguments
lla
m-by-3 array of geodetic coordinates (latitude, longitude, and altitude),
in [degrees, degrees, meters].
3-295
lla2flat
llo
Reference location, in degrees, of latitude and longitude, for the origin
of the estimation and the origin of the flat Earth coordinate system.
psio
Angular direction of flat Earth x-axis (degrees clockwise from north),
which is the angle in degrees used for converting flat Earth x and y
coordinates to the North and East coordinates.
href
Reference height from the surface of the Earth to the flat Earth frame
with regard to the flat Earth frame, in meters.
ellipsoidModel
String that specifies the specific ellipsoid planet model. This function
supports only 'WGS84'.
Default: WGS84
flattening
Custom ellipsoid planet defined by flattening.
equatorialRadius
Planetary equatorial radius, in meters.
Output
Arguments
flatearth_pos
Flat Earth position coordinates, in meters.
Examples Estimate coordinates at latitude, longitude, and altitude:
p = lla2flat( [ 0.1 44.95 1000 ], [0 45], 5, -100 )
p =
3-296
lla2flat
1.0e+004 *
1.0530 -0.6509 -0.0900
Estimate coordinates at multiple latitudes, longitudes, and altitudes,
specifying the WGS84 ellipsoid model:
p = lla2flat( [ 0.1 44.95 1000; -0.05 45.3 2000 ], [0 45], 5, -100, 'WGS84' )
p =
1.0e+004 *
1.0530 -0.6509 -0.0900
-0.2597 3.3751 -0.1900
Estimate coordinates at multiple latitudes, longitudes, and altitudes,
specifying a custom ellipsoid model:
f = 1/196.877360;
Re = 3397000;
p = lla2flat( [ 0.1 44.95 1000; -0.05 45.3 2000 ], [0 45], 5, -100, f, Re )
p =
1.0e+004 *
0.5588 -0.3465 -0.0900
-0.1373 1.7975 -0.1900
Algorithms The estimation begins by finding the small changes in latitude and
longitude from the output latitude and longitude minus the initial
latitude and longitude.
3-297
lla2flat
d
d
0
0
To convert geodetic latitude and longitude to the North and East
coordinates, the estimation uses the radius of curvature in the prime
vertical (R
N
) and the radius of curvature in the meridian (R
M
). R
N
and
R
M
are defined by the following relationships:
R
R
f f
R R
f f
f f
N
M N
1 2
1 2
1 2
2 2
0
2
2 2
0
( ) sin
( )
( ) sin
where (R) is the equatorial radius of the planet and f is the flattening
of the planet.
Small changes in the North (dN) and East (dE) positions are
approximated from small changes in the North and East positions by
dN
d
R
dE
d
R
M
N
j
(
,
\
,
(
j
(
,
\
,
(
atan
atan
1
1
0
cos
With the conversion of the North and East coordinates to the flat Earth
x and y coordinates, the transformation has the form of
p
p
N
E
x
y
,
,
]
]
]
,
]
]
]
,
,
]
]
]
cos sin
sin cos
where
3-298
lla2flat
( )
is the angle in degrees clockwise between the x-axis and north.
The flat Earth z-axis value is the negative altitude minus the reference
height (h
ref
).
p h h
z ref
References Etkin, B., Dynamics of Atmospheric Flight. NewYork: John Wiley &
Sons, 1972.
Stevens, B. L., and F. L. Lewis, Aircraft Control and Simulation, 2nd
ed. New York: John Wiley & Sons, 2003.
See Also flat2lla
3-299
load (Aero.Body)
Purpose Get geometry data from source
Syntax load(h, bodyDataSrc)
h.load(bodyDataSrc)
load(h, bodyDataSrc, geometrysource)
h.load(bodyDataSrc, geometrysource)
Description load(h, bodyDataSrc) and h.load(bodyDataSrc) load the graphics
data from the body graphics file. This command assumes a default
geometry source type set to Auto.
load(h, bodyDataSrc, geometrysource) and h.load(bodyDataSrc,
geometrysource) load the graphics data from the body graphics file,
bodyDataSrc, into the face, vertex, and color data of the animation
body object h. Then, when axes ax is available, you can use this data
to generate patches with generatePatches. geometrysource is the
geometry source type for the body.
By default geometrysource is set to Auto, which recognizes .mat
extensions as MAT-files, .ac extensions as Ac3d files, and structures
containing fields of name, faces, vertices, and cdata as MATLAB
variables. If you want to use alternate file extensions or file types, enter
one of the following:
Auto
Variable
MatFile
Ac3d
Custom
Examples Load the graphic data from the graphic data file, pa24-250_orange.ac,
into b.
b=Aero.Body;
b.load('pa24-250_orange.ac','Ac3d');
3-300
load (Aero.Body)
See Also generatePatches | move | update
3-301
machnumber
Purpose Compute Mach number using velocity and speed of sound
Syntax mach = machnumber(v, a)
Description mach = machnumber(v, a) computes m Mach numbers, mach, from an
m-by-3 array of velocities, v, and an array of m speeds of sound, a. v and
a must have the same length units.
Examples Determine the Mach number for velocity and speed of sound in feet
per second:
mach = machnumber([84.3905 33.7562 10.1269], 1116.4505)
mach =
0.0819
Determine the Mach number for velocity and speed of sound in meters
per second:
mach = machnumber([25.7222 10.2889 3.0867], [340.2941 295.0696])
mach =
0.0819 0.0945
Determine the Mach number for velocity and speed of sound in knots:
mach = machnumber([50 20 6; 5 0.5 2], [661.4789 573.5694])
mach =
0.0819
0.0094
3-302
machnumber
See Also airspeed | alphabeta | dpressure
3-303
mjuliandate
Purpose Modified Julian date calculator
Syntax mjd = mjuliandate(v)
mjd = mjuliandate(s,f)
mjd = mjuliandate(y,mo,d)
mjd = mjuliandate([y,mo,d])
mjd = mjuliandate(y,mo,d,h,mi,s)
mjd = mjuliandate([y,mo,d,h,mi,s])
Description mjd = mjuliandate(v) converts one or more date vectors, v, into
modified Julian date, mjd. Input v can be an m-by-6 or m-by-3 matrix
containing m full or partial date vectors, respectively. mjuliandate
returns a column vector of m modified Julian dates. Modified Julian
dates begin at midnight rather than noon, and the first two digits of its
corresponding Julian date are removed.
A date vector contains six elements, specifying year, month, day,
hour, minute, and second. A partial date vector has three elements,
specifying year, month, and day. Each element of v must be a positive
double-precision number.
mjd = mjuliandate(s,f) converts one or more date strings, s,
into modified Julian date, mjd, using format string f. s can be a
character array, where each row corresponds to one date string, or a
one-dimensional cell array of strings. mjuliandate returns a column
vector of m modified Julian dates, where m is the number of strings in s.
All of the date strings in s must have the same format f, composed of
the same date format symbols as the datestr function. mjuliandate
does not accept formats containing the letter Q.
If a format does not contain enough information to compute a date
number, then:
Hours, minutes, and seconds default to 0.
Days default to 1.
Months default to January.
Years default to the current year.
3-304
mjuliandate
Date strings with two-character years are interpreted to be within 100
years of the current year.
mjd = mjuliandate(y,mo,d) and mjd = mjuliandate([y,mo,d])
return the decimal year for corresponding elements of the y,mo,d
(year,month,day) arrays. Specify y, mo, and d as one-dimensional arrays
of the same length or scalar values.
mjd = mjuliandate(y,mo,d,h,mi,s) and mjd =
mjuliandate([y,mo,d,h,mi,s]) return the modified Julian
dates for corresponding elements of the y,mo,d,h,mi,s
(year,month,day,hour,minute,second) arrays. Specify the six arguments
as one-dimensional arrays of the same length or scalar values.
Examples Calculate the modified Julian date for May 24, 2005:
mjd = mjuliandate('24-May-2005','dd-mmm-yyyy')
mjd =
53514
Calculate the modified Julian date for December 19, 2006:
mjd = mjuliandate(2006,12,19)
mjd =
54088
Calculate the modified Julian date for October 10, 2004, at 12:21:00
p.m.:
mjd = mjuliandate(2004,10,10,12,21,0)
mjd =
5.3289e+004
3-305
mjuliandate
Assumptions
and
Limitations
This function is valid for all common era (CE) dates in the Gregorian
calendar.
The calculation of modified Julian date does not take into account leap
seconds.
See Also decyear | juliandate | leapyear
3-306
moonLibration
Purpose Moon librations
Syntax angles= moonLibration(ephemerisTime)
angles= moonLibration(ephemerisTime,ephemerisModel)
angles= moonLibration(ephemerisTime,ephemerisModel,action)
[angles,rates] = earthNutation( ___ )
Description angles= moonLibration(ephemerisTime) implements the Moon
libration angles for ephemerisTime.
The function uses the Chebyshev coefficients that the NASA Jet
Propulsion Laboratory provides.
angles= moonLibration(ephemerisTime,ephemerisModel) uses the
ephemerisModel coefficients to implement these values.
angles= moonLibration(ephemerisTime,ephemerisModel,action)
uses action to determine error reporting.
[angles,rates] = earthNutation( ___ ) implements the Moon
libration angles and rates using any combination of the input arguments
in the previous syntaxes.
Input
Arguments
ephemerisTime - Julian dates
scalar | 2-element vector | column vector | M-by-2 matrix
Julian dates for which the positions are calculated, specified as one
of the following:
Scalar
Specify one fixed Julian date.
2-element vector
Specify the Julian date in multiple parts. The first element is the
Julian date for a specific epoch that is the most recent midnight at or
3-307
moonLibration
before the interpolation epoch. The second element is the fractional
part of a day elapsed between the first element and epoch. The
second element must be positive. The value of the first element plus
the second element cannot exceed the maximum Julian date.
Column vector
Specify a column vector with M elements, where M is the number
of Julian dates.
M-by-2 matrix
Specify a matrix, where M is the number of Julian dates and the
second column contains the elapsed days (Julian epoch date/elapsed
day pairs).
Data Types
double
ephemerisModel - Ephemerides coefficients
`405' (default) | '421'|'423'
Ephemerides coefficients, specified as one of these ephemerides defined
by the Jet Propulsion Laboratory:
'405'
Released in 1998. This ephemerides takes into account the Julian
date range 2305424.50 (December 9, 1599 ) to 2525008.50 (February
20, 2201).
This function calculates these ephemerides with respect to the
International Celestial Reference Frame version 1.0, adopted in 1998.
'421'
Released in 2008. This ephemerides takes into account the Julian
date range 2414992.5 (December 4, 1899) to 2469808.5 (January
2, 2050).
This function calculates these ephemerides with respect to the
International Celestial Reference Frame version 1.0, adopted in 1998.
3-308
moonLibration
'423'
Released in 2010. This ephemerides takes into account the Julian
date range 2378480.5 (December 16, 1799) to 2524624.5 (February
1, 2200).
This function calculates these ephemerides with respect to the
International Celestial Reference Frame version 2.0, adopted in 2010.
Data Types
char
action - Function behavior
'Error' (default) | 'None' | 'Warning'
Function behavior when inputs are out of range, specified as a string as
one of these string values:
Value Description
'None' No action.
'Warning' Warning in the MATLAB Command Window,
model simulation continues.
'Error' MATLAB returns an exception, model
simulation stops.
Data Types
char
Output
Arguments
angles - Moon libration angles
M-by-3 numeric array
Moon libration angles, specified as an M-by-3 numeric array. M is the
number of Julian dates, in rows. The columns contain the Euler angles
( ) for Moon attitude, in radians.
If the input arguments include multiple Julian dates or epochs, this
array has the same number of rows as the ephemerisTime input.
3-309
moonLibration
rates - Moon libration angular rates
M-by-3 numeric array
Moon libration angular rates, specified as an M-by-3 numeric array. M
is the number of Julian dates, in rows. The columns contain the Moon
libration Euler angular rates (), in radians/day.
If the input arguments include multiple Julian dates or epochs, this
array has the same number of rows as the ephemerisTime input.
Examples Implement Libration Angles of Moon
Implement libration angles of the Moon for December 1, 1990 with
DE405. Use the juliandate function to calculate the input Julian date
value.
angles = moonLibration(juliandate(1990,12,1))
angles =
1.0e+03 *
0.0001 0.0004 1.8010
Implement Libration Angles and Rates for Moon
Specify the ephemerides (DE421) and use the juliandate function for
the date (January 1, 2000) to calculate both the Moon libration angles
and rates.
[angles,rates] = moonLibration([2451544.5 0.5],'421')
angles =
1.0e+03 *
-0.0001 0.0004 2.5643
rates =
-0.0001 0.0000 0.2301
3-310
moonLibration
References
[1] Folkner, W. M., J. G. Williams, D. H. Boggs, The Planetary and
Lunar Ephemeris DE 421, JPL Interplanetary Network Progress
Report 24-178, 2009.
[2] Vallado, D. A., Fundamentals of Astrodynamics and Applications,
McGraw-Hill, New York, 1997.
See Also juliandate | earthNutation | planetEphemeris
External
Web Sites
http://ssd.jpl.nasa.gov/?planet_eph_export
http://syrte.obspm.fr/jsr/journees2010/powerpoint/folkner.pdf
3-311
move (Aero.Body)
Purpose Change animation body position and orientation
Syntax move(h, translation, rotation)
h.move(translation,rotation)
Description move(h, translation, rotation) and
h.move(translation,rotation) set a new position and orientation for
the body object h. translation is a 1-by-3 matrix in the aerospace
body x-y-z coordinate system. rotation is a 1-by-3 matrix, in
radians, that specifies the rotations about the right-hand x-y-z
sequence of coordinate axes. The order of application of the rotation is
z-y-x (r-q-p).
Examples Change animation body position to newpos and newrot.
h = Aero.Body;
h.load('ac3d_xyzisrgb.ac','Ac3d');
newpos = h.Position + 1.00;
newrot = h.Rotation + 0.01;
h.move(newpos,newrot);
See Also load
3-312
move (Aero.Node)
Purpose Change node translation and rotation
Syntax move(h,translation,rotation)
h.move(translation,rotation)
Description move(h,translation,rotation) and h.move(translation,rotation)
set a new position and orientation for the node object h. translation
is a 1-by-3 matrix in the aerospace body x-y-z coordinate system
or another coordinate system. In the latter case, you can use the
CoordTransformFcn function to move it into an aerospace body. The
defined aerospace body coordinate system is defined relative to the
screen as x-left, y-in, z-down.
rotation is a 1-by-3 matrix, in radians, that specifies the rotations
about the right-hand x-y-z sequence of coordinate axes. The order of
application of the rotation is z-y-x (r-q-p). This function uses the
CoordTransformFcn to apply the translation and rotation from the
input coordinate system to the aerospace body. The function then moves
the translation and rotation from the aerospace body to the VRML
x-y-z coordinates. The defined VRML coordinate system is defined
relative to the screen as x-right, y-up, z-out.
Examples Move the Lynx body. This example uses the Simulink 3D Animation
vrnode/getfield function to retrieve the translation and rotation.
These coordinates are those used in the Simulink 3D Animation
software.
h = Aero.VirtualRealityAnimation;
h.VRWorldFilename = [matlabroot,'/toolbox/aero/astdemos/asttkoff.wrl'];
copyfile(h.VRWorldFilename,[tempdir,'asttkoff.wrl'],'f');
h.VRWorldFilename = [tempdir,'asttkoff.wrl'];
h.initialize();
newtrans = getfield(h.Nodes{4}.VRNode,'translation') + 1.0;
newrot = getfield(h.Nodes{4}.VRNode,'rotation') + [.2 0.01 0.01 0.01];
h.Nodes{4}.move(newtrans,newrot);
3-313
move (Aero.Node)
Limitations This function cannot get the node position in aerospace body
coordinates; it needs to use the CoordTransformFcn to do so.
This function cannot set a viewpoint position or orientation (see
addViewpoint).
See Also addNode
3-314
Aero.Animation.moveBody
Purpose Move body in animation object
Syntax moveBody(h,idx,translation,rotation)
h.moveBody(idx,translation,rotation)
Description moveBody(h,idx,translation,rotation) and
h.moveBody(idx,translation,rotation) set a new position and
attitude for the body specified with the index idx in the animation object
h. translation is a 1-by-3 matrix in the aerospace body coordinate
system. rotation is a 1-by-3 matrix, in radians, that specifies the
rotations about the right-hand x-y-z sequence of coordinate axes. The
order of application of the rotation is z-y-x (R-Q-P).
Input
Arguments
h Animation object.
translation 1-by-3 matrix in the aerospace body coordinate
system.
rotation 1-by-3 matrix, in radians, that specifies the
rotations about the right-hand x-y-z sequence
of coordinate axes.
idx Body specified with this index.
Examples Move the body with the index 1 to position offset from the original by
+ [0 0 -3] and rotation, rot1.
h = Aero.Animation;
idx1 = h.createBody('pa24-250_orange.ac','Ac3d');
pos1 = h.Bodies{1}.Position;
rot1 = h.Bodies{1}.Rotation;
h.moveBody(1,pos1 + [0 0 -3],rot1);
3-315
Node (Aero.Node)
Purpose Create node object for use with virtual reality animation
Syntax h = Aero.Node
Description h = Aero.Node creates a node object for use with virtual reality
animation.
See Aero.Node for further details.
See Also Aero.Node
3-316
nodeInfo (Aero.VirtualRealityAnimation)
Purpose Create list of nodes associated with virtual reality animation object
Syntax nodeInfo(h)
h.nodeInfo
n = nodeInfo(h)
n = h.nodeInfo
Description nodeInfo(h) and h.nodeInfo create a list of nodes associated with the
virtual reality animation object, h.
n = nodeInfo(h) and n = h.nodeInfo create a cell array (n) that
contains the node information. The function stores the information
in a cell array as follows:
N{1,n} = Node Index
N{2,n} = Node Name
N{3,n} = Node Type
where n is the number of nodes. You might want to use this function
to find an existing node by name and then perform a certain action
on it using the node index.
Examples
Create list of nodes associated with virtual reality animation object, h.
h = Aero.VirtualRealityAnimation;
h.VRWorldFilename = [matlabroot,'/toolbox/aero/astdemos/asttkoff.wrl'];
h.initialize();
h.nodeInfo;
See Also addNode
3-317
planetEphemeris
Purpose Position and velocity of astronomical objects
Syntax position= planetEphemeris(ephemerisTime,center,target)
position = planetEphemeris(ephemerisTime,center,target,
ephemerisModel)
position = planetEphemeris(ephemerisTime,center,target,
ephemerisModel,units)
position= planetEphemeris(ephemerisTime,center,target,
ephemerisModel,units,action)
[position,velocity] = planetEphemeris( ___ )
Description position= planetEphemeris(ephemerisTime,center,target)
implements the position of the target object relative to the specified
center object for a given Julian date ephemerisTime. By default, the
function implements the position based on the DE405 ephemerides
in units of km.
The function uses the Chebyshev coefficients that the NASA Jet
Propulsion Laboratory provides.
position = planetEphemeris(ephemerisTime,center,target,
ephemerisModel) uses the ephemerisModel coefficients to implement
these values.
position = planetEphemeris(ephemerisTime,center,target,
ephemerisModel,units) specifies the units for these values.
position= planetEphemeris(ephemerisTime,center,target,
ephemerisModel,units,action) uses action to determine error
reporting.
[position,velocity] = planetEphemeris( ___ ) implements the
position and velocity of a the target object relative to the specified
3-318
planetEphemeris
center for a given Julian date ephemerisTime using any of the input
arguments in the previous syntaxes.
Input
Arguments
ephemerisTime - Julian date
scalar | 2-element vector | column vector | M-by-2 matrix
Julian date for which the positions are calculated, specified as one of
the following:
Scalar
Specify one fixed Julian date.
2-element vector
Specify the Julian date in multiple parts. The first element is the
Julian date for a specific epoch that is the most recent midnight at or
before the interpolation epoch. The second element is the fractional
part of a day elapsed between the first element and epoch. The
second element must be positive. The value of the first element plus
the second element cannot exceed the maximum Julian date.
Column vector
Specify a column vector with M elements, where M is the number of
fixed Julian dates.
M-by-2 matrix
Specify a matrix, where M is the number of Julian dates and the
second column contains the elapsed days (Julian epoch date/elapsed
day pairs).
Data Types
double
center - Reference body (astronomical object) or point of
reference
'Sun' | 'Mercury' | 'Venus' | 'Earth' | 'Moon' | 'Mars' |
'Jupiter' | 'Saturn' | 'Uranus' | 'Neptune' | 'Pluto' |
'SolarSystem' | 'EarthMoon'
3-319
planetEphemeris
Reference body (astronomical object) or point of reference from which to
measure the target barycenter position and velocity.
Data Types
char
target - Target body (astronomical object) or point of reference
'Sun' | 'Mercury' | 'Venus' | 'Earth' | 'Moon' | 'Mars' |
'Jupiter' | 'Saturn' | 'Uranus' | 'Neptune' | 'Pluto' |
'SolarSystem' | 'EarthMoon'
Target body (astronomical object) or point of reference of the barycenter
position and velocity measurement.
Data Types
char
ephemerisModel - Ephemerides coefficients
`405' (default) | '421' | '423'
Ephemerides coefficients, specified as one of these ephemerides defined
by the Jet Propulsion Laboratory:
'405'
Released in 1998. This ephemerides takes into account the Julian
date range 2305424.50 (December 9, 1599 ) to 2525008.50 (February
20, 2201).
This function calculates these ephemerides with respect to the
International Celestial Reference Frame version 1.0, adopted in 1998.
'421'
Released in 2008. This ephemerides takes into account the Julian
date range 2414992.5 (December 4, 1899) to 2469808.5 (January
2, 2050).
This function calculates these ephemerides with respect to the
International Celestial Reference Frame version 1.0, adopted in 1998.
'423'
3-320
planetEphemeris
Released in 2010. This ephemerides takes into account the Julian
date range 2378480.5 (December 16, 1799) to 2524624.5 (February
1, 2200).
This function calculates these ephemerides with respect to the
International Celestial Reference Frame version 2.0, adopted in 2010.
Data Types
char
units - Output units
'km' (default) | 'AU'
Output units for position and velocity, specified as 'km' for km and
km/s or 'AU' for astronomical units or AU/day.
Data Types
char
action - Function behavior
'Error' (default) | 'None' | 'Warning'
Function behavior when inputs are out of range.
Value Description
'None' No action.
'Warning' Warning in the MATLAB Command Window,
model simulation continues.
'Error' MATLAB returns an exception, model
simulation stops.
Data Types
char
3-321
planetEphemeris
Output
Arguments
position - Barycenter position
M-by-3 vector
Barycenter position of the target object relative to the barycenter of
the center object, returned as an M-by-3 vector, where M is the number
of Julian dates. The 3 vector contains the x, y, and z of the position
along the International Celestial Reference Frame (ICRF). Units are
km or astronomical units (AU). If input arguments include multiple
Julian dates or epochs, this vector has the same number of rows as
the ephemerisTime input.
velocity - Barycenter velocity
M-by-3 vector
Barycenter velocity of the target object relative to the barycenter of the
center object, returned as an M-by-3 vector, where M is the number
of Julian dates. The 3 vector contains the velocity in the x, y, and z
directions along the ICRF. Velocity of the Units are km or astronomical
units (AU). If the input includes multiple Julian dates or epochs, this
vector has the same number of rows as the ephemerisTime input.
Examples Implement Position of Moon
Implement the position of the Moon with respect to the Earth for
December 1, 1990 with DE405:
position = planetEphemeris(juliandate(1990,12,1),'Earth','Moon')
position =
1.0e+05 *
2.3112 2.3817 1.3595
Implement Position and Velocity for Saturn
Implement the position and velocity for Saturn with respect to the
Solar System barycenter for noon on January 1, 2000 using DE421
and AU units:
[position,velocity] = planetEphemeris([2451544.5 0.5],...
'SolarSystem','Saturn','421','AU')
3-322
planetEphemeris
position =
6.3993 6.1720 2.2738
velocity =
-0.0043 0.0035 0.0016
References
[1] Folkner, W. M., J. G. Williams, D. H. Boggs, The Planetary and
Lunar Ephemeris DE 421, JPL Interplanetary Network Progress
Report 24-178, 2009.
[2] Ma, C. et al., The International Celestial Reference Frame as
Realized by Very Long Baseline Interferometry, Astronomical Journal,
Vol. 116, 516546, 1998.
[3] Vallado, D. A., Fundamentals of Astrodynamics and Applications,
McGraw-Hill, New York, 1997.
See Also juliandate | moonLibration | earthNutation
External
Web Sites
http://ssd.jpl.nasa.gov/?planet_eph_export
3-323
Aero.Animation.play
Purpose Animate Aero.Animation object given position/angle time series
Syntax play(h)
play.h
Description play(h) and play.h animate the loaded geometry in h for the
current TimeseriesDataSource at the specified rate given by the
'TimeScaling' property (in seconds of animation data per second of
wall-clock time) and animated at a certain number of frames per second
using the 'FramesPerSecond' property.
The time series data is interpreted according to the
'TimeseriesSourceType' property, which can be one
of:
'Timeseries' MATLAB time series data with six
values per time:
x y z phi theta psi
The values are resampled.
'Simulink.Timeseries' Simulink.Timeseries (Simulink signal
logging):
First data item
x y z
Second data item
phi theta psi
3-324
Aero.Animation.play
'StructureWithTime' Simulink struct with time (for
example, Simulink root outport
logging 'Structure with time'):
signals(1).values: x y z
signals(2).values: phi theta
psi
Signals are linearly interpolated vs.
time using interp1.
'Array6DoF' A double-precision array in n rows
and 7 columns for 6-DoF data:
time x y z phi theta psi. If a
double-precision array of 8 or more
columns is in 'TimeseriesSource',
the first 7 columns are used as 6-DoF
data.
'Array3DoF' A double-precision array in n rows
and 4 columns for 3-DoF data: time
x z theta. If a double-precision
array of 5 or more columns is in
'TimeseriesSource', the first 4
columns are used as 3-DoF data.
'Custom' Position and angle data is retrieved
from 'TimeseriesSource'
by the currently registered
'TimeseriesReadFcn'.
The following are limitations for the TStart and TFinal values:
TStart and TFinal must be numeric.
TStart and TFinal cannot be Inf or NaN.
TFinal must be greater than or equal to TStart.
3-325
Aero.Animation.play
TFinal cannot be greater than the maximum Timeseries time.
TStart cannot be less than the minimum Timeseries time.
The time advancement algorithm used by play is based on animation
frames counted by ticks:
ticks = ticks + 1;
time = tstart + ticks*FramesPerSecond*TimeScaling;
where
TimeScaling Specify the seconds of animation data
per second of wall-clock time.
FramesPerSecond Specify the number of frames
per second used to animate the
'TimeseriesSource'.
For default 'TimeseriesReadFcn' methods, the last frame played is
the last time value.
Time is in seconds, position values are in the same units as the geometry
data loaded into the animation object, and all angles are in radians.
Note If there is a 15% difference between the expected time advance
and the actual time advance, this method will generate the following
warning:
TimerPeriod has been set to <value>. You may wish to modify the animation
TimeScaling and FramesPerSecond properties to compensate for the
millisecond limit of the TimerPeriod. See documentation for details.
Input
Arguments
h Animation object.
3-326
Aero.Animation.play
Examples Animate the body, idx1, for the duration of the time series data.
h = Aero.Animation;
h.FramesPerSecond = 10;
h.TimeScaling = 5;
idx1 = h.createBody('pa24-250_orange.ac','Ac3d');
load simdata;
h.Bodies{1}.TimeSeriesSource = simdata;
h.show();
h.play();
3-327
play (Aero.FlightGearAnimation)
Purpose Animate FlightGear flight simulator using given position/angle time
series
Syntax play(h)
h.play
Description play(h) and h.play animate FlightGear flight simulator using
specified time series data in h. The time series data can be set in h by
using the property 'TimeseriesSource'.
The time series data, stored in the property 'TimeseriesSource', is
interpreted according to the 'TimeseriesSourceType' property, which
can be one of:
'Timeseries' MATLAB time series data with six
values per time:
latitude longitude altitude phi
theta psi
The values are resampled.
'StructureWithTime' Simulink struct with time (for
example, Simulink root outport
logging 'Structure with time'):
signals(1).values: latitude
longitude altitude
signals(2).values: phi theta
psi
Signals are linearly interpolated vs.
time using interp1.
3-328
play (Aero.FlightGearAnimation)
'Array6DoF' A double-precision array in n rows
and 7 columns for 6-DoF data: time
latitude longitude altitude phi
theta psi. If a double-precision
array of 8 or more columns is in
'TimeseriesSource', the first 7
columns are used as 6-DoF data.
'Array3DoF' A double-precision array in n rows
and 4 columns for 3-DoF data: time
latitude altitude theta. If a
double-precision array of 5 or more
columns is in 'TimeseriesSource',
the first 4 columns are used as 3-DoF
data.
'Custom' Position and angle data is retrieved
from 'TimeseriesSource'
by the currently registered
'TimeseriesReadFcn'.
The time advancement algorithm used by play is based on animation
frames counted by ticks:
ticks = ticks + 1;
time = tstart + ticks*FramesPerSecond*TimeScaling;
where
TimeScaling Specify the seconds of animation data
per second of wall-clock time.
FramesPerSecond Specify the number of frames
per second used to animate the
'TimeseriesSource'.
For default 'TimeseriesReadFcn' methods, the last frame played is
the last time value.
3-329
play (Aero.FlightGearAnimation)
Time is in seconds, position values are in the same units as
the geometry model to be used by FlightGear (see the property
'GeometryModelName'), and all angles are in radians. A possible result
of using incorrect units is the early termination of the FlightGear flight
simulator.
Note If there is a 15% difference between the expected time advance
and the actual time advance, this method will generate the following
warning:
TimerPeriod has been set to <value>. You may wish to modify the animation
TimeScaling and FramesPerSecond properties to compensate for the
millisecond limit of the TimerPeriod. See documentation for details.
The play method supports FlightGear animation objects with custom
timers.
Limitations The following are limitations for the TStart and TFinal values:
TStart and TFinal must be numeric.
TStart and TFinal cannot be Inf or NaN.
TFinal must be greater than or equal to TStart.
TFinal cannot be greater than the maximum Timeseries time.
TStart cannot be less than the minimum Timeseries time.
Examples Animate FlightGear flight simulator using the given 'Array3DoF'
position/angle time series data:
data = [86.2667 -2.13757034184404 7050.896596 -0.135186746141248;...
87.2833 -2.13753906554384 6872.545051 -0.117321084678936;...
88.2583 -2.13751089592972 6719.405713 -0.145815609299676;...
89.275 -2.13747984652232 6550.117118 -0.150635248762596;...
90.2667 -2.13744993157894 6385.05883 -0.143124782831999;...
3-330
play (Aero.FlightGearAnimation)
91.275 -2.13742019116849 6220.358163 -0.147946202530756;...
92.275 -2.13739055547779 6056.906647 -0.167529704309343;...
93.2667 -2.13736104196014 5892.356118 -0.152547361677911;...
94.2583 -2.13733161570895 5728.201718 -0.161979312941906;...
95.2583 -2.13730231163081 5562.923808 -0.122276929636682;...
96.2583 -2.13727405475022 5406.736322 -0.160421658944379;...
97.2667 -2.1372440001805 5239.138477 -0.150591353731908;...
98.2583 -2.13721598764601 5082.78798 -0.147737722951605];
h = fganimation
h.TimeseriesSource = data
h.TimeseriesSourceType = 'Array3DoF'
play(h)
Animate FlightGear flight simulator using the custom timer,
MyFGTimer.
h.SetTimer('MyFGTimer')
h.play('MyFGTimer')
See Also GenerateRunScript | initialize | update
3-331
play (Aero.VirtualRealityAnimation)
Purpose Animate virtual reality world for given position and angle in time series
data
Syntax play(h)
h.play
Description play(h) and h.play animate the virtual reality world in h for the
current TimeseriesDataSource at the specified rate given by the
'TimeScaling' property (in seconds of animation data per second of
wall-clock time) and animated at a certain number of frames per second
using the 'FramesPerSecond' property.
The time series data is interpreted according to the
'TimeseriesSourceType' property, which can be one
of:
'timeseries' MATLAB time series data with six
values per time:
x y z phi theta psi
The values are resampled.
'Simulink.Timeseries' Simulink.Timeseries (Simulink signal
logging):
First data item
x y z
Second data item
phi theta psi
3-332
play (Aero.VirtualRealityAnimation)
'StructureWithTime' Simulink struct with time (for
example, Simulink root outport
logging 'Structure with time'):
signals(1).values: x y z
signals(2).values: phi theta
psi
Signals are linearly interpolated vs.
time using interp1.
'Array6DoF' A double-precision array in n rows
and 7 columns for 6-DoF data:
time x y z phi theta psi. If a
double-precision array of 8 or more
columns is in 'TimeseriesSource',
the first 7 columns are used as 6-DoF
data.
'Array3DoF' A double-precision array in n rows
and 4 columns for 3-DoF data: time
x z theta. If a double-precision
array of 5 or more columns is in
'TimeseriesSource', the first 4
columns are used as 3-DoF data.
'Custom' Position and angle data is retrieved
from 'TimeseriesSource'
by the currently registered
'TimeseriesReadFcn'.
The time advancement algorithm used by play is based on animation
frames counted by ticks:
ticks = ticks + 1;
time = tstart + ticks*FramesPerSecond*TimeScaling;
where
3-333
play (Aero.VirtualRealityAnimation)
TimeScaling Specify the seconds of animation data
per second of wall-clock time.
FramesPerSecond Specify the number of frames
per second used to animate the
'TimeseriesSource'.
For default 'TimeseriesReadFcn' methods, the last frame played is
the last time value.
Time is in seconds, position values are in the same units as the geometry
data loaded into the animation object, and all angles are in radians.
Examples Animate virtual reality world, asttkoff.
h = Aero.VirtualRealityAnimation;
h.FramesPerSecond = 10;
h.TimeScaling = 5;
h.VRWorldFilename = [matlabroot,'/toolbox/aero/astdemos/asttkoff.wrl'];
h.initialize();
load takeoffData
h.Nodes{7}.TimeseriesSource = takeoffData;
h.Nodes{7}.TimeseriesSourceType = 'StructureWithTime';
h.Nodes{7}.CoordTransformFcn = @vranimCustomTransform;
h.play();
See Also initialize
3-334
quat2angle
Purpose Convert quaternion to rotation angles
Syntax [r1 r2 r3] = quat2angle(q)
[r1 r2 r3] = quat2angle(q, s)
Description [r1 r2 r3] = quat2angle(q) calculates the set of rotation angles,
r1, r2, r3, for a given quaternion, q. q is an m-by-4 matrix containing
m quaternions. Each element of q must be a real number. q has its
scalar number as the first column.
Rotation angles are output in radians.
r1
Returns an m array of first rotation angles.
r2
Returns an m array of second rotation angles.
r3
Returns an m array of third rotation angles.
[r1 r2 r3] = quat2angle(q, s) calculates the set of rotation angles,
r1, r2, r3, for a given quaternion, q, and a specified rotation sequence, s.
The default rotation sequence is 'ZYX', where r1 is z-axis rotation, r2
is y-axis rotation, and r3 is x-axis rotation.
Supported rotation sequence strings are 'ZYX', 'ZYZ', 'ZXY', 'ZXZ',
'YXZ', 'YXY', 'YZX', 'YZY', 'XYZ', 'XYX', 'XZY', and 'XZX'.
Examples Determine the rotation angles from q = [1 0 1 0].
[yaw, pitch, roll] = quat2angle([1 0 1 0])
yaw =
0
pitch =
1.5708
roll =
0
3-335
quat2angle
Determine the rotation angles from multiple quaternions.
q = [1 0 1 0; 1 0.5 0.3 0.1];
[pitch, roll, yaw] = quat2angle(q, 'YXZ')
pitch =
1.5708
0.8073
roll =
0
0.7702
yaw =
0
0.5422
Assumptions
and
Limitations
The limitations for the 'ZYX', 'ZXY', 'YXZ', 'YZX', 'XYZ', and 'XZY'
implementations generate an r2 angle that lies between 90 degrees,
and r1 and r3 angles that lie between 180 degrees.
The limitations for the 'ZYZ', 'ZXZ', 'YXY', 'YZY', 'XYX', and 'XZX'
implementations generate an r2 angle that lies between 0 and 180
degrees, and r1 and r3 angles that lie between 180 degrees.
See Also angle2dcm | angle2quat | dcm2angle | dcm2quat | quat2dcm
3-336
quat2dcm
Purpose Convert quaternion to direction cosine matrix
Syntax n = quat2dcm(q)
Description n = quat2dcm(q) calculates the direction cosine matrix, n, for a given
quaternion, q. Input q is an m-by-4 matrix containing m quaternions. n
returns a 3-by-3-by-m matrix of direction cosine matrices. The direction
cosine matrix performs the coordinate transformation of a vector in
inertial axes to a vector in body axes. Each element of q must be a real
number. Additionally, q has its scalar number as the first column.
Examples Determine the direction cosine matrix from q = [1 0 1 0]:
dcm = quat2dcm([1 0 1 0])
dcm =
0 0 -1.0000
0 1.0000 0
1.0000 0 0
Determine the direction cosine matrices from multiple quaternions:
q = [1 0 1 0; 1 0.5 0.3 0.1];
dcm = quat2dcm(q)
dcm(:,:,1) =
0 0 -1.0000
0 1.0000 0
1.0000 0 0
dcm(:,:,2) =
3-337
quat2dcm
0.8519 0.3704 -0.3704
0.0741 0.6148 0.7852
0.5185 -0.6963 0.4963
See Also angle2dcm | dcm2angle | dcm2quat | angle2quat | quat2angle |
quatrotate
3-338
quatconj
Purpose Calculate conjugate of quaternion
Syntax n = quatconj(q)
Description n = quatconj(q) calculates the conjugate, n, for a given quaternion,
q. Input q is an m-by-4 matrix containing m quaternions. n returns an
m-by-4 matrix of conjugates. Each element of q must be a real number.
Additionally, q has its scalar number as the first column.
Examples Determine the conjugate of q = [1 0 1 0]:
conj = quatconj([1 0 1 0])
conj =
1 0 -1 0
See Also quatdivide | quatinv | quatmod | quatmultiply | quatnorm |
quatnormalize | quatrotate
3-339
quatdivide
Purpose Divide quaternion by another quaternion
Syntax n = quatdivide(q,r)
Description n = quatdivide(q,r) calculates the result of quaternion division, n,
for two given quaternions, q and r. Inputs q and r can each be either an
m-by-4 matrix containing m quaternions, or a single 1-by-4 quaternion.
n returns an m-by-4 matrix of quaternion quotients. Each element of q
and r must be a real number. Additionally, q and r have their scalar
number as the first column.
Examples Determine the division of two 1-by-4 quaternions:
q = [1 0 1 0];
r = [1 0.5 0.5 0.75];
d = quatdivide(q, r)
d =
0.7273 0.1212 0.2424 -0.6061
Determine the division of a 2-by-4 quaternion by a 1-by-4 quaternion:
q = [1 0 1 0; 2 1 0.1 0.1];
r = [1 0.5 0.5 0.75];
d = quatdivide(q, r)
d =
0.7273 0.1212 0.2424 -0.6061
1.2727 0.0121 -0.7758 -0.4606
See Also quatconj | quatinv | quatmod | quatmultiply | quatnorm |
quatnormalize | quatrotate
3-340
quatinv
Purpose Calculate inverse of quaternion
Syntax n = quatinv(q)
Description n = quatinv(q) calculates the inverse, n, for a given quaternion, q.
Input q is an m-by-4 matrix containing m quaternions. n returns an
m-by-4 matrix of inverses. Each element of q must be a real number.
Additionally, q has its scalar number as the first column.
Examples Determine the inverse of q = [1 0 1 0]:
qinv = quatinv([1 0 1 0])
qinv =
0.5000 0 -0.5000 0
See Also quatconj | quatdivide | quatmod | quatmultiply | quatnorm |
quatnormalize | quatrotate
3-341
quatmod
Purpose Calculate modulus of quaternion
Syntax n = quatmod(q)
Description n = quatmod(q) calculates the modulus, n, for a given quaternion,
q. Input q is an m-by-4 matrix containing m quaternions. n returns a
column vector of m moduli. Each element of q must be a real number.
Additionally, q has its scalar number as the first column.
Examples Determine the modulus of q = [1 0 0 0]:
mod = quatmod([1 0 0 0])
mod =
1
See Also quatconj | quatdivide | quatinv | quatmultiply | quatnorm |
quatnormalize | quatrotate
3-342
quatmultiply
Purpose Calculate product of two quaternions
Syntax n = quatmultiply(q,r)
Description n = quatmultiply(q,r) calculates the quaternion product, n, for two
given quaternions, q and r. Inputs q and r can each be either an
m-by-4 matrix containing m quaternions, or a single 1-by-4 quaternion.
n returns an m-by-4 matrix of quaternion products. Each element of q
and r must be a real number. Additionally, q and r have their scalar
number as the first column.
The quaternions have the form of
q q q q q
0 1 2 3
i j k
and
r r r r r
0 1 2 3
i j k
The quaternion product has the form of
n q r n n n n
0 1 2 3
i j k
where
n r q r q r q r q
n r q r q r q r q
n r q r
0 0 0 1 1 2 2 3 3
1 0 1 1 0 2 3 3 2
2 0 2
( )
( )
(
11 3 2 0 3 1
3 0 3 1 2 2 1 3 0
q r q r q
n r q r q r q r q
)
( )
Note Quaternion multiplication is not commutative.
3-343
quatmultiply
Examples Determine the product of two 1-by-4 quaternions:
q = [1 0 1 0];
r = [1 0.5 0.5 0.75];
mult = quatmultiply(q, r)
mult =
0.5000 1.2500 1.5000 0.2500
Determine the product of a 1-by-4 quaternion with itself:
q = [1 0 1 0];
mult = quatmultiply(q)
mult =
0 0 2 0
Determine the product of 1-by-4 and 2-by-4 quaternions:
q = [1 0 1 0];
r = [1 0.5 0.5 0.75; 2 1 0.1 0.1];
mult = quatmultiply(q, r)
mult =
0.5000 1.2500 1.5000 0.2500
1.9000 1.1000 2.1000 -0.9000
See Also quatconj | quatdivide | quatinv | quatmod | quatnorm |
quatnormalize | quatrotate
3-344
quatnorm
Purpose Calculate norm of quaternion
Syntax n = quatnorm(q)
Description n = quatnorm(q) calculates the norm, n, for a given quaternion, q.
Input q is an m-by-4 matrix containing m quaternions. n returns a
column vector of m norms. Each element of q must be a real number.
Additionally, q has its scalar number as the first column.
Examples Determine the norm of q = [1 0 0 0]:
norm = quatnorm([1 0 0 0])
norm =
1
See Also quatconj | quatdivide | quatinv | quatmod | quatmultiply |
quatnormalize | quatrotate
3-345
quatnormalize
Purpose Normalize quaternion
Syntax n = quatnormalize(q)
Description n = quatnormalize(q) calculates the normalized quaternion, n,
for a given quaternion, q. Input q is an m-by-4 matrix containing m
quaternions. n returns an m-by-4 matrix of normalized quaternions.
Each element of q must be a real number. Additionally, q has its scalar
number as the first column.
Examples Normalize q = [1 0 1 0]:
normal = quatnormalize([1 0 1 0])
normal =
0.7071 0 0.7071 0
See Also quatconj | quatdivide | quatinv | quatmod | quatmultiply |
quatnorm | quatrotate
3-346
quatrotate
Purpose Rotate vector by quaternion
Syntax n = quatrotate(q,r)
Description n = quatrotate(q,r) calculates the rotated vector, n, for a quaternion,
q, and a vector, r. q is either an m-by-4 matrix containing m quaternions,
or a single 1-by-4 quaternion. r is either an m-by-3 matrix, or a single
1-by-3 vector. n returns an m-by-3 matrix of rotated vectors. Each
element of q and r must be a real number. Additionally, q has its scalar
number as the first column.
Examples Rotate a 1-by-3 vector by a 1-by-4 quaternion:
q = [1 0 1 0];
r = [1 1 1];
n = quatrotate(q, r)
n =
-1.0000 1.0000 1.0000
Rotate a 1-by-3 vector by a 2-by-4 quaternion:
q = [1 0 1 0; 1 0.5 0.3 0.1];
r = [1 1 1];
n = quatrotate(q, r)
n =
-1.0000 1.0000 1.0000
0.8519 1.4741 0.3185
Rotate a 2-by-3 vector by a 1-by-4 quaternion:
q = [1 0 1 0];
r = [1 1 1; 2 3 4];
3-347
quatrotate
n = quatrotate(q, r)
n =
-1.0000 1.0000 1.0000
-4.0000 3.0000 2.0000
Rotate a 2-by-3 vector by a 2-by-4 quaternion:
q = [1 0 1 0; 1 0.5 0.3 0.1];
r = [1 1 1; 2 3 4];
n = quatrotate(q, r)
n =
-1.0000 1.0000 1.0000
1.3333 5.1333 0.9333
See Also quatconj | quatinv | quatmod | quatmultiply | quatnorm |
quatnormalize
3-348
read (Aero.Geometry)
Purpose Read geometry data using current reader
Syntax read(h, source)
Description read(h, source) reads the geometry data of the geometry object h.
source can be:
'Auto'
Selects default reader.
'Variable'
Selects MATLAB variable of type structure structures that contains
the fieldsname, faces, vertices, and cdata that define the geometry
in the Handle Graphics patches.
'MatFile'
Selects MAT-file reader.
'Ac3dFile'
Selects Ac3d file reader.
'Custom'
Selects a custom reader.
Examples Read geometry data from Ac3d file, pa24-250_orange.ac.
g = Aero.Geometry;
g.Source = 'Ac3d';
g.read('pa24-250_orange.ac');
3-349
Aero.Animation.removeBody
Purpose Remove one body from animation
Syntax h = removeBody(h,idx)
h = h.removeBody(idx)
Description h = removeBody(h,idx) and h = h.removeBody(idx) remove the
body specified by the index idx from the animation object h.
Input
Arguments
h Animation object.
idx Body specified with this index.
Examples Remove the body identified by the index, 1.
h = Aero.Animation;
idx1 = h.createBody('pa24-250_orange.ac','Ac3d');
h = removeBody(h,1)
3-350
removeNode (Aero.VirtualRealityAnimation)
Purpose Remove node from virtual reality animation object
Syntax removeNode(h,node)
h.removeNode(node)
Description removeNode(h,node) and h.removeNode(node) remove the node
specified by node from the virtual reality animation object h. node can
be either the node name or the node index. This function can remove
only one node at a time.
Note You can use only this function to remove a node added by
addNode. If you need to remove a node from a previously defined .wrl
file, use a VRML editor.
Examples Remove the node, Lynx1.
h = Aero.VirtualRealityAnimation;
h.VRWorldFilename = [matlabroot,'/toolbox/aero/astdemos/asttkoff.wrl'];
copyfile(h.VRWorldFilename,[tempdir,'asttkoff.wrl'],'f');
h.VRWorldFilename = [tempdir,'asttkoff.wrl'];
h.initialize();
h.addNode('Lynx1',[matlabroot,'/toolbox/aero/astdemos/chaseHelicopter.wrl']);
h.removeNode('Lynx1');
See Also addNode
3-351
removeViewpoint (Aero.VirtualRealityAnimation)
Purpose Remove viewpoint node from virtual reality animation
Syntax removeViewpoint(h,viewpoint)
h.removeViewpoint(viewpoint)
Description removeViewpoint(h,viewpoint) and h.removeViewpoint(viewpoint)
remove the viewpoint specified by viewpoint from the virtual reality
animation object h. viewpoint can be either the viewpoint name or the
viewpoint index. This function can remove only one viewpoint at a time.
Note You can use this function to remove a viewpoint added by
addViewpoint. If you need to remove a viewpoint from a previously
defined .wrl file, use a VRML editor.
Examples Remove the node, Lynx1.
h = Aero.VirtualRealityAnimation;
h.VRWorldFilename = [matlabroot,'/toolbox/aero/astdemos/asttkoff.wrl'];
copyfile(h.VRWorldFilename,[tempdir,'asttkoff.wrl'],'f');
h.VRWorldFilename = [tempdir,'asttkoff.wrl'];
h.initialize();
h.addViewpoint(h.Nodes{2}.VRNode,'children','chaseView','View From Helicopter');
h.removeViewpoint('chaseView');
See Also addViewpoint
3-352
rrdelta
Purpose Compute relative pressure ratio
Syntax d = rrdelta(p0, mach, g)
Description d = rrdelta(p0, mach, g) computes m pressure relative ratios, d,
from m static pressures, p0, m Mach numbers, mach, and m specific heat
ratios, g. p0 must be in pascals.
Examples Determine the relative pressure ratio for three pressures:
delta = rrdelta([101325 22632.0672 4328.1393], 0.5, 1.4)
delta =
1.1862 0.2650 0.0507
Determine the relative pressure ratio for three pressures and three
different heat ratios:
delta = rrdelta([101325 22632.0672 4328.1393], 0.5, [1.4 1.35 1.4])
delta =
1.1862 0.2635 0.0507
Determine the relative pressure ratio for three pressures at three
different conditions:
delta = rrdelta([101325 22632.0672 4328.1393], [0.5 1 2], [1.4 1.35 1.4])
delta =
1.1862 0.4161 0.3342
3-353
rrdelta
Assumptions
and
Limitations
For cases in which total pressure ratio is desired (Mach number is
nonzero), the total pressures are calculated assuming perfect gas
(with constant molecular weight, constant pressure specific heat, and
constant specific heat ratio) and dry air.
References Aeronautical Vestpocket Handbook, United Technologies Pratt &
Whitney, August, 1986
See Also rrsigma | rrtheta
3-354
rrsigma
Purpose Compute relative density ratio
Syntax s = rrsigma(rho, mach, g)
Description s = rrsigma(rho, mach, g) computes m density relative ratios, s,
from m static densities, rho, m Mach numbers, mach, and m specific heat
ratios, g. rho must be in kilograms per meter cubed.
Examples Determine the relative density ratio for three densities:
sigma = rrsigma([1.225 0.3639 0.0953], 0.5, 1.4)
sigma =
1.1297 0.3356 0.0879
Determine the relative density ratio for three densities and three
different heat ratios:
sigma = rrsigma([1.225 0.3639 0.0953], 0.5, [1.4 1.35 1.4])
sigma =
1.1297 0.3357 0.0879
Determine the relative density ratio for three densities at three
different conditions:
sigma = rrsigma([1.225 0.3639 0.0953], [0.5 1 2], [1.4 1.35 1.4])
sigma =
1.1297 0.4709 0.3382
3-355
rrsigma
Assumptions
and
Limitations
For cases in which total density ratio is desired (Mach number is
nonzero), the total density is calculated assuming perfect gas (with
constant molecular weight, constant pressure specific heat, and
constant specific heat ratio) and dry air.
References Aeronautical Vestpocket Handbook, United Technologies Pratt &
Whitney, August, 1986
See Also rrdelta | rrtheta
3-356
rrtheta
Purpose Compute relative temperature ratio
Syntax th = rrtheta(t0, mach, g)
Description th = rrtheta(t0, mach, g) computes m temperature relative ratios,
th, from m static temperatures, t0, m Mach numbers, mach, and m specific
heat ratios, g. t0 must be in kelvin.
Examples Determine the relative temperature ratio for three temperatures:
th = rrtheta([273.15 310.9278 373.15], 0.5, 1.4)
th =
0.9953 1.1330 1.3597
Determine the relative temperature ratio for three temperatures and
three different heat ratios:
th = rrtheta([273.15 310.9278 373.15], 0.5, [1.4 1.35 1.4])
th =
0.9953 1.1263 1.3597
Determine the relative temperature ratio for three temperatures at
three different conditions:
th = rrtheta([273.15 310.9278 373.15], [0.5 1 2], [1.4 1.35 1.4])
th =
0.9953 1.2679 2.3310
3-357
rrtheta
Assumptions
and
Limitations
For cases in which total temperature ratio is desired (Mach number
is nonzero), the total temperature is calculated assuming perfect gas
(with constant molecular weight, constant pressure specific heat, and
constant specific heat ratio) and dry air.
References Aeronautical Vestpocket Handbook, United Technologies Pratt &
Whitney, August, 1986
See Also rrdelta | rrsigma
3-358
saveas (Aero.VirtualRealityAnimation)
Purpose Save virtual reality world associated with virtual reality animation
object
Syntax saveas(h, filename)
h.saveas(filename)
Description saveas(h, filename) and h.saveas(filename) save the world
associated with the virtual reality animation object, h, into the .wrl file
name specified in the filename variable. After saving, this function
reinitializes the virtual reality animation object from the saved world.
Examples Save the world associated with h.
h = Aero.VirtualRealityAnimation;
h.VRWorldFilename = [matlabroot,'/toolbox/aero/astdemos/asttkoff.wrl'];
copyfile(h.VRWorldFilename,[tempdir,asttkoff.wrl'],'f');
h.VRWorldFilename = [tempdir,asttkoff.wrl'];
h.initialize();
h.saveas([tempdir,'my_asttkoff.wrl']);
3-359
SetTimer (Aero.FlightGearAnimation)
Purpose Set name of timer for animation of FlightGear flight simulator
Syntax SetTimer(h)
h.SetTimer
SetTimer(h, MyFGTimer)
h.SetTimer('MyFGTimer')
Description SetTimer(h) and h.SetTimer set the name of the MATLAB timer
for the animation of the FlightGear flight simulator. SetTimer(h,
MyFGTimer) and h.SetTimer('MyFGTimer') set the name of the
MATLAB timer for the animation of the FlightGear flight simulator
and assign a custom name to the timer.
You can use this function to customize your FlightGear animation
object. This customization allows you to simultaneously run multiple
FlightGear objects if you want to use
Multiple FlightGear sessions
Different ports to connect to those sessions
Examples Set the MATLAB timer for animation of the FlightGear animation
object, h:
h = Aero.FlightGearAnimation
h.SetTimer
Set the MATLAB timer used for animation of the FlightGear animation
object, h, and assign a custom name, MyFGTimer, to the timer:
h = Aero.FlightGearAnimation
h.SetTimer('MyFGTimer')
See Also ClearTimer
3-360
Aero.Animation.show
Purpose Show animation object figure
Syntax show(h)
h.show
Description show(h) and h.show create the figure graphics object for the animation
object h. Use the Aero.Animation.hide function to close the figure.
Input
Arguments
h Animation object.
Examples Show the animation object, h.
h = Aero.Animation;
idx1 = h.createBody('pa24-250_orange.ac','Ac3d');
h.show;
3-361
update (Aero.Body)
Purpose Change body position and orientation as function of time
Syntax update(h,t)
h.update(t)
Description update(h,t) and h.update(t) change body position and orientation of
body h as a function of time t. t is a scalar in seconds.
Note This function requires that you load the body geometry and time
series data first.
Examples Update the body b with time in seconds of 5.
b=Aero.Body;
b.load('pa24-250_orange.ac','Ac3d');
tsdata = [ ...
0, 1,1,1, 0,0,0; ...
10 2,2,2, 1,1,1; ];
b.TimeSeriesSource = tsdata;
b.update(5);
See Also load
3-362
update (Aero.Camera)
Purpose Update camera position based on time and position of other Aero.Body
objects
Syntax update(h,newtime,bodies)
h.update(newtime,bodies)
Description update(h,newtime,bodies) and h.update(newtime,bodies) update
the camera object, h, position and aim point data based on the new time,
newtime, and position of other Aero.Body objects, bodies. This function
updates the camera object PrevTime property to newtime.
See Also Aero.Animation.play
3-363
update (Aero.FlightGearAnimation)
Purpose Update position data to FlightGear animation object
Syntax update(h,time)
h.update(time)
Description update(h,time) and h.update(time) update the position data to the
FlightGear animation object via UDP. It sets the new position and
attitude of body h. time is a scalar in seconds.
Note This function requires that you load the time series data and
run FlightGear first.
Examples Configure a body with TimeSeriesSource set to simdata, then update
the body with time time equal to 0.
h = Aero.FlightGearAnimation;
h.FramesPerSecond = 10;
h.TimeScaling = 5;
load simdata;
h.TimeSeriesSource = simdata;
t = 0;
h.update(t);
See Also GenerateRunScript | initialize | play
3-364
update (Aero.Node)
Purpose Change node position and orientation versus time data
Syntax update(h,t)
h.update(t)
Description update(h,t) and h.update(t) change node position and orientation of
node h as a function of time t. t is a scalar in seconds.
Note This function requires that you load the node and time series
data first.
Examples Move the Lynx body.
h = Aero.VirtualRealityAnimation;
h.FramesPerSecond = 10;
h.TimeScaling = 5;
h.VRWorldFilename = [matlabroot,'/toolbox/aero/astdemos/asttkoff.wrl'];
copyfile(h.VRWorldFilename,[tempdir,'asttkoff.wrl'],'f');
h.VRWorldFilename = [tempdir,'asttkoff.wrl'];
h.initialize();
load takeoffData
h.Nodes{7}.TimeseriesSource = takeoffData;
h.Nodes{7}.TimeseriesSourceType = 'StructureWithTime';
h.Nodes{7}.update(5);
See Also updateNodes
3-365
Aero.Animation.updateBodies
Purpose Update bodies of animation object
Syntax h = updateBodies(time)
h.updateBodies(time)
Description h = updateBodies(time) and h.updateBodies(time) set the new
position and attitude of movable bodies in the animation object h. This
function updates the bodies contained in the animation object h. time
is a scalar in seconds.
Examples Configure a body with TimeSeriesSource set to simdata, then update
the body with time t equal to 0.
h = Aero.Animation;
h.FramesPerSecond = 10;
h.TimeScaling = 5;
idx1 = h.createBody('pa24-250_orange.ac','Ac3d');
load simdata;
h.Bodies{1}.TimeSeriesSource = simdata;
t = 0;
h.updateBodies(t);
3-366
Aero.Animation.updateCamera
Purpose Update camera in animation object
Syntax updateCamera(h,time)
h.updateCamera(time)
Description updateCamera(h,time) and h.updateCamera(time) update the camera
in the animation object h. time is a scalar in seconds.
Note The PositionFcn property of a camera object controls the camera
position relative to the bodies in the animation. The default camera
PositionFcn follows the path of a first order chase vehicle. Therefore,
it takes a few steps for the camera to position itself correctly in the
chase plane position.
Input
Arguments
h Animation object.
time Scalar in seconds.
Examples Configure a body with TimeSeriesSource set to simdata, then update
the camera with time t equal to 0.
h = Aero.Animation;
h.FramesPerSecond = 10;
h.TimeScaling = 5;
idx1 = h.createBody('pa24-250_orange.ac','Ac3d');
load simdata;
h.Bodies{1}.TimeSeriesSource = simdata;
t = 0;
h.updateCamera(t);
3-367
updateNodes (Aero.VirtualRealityAnimation)
Purpose Change virtual reality animation node position and orientation as
function of time
Syntax updateNodes(h,t)
h.updateNotes(t)
Description updateNodes(h,t) and h.updateNotes(t) change node position and
orientation of body h as a function of time t. t is a scalar in seconds.
Note This function requires that you load the node and time series
data first.
Examples Update the node h with time in 5 seconds.
h = Aero.VirtualRealityAnimation;
h.FramesPerSecond = 10;
h.TimeScaling = 5;
h.VRWorldFilename = [matlabroot,'/toolbox/aero/astdemos/asttkoff.wrl'];
copyfile(h.VRWorldFilename,[tempdir,'asttkoff.wrl'],'f');
h.VRWorldFilename = [tempdir,'asttkoff.wrl'];
h.initialize();
load takeoffData
h.Nodes{7}.TimeseriesSource = takeoffData;
h.Nodes{7}.TimeseriesSourceType = 'StructureWithTime';
h.Nodes{7}.CoordTransformFcn = @vranimCustomTransform;
h.updateNodes(5);
See Also addNode | update
3-368
Viewpoint (Aero.Viewpoint)
Purpose Create viewpoint object for use in virtual reality animation
Syntax h = Aero.Viewpoint
Description h = Aero.Viewpoint creates a viewpoint object for use with virtual
reality animation.
See Aero.Viewpoint for further details.
3-369
VirtualRealityAnimation (Aero.VirtualRealityAnimation)
Purpose Construct virtual reality animation object
Syntax h = Aero.VirtualRealityAnimation
Description h = Aero.VirtualRealityAnimation constructs a virtual reality
animation object. The animation object is returned to h.
See Aero.VirtualRealityAnimation for further details.
See Also Aero.VirtualRealityAnimation
3-370
wrldmagm
Purpose Use World Magnetic Model
Note The '2000' or '2005' epoch year are outdated. For model years
between 2000 and the start of 2010, use igrf11magm. For model years
between 2010 and the start of 2015, use wrldmagm.
Syntax [xyz, h, dec, dip, f] = wrldmagm(height, lat, lon, dyear)
[xyz, h, dec, dip, f] = wrldmagm(height, lat, lon, dyear,
'2010')
[xyz, h, dec, dip, f] = wrldmagm(height, lat, lon, dyear,
'2005')
[xyz, h, dec, dip, f] = wrldmagm(height, lat, lon, dyear,
'2000')
Description [xyz, h, dec, dip, f] = wrldmagm(height, lat, lon, dyear)
calculates the Earths magnetic field at a specific location and time using
the World Magnetic Model (WMM). The default WMM is WMM-2010,
which is valid from January 1, 2010, until December 31, 2014.
Inputs required by wrldmagm are:
height A scalar value, in meters
lat A scalar geodetic latitude, in degrees, where
north latitude is positive, and south latitude
is negative
lon A scalar geodetic longitude, in degrees, where
east longitude is positive, and west longitude
is negative
dyear A scalar decimal year. Decimal year is the
desired year in a decimal format to include any
fraction of the year that has already passed.
Outputs calculated for the Earths magnetic field include:
3-371
wrldmagm
xyz Magnetic field vector in nanotesla (nT)
h Horizontal intensity in nanotesla (nT)
dec Declination in degrees
dip Inclination in degrees
f Total intensity in nanotesla (nT)
[xyz, h, dec, dip, f] = wrldmagm(height, lat, lon, dyear,
'2010') is an alternate method for calling WMM-2010, or 2010 epoch.
[xyz, h, dec, dip, f] = wrldmagm(height, lat, lon, dyear,
'2005') is an alternate method for calling WMM-2005, or 2005 epoch.
[xyz, h, dec, dip, f] = wrldmagm(height, lat, lon, dyear,
'2000') is the method for calling WMM-2000, or 2000 epoch.
Examples Calculate the magnetic model 1000 meters over Natick, Massachusetts
on July 4, 2010, using WMM-2010:
[XYZ, H, DEC, DIP, F] = wrldmagm(1000, 42.283, -71.35, decyear(2010,7,4),'2010')
XYZ =
1.0e+004 *
1.9229
-0.5139
4.8865
H =
1.9904e+004
DEC =
-14.9627
3-372
wrldmagm
DIP =
67.8376
F =
5.2763e+004
Assumptions
and
Limitations
The WMM specification produces data that is reliable five years after
the epoch of the model, which begins January 1 of the model year
selected. The WMM specification describes only the long-wavelength
spatial magnetic fluctuations due to the Earths core. Intermediate and
short-wavelength fluctuations, contributed from the crustal field (the
mantle and crust), are not included. Also, the substantial fluctuations
of the geomagnetic field, which occur constantly during magnetic
storms and almost constantly in the disturbance field (auroral zones),
are not included.
References http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml
NOAA Technical Report: The US/UK World Magnetic Model for
20052010
See Also decyear
3-373
Aero.Animation.Bodies property
Purpose Specify name of animation object
Values MATLAB array
Default: [ ]
Description This property specifies the bodies that the animation object contains.
3-374
Aero.Animation.Camera property
Purpose Specify camera that animation object contains
Values handle
Default: [ ]
Description This property specifies the camera that the animation object contains.
3-375
Aero.Animation.Figure property
Purpose Specify name of figure object
Values MATLAB array
Default: [ ]
Description This property specifies the name of the figure object.
3-376
Aero.Animation.FigureCustomizationFcn property
Purpose Specify figure customization function
Values MATLAB array
Default: [ ]
Description This property specifies the figure customization function.
3-377
Aero.Animation.FramesPerSecond property
Purpose Animation rate
Values MATLAB array
Default: 12
Description This property specifies rate in frames per second.
3-378
Aero.Animation.Name property
Purpose Specify name of animation object
Values String
Default: ' '
Description This property specifies the name of the animation object.
3-379
Aero.Animation.TCurrent property
Purpose Current time
Values double
Default: 0
Description This property specifies the current time.
3-380
Aero.Animation.TFinal property
Purpose End time
Values double
Default: NaN
Description This property specifies the end time.
3-381
Aero.Animation.TimeScaling property
Purpose Scaling time
Values double
Default: 1
Description This property specifies the time, in seconds.
3-382
Aero.Animation.TStart property
Purpose Start time
Values double
Default: NaN
Description This property specifies the start time.
3-383
Aero.Animation.VideoCompression property
Purpose Video recording compression file type
Values Archival
Create Motion JPEG 2000 format file with lossless compression.
Motion JPEG AVI
Create compressed AVI format file using Motion JPEG codec.
Motion JPEG 2000
Create compressed Motion JPEG 2000 format file.
MPEG-4
Create compressed MPEG-4 format file with H.264 encoding
(Windows 7 systems only).
Uncompressed AVI
Create uncompressed AVI format file with RGB24 video.
Data type: Aero.VideoProfileTypeEnum
Default: 'Archival'
Description This property specifies the compression file type to create. For more
information on video compression, see the VideoWriter class.
3-384
Aero.Animation.VideoFileName property
Purpose Video recording file name
Values filename
Data type: string
Default: temp
Description This property specifies the file name for the video recording.
3-385
Aero.Animation.VideoQuality property
Purpose Video recording quality
Values Value between 0 and 100
Data type: double
Default: 75
Description This property specifies the recording quality. For more information on
video quality, see the Quality property of the VideoWriter class.
3-386
Aero.Animation.VideoRecord property
Purpose Video recording
Values on
Enable video recording.
off
Disable video recording.
scheduled
Schedule video recording. Use this setting with the VideoTStart
and VideoTFinal properties.
Data type: string
Default: 'off'
Description This property enables video recording of animation objects.
Examples Record Animation Object Simulation
Simulate and record flight data.
Create an animation object.
h = Aero.Animation;
Control the frame display rate.
h.FramesPerSecond = 10;
Set the time-scaling (TimeScaling) property on the animation object to
specify the data per second.
h.TimeScaling = 5;
The combination of FramesPerSecond and TimeScaling properties
determines the time step of the simulation. These settings result in a
time step of approximately 0.5 s.
3-387
Aero.Animation.VideoRecord property
Create and load a body for the animation object.
idx1 = h.createBody('pa24-250_orange.ac','Ac3d');
Load simulated flight trajectory data (simdata), located in
matlabroot\toolbox\aero\astdemos.
load simdata;
Set the time series data for the body.
h.Bodies{1}.TimeSeriesSource = simdata;
Create a figure object for the animation object.
h.show();
Set up recording properties.
h.VideoRecord = 'on';
h.VideoQuality = 50;
h.VideoCompression = 'Motion JPEG AVI'
h.VideoFilename = 'astMotion_JPEG';
Play the animation.
h.play();
Verify that a file named astMotion_JPEG.avi was created in the
current folder.
Disable recording to preserve the file.
h.VideoRecord = 'off';
Record Animation for Four Seconds
Simulate flight data for four seconds.
Create an animation object.
3-388
Aero.Animation.VideoRecord property
h = Aero.Animation;
Control the frame display rate.
h.FramesPerSecond = 10;
Configure the animation object to set the seconds of animation data per
second time-scaling (TimeScaling) property.
h.TimeScaling = 5;
The combination of FramesPerSecond and TimeScaling
properties determines the time step of the simulation
(TimeScaling/FramesPerSecond). These settings result in a time step
of approximately 0.5 s.
Create and load a body for the animation object.
idx1 = h.createBody('pa24-250_orange.ac','Ac3d');
Load simulated flight trajectory data (simdata), located in
matlabroot\toolbox\aero\astdemos.
load simdata;
Set the time series data for the body.
h.Bodies{1}.TimeSeriesSource = simdata;
Create a figure object for the animation object.
h.show();
Set up recording properties.
h.VideoRecord='on';
h.VideoQuality = 50;
h.VideoCompression = 'Motion JPEG AVI';
h.VideoFilename = 'astMotion_JPEG';
3-389
Aero.Animation.VideoRecord property
Play the animation from TFinal to TStart.
h.TSTart = 1;
h.TFinal = 5;
h.play();
Verify that a file named astMotion_JPEG.avi was created in the
current folder. When you rerun the recording, notice that the play time
is shorter than that in the previous example when you record for the
length of the simulation time.
Disable recording to preserve the file.
h.VideoRecord = 'off';
Schedule Three Second Recording of Simulation
Schedule three second recording of animation object simulation.
Create an animation object.
h = Aero.Animation;
Control the frame display rate.
h.FramesPerSecond = 10;
Configure the animation object to set the seconds of animation data per
second time-scaling (TimeScaling) property.
h.TimeScaling = 5;
The combination of FramesPerSecond and TimeScaling
properties determines the time step of the simulation
(TimeScaling/FramesPerSecond). These settings result in a time step
of approximately 0.5 s.
Create and load a body for the animation object.
idx1 = h.createBody('pa24-250_orange.ac','Ac3d');
3-390
Aero.Animation.VideoRecord property
Load simulated flight trajectory data (simdata), located in
matlabroot\toolbox\aero\astdemos.
load simdata;
Set the time series data for the body.
h.Bodies{1}.TimeSeriesSource = simdata;
Create a figure object for the animation object.
h.show();
Set up recording properties.
h.VideoQuality = 50;
h.VideoCompression = 'Motion JPEG AVI';
h.VideoFilename = 'astMotion_JPEG';
Set up simulation time from TFinal to TStart.
h.TSTart = 1;
h.TFinal = 5;
Set up to record between two and four seconds of the four second
simulation.
h.VideoRecord='scheduled';
h.VideoTSTart = 2;
h.VideoTFinal = 4;
Play the animation.
h.play();
Verify that a file named astMotion_JPEG.avi was created in the
current folder. When you rerun the recording, notice that the play time
is shorter than that in the previous example when you record for the
length of the simulation time.
3-391
Aero.Animation.VideoRecord property
Disable recording to preserve the file.
h.VideoRecord = 'off';
3-392
Aero.Animation.VideoTFinal property
Purpose Video recording stop time for scheduled recording
Values Value between TStart and TFinal
Data type: double
Default: NaN, which uses the value of TFinal
Description This property specifies the stop time of scheduled recording.
Use when VideoRecord is set to 'scheduled'. Use VideoTStart to
set the start time of the recording.
3-393
Aero.Animation.VideoTStart property
Purpose Video recording start time for scheduled recording
Values Value between TStart and TFinal
Data type: double
Default: NaN, which uses the value of TStart.
Description This property specifies the start time of the scheduled recording.
Use when VideoRecord is set to 'scheduled'. Use VideoTFinal to
set the end time of the recording.
3-394
A
AC3DFiles and Thumbnails
A AC3D Files and Thumbnails
AC3D Files and Thumbnails Overview
Aerospace Toolbox demos use the following AC3D files, located in the
matlabroot\toolbox\aero\astdemos folder. For other AC3D files, see
http://www.flightgear.org/Downloads/ and click the Download Aircraft
link.
Thumbnail AC3D File
ac3d_xyzisrgb.ac
blueoctagon.ac
bluewedge.ac
body_xyzisrgb.ac
delta2.ac
greenarrow.ac
pa24 250_blue.ac
pa24 250_orange.ac
A-2
AC3D Files and Thumbnails Overview
Thumbnail AC3D File
redwedge.ac
testrocket.ac
A-3
A AC3D Files and Thumbnails
A-4
Index
Index A
AC3D files A-2
addBody (Aero.Animation) function 3-2
addNode (Aero.VirtualRealityAnimation)
function 3-3
addRoute (Aero.VirtualRealityAnimation)
function 3-4
addViewpoint
(Aero.VirtualRealityAnimation)
function 3-5
Aero.Animation
example 2-27
flight simulator overview 2-27
introducing 2-26
Aero.Animation object 3-9
Aero.Body object 3-10
Aero.Camera object 3-14
Aero.FlightGearAnimation
example 2-65
introducing 2-26
Aero.FlightGearAnimation object 3-16
Aero.Geometry object 3-22
Aero.Node object 3-24
Aero.Viewpoint function 3-28
Aero.VirtualRealityAnimation
example 2-37
flight simulator overview 2-37
introducing 2-26
Aero.VirtualRealityAnimation object 3-29
Aerospace Toolbox
3-D flight data playback 2-26
AC3D files A-2
animation objects 2-26
coordinate systems 2-2
flight data file access 2-14
aerospace units
definition 2-12
airspeed function 3-41
alphabeta function 3-42
angle2dcm function 3-44
angle2quat function 3-47
animation objects
introducing 2-26
atmoscira function 3-52
atmoscoesa function 3-49
atmosisa function 3-59
atmoslapse function 3-62
atmosnonstd function 3-66
atmosnrlmsise00 function 3-72
atmospalt function 3-84
B
Bodies
properties 3-374
Body (Aero.Body) function 3-86
body coordinates 2-4
C
Camera
properties 3-375
Camera (Aero.Camera) function 3-87
ClearTimer(Aero.FlightGearAnimation)
function 3-88
convacc function 3-89
convang function 3-91
convangacc function 3-93
convangvel function 3-95
convdensity function 3-97
convforce function 3-99
convlength function 3-101
convmass function 3-103
convpres function 3-105
convtemp function 3-107
convvel function 3-109
coordinate systems 2-2
approximations 2-3
body coordinates 2-4
definition 2-2
Index-1
Index
display 2-10
Earth-centered coordinates 2-9
ECEF coordinates 2-10
ECI coordinates 2-9
geocentric and geodetic latitudes 2-7
modeling 2-4
motion with respect to other planets 2-3
navigation 2-7
NED coordinates 2-8
references 2-11
rotational degrees of freedom 2-4 2-6
translational degrees of freedom 2-4 to 2-5
wind coordinates 2-5
correctairspeed function 3-111
createBody (Aero.Animation) function 3-114
D
datcomimport function 3-116
dcm2alphabeta function 3-160
dcm2angle function 3-162
dcm2latlon function 3-165
dcm2quat function 3-167
dcmbody2wind function 3-168
dcmecef2ned function 3-170
decyear function 3-180
delete (Aero.Animation) function 3-183
delete (Aero.FlightGearAnimation)
function 3-184
delete (Aero.VirtualRealityAnimation)
function 3-185
demos
AC3D files A-2
digital DATCOM
examining 2-15
importing 2-14
overview 2-14
plotting aerodynamic coefficients 2-22
digital DATCOM file
example 2-14
importing data 2-15
dpressure function 3-186
E
Earth-centered coordinates 2-9
ECEF coordinates 2-10
ecef2lla function 3-193
ECI coordinates 2-9
examples
astfganim 2-57
astimportddatcom 2-14
astmlanim 2-27
astvranim 2-37
type astdatcom.in 2-14
F
fganimation (Aero.FlightGearAnimation)
function 3-195
Figure
properties 3-376
FigureCustomizationFcn
properties 3-377
findstartstoptimes (Aero.Body)
function 3-196
findstartstoptimes (Aero.Node)
function 3-197
flat2lla function 3-198
FlightGear
flight simulator overview 2-57
installing 2-62
obtaining 2-58
flowfanno function 3-203
flowisentropic function 3-209
flownormalshock function 3-214
flowprandtlmeyer function 3-220
flowrayleigh function 3-224
FramesPerSecond
properties 3-378
Index-2
Index
functions
addBody (Aero.Animation) 3-2
addNode
(Aero.VirtualRealityAnimation) 3-3
AddRoute
(Aero.VirtualRealityAnimation) 3-4
addViewpoint(Aero.VirtualRealityAnimation) 3-5
Aero.Viewpoint 3-28
airspeed 3-41
alphabeta 3-42
angle2dcm 3-44
angle2quat 3-47
atmoscira 3-52
atmoscoesa 3-49
atmosisa 3-59
atmoslapse 3-62
atmosnonstd 3-66
atmosnrlmsise00 3-72
atmospalt 3-84
Body (Aero.Body) 3-86
Camera (Aero.Camera) 3-87
ClearTimer(Aero.FlightGearAnimation) 3-88
convacc 3-89
convang 3-91
convangacc 3-93
convangvel 3-95
convdensity 3-97
convforce 3-99
convlength 3-101
convmass 3-103
convpres 3-105
convtemp 3-107
convvel 3-109
correctairspeed 3-111
createBody (Aero.Animation) 3-114
datcomimport 3-116
dcm2alphabeta 3-160
dcm2angle 3-162
dcm2latlon 3-165
dcm2quat 3-167
dcmbody2wind 3-168
dcmecef2ned 3-170
decyear 3-180
delete (Aero.Animation) 3-183
delete
(Aero.FlightGearAnimation) 3-184
delete
(Aero.VirtualRealityAnimation) 3-185
dpressure 3-186
ecef2lla 3-193
fganimation
(Aero.FlightGearAnimation) 3-195
findstartstoptimes (Aero.Body) 3-196
findstartstoptimes (Aero.Node) 3-197
flat2lla 3-198
flowfanno 3-203
flowisentropic 3-209
flownormalshock 3-214
flowprandtlmeyer 3-220
flowrayleigh 3-224
generatePatches (Aero.Body) 3-234
GenerateRunScript
(Aero.FlightGearAnimation) 3-235
geoc2geod 3-238
geocradius 3-241
geod2geoc 3-243
geoidegm96 3-245
geoidheight 3-248
gravitycentrifugal 3-254
gravitysphericalharmonic 3-257
gravitywgs84 3-265
gravityzonal 3-273
hide (Aero.Animation) 3-280
igrf11magm 3-281
initialize (Aero.Animation) 3-285
initialize
(Aero.FlightGearAnimation) 3-286
initialize
(Aero.VirtualRealityAnimation) 3-287
initIfNeeded (Aero.Animation) 3-288
Index-3
Index
juliandate 3-289
leapyear 3-292
lla2ecef 3-293
lla2flat 3-295
load (Aero.Body) 3-300
machnumber 3-302
mjuliandate 3-304
move (Aero.Body) 3-312
move (Aero.Node) 3-313
moveBody (Aero.Animation) 3-315
Node (Aero.Node) 3-316
nodeInfo
(Aero.VirtualRealityAnimation) 3-317
play (Aero.Animation) 3-324
play (Aero.FlightGearAnimation) 3-328
play
(Aero.VirtualRealityAnimation) 3-332
quat2angle 3-335
quat2dcm 3-337
quatconj 3-339
quatdivide 3-340
quatinv 3-341
quatmod 3-342
quatmultiply 3-343
quatnorm 3-345
quatnormalize 3-346
quatrotate 3-347
read (Aero.Geometry) 3-349
removeBody (Aero.Animation) 3-350
removeNode
(Aero.VirtualRealityAnimation) 3-351
removeViewpoint
(Aero.VirtualRealityAnimation) 3-352
rrdelta 3-353
rrsigma 3-355
rrtheta 3-357
saveas
(Aero.VirtualRealityAnimation) 3-359
SetTimer(Aero.FlightGearAnimation) 3-360
show (Aero.Animation) 3-361
update (Aero.Body) 3-362
update (Aero.Camera) 3-363
update
(Aero.FlightGearAnimation) 3-364
update (Aero.Node) 3-365
updateBodies (Aero.Animation) 3-366
updateCamera (Aero.Animation) 3-367
updateNodes
(Aero.VirtualRealityAnimation) 3-368
Viewpoint (Aero.Viewpoint) 3-369
VirtualRealityAnimation
(Aero.VirtualRealityAnimation) 3-370
wrldmagm 3-371
G
generatePatches (Aero.Body) function 3-234
GenerateRunScript
(Aero.FlightGearAnimation)
function 3-235
geoc2geod function 3-238
geocentric and geodetic latitudes 2-7
geocradius function 3-241
geod2geoc function 3-243
geoidegm96 function 3-245
geoidheight function 3-248
Geometry (Aero.Geometry) object 3-253
gravitycentrifugal function 3-254
gravitysphericalharmonic function 3-257
gravitywgs84 function 3-265
gravityzonal function 3-273
H
hide (Aero.Animation) function 3-280
I
igrf11magm function 3-281
importing
digital DATCOM data 2-14
Index-4
Index
initialize (Aero.Animation) function 3-285
initialize (Aero.FlightGearAnimation)
function 3-286
initialize (Aero.VirtualRealityAnimation)
function 3-287
initIfNeeded (Aero.Animation)
function 3-288
J
juliandate function 3-289
L
leapyear function 3-292
lla2ecef function 3-293
lla2flat function 3-295
load (Aero.Body) function 3-300
M
machnumber function 3-302
mjuliandate function 3-304
modeling 2-4
move (Aero.Body) function 3-312
move (Aero.Node) function 3-313
moveBody (Aero.Animation) function 3-315
N
Name
properties 3-379
navigation 2-7
NED coordinates 2-8
Node (Aero.Node) function 3-316
nodeInfo (Aero.VirtualRealityAnimation)
function 3-317
O
objects
Aero.Animation 3-9
Aero.Body 3-10
Aero.Camera 3-14
Aero.FlightGearAnimation 3-16
Aero.Geometry 3-22
Aero.Node 3-24
Aero.VirtualRealityAnimation 3-29
Geometry (Aero.Geometry) 3-253
P
play (Aero.Animation) function 3-324
play (Aero.FlightGearAnimation)
function 3-328
play (Aero.VirtualRealityAnimation)
function 3-332
properties
Bodies 3-374
Camera 3-375
Figure 3-376
FigureCustomizationFcn 3-377
FramesPerSecond 3-378
Name 3-379
TCurrent 3-380
TFinal 3-381
TimeScaling 3-382
TStart 3-383
VideoCompression 3-384
VideoFileName 3-385
VideoQuality 3-386
VideoRecord 3-387
VideoTFinal 3-393
VideoTStart 3-394
Q
quat2angle function 3-335
quat2dcm function 3-337
quatconj function 3-339
quatdivide function 3-340
Index-5
Index
quatinv function 3-341
quatmod function 3-342
quatmultiply function 3-343
quatnorm function 3-345
quatnormalize function 3-346
quatrotate function 3-347
R
read (Aero.Geometry) function 3-349
removeBody (Aero.Animation) function 3-350
removeNode (Aero.VirtualRealityAnimation)
function 3-351
removeViewpoint
(Aero.VirtualRealityAnimation)
function 3-352
rotational degrees of freedom 2-4 2-6
rrdelta function 3-353
rrsigma function 3-355
rrtheta function 3-357
S
saveas (Aero.VirtualRealityAnimation)
function 3-359
SetTimer(Aero.FlightGearAnimation)
function 3-360
show (Aero.Animation) function 3-361
T
TCurrent
properties 3-380
TFinal
properties 3-381
TimeScaling
properties 3-382
translational degrees of freedom 2-4 to 2-5
TStart
properties 3-383
U
update (Aero.Body) function 3-362
update (Aero.Camera) function 3-363
update (Aero.FlightGearAnimation)
function 3-364
update (Aero.Node) function 3-365
updateBodies (Aero.Animation)
function 3-366
updateCamera (Aero.Animation)
function 3-367
updateNodes
(Aero.VirtualRealityAnimation)
function 3-368
V
VideoCompression
properties 3-384
VideoFileName
properties 3-385
VideoQuality
properties 3-386
VideoRecord
properties 3-387
VideoTFinal
properties 3-393
VideoTStart
properties 3-394
Viewpoint (Aero.Viewpoint) function 3-369
VirtualRealityAnimation
(Aero.VirtualRealityAnimation)
function 3-370
W
wind coordinates 2-5
wrldmagm function 3-371
Index-6