Get Current Value of Generalized Model by Model Conversion
This example shows how to get the current value of a generalized model by converting it to a numeric model. This conversion is useful, for example, when you have tuned the parameters of the generalized model using a tuning command such as systune
.
Create a Generalized Model
Represent the transfer function
containing a real, tunable parameter, a
, which is initialized to 10.
a = realp('a',10);
F = tf(a,[1 a]);
F
is a genss
model parameterized by a
.
Tune the Model
Typically, once of you have a generalized model, you tune the parameters of the model using a tuning command such as systune
. For this example, instead of tuning the model, manually change the value of the tunable component of F
.
F.Blocks.a.Value = 5;
Get the Current Value of the Generalized Model
Get the current value of the generalized model by converting it to a numeric model.
F_cur_val = tf(F)
F_cur_val = 5 ----- s + 5 Continuous-time transfer function.
tf(F)
converts the generalized model, F
, to a numeric transfer function, F_cur_val
.
To view the state-space representation of the current value of F
, type ss(F)
.
To examine the current values of the individual tunable components in a generalized model, use showBlockValue
.
See Also
realp
| tf
| showBlockValue