Simulink Control Design™ - MathWorks

(Tuis.) #1

Improve Linear Analysis Performance


This example shows how to use the fastRestartForLinearAnalysis command to
speed up multiple calls to compiling functions in Simulink Control Design such as findop
and linearize.

Run Linear Analysis Commands in a Loop

In this example, you will trim and linearize a closed loop engine speed control model. The
PI control parameters are varied to observe how the closed loop behavior changes at
steady state. Since linearize and findop is called in a loop, the model will be compiled
2*N + 1 times including the first call to operspec.

Open the engine speed control model and obtain the linear analysis points from the
model.

mdl = 'scdspeedctrl';
open_system(mdl);
io = getlinio(mdl);
fopt = findopOptions('DisplayReport','off');

Configure the PI controller to use the base workspace variables kp and ki.

blk = [mdl,'/PID Controller'];
set_param(blk,'P','kp');
set_param(blk,'I','ki');

Create a grid of parameters to vary.

vp = 0.0005:0.0005:0.003;
vi = 0.0025:0.0005:0.005;

3 Batch Linearization

Free download pdf