l>HTTP/1.1 200 OKServer: GlassFish Server Open Source Edition 4.1.2 X-Powered-By: Servlet/3.1 JSP/2.3 (GlassFish Server Open Source Edition 4.1.2 Java/Oracle Corporation/1.8) Set-Cookie: JSESSIONID=cad59ca70c5b7b52d0ec0e289032; Path=/; Secure; HttpOnly Set-Cookie: MW_Doc_Template=WEB||||||||||; Path=/help; Secure Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Expires: Tue, 09 Mar 2021 18:07:26 EST Content-Type: text/html;charset=utf-8 Date: Tue, 12 Apr 2022 07:29:23 GMT Transfer-Encoding: chunked 10017Canonical state-space realization - MATLAB canon
Main Content

canon

Canonical state-space realization

Description

example

csys= canon(sys,type)transforms the linear modelsysinto a canonical state-space modelcsys.typespecifies whethercsysis in modal or companion form.

For information on controllable and observable canonical forms, seeCanonical State-Space Realizations.

example

csys= canon(sys,'modal',condt)specifies an upper boundcondton the condition number of the block-diagonalizing transformation. Usecondtif you have close lying eigenvalues incsys.

example

[csys,T]= canon(___)also returns the state-coordinate transformation matrixT与状态空间模型的状态systo the states ofcsys.

Examples

collapse all

aircraftPitchSSModel.matcontains the state-space matrices of an aircraft where the input is elevator deflection angle δ and the output is the aircraft pitch angle θ .

[ α ˙ q ˙ θ ˙ ] = [ - 0 . 3 1 3 5 6 . 7 0 - 0 . 0 1 3 9 - 0 . 4 2 6 0 0 5 6 . 7 0 ] [ α q θ ] + [ 0 . 2 3 2 0 . 0 2 0 3 0 ] [ δ ] y = [ 0 0 1 ] [ α q θ ] + [ 0 ] [ δ ]

Load the model data to the workspace and create the state-space modelsys.

load('aircraftPitchSSModel.mat'); sys = ss(A,B,C,D)
sys = A = x1 x2 x3 x1 -0.313 56.7 0 x2 -0.0139 -0.426 0 x3 0 56.7 0 B = u1 x1 0.232 x2 0.0203 x3 0 C = x1 x2 x3 y1 0 0 1 D = u1 y1 0 Continuous-time state-space model.

Convert the resultant state-space modelsysto companion canonical form.

csys = canon(sys,'companion')
csys = A = x1 x2 x3 x1 0 0 -1.709e-16 x2 1 0 -0.9215 x3 0 1 -0.739 B = u1 x1 1 x2 0 x3 0 C = x1 x2 x3 y1 0 1.151 -0.6732 D = u1 y1 0 Continuous-time state-space model.

csysis the companion canonical form ofsys.

pendulumCartSSModel.matcontains the state-space model of an inverted pendulum on a cart where the outputs are the cart displacementxand the pendulum angle θ . The control inputuis the horizontal force on the cart.

[ x ˙ x ¨ θ ˙ θ ¨ ] = [ 0 1 0 0 0 - 0 . 1 3 0 0 0 0 1 0 - 0 . 5 3 0 0 ] [ x x ˙ θ θ ˙ ] + [ 0 2 0 5 ] u y = [ 1 0 0 0 0 0 1 0 ] [ x x ˙ θ θ ˙ ] + [ 0 0 ] u

First, load the state-space modelsysto the workspace.

load('pendulumCartSSModel.mat','sys');

Convertsysto modal canonical form and extract the transformation matrix.

[csys,T] = canon(sys,'modal')
csys = A = x1 x2 x3 x4 x1 0 0 0 0 x2 0 -0.05 0 0 x3 0 0 -5.503 0 x4 0 0 0 5.453 B = u1 x1 1.875 x2 6.298 x3 12.8 x4 12.05 C = x1 x2 x3 x4 y1 16 -4.763 -0.003696 0.003652 y2 0 0.003969 -0.03663 0.03685 D = u1 y1 0 y2 0 Continuous-time state-space model.
T =4×40.0625 1.2500 -0.0000 -0.1250 0 4.1986 0.0210 -0.4199 0 0.2285 -13.5873 2.4693 0 -0.2251 13.6287 2.4995

csysis the modal canonical form ofsys, whileTrepresents the transformation between the state vectors ofsysandcsys.

For this example, consider the following system with doubled poles and clusters of close poles:

s y s ( s ) = 1 0 0 ( s - 1 ) ( s + 1 ) s ( s + 1 0 ) ( s + 1 0 . 0 0 0 1 ) ( s - ( 1 + i ) ) 2 ( s - ( 1 - i ) ) 2

Create azpkmodel of this system and convert it to modal canonical form using the string'modal'.

sys = zpk([1 -1],[0 -10 -10.0001 1+1i 1-1i 1+1i 1-1i],100); csys1 = canon(sys,'modal'); csys1.A
ans =7×70 0 0 0 0 0 0 0 1.0000 2.1220 0 0 0 0 0 -0.4713 1.0000 1.5296 0 0 0 0 0 0 1.0000 1.8439 0 0 0 0 0 -0.5423 1.0000 0 0 0 0 0 0 0 -10.0000 4.0571 0 0 0 0 0 0 -10.0001
csys1.B
ans =7×10.1600 -0.0052 0.0201 -0.0975 0.2884 0 4.0095

syshas a pair of poles ats=-10ands=-10.0001, and two complex poles of multiplicity 2 ats=1+iands=1-i. As a result, the modal formcsys1is a state-space model with a block of size 2 for the two poles nears=-10, and a block of size 4 for the complex eigenvalues.

Now, separate the two poles nears=-10通过增加的条件数的值the block-diagonalizing transformation. Use a value of1e10for this example.

csys2 = canon(sys,'modal',1e10); csys2.A
ans =7×70 0 0 0 0 0 0 0 1.0000 2.1220 0 0 0 0 0 -0.4713 1.0000 1.5296 0 0 0 0 0 0 1.0000 1.8439 0 0 0 0 0 -0.5423 1.0000 0 0 0 0 0 0 0 -10.0000 0 0 0 0 0 0 0 -10.0001
formatshortEcsys2.B
ans =7×11.6000e-01 -5.1885e-03 2.0117e-02 -9.7508e-02 2.8844e-01 1.6267e+05 1.6267e+05

TheAmatrix ofcsys2includes separate diagonal elements for the poles nears=-10. Increasing the condition number results in some very large values in theBmatrix.

The fileicEngine.matcontains one data set with 1500 input-output samples collected at the a sampling rate of 0.04 seconds. The inputu(t)is the voltage (V) controlling the By-Pass Idle Air Valve (BPAV), and the outputy(t)is the engine speed (RPM/100).

Use the data inicEngine.matto create a state-space model with identifiable parameters.

loadicEngine.matz = iddata(y,u,0.04); sys = n4sid(z,4,'InputDelay',2);

Convert the identified state-space modelsysto companion canonical form.

csys = canon(sys,'companion');

Obtain the covariance of the resulting form by running a zero-iteration update to model parameters.

opt = ssestOptions; opt.SearchOptions.MaxIterations = 0; csys = ssest(z,csys,opt);

Compare frequency response confidence bounds ofsystocsys.

h = bodeplot(sys,csys,'r.'); showConfidence(h)

Figure contains 2 axes objects. Axes object 1 with title From: u1 To: y1 contains 2 objects of type line. These objects represent sys, csys. Axes object 2 contains 2 objects of type line. These objects represent sys, csys.

The frequency response confidence bounds are identical.

Input Arguments

collapse all

Dynamic system, specified as a SISO, or MIMO dynamic system model. Dynamic systems that you can use include:

  • Continuous-time or discrete-time numeric LTI models, such astf,zpk,ss, orpidmodels.

  • Generalized or uncertain LTI models such asgenssoruss(Robust Control Toolbox)models. (Using uncertain models requires Robust Control Toolbox™ software.)

    The resulting canonical state-space model assumes

    • current values of the tunable components for tunable control design blocks.

    • 名义模型值不确定的控制设计blocks.

  • Identified LTI models, such asidtf(System Identification Toolbox),idss(System Identification Toolbox),idproc(System Identification Toolbox),idpoly(System Identification Toolbox), andidgrey(System Identification Toolbox)models.(Using identified models requires System Identification Toolbox™ software.)

You cannot use frequency-response data models such asfrdmodels.

Transformation type, specified as either'modal'or'companion'. Iftypeis unspecified, thencanonconverts the specified dynamic system model to modal canonical form by default.

The companion canonical form is the same as the observable canonical form. For information on controllable and observable canonical forms, seeCanonical State-Space Realizations.

  • Modal Form

    In modal form,Ais a block-diagonal matrix. The block size is typically 1-by-1 for real eigenvalues and 2-by-2 for complex eigenvalues. However, if there are repeated eigenvalues or clusters of nearby eigenvalues, the block size can be larger.

    For example, for a system with eigenvalues ( λ 1 , σ ± j ω , λ 2 ) , the modalAmatrix is of the form

    [ λ 1 0 0 0 0 σ ω 0 0 ω σ 0 0 0 0 λ 2 ]

  • Companion Form

    In the companion realization, the characteristic polynomial of the system appears explicitly in the rightmost column of theAmatrix. For a system with characteristic polynomial

    P ( s ) = s n + α 1 s n 1 + + α n 1 s + α n

    the corresponding companionAmatrix is

    A = [ 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 α n α n 1 α n 2 α n 3 α 1 ]

    The companion transformation requires that the system is controllable from the first input. The transformation to companion form is based on the controllability matrix which is almost always numerically singular for mid-range orders. Hence, avoid using it when possible.

    The companion canonical form is the same as the observable canonical form. For more information on observable and controllable canonical forms, seeCanonical State-Space Realizations.

Upper bound on the condition number of the block-diagonalizing transformation, specified as a positive scalar. This argument is available only whentypeis set to'modal'.

Increasecondtto reduce the size of the eigenvalue clusters in theAmatrix ofcsys. Settingcondt = Infdiagonalizes matrixA.

Output Arguments

collapse all

Canonical state-space form of the dynamic model, returned as anssmodel object.csysis a state-space realization ofsysin the canonical form specified bytype.

Transformation matrix, returned as an n-by-n matrix, where n is the number of states.Tis the transformation between the state vectorxof the state-space modelsysand the state vectorxcofcsys:

xc=Tx

.

This argument is available only whensysis anssmodel object.

Limitations

  • You cannot use frequency-response data models to convert to canonical state-space form.

  • The companion form is poorly conditioned for most state-space computations, that is, the transformation to companion form is based on the controllability matrix which is almost always numerically singular for mid-range orders. Hence, avoid using it when possible.

Algorithms

Thecanoncommand uses thebdschurcommand to convertsysinto modal form and to compute the transformationT. Ifsysis not a state-space model,canonfirst converts it to state space usingss.

The reduction to companion form uses a state similarity transformation based on the controllability matrix[1].

References

[1] Kailath, T.Linear Systems, Prentice-Hall, 1980.

Version History

Introduced before R2006a

expand all

Behavior changed in R2022a

See Also

||||||||(Robust Control Toolbox)|(System Identification Toolbox)|(System Identification Toolbox)|(System Identification Toolbox)|(System Identification Toolbox)|(System Identification Toolbox)

0