System Identification Labview Toolkit
System Identification Labview Toolkit
TTM
Support
Worldwide Technical Support and Product Information
ni.com
National Instruments Corporate Headquarters
11500 North Mopac Expressway
Worldwide Offices
Australia 1800 300 800, Austria 43 0 662 45 79 90 0, Belgium 32 0 2 757 00 20, Brazil 55 11 3262 3599,
Canada (Calgary) 403 274 9391, Canada (Ottawa) 613 233 5949, Canada (Qubec) 450 510 3055,
Canada (Toronto) 905 785 0085, Canada (Vancouver) 604 685 7530, China 86 21 6555 7838,
Czech Republic 420 224 235 774, Denmark 45 45 76 26 00, Finland 385 0 9 725 725 11,
France 33 0 1 48 14 24 24, Germany 49 0 89 741 31 30, India 91 80 51190000, Israel 972 0 3 6393737,
Italy 39 02 413091, Japan 81 3 5472 2970, Korea 82 02 3451 3400, Malaysia 603 9131 0918,
Mexico 01 800 010 0793, Netherlands 31 0 348 433 466, New Zealand 0800 553 322, Norway 47 0 66 90 76 60,
Poland 48 22 3390150, Portugal 351 210 311 210, Russia 7 095 783 68 51, Singapore 65 6226 5886,
Slovenia 386 3 425 4200, South Africa 27 0 11 805 8197, Spain 34 91 640 0085, Sweden 46 0 8 587 895 00,
Switzerland 41 56 200 51 51, Taiwan 886 2 2528 7227, Thailand 662 992 7519,
United Kingdom 44 0 1635 523545
For further support information, refer to the Technical Support and Professional Services appendix. To comment
on National Instruments documentation, refer to the National Instruments Web site at ni.com/info and enter
the info code feedback.
2004 National Instruments Corporation. All rights reserved.
Important Information
Warranty
The media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects
in materials and workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation. National
Instruments will, at its option, repair or replace software media that do not execute programming instructions if National Instruments receives
notice of such defects during the warranty period. National Instruments does not warrant that the operation of the software shall be
uninterrupted or error free.
A Return Material Authorization (RMA) number must be obtained from the factory and clearly marked on the outside of the package before
any equipment will be accepted for warranty work. National Instruments will pay the shipping costs of returning to the owner parts which are
covered by warranty.
National Instruments believes that the information in this document is accurate. The document has been carefully reviewed for technical
accuracy. In the event that technical or typographical errors exist, National Instruments reserves the right to make changes to subsequent
editions of this document without prior notice to holders of this edition. The reader should consult National Instruments if errors are suspected.
In no event shall National Instruments be liable for any damages arising out of or related to this document or the information contained in it.
EXCEPT AS SPECIFIED HEREIN, NATIONAL INSTRUMENTS MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. CUSTOMERS RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF
NATIONAL INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE CUSTOMER. NATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR
DAMAGES RESULTING FROM LOSS OF DATA, PROFITS, USE OF PRODUCTS, OR INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY
THEREOF. This limitation of the liability of National Instruments will apply regardless of the form of action, whether in contract or tort, including
negligence. Any action against National Instruments must be brought within one year after the cause of action accrues. National Instruments
shall not be liable for any delay in performance due to causes beyond its reasonable control. The warranty provided herein does not cover
damages, defects, malfunctions, or service failures caused by owners failure to follow the National Instruments installation, operation, or
maintenance instructions; owners modification of the product; owners abuse, misuse, or negligent acts; and power failure or surges, fire,
flood, accident, actions of third parties, or other events outside reasonable control.
Copyright
Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including photocopying,
recording, storing in an information retrieval system, or translating, in whole or in part, without the prior written consent of National
Instruments Corporation.
Trademarks
LabVIEW, MATRIXx, National Instruments, National Instruments Alliance Partner, NI, ni.com, and NI-DAQ are trademarks of
National Instruments Corporation.
Product and company names mentioned herein are trademarks or trade names of their respective companies.
Members of the National Instruments Alliance Partner Program are business entities independent from National Instruments and have no
agency, partnership, or joint-venture relationship with National Instruments.
Patents
For patents covering National Instruments products, refer to the appropriate location: HelpPatents in your software, the patents.txt file
on your CD, or ni.com/patents.
Contents
About This Manual
Conventions ...................................................................................................................ix
Related Documentation..................................................................................................x
Chapter 1
Introduction to System Identification
Model-Based Control Design Process ...........................................................................1-2
Analyzing Data and Creating a Dynamic System ...........................................1-2
Designing a Controller ....................................................................................1-4
Simulating the Dynamic System .....................................................................1-4
Deploying the Controller.................................................................................1-4
Developing Models with the Toolkit .............................................................................1-5
System Identification Assistant .......................................................................1-5
System Identification VIs ................................................................................1-5
Chapter 2
Acquiring and Preprocessing Data
Acquiring Data from a System ......................................................................................2-1
Accounting for Factors that Influence a System .............................................2-2
Choosing a Stimulus Signal.............................................................................2-2
Common Stimulus Signals ..............................................................................2-3
Filtered Gaussian White Noise .........................................................2-4
Random Binary Signal ......................................................................2-4
Pseudo-Random Binary Sequence ....................................................2-5
Chirp Waveform ...............................................................................2-6
Selecting a Sampling Rate...............................................................................2-7
Applying an Anti-Aliasing Filter.....................................................................2-7
Preprocessing Data from a System ................................................................................2-8
Visually Inspecting the Data ...........................................................................2-8
Removing Offsets and Trends .........................................................................2-8
Removing Offsets .............................................................................2-9
Removing Trends ..............................................................................2-9
Outliers ............................................................................................................2-10
Filtering and Downsampling ...........................................................................2-10
Data Scaling.....................................................................................................2-11
Contents
Chapter 3
Nonparametric Model Estimation Methods
Impulse Response.......................................................................................................... 3-2
Correlation Analysis ....................................................................................... 3-3
Prewhitening ................................................................................................... 3-5
Accuracy of the Impulse Response ................................................................. 3-5
Selecting Impulse Response Length ............................................................... 3-8
Applications of the Impulse Response............................................................ 3-8
Frequency Response...................................................................................................... 3-10
Spectral Analysis Method ............................................................................... 3-11
Accuracy of the Lag Window ......................................................................... 3-12
Applications of the Frequency Response........................................................ 3-16
Chapter 4
Parametric Model Estimation Methods
Parametric Model Estimation ........................................................................................ 4-1
General-Linear Polynomial Model ................................................................. 4-1
ARX Model ...................................................................................... 4-3
ARMAX Model ................................................................................ 4-4
Output-Error Model .......................................................................... 4-5
Box-Jenkins Model........................................................................... 4-6
AR Model ......................................................................................... 4-7
State-Space Model .......................................................................................... 4-8
Polynomial Models versus State-Space Models ............................................. 4-8
Determining Parameters for the Prediction Error Method.............................. 4-9
Akaikes Information Criterion ........................................................ 4-10
Akaikes Final Prediction Error Criterion ........................................ 4-11
Minimum Data Length Criterion ...................................................... 4-11
Converting Models ........................................................................................................ 4-11
Validating Models ......................................................................................................... 4-12
Validation Methods......................................................................................... 4-13
Simulation......................................................................................... 4-13
Prediction.......................................................................................... 4-13
Residual Analysis ............................................................................. 4-14
Autocorrelation................................................................... 4-14
Cross Correlation................................................................ 4-15
Model Order Reduction .................................................................................. 4-15
vi
ni.com
Contents
Chapter 5
Recursive Model Estimation Methods
Defining Recursive Model Estimation ..........................................................................5-1
Adaptive Algorithms......................................................................................................5-3
Least Mean Square ..........................................................................................5-3
Normalized Least Mean Square ......................................................................5-5
Recursive Least Squares..................................................................................5-6
Kalman Filter...................................................................................................5-7
Chapter 6
System Identification Case Study
Data Preprocessing ........................................................................................................6-1
Examining the Time Response Data ...............................................................6-2
Examining the Frequency Response Data.......................................................6-3
Applying a Filter to the Raw Data...................................................................6-5
Downsampling the Raw Data..........................................................................6-6
Estimating the Model.....................................................................................................6-7
Akaikes Information Criterion .......................................................................6-8
Verifying the Results.......................................................................................6-9
Minimum Data Length Criterion.....................................................................6-10
User-Defined Criterion....................................................................................6-11
ARX Model Validation..................................................................................................6-13
Simulation and Prediction ...............................................................................6-13
Residual Analysis ............................................................................................6-14
Estimating a State-Space Model ....................................................................................6-17
Finding the Singular Values ............................................................................6-17
Validating the Estimated State-Space Model ..................................................6-18
Additional Examples......................................................................................................6-19
Appendix A
References
Appendix B
Technical Support and Professional Services
vii
Conventions
The following conventions are used in this manual:
The symbol leads you through nested menu items and dialog box options
to a final action. The sequence FilePage SetupOptions directs you to
pull down the File menu, select the Page Setup item, and select Options
from the last dialog box.
This icon denotes a note, which alerts you to important information.
bold
Bold text denotes items that you must select or click in the software, such
as menu items and dialog box options. Bold text also denotes parameter
names.
italic
ix
monospace
Text in this font denotes text or characters that you should enter from the
keyboard, sections of code, programming examples, and syntax examples.
This font is also used for the proper names of disk drives, paths, directories,
programs, subprograms, subroutines, device names, functions, operations,
variables, filenames, and extensions.
monospace italic
Italic text in this font denotes text that is a placeholder for a word or value
that you must supply.
Related Documentation
The following documents contain information that you might find helpful
as you read this manual:
LabVIEW Help
ni.com
Introduction to System
Identification
1-1
Chapter 1
Plant Modeling
and Analysis
Simulation
Control Design
LabVIEW
Simulation
Module
Control Design
Toolkit
System Identification
Toolkit
Deployment
LabVIEW Real-Time
Module
LabVIEW
1-2
ni.com
Chapter 1
Modeling
Characterization
Characterization
Data
Verification/
Validation
Characterization
Select Model
Characterization
Applications
Characterization
Real-world systems seldom have one model that perfectly describes all the
observed behaviors of the system. Because system identification involves
many variablessuch as sampling frequency, type of mathematical model,
model order, and so onyou usually have a number of models you can use.
Each model describes the behavior of the system to some extent or in a
particular mode of operation.
Furthermore, multiple applicable algorithms might be available for the
same model. The algorithms you select depend on the model structure,
stochastic assumptions, and numerical properties of the algorithm. The
System Identification Toolkit includes different adaptive schemes for
recursive system identification and different algorithms for auto-regression
(AR) model estimation. Refer to Chapter 3, Nonparametric Model
Estimation Methods, and Chapter 4, Parametric Model Estimation
Methods, for information about the various estimation methods that the
System Identification Toolkit supports.
1-3
Chapter 1
Designing a Controller
In the second phase of the design process, you synthesize and analyze a
controller. The LabVIEW Control Design Toolkit provides a set of VIs for
classical and modern linear control analysis and design techniques. With
these VIs you can create and analyze linear time-invariant system models
and design automatic control systems.
You can analyze the plant model you identified using the System
Identification Toolkit using the Control Design Toolkit. The Control
Design VIs help you determine an appropriate controller structure. You
then can synthesize a controller to achieve the desired performance criteria
of the closed-loop system based on the dynamic behavior of the plant
and/or control system. Finally, you can analyze the overall closed-loop
system by combining the controller with the identified plant model.
1-4
ni.com
Chapter 1
1-5
Chapter 1
1-6
ni.com
2-1
Chapter 2
2-2
ni.com
Chapter 2
You want the inputs to the system under test to excite the system.
Exciting the system is dependent on the spectrum of the input signal.
Specifically, you must excite the system with an input frequency
similar to the frequency at which such inputs change during normal
operations.
You want the amplitude of the step input to cover a wide range of
variations. Therefore, in the data you use for model estimation, you
need to cover the normal operation range of system inputs, especially
when you use the calculated model for model-based control. To cover
the normal operation range, you can combine the positive and negative
step changes of different magnitudes in the system inputs.
You want the input signal to deliver as much input power to the system
as possible. However, in the real-world, you must ensure that this input
power stays within the limits of the physical system. The crest factor
Cf, defined by the following equation, describes this property.
2
Cf
max t u ( t )
------------------------------------------N
1
lim N ---N
u ( t )
2
t=1
The smaller the crest factor the better the signal excitation resulting in
larger total energy delivery and enhanced signal-to-noise ratio. The
theoretical lower bound for crest factor is 1.
2-3
Chapter 2
2-4
ni.com
Chapter 2
2-5
Chapter 2
Chirp Waveform
The chirp, also known as a swept sine wave, is a sinusoid waveform with a
frequency that varies continuously over a certain range of values
1 2 for a specific period of time 0 t T. The resulting signal has
a crest factor Cf of 2 and is easily modified to excite specific signal
spectra.
In comparison to other signals, like the white noise stimulus, a chirp
waveform is easier to generate and control. Figure 2-4 shows an example
of a chirp waveform.
2-6
ni.com
Chapter 2
2-7
Chapter 2
Similarly, you can use a digital filter to remove frequency content above the
system bandwidth and then decimate or downsample the data to the desired
sampling rate.
Removing outliers
2-8
ni.com
Chapter 2
Removing Offsets
The estimated system model is a linearized version of the true system
around the operating point. You must subtract the operating points from the
raw data samples because linearization is done with respect to the signal
values relative to the operating point, which is the offset level of the signal.
Figure 2-5 shows an example of removing the offset level of a signal. The
goal of the water tank is to keep the water level at six meters. The Water
level record graph shows that the water level changes in the vicinity of the
operating point of six meters. If you use the water level record for system
identification, you must remove the six meter operating point value.
The SI Remove Trend VI enables you to remove the offset from the raw
data set. You must set the trend type to mean to use this preprocessing
technique.
Removing Trends
External influences might add some low frequency or periodic
components, which are not relevant to the specific modeling problem, to
the data. Examples of external influences include variations due to the
24-hour day cycle in power plants, seasonal influences in biological and
economical systems, thermal expansion in rolling mills, 50 Hz and 60 Hz
powerline interferences, and so on. The amplitude of these trends can be
large and can corrupt the results of signal analysis and parametric
identification algorithms.
The SI Remove Trend VI provides a way for you to remove trends from the
raw data set. You must set the trend type to linear to use this preprocessing
technique.
2-9
Chapter 2
Outliers
Various unexpected events, such as an abnormal pulse, a temporary sensor
failure, or transmitter failure, can corrupt the raw data samples. These
disturbances, or outliers, can severely distort the resulting model
estimation. However, you often can recognize outliers by visually
inspecting the data, as shown in Figure 2-6.
Visually inspecting the graph tells you that the data acquired between
85100 seconds is abnormal. When preprocessing data, you want to
remove all outliers in the data set. You must remove the outliers manually.
2-10
ni.com
Chapter 2
methods that use the impulse response and frequency response. Refer to
Chapter 4, Parametric Model Estimation Methods, for information about
the parametric model structures and the parametric model estimation
methods. Refer to Chapter 5, Recursive Model Estimation Methods, for
information about recursive model estimation methods.
Data Scaling
In multiple-input multiple-output (MIMO) systems, it is common to have
inputs and outputs of different amplitude ranges. Such a diversity in
amplitudes can make the model estimation calculation ill-conditioned,
which deteriorates the precision of the dynamic response. For example,
consider the values A and B in Figure 2-7. Valves A and B operate between
0100% and 5060% opening range, respectively.
PA
PB
Level
The pressure in their respective stream lines are PA and PB. Assume that PB
can be much larger than PA, you might need to normalize the range of
operation of valve B for numerical robustness. You can use the following
relationship to normalize the range of operation.
Level
Level
------------------ -----------------------------------%A
( %B 50 )10
The SI Normalize VI ensures that all stimulus and response signals have a
zero mean and unit variance over the sample data range used for model
estimation. This process standardizes the range of the equation for all
signals considered for model estimation. This data preprocessing step
considers all inputs and outputs equally important from the numerical
calculation viewpoint.
2-11
Nonparametric Model
Estimation Methods
3-1
Chapter 3
Impulse Response
An impulse input, as shown in Figure 3-1, to a dynamic system is defined
differently depending on whether the system is discrete or continuous. For
a continuous dynamic system, an impulse input is a unit-area signal with an
infinite amplitude and infinitely small duration occurring at a specified
time. At all other times, the input signal value is zero. For a discrete system,
an impulse is a physical pulse that has unit amplitude at the first sample
period and zero amplitude for all other times.
u(t)
Area = 1
0
0
t
0
Because the impulse signal excites all frequencies and the duration of this
signal is infinitely small, you can see the natural response of the system.
Figure 3-2 shows that the impulse response of a linear time-invariant
system is equal to the output y(n) of the system when you apply an impulse
signal to the input u(n) of the system. The impulse response provides the
complete characteristic information of a system.
System
h(k)
u(n)
y(n)
3-2
ni.com
Chapter 3
If you know the impulse response h(k) and the input signal u(n) of a system,
then you can compute the output y(n) of the system by using the following
equation.
y( n) =
u ( n k )h ( k ) + e ( n )
k=0
Correlation Analysis
The correlation analysis method uses the cross correlation between the
input and output signals as an estimation of the impulse response. The input
signal must be zero-mean white noise with a spectral density that is equally
distributed across the whole frequency range. The SI Estimate Impulse
Response VI can prewhiten signals that are not white noise.
3-3
Chapter 3
Assuming the input u(n) of the system is a stationary, stochastic process and
statistically independent of the disturbance e(n), the following equation is
true.
R uy ( ) =
uu ( k
)h ( k )
k=0
Ruy represents the cross correlation function between the stimulus signal
u(n) and the response signal y(n), as defined by the following equation.
1
R uy ( ) = ---N
N max ( , 0 ) 1
y ( n + )u ( n )
n = min ( , 0 )
N 1
u ( n + )u ( n )
n=0
R uu ( ) = u ( )
where u is the standard deviation of the stimulus white noise and ( ) is
the Dirac function. Substituting Ruu( ) into the cross correlation function
between the stimulus signal u(n) and the response signal y(n) yields the
following equation.
R uy ( ) =
2
u
( k )h ( k ) = h ( )
2
u
k=0
You can rearrange the terms of this equation to obtain the following
equation defining the impulse response h(k).
R uy ( k )
h ( k ) = --------------2
u
3-4
ni.com
Chapter 3
Prewhitening
The correlation analysis method that estimates the impulse response is
useful only when the input signal u(n) is a zero-mean white noise signal.
However, the input signal is not white noise in most real-world
applications. The input u(n) and output y(n) signals therefore must be
preconditioned before you apply the correlation analysis method.
Prewhitening is a preconditioning technique for the correlation analysis
method. Prewhitening involves applying a filter to the input signal u(n) and
the output signal y(n) to obtain a prewhitened input signal u'(n) and a
prewhitened output signal y'(n). If the filter is well designed such that u'(n)
is white noise, you can perform a correlation analysis on u'(n) and y'(n) to
estimate the impulse response. The impulse response that you estimate with
u'(n) and y'(n) is equivalent to the impulse response that you estimate with
u(n) and y(n) because the following equation remains true.
y' ( n ) =
u' ( n k )h ( k ) + e ( n )
k=0
You now must design the prewhitening filter so that u'(n) is white noise.
The SI Estimate Impulse Response VI uses an AR model for this purpose.
Refer to Chapter 4, Parametric Model Estimation Methods, for more
information about AR model estimation.
3-5
Chapter 3
Figure 3-3 shows the front panel of a VI that simulates a system defined by
the following equation.
y ( n ) = 0.2u ( n ) + 0.8u ( n 1 ) + 0.3u ( n 2 )
Figure 3-4 shows the block diagram of this VI. This example VI
demonstrates the accuracy of the impulse response estimation in the
following circumstances:
3-6
ni.com
Chapter 3
In this example VI, the is white noise? checkbox determines whether the
SI Estimate Impulse Response VI generates zero-mean white noise as an
input to the system. When you place a checkmark in the is white noise?
checkbox and run the VI, the generated input signal is zero-mean white
noise, and the estimated impulse response closely approximates the true
impulse response. When you do not place a checkmark in the is white
noise? checkbox, the generated input signal is not zero-mean white noise.
As a result, the estimated impulse response is different from the true
impulse response. These results indicate that the correlation analysis
method is accurate and reliable when the input signal is zero-mean white
noise.
The AR order box determines the level of prewhitening. When AR order
equals 0, the SI Estimate Impulse Response VI does not apply prewhitening
to the system. When AR order is small and you do not place a checkmark
in the is white noise? checkbox, the variance of the impulse response is
large because the input signal is not always white noise. The greater the
value of AR order, the better the VI whitens the signal, but the more
computation time and memory the VI requires.
The whiteness test indicator of this VI shows whether the input is
zero-mean white noise. This indicator displays the autocorrelation of the
stimulus signal after whitening. If most of the autocorrelation is within the
confidence region, the input signal is well prewhitened, and the estimation
of the impulse response is reliable. If the autocorrelation is outside of the
confidence region, the estimation is unreliable. When the estimation is
unreliable, rejected? is TRUE and indicates a 5% risk of rejecting an
impulse response estimation that might be reliable.
3-7
Chapter 3
3-8
ni.com
Chapter 3
3-9
Chapter 3
In Figure 3-5, the two initial values of the estimated impulse response are
smaller than the confidence level. You can have 99.0% confidence that
values less than the confidence level are insignificant, and you can consider
those values to be equal to 0. Therefore, you can conclude that the time
delay of the system is 2 because the beginning of the first two values of the
impulse response are zero.
Frequency Response
In theory, the results from impulse response estimation and the results from
frequency response estimation are equivalent. For example, the Fourier
transform of the impulse response h(k), which you can compute using
impulse response estimation, equals the frequency response G(e j).
However, this equivalence does not hold in most real-world applications
because of different preprocessing schemes in impulse response estimation
and frequency response estimation.
The frequency response provides the complete frequency-domain
characteristics of the system, including the passband and the natural
frequency of the system. A sinusoidal input signal has the following general
form:
u ( t ) = sin ( 0 t )
3-10
ni.com
Chapter 3
uy (e ) = uu ( e )G (e )
G(e j) is the frequency response of the system. uu(e j) is the auto-spectral
density of the stimulus signal u(n). uy(e j) is the cross-spectral density
between the stimulus signal u(n) and the response signal y(n).
You then can use the following equation to compute the frequency
response G(e j).
j
uy (e )
j
G (e ) = ------------------j
uu (e )
You can compute uu(e j) and uy(e j) by applying a fast Fourier
transform (FFT) to the autocorrelation Ruu and the cross correlation Ruy,
respectively. As shown in the autocorrelation function Ruu and the cross
3-11
Chapter 3
uu (e ) =
uu (
)w m ( )e
uy (
)w m ( )e
= N
N
j
uy (e ) =
= N
The lag window approaches zero when the lag is large. The window
weighs out the points of Ruu and Ruy with large lag , thereby improving the
accuracy of the frequency response estimation. The SI Estimate Frequency
Response VI uses a Hanning window as the lag window.
Refer to the book, System Identification Theory for the User1, for
information about using a Hanning window.
Ljung, L. 1999. System Identification Theory for the User. 2d ed. Prentice Hall.
3-12
ni.com
Chapter 3
The following example demonstrates how the length of the lag window
affects the frequency response estimation. Figure 3-7 shows the front panel
of a VI that simulates a system defined by the following equation.
y ( n ) 1.46y ( n 1 ) + 2.5y ( n 2 ) 1.46y ( n 3 ) + y ( n 4 )
= u ( n ) + 0.45u ( n 1 ) + u ( n 2 )
3-13
Chapter 3
In this example VI, the input signal u(n) is a swept sine wave whose
normalized frequency is from 0 to 0.5. The number of data points in the
input signal is 4096. The length of the lag window therefore must be less
than or equal to 4096. Figure 3-9 and Figure 3-10 show the resulting
frequency responses when the window length is 4096 and 64 respectively.
3-14
ni.com
Chapter 3
The frequency response curve is smoother and the variance is smaller when
the length of the lag window is small. However, when the length of the lag
window is too small, you cannot distinguish between the two close peaks
in the frequency response, as shown in Figure 3-10. When the length of the
lag window is large, the SI Estimate Frequency Response VI accurately
estimates the peaks, as shown in Figure 3-9. The bias is small with a large
lag window, but the variance of the estimated frequency response is large
with a large lag window.
3-15
Chapter 3
Setting the length of the lag window to 510% of the number of data points
when estimating the frequency response often results in a good trade-off
between the bias and variance. However, the selection of the length of the
lag window is not trivial. The length also depends on the signals, the
properties of the system, and the purpose of application. For example, if
you want to know the passband of a system, use a smaller lag window. If
you want to identify the dynamic properties of a system, such as its natural
frequency, use a larger lag window.
3-16
ni.com
Chapter 3
3-17
y ( n ) = q G ( q , )u ( n ) + H ( q , )e ( n )
u(n) and y(n) are the input and output of the system respectively.
e(n) is zero-mean white noise, or the disturbance of the system.
G(q 1, ) is the transfer function of the deterministic part of the system.
H(q 1, ) is the transfer function of the stochastic part of the system.
4-1
Chapter 4
B ( q ) = b0 + b1 q
+ a2 q
+ + a na q
+ + b nb 1 q
na
( nb 1 )
nc
C ( q ) = 1 + c1 q
+ c2 q
+ + c n c q
D ( q ) = 1 + d1 q
+ d2 q
+ + d n d q
+ f2 q
+ + f nf q
F ( q ) = 1 + f1 q
nd
nf
where na, nb, nc, nd, and nf are the model orders.
Figure 4-1 depicts the signal flow of a general-linear model.
4-2
ni.com
Chapter 4
C(q)
D(q)
B(q)
F(q)
1
A(q)
ARX Model
When C(q), D(q), and F(q) equal 1, the general-linear polynomial model
reduces to an ARX model. The following equation describes an ARX
model.
A(q)y(n) = qkB(q)u(n) + e(n) = B(q)u(n k) + e(n)
Note
Remember that the backward shift operator makes q ku(n) = u(n k).
Figure 4-2 depicts the signal flow of an ARX model.
e(n)
u(n)
B(q)
1
A(q)
y(n)
The ARX model is the simplest model incorporating the stimulus signal.
The estimation of the ARX model is the most efficient of the polynomial
estimation methods because it is the result of solving linear regression
4-3
Chapter 4
ARMAX Model
When D(q) and F(q) equal 1, the general-linear polynomial model reduces
to the ARMAX model. The following equation describes an ARMAX
model.
A(q)y(n) = qkB(q)u(n) + C(q)e(n) = B(q)u(n k) + C(q)e(n)
Figure 4-3 depicts the signal flow of the ARMAX model.
4-4
ni.com
Chapter 4
e(n)
C(q)
u(n)
B(q)
1
A(q)
y(n)
Unlike the ARX model, the system structure of an ARMAX model include
disturbances dynamics. ARMAX models are useful when you have
dominating disturbances that enter early in the process, such as at the input.
For example, a wind gust affecting an aircraft is a dominating disturbance
early in the process. The ARMAX model has more flexibility in the
handling of disturbance modeling than the ARX model.
The identification method of the ARMAX model is the prediction error
method. However, you cannot use an analytic form to solve the problem.
The SI Estimate ARMAX Model VI uses the Newton-Gauss method to
search for the optimal ARMAX model. This searching algorithm is an
iterative procedure so it is inefficient and can get stuck at a local minimum,
especially when the signal-to-noise ratio is low. Use model validation
methods to verify whether the model achieves the required quality and to
verify whether the estimation is stuck at a local minimum. If the estimation
is stuck at a local minimum, select a new model structure or change the
model order.
Output-Error Model
When A(q), C(q), and D(q) equal 1, the general-linear polynomial model
reduces to the output-error model. The following equation describes an
output-error model.
k
B(q)
q B( q)
y ( n ) = ------------------- u ( n ) + e ( n ) = ----------- u ( n k ) + e ( n )
F( q)
F(q)
Figure 4-4 depicts the signal flow of the output-error model.
4-5
Chapter 4
e(n)
B(q)
F(q)
u(n)
y(n)
Box-Jenkins Model
When A(q) equals 1, the general-linear polynomial model reduces to the
Box-Jenkins model. The following equation describes a Box-Jenkins
model.
k
C(q)
B(q)
C(q)
q B(q)
y ( n ) = ------------------- u ( n ) + ------------ e ( n ) = ----------- u ( n k ) + ------------ e ( n )
F(q)
D(q)
F(q)
D(q)
Figure 4-5 depicts the signal flow of the Box-Jenkins model.
e(n)
C(q)
D(q)
u(n)
B(q)
F(q)
y(n)
4-6
ni.com
Chapter 4
AR Model
When C(q), D(q), and F(q) equal 1 and B(q) equals 0, the general-linear
polynomial model reduces to the AR model. The following equation
describes an AR model.
A(q)y(n) = e(n)
Figure 4-6 depicts the signal flow of the AR model.
e(n)
1
A(q)
y(n)
Strictly speaking, the AR model is not a model for a system but a model for
a signal. A system is a device with an input and an output, but an AR model
does not include the dynamics between the input and output.
Time series analyses, such as power spectrum envelope estimation,
prewhitening, and linear prediction coding, commonly use the AR model.
If you consider A(q) to be a filter, A(q)y(n) is the filtering of A(q) on the
signal y(n). The result of the filtering is white noise e(n), as shown in AR
model equation. Hence, the filter A(q) is also known as the whitening or
prewhitening filter. From the frequency-domain standpoint, the whitening
filter A(q) suppresses the spectrum at frequencies where the magnitude of
the spectrum is large. Suppressing the high magnitude frequencies results
in a flat spectrum. Refer to Chapter 3, Nonparametric Model Estimation
Methods, for examples on how to apply the AR model for prewhitening.
As shown in AR model equation, if you know the AR coefficients A(q) and
the noise e(n), you can reconstruct the signal y(n). A(q) and e(n) completely
characterize a signal. A(q) normally has a small number of coefficients. e(n)
has a small dynamic range and requires a smaller number of bits for
4-7
Chapter 4
encoding. Therefore, you can use the AR model for compression purposes
in a process known as linear prediction coding (LPC). Speech and vibration
signal processing, such as compression, pattern recognition, and so on,
commonly use LPC. A(q) and e(n) also can be used for estimating the
power spectrum of the signal y(n).
State-Space Model
In addition to polynomial models, the System Identification Toolkit also
can estimate state-space models. The following equations describe a
state-space model.
x(n +1) = Ax(n) + Bu(n) + Ke(n)
y(n) = Cx(n) + Du(n) + e(n)
x(n) is the state vector. A, B, C, D, and K are the system matrices. The
dimension of the state vector x(n) is the only setting you need to provide for
the state-space model. The state-space model describes a system using
difference equations with an auxiliary state vector x(n). The state-space
transfer matrices often reflect physical characteristics of a system. Hence,
state-space models often are preferable to polynomial models, especially in
modern control applications.
The SI Estimate State-Space Model VI uses the N4SID algorithm to
estimate the state-space model. Refer to the System Identification Toolkit
Algorithm References (SIreference.pdf), available in the
labview\manuals directory, for more information about this algorithm.
4-8
ni.com
Chapter 4
When the model order is high, use an ARX model because the algorithm
involved in ARX model estimation is fast and efficient when the number of
data points is very large. The state-space model estimation with a large
number of data points is slow and requires a large amount of memory. If
you must use a state-space model, for example in modern control methods,
reduce the sampling rate of the signal in case the sampling rate is
unnecessarily high.
The other polynomial models, including the ARMAX, output-error,
Box-Jenkins, and general-linear models, involve iterative, nonlinear
optimization in the identification procedure. They require excessive
computation time, and the minimization can get stuck at a false local
minimum, especially when the order is high and the signal-to-noise ratio is
low. However, you can use these models when the stochastic dynamic is
important because they provide more flexibility for the stochastic
dynamics.
2.
3.
Test various ARX model orders with this delay choosing those orders
that provide the best fit.
4.
Because the ARX model describes both the system dynamics and
noise properties using the same set of poles, the resulting model can be
unnecessarily high in order. By plotting the poles and zeros with the
uncertainty intervals and looking for potential cancellations of
pole-zero pairs, you can reduce the model order. The resulting orders
of the poles and zeros are a good starting point for ARMAX,
4-9
Chapter 4
If you still cannot obtain a suitable model, additional physical insight into
the problem might be necessary. Compensating for nonlinear sensors or
actuators and handling of important physical nonlinearities are often
necessary in addition to using a ready-made model.
From the prediction error standpoint, the higher the order of the model is,
the better the model fits the data because the model has more degrees of
freedom. However, you need more computation time and memory for
higher orders. The parsimony principle advocates choosing the model with
the smallest degree of freedom, or number of parameters, if all the models
fit the data well and pass the verification test. The criteria to assess the
model order therefore not only must rely on the prediction error but also
must incorporate a penalty when the order increases. Akaikes Information
Criterion (AIC), Akaikes Final Prediction Error Criterion (FPE), and the
Minimum Data Length Criterion (MDL) are criteria you can use to estimate
the model order. The SI Estimate Orders of System Model VI implements
the AIC, FPE, and MDL methods to search for the optimal model order in
the range of interest. You also can plot the prediction error as a function of
the model dimension and then visually find the knee in the curve or apply
an F-test to obtain an appropriate estimation of the model order.
4-10
ni.com
Chapter 4
Converting Models
According to linear system theory, you can represent a linear, discrete-time
system with different models. You can convert one model representation to
another using the System Identification Toolkit VIs. Use the Model
Conversion VIs to convert an AR, ARX, ARMAX, output-error,
Box-Jenkins or general-linear model into a state-space, transfer function, or
zero-pole-gain model and to convert a state-space model into a transfer
function or zero-pole-gain model.
Each model representation has benefits and drawbacks for characterizing a
dynamic system. Refer to the Polynomial Models versus State-Space
Models section for information about choosing an appropriate model
representation to use.
You also can use the Model Conversion VIs to convert models created in
the System Identification Toolkit into transfer function, zero-pole-gain, or
state-space models that you can use with the LabVIEW Control Design
Toolkit. This model conversion process enables you to identify a model for
4-11
Chapter 4
an unknown system with the System Identification Toolkit and then design
a controller for that same system using the Control Design Toolkit.
Refer to the Model-Based Control Design Process section of Chapter 1,
Introduction to System Identification, for more information about the
integration of the System Identification Toolkit and the Control Design
Toolkit in the model-based control design process. Refer to ni.com for
more information about the Control Design Toolkit.
Validating Models
Model estimation only determines the best model of the system within the
chosen model structure. Model estimation does not determine whether the
model provides the most accurate description of the system. Once you
obtain a model, you then must validate the model to determine how well the
behavior of the model corresponds to both the observed data, any prior
knowledge of the system, and the purpose for which you will use the model.
If the model is inadequate, you must revise the system identification
process or consider using another approach.
Validating the model provides a measure of the quality of the model
obtained through the system identification process. Model validation
determines whether the model is flexible enough to describe the system and
whether the model is too complex.
The best way to validate a model is to experiment with the model under
real-world conditions. If the model works as well as expected, then the
model estimation is successful. However, experimenting with the model
under real-world conditions can be dangerous. For example, introducing
arbitrary perturbations to the input of a chemical plant can lead to a harmful
explosion.
Before you incorporate the model into real applications you can validate the
model by using plots and common sense or by using statistical tests on the
prediction error.
The System Identification Toolkit provides three of the most common
validation methods: model simulation, model prediction, and model
residual analysis. In addition to these methods, you also can perform Bode,
Nyquist, or pole-zero analyses to investigate the results of the model
estimation.
4-12
ni.com
Chapter 4
Validation Methods
Once you build a model, you can use at least three different methods to
validate the model and evaluate its flexibility. You can use model
simulation to understand the underlying dynamic relationship between the
model inputs and outputs. You can use model prediction to test the ability
of the model to predict the response of the system using past input and
output data. You also can use model residual analysis to test the whiteness
of the prediction error and the independency between the prediction error
and the input signal using statistical techniques. The methods you select to
validate the model depend on the purpose for which you created the model.
You can use one or all of these methods to validate the model.
Simulation
The CD Model Simulation VI determines the outputs of a system for given
inputs. The best way to determine the outputs is to verify the behavior of a
system in a real-world environment by intentionally injecting perturbations
into the input data. For example, you can study the characteristics of an
electric motor by varying the input voltage and observing how the motor
responds. However, in many cases you cannot experiment with a system
because of safety concerns.
Once you build a model for the system based on the input and output data,
you do not have to evaluate the behavior of the system in a real-world
environment. You can use the model to simulate the response of the system
by using the model equations and then evaluate the behavior of the system.
You also can use a simulation to validate the model by comparing the
simulated response with the measured response.
Some systems that you want to identify may be unstable. For an unstable
system, simulation is not suitable for validating the system. Use model
prediction to validate the system instead.
Prediction
The SI Model Prediction VI determines the response of a system at time t
based on the output information available at time t k and all the inputs
applied from time t k to time t. k represents the size of prediction window.
Therefore, model prediction is helpful in determining how useful a model
is in estimating future responses of the system, given all information at
time t and an expected input profile in the future. There are some control
techniques that take advantage of model prediction to improve control
4-13
Chapter 4
Residual Analysis
Residual analysis is the third validation method that the System
Identification Toolkit provides. The response that an estimated model
predicts and the actual response from the system are different. This
difference is called the prediction error or residual. The following equation
defines the residual e(n).
e ( n ) = y ( n ) y ( n )
y(n) is measured output data and y'(n) is output data from the
one-step-ahead prediction. If the model is capable of describing the true
system, the residual is zero-mean white noise and independent of the input
signal. You can use autocorrelation analysis to test whether the residual is
zero-mean white noise. You can use cross correlation analysis to test
whether the residual is independent of the input signal. The SI Model
Residual Analysis VI calculates both the autocorrelation and the cross
correlation values.
Autocorrelation
The following equation defines the autocorrelation of the residuals.
1
R e ( ) = ---N
N
e ( n )e ( n + )
n=1
Ideally, the residual is white noise and therefore the autocorrelation ReN( )
is zero when is non-zero. A large autocorrelation when is non-zero
indicates that the residual is not zero-mean white noise and normally
implies that the model structure is not relevant to the system or that you
need to increase the model order.
4-14
ni.com
Chapter 4
Cross Correlation
The following equation defines the cross correlation between residuals and
past inputs.
N
R eu
1
( ) = ---N
e ( n )u ( n + )
n=1
If the residual is independent of the input, the cross correlation is zero for
all . If the residual correlates with the input, the model has not captured all
deterministic variations from the data. Therefore you need to revise the
model variation.
The confidence level of cross correlation output of the SI Model Residual
Analysis VI assesses whether the value of the cross correlation is
sufficiently small. If the value of the cross correlation is smaller than the
value of confidence level of cross correlation, the value is insignificant
and you can consider it to be equal to zero.
4-15
5-1
Chapter 5
u(n)
Unknown System
Adaptive Model
y(n)
+
e(n)
y(n)
The stimulus signal u(n) is the input to both the unknown system and the
adaptive model. The response of the system y(n) and the predicted response
of the adaptive model y ( n ) are combined to determine the error of the
system. The error of the system is defined by the following equation.
e ( n ) = y ( n ) y ( n )
The adaptive model generates the predicted response y ( n + 1 ) based on
u(n + 1) after adjusting the parametric vector w ( n ) based on the error e(n).
Figure 5-1 shows how the error information e(n) is sent back to the adaptive
model, which adjusts the parametric vector w ( n ) to account for the error.
You iterate on this process until you minimize the magnitude of the least
mean square error e(n).
Before you apply the recursive model estimation, you must first select the
parametric model structure that determines the parametric vector w ( n ) .
Then, you must select the method that automatically adjusts the parametric
vector such that the error e(n) goes to the minimum.
The System Identification Toolkit provides Recursive Model Estimation
VIs that support the following model structures:
ARX
ARMAX
Output Error
Box-Jenkins
General Linear
5-2
ni.com
Chapter 5
Adaptive Algorithms
Adaptive algorithms are fundamental in recursive system identification.
The adaptive method you use affects the performance of recursive system
identification application.
The goal of an adaptive algorithm is to minimize the cost function. The
following equation defines the cost function J(n).
J(n) = E[e2(n)]
Again, e(n) represents the difference between the predicted response y ( n )
and the response y(n) of the unknown system, as shown in Figure 5-1.
The goal of all recursive algorithms is to adjust the parametric vector w ( n )
until you minimize the cost function J(n). When the cost function J(n) is
sufficiently small, the parametric vector w ( n ) is considered optimal for the
estimation of the actual system.
J(n) = E[ e (n)]
5-3
Chapter 5
2.
3.
4.
5.
6.
7.
8.
The LMS algorithm is one of the most widely used and understood adaptive
algorithms. Selecting the step-size is important with the LMS algorithm.
The selection of the step-size directly affects the rate of convergence and
the stability of the algorithm. The convergence rate of the LMS algorithm
5-4
ni.com
Chapter 5
( n ) = ----------------------------2
+ ( n )
Again, ( n ) represents the data vector. is a very small positive number
2
that prevents the denominator from equaling zero when ( n ) is
approaches to zero.
The step-size (n) is time-varying because the step-size changes with the
time index n.
Substituting (n) into the parametric vector w ( n ) equation yields the
following equation.
w ( n + 1 ) = w ( n ) + ( n )e ( n )( n )
Compared to the LMS algorithm, the NLMS algorithm is always stable if
the step-size (n) is between zero and two, regardless of the statistical
property of the stimulus signal u(n).
The procedure of the NLMS algorithm is the same as the LMS algorithm
except for the estimation of the time varying step-size (n).
5-5
Chapter 5
N1
e ( n i )
2
i=0
Compare this modified cost function, which uses the previous N error
terms, to the cost function, J(n) = E[e2(n)], which uses only the current
error information e(n). The modified cost function J(n) is more robust. The
corresponding convergence rate in the RLS algorithm is faster, but the
implementation is more complex than LMS-based algorithms.
The following procedure describes how to implement the RLS algorithm.
1.
2.
3.
5.
P(0) = 0
0
0
4.
0
0
0 0
0 0
0
0
6.
5-6
ni.com
Chapter 5
7.
8.
9.
10. Stop if the error is small enough, else set n = n + 1 and repeat
steps 410.
Kalman Filter
The Kalman filter is a linear optimum filter that minimizes the mean of the
squared error recursively. The convergence rate of the Kalman filter is
usually faster, but the implementation is more complex than LMS-based
algorithms.
Recall that the equation J(n) = E[e2(n)] defines the cost function. The
following procedure lists the steps of the Kalman filter algorithm.
1.
2.
5-7
Chapter 5
3.
P(0) = 0
0
0
4.
5.
0
0
0 0
0 0
0
0
6.
7.
8.
9.
P ( n + 1 ) = P ( n ) K ( n ) ( n ) P ( n ) + QP
QP is the correlation matrix of the process noise.
10. Stop if the error is small enough, else set n = n + 1 and repeat
steps 410.
The Recursive Model Estimation VIs have a recursive method parameter
that enables you to specify which recursive estimation method to use.
5-8
ni.com
This chapter contains a case study that guides you through the system
identification process. The case study uses sample data that the LabVIEW
System Identification Toolkit provides in the SI Data Samples VI. The
SI Data Samples VI includes data sets for a DC motor, a flexible robot1
arm, and a ball and beam apparatus. The case study in this chapter uses the
flexible arm data to demonstrate the system identification process and
compare different estimation methods.
The flexible arm is a nonlinear dynamic system.The System Identification
Toolkit enables you to model systems linearly. So this case study
demonstrates how you obtain a linear representation of a nonlinear system.
The VIs for this case study are located in labview\examples\system
identification\SICaseStudy1.llb.
Refer to the LabVIEW Help, available by selecting HelpVI, Function, &
How-To Help, for information about specific System Identification VIs in
this case study.
Data Preprocessing
The next step in the system identification process after gathering data is to
preprocess the data. The input to this system is the reaction torque of the
structure on the ground. This input is a swept sine wave with 200 frequency
points equally spaced over the frequency band from 0.122 Hz to 24.4 Hz.
The output of this system is the acceleration of the flexible arm. The
acceleration contains information about the flexible resonances and
anti-resonances.
The flexible robotic arm data was adopted from a case study in the MATRIXx Interactive System Identification Module, Part 2
manual. Hendrik Van Brussel and Jan Swevers of the laboratory of Production Manufacturing and Automation of the
Katholieke Universiteit Leuven provided this data, which they obtained in the framework of the Belgian Programme on
Interuniversity Attracion Poles.
6-1
Chapter 6
The names of the figures in this chapter reflect the names of the example VIs located
in the labview\examples\system identification\SICaseStudy1.llb.
Note
The stimulus signal torque output corresponds to the input data, or the
torque, and the response signal acceleration output corresponds to the
output data, or the acceleration.
Figure 6-2 shows the input and output data on graphs during the length of
the response. By looking at the graphs, you can inspect the data for outliers,
clipped saturation, or quantization effects that you can remove because they
are not representative of the system behavior.
6-2
ni.com
Chapter 6
Figure 6-2. Flexible Arm Data Set Plotted in the Time Domain
Figure 6-2 shows no obvious nominal, trend, or outlier values in the input
or output time waveforms.
6-3
Chapter 6
The input data is periodic over 4096 samples, which is the signal length.
Notice that in Figure 6-3 the window length, 4096, is the same as the signal
length so as to obtain a smaller bias in the frequency response estimation.
Figure 6-4 shows the magnitude and phase responses of the measured
output signal. The magnitude response graph shows three resonances and
two anti-resonances in the frequency domain. Resonances are vibrations of
large amplitude in a system caused by exciting the system at its natural
frequency.
Notice the resonance at approximately 42 Hz. You can deduce that this
resonance is caused by noise or nonlinear system behavior because the
42 Hz falls outside the frequency range of the input data, 0.12224.4 Hz.
At 42 Hz, there is no input energy, thus implying that the response at 42 Hz
is not a result of the input.
By examining the frequency response data, you see that filtering is
necessary to remove this resonance peak at 42 Hz. The following section
describes how to use the System Identification Toolkit to apply a filter to
the flexible arm data.
6-4
ni.com
Chapter 6
You can see the effects of the lowpass filter by comparing the frequency
response of the filtered data set in Figure 6-6 to the frequency response of
the non-filtered data set in Figure 6-4. By using a lowpass filter, you can see
that the resonance at approximately 42 Hz is no longer part of the data set
you will use to estimate the model.
6-5
Chapter 6
6-6
ni.com
Chapter 6
Figure 6-8 shows the frequency response after applying a filter to and
downsampling the raw data set.
Figure 6-8. Frequency Response of the Filtered Data Set after Downsampling
Sometimes the results you obtain with these three criteria might be
inconsistent. You can use a pole-zero plot for further investigation and to
verify the results of the order estimation. Refer to the Akaikes Information
Criterion, Akaikes Final Prediction Error Criterion, and Minimum Data
6-7
Chapter 6
The following sections show you how to use the AIC, MDL, and a
user-defined criterion to determine the A and B orders of an ARX model.
6-8
ni.com
Chapter 6
A order = 9
B order = 10
delay = 0
6-9
Chapter 6
Because there are three pole-zero pairs, you can conclude that the AIC
criterion does not produce the most optimal orders.
A order = 6
B order = 6
delay = 0
6-10
ni.com
Chapter 6
Compare Figure 6-12, which uses the MDL criterion and Figure 6-11,
which uses the AIC criterion. Because there are no overlapping pole-zero
pairs in Figure 6-11, you can conclude that the MDL criterion fits better
than AIC criterion in this particular example.
In addition to examining redundancy, you also can use the pole-zero plot
for other purposes. For example, both Figure 6-11 and Figure 6-12 show
poles outside the unit circle. Having poles outside the unit circle implies
that this model is not optimal because the ARX system based on the AIC
or MDL criteria is unstable. One way to stabilize the system is to change
the order.
In addition to the FPE, AIC, and MDL criteria, you can set user-defined
orders in the SI Estimate Orders of System Model VI.
User-Defined Criterion
If you know nothing about the system, you might have to rely on trial and
error to determine the optimal orders of the model. However, if you have
some knowledge about a system, you can customize the estimation to find
a model that fits a certain model dimension. For this model, assume you
know that the system is stable, therefore, there should not be any poles
outside the unit circle. Therefore, because both the AIC and MDL criterion
did not produce stable models, the model orders do not describe the system
accurately.
6-11
Chapter 6
On the block diagram, as shown in Figure 6-13, you can customize the
method parameter. Instead of AIC or MDL, you can select <Other> and
enter the desired model dimension in the textbox. Assume you know that
the model dimension is nine.
Figure 6-14 shows the corresponding Pole-Zero Plot graph with a model
dimension of nine, which corresponds to the following optimal orders:
A order = 4
B order = 5
delay = 0
Compare the pole-zero plot in Figure 6-14 with Figure 6-11 and
Figure 6-12. Figure 6-14, which has no overlapping pole-zero pairs and all
6-12
ni.com
Chapter 6
the poles are within the unit circle. By visually inspecting the pole-zero
plot, you can see that this model is stable and not redundant. Using these
model orders, you now can estimate and verify the system model.
6-13
Chapter 6
Residual Analysis
In addition to simulation and prediction, you can perform a residual
analysis to validate the system model. Residual analysis tests whether the
prediction error correlates to the stimulus signal. Prediction errors are
usually uncorrelated with all stimulus signals in an open-loop system.
6-14
ni.com
Chapter 6
The block diagram in Figure 6-17 shows how you can use the SI Model
Residual Analysis VI to with the ARX model identified in the
User-Defined Criterion section to analyze the residuals.
When you verify and validate the identified model, you must use multiple
analysis techniques to determine if the estimated model accurately
represents the system. Some analysis techniques can be misleading. For
example, if you performed a residual analysis on the model identified in the
6-15
Chapter 6
Minimum Data Length Criterion section, you might conclude that this
model is an accurate representation of the system. Figure 6-19 shows the
autocorrelation and cross correlation residual analysis for the model in the
Minimum Data Length Criterion section. Recall that this model has the
following orders:
A order = 6
B order = 6
delay = 0
Figure 6-19 shows that both the autocorrelation and cross correlation are
inside the confidence region. Therefore, without performing any other
analyses, you might conclude that this model is an accurate representation
of the system. However, the pole-zero analysis in the Minimum Data
Length Criterion section showed poles outside of the unit circle. So you
already determined that this model is unstable. Thus, despite acceptable
autocorrelation and cross correlation values, concluding that this model is
accurate is incorrect.
Thus, if you only performed a residual analysis, you might not discover that
this model is actually unstable. When validating a model, perform multiple
analyses to ensure the accuracy of the model.
6-16
ni.com
Chapter 6
The Singular Values graph in Figure 6-21 shows a singular value plot with
four leading singular values.
6-17
Chapter 6
By looking both at the Singular Values graph and the optimal order, you
can see that there are four states in this state-space model.
The simulation and 1-step ahead prediction graphs in Figure 6-22 show
simulation and prediction plots for a state-space model.
6-18
ni.com
Chapter 6
Additional Examples
In this chapter, you learned how to start from raw data and find an accurate
model to represent the system from which you acquired the data. The
examples in this chapter are located in labview\examples\system
identification\SICaseStudy1.llb.
The labview\examples\system identification\ directory also
contains other examples you can use to become familiar with the System
Identification VIs.
Refer to the LabVIEW Help, available by selecting HelpVI, Function, &
How-To Help, for information about specific System Identification VIs in
this case study.
6-19
References
A-1
Appendix A
References
A-2
ni.com
If you searched ni.com and could not find the answers you need, contact
your local office or NI corporate headquarters. Phone numbers for our
worldwide offices are listed at the front of this manual. You also can visit
the Worldwide Offices section of ni.com/niglobal to access the branch
office Web sites, which provide up-to-date contact information, support
phone numbers, email addresses, and current events.
B-1