Professional Documents
Culture Documents
TM
June 2008
Support
Worldwide Technical Support and Product Information
ni.com
National Instruments Corporate Headquarters
11500 North Mopac Expressway Austin, Texas 78759-3504 USA Tel: 512 683 0100
Worldwide Offices
Australia 1800 300 800, Austria 43 662 457990-0, Belgium 32 (0) 2 757 0020, Brazil 55 11 3262 3599,
Canada 800 433 3488, China 86 21 5050 9800, Czech Republic 420 224 235 774, Denmark 45 45 76 26 00,
Finland 358 (0) 9 725 72511, France 01 57 66 24 24, Germany 49 89 7413130, India 91 80 41190000,
Israel 972 3 6393737, Italy 39 02 41309227, Japan 0120-527196, Korea 82 02 3451 3400,
Lebanon 961 (0) 1 33 28 28, Malaysia 1800 887710, 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 495 783 6851, Singapore 1800 226 5886, Slovenia 386 3 425 42 00, South Africa 27 0 11 805 8197,
Spain 34 91 640 0085, Sweden 46 (0) 8 587 895 00, Switzerland 41 56 2005151, Taiwan 886 02 2377 2222,
Thailand 662 278 6777, Turkey 90 212 279 3031, 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.
20042008 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. C USTOMERS 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.
National Instruments respects the intellectual property of others, and we ask our users to do the same. NI software is protected by copyright and other
intellectual property laws. Where NI software may be used to reproduce software or other materials belonging to others, you may use NI software only
to reproduce materials that you may reproduce in accordance with the terms of any applicable license or other legal restriction.
Trademarks
National Instruments, NI, ni.com, and LabVIEW are trademarks of National Instruments Corporation. Refer to the Terms of Use section
on ni.com/legal for more information about National Instruments trademarks.
Other 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.
Algorithm References
This document describes the VIs used to implement the algorithms in the LabVIEW System
Identification Toolkit.
Refer to the LabVIEW Help, available in LabVIEW by selecting HelpSearch the LabVIEW Help,
for more information about the main steps in the system identification process and about how to use the
System Identification Toolkit to create applications that can accomplish the various tasks in the process.
Contents
System Identification Palettes, VIs, and SubVIs ...................................................................................... 2
si_Piecewise Linear Fitting.vi .................................................................................................................. 3
SI Detect Feedback (Array).vi .................................................................................................................. 5
si_AR (FB, LS, YW and PC).vi ............................................................................................................... 6
si_AR Burg Method.vi ............................................................................................................................. 8
si_Est ARX Model (SISO).vi ................................................................................................................. 10
si_Est ARX Model (MISO).vi ................................................................................................................ 12
si_Est ARX Model (MIMO).vi .............................................................................................................. 13
si_Est ARMAX Model (SISO).vi ........................................................................................................... 14
si_Est ARMAX Model (MISO).vi ......................................................................................................... 16
si_Est OE Model (SISO).vi .................................................................................................................... 17
si_Est OE Model (MISO).vi ................................................................................................................... 19
si_Est BJ Model (SISO).vi ..................................................................................................................... 21
si_Est BJ Model (MISO).vi .................................................................................................................... 23
si_Est GL Model (SISO).vi .................................................................................................................... 26
si_Est GL Model (MISO).vi ................................................................................................................... 28
SI Estimate Continuous Transfer Function Model (SISO Array).vi ....................................................... 31
SI Estimate Discrete Transfer Function Model (SISO Array).vi ............................................................ 33
SI Estimate User-Defined Model (MIMO Array).vi .............................................................................. 34
si_Impulse Realization (MIMO).vi ........................................................................................................ 35
Subspace Identification Method via Principal Component Analysis (SIMPCA) ................................... 37
si_Correlation Analysis.vi ...................................................................................................................... 41
SI Estimate Impulse Response (Least Squares Array).vi ....................................................................... 43
si_Frequency Analysis.vi ....................................................................................................................... 45
SI Estimate Partially Known Continuous Transfer Function Model (General SISO Array).vi .............. 47
SI Estimate Partially Known State-Space Model (MIMO Array).vi ...................................................... 49
Recursive Model Estimation VIs ............................................................................................................ 50
SI Model Simulation VIs ........................................................................................................................ 58
SI Model Prediction VIs ......................................................................................................................... 65
si_Residual Analysis.vi .......................................................................................................................... 70
si_Convert to Transfer Function Model.vi ............................................................................................. 72
si_Convert to State Space Model.vi........................................................................................................ 74
si_Convert to Pole-Zero Model.vi .......................................................................................................... 76
si_Std Freq.vi.......................................................................................................................................... 77
si_Std Root to Polynomial.vi .................................................................................................................. 80
si_Polynomial Root Derivative.vi .......................................................................................................... 82
si_Variance of Real and Imaginary of Roots.vi ...................................................................................... 84
si_Confidence Region of Polynomial.vi ................................................................................................. 85
SI Average Theta and Covariance.vi ...................................................................................................... 87
SI Generate Pseudo-Random Binary Sequence.vi .................................................................................. 88
Gauss-Newton Minimization Method .................................................................................................... 89
Instrumental Variable Method ................................................................................................................ 92
SI Estimate Discrete Transfer Function Model from FRF (SISO arbitrary).vi ....................................... 93
SI Estimate Continuous Transfer Function Model from FRF (SISO arbitrary).vi ................................. 96
SI Estimate State-Space Model from FRF.vi ......................................................................................... 97
Algorithm References
Parametric
Model
Estimation
VI
SI Remove Trend
SI Detect Feedback
SI Estimate Impulse Response
SubVI
si_Piecewise Linear Fitting.vi
SI Detect Feedback (Array).vi
si_Correlation Analysis.vi
SI Estimate Impulse Response (Least Squares
Array).vi
si_Frequency Analysis.vi
SI Estimate Frequency
Response
SI Estimate Transfer Function
Model from FRF
Partially Known
Model
Estimation
Recursive
Model
Estimation
Model
SI Estimate User-Defined
Model
SI Estimate Partially Known
Continuous Transfer Function
Model
SI Estimate Partially Known
State-Space Model
SI Recursively Estimate AR
Model
SI Recursively Estimate ARX
Model
SI Recursively Estimate
ARMAX Model
SI Recursively Estimate OE
Model
SI Recursively Estimate BJ
Mode
SI Recursively Estimate StateSpace Model
SI Model Conversion
ni.com
Algorithm References
Conversion
Model Analysis
SI Bode Plot
SI Nyquist Plot
SI Pole-Zero Plot
Model
Validation
SI Model Simulation
SI Model Prediction
Utilities
Introduction
This section includes the algorithms and references used by the si_Piecewise Linear Fitting.vi. The
si_Piecewise Linear Fitting.vi is the core VI used to remove a piecewise linear trend from the
input-output data of a system.
2.
Function Description
The purpose of this function is to find the piecewise linear trend of a signal. A signal with a
piecewise linear trend is represented by
s0 sN 1 .
N-1.
3.
APIs
Para Name
signal with
In/Out
Type
Description
In
1D DBL Array
In
1D I32 Array
Out
1D DBL Array
Fitted signal
Out
1D DBL Array
trend
piecewise
points
Signal
(without
trend)
best fit
Algorithm References
4.
slopes
Out
1D DBL Array
intercepts
Out
1D DBL Array
error
Out
I32
Algorithms
If
y0, y1 yL , yN 1 are the best fit signal values at the piecewise points0, x1, , xL, N-1,
sk
between
xi
and
xi 1
is:
x k
k xi
sk yi i 1
yi 1
, xi k xi 1
xi 1 xi
xi 1 xi
(1)
Therefore, you can obtain the piecewise linear trend, or the best fit values, of the signal if you
know y0, y1 yL , yN 1 . Using the least square criterion, you can obtain
y0, y1 yL , yN 1
by
AY S
where
a00
a0m0
0
0
A
0
0
0
0
0
where
xi
(2)
aik
and
xi 1
xi1 k
xi 1 xi
that satisfies
bik
b00
b0m0
0
0
0
0
0
0
a10
a1m1
b10
b1m1
0
0
0
0
0
0
0
0
0
0
k xi
xi1 xi
0
0
0
bL1,0
bL1,mL1
0
0
0
aL1,0
aL1,mL1
(3)
m0 ... mL1 N . x0 0
and
xN 1 N 1 .
By solving Equation 2, you can calculate the best fit value at the piecewise points,
y0, y1 yL , yN 1 . Then, by multiplying the matrix A by the vector Y, you can calculate the best
fit signal.
ni.com
Algorithm References
Introduction
This section includes the algorithms and references used by the SI Detect Feedback (Array).vi. The
SI Detect Feedback (Array).vi is the core VI used to detect feedback in a system. The SI Detect
Feedback (Array).vi is located in the labview\vi.lib\addons\System Identification\Data
Preprocess.llb directory.
2.
Function Description
The purpose of this VI is to determine whether data is collected from a closed-loop system using
estimated impulse responses. The SI Detect Feedback (Array).vi uses the least squares method to
estimate impulse responses. Refer to the SI Estimate Impulse Response (Least Squares Array).vi
for more information about estimating impulse responses.
3.
APIs
Para Name
In/Out
Type
Description
stimulus signal
In
1D DBL Array
response signal
In
1D DBL Array
impulse response
In
Cluster
length
t>=0, represented as
N t 0
and N t 0 ,
respectively.
confidence level
In
Numeric
(%)
feedback exists?
Out
Boolean
impulse response
Out
XY graph
graph
4.
Algorithms
1)
Estimate the impulse responses, h(k), as well as the standard deviation, std(k), of the impulse
responses.
2)
In an open-loop system, the current input signal, u(k), and the previous output signal, y(k+j),
j<0, do not correlate with each other. Thus, the impulse response h(j) at negative lags (j<0) is
zero. In a closed-loop system, the previous output signal correlates with the current input
signal because of the feedback path in the system. Hence, some values of the impulse
response at negative lags are nonzero. In other words, when the impulse responses of a
system are nonzero at negative lags, feedback exists in the system.
However, signals might contain noise, so the estimated impulse responses at negative lags
might not be zero even in an open-loop system. When h(j) lies in the range from - N*std(-j)
Algorithm References
Introduction
This section includes the algorithms and references used by the si_AR (FB, LS, YW and PC).vi. The
si_AR (FB, LS, YW and PC).vi is the core VI used to estimate AR models. The si_AR (FB, LS,
YW and PC).vi implements the forward-backward, least-square, Yule-Walker, and principle
components methods for AR model estimation.
2.
Function Description
The Auto-Regression (AR) model is defined as:
Na
A(q) 1 ai q i , e(n) is
(1)
i 1
q i y(n) y(n i)
The purpose of this VI is to estimate A(q) given the signal y(t) so that Equation 1 holds.
3.
APIs
Para Name
In/Out
Type
Description
signal
In
1D DBL Array
AR order
In
I32
method
In
AR
Out
1D DBL Array
std
Out
1D DBL Array
Standard deviations of
covariance
Out
2D DBL Array
Covariance matrix of
noise
Out
1D DBL Array
e(n)
noise
Out
DBL
Variance of e(n)
coefficients
[a1 , a2 ,....,aNa ]
variance
ni.com
Algorithm References
error
4.
Out
I32
Error code
Algorithms
Forward-Backward Method
The AR coefficients can be estimated by solving the following linear equations:
M f
m f
a
M b
mb
(2)
where
y(0)
y(na 1) y(na 2)
y (n )
y(na 1)
y(1)
a
Mf
y( N 2) y( N 3) y( N na 1)
y(2)
y(na )
y(1)
y(2)
y(3)
y(na 1)
Mb
y( N na ) y( N na 1) y( N 1)
y(0)
a1
y(na )
a
y(n 1)
y(1)
2
a
mf
, mb
, a
y( N 1)
y( N na 1)
ana
Least Squares Method
The AR coefficients can be estimated by solving the following linear equations:
y(0)
y(na 1) y(na 2)
a1
y(na )
a
y (n )
y(na 1)
y(1)
a
2 y(na 1)
y( N 1)
y( N 2) y( N 3) y( N na 1) na
(1)
M f
m f
a
M b
mb
(3)
where
Algorithm References
0
y(0)
y(1)
y(0)
0
Mf
y( N na ) y( N na 1) y( N 1)
y(2) y(na )
y(1)
y(2)
y(3) y(na 1)
Mb
0
y( N 1) 0
a1
y(1)
y(0)
a
y(2)
y(1)
2
mf
, mb
, a
ana
y( N 1)
y( N 2)
5.
References
[1] Signal Processing Toolkit User Manual, National Instruments
[2] Guangshu Hu, Digital Signal Processing, Tsing Hua University Press.
Introduction
This section includes the algorithms and references used by the si_AR Burg Method.vi. The si_AR
Burg Method.vi is the core VI used to estimate an AR model using the Burg method. The si_AR
Burg Method.vi is located in the labview\vi.lib\addons\System Identification\Parametric
Estimation Subs.llb directory.
2.
Function Description
The Auto-Regression (AR) model is defined as:
(1)
Na
A(q) 1 ai q i , e(n) is white noise, and y(n) is the signal. q is the backward shift
i 1
q i y(n) y(n i)
The purpose of this VI is to estimate A(q) given the signal y(t) so that Equation 1 holds.
3.
APIs
ni.com
Algorithm References
Para Name
In/Out
Type
Description
stimulus
In
2D DBL Array
In
1D DBL Array
In
Cluster containing A
signal
response
signal
model
parameters
Na
delay. A order is
respectively.
Out
Cluster
-
std
Out
Cluster
Out
DBL
Variance of e(n)
Out
2D DBL Array
Out
1D DBL Array
deviations
noise
variance
covariance
matrix
noise
4.
e(n)
Algorithms
Burg Method [Ref 1, page 363]
According to the definition of AR model, you can define:
Na
r f = E{ e f (n) }
where
x f (n) is the forward prediction vector, e f (n) is the error vector, and a f k are the
coefficients of an AR model.
Correspondingly, you can define:
Na
x b (n na ) akb (k ) x(n na k )
k 1
eb (n) = x(n - na ) - xb (n - na )
2
r b = E{ eb (n) }
Algorithm References
The coefficients
algorithm, where
(2)
am (m) = km
(3)
(4)
N 1
km
2 emf 1 (i)emb 1 (i 1)
, m 1,2,....,na
i m
N 1
| e
i m
f
m1
N 1
(i) | | e
2
i m
b
m1
(i 1) |
(5)
(6)
b
0
References
[1] Guangshu Hu, Digital Signal Processing, Tsing Hua University Press.
Introduction
This section includes the algorithms and references used by the si_Est ARX Model (SISO).vi,
which is the core VI to estimate the coefficients of an ARX (SISO) model using the input-output
data of a system. The si_Est ARX Model (SISO).vi is located in the labview\vi.lib\addons\System
Identification\Parametric Estimation Subs.llb directory.
2.
Function Description
The ARX (SISO) model is described as
where A(q) 1
Na
Nb 1
i 1
i 0
(1)
e(n) are the input, output, and disturbance of a system, respectively. q is the backward shift
operator, which means
q i y(n) y(n i)
The purpose of this VI is to estimate the coefficients
10
ni.com
Algorithm References
3.
APIs
Para Name
In/Out
Type
Description
stimulus
In
1D DBL Array
In
1D DBL Array
In
Cluster containing A
signal
response
signal
model
parameters
Nb ,
and k,
respectively
delay. A order, B
order, and delay are
I32.
ARX model
Out
Cluster
std
Out
Cluster
deviations
noise
coefficients
Out
DBL
Variance of e(n)
Out
2D DBL Array
Out
1D DBL Array
variance
covariance
matrix
noises
4.
e(n)
Algorithms
The least square solution for the ARX model estimation is [Equation 7.34, Ref 1]:
NLS [
N
1 N
T
1 1
(
t
)
(
t
)
]
(t) y(t)
N t 1
N t 1
(2)
where
AX Y
(3)
where
a1
T ( p)
y ( p)
y( p 1)
aNa
( p 1)
A
, X b0 , and Y
y( N )
( N )
bNb 1
5.
References
11
Algorithm References
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the si_Est ARX Model (MISO).vi,
which is the core VI to estimate the coefficients of an ARX (MISO) model based on the inputoutput data of a system. The si_Est ARX Model (MISO).vi is located in the
labview\vi.lib\addons\System Identification\Parametric Estimation Subs.llb directory.
2.
Function Description
An ARX (MISO) model is described as
(1)
Na
Nib 1
b q
j 0
ij
q i y(n) y(n i) .
k is the delay of the system.
3.
APIs
Para Name
In/Out
Type
Description
stimulus
In
2D DBL Array
In
1D DBL Array
In
Cluster containing A
signal
response
signal
model
parameters
Na
delay. A order is
respectively.
Out
Cluster
std
Out
Cluster
Out
DBL
Variance of e(n)
Out
2D DBL Array
deviations
noise
variance
covariance
12
ni.com
Algorithm References
matrix
noise
4.
Out
1D DBL Array
e(n)
Algorithms
Similar to the algorithm of the si_Est ARX Model (SISO).vi.
5.
References
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the si_Est ARX Model (MIMO).vi,
which is the core VI to estimate the coefficients of the an ARX (MIMO) model based on the inputoutput data of a system. The si_Est ARX Model (MIMO).vi is located in the
labview\vi.lib\addons\System Identification\Parametric Estimation Subs.llb directory.
2.
Function Description
The ARX (MIMO) model is described as
Na
A(q) I Ai q
i 1
Nb 1
B(q) Bi q i
i 0
(1)
Ai
and
Bi
are
matrices, N is the number of input channels, M is the number of output channels, k is the delay of
the system, and q is the backward shift operator, which means
q i y(n) y(n i) .
3.
APIs
Para Name
In/Out
Type
Description
stimulus
In
2D DBL Array
In
2D DBL Array
In
Cluster containing A
signal
response
signal
model
parameters
[ N1b , N 2 b ,....,N Nb ] ,
delay. A order is
respectively.
[ N 1a , N 2 a ,....,N Na ] ,
13
Algorithm References
Out
Cluster
std
Out
Cluster
Out
2D DBL Array
Variance of e(n)
Out
3D DBL Array
Out
2D DBL Array
deviations
noise
variance
covariance
matrix
noise
4.
e(n)
Algorithms
Similar to the algorithm of the si_Est ARX Model (SISO).vi.
5.
References
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the si_Est ARMAX Model (SISO).vi,
which is the core VI to estimate the coefficients of an ARMAX (SISO) model based on the inputoutput data of a system. The si_Est ARMAX Model (SISO).vi is located in the
labview\vi.lib\addons\System Identification\Parametric Estimation Subs.llb directory.
2.
Function Description
The ARMAX (SISO) model is described as
(1)
Na
Nb 1
Nc
i 1
i 0
i 1
the input, output, and disturbance of a system, respectively. q is the backward shift operator, which
means
q i y(n) y(n i) .
k is the delay of the system. The purpose of this VI is to estimate the coefficients [a1, a2,....,aN ] ,
a
[b0, b1,....,bN 1] and [c1, c2,....,cN ] based on the input-output data of a system.
b
c
3.
APIs
Para Name
In/Out
Type
Description
14
ni.com
Algorithm References
stimulus
In
1D DBL Array
In
1D DBL Array
In
Cluster containing A
signal
response
signal
model
parameters
order, B order, C
Nb , Nc , and k, respectively.
Out
Cluster
Out
Cluster
model
std
deviations
noise
and C
Out
DBL
Variance of e(n)
Out
2D DBL Array
Out
1D DBL Array
variance
covariance
matrix
noise
4.
e(n)
Algorithms
The multi-stage method is applied to have a coarse estimation for A(q), B(q), and C(q), and
then the Gauss-Newton minimization method is applied to refine the results of A(q), B(q), and
C(q).
(2)
A(q)y(t)=B(q)u(t-k)+ v(t)
Since v(t) here is not white Gaussian noise, the System Identification Toolkit applies the
instrumental variable (IV) method to estimate A(q) and B(q). You then can have
1
v(t ) e(t )
C(q)
National Instruments Corporation
15
(4)
Algorithm References
(6)
Equation 5 represents one form of ARX model. C(q) can be estimated by using ARX model
References
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the si_Est ARMAX Model (MISO).vi,
which is the core VI to estimate the coefficients of an ARMAX (MISO) model based on the inputoutput data of a system. The si_Est ARMAX Model (MISO).vi is located in the
labview\vi.lib\addons\System Identification\Parametric Estimation Subs.llb directory.
2.
Function Description
The ARMAX (MISO) model is described as
Na
a q
i 1
(1)
Nib 1
b q
j 0
ij
Nc
number of input channels, and q is the backward shift operator, which means
q i y(n) y(n i) .
ki
is the delay of the i-th input of the system. The purpose of this VI is to estimate the coefficients
and
APIs
Para Name
In/Out
Type
Description
16
ni.com
Algorithm References
stimulus signal
In
2D DBL Array
response signal
In
1D DBL Array
model
In
Cluster containing A
parameters
Na
[ N1b , N 2 b ,....,N Nb ] , N c ,
and k,
respectively.
B order is 1D I32.
ARMAX model
Out
Cluster
std deviations
Out
Cluster
noise variance
Out
DBL
Variance of e(n)
covariance
Out
2D DBL Array
Out
1D DBL Array
matrix
noise
4.
e(n)
Algorithms
Similar to the algorithm of the si_Est ARMAX Model (SISO).vi.
5.
References
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the si_Est OE Model (SISO).vi, which
is the core VI to estimate the coefficients of an output-error (OE) (SISO) model based on the
input-output data of a system. The si_Est OE Model (SISO).vi is located in the
labview\vi.lib\addons\System Identification\Parametric Estimation Subs.llb directory.
2.
Function Description
An OE (SISO) model is described as
y(n)
where,
Nb 1
B(q) bi q
i 0
B(q)
u(n k ) e(n)
F (q)
, F (q) 1
Nf
fq
i 1
(1)
q i y(n) y(n i) .
17
Algorithm References
k is the delay of the system. The purpose of this VI is to estimate the coefficients
3.
APIs
Para Name
In/Out
Type
Description
stimulus
In
1D DBL Array
In
1D DBL Array
In
signal
response
signal
model
parameters
OE model
Out
Cluster
Nb , N f
and k respectively.
B is [0,...0, b0 , b1 ,....,bNb 1 ] , The
number of zeros at the beginning
equals k. F is
std
Out
Cluster
deviations
noise
[1, f1 , f 2 ,...., f N f ]
coefficients B and F
Out
DBL
Variance of e(n)
Out
2D DBL Array
Out
1D DBL Array
variance
covariance
matrix
noise
4.
e(n)
Algorithms
The multi-stage method is applied to have a coarse estimation for B(q) and F(q), and then the
Gauss-Newton minimization method is applied to refine the results of B(q) and F(q).
(2)
(3)
Equation 3 is in the form of ARX model. Since v(t) here is not white Gaussian noise, the System
Identification Toolkit applies the instrumental variable (IV) method to estimate F(q) and B(q).
18
ni.com
Algorithm References
References
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the si_Est OE Model (MISO).vi,
which is the core VI to estimate the coefficients of an output-error (OE) (MISO) model based on
the input-output data of a system. The si_Est OE Model (MISO).vi is located in the
labview\vi.lib\addons\System Identification\Parametric Estimation Subs.llb directory.
2.
Function Description
An OE (MISO) model is described as
y(n)
B(q)
u(n k ) e(n)
F (q)
(1)
where
Nib 1
b q
j 0
ij
Nif
and
Fi (q) 1 f ij q j
j 1
B (q)
B(q) B1 (q) B2 (q)
[
,
,..., N ] ,
F (q) F1 (q) F2 (q)
FN (q)
u(n k) [u1 (n k1 ),u2 (n k2 ),....,uN (n kN )]T , N is the number of input channels and q
is the backward shift operator, which means:
q i y(n) y(n i) .
ki
is the delay of the i-th input of the system. The purpose of this VI is to estimate the coefficients
APIs
Para Name
stimulus
In/Out
Type
Description
In
2D DBL Array
In
1D DBL Array
signal
response
19
Algorithm References
signal
model
In
parameters
are 1D I32.
OE model
Out
[ N1 f , N 2 f ,....,N Nf ] ,
and k, respectively.
Cluster
B is a matrix as
ki
F is a matrix as
1, f 21, f 22 ,...., f 2 N2 f
...
1, f N1 , f N 2 ,...., f NN
Nf
std deviations
Out
Cluster
noise variance
Out
DBL
Variance of e(n)
covariance
Out
2D DBL Array
Out
1D DBL Array
matrix
noise
4.
e(n)
Algorithms
The multi-stage method is applied to have a coarse estimation for B(q) and F(q), and then the GaussNewton minimization method is applied to refine the results of B(q) and F(q).
Multi-Stage Coarse Estimation
This method is generally described on page 337 of Ref 1. Here is the deduction specific for the OE
model.
By multiplying
F max(q)
(2)
where
(n) F max(q)e(n)
Here
F max(q)
(3)
considered as an ARX (MISO) model. With the ARX (MISO) model estimation, you can have an
20
ni.com
Algorithm References
estimation for
F max(q)
F max(q)
5.
References
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the si_Est BJ Model (SISO).vi, which
is the core VI to estimate the coefficients of a Box-Jenkins (BJ) (SISO) model based on the inputoutput data of a system. The si_Est BJ Model (SISO).vi is located in the
labview\vi.lib\addons\System Identification\Parametric Estimation Subs.llb directory.
2.
Function Description
A BJ (SISO) model is described as
y(n)
where
B(q)
C(q)
u(n k )
e(n)
F (q)
D(q)
(1)
Nb 1
Nf
Nc
Nd
i 0
i 1
i 1
i 1
q i y(n) y(n i) .
k is the delay of the system. The purpose of this function is to estimate the coefficients
and
[d1, d2 ,....,dNd ]
based on the
APIs
Para Name
stimulus
In/Out
Type
Description
In
1D DBL Array
In
1D DBL Array
In
Cluster
signal
response
signal
model
parameters
delay are
21
Nb
Nf
Nc , Nd
and k,
Algorithm References
respectively.
BJ model
Out
Cluster
B is [0,...0, b0 , b1 ,....,bN
b 1
] , The
[1, f1 , f 2 ,...., f N f ] .
Out
Cluster
noise variance
Out
DBL
Variance of e(n)
covariance
Out
2D DBL Array
Out
1D DBL Array
matrix
noise
4.
e(n)
Algorithms
The multi-stage method is applied to have a coarse estimation for B(q), F(q), C(q) and D(q), and
then the Gauss-Newton minimization method is applied to refine the results of B(q), F(q), C(q)
and D(q).
Multi-Stage Coarse Estimation
This method is generally described on page 337 of Ref 1. Here is the deduction specific for BJ
model.
Let
(n) F (q)
C(q)
e(n)
D(q)
(2)
(3)
You then apply the instrumental variable (IV) method to estimate B(q) and F(q) and have the
following equation:
v(n) y(n)
Here, as elsewhere,
B (q)
C(q)
u(n k )
e(n)
D(q)
F (q)
. If
Nc 0 ,
(4)
D(q)v(n) e(n)
(5)
Equation 5 can be treated as an AR model. With the AR model estimation, you have an
estimation for D(q). If
Nc 0 ,
Equation 4 is rewritten as
D(q)
v(n) e(n)
C(q)
22
(6)
ni.com
Algorithm References
e(n) .
Since the
(7)
Equation 7 is one form of the ARX model. C(q) and D(q) can be estimated by using ARX model
estimation methods with
v(n)
and
References
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This document includes the algorithms and references used by the si_Est BJ Model (MISO).vi,
which is the core VI to estimate the coefficients of a Box-Jenkins (BJ) (MISO) model based on the
input-output data of a system. The si_Est BJ Model (MISO).vi is located in the
labview\vi.lib\addons\System Identification\Parametric Estimation Subs.llb directory.
2.
Function Description
A BJ (MISO) model is described as:
B(q)
C(q)
u(n k )
e(n)
F (q)
D(q)
y(n)
(1)
where
Nib 1
b q
j 0
ij
Nif
and
Fi (q) 1 f ij q j
j 1
B (q)
B(q) B1 (q) B2 (q)
[
,
,..., N ] ,
F (q) F1 (q) F2 (q)
FN (q)
C(q) 1 ci q
i 1
Nd
D(q) 1 di q i
i 1
23
Algorithm References
q i y(n) y(n i) .
ki
is the delay of the i-th input of the system. The purpose of this VI is to estimate the coefficients
[bij ] , [ fij ] , [c1 , c2 ,....,cNc ] , and [d1, d2 ,....,d Nd ] based on the input-output data of a system.
3.
APIs
Para Name
stimulus
In/Out
Type
Description
In
2D DBL Array
In
1D DBL Array
In
Cluster
signal
response
signal
model
parameters
delay are
[ N1b , N 2 b ,....,N Nb ] ,
[ N1 f , N 2 f ,....,N Nf ] , N c , N d
[ k1 , k 2 ,....,k N ] ,
BJ model
Out
Cluster
and
respectively.
B is a matrix as
ki
F is a matrix as
1, f 21, f 22 ,...., f 2 N2 f
...
1, f N1 , f N 2 ,...., f NN
Nf
C is
Out
Cluster
noise variance
Out
DBL
covariance
Out
2D DBL Array
Out
1D DBL Array
Variance of e(n)
-
matrix
noise
e(n)
24
ni.com
Algorithm References
4.
Algorithms
The multi-stage method is applied to have a coarse estimation for B(q), F(q), C(q) and D(q), and
then the Gauss-Newton minimization method is applied to refine the results of B(q), F(q), C(q) and
D(q).
Multi-Stage Coarse Estimation
This method is generally described on page 337 of Ref 1. Here is the deduction specific for BJ
model.
By multiplying
F max(q)
(2)
where
(n) F max(q)
Here
F max(q)
C(q)
e(n)
D(q)
considered as an ARX (MISO) model. With the ARX (MISO) model estimation, you can have an
estimation for
F max(q)
F max(q)
can apply the Instrumental Variable method to estimate B(q) and F(q) of Equation 1 and have:
v(n) y(n)
Here, as elsewhere,
B (q)
C(q)
u(n k )
e(n)
D(q)
F (q)
. If
Nc 0 ,
(3)
D(q)v(n) e(n)
(4)
Equation 4 can be treated as an AR model. With the AR model estimation, you have an estimation
for D(q). If
Nc 0 ,
Equation 3 is rewritten as
D(q)
v(n) e(n)
C(q)
Then a high order AR model is applied to estimate
e(n) .
Since
(5)
(6)
Equation 6 is one form of ARX model. Then C(q) and D(q) can be estimated by using ARX model
estimation methods with
v(n)
and
25
Algorithm References
Introduction
This section includes the algorithms and references used by the si_Est GL Model (SISO).vi, which
is the core VI to estimate the coefficients of a general-linear (GL) (SISO) model based on the
input-output data of a system. The si_Est GL Model (SISO).vi is located in the
labview\vi.lib\addons\System Identification\Parametric Estimation Subs.llb.
2.
Function Description
A GL (SISO) model is described as:
A(q) y(n)
where
B(q)
C(q)
u(n k )
e(n)
F (q)
D(q)
(1)
Na
Nb 1
Nf
Nc
i 1
i 0
i 1
i 1
D(q) 1 di q i
i 1
q i y(n) y(n i) .
k is the delay of the system. The purpose of this VI is to estimate the coefficients
,
[a1 , a2 ,....,aNa ]
[b0 , b1 ,....,bNb 1 ]
[ f1 , f 2 ,...., f N f ]
and
[c1 , c2 ,....,cNc ]
APIs
Para Name
stimulus
In/Out
Type
Description
In
1D DBL Array
In
1D DBL Array
In
Cluster
signal
response
signal
model
parameters
GL model
Out
Cluster
Na
Nb
Nf
Nc ,
and k, respectively.
A is
[1, a1 , a2 ,....,aNa ] . B
26
[1, f1 , f 2 ,...., f N f ] .
ni.com
Algorithm References
is
Out
Cluster
noise variance
Out
DBL
Variance of e(n)
covariance
Out
2D DBL Array
Out
1D DBL Array
matrix
noise
4.
e(n)
Algorithms
The multi-stage method is applied to have a coarse estimation for A(q), B(q), F(q), C(q) and D(q),
and then the Gauss-Newton minimization method is applied to refine the results of A(q), B(q), F(q),
C(q) and D(q).
Multi-Stage coarse estimation
This method is generally described on page 337 of Ref 1. Here is the deduction specific for GL
model.
Let
(n) F (q)
C(q)
e(n)
D(q)
(2)
(3)
You then can apply the instrumental variable (IV) method to estimate B(q) and A(q)F(q). Let
(n)
C(q)
e(n) , then Equation 1 becomes
D(q)
A(q) y(n)
B(q)
u(n k ) (n)
F (q)
(4)
You can approximately consider Equation 4 as an ARX model, whose B order is high
(
Nb
Nf
Nc
+ N d ). Then by applying the instrumental variable method, you get A(q). Since
A(q)F(q) and A(q) are known now, you can compute F(q) (=A(q)F(q)/A(q)). So far you already
have estimation for A(q), B(q), and F(q). Substituting them into Equation 1, you have
B (q)
C(q)
v(n) A(q) y(n)
u (n k )
e(n)
D(q)
F (q)
Here, as elsewhere,
. If
Nc 0 ,
D(q)v(n) e(n)
27
(5)
(6)
Algorithm References
Equation 6 can be treated as an AR model. With the AR model estimation, you can have an
estimation for D(q). If
Nc 0 ,
Equation 5 is rewritten as
D(q)
v(n) e(n)
C(q)
Then a high order AR model is applied to estimate
e(n) .
Since
(7)
(8)
Equation 8 is one form of ARX model. C(q) and D(q) can be estimated by using ARX model
estimation methods with
v(n)
and
5.
References
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the si_Est GL Model (MISO).vi,
which is the core VI to estimate the coefficients of a general-linear (GL) (MISO) model based on
the input-output data of a system. The si_Est GL Model (MISO).vi is located in the
labview\vi.lib\addons\System Identification\Parametric Estimation Subs.llb directory.
2.
Function Description
A GL (MISO) model is described as:
A(q) y(n)
where
Na
A(q) 1 ai q i
B(q)
C(q)
u(n k )
e(n)
F (q)
D(q)
(1)
i 1
Nib 1
b q
j 0
ij
Nif
and
Fi (q) 1 f ij q j
j 1
B (q)
B(q) B1 (q) B2 (q)
[
,
,..., N ] ,
F (q) F1 (q) F2 (q)
FN (q)
28
ni.com
Algorithm References
Nd
i 1
i 1
C(q) 1 ci q i , D(q) 1 di q i
q i y(n) y(n i) .
ki
is the delay of the i-th input of the system. The purpose of this VI is to estimate the coefficients
and
[d1 , d2 ,....,d Nd ]
APIs
Para Name
stimulus
In/Out
Type
Description
In
2D DBL Array
In
1D DBL Array
In
signal
response
signal
model
parameters
Na
and
[ k 1 , k 2 ,....,k N ] ,
respectively.
are I32.
GL model
Out
Cluster
A is
[1, a1 , a2 ,....,aNa ] .
B is a matrix as
ki
F is a matrix as
1, f 21, f 22 ,...., f 2 N2 f
...
1, f N1 , f N 2 ,...., f NN
Nf
C is
29
Algorithm References
Out
Cluster
deviations
noise
A, B, F, C, and D
Out
DBL
Variance of e(n)
Out
2D DBL Array
Out
1D DBL Array
variance
covariance
matrix
noise
4.
e(n)
Algorithms
The multi-stage method is applied to have a coarse estimation for A(q), B(q), F(q), C(q) and D(q),
and then the Gauss-Newton minimization method is applied to refine the results of A(q), B(q), F(q),
C(q) and D(q).
Multi-Stage Coarse Estimation
This method is generally described on page 337 of Ref 1. Here is the deduction specific for GL
(MISO) model.
Let
(n) F (q)
and set
C(q)
e(n)
D(q)
where
(2)
F max(q)
A(q)F max(q) .
(3)
(4)
A(q)F max(q) and B(q) as filter and then applying the Instrumental Variable method, you
A(q)
and
B (q)
C(q)
v(n) A(q) y(n)
u (n k )
e(n)
D(q)
F (q)
Here, as elsewhere,
. If
Nc 0 ,
(5)
D(q)v(n) e(n)
(6)
Equation 6 can be treated as an AR model. With the AR model estimation, you have an estimation
for D(q). If
Nc 0 ,
Equation 5 is re-written as
D(q)
v(n) e(n)
C(q)
System Identification Toolkit
30
(7)
ni.com
Algorithm References
e(n) .
Since the
(8)
Equation 8 is one form of ARX model. Then C(q) and D(q) can be estimated by using ARX model
estimation methods with
v(n)
and
References
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the SI Estimate Continuous Transfer
Function Model (SISO Array).vi. The SI Estimate Continuous Transfer Function Model (SISO
Array).vi is the core VI used to estimate continuous transfer functions. The SI Estimate
Continuous Transfer Function Model (SISO Array).vi is located in the
labview\vi.lib\addons\System Identification\Parametric Estimation.llb directory.
2.
Function Description
The continuous transfer function model can be represented as
(1)
where u(k) and y(k) are the input and output of a system, e(k) is the additive noise, and H(s) is
represented by the following equation.
H ( s)
Td
(2)
is the time delay. The purpose
APIs
Para Name
In/Out
Type
Description
stimulus signal
In
1D DBL Array
response signal
In
1D DBL Array
orders of
In
Cluster
31
Algorithm References
transfer function
denominator order
model
delay initial
In
DBL
sampling rate
In
DBL
system model
Out
Object containing
guess (s)
out
model
coefficients of
Out
Cluster
transfer function
Denominator is a0 , a1,...,an
model
delay (s)
4.
Td
Out
DBL
The estimated
Td
Algorithms
This VI uses three steps to estimate the continuous transfer function H(s).
1)
H ' z z Td / dtGz
(3)
v0 v1 z .... vn z n
Gz
u0 u1 z ... un z n
(4)
where
vn
m n.
Equation 4 uses a slightly higher numerator order to include all the possible cases.
The first step is to estimate the discrete transfer function
Transfer Function Model (SISO Array).vi for more information about estimating the discrete
transfer function model.
2)
converted model might have a higher numerator order than m. The SI Estimate Continuous
Transfer Function Model (SISO Array).vi truncates unnecessarily high order coefficients, and the
coefficients you obtain are the initial estimates for minimization in step 3.
3)
Td
ai and bj
32
ni.com
Algorithm References
VN
1 N 1 2
e (k )
N k 1 2
(5)
Introduction
This section includes the algorithms and references used by the SI Estimate Discrete Transfer
Function Model (SISO Array).vi. The SI Estimate Discrete Transfer Function Model (SISO
Array).vi is the core VI used to estimate discrete transfer functions with the direct identification
approach. The SI Estimate Discrete Transfer Function Model (SISO Array).vi is located in the
labview\vi.lib\addons\System Identification\Parametric Estimation.llb directory.
2.
Function Description
The discrete transfer function model can be represented as
(1)
where u(k) and y(k) are the stimulus and response signals, e(k) is the additive noise, and H(z) is
represented by the following equation.
b0 b1 z... bm z m
H ( z)
, m n
a0 a1 z... an z n
(2)
where m is the numerator order and n is the denominator order. The purpose of this VI is to
estimate the transfer function H(z) using the stimulus and response signals of a system.
3.
APIs
Para Name
In/Out
Type
Description
stimulus signal
In
1D DBL Array
response signal
In
1D DBL Array
orders of
In
Cluster
transfer function
denominator order
model
sampling rate
In
DBL
system model
Out
Object containing
out
coefficients of
Out
b0 ,b1,...,bm ,
Denominator is a0 , a1 ,...,an
Cluster
Numerator is
transfer function
model
33
Algorithm References
4.
Algorithm
The model shown in Equation 1 is one type of output-error (OE) model. Therefore, you can
estimate the transfer function H(z) by estimating an equivalent OE model. You can obtain the
order of this OE model by expressing H(z) in terms of the negative power of z. The following
equation shows the relationship between the discrete transfer function and an OE model.
H z 1 z ( nm)
bm ... b1 z1m b0 z m
an ... a1 z1n a0 z n
(3)
Using Equation 3, you can find that the B order, F order, and delay of this equivalent OE model
are m+1, n, and n-m, respectively.
You also can apply the indirect identification and joint input-output identification approaches to
estimate a transfer function model. Refer to the LabVIEW System Identification Toolkit User
Manual for information about the indirect identification and joint input-output identification
approaches. With the joint input-output identification approach, any open-loop model estimation
method can be used to estimate the transfer function between the reference signal and the stimulus
signal. The System Identification Toolkit uses a long FIR model to estimate this transfer function.
[Ref 1]
5.
References
[1] Paul M.J.Van Den Hof, Ruud J.P.Schrama: An Indirect Method for Transfer Function
Estimation from Closed Loop Data, Automatica, Vol. 29, No. 6, 1993, pp. 1523-1527.
Introduction
This section includes the algorithms and references used by the SI Estimate User-Defined Model
(MIMO Array).vi. The SI Estimate User-Defined Model (MIMO Array).vi is the core VI used to
estimate user-defined models. The SI Estimate User-Defined Model (MIMO Array).vi is located in
the labview\vi.lib\addons\System Identification\Parametric Estimation.llb directory.
2.
Function Description
The purpose of this VI is to estimate a user-defined model. You can use a template VI to define a
linear or nonlinear model and then use the SI Estimate User-Defined Model (MIMO Array).vi to
estimate this defined model.
3.
APIs
Para Name
stimulus signal
In/Out
In
Type
Description
2D DBL Array
34
ni.com
Algorithm References
response signal
In
2D DBL Array
user defined
In
Path
model
model to be estimated
variables
In
1D Cluster Array
data
In
Variant
termination
In
Cluster
response
Out
2D DBL Array
obtained by
estimated model
optimized
Out
1D Cluster Array
variables
number of
Out
Numeric
function calls
4.
Algorithm
You can estimate a user-defined model by refining the initial estimates using Gauss-Newton
optimization routines. The purpose of optimization is to minimize the following cost function:
1 N 1
1 N 1
VN e 2 (k , ) yk , yk
N k 1 2
N k 1 2
where
and
(1)
Introduction
This section includes the algorithms and references used by the si_Impulse Realization
(MIMO).vi. The si_Impulse Realization (MIMO).vi is the core VI used to estimate state-space
models from the impulse response of a system. The si_Impulse Realization (MIMO).vi is located
in the labview\vi.lib\addons\System Identification\ Parametric Estimation Subs.llb directory.
2.
Function Description
State-space models in this VI are defined as:
35
Algorithm References
xt 1 Axt But
yt Cxt Dut
(1)
The goal of this VI is to estimate the system matrixes A, B, C, and D using the impulse response
hk , where k>=0.
3.
APIs
Para Name
In/Out
Type
Description
impulse response
In
Cluster
model order
In
I32
length
In
I32
coefficients of state-
Out
Cluster
space model
4.
space model
Algorithms
The impulse response of this system can be computed as
h0 D , hk CAk 1B ,
k>0
(2)
hk 1 hk 2 ... hk j 1 hk j
h
...
k 2 hk 3 ...
...
H ij k hk 3
...
(3)
Hij k Oi Ak Fj
where
Oi
and
Fj
Oi C CA ... CAi1
, F B
T
AB ... A j 1B
Hij 0 Oi Fj ,
(4)
Hij 1 Oi AFj
(5)
(6)
The SVD of
Hij 0 is
H ij 0 U1 U 2 1
V1T
T
T U1 1V1
V2
36
(7)
ni.com
Algorithm References
where
contains the n largest singular values, n is the model order, or number of states, and
Oi U1 12 , Fi 12 V1T
[Ref 2]
(8)
11 2
A 1 2 U1T Hi, j 1V
B 1 2 U1T Hi,1 0
C H1, j 0V1 1
1
2
The above three equations are the Zeiger-McEwen approximate realization algorithm. [Ref 2]
5.
References
[1] Xmath System Identification Module, Part 1
[2] H.P. Zeiger and A.J.McEwen, Approximate Linear Realization of Given Dimension via Hos
Algorithm, IEEE Transactions on Automatic Control, Volume 19, Issue 2, Apr 1974 Page: 153
Introduction
This section includes the algorithms and references used by the si_State Space Model Estimation
(SISO).vi and the si_State Space Model Estimation (MIMO).vi. They are the core VIs to estimate
the coefficients of a state-space model based on the input-output data of a system. The si_State
Space Model Estimation (SISO).vi and the si_State Space Model Estimation (MIMO).vi are
located in the labview\vi.lib\addons\System Identification\Parametric Estimation Subs.llb directory.
2.
Function Description
The state space model in the System Identification Toolkit is defined as
ut
yt .
37
Algorithm References
3.
API
For SISO Case
Para Name
In/Out
Type
Description
stimulus
In
1D DBL Array
response
In
1D DBL Array
# of states
In
I32
Number of states
# p,f
In
I32
Estimation horizon
structure
In
Cluster
selector
SS coef
initial state
Out
Cluster
Out
1D DBL Array
Kalman gain
X0
Out
1D DBL Array
Initial States
In/Out
Type
Description
stimulus
In
2D DBL Array
response
In
2D DBL Array
# of states
In
I32
Number of states
# p,f
In
I32
Estimation horizon
structure
In
Cluster
selector
coefficients
initial state
Out
Cluster
of state-
matrix, A, B, C, and D
space
4.
Out
2D DBL Array
Kalman gain
X0
Out
1D DBL Array
Initial States
Algorithm
A state space model in linear regression form can be represented as
qxt A B xt K
y C D u I et
t
t
Using the least squares criterion and you get the following equation to solve the parameter matrix:
qX t A B X t qX t T T
A B
C D min Y C D U Y X t ,U t
t t
t
Where
Xt T T
X t ,U t
U
t
(1)
From the above equation, you can see that you can estimate the system matrix if you can estimate
the state sequence
Xt .
38
ni.com
Algorithm References
A.
yt
qy
t
Yf
f 1
q yt
yt 1
qyt 1
f 1
q y y1
q 1 yt
q p y
Z p 1 t
q ut
p
q ut
q 1 yt 1
p
q yt 1
q 1ut 1
p
q ut 1
yt N 1
ut
, U qut
f
f 1
q f 1 yt N 1
q uu
ut 1
qut 1
f 1
q ut 1
ut N 1
f 1
q ut N 1
q 1 yt N 2 q 1 yt N 1
q p yt N 2 q p yt N 1
q 1ut N 2 q 1ut N 1
q p ut N 2 q p ut N 1
(2)
Where p is the past horizon, f is the future horizon. By iterating the system equations, you can get
the extended model, represented by the following equation:
Yf f X H f U f Gf E f
Where f is the extended system observability matrix.
0 0 0
D
C
CB
D 0 0
CA
, H CAB CB D 0
f
f
f 1
CA
f
2
CA B CB
0 0 0
I
CK
I
0 0
G f CAK CK I
0
2
CA K CK
0
0
0,
0
D
0
0
0
0
I
The Kalman state X is unknown, but that any Kalman state is estimated from past input and output
data is known, i.e.
U p
X Lu , Ly Lz Z p
Yp
Yf f Lz Z p H f U f Gf E f
Project out
Uf
by multiplying
U f
39
Algorithm References
Yf U f Z Tp z Z p U f Z Tp
Where
z f Lz
and
can be estimated
[U Tf , Z Tp ,Y fT ] .
T
T
z R23
R22 R22
R22
T
f
T
p
T
f
(3)
(4)
weighted
with Z p .
SVD
z Z p USV T
f U1
Xt
by solving z Z p
f X t . That is
X t Tf f
And also the
With the
B.
qXt
(5)
pT z Z p
(6)
Yt U t X t and qXt
Yf Z G f E f
From
U f
T
R33
Q3T G f E f
T
R33
Q3T comes from equation (3).
Transform the innovation process into unit variance white sequence, e1 , i.e.
G f E f G f F E1 f Gf E1 f
T
Gf E1 f R33
Q3T
Because
Q3T
40
Q3T , then
ni.com
Algorithm References
T
Gf R33
Then the Kalman gain K, actually KF, can be identified from the first block column of
as
G f , denoted
Gf 1 ,
F
CKF I
0 F
mm
Gf 1
0 1:m f 1,: KF
f 2
CA F
K KF F 1
C.
(7)
Yf f X H f U f Gf E f
at t = 0,
Y f 0 f X 0 H f U f 0 Gf E1 f 0
You can first compute Yf 0 for zero initial states to obtain
through the estimated system with X 0
By removing
0, , 0.
G Y
1
f
f0
H f U f 0 Gf
f X 0 E1 f 0
(8)
5.
Reference
[1]. Jin Wang and S. Joe Qin. A New Deterministic-Stochastic Subspace Identification Method
Using Principal Component Analysis. TWMCC Technical Report TWMCC-2004-01.
[2]. Peter Van Overschee and Bart De Moor. N4SID : Subspace Algorithms for the Identification of
Combined Deterministic-Stochastic Systems. Automatica, Special Issue on Statistical Signal
Processing & Control, Vol.30, No.1, pp.75-93, 1994.
[3]. Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
si_Correlation Analysis.vi
1.
Introduction
This section includes the algorithms and references used by the si_Correlation Analysis.vi, which
is the core VI to estimate impulse responses of a system. The si_Correlation Analysis.vi is located
in the labview\vi.lib\addons\System Identification\Nonparametric Estimation Subs.llb directory.
41
Algorithm References
2.
Function Description
A discrete-time description of the system with an additive disturbance v(t ) can be represented as:
t 0,1,2,
(1)
k 0
where u(t) and y(t) are the input and output of a system, and v(t) is the disturbance of the system.
g(k) is the impulse response of the system.
The purpose of this VI is to estimate the impulse response, g(k), of the system based on the input
and output of the system.
3.
Function API
Para Name
In/Out
Type
Description
stimulus signal
In
1D DBL Array
response
In
1D DBL Array
AR Order
In
I32
num of points
In
DBL
Impulse
Out
1D DBL Array
whiteness test
Out
XY Graph
rejected
Out
Boolean
signal
Response
reliable
confidence
Out
DBL
level
4.
Ryu ( ) g (k )Ru (k )
(2)
k 0
Ru ( ) E[u(t )u(t )] ( )
where
(3)
(4)
Input Pre-Whitening
42
ni.com
Algorithm References
If the input sequence is not exactly random white noise, large errors exist in the impulse response
calculated from the above correlation analysis method. A pre-whitening FIR filter is applied to
both the input and output sequences to whiten the input sequence. The coefficients of the prewhitening filter are exactly the coefficients of the AR model of the input sequence.
Whiteness Test
The stimulus signal after prewhitening is considered to be white noise. However, if the AR order is
not selected properly, this prewhitening might not be as good as expected. Therefore, you need to
test the whiteness of the prewhitened stimulus signal by computing and plotting the autocorrelation
and 99% confidence level with the System Identification Toolkit. If all Ru ( ),
are within
the confidence region, you have 99% confidence to say that the signal has been prewhitened.
2 / N [Page 512. Whiteness Test, Ref 1]. So the 99% confidence level of each point of
~
Ru ( ), 0 is computed by 2.576 ( 2.576 / N ) . The constant 2.576 is computed as
the following diagram:
5.
Reference
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the SI Estimate Impulse Response
(Least Squares Array).vi. The SI Estimate Impulse Response (Least Squares Array).vi is the core
VI used to calculate an impulse response using the least squares method. The SI Estimate Impulse
Response (Least Squares Array).vi is located in the labview\vi.lib\addons\System
Identification\Nonparametric Estimation.llb directory.
43
Algorithm References
2.
Function Description
A discrete-time description of a system with an additive noise e(n) can be represented as:
yn
hk un k en ,
where u(n) and y(n) are the input and output of a system, and h(k) is the impulse response of the
system. The purpose of this VI is to estimate the impulse response, h(k), using the input and output
signals of the system.
3.
APIs
Para Name
In/Out
Type
Description
stimulus signal
In
1D DBL Array
response signal
In
1D DBL Array
impulse
In
Cluster
response length
impulse
represented as
N t 0
and
N t 0
, respectively
Out
Cluster
Out
Cluster
response
standard
deviation
4.
impulse response
Algorithms
Using Equation 1, you can calculate the following linear equations by truncating the impulse
response to a limited length.
AH E Y
(2)
where
h Nt 0
T ( p)
e( p Nt 0 )
h N 1
T
0
e( p 1 N )
( p 1)
t 0
, E
A
, H
, and
h( Nt 0 1)
(L 1)
e( L 1 Nt 0 )
hNt 0
y( p Nt 0 )
y ( p 1 N )
t 0
Y
y( L 1 Nt 0 )
44
ni.com
Algorithm References
L1 Nt 0
2
e n
(3)
n p Nt 0
You then can deduce that the optimal solution for the above cost function is
H AT A AT Y
(4)
Equation 4 also is known as the least squares method. The covariance matrix of the estimated
impulse response is:
C e AT A
(5)
where C is the covariance matrix and e is the variance of the noise e(n). [Ref 1]
5.
References
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall, Page 284,
Equation 9.18.
si_Frequency Analysis.vi
1.
Introduction
This section includes the algorithms and references used by the si_Frequency Analysis.vi, which is
the core VI to estimate frequency response of a system. The si_ Frequency Analysis.vi is located in
the labview\vi.lib\addons\System Identification\Nonparametric Estimation Subs.llb directory.
2.
Function Description
The discrete-time description of a system can be represented as
Ryu ( ) g (k )Ru (k )
(1)
k 0
where
Ru
Ryu
the input and output of a system. g(k) is the impulse response of the system. By using the Fourier
transform on both sides of Equation 1, you obtain
yu (e j ) G(e j )u (e j )
G(e j ) is known as the frequency response of the system.
(2)
the frequency response of a system based on its measured input and output signal. Refer to the
si_Correlation Analysis.vi for more information about the discrete-time description of a system.
3.
Function API
Para Name
stimulus signal
In/Out
In
Type
1D DBL Array
Description
The input signal of a system
45
Algorithm References
response
In
1D DBL Array
In
I32
In
I32
signal
Window
length
num of freq
bins
sequence
freq in log?
In
Boolean
amplitude in
In
Boolean
dB?
sampling rate
In
DBL
Amplitude
Out
XY Graph
Out
XY Graph
Out
Cluster
Response
Phase
Response
Std deviations
response
4.
Nyu ()
G(e ) N
u ()
(3)
where
N 1
Nyu () 1 Ryu ( )e j
N 0
N 1
uN() 1 Ru ( )e j
N 0
(4)
(5)
However, due to the limit length of the signal to compute Equation 4 and 5, the frequency leakage
of the Fourier transform may corrupt the estimation of frequency response. So normally the
following window is applied to reduce the leakage of the Fourier transform.
yu (e j )
1 N 1
Ryu ( )w( )e j
N 0
u (e j )
w( )
1 N 1
Ru ( )w( )e j
N 0
(6)
(7)
is known as the lag window. The lag window controls the trade-off of the variance and bias
of the frequency response estimation. The narrower the lag window, which is applied on the
46
ni.com
Algorithm References
correlation function in time domain, the more different frequencies will be weighted and then the
estimated frequency response is smooth. However, the estimation may be biased considerably.
Residual Spectrum
The spectrum of the residual of a system can be computed with [Equation 6.78, Ref 1]:
Nyu ()
N
N
v () y () N
u ()
(8)
E | G N (e j ) EG N (e j ) |2
where N is the signal length and
W ( ) 0.75
()
1
W ( ) v
N
u ()
(9)
is the
Reference
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the SI Estimate Partially Known
Continuous Transfer Function Model (General SISO Array).vi. The SI Estimate Partially Known
Continuous Transfer Function Model (General SISO Array).vi is the core VI used to estimate a
partially known state-space model. The SI Estimate Partially Known Continuous Transfer
Function Model (General SISO Array).vi is located in the labview\vi.lib\addons\System
Identification\Partially Known Model Estimation.llb directory.
2.
Function Description
The partially known transfer function model is represented by the following two equations:
K p (1 a1s ... al sl )
1 T s1 2r s / s / w
i
p
j 2
1 T s1 2r s / s / w
i
p
(1)
sh K p (1 a1s ... al sl )
e sTd
j 2
e sTd
(2)
47
Algorithm References
Where
h i 2 j n , where n
K p sTd
e
1 Tp s
(3)
Kp
e sTd
1 2rs / s 2 / 2
3.
(4)
APIs
Para Name
In/Out
Type
Description
stimulus signal
In
1D DBL Array
response signal
In
1D DBL Array
system model in
In
information about a
system model
sampling rate
In
DBL
system model
Out
Object containing
out
model
coefficients of
Out
Cluster
transfer function
model
delay (s)
Out
Numeric
The estimated
den info
Out
Cluster
Td
information
48
ni.com
Algorithm References
static gain
4.
Out
Numeric
The estimated
Kp
Algorithm
You can estimate a partially known continuous transfer function model by refining initial estimates
with Gauss-Newton optimization routines. The purpose of optimization is to minimize the
following cost function:
VN
where
1 N 1 2
1 N 1
e
(
k
,
yk, yk
N k 1 2
N k 1 2
is the variable vector,
(5)
response.
If you have prior knowledge about
K p , Td , Tpi , j , and r j ,
using the SI Create Partially Known Continuous Transfer Function Model VI. If you do not
specify these variables using the SI Create Partially Known Continuous Transfer Function Model
VI, the SI Estimate Partially Known Continuous Transfer Function Model VI can find the initial
estimates for these variables. Refer to the SI Estimate Continuous Transfer Function Model (SISO
Array).vi for more information about finding the initial estimates for the coefficients of a
continuous transfer function model.
Introduction
This section includes the algorithms and references used by the SI Estimate Partially Known StateSpace Model (MIMO Array).vi. The SI Estimate Partially Known State-Space Model (MIMO
Array).vi is the core VI used to estimate partially known state-space models. The SI Estimate
Partially Known State-Space Model (MIMO Array).vi is located in the
labview\vi.lib\addons\System Identification\Partially Known Model Estimation.llb directory.
2.
Function Description
Discrete state-space models can be represented as:
dxt
Axt But Ket
dt
National Instruments Corporation
49
Algorithm References
yt Cxt Dut et
The goal of this VI is to estimate a user-defined state-space model.
3.
APIs
Para Name
In/Out
Type
Description
stimulus signal
In
2D DBL Array
response signal
In
2D DBL Array
system model in
In
sampling rate
In
DBL
Out
Object containing
information about this
model
coefficients of
Out
Cluster
state-space model
variables
D.
Out
1D Cluster Array
4.
Kalman gain
Out
2D DBL Array
initial states
Out
1D DBL Array
Algorithm
You can estimate a partially known state-space model by refining initial estimates using Gauss-Newton
optimization routines. The purpose of optimization is to minimize the following cost function:
1 N 1
1 N 1
VN e2 (k , ) yk , yk
N k 1 2
N k 1 2
where
(1)
response.
You can specify the initial estimates for the variables of a model using the SI Create Partially
Known State-Space Model VI.
Introduction
This section includes the algorithms and references used by the si_Recursive ARMAX Model
(SISO).vi, si_Recursive OE Model (SISO).vi, si_Recursive BJ Model (SISO).vi, and si_Recursive
50
ni.com
Algorithm References
Algorithms
Recursively parametric model estimation is generally divided into two steps. The first step is to
construct and update the state vector of a system. The second step is to optimize parameter values
by using different update methods.
The generalized model can be rewritten as
where
T (n) is the data vector constructed from the past input-output data u(n) and y(n) .
is
(t 1) L(t ) (t )
^
(t ) y(t ) y(t )
L(t )
P(t 1) (t )
(t ) (t )T P(t 1) (t )
1
P(t 1) (t ) (t )T P(t 1)
P(t )
P(t 1)
(t )
(t ) (t )T P(t 1) (t )
t
If you select
R(t ) (k ) T (k )
k 1
page 281, Ref 1], and the recursive schema changes into
^
(t 1) L(t ) (t )
^
(t ) y(t ) y(t )
L(t )
P(t 1) (t )
(t ) (t )T P(t 1) (t )
P(t )
1
P(t 1) (t ) (t )T P(t 1)
P
(
t
1)
(t )
(t ) (t )T P(t 1) (t )
For different model structures, you need to compute different gradient vector (k )
51
Algorithm References
where A(q) 1
Na
a q
i 1
Nb
B(q) bj q
, C(q) 1
j 0
Nc
c q
i 1
which means
q i y(n) y(n i) .
k is the delay of the system.
The general ARMAX (SISO) can be reform as the following linear regressions structure
y(n) T (n)
where
T (n) is the data vector constructed from the past input-output data u(n) and y(n) :
(n) [ y(n 1),..., y(n Na ), u(n k ),..., u(n k N1,b ), (n 1),..., (n Nc )]T .
Algorithm Reference
^
(t, ) [
^
^
^
^
^
^
y(t ),..,
y(t ),
y(t ),...,
y(t ),
y(t )
y(t )]
a1
aNa
b0
bNb
c1
cNc
where
C(q)
^
y(t ) qi y(t ), i 1,..., Na
ai
C(q)
^
y(t ) qiu(t ), i 0,..., Nb
bi
C(q)
^
y(t ) qi (t ), i 0,..., Nc
ci
52
ni.com
Algorithm References
y(n)
where
B(q)
u(n k ) e(n)
F (q)
Nb
Nf
j 0
i 1
y(n) T (n)
where
T (n) is the data vector constructed from the past input-output data u(n) and y(n) :
(n) [u(n k ),..., u(n k Nb )1(n 1), w(n 1),..., w(n N f )]T
where
Algorithm Reference
^
(t, ) [
^
^
^
^
y(t ),...,
y(t ), y(t ),...,
y(t )]
b0
bNb
f1
f N f
where
F (q)
^
y(t ) qiu(t ), i 0,..., Nb
bi
53
Algorithm References
F (q)
^
y(t ) qi w(t ), i 1,..., N f
fi
y(n)
B(q)
C(q)
u(n k )
e(n)
F (q)
D(q)
where
Nb
Nf
Nc
Nd
j 0
i 1
i 1
i 1
q is
q i y(n) y(n i) .
k is the delay of the system.
The general OE(SISO) can be reformed as the following linear regressions structure:
y(n) T (n)
where
T (n) is the data vector constructed from the past input-output data u(n) and y(n) :
54
ni.com
Algorithm References
(t, ) [
^
^
^
^
^
^
^
^
y(t ),...,
y(t ), y(t ),...,
y(t ),
y(t ),...,
y(t ),
y(t ),...,
y(t )]
b0
bNb
f1
f N f
c1
cNc
d1
dNd
where
C(q)F (q)
^
y(t ) D(q)qiu(t ), i 0,..., Nb
bi
C(q)F (q)
^
y(t ) D(q)qi w(t ), i 1,..., N f
fi
C(q)
^
y(t ) qi (t ), i 1,..., Nc
ci
C(q)
^
y(t ) qi v(t ), i 0,..., Nd
di
55
Algorithm References
A(q) y(n)
i 1
Bi (q)
C(q)
ui (n k )
e(n)
Fi (q)
D(q)
Na
A(q) 1 ai q i
where
i 1
Bi (q)
Ni ,b 1
i, j
j 0
, C(q) 1
Nc
c q
i 1
, D(q) 1
Nd
d q
i 1
Ni , f
q i y(n) y(n i) .
k is the delay of the system.
y(n) T (n)
where
T (n) is the data vector constructed from the past input-output data u(n) and y(n) :
wi (t ) fi ,1wi (t 1) fi ,2 wi (t 1) ... fi ,n f 1 wi (t Ni , f )
bi,1ui (t ki ) bi,2ui (t ki 1) ... bi,nb1 ui (t ki Ni,b 1)
56
ni.com
Algorithm References
[a1,..., aNa , b1,0 ,..., b1, N1,b ,..., bnu ,0 ,..., bnu , Nnu ,b , f1,1,..., f1, N1, f ,..., fnu ,1,..., fnu , Nnu , f , c1,..., cNc , d1 ,..., dNd ]T
Algorithm Reference
^
(t, ) [
^
^
y(t ),...,
y(t ),
a1
aNa
^
^
^
^
y(t ),...,
y(t ),...,
y(t ),...,
y(t ),
b1,0
b1, Nb
bnu ,0
bnu , Nnu ,b
^
^
^
^
y(t ),...,
y(t ),...,
y(t ),...,
y(t ),
f1,1
f1, N f
fnu ,1
fnu , Nnu , f
^
^
^
^
y(t ),...,
y(t ),
y(t ),...,
y(t )]
c1
cNc
d1
d Nd
where
C(q)
^
y(t ) D(q)qi y(t ), i 0,..., Na
ai
C(q)F (q)
^
y(t ) D(q)q jui (t ), i 1,..., nu , j 0,..., Ni,b
bi, j
C(q)F (q)
^
y(t ) D(q)q j wi (t ), i 1,..., nu , j 1,..., Ni, f
fi, j
C(q)
^
y(t ) qi (t ), i 1,..., Nc
ci
C(q)
^
y(t ) qi v(t ), i 1,..., Nd
di
57
Algorithm References
C(q)Fi (q) (t, bi, j ) D(q)(t, bi, j ) , (t k, bi, j ) (t, bi, j k ) .If defines
C(q)Fi (q) Gi (q)
That is
C(q)Fi (q) (t, fi, j ) D(q)(t, fi, j ) , (t k, bi, j ) (t, bi, j k ) . If defines
C(q)Fi (q) Gi (q)
That is
3.
Reference
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the si_GL Model Sim (MISO).vi,
si_Std Response To Model.vi, si_ARX Model Sim (MIMO).vi, si_State-Space (MIMO) core.vi
and si_Transfer Function Sim Core.vi, which are the core VIs to simulate defined models in SI
toolkit. These VIs are located in the labview\vi.lib\addons\System Identification\Model Analysis
Subs.llb directory.
58
ni.com
Algorithm References
2. Algorithms
The following are the algorithms for the SI Model Simulation VIs.
A(q) y(n)
i 1
Bi (q)
C(q)
ui (n k )
e(n)
Fi (q)
D(q)
Na
A(q) 1 ai q i
where
i 1
Bi (q)
Ni ,b 1
Nc
Nd
Ni , f
j 0
i 1
i 1
j 1
q i y(n) y(n i) .
k is the delay of the system.
y(n) T (n)
where
T (n) is the data vector constructed from the past input-output data u(n) and y(n) :
wi (t ) fi ,1wi (t 1) fi ,2 wi (t 1) ... fi ,n f 1 wi (t Ni , f )
bi,1ui (t ki ) bi,2ui (t ki 1) ... bi,nb1 ui (t ki Ni,b 1)
[a1,..., aNa , b1,0 ,..., b1, N1,b ,..., bnu ,0 ,..., bnu , Nnu ,b , f1,1,..., f1, N1, f ,..., fnu ,1,..., fnu , Nnu , f , c1,..., cNc , d1 ,..., dNd ]T
Algorithm Reference
59
Algorithm References
following steps:
1) IIR filtering stimulus
coefficients of
D(q)
forward coefficients.
Note: the noise
d -dimension vector
becomes sufficiently
f ( ) f (0 ) f ' (0 )( 0 )
where
with respect to
^
. This means
f (n, ) y(n, )
The covariance matrix of simulated response can be obtained according to the lemma:
60
ni.com
Algorithm References
P is the covariance matrix of model parameter vector . Thus, you need to compute the
derivative matrix of
y' (n, ) .
1 j
y(n)
q y(n) q j ya (n), j 1,..., Na
a j
A(q)
1
y(n)
q jui (n k ) q jubi (n k ), j 0,..., Ni,b
b(i, j )
A(q)Fi (q)
Bi (q)
y(n)
q jui (n k ) q ju fi (n k ), j 1,..., Ni, f
f(i, j )
A(q)Fi (q)Fi (q)
1
y(n)
q j e(n) q j ec (n), j 0,..., Nc
c j
A(q)D(q)
C(q)
y(n)
q j e(n) q j e f (n), j 0,..., Nd
d j
A(q)D(q)D(q)
ya (n) can be obtained by IIR filtering y(n) with -1 being forward coefficients and coefficient of
ubi (n) can be obtained by IIR filtering ui (n) with 1 being forward coefficients and coefficient of
A(q)Fi (q) being backward coefficients.
ec (n) can be obtained by IIR filtering e(n) with 1 being forward coefficients and coefficient of
A(q)D(q) being backward coefficients.
61
Algorithm References
yvec' (n, ) [q1 ya (n),..., q Na ya (n), ub1 (n k ),..., q N1,b ub1 (n k ),..., ubnu (n k ),..., q
q1u f 1 (n),..., q
N1, f
N f
Nnu , f
Nnu ,b
ubnu (n k ),...,
u f nu (n),
e f (n)]
[ ya (n 1),..., ya (n Na ), ub1 (n k ),..., ub1 (n k N1,b ),..., ubnu (n k ),..., ubnu (n k Nnu ,b ),...,
u f 1 (n k 1),..., u f 1 (n k N1, f ),..., u f nu (n k 1),..., u f nu (n k Nnu , f ),
ec (n 1),..., ec (n Nc ), e f (n 1),..., e f (n N f )]
The derivative matrix therefore is defined as
yvec' (1, )
y' (t, )
yvec' ( N , )
Covy(t, )
approximation formula.
The diagonal values of
q 1
as:
u(t )
and
y(t )
are the inputs and outputs of the system, respectively. k is the delay of the
...
a1N y 1 yN y (t 1) a1N y 2 yN y (t 2) ... a1N y n1aN yN y (t n1aN y )
y
b
b111u1 (t k11) b112u1 (t k11 1) ... b11n11b u1 (t k11 n11
1)
b
b121u2 (t k12) b122u2 (t k12 1) ... b12n12b u2 (t k12 n12
1)
...
b1Nu 1uNu (t k1Nu ) b1Nu 2uNu (t k1Nu 1) ... b1Nu n1bN uNu (t k1Nu n1bNu 1)
u
e1 (t )
62
ni.com
Algorithm References
a
y2 (t ) a221y2 (t 1) a222y2 (t 2) ... a22n22a y2 (t n22
)
a
a211y1 (t 1) a212y1 (t 2) ... a21n21a y1 (t n21
)
...
a2 N y 1 yN y (t 1) a2 N y 2 yN y (t 2) ... a2 N y n2aN yN y (t n2aN y )
y
b
b211u1 (t k21) b212u1 (t k21 1) ... b21n21b u1 (t k21 n21
1)
b
b221u2 (t k22) b222u2 (t k22 1) ... b22n12b u2 (t k22 n22
1)
...
b2 Nu 1uNu (t k2 Nu ) b2 Nu 2uNu (t k2 Nu 1) ... b2 Nu n2b N uNu (t k2 Nu n2bNu 1)
u
e2 (t )
...
aN y ( N y 1)1 y( N y 1) (t 1) aN y ( N y 1) 2 y( N y 1) (t 2) ... aN y ( N y 1) nNa
y ( N y 1)
y( N y 1) (t nNa y ( N y 1) )
eN y (t )
From the model definition, the response of
X (t 1) AX (t ) BU (t ) KE(t )
,
Y (t ) CX (t ) DU (t ) E(t )
where
U (t )
and
Y (t )
X (t ) is the state
variables.
63
Algorithm References
u1 (t )
u (t )
2
, t 1, 2,..., N , n is the number of inputs, N is the
U (t ) is input vector. U (t )
u
unu (t )
sample number.
y1 (t )
y (t )
2
, t 1, 2,..., N , n is the number of outputs, N is the
Y (t ) is output vector. Y (t )
y
yny (t )
sample number.
X (t ) is state vector.
e1 (t )
e (t )
2
, t 1,2,..., N
E(t )
eny (t )
x1 (t )
x (t )
2
, t 1, 2,..., N , n is the number of states
X (t )
x
xnx (t )
E(t ) form a recursive relationship. The response of the model is computed in the point-by-point
style in this VI.
si_Transfer Function Sim Core.vi
This VI is the core VI to compute response of a transfer function (MIMO) model based on the
input stimulus. The transfer function (MIMO) model is described as
Y (t ) G( z)U (t )
G( z) is polynomial fraction matrix, defined as
g11 ( z) g1nx ( z)
G( z)
g ( z) g ( z)
ny nx
ny 1
Where
64
ni.com
Algorithm References
j indicates jth
u1 (t )
u (t )
2
, t 1, 2,..., N , n is the number of inputs, N is the
U (t ) is input vector. U (t )
u
unu (t )
sample number.
y1 (t )
y (t )
2
, t 1, 2,..., N , n is the number of outputs, N is the
Y (t ) is output vector. Y (t )
y
yny (t )
sample number.
From the definition of the model, the computation of multiple outputs
Y (t )
gij (z) being forward coefficients and denominator of gij (z) being backward coefficients.
3.
Reference
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the si_GL Model Predict (MISO).vi,
si_SS Model predict vi, and si_SS State Response.vi, which are the core VIs to predict the
response of defined models in SI toolkit. These VIs are located in the
labview\vi.lib\addons\System Identification\Model Analysis Subs.llb directory.
2.
Algorithms
The following are the algorithms for the SI Model Prediction VIs.
65
Algorithm References
A(q) y(t )
i 1
Bi (q)
C(q)
ui (t k )
e(t )
Fi (q)
D(q)
where
Na
A(q) 1 ai q i
Bi (q)
i 1
Ni ,b 1
bi, j q j
Nc
j 0
C(q) 1 ci qi
i 1
Nd
D(q) 1 di qi
i 1
Ni , f
q i y(n) y(n i) .
k is the delay of the system.
Algorithm Reference
According to the definition of the k-step-ahead prediction of
Gi (q)
Bi (q)
C(q)
, i 1,..., Nu , H (q)
A(q)Fi (q)
A(q)D(q)
C(q)
F (q)D(q)
y(t | t k )
u (t )
F (q)C(q) F (q)
^
nu
i 1
H k (q)Bi (q)
j 1,..,nu
j 1,..,nu
j 1,..,nu
66
j 1,..,nu
F (q)
j 1,..,nu
Fi (q)
ni.com
y(t )
Algorithm References
F (q)
(q)
g (q ), n 1,..., k
A(q) D(q) F (q)
C(q)
j 1,..,nu
j 1,..,nu
an IIR filter.
F ( q)
with coefficients of C(q) F (q) being forward coefficients and
A(q) D(q) F (q)
C ( q)
j 1,..,nu
j 1,..,nu
A(q)D(q)
j 1,..,nu
j 1,..,nu
H k (q)Bi (q)
Fi (q)C(q)
C(q)
F (q)
j 1,..,nu
Fj (q)D(q)
j 1,..,nu
j 1,..,nu
of
C(q)
F (q)
j 1,..,nu
coefficients of
j 1,..,nu
Fi (q)
being forward coefficients and
X (t 1) AX (t ) BU (t ) KE(t )
,
Y (t ) CX (t ) DU (t ) E(t )
where
U (t )
and
Y (t )
X (t ) is the state
variables.
u1 (t )
u (t )
2
, t 1, 2,..., N , n is the number of inputs, N is the
U (t ) is the input vector. U (t )
u
unu (t )
sample number.
67
Algorithm References
y1 (t )
y (t )
2
, t 1, 2,..., N , n is the number of outputs, N is
Y (t ) is the output vector. Y (t )
y
yny (t )
the sample number.
e1 (t )
e (t )
2
, t 1,2,..., N
E(t )
eny (t )
x1 (t )
x (t )
2
, t 1, 2,..., N , n is the number of states
X (t )
x
xnx (t )
E(t ) form a recursive relationship. The response of the model is computed in the point-by-point
style in this VI.
Algorithm Reference
One-step Prediction
The conditional expectation of
^
X (t 1) A X (t ) BU (t ) K[Y (t ) C X (t ) DU (t )]
^
Y (t ) C X (t ) DU (t )
This can be reformed as
^
^
U (t )
X (t 1) [ A KC] X (t ) [ B KD, K ][
]
Y (t )
^
Y (t ) C X (t ) DU (t )
From
68
ni.com
Algorithm References
The K-step prediction is also to find the formula between the predicted
Y (t ) and
Y (t k ) CX (t k ) DU (t k ) E(t k )
CAX (t k 1) CBU (t k 1) CBKE(t k 1)
DU (t k ) E(t k )
...
CAk X (t ) CAk 1BU (t ) CAk 2 BU (t 1) ...
CBU (t k 1) DU (t k )
CAk 1KE(t ) CAk 2 KE(t 1) ...
CKE(t k 1) E(t k )
The state space model can be rewritten as the matrix multiplications, as shown by the
following equation:
Y^ (1)
T
X (1 k )
U (1 k ),U (1 k 1),...,U (1)
X (2 k )
^ ^
[CAk 1B, CAk 2 B,..., D] U (2 k ),U (2 k 1),...,U (2)
Y (1) Y (t k ) CAk
X ( N k )
U ( N k ),U ( N k 1),...,U ( N )
Y ( N )
[CA B, CA B,..., D]
U ( N k ),U ( N k 1),...,U ( N )
filtering
69
Algorithm References
X (t 1) AX (t ) BU (t )
X (t ) can be computed by a recursive process.
3.
Reference
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
si_Residual Analysis.vi
1.
Introduction
This section includes algorithms and references used by the si_Residual Analysis.vi, which is the
core VI to calculate the autocorrelation of prediction error and cross-correlation between
prediction error and stimulus signal. The si_Residual Analysis.vi is located in the
labview\vi.lib\addons\System Identification\Model Analysis Subs.llb directory.
2.
Function Description
You can use this VI to calculate the autocorrelation of prediction error and cross-correlation
among the prediction error, stimulus signal, and their confidence interval.
3.
APIs
Para Name
prediction
In/Out
Type
Description
In
1D CDB Array
Prediction error
input signal u
In
2D DBL Array
Input signal
cov(e)
Out
1D CDB Array
error
prediction errors
confidence of
Out
DBL
Confidence of
Out
2D DBL Array
cov(e)
cov(e)
cov(u, e)
Out
1D CDB Array
Confidence of
cov(u, e)
cov(u, e)
4.
cove ( )
The auto-correlation of prediction error is defined as
ReN ( )
1 N
e(t)e(t )
N t 1
70
(1)
ni.com
Algorithm References
cove ( )
where
cove ( )
N ReN ( ) is a zero mean Gaussian distribution with variance 2 [P.512, Ref 1],
2 / N .
Na
where
(2)
1 N 2
e (t) ReN (0) , which is the variance of the prediction error.
N t 1
Confidence of
Since
ReN ( )
denotes the
ReN ( )
is
(3)
is
1
N
(4)
coveu ( )
The cross-correlation between the prediction error, e(t), and the input signal, u(t), is
defined as
ReuN ( )
1 N
e(t)u(t )
N t 1
(5)
coveu ( )
N
e
N
u
R (0)R (0)
Confidence of
Since
ReuN ( )
(6)
coveu ( )
P1
k N
P1 / N .
(k ) RuN (k )
(7)
Na
N
e
P1
N
ReuN ( ) is
(8)
coveu ( )
71
is
System Identification Toolkit
Algorithm References
1
ReN (0)RuN (0)
5.
Na
P1
N
(9)
Reference
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the si_Convert to Transfer Function
Model.vi, which is the core VI to convert defined models into transfer function models. The
si_Convert to Transfer Function Model.vi is located in the labview\vi.lib\addons\System
Identification\Model Conversion Subs.llb directory.
2.
Function Description
You can use this VI to convert an AR, ARX (SISO, MISO, and MIMO), ARMAX (SISO, MISO),
OE (SISO, MISO), BJ (SISO, MISO), general linear model (SISO, MISO), or state-space model
(SISO, MISO, and MIMO) into the corresponding transfer function model.
3.
APIs
Para Name
system model in
In/Out
In
Type
Description
SI object
4.
realization type
In
Text ring
tolerance
In
DBL
Out
SI object
Algorithms
Transfer Function Model Equivalents of General Linear Models
This algorithm is used by the si_GL2TF (MISO).vi.
If the transfer function between i-th input and output of a MISO general linear model is
Bi (q)
a1q1 amqm
Gi (q)
Gi (q)
(1)
as
Gi (q)
a1qm1 qm
qm b1qm1 bm
72
(2)
ni.com
Algorithm References
The transfer function between the noise and output of a MISO general linear model is
H (q)
C(q)
D(q)
(3)
(4)
( zI ) X ( z) AX ( z) BU ( z) KE( z)
Y ( z) CX ( z) DU ( z) E( z)
(5)
So
G( z)
Y ( z)
C( zI A)1 B D
U ( z)
(6)
H ( z)
Y ( z)
C( zI A)1 K I
E( z )
(7)
Further [Ref 1]
where
C( zI A)1 B
and
The equivalent transfer function representation for the determinant part can be presented as
G( z) C( zI A)1 B D
(8)
B is for one input. Each row vector of C is for one output. By selecting
B and row by row of C , MIMO system of G( z) can be computed channel
by channel.
The equivalent transfer function representation of the noise part is
H ( z) C( zI A)1 K I
5.
(9)
Reference
73
Algorithm References
Introduction
This section includes the algorithms and references used by the si_Convert to State-Space
Model.vi, which is the core VIs to convert defined models into state-space models. The si_Convert
to State-Space Model.vi is located in the labview\vi.lib\addons\System Identification\Model
Conversion Subs.llb directory.
2.
Function Description
You can use this VI is to convert an AR, ARX (SISO, MISO, and MIMO), ARMAX (SISO,
MISO), OE (SISO, MISO), BJ (SISO, MISO), general linear model (SISO, MISO), transfer
function (SISO, MISO and MIMO), or pole-zero model (SISO, MISO and MIMO) into the
equivalent state-space model.
3.
APIs
Para Name
system model in
In/Out
In
Type
Description
SI object
4.
realization type
In
Text ring
tolerance
In
DBL
Out
SI object
Algorithms
State-Space Model Equivalents of Transfer Function Models
This algorithm is used by the si_TF2SS Realization (MIMO).vi
The transfer function representation of a given MIMO system is defined by the following
polynomial fraction matrix:
G(q)
g (q) g (q)
ny nu
ny 1
Where
74
ni.com
Algorithm References
G( z) can be reformed as
G(q)
where
1
An qn An1qn1 ... Aq
A0
1
m
m1
1
Bmq Bm1q ... B1q B0
The equivalent observable state-space realization of the transfer function model can be performed
as
Am1 1 0 ... 0
A
0 1 ... 0
A m2 ...
A0 0 0 ... 0
Bm1 Am1Bm
B A B
B m2 m2 m
B0 A0 Bm
C 1
D Bm
0 0
0 0
Ey(t) + A1 y(t - 1) + ... + ANa y(t - Na ) = B0u(t - k ) + ... + BNb u(t - k - Nb ) + Ee(t )
Where
y(t ) is output vector [ y1 (t), y2 (t),..., yny (t)]T , u(t ) is input vector
[u1 (t ), u2 (t ),..., unu (t )]T , E is identity matrix, A1,..., ANa is ny ny matrix, B0 ,..., BNb is
Reference
[1] T. Kailath, Linear Systems, Prentice Hall, Prentice Hall, 1980.
75
Algorithm References
Introduction
This section includes the algorithms and references used by the si_Convert to Pole-Zero Model.vi,
which is the core VI to convert defined models into pole-zero models. the si_Convert to Pole-Zero
Model.vi is located in the labview\vi.lib\addons\System Identification\Model Conversion Subs.llb
directory.
2.
Function Description
You can use this VI is to convert an AR, ARX (SISO, MISO, and MIMO), ARMAX (SISO,
MISO), OE (SISO, MISO), BJ (SISO, MISO), general linear model (SISO, MISO), state-space
model (SISO, MISO, and MIMO), or transfer function model (SISO, MISO, and MIMO) into the
equivalent pole-zero model.
3.
APIs
Para Name
In/Out
system model in
In
Type
Description
SI object
4.
realization type
In
Text ring
tolerance
In
DBL
Out
SI object
Algorithms
This algorithm is used by the si_TF2ZP (MIMO).vi and the si_TF2ZP plus STD (MIMO).vi.
The pole-zero model representations of a given MIMO system is defined by the following
polynomial fraction matrix:
G(q)
g (q) g (q)
ny nu
ny 1
where
gij (q) is the polynomial fraction in delay operator q1 , represented in terms of the zeros,
poles, and the transfer function gain K , where the static gain K s can be computed from
Ks G(1) .
n1
gij (q)
K (q qi )
i 0
m1
(q q )
i 0
76
ni.com
Algorithm References
You then need to compute the polynomial roots of transfer function polynomials to convert a
transfer function model into a pole-zero model.
The Standard Deviation of Zeros and Poles
Refer to the si_Std Root to Polynomial.vi for more information about the implementing algorithm.
The si_Std Root to Polynomial.vi is a core VI used by the SI Poles-Zeros Plot.vi.
5.
Reference
[1] T. Kailath, Linear Systems, Prentice Hall, Prentice Hall, 1980.
si_Std Freq.vi
1.
Introduction
This section includes the algorithms and references used by the si_Std Freq.vi, which is the core
VI to estimate standard deviation of frequency response. The si_Std Freq.vi is located in the
labview\vi.lib\addons\System Identification\Model Presentation Subs.llb directory.
2.
Function Description
You can use this VI to compute the confidence region of the Bode and Nyquist plots. The
frequency response function, G(e
coefficients
3.
G e j
G(e j ) .
APIs
Para Name
In/Out
Type
Description
freq response
In
1D CDB Array
Frequency response
In
1D DBL Array
transfer
In
Cluster
containing
Alpha, Beta 1
and Beta 2.
function
G(e j )
Alpha, Beta 1
77
Algorithm References
In
2D DBL Array
matrix
coefficients N
standard
Out
deviation
Cluster
containing the
standard
deviation of the
magnitude and
phase response
4.
Algorithms
Since all the other polynomial models are converted to general-linear models when computing
frequency response, this section discusses only the computation formula for frequency response of
general-linear models.
Frequency Response of General Linear Model
The general-linear model (SISO) is defined as
A(q) y(t )
B(q)
C(q)
u(t )
e(t )
F (q)
D(q)
(1)
The frequency response between the input and output of the system is
G(e j )
B(e j )
A(e j )F (e j )
(2)
A(q) y(t )
i 1
Bi (q)
C(q)
ui (t )
e(t )
Fi (q)
D(q)
(3)
Gi (e j )
Bi (e j )
A(e j )Fi (e j )
(4)
be an estimate of the coefficients of the polynomial model. The mean and covariance
matrix of
is
asymptotically as
f ( ) f (0 ) f ' (0 )( 0 )
78
ni.com
Algorithm References
where
with respect to
^
. This means
(5)
G(e j ) .
f (0 )
is the
approximation formula, the covariance matrix of magnitude and phase of frequency response
function
G(e j )
are
(6)
and
Since
and
G(e j )
(7)
are known, you can apply Equation 6 and 7 to compute the standard
deviation of magnitude and phase of frequency response if you know the derivative of the
magnitude and phase of
G(e j )
Derivative of
with respect to
. To derive
| G(e j ) |
and
The derivative of
with respect to
at frequency
is a vector defined as
G(e j1 ) [ G(e j1 ),
G(e j1 ),...,
G(e j1 ),
a1
a2
aNa
G(e j1 ),
G(e j1 ),...,
G(e j1 ),
b1
b2
bNb
(7)
G(e j1 ) j1 k
G(e j1 )
(e ) , k 1,2,..., Na ,
ak
A(e j1 )
G(e j1 ) j1 k
G(e j1 )
(e ) , k 1,2,..., Nb ,
bk
B(e j1 )
79
Algorithm References
G(e j1 ) j1 k
j1
G(e )
(e ) , k 1,2,..., N f .
fk
F (e j1 )
The derivative of
G(e j )
is defined as
j1
G(e )
j2
G(e )
G(e j )
....
jN
G(e )
Since
(8)
is
j
j
j
j
(G(e )). G(e ) (G(e )). G(e )
=
(G(e j )). G(e j )
j
G(e )
1
( G(e j ) )
2* G(e j )
where
G(e j )
derivative of
is the conjugate of
arg(G(e j ))
G(e j ) .
Because
(9)
is
| G(e j ) |
and
| G(e j ) |
5.
(10)
and
| G(e j ) |
arg G(e j ) .
).
Reference
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the si_Std Root to Polynomial.vi,
which is the core VI to calculate the confidence region of the roots of a polynomial. The si_Std
80
ni.com
Algorithm References
Function Description
You can use this VI to calculate the confidence region of the roots of a polynomial based on its
coefficients and the covariance of the coefficients.
3.
APIs
Para Name
In/Out
polynomial
Type
Description
In
1D DBL Array
In
2D DBL Array
coefficients
covariance
coefficients
std range
In
DBL
Roots
Out
1D CDB Array
Out
1D Array of
Cluster
Out
1D DBL Array
format)
4.
Algorithms
Variance of the Transform [Page 292, 9-56, Ref 1]
Let the
d -dimension vector
f ( ) f (0 ) f ' (0 )( 0 )
where
with respect to
^
. This means
^
81
Algorithm References
Then by using the si_Variance of Real and Imaginary of Roots.vi, you can get the variance of the
real part and the imaginary part and their covariance for each root.
Set the variances you obtained as the input of the si_Confidence Region of Polynomial.vi, you can
get the confidence region of each roots.
5.
References
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This section includes the algorithms and references used by the si_Polynomial Root Derivative.vi,
which is the core VI to calculate the derivative of roots of a polynomial with respect to the
polynomial coefficients. The si_Polynomial Root Derivative.vi is located in the
labview\vi.lib\addons\System Identification\Model Presentation Subs.llb directory.
2.
Function Description
Given a polynomial as represented by the following equation:
(1)
The purpose of this VI is to calculate the derivative of the roots with respective to the coefficients.
x1
x1
a a
n
0
xn xn
an
an
where
xi
xi
a
k
3.
ai
(2)
APIs
Para Name
In/Out
Type
Description
coefficients
In
1D DBL Array
dx/da
Out
2D CDB Array
4.
Algorithms
82
ni.com
Algorithm References
1 for Equation 1,
(3)
b1 (1) xi
i
b x x
2
i j
i j
bn (1)n x1...xn
(4)
or
bp (1) p
k1
...xk p , p 1,2,..., n
(5)
k1 ...k p
ki k j
b1
1, q 1,2,..., n
xq
(6)
and
bp
(1) p xk1 ...xk p1
xq
k1 ...k p1
ki k j
ki q
p
(1) xk1 ...xk p1 xq xk1 ...xk p2
k1...k p1
.
k1 ...k p2
ki k j
ki k j
ki q
b
(1) p (1) p1 bp1 (1) p1 xq p1
xq
bp1 xq
(7)
bp1
xq
(9)
(10)
where
bj
aj
, j 1,2,..., n .
a0
83
Algorithm References
xi
x
1 n
2 ak i
a0
a0 k 1 bk
xi 1 xi
, k 1, 2,..., n
ak a0 bk
(11)
(12)
Introduction
This section includes the algorithms and references used by the si_Variance of Real and Imaginary
of Roots.vi, which is the core VI to calculate the variance of real part and imaginary part of
polynomial roots of a polynomial and their covariance. The si_Variance of Real and Imaginary of
Roots.vi is located in the labview\vi.lib\addons\System Identification\Model Presentation Subs.llb
directory.
2.
Function Description
If the variance and covariance of a complex number and its conjugate are known, you can deduce
the variance of the real and imaginary parts and the covariance between the real and imaginary
parts. You can use this VI to calculate the variance of real and imaginary parts, the covariance of
real and imaginary parts if the roots of a polynomial are known, and the covariance matrix of the
roots. Note that the polynomial roots are required to be real or in conjugate pairs in this VI.
3.
APIs
Para Name
In/Out
Type
Description
polynomial roots
In
1D CDB Array
Covariance
In
2D CDB Array
Out
1D CDB Array
format)
Polynomial Roots
Out
1D CDB Array
Re_Variance
Out
1D DBL Array
Im_Variance
Out
1D DBL Array
Re_Im_Covariance
Out
1D DBL Array
dup
of the roots
4.
Algorithms
For a complex number,
can be written as
b . Then, z
E( z) E(a) E(b)i ,
where
84
ni.com
Algorithm References
Thus,
D( z)
and
Cov(a, b)
and
(1)
b.
(2)
1
Cov(a, b) (D( z))
2
(3)
1
D(a) (Cov( z, z) (D( z)))
2
If
1
D(b) (Cov( z, z) (D( z)))
2
z is a real number, you can treat z as a complex number with D(b) 0
(4)
(5)
and
Cov(a, b) 0 .
D(a) D( z)
(6)
D(b) 0
(7)
Cov(a, b) 0
(8)
Introduction
This section includes the algorithms and references used by the si_Confidence Region of
Polynomial.vi, which is the core VI to calculate the confidence regions of roots of a polynomial.
The si_ Confidence Region of Polynomial.vi is located in the labview\vi.lib\addons\System
Identification\Model Presentation Subs.llb directory.
2.
Function Description
If you have knowledge about the variance and covariance of the real part and imaginary part of a
complex number, you can draw the confidence region of the complex number as an ellipse, or an
interval in the degenerate form, on the plane. Similarly, for a polynomial, if you know all the
above parameters of its roots, you can draw several ellipses on the plane to show the confidence
region of its roots. You can use this VI to calculate the bound of these ellipses.
3.
APIs
85
Algorithm References
Para Name
polynomial
In/Out
Type
Description
In
1D CDB Array
var_Re
In
1D DBL Array
var_Im
In
1D DBL Array
covar_ReIm
In
1D DBL Array
roots
roots
num of points
In
I32
std range
In
BDL
Out
1D Array of
Cluster
4.
Algorithms
For a complex number,
X , you can denote its real part and imaginary part as x1 and x2 .
1 2 , where 0 1 .
If one of
and
(1, 2 )
equal 0.
Otherwise, you can consider the distribution of
P( x1, x2 )
x1
and
x2
z
exp
2
2 1 2
21 2 1
1
(1)
where
2
2
x1 1 2 x1 1 x2 2 x2 2
12
1 2
22
(2)
You can move the average point to zero and rotate the axis as shown in the following equation by
coordinate converting:
x1 1 r1 cos r2 sin
x2 2 r1 sin r2 cos
Then,
86
ni.com
Algorithm References
12
1 2
22
2
2
sin 2 cos sin cos 2
2
r2
2
1 2
2
1
Let
(3)
2 1
(4)
The constant before the exponential function is not necessary to know, but you must know it is
also a normal distribution with
cos2
12
1
2 cos sin
1 2
1 2
sin2
22
(5)
is the variance.
So, in this direction, (cos ,sin ) , the confidence region is [-std range* , std range* ]. Thus,
where
you have a point on the ellipse as (std range* * cos + 1 , std range* * sin + 2 ). You can
get the ellipse by connecting all these points.
For a polynomial, you can handle all its roots following the above method.
Introduction
This section includes the algorithms and references used by the SI Average Theta and
Covariance.vi. The SI Average Theta and Covariance.vi is the core VI used to merge general linear
polynomial models. The SI Average Theta and Covariance.vi is located in the
labview\vi.lib\addons\System Identification\Model Merge.llb directory.
2.
Function Description
The purpose of this function is to merge general-linear polynomial models estimated from
different experimental data sets. The models to be merged must be of the same model type and
must have the same model orders.
87
Algorithm References
3.
APIs
Para Name
In/Out
Type
Description
theta 1
In
2D DBL Array
covariance 1
In
3D DBL Array
theta 2
In
2D DBL Array
covariance 2
In
3D DBL Array
theta
Out
2D DBL Array
covariance
Out
3D DBL Array
4.
Algorithms
This VI uses
to denote the
corresponding covariance matrix. The optimal way to combine these estimates is demonstrated by
the following equation: [Ref 1]
2
C C i
i1
1 1
5.
i
1
CC i
(1)
i 1
References
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall, Page 465,
Equation 14.15.
Introduction
This section includes the algorithms and references used by the SI Generate Pseudo-Random
Binary Sequence.vi. The SI Generate Pseudo-Random Binary Sequence.vi is the core VI used to
generate pseudo-random binary sequences (PRBS). The SI Generate Pseudo-Random Binary
Sequence.vi is located in the labview\vi.lib\addons\System Identification\Utility.llb directory.
2.
Function Description
The purpose of this function is to generate a PRBS to be used as the stimulus signal of a system.
3.
APIs
Para Name
In/Out
Type
Description
samples
In
I64
polynomial order
In
I32
seed
In
I64
88
ni.com
Algorithm References
4.
upsampling factor
In
I32
PRBS
Out
1D U8 Array
Algorithms
High frequency fluctuations can be harmful to devices in the real-world industrial environment.
Therefore, a stimulus signal whose power spectrum is similar to a lowpass filter is often desirable.
You can obtain a lowpass PRBS by upsampling the original PRBS, also known as the original
maximum length sequence, whose spectrum is uniform over the entire frequency range. [Ref 1]
n
where n is the upsampling factor,
Tclk
Tclk
Ts
(1)
5.
Reference
[1] Yucai Zhu, Multivariable System Identification for Process Control, Elsevier Science, 2001,
Page 43.
Introduction
This section summarizes the algorithms of the Gauss-Newton minimization method. You can
use the Gauss-Newton minimization method to refine the estimation of continuous transfer
function models, user-defined models, partially known models, and polynomial models such
as the ARMAX, output-error (OE), Box-Jenkins (BJ), and general-linear models.
2.
Problem to Solve
The purpose of model estimation is to identify the model coefficients by minimizing the mean
square error,
1 N 1 2
(t, )
N t 1 2
(1)
In this equation, all the coefficients to be estimated are combined together as a vector.
(t , )
is the error
y (t, ) y(t ) ,
You can use some methods, such as the multi-stage method for polynomial models, to get a
coarse estimation of
Algorithm References
(i1) (i ) f (i )
where
(2)
f (i )
f ( ) as
f ( ) V ''( ) V '( )
1
(3)
where
1 N
(t, ) (t, )
N t 1
(4)
1 N
(t, ) T (t, )
N t 1
(5)
V '( )
and
V ''( )
t,
dyt,
dt
(6)
T denotes transposing. By inserting Equations 4 and 5 into 3, you obtain the following
equation:
N
f ( )
(t, ) (t, )
t 1
N
(t, )
(t, )
t 1
(1, )
(2, )
(1, ) (2, ) ... ( N , ) ...
( N , )
T (1, )
T
(2, )
(1,
(2,
)
...
(
N
,
...
T
( N , )
T (1, )
T
(2, )
...
T
( N , )
You can evaluate
f ( )
(1, )
(2, )
...
( N , )
(7)
90
ni.com
Algorithm References
T (1, )
(1, )
T
(2, ) f ( ) (2, )
...
...
T
( N , )
( N , )
(8)
(t, )
1
[ y(t 1)... y(t Na ) u(t 0)...u(t Nb 1)
C(q)
(t 1)... (t Nc )]T
Gradient of OE Model [Page 330, Equation 10.54b,e, Ref 1]
1 k
Bq
q u(t ),
q k ut , t 1,...,N
F qF q
F q
t,
D(q)
D(q) k
qk u(t ),
q w(t ),
C(q) F (q)
C(q) F (q)
1
1 k
qk (t ),
q v(t )], t 1,..., N
C(q))
C(q))
(t, ) [
(t, ) [
D(q) k
D(q)
D(q) k
q y(t ),
qk u(t ),
q w(t ),
C(q)
C(q) F (q)
C(q) F (q)
1
1 k
qk (t ),
q v(t )], t 1,..., N
C(q))
C(q))
yt, d yt, d
2 d
d *DIFF _ 2
t,
where
4.
DIFF _ 2 = 3.2057501263e6
91
Algorithm References
(n) | (n) |
(n) (n)
(n)
1.5 .
1 1.8
MAD* 1.483263287118
where MAD = the median of { | (t ) ~ | } with ~ as the median of (t ) [Page 483, Ref 1].
The constant 1.483263287118 is obtained with
5.
Reference
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
Introduction
This document includes the algorithm summary on the instrumental variable method to identify
an ARX model.
2.
Problem to Solve
An ARX model can be defined as
Algorithms
The instrumental variable method suggests the solution for the ARX model as [Eq. 7.118, P. 224,
Ref 1]:
NLS [
where
N
1 N
T
1 1
(
t
)
(
t
)
]
(t) y(t)
N t 1
N t 1
(1)
92
ni.com
Algorithm References
For an open-loop system, the input sequence of the system, or its filtered version, is often a good
choice of instrumental variables. One of the choices of instrumental variables is
x(t )
(2)
(3)
where
(4)
(5)
In practice, you can use the least squares method to estimate the coefficients of an ARX model.
You then can use the estimated A(q) and B(q) as N(q) and M(q), respectively, to have an
instrumental variable estimation of the ARX model with Equation 1.
4.
Reference
[1] Ljung, L. 1999. System Identification Theory for the User. 2nd ed. Prentice Hall.
[2] National Instruments xMath User Manual.
Introduction
This section includes the algorithms and references used by the SI Estimate Discrete Transfer
Function Model from FRF (SISO arbitrary).vi. The SI Estimate Discrete Transfer Function Model
from FRF (SISO arbitrary).vi is the core VI used to estimate discrete transfer functions from FRF
data. The SI Estimate Discrete Transfer Function Model from FRF (SISO arbitrary).vi is located in
the labview\vi.lib\addons\System Identification\Frequency Domain Estimation.llb directory.
2.
Function Description
The discrete transfer function model can be represented as
y( k ) H( z )u( k ) e( k ) ,
(1)
where u(k) and y(k) are the stimulus and response signals of a system, e(k) is the additive noise,
and H(z) is represented by the following equation.
H( z )
b0 b1z... bm z
a0 a1z... an z
, mn
(2)
93
Algorithm References
3.
APIs
Para Name
In/Out
Type
Description
FRF magnitude
In
Cluster
FRF phase
In
Cluster
FRF format
In
Cluster
orders of
In
Cluster
transfer function
denominator order
model
FRF weight
In
1D CDB Array
sampling rate
In
DBL
system model
Out
Object containing
out
information about
this model
coefficients of
Out
Cluster
transfer function
model
4.
Algorithms
This VI uses the polynomial Matrix Fraction Description (MFD) to represent the transfer function
model. The polynomial MFD also estimates MIMO models. This estimation method is a
multivariable least squares method in the frequency domain.
For a set of observed FRF data G( ) , evaluated at N frequency points
j
p r
i
for j 1,...,N
G( e ) G( j ) C
(3)
The aim of the identification procedure is to find a linear time-invariant (LTI) model P( ) that
approximates the above FRF data. The model P( ) is parameterized by either a left or right
polynomial MFD, where collects all the real-valued parameters of the polynomial MFD.
The model P( ) approximates the data G( ) by minimizing the following equation.
j
J( )
trE( j , )E * ( j , ) E( ) 2F
N
(4)
j 1
: argminJ( )
(5)
Focusing on the left-hand side of the polynomial MFD, the model P( ) can be parameterized as
94
ni.com
Algorithm References
P( z , ) A( z , ) B( z , )
(6)
where A and B denote parameterized polynomial matrices in terms of z-1. Note that
P( j , ) P( z , )
(7)
i jT
z e
For a model with r inputs and p outputs, the following equations represent A and B, respectively:
1
A( z , ) I p p
where A
p p
pr
(8)
k 1
d m 1
k d
Ak z
B( z , )
where B
Bk z
(9)
and d denotes the number of leading zero matrix coefficients. Because each
input-output pair defines a SISO LTI system, Equations 8 and 9 are scalar polynomials.
When the system is defined by scalar polynomials, you can determine dij by the number of time
delays from the j-th input to the i-th output. These pair-wise parameters, dij, mij, and nij are
structural parameters and are set to d:=min{dij}, m:=max{mij}, and n:=max{nij} for Equations 8
and 9 in the general MIMO case.
Then, the error E( , ) is defined by the following:
j
1
1
1
1
E( j , ) A( z , ) A( z , )G( j ) B( z , ) i T
z e j
(9)
From here, a multivariable case SK-iteration can be invoked to actually minimize the error. If
necessary, a subsequent GN-optimization can be utilized by using the SK-iteration result as the
initial estimate.
Because this VI applies to SISO systems only, the above algorithm is used in a degenerated case,
where r=p=1.
5.
References
[1] R. A. Callafon, D. de Roover, and P. M. J. Van den Hof, Multivariable least squares frequency
domain identification using polynomial matrix fraction descriptions, in Proc. 35th Int. Conf.
Decision and Control, Kobe, Japan, Dec. 1996, pp. 2030-2035.
95
Algorithm References
2. Function Description
The continuous transfer function model can be represented as
(1)
where u(k) and y(k) are the input and output of a system, e(k) is the additive noise, and H(s) is
represented by the following equation.
H ( s)
b0 b1s... b j s ... bm s
a0 a1s... ai s ... an s
,m<n
(2)
where m is the numerator order and n is the denominator order. The purpose of this VI is to
estimate the transfer function H(s) by using the FRF of a system.
3. APIs
Para Name
In/Out
Type
Description
FRF magnitude
In
Cluster
FRF phase
In
Cluster
FRF format
In
Cluster
orders of
In
Cluster
transfer function
denominator order
model
FRF weight
In
1D CDB Array
system model
Out
out
Object containing
information about this
model
coefficients of
Out
Cluster
transfer function
model
4. Algorithms
96
ni.com
Algorithm References
The algorithm used in this VI is a least squares method. To have better numerical properties, the
basis polynomials are chosen to be the Chebyshev polynomials[1] instead of the natural basis
polynomials {1, s, s2, , sn}.
Chebyshev polynomials are defined in many ways. One way by recursion is as follows:
T0(s) = 1
T1(s) = s
Tn+1(s) = 2sTn(x) Tn-1(s)
where the resulting basis polynomials are {T0, T1, T2, , Tn}.
Now you can define H(s) as:
H( s )
(3)
Suppose you obtain a set of observed FRF data G( ) , evaluated at N frequency points .
j
G( ) G( ) C , for j 1,...N
j
j
By evaluating H(s) at the same set of N frequency points , you reach a standard setup for a least
j
squares problem:
N
H( , j ) G( j )
argmin
j 1
where H( , ) H( s )
j
siw j
and a0
a1
... an b0 b1
c
... bm .
After obtaining , the coefficients under the Chebyshev basis, you can insert them back into
Equation 3 so as to obtain the coefficients {a0, a1, , an, b0, b1, , bm}, which are under the natural
basis.
5. References
[1] Vetterling, William T., William H. Press, Saul A. Teukolsky, and Brian P. Flannery. 1992.
Numerical Recipes in C: The Art of Scientific Computing. Cambridge University Press
[2] Xmath System Identification Module, Part 1
Introduction
This section includes the algorithms and references used by the SI Estimate State-Space Model
from FRF.vi. The SI Estimate Discrete State-Space Model from FRF (MIMO arbitrary).vi is the
core VI used to estimate a discrete state-space model from FRF data. The SI Estimate State-Space
97
Algorithm References
Function Description
The discrete state space models in this VI are defined as
x( k 1) Ax( k ) Bu( k )
y( k ) Cx( k ) Du( k ) n( k )
m
(1)
system. n( k ) is the noise term which is assumed to be independent of the input sequence
u(k). By using the Fourier transform on both sides of both equations in Equation 1, you obtain the
following equations.
i
e X ( ) AX ( ) BU( )
Y ( ) CX( ) DU( ) N( )
where Y(), U(), N(), and X() are the transformed output, input, noise, and state,
respectively. By eliminating the state, you obtain the following equation.
Y ( ) G( e
i
where G( e
) G( z )
z e
D C( zI A ) B
z e
)U( ) N( )
and is the frequency response function
3.
) of the system.
APIs
Para Name
In/Out
Type
Description
FRF magnitude
In
Cluster
FRF phase
In
Cluster
FRF format
In
Cluster
number of states
In
I32
noise subspace
In
DBL
structure selector
In
Cluster
sampling rate
In
DBL
system model
Out
Object containing
98
ni.com
Algorithm References
out
information about
this model
coefficients of
Out
Cluster
Estimated matrices A, B, C, D
Out
1D DBL Array
state-space
model
initial states
4.
Algorithms
The algorithm used in this VI is a frequency-domain subspace identification method, which is very
similar to its time-domain counterpart.
y( k )
y( k 1 )
and similarly with u ( k ) and n ( k )
Define yd ( k )
d
d
y( k d 1 )
By recursively using Equation 1, you obtain:
yd d x( k ) d ud ( k ) nd ( k )
(2)
C
CA
and is the extended system observability matrix and
where d
d 1
CA
0 0 0
D
CB
D 0 0
d CAB CB D 0
d 2
CA B CB
0
0
0 is the lower triangular Toeplitz matrix.
0
D
Wd ( ) Y( ) d X ( ) dWd ( ) U( ) Wd ( ) N( )
where denotes the Kronecker product and Wd ( ) 1 e
2i
... e
(3)
i( d 1 ) T
Assume you have samples of the Fourier transform of the input and output signals at M
frequencies k, where k=1, 2,, M. By collecting these samples properly, you have
Yd ,M (Wq ( 1 ) Y( 1 ) ... Wq ( M ) Y( M ) )
Ud ,M (Wq ( 1 ) U( 1 ) ... Wq ( M ) U( M ) )
Nd ,M (Wq ( 1 ) N( 1 ) ... Wq ( M ) N( M ) )
X M ( X ( 1 ) ... X ( M ) )
By using Equation 3, you obtain
99
Algorithm References
Yd ,M d X M dU d ,M Nd ,M
(4)
H
U R11 0 Q1
R
Y 21 R22 Q H
2
3) Calculate the SVD of R22
ReR
22
Im R22 U S U O S
0
T
0 VS
O V T
O
4) Determine A and C:
( J U ) J U
A
1 s
2 s
C J 3U s
where J ( I
1
( d 1)l
0( d 1)l l ) , J 2 ( 0( d 1)l l
,D
, x argmin
B
0
5.
k 1
Y ( k ) ( D C ( e
ik
)1 B )U ( ) C ( e
IA
k
ik
)1 x
IA
0
References
[1] McKelvey, T. 1995. Identification of State-Space Models from Time and Frequency Data.
Ph.D. thesis, Department of Electrical Engineering, Division of Automatic Control, Linkoping
University, Sweden.
100
ni.com