Simulink Control Design™ - MathWorks

(Tuis.) #1
Specify linearization I/Os.

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

Vary plant parameters A and b, and create a 3-by-4 parameter grid.

[A_grid,b_grid] = ndgrid(linspace(0.9*A,1.1*A,3),linspace(0.9*b,1.1*b,4));
params(1).Name = 'A';
params(1).Value = A_grid;
params(2).Name = 'b';
params(2).Value = b_grid;

Create a linearization option set, setting the StoreOffsets option to true.

opt = linearizeOptions('StoreOffsets',true);

Linearize the model using the specified parameter grid, and return the linearization
offsets in the info structure.

[sys,op,info] = linearize('watertank',io,params,opt);

Extract the linearization offsets.

offsets = getOffsetsForLPV(info)

offsets =

struct with fields:

x: [2x1x3x4 double]
y: [1x1x3x4 double]
u: [1x1x3x4 double]
dx: [2x1x3x4 double]

To configure an LPV System block, use the fields from offsets directly.

15 Alphabetical List

Free download pdf