Simulink Control Design™ - MathWorks

(Tuis.) #1
% - Default model initial conditions are used to initialize optimization.
opspec.States(5).Known = true;
%% Create the options
opt = findopOptions('DisplayReport','iter');
%% Specify ball heights at which to compute operating points
height = [0.05;0.1;0.15];
%% Loop over height values to find the corresponding operating points
for i = 1:length(height)
% Set the ball height in the specification
opspec.States(5).x = height(i);
% Update the model ball haight reference parameter
set_param('magball/Desired Height','Value',num2str(height(i)))
end
%% Compute operating points using the defined specs
[op,opreport] = findop(model,opspec,opt);

After running this script, op contains operating points corresponding to each of the
specified height values.

See Also


Apps
Linear Analysis Tool | Steady State Manager


Functions
findop


More About



  • “Generate MATLAB Code for Operating Point Configuration” on page 1-145

  • “Batch Linearize Model at Multiple Operating Points Using linearize Command” on
    page 3-28

  • “Vary Operating Points and Obtain Multiple Transfer Functions Using slLinearizer
    Interface” on page 3-41

  • “Batch Compute Steady-State Operating Points for Multiple Specifications” on page
    1-91

  • “Batch Compute Steady-State Operating Points for Parameter Variation” on page 1-
    95


See Also
Free download pdf