Simulink Control Design™ - MathWorks

(Tuis.) #1
Trim the operating point using both the custom constraints and the custom objective
function, and view the trimmed state values.

[op2,rpt2] = findop(mdl,opspec,opt);
op2.States

(1.) scdTanks/Inertia
x: 0
(2.) scdTanks/Tank1
x: 15
(3.) scdTanks/Tank2
x: 15
(4.) scdTanks/Tank3
x: 16

In the trimmed operating point, the pressure in Tank3 is within the [16,20] range
specified in the custom objective function.

To view the final value of the scalar objective function, check the CustomObj property of
the operating point search report.

rpt2.CustomObj

ans =

0

Add Custom Mapping

For complex models, you can define a custom mapping that selects a subset of the model
states, inputs, and outputs to pass to the custom constraint and objective functions. Doing
so simplifies the constraint and objective functions by eliminating unneeded states,
inputs, and outputs.

To specify a custom mapping, define a function with your operating point specification,
opspec, as an input argument, and output arguments:


  • indx - Indices of mapped states

  • indu - Indices of mapped inputs

  • indy - Indices of mapped outputs


1 Steady-State Operating Points

Free download pdf