DynamicSystems
Covariance
compute the output and state covariance of a linear system driven by white Gaussian noise inputs
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Covariance(sys, Rw)
Covariance(sys, Rw, opts)
sys
-
System; system object
Rw
Matrix; white Gaussian noise inputs intensities.
opts
(optional) equation(s) of the form option = value; specify options for the Covariance command
output = outcovar or statecovar or list of these names.
Specifies the returned values. By default, only the output covariance Matrix is returned. The state covariance Matrix is returned when sys is given in the state-space form. Otherwise, an empty Matrix is returned.
checkstability = truefalse
True means check whether the system is stable; if it is not stable, an error occurs. False means skip the check. The default is true.
The Covariance command computes the steady-state output and state covariance of a linear system sys driven by white Gaussian noise inputs. In state-space form, this system is represented as:
x.=Ax+Bw
y=Cx+Dw
where: A ∈ ℝn×n, B ∈ ℝn×m, C ∈ ℝp×n, and D ∈ ℝp×m, and n, m, and p are the number of states, inputs and outputs of the linear system respectively.
The input disturbances w are zero-mean white Gaussian noise inputs with spectral densities or intensities Rw ∈ ℝm×m. In other words, the expected value of w is 𝔼⁡w⁡t=0 and its covariance matrix is 𝔼⁡w⁡t·wT⁡t+τ=Rw·δ⁡τ where δ is the Dirac delta function. In the scalar case, Rw=σw2 or variance of the random process.
The steady-state covariance matrix of the state x is Px ∈ ℝn×n. The state covariance matrix computed value is returned when sys is in the state-space form.
The steady-state covariance matrix of the output y is Py ∈ ℝp×p. The output covariance Matrix is returned for any sys type.
The covariance matrices are computed by solving the following equations:
Continuous-time system
A·Px+Px·AT+B·Rw·BT=0 (continuous Lyapunov equation)
Py=C·Px·CT+D·Rw·DT
Discrete-time system
Px=A·Px·AT+B·Rw·BT (discrete Lyapunov equation)
The Lyapunov equation approach to finding the steady-state covariance matrices is based on the assumption that the system is stable. For unstable systems, Px and Py are infinite.
with⁡DynamicSystems:
Example 1 : Find the covariance matrices of a system with discrete-time transfer function shown below, whose input is a Gaussian white process with spectral density Rw = 5.
sys1≔TransferFunction⁡10⁢2⁢z+110⁢z2+2⁢z+5,discrete,sampletime=0.1:
PrintSystem⁡sys1
Transfer Functiondiscrete; sampletime = .11 output(s); 1 input(s)inputvariable=u1⁡zoutputvariable=y1⁡ztf1,1=20⁢z+1010⁢z2+2⁢z+5
For a system with a single input, the dimension of the Matrix Rw is 1x1.
Rw≔Matrix⁡5
Rw≔5
By default, the output covariance Matrix Py is returned if no output option is specified.
Py≔Covariance⁡sys1,Rw
Py≔30.3167420814479
Return the state covariance Matrix Px (expected empty for TF)
Px≔Covariance⁡sys1,Rw,output=statecovar
Px≔
Example 2 : Find the steady-state output covariance matrix of a continuous state-space system driven by a Gaussian white process with intensity Rw = 2.
sys2≔StateSpace⁡−5,3|3,−4,2,3,1,−2|12,1,0,0:
PrintSystem⁡sys2
State Spacecontinuous2 output(s); 1 input(s); 2 state(s)inputvariable=u1⁡toutputvariable=y1⁡t,y2⁡tstatevariable=x1⁡t,x2⁡ta=−533−4b=23c=112−21d=00
For a system with a single input, the Rw Matrix has 1x1 dimensions.
Rws≔Matrix⁡2
Rws≔2
Return the output covariance Matrix Py.
Py≔Covariance⁡sys2,Rws,output=outcovar
Py≔9.00000000000000−4.00000000000000−4.000000000000001.81818181818182
Return a list of the output and state covariance Matrices [Py, Px]
outlist≔Covariance⁡sys2,Rws,output=outcovar,statecovar
outlist≔9.00000000000000−4.00000000000000−4.000000000000001.81818181818182,3.363636363636374.272727272727284.272727272727285.45454545454546
The DynamicSystems[Covariance] command was introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
DynamicSystems[Grammians]
DynamicSystems[NormH2]
LinearAlgebra[LyapunovSolve]
LinearAlgebra[SylvesterSolve]
Download Help Document