Covariance - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

DynamicSystems

 Covariance
 compute the output and state covariance of a linear system driven by white Gaussian noise inputs

 Calling Sequence Covariance(sys, Rw) Covariance(sys, Rw, opts)

Parameters

 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

Options

 • 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.

Description

 • 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:
 $\stackrel{.}{x}=\mathrm{Ax}+\mathrm{Bw}$
 $y=\mathrm{Cx}+\mathrm{Dw}$
 where: ${\mathrm{A ∈ ℝ}}^{\mathrm{n×n}}$, ${\mathrm{B ∈ ℝ}}^{\mathrm{n×m}}$, ${\mathrm{C ∈ ℝ}}^{\mathrm{p×n}}$, and ${\mathrm{D ∈ ℝ}}^{\mathrm{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 ${\mathrm{Rw ∈ ℝ}}^{\mathrm{m×m}}$. In other words, the expected value of $w$ is $𝔼\left(w\left(t\right)\right)=0$ and its covariance matrix is $𝔼\left(w\left(t\right)·\left({w}^{T}\right)\left(t+\mathrm{\tau }\right)\right)=\mathrm{Rw}·\delta \left(\mathrm{\tau }\right)$ where $\mathrm{\delta }$ is the Dirac delta function. In the scalar case, $\mathrm{Rw}={\mathrm{\sigma }}_{w}^{2}$ or variance of the random process.
 • The steady-state covariance matrix of the state $x$ is ${\mathrm{Px ∈ ℝ}}^{\mathrm{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 ${\mathrm{Py ∈ ℝ}}^{\mathrm{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·\mathrm{Px}+\mathrm{Px}·{A}^{T}+B·\mathrm{Rw}·{B}^{T}=0$  (continuous Lyapunov equation)
 $\mathrm{Py}=C·\mathrm{Px}·{C}^{T}+\mathrm{D}·\mathrm{Rw}·{\mathrm{D}}^{T}$

Discrete-time system

 $\mathrm{Px}=A·\mathrm{Px}·{A}^{T}+B·\mathrm{Rw}·{B}^{T}$  (discrete Lyapunov equation)
 $\mathrm{Py}=C·\mathrm{Px}·{C}^{T}+\mathrm{D}·\mathrm{Rw}·{\mathrm{D}}^{T}$
 • The Lyapunov equation approach to finding the steady-state covariance matrices is based on the assumption that the system is stable. For unstable systems, $\mathrm{Px}$ and $\mathrm{Py}$ are infinite.

Examples

 > $\mathrm{with}\left(\mathrm{DynamicSystems}\right):$

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.

 > $\mathrm{sys1}≔\mathrm{TransferFunction}\left(\frac{10\left(2z+1\right)}{10{z}^{2}+2z+5},\mathrm{discrete},\mathrm{sampletime}=0.1\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys1}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{discrete; sampletime = .1}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({z}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({z}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{20}{}{z}{+}{10}}{{10}{}{{z}}^{{2}}{+}{2}{}{z}{+}{5}}\end{array}\right$ (1)

For a system with a single input, the dimension of the Matrix Rw is 1x1.

 > $\mathrm{Rw}≔\mathrm{Matrix}\left(\left[\left[5\right]\right]\right)$
 ${\mathrm{Rw}}{≔}\left[\begin{array}{c}{5}\end{array}\right]$ (2)

By default, the output covariance Matrix Py is returned if no output option is specified.

 > $\mathrm{Py}≔\mathrm{Covariance}\left(\mathrm{sys1},\mathrm{Rw}\right)$
 ${\mathrm{Py}}{≔}\left[\begin{array}{c}{30.3167420814479}\end{array}\right]$ (3)

Return the state covariance Matrix Px (expected empty for TF)

 > $\mathrm{Px}≔\mathrm{Covariance}\left(\mathrm{sys1},\mathrm{Rw},\mathrm{output}=\mathrm{statecovar}\right)$
 ${\mathrm{Px}}{≔}\left[\begin{array}{}\end{array}\right]$ (4)

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.

 > $\mathrm{sys2}≔\mathrm{StateSpace}\left(⟨⟨-5,3⟩|⟨3,-4⟩⟩,⟨⟨2,3⟩⟩,⟨⟨1,-2⟩|⟨\frac{1}{2},1⟩⟩,⟨⟨0,0⟩⟩\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys2}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{2 output\left(s\right); 1 input\left(s\right); 2 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({t}\right){,}{\mathrm{y2}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1}}{}\left({t}\right){,}{\mathrm{x2}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{cc}{-5}& {3}\\ {3}& {-4}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{2}\\ {3}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cc}{1}& \frac{{1}}{{2}}\\ {-2}& {1}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{0}\\ {0}\end{array}\right]\end{array}\right$ (5)

For a system with a single input, the Rw Matrix has 1x1 dimensions.

 > $\mathrm{Rws}≔\mathrm{Matrix}\left(\left[\left[2\right]\right]\right)$
 ${\mathrm{Rws}}{≔}\left[\begin{array}{c}{2}\end{array}\right]$ (6)

Return the output covariance Matrix Py.

 > $\mathrm{Py}≔\mathrm{Covariance}\left(\mathrm{sys2},\mathrm{Rws},\mathrm{output}=\mathrm{outcovar}\right)$
 ${\mathrm{Py}}{≔}\left[\begin{array}{cc}{9.00000000000000}& {-4.00000000000000}\\ {-4.00000000000000}& {1.81818181818182}\end{array}\right]$ (7)

Return a list of the output and state covariance Matrices [Py, Px]

 > $\mathrm{outlist}≔\mathrm{Covariance}\left(\mathrm{sys2},\mathrm{Rws},\mathrm{output}=\left[\mathrm{outcovar},\mathrm{statecovar}\right]\right)$
 ${\mathrm{outlist}}{≔}\left[\left[\begin{array}{cc}{9.00000000000000}& {-4.00000000000000}\\ {-4.00000000000000}& {1.81818181818182}\end{array}\right]{,}\left[\begin{array}{cc}{3.36363636363637}& {4.27272727272728}\\ {4.27272727272728}& {5.45454545454546}\end{array}\right]\right]$ (8)

Compatibility

 • The DynamicSystems[Covariance] command was introduced in Maple 18.
 • For more information on Maple 18 changes, see Updates in Maple 18.