System IDentification Programs
System IDentification Programs
R=20030006686 2019-11-13T17:11:00+00:00Z
AIA A
AIAA-2002-4704
Eugene A. Morelli
NASA Langley Research Center
Hampton, VA
For permission to copy or to republish, contact the American Institute of Aeronautics and Astronautics,
1801 Alexander Bell Drive, Suite 500, Reston, VA, 20191-4344
AIAA-2002-4704
Eugene A. Morelli
estimated parameter error calculation, linear and SIDPAC, is a collection of computer programs that
nonlinear simulation, plotting, and 3-D visualization. implement a variety of methods for solving problems
An overview of SIDPAC capabilities is provided, along in the area of system identification applied to aircraft.
with a demonstration of the use of SIDPAC with real This paper describes the routines included in SIDPAC
flight test data from the NASA Glenn Twin Otter and demonstrates SIDPAC using a real flight test data
aircraft. The SIDPAC software is available without example. All SIDPAC programs were written in
MATLAB ® as m-file functions. An m-file function in
charge to U.S. citizens by request to the author,
contingent on the requestor completing a NASA MATLAB ® is the analog of a subroutine in
software usage agreement. FORTRAN or a function in C.
models are generally dynamic with multiple inputs and implementing SIDPAC algorithms.
outputs, and the measurements are noisy. As a result,
All of the algorithms implemented in £TDPAC are
the required data volume is substantial, and most
based on information available in the open literature.
aircraft system identification tasks require computers The documents listed under References contain
information on the algorithms implemented in
Research Engineer, Senior Member AIAA SIDPAC. The references are grouped according to
e-mail: [email protected] a.gov their relevance to system identification problems
addressed in SIDPAC.
Copyright © 2002 by the American Institute of Aeronautics and
Astronautics, Inc. No copyright is asserted in the United States Development of SIDPAC occurred over a period
under Title 17, U.S. Code. The U.S. Government has a royalty- of approximately 10 years at NASA Langley Research
free license to exercise all rights under the copyright claimed Center. The author wrote and tested all of the SIDPAC
herein for Governmental purposes. All other rights are reserved by routines. Most of the routines in SIDPAC were
the copyright owner.
software was sent to all registered SIDPAC users via obtaining good results.
e-mail just prior to public release of this paper.
It is a simple matter to create custom data
Calling syntax and descriptive material in the analysis and modeling scripts in MATLAB ® for
header of each SIDPAC m-file are displayed in the particular system identification problems, using calls to
MATLAB ® command window in response to typing SIDPAC m-files. This is demonstrated in the Examole
help filename, where filename is the name of a section. The resulting script can be used to automate
specific m-file. All SIDPAC m-files have the the analysis for different maneuvers, and has the added
customary .m file extension. MATLAB ® is an benefit of completely documenting the data analysis
interpretive language, so the source code runs directly and modeling process.
in the MATLAB ® environment, with no requirement
The m-file functions that comprise the main
for explicit compile and link commands. To execute
capabilities of SIDPAC are categorized below
any m-file in SIDPAC, the correct calling syntax can
according to functionality. Short narrative descriptions
be copied from the comment header directly to the
of the m-files appear below each category heading.
accel cor.m - Corrects accelerometer measurements fixdrop, m -Manually fixes data dropouts.
from the sensor location to the aircraft c.g.
hsmoo.m -Implements a posteriori low-pass filtering
axcnv.m - Finds vector components in a rotated using fixed weight smoothing.
coordinate system.
pwrband.m - Computes the frequency band that
bodecmp.m - Compares Bode plots for general contains a given fraction of the power in a time series.
transfer function models.
smoo.m - Separates signal from noise for a measured
bodeplt.m -Draws Bode plots. time series, using Fourier analysis and an optimal
Wiener filter.
chirpz.m - Computes the chirp-Z discrete Fourier
transform. spect.m - Computes power spectral density for a
measured time series.
cmpplt.m - Plots two time series and their difference.
tshiff.m - Estimates the relative time shift between two
cmpsigs.m - Scales and removes biases from two
time series, using time-domain cross correlation.
time series so their waveforms can be compared.
xsmep.m - Computes smoothed endpoints for a
compfc.m - Computes non-dimensional applied force measured time series.
coefficients based on measured data.
Experiment Design
compmc.m - Computes non-dimensional applied
moment coefficients based on measured data. compcrb.m - Computes the Cram6r-Rao bounds and
the information matrix.
compzsd.m - Computes a smoothed numerical time
derivative of noisy time series using Fourier analysis dox.m - Generates modern experiment designs for
and the Wiener filter in the frequency domain. response surface modeling.
corx.m - Computes the normalized regressor mkrandss.m - Generates a sum of sine waves with
correlation matrix. random amplitudes and frequencies.
csrnep.rn - Computes smoothed endpoints for a noisy mkrdn.m - Generates white or arbitrarily colored
time series using a local cubic least squares fit. random noise inputs.
cubic_dtrend.m - Computes a cubic detrend function mksqw.m - Generates an alternating square wave
for a noisy time series. input with arbitrary amplitudes and pulse widths.
cutItd.m - Plots flight test data and implements mksswp.m - Generates a Schroeder sweep input.
manual cutting of flight test maneuver data lengths.
Data Compatibility Analysis
deriv.m - Computes a smoothed numerical time
a irch k. m - Checks the compatibility of measured data
derivative of noisy time series using local least squares
for translational accelerations, body-axis angular rates,
polynomial fits to the data.
airspeed, sideslip angle, and angle of attack.
dIt.m - Computes the discrete Fourier transform using
the definition (i.e., without using a Fast Fourier
compat.m - Estimates instrumentation error
or frequency-domain data.
slesq.m - Computes equation-error model parameter
estimates and covariance matrix estimates for a linear
Output-Error Parameter Estimation
least squares regression problem, using a batch
mnr.m - Computes the modified Newton-Raphson formulation applied to sequential sections of data. This
step for multi-dimensional parameter optimization, and routine is the sequential version of lesq.m.
computes the cost gradient and information matrix.
Frequency Domain Parameter Estimation
oe.m - Estimates dynamic model parameters from
measured input-output time-domain data using fdoe.m - Estimates dynamic model parameters from
output-error maximum likelihood. This routine uses measured input-output frequency-domain data using
general dynamic model definition m-files that can be output-error maximum likelihood. This routine is the
linear or nonlinear. frequency-domain equivalent of oe.m.
senest.m - Computes sensitivity estimates using finite tfest.m - Estimates parameters in a transfer function
differences. model structure, using equation-error in the frequency
domain and fint.m to compute high-accuracy finite
simplex.m - Implements the simplex method for Fourier integrals for arbitrary frequencies.
multi-dimensional parameter optimization without cost
function gradients. Ioest.m - Estimates parameters in a low order
equivalent system transfer function model structure,
Estimated Parameter Error Bounds
using the same approach as in tfest.m, except that a
relaxation technique is used to estimate the equivalent
r_colores.m - Computes Cram6r-Rao bounds for the
covariances of the estimated parameters in a linear time delay parameter.
int2.m -Does two-dimensional linear interpolation. runk4.c - C mex-file version of runk4.m used in
Ioadflat.m - Reads a general ASCII flat file into the spl.m - Generates spline functions.
misvd.m - Computes robust matrix inversion using To demonstrate the use and capabilities of
singular value decomposition. SIDPAC, a real flight test data analysis and modeling
problem is presented. This example was chosen so that
milstd.m - Computes longitudinal handling qualities some of the main elements of SIDPAC could be
level prediction according to MIL-STD 1797A, and demonstrated.
plots handling qualities parameters and boundaries.
The flight test data was obtained from a
model_disp.m - Displays the functional form and
longitudinal maneuver flown on the NASA Glenn
parameter values for a polynomial model.
Twin Otter aircraft, see Figure 1. The Twin Otter is a
ocf.m - Converts a transfer function numerator and twin-engine turboprop commuter aircraft equipped
denominator into a state space model in observer with high-quality flight research instrumentation.
canonical form.
The flight test data for the example maneuver was
plotmesh.m - Makes 3-D mesh plots for polynomial available in an ASCII file, with the measured quantities
models. named according to the convention used at NASA
Glenn. To use SIDPAC effectively, the first step is to
plotpest.m - Plots parameter estimates and error bars
put the data in a standard format that some of the
representing 95 percent confidence intervals.
SIDPAC routines expect. This is a simple matter of
plotsurf.m - Makes 3-D surface plots for polynomial unit conversions, routine calculations, and assembling
models. the data into an array called fdata in the MATLAB ®
workspace, where each column of the array is assigned
plot3d.m - Makes 3-D plots using data arranged for
a specific quantity. There is a GUI in SIDPAC to make
linear regression.
this process easier, which is invoked by simply typing
press, m - Computes predicted sum of squares metric. sid at the MATLAB ® command window prompt. The
resulting GUI is shown in Figure 2. The analyst can
ratelim.m - Implements rate limits.
use this GUI to quickly plot any of the workspace
STDPAC addresses a wide range of system Morelli, E.A. "Estimating Noise Characteristics
identification problems in a common MATLAB ® from Flight Test Data using Optimal Fourier
environment. MATLAB ® has many advantages, Smoothing," Journal of Aircraft, Vol. 32, No. 4,
arithmetic by default. These characteristics make Errors in Measured Airplane Responses using
Maximum Likelihood Method," NASA TM 89059,
MATLAB ® an excellent choice for implementing
STDPAC algorithms. January 1987.
the requestor, along with a one-sentence description of Morelli, E.A., "Global Nonlinear Aerodynamic
the intended use of SIDPAC, for technology transfer Modeling using Multivariate Orthogonal Functions,"
record-keeping purposes. Journal of Aircraft, Vol. 32, No. 2, March-April
technology to aircraft system identification problems, Morelli, E.A., "Global Nonlinear Parametric
within a single, highly capable, and easy-to-use Modeling with Application to F-16 Aerodynamics,"
computing environment. ACC paper WP04-2, Paper ID i-98010-2, American
Control Conference, Philadelphia, Pennsylvania,
June 1998.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::_;_;_2.
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
Fibre3 £TDPAC Maneuver Length GUI
i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_ii___iiiiiiiiiiiiii
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_iiiii!!iii iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
........................................................... ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
_ __i_i_
i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
Fi__mre4 £TDPAC Translational Data Compatibility GUI
10
',',i',i',i',i',i',i',i',i',i',i',i',i',i',i',i',i',_g,i',i',i',i',i_i',i_
......i......i"-,-_--ff ......i.....:_"--'i.....4:....._°' q__i__i__i__i__i__i__i__i__i__i__i__i__
-?-.....i ......i......t-)-'-:'_-i_:-i .....
i ......................
i i i---I
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_iii iiiiiiiiiiiii iiiiiiiii
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_iiiiiiiiiiii
:::::_ : :: :::::::
i:::::::::::::
:::::iiiiiiiiiiiii iiiiiiiiiii
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_iiiiiiiiii_iii iiiiiiii_iiiiiiiii!iii!i!iii!iii!i!iii!iiiii!iii!iiiii!iii!i!iii!iiiii!iii!iiiii!iii!i!i!i!_iiiiii
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_iiii/
................
!...............
i...............
!................
!...............
ii_i_i_i_i_i_i_i_i_i_i_i_i_i_i_i_i_i_i_i_i_i_i_6_i_i_
i...............
!................
!...............
i..............
!................
...... "....... i ...... "....... "...... [...... i....... "....... _....... ".....
|iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_iiiiiiiiiiiiii_iii
: : = : : : : : : iiiiiiiiiiiiiiiiiiiiiii==i==i==i==i==i==i==i==i==i==i==i==i==i==i==i
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_iii_6iii_iii
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiiiiiiiiiiiiiii
iiiiiii_iiiiiiiiliiiiiiiiiiiiiiiiiiiiiiiiiiiii
ii iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_iiiiiiiiiiiiiiiiiiiiiiiiii_ii
iiiiiiiiiiiiiiiiiiiiiiii_
_i..............................
i..............................
i..............................
i...............................
i:::::::_:_:?:::i ...............................
i..........................
::i..............................
i......................
:::::iiiiiii_l___
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
', ', ', _.;._,.-,:-_-"_ ', 'h ', ', Im Flight I
?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:::?::
L ...... _ ...... J ...... "_g':'.'L .... L ...... [ _ _ _ _ _-_,... .... J ..... Model |::?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?:?::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
i:i:i:i:i:i:i:i:i:i:i:i:i:i:i:i:i:
_i:i:i:i:i@i:i ...... "___;_:'
', _f-" ...... ',"-; ..... ',"...... ;" ', ...... ',"--- ;---" 1 ....... ',"L; .... .___-
', .,_: _'_-_
£ ____________________________________________________________________________________________________iiiiiiiiiiiiiii:_
ii1811 1 i:i ii iii ii ii iii ii i:: :::: :::: : ::
...............................................................
r ' _ ....... '. _ ............................
_- :::::gi:,_i .............................................
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_iiiiiiiiiiiiiiiiiiiiiiiiii_iiiiiiiiiiiiiiiiiiiiiiiiiiii_iiiiiiiiiiiiiiiiiiiiiiiiii_iiiiiiiiiiiii
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_iii iiiiiiiiiiiii iiiiiiiiii
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_iiiiiiiiii_iii
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
_ _ _ _ _ _ _ _
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
.................................................................................................................................................................................................................................................................................................
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii',_',_',iii',_',_',iii
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiNiiiiii_iii_iii_iiiiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiiiiiiii
11
%
% Calls:
% compfc.m
% compmc.m
% xsmep.m
% lesq.m
% r_colores.m
% model_disp.m
% swr. m
% zep.m
% tfest.m
% nldyn_psel.m
% oe.m
% nldyn.m
% m_colores.m
% plotpest.m
% tfsim.m
%
% Author: Eugene A. Morelli
%
% History:
% 11 Jul 2002 - Created and debugged, EAM.
%
% Copyright (C) 2002 Eugene A. Morelli
%
% This program carries no warranty, not even the implied
% warranty of merchantability or fitness for a particular purpose.
%
% Please email bug reports or suggestions for improvements to:
%
% [email protected]
%
%
% Load the data file.
%
load 'totter Ion 020213f1_018.mat'
%
% Set up the figure window.
%
FgH=figure('Units','normalized','Position',[.506.231 .504.715],...
'Name','SIDPAC Demonstration','N umberTitle','off,'Toolbar','none');
%
% Plot the measured inputs and outputs.
%
subplot(4,1,1), plot(t,fdata(:,14),'LineWidth',2),
title('Twin Otter Flight Test Data','FontWeight','bold'),
grid on, ylabel('elevator (deg)'),
12
13
14
15
16
17
i_iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii_iiiiiiii_i_iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
18