Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Create State-Space Model with Both Fixed and Tunable Parameters

This example shows how to create a state-space genss model having both fixed and tunable parameters.

$$A = \left[ {\begin{array}{*{20}{c}}
1&{a + b}\\
0&{ab}
\end{array}} \right],\quad B = \left[ {\begin{array}{*{20}{c}}
{ - 3.0}\\
{1.5}
\end{array}} \right],\quad C = \left[ {\begin{array}{*{20}{c}}
{0.3}&0
\end{array}} \right],\quad D = 0,$$

where a and b are tunable parameters, whose initial values are -1 and 3, respectively.

Create the tunable parameters using realp.

a = realp('a',-1);
b = realp('b',3);

Define a generalized matrix using algebraic expressions of a and b.

A = [1 a+b;0 a*b];

A is a generalized matrix whose Blocks property contains a and b. The initial value of A is [1 2;0 -3], from the initial values of a and b.

Create the fixed-value state-space matrices.

B = [-3.0;1.5];
C = [0.3 0];
D = 0;

Use ss to create the state-space model.

sys = ss(A,B,C,D)
sys =

  Generalized continuous-time state-space model with 1 outputs, 1 inputs, 2 states, and the following blocks:
    a: Scalar parameter, 2 occurrences.
    b: Scalar parameter, 2 occurrences.

Type "ss(sys)" to see the current value, "get(sys)" to see all properties, and "sys.Blocks" to interact with the blocks.

sys is a generalized LTI model (genss) with tunable parameters a and b.

More About

Was this topic helpful?