linearize simulink block to uncertain model -凯发k8网页登录
this example shows how to make a simulink® block linearize to an uncertain variable at the command line. to learn how to specify an uncertain block linearization using the simulink model editor, see .
for this example, open the simulink model slexaircraftexample
.
mdl = 'slexaircraftexample';
open_system(mdl)
examine the subsystem aircraft dynamics model
.
subsys = [mdl,'/aircraft dynamics model'];
open_system(subsys)
suppose you want to specify the following uncertain real values for the gain blocks mw
and zd
.
mw_unc = ureal('mw',-0.00592,'percentage',50); zd_unc = ureal('zd',-63.9979,'percentage',30);
to specify these values as the linearization for these blocks, create a blocksubs
structure to pass to the linearize
function. the field names are the names of the simulink blocks, and the values are the corresponding uncertain values. note that in this model, the name of the mw
block is gain4
, and the name of the zd
block is gain5
.
mw_name = [subsys,'/gain4']; zd_name = [subsys,'/gain5']; blocksubs(1).name = mw_name; blocksubs(1).value = mw_unc; blocksubs(2).name = zd_name; blocksubs(2).value = zd_unc;
compute the uncertain linearization. linearize
linearizes the model at operating point specified in the model, making the substitutions specified by blocksubs
. the result is an uncertain state-space model with an uncertain real parameter for each of the two uncertain gains.
sys = linearize(mdl,blocksubs)
uncertain continuous-time state-space model with 1 outputs, 1 inputs, 7 states. the model uncertainty consists of the following blocks: mw: uncertain real, nominal = -0.00592, variability = [-50,50]%, 1 occurrences zd: uncertain real, nominal = -64, variability = [-30,30]%, 1 occurrences type "sys.nominalvalue" to see the nominal value and "sys.uncertainty" to interact with the uncertain elements.
examine the uncertain model response.
step(sys)
step
takes random samples and provides a sense of the range of responses within the uncertainty of the linearized model.
see also
(simulink control design)