functionanalysis

Perform a system analysis based on the poles and zeros of the system

Extends from Modelica_LinearSystems2.Internal.PartialPlotFunction (Interface of a plot function).

Information

Syntax

Modelica_LinearSystems2.StateSpace.Analysis.analysis(ss);
   or
Modelica_LinearSystems2.StateSpace.Analysis.analysis(
  ss,
  analyseOptions=analyseOptions,
  fileName,
  systemName,
  description);

Description

This function analyzes a state space system

der(x) = A * x + B * u
    y  = C * x + D * u     
    x(t=0) = x0

based on its poles, i.e. the eigenvalues, and the zeros of the system. The system will be checked for stability, controllability and observability. In the case that the system is not stable stabilizability and detectability are examined. Furthermore, stability, controllability, observability, stabilizability, and detectability are indicated for each eigenvalue.

Stability

System (1) is stable if and only if all eigenvalues of the matrix A have negative real parts. The calculation of the eigenvalues is based on the LAPACK routine dgeev.

Controllability

System (1) is said to be controllable if, starting from any initial state x0, the system can be driven by appropriate inputs to any final state x1 within some finite time window. Equivalent is that the eigenvalues of A-BK can arbitrarily be assigned by an appropriate choice of the matrix K.

Stabilizability

System (1) is said to be stabilizable if all the unstable eigenvalues, i.e. all s with Re(s)>=0, of A are controllable. Therefore, a controllable system is always stabilizable. An equivalent definition of stabilizability is, that a system is said to be stabilizable if there exist a matrix K such that A-BK is stable.

Observability

System (1) is said to be observable if the (arbitrary) initial state x0 can be uniquely determined from any state x(t1), t1>0, from the knowledge of the input u(t) and output y(t). With other words, from the system's outputs it is possible to determine the behavior of the entire system. Equivalent is, that the eigenvalues of A-LC can be arbitrarily be assigned by an appropriate choice of matrix L. Observability is called the dual concept of controllability, since a system (A,B,C,D) is observable if the system (AT, CT, BT, DT) is controllable.

Detectability

System (1) is said to be detectable if all the unstable eigenvalues, i.e. all s with Re(s)>=0, of A are observable. Therefore, a observable system is always detectable. An equivalent definition of detectability is, that a system is said to be detectable if there exist a matrix L such that A-LC is stable. Detectability is called the dual concept of stabilizability, since a system (A,B,C,D) is detectable if the system (AT, CT, BT, DT) is stabilizable.

Algorithm to test controllability/stabilizability and observability/detectability respectively

The test of controllability and stabilizability is performed with the staircase algorithm which transforms the system (A,B,C,D) into the controller-Hessenberg form (AH, BH, CH, D) with AH is a block upper Hessenberg matrix and BH=[B1; 0] with triangular matrix B1 with rank(B1) = rank(B). In AH=[Ac, *,0, Anc) the eigenvalues of the matrices Ac and Anc are the controllable eigenvalues and uncontrollable eigenvalues of A respectively. The test of observability and detectability is performed by testing the system (AT, CT, BT, DT) with respect to controllability and stabilizability.

Solution of a linear time invariant system

The solution x(t) of the initial value problem (1) consists of the homogeneous part (zero input response) xh(t) and the inhomogeneous part xi(t). The zero input solution is given by

xh(t) = exp(A*(t-t0))x0.

The system can also be represented as a linear combination of the modal states z,

x = Vz

i.e. the states of a similar system, with

der(z) = V-1AVz + V-1Bu

where the system matrix V-1AV is the real Jordan form. For single real eigenvectors the system is decoupled, i.e. the solution of the modal states are denoted by

zi = exp(si t)*z0i

The behavior of the modal states is determined as the solution of a linear first order differential equation for real eigenvalues. Since this behavior is well known, the behavior of the xi can at least roughly be estimated by means of the behavior of the most relevant modal states. Therefore, the contribution of the modal states to the states is computed as an indication of the original system behavior.

Contribution of the modal states to the states

Generally, as described above, the states of the system can be described as linear combination of modal states and, therefore, the states can be characterized to a certain extend by the modal states if the proportions of the combination are known. Hence, for each modal state zi of the vector z the elements |vi,j|/|vi| of the corresponding right eigenvector vi indicate the proportion of zi that is contributed to the state xj. On the other hand, the composition of xi is indicated by the elements |vi,j|/|viT|, i.e. the elements |vi,j|/|viT| of the corresponding row viT of the eigenvector matrix V indicate the proportion of the state xi that is contributed by the modal state zj.

Example

  ss=StateSpace(
    A=[-3,2,-3,4,5,6; 0,6,7,8,9,4; 0,2,3,0,78,6; 0,1,2,2,3,3; 0,13,34,0,0,1; 0,
      0,0,-17,0,0],
    B=[1,0; 0,1; 1,0; 0,1; 1,0; 0,1],
    C=[0,0,1,0,1,0; 0,1,0,0,1,1],
    D=[0,0; 0,0],
    xNames={"x1","x2","x3","x4","x5","x6"},
    uNames={"u1","u2"}, yNames={"y1","y2"});

  String fileName="analysis.html";
  String systemName="Demonstration System";
  String description="System to demonstrate the usage of Modelica_LinearSystems2.StateSpace.Analysis.anlysis()"

algorithm
  Modelica_LinearSystems2.StateSpace.Analysis.analysis(ss, fileName=fileName, systemName=systemName, description=description)
//  gives:

System report

The system Demonstation System

der(x) = A * x + B * u
    y  = C * x + D * u

is defined by

        x1   x2   x3   x4   x5   x6            u1  u2
    x1  -3    2   -3    4    5    6         x1  1   0
    x2   0    6    7    8    9    4         x2  0   1
A = x3   0    2    3    0   78    6     B = x3  1   0
    x4   0    1    2    2    3    3         x4  0   1
    x5   0   13   34    0    0    1         x5  1   0
    x6   0    0    0  -17    0    0         x6  0   1

        x1   x2   x3   x4   x5   x6            u1  u2
C = y1   0    0    1    0    1    0     D = y1  0   0
    y2   0    1    0    0    1    1         y2  0   0
Description

System to demonstrate the usage of Modelica_LinearSystems2.StateSpace.Analysis.analysis()

Characteristics

The system
is not stable
but it is controllable
and therefore it is stabilizable
The system is not observable
but it is detectable

Eigenvalues analysis

Real eigenvalues

number eigenvalue T [s] characteristics contribution to states
1   -4.9874e+001   0.0201   stable, controllable, observable   z[1] contributes to x3 with 54.6 %
  z[1] contributes to x5 with 37 %
2   -3.0000e+000   0.3333   stable, controllable, not observable   z[2] contributes to x1 with 100 %
3   2.9891e+000   0.3346   not stable, stabilizable, detectable   z[3] contributes to x2 with 51.9 %
  z[3] contributes to x1 with 23.9 %
4   5.5825e+001   0.0179   not stable, stabilizable, detectable   z[4] contributes to x3 with 48.4 %
  z[4] contributes to x5 with 32.5 %

Conjugated complex pairs of eigenvalues

number eigenvalue freq. [Hz] damping characteristics contribution to states
5/6   1.0299e+000 ± 6.5528e+000j   1.0557   -0.1553   not stable, stabilizable, detectable   z[ 5/6] contribute to x6 with 35.9 %
  z[ 5/6] contribute to x2 with 20.6 %

In the table above, the column contribution to states lists for each eigenvalue the states to which thecorresponding modal state contributes most. This information is based on the two largest absolute values of the corresponding right eigenvector (if the second large value is less than 5 % of the largest contribution, it is not shown).

In the next table, for each state in the column correlation to modal states, the modal states which contribute most to the coresponding state are summarized, i.e. the state is mostly composed of these modal states This information is based on the two largest absolute values of row i of the eigenvector matrix that is associated with eigenvalue i (if the second large value is less than 5 % of the largest contribution, it is not shown). This only holds if the modal states are in the same order of magnitude. Otherwise, the modal states listed in the last column might be not the most relevant one.

state composition eigenvalue # freq. [Hz] damping T [s]
  x1   is composed of 42.5% by z[2]
  is composed of 35.4% by z[5/6]
  2
  5/6
  ---
  1.0557
  ---
  -0.1553
  0.0201
  ---
  x2   is composed of 44.2% by z[3]
  is composed of 43.7% by z[5/6]
  3
  5/6
  ---
  1.0557
  ---
  -0.1553
  0.3333
  ---
  x3   is composed of 36.9% by z[1]
  is composed of 36.3% by z[4]
  1
  4
  ---
  ---
  ---
  ---
  0.3346
  0.0179
  x4   is composed of 88.9% by z[5/6]
  is composed of 9.8% by z[4]
  5/6
  4
  1.0557
  ---
  -0.1553
  ---
  ---
  0.0179
  x5   is composed of 45.3% by z[1]
  is composed of 44.1% by z[4]
  1
  4
  ---
  ---
  ---
  ---
  0.0000
  0.0179
  x6   is composed of 95.7% by z[5/6]   5/6   1.0557   -0.1553   ---

Invariant zeros

number invariant zero Time constant [s] freq. [Hz] damping
  1   -5.4983e+001   0.0182   ---   ---
  2   -3.0000e+000   0.3333   ---   ---
  3/4   3.2417e+000 ± 5.6548e+000j   ---   1.0374   -0.4973

Inputs

TypeNameDefaultDescription
StateSpacess
Internal.AnalyseOptionsanalyseOptionsModelica_LinearSystems2.Internal.AnalyseOptions(plotEigenValues = true, plotInvariantZeros = true, plotStepResponse = true, plotFrequencyResponse = true, printSystem = true, printEigenValues = true, printEigenValueProperties = true, printInvariantZeros = true, printControllability = true, printObservability = true, headingEigenValues = "Eigenvalues", headingInvariantzeros = "Invariant zeros", headingStepResponse = "Step response", headingFrequencyResponse = "Frequency response", dB_w = false)
StringfileName"systemReport.html"Name of html-file that contains eigenvalue table
StringsystemName""Name of system (used as heading in html file)
Stringdescription""Description of system (used in html file)
Plot.Records.DiagramdefaultDiagram (from PartialPlotFunction)Default diagram layout
Plot.Records.Devicedevice (from PartialPlotFunction)Modelica_LinearSystems2.Utilities.Plot.Records.Device()Properties of device where figure is shown

Contents

NameDescription
printSystemPrint the state space system in html format on file
printHead1Print the heading of document for characteristics in html format on file
printHead2aPrint the heading of document for eigenvalues in html format on file
printHead2bPrint the heading of document for conjugated complex pairs in html format on file
printHead3Print the heading of document for description in html format on file
printHead4Print the heading of document for invariant zeros in html format on file
printHTMLbasicsPrint the html preamble or ending on file
printTab1Print the table with real eigenvalues in html format on file
printTab2Print the table with complex conjugate eigenvalues in html format on file
printTab3Print the table with eigenvalues in html format on file
printTab4Print the table with eigenvalues in html format on file

Revisions

Date Author Comment
2010-05-31 Marcus Baur, DLR-RM Realization