Simulink Control Design™ - MathWorks

(Tuis.) #1
params(2).Name = 'b';
params(2).Value = b_grid;

Create a default operating point specification for the mode that specifies that both model
states are unknown and must be at steady state in the trimmed operating point.

opspec = operspec(sys);

Trim the model using the specified operating point specification, parameter grid, and
option set. Suppress the display of the operating point search report.

opt = findopOptions('DisplayReport','off');
[op,opreport] = findop(sys,opspec,params,opt);

findop trims the model for each parameter combination using only one model
compilation. op is a 3-by-4 array of operating point objects that correspond to the
specified parameter grid points.

To compute the closed-loop input/output transfer function for the model, define the
linearization input and output points as the reference input and model output,
respectively.

io(1) = linio('watertank/Desired Water Level',1,'input');
io(2) = linio('watertank/Water-Tank System',1,'output');

To extract multiple open-loop and closed-loop transfer functions from the same model,
batch linearize the system using an slLinearizer interface. For more information, see
“Vary Parameter Values and Obtain Multiple Transfer Functions” on page 3-32.

Batch linearize the model at the trimmed operating points using the specified I/O points
and parameter variations.

G = linearize(sys,op,io,params);

G is a 3-by-4 array of linearized models. Each entry in the array contains a linearization
for the corresponding parameter combination in params. For example, G(:,:,2,3)
corresponds to the linearization obtained by setting the values of the A and b parameters
to A_grid(2,3) and b_grid(2,3), respectively. The set of parameter values
corresponding to each entry in the model array G is stored in the SamplingGrid
property of G. For example, examine the corresponding parameter values for linearization
G(:,:,2,3):

G(:,:,2,3).SamplingGrid

3 Batch Linearization

Free download pdf