Analyze Command-Line Batch Linearization Results
Using Response Plots
This example shows how to plot and analyze the step response for batch linearization
results obtained at the command line. The term batch linearization results refers to the
ss model array returned by the slLinearizer interface or linearize function. This
array contains linearizations for varying parameter values, operating points, or both, such
as illustrated in “Batch Linearize Model for Parameter Variations at Single Operating
Point” on page 3-20 and “Vary Operating Points and Obtain Multiple Transfer Functions
Using slLinearizer Interface” on page 3-41. You can use the techniques illustrated in this
example to analyze the frequency response, stability, or sensitivity for batch linearization
results.
Obtain Batch Linearization Results
Load the batch linearization results saved in scd_batch_lin_results1.mat.
The following code obtains linearizations of the watertank model for four simulation
snapshot times, t = [0 1 2 3]. At each snapshot time, the model parameters, A and b,
are varied. The sample values for A are [10 20 30], and the sample values for b are [4
6]. The slLinearizer interface includes analysis points at the reference signal and
plant output.
open_system('watertank')
sllin = slLinearizer('watertank',{'watertank/Desired Water Level',...
'watertank/Water-Tank System'})
[A_grid,b_grid] = ndgrid([10,20,30],[4 6]);
params(1).Name = 'A';
params(1).Value = A_grid;
params(2).Name = 'b';
params(2).Value = b_grid;
sllin.Parameters = params;
sllin.OperatingPoints = [0,1,2,3];
linsys = getIOTransfer(sllin,'Desired Water Level','Water-Tank System');
linsys, a 4-by-3-by-2 ss model array, contains the closed-loop transfer function of the
linearized watertank model from the reference input to the plant output. The operating
point varies along the first array dimension of linsys, and the parameters A and b vary
along the second and third dimensions, respectively.
3 Batch Linearization