- Scilab Online Help
- CACSD
- abcd
- abinv
- arhnk
- arl2
- arma
- arma2p
- armac
- armax
- armax1
- arsimul
- augment
- balreal
- bilin
- black
- bode
- bstap
- cainv
- calfrq
- canon
- ccontrg
- chart
- cls2dls
- colinout
- colregul
- cont_frm
- cont_mat
- contr
- contrss
- copfac
- csim
- ctr_gram
- dbphi
- dcf
- ddp
- des2ss
- des2tf
- dhinf
- dhnorm
- dscr
- dsimul
- dt_ility
- dtsi
- equil
- equil1
- evans
- feedback
- findABCD
- findAC
- findBD
- findBDK
- findR
- findx0BD
- flts
- fourplan
- frep2tf
- freq
- freson
- fspecg
- fstabst
- g_margin
- gainplot
- gamitg
- gcare
- gfare
- gfrancis
- gtild
- h2norm
- h_cl
- h_inf
- h_inf_st
- h_norm
- hallchart
- hankelsv
- hinf
- imrep2ss
- inistate
- invsyslin
- kpure
- krac2
- lcf
- leqr
- lft
- lin
- linf
- linfn
- linmeq
- lqe
- lqg
- lqg2stan
- lqg_ltr
- lqr
- ltitr
- m_circle
- macglov
- markp2ss
- minreal
- minss
- mucomp
- narsimul
- nehari
- nicholschart
- noisegen
- nyquist
- obs_gram
- obscont
- observer
- obsv_mat
- obsvss
- p_margin
- parrot
- pfss
- phasemag
- ppol
- prbs_a
- projsl
- reglin
- repfreq
- ric_desc
- ricc
- riccati
- routh_t
- rowinout
- rowregul
- rtitr
- sensi
- sgrid
- show_margins
- sident
- sm2des
- sm2ss
- sorder
- specfact
- ss2des
- ss2ss
- ss2tf
- st_ility
- stabil
- svplot
- sysfact
- syssize
- tf2des
- tf2ss
- time_id
- trzeros
- ui_observer
- unobs
- zeropen
- zgrid
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
sident
discrete-time state-space realization and Kalman gain
Calling Sequence
[(A,C)(,B(,D))(,K,Q,Ry,S)(,rcnd)] = sident(meth,job,s,n,l,R(,tol,t,Ai, Ci,printw))
Arguments
- meth
integer option to determine the method to use:
- =
1 : MOESP method with past inputs and outputs;
- =
2 : N4SID method;
- =
3 : combined method: A and C via MOESP, B and D via N4SID.
- job
integer option to determine the calculation to be performed:
- =
1 : compute all system matrices, A, B, C, D;
- =
2 : compute the matrices A and C only;
- =
3 : compute the matrix B only;
- =
4 : compute the matrices B and D only.
- s
the number of block rows in the processed input and output block Hankel matrices. s > 0.
- n
integer, the order of the system
- l
integer, the number of the system outputs
- R
the 2*(m+l)*s-by-2*(m+l)*s part of R contains the processed upper triangular factor R from the QR factorization of the concatenated block-Hankel matrices, and further details needed for computing system matrices.
- tol
(optional) tolerance used for estimating the rank of matrices. If tol > 0, then the given value of tol is used as a lower bound for the reciprocal condition number; an m-by-n matrix whose estimated condition number is less than 1/tol is considered to be of full rank. Default: m*n*epsilon_machine where epsilon_machine is the relative machine precision.
- t
(optional) the total number of samples used for calculating the covariance matrices. Either t = 0, or t >= 2*(m+l)*s. This parameter is not needed if the covariance matrices and/or the Kalman predictor gain matrix are not desired. If t = 0, then K, Q, Ry, and S are not computed. Default: t = 0.
- Ai
real matrix
- Ci
real matrix
- printw
(optional) switch for printing the warning messages.
- =
1: print warning messages;
- =
0: do not print warning messages.
Default: printw = 0.
- A
real matrix
- C
real matrix
- B
real matrix
- D
real matrix
- K
real matrix, kalman gain
- Q
(optional) the n-by-n positive semidefinite state covariance matrix used as state weighting matrix when computing the Kalman gain.
- RY
(optional) the l-by-l positive (semi)definite output covariance matrix used as output weighting matrix when computing the Kalman gain.
- S
(optional) the n-by-l state-output cross-covariance matrix used as cross-weighting matrix when computing the Kalman gain.
- rcnd
(optional) vector of length lr, containing estimates of the reciprocal condition numbers of the matrices involved in rank decisions, least squares, or Riccati equation solutions, where lr = 4, if Kalman gain matrix K is not required, and lr = 12, if Kalman gain matrix K is required.
Description
SIDENT function for computing a discrete-time state-space realization (A,B,C,D) and Kalman gain K using SLICOT routine IB01BD.
[A,C,B,D] = sident(meth,1,s,n,l,R) [A,C,B,D,K,Q,Ry,S,rcnd] = sident(meth,1,s,n,l,R,tol,t) [A,C] = sident(meth,2,s,n,l,R) B = sident(meth,3,s,n,l,R,tol,0,Ai,Ci) [B,K,Q,Ry,S,rcnd] = sident(meth,3,s,n,l,R,tol,t,Ai,Ci) [B,D] = sident(meth,4,s,n,l,R,tol,0,Ai,Ci) [B,D,K,Q,Ry,S,rcnd] = sident(meth,4,s,n,l,R,tol,t,Ai,Ci)
SIDENT computes a state-space realization (A,B,C,D) and the Kalman predictor gain K of a discrete-time system, given the system order and the relevant part of the R factor of the concatenated block-Hankel matrices, using subspace identification techniques (MOESP, N4SID, or their combination).
The model structure is :
x(k+1) = Ax(k) + Bu(k) + Ke(k), k >= 1, y(k) = Cx(k) + Du(k) + e(k),
where x(k) is the n-dimensional state vector (at time k),
u(k) is the m-dimensional input vector,
y(k) is the l-dimensional output vector,
e(k) is the l-dimensional disturbance vector,
and A, B, C, D, and K are real matrices of appropriate dimensions.
Comments
1. The n-by-n system state matrix A, and the p-by-n system output matrix C are computed for job <= 2.
2. The n-by-m system input matrix B is computed for job <> 2.
3. The l-by-m system matrix D is computed for job = 1 or 4.
4. The n-by-l Kalman predictor gain matrix K and the covariance matrices Q, Ry, and S are computed for t > 0.
Examples
//generate data from a given linear system A = [ 0.5, 0.1,-0.1, 0.2; 0.1, 0, -0.1,-0.1; -0.4,-0.6,-0.7,-0.1; 0.8, 0, -0.6,-0.6]; B = [0.8;0.1;1;-1]; C = [1 2 -1 0]; SYS=syslin(0.1,A,B,C); nsmp=100; U=prbs_a(nsmp,nsmp/5); Y=(flts(U,SYS)+0.3*rand(1,nsmp,'normal')); S = 15; N = 3; METH=1; [R,N1] = findR(S,Y',U',METH); [A,C,B,D,K] = sident(METH,1,S,N,1,R); SYS1=syslin(1,A,B,C,D); SYS1.X0 = inistate(SYS1,Y',U'); Y1=flts(U,SYS1); clf();plot2d((1:nsmp)',[Y',Y1']) METH = 2; [R,N1,SVAL] = findR(S,Y',U',METH); tol = 0; t = size(U',1)-2*S+1; [A,C,B,D,K] = sident(METH,1,S,N,1,R,tol,t) SYS1=syslin(1,A,B,C,D) SYS1.X0 = inistate(SYS1,Y',U'); Y1=flts(U,SYS1); clf();plot2d((1:nsmp)',[Y',Y1'])
Authors
V. Sima, Research Institute for Informatics, Bucharest, Oct. 1999. Revisions: May 2000, July 2000.
<< show_margins | CACSD | sm2des >> |