| Contents | Index |
[op,opreport]
= findop(sys,opspec)
[op,opreport]
= findop(sys,opspec,options)
op = findop(sys,tsnapshot)
[op,opreport] = findop(sys,opspec) returns the steady-state operating point of the model that meets the specifications opspec. The Simulink model must be open.
[op,opreport] = findop(sys,opspec,options) searches for the operating point of the model using additional optimization algorithm options specified by options.
op = findop(sys,tsnapshot) simulates the model and extracts operating points at the simulation snapshot time instants (snapshots) t.
Initialize operating point search at a simulation snapshot or a previously computed operating point using initopspec.
Linearize the model at the operating point op using linearize.
sys |
Simulink model name, specified as a string inside single quotes (' '). |
opspec |
Operating point specification object, specified using operspec. |
options |
Algorithm options, specified using linoptions. |
tsnapshot |
Simulation snapshot time instants when to extract the operating point of the model, specified as a scalar or vector. |
opreport |
Optimization results report object. This report displays automatically even when you suppress the output using a semicolon. You can avoid displaying the report by using linoptions to set the DisplayReport field in options to 'off'. The opreport object has these properties:
|
A steady-state operating point of the model, also called equilibrium or trim condition, includes state variables that do not change with time.
A model might have several steady-state operating points. For example, a hanging pendulum has two steady-state operating points. A stable steady-state operating point occurs when a pendulum hangs straight down. That is, the pendulum position does not change with time. When the pendulum position deviates slightly, the pendulum always returns to equilibrium; small changes in the operating point do not cause the system to leave the region of good approximation around the equilibrium value.
An unstable steady-state operating point occurs when a pendulum points upward. As long as the pendulum points exactly upward, it remains in equilibrium. However, when the pendulum deviates slightly from this position, it swings downward and the operating point leaves the region around the equilibrium value.
When using optimization search to compute operating points for a nonlinear system, your initial guesses for the states and input levels must be in the neighborhood of the desired operating point to ensure convergence.
When linearizing a model with multiple steady-state operating points, it is important to have the right operating point. For example, linearizing a pendulum model around the stable steady-state operating point produces a stable linear model, whereas linearizing around the unstable steady-state operating point produces an unstable linear model.
Steady-State Operating Point (Trimming) From Specifications
This example shows how to use findop to compute an operating point of a model from specifications.
Open Simulink model.
sys = 'watertank'; load_system(sys);
Create operating point specification object.
opspec = operspec(sys)
By default, all model states are specified to be at steady state.
Operating Specification for the Model watertank.
(Time-Varying Components Evaluated at time t=0)
States:
----------
(1.) watertank/PID Controller/Integrator
spec: dx = 0, initial guess: 0
(2.) watertank/Water-Tank System/H
spec: dx = 0, initial guess: 1
Inputs: None
----------
Outputs: None
----------operspec extracts the default operating point of the Simulink model with two states. The model does not have any root-level inport blocks and no root-level outport blocks or output constraints.
Configure specifications for the first model state.
opspec.States(1).SteadyState = 1; opspec.States(1).x = 2; opspec.States(1).Min = 0;
The first state must be at steady state and have an initial value of 2 with a lower bound of 0.
Configure specifications for the second model state.
opspec.States(2).Known = 1; opspec.States(2).x = 10;
The second state sets the desired height of the water in the tank at 10. Configuring the height as a known value keeps this value fixed when computing the operating point.
Find the operating point that meets these specifications.
[op,opreport] = findop(sys,opspec) bdclose(sys);
opreport describes how closely the optimization algorithm met the specifications at the end of the operating point search.
Operating Report for the Model watertank.
(Time-Varying Components Evaluated at time t=0)
Operating point specifications were successfully met.
States:
----------
(1.) watertank/PID Controller/Integrator
x: 1.26 dx: 0 (0)
(2.) watertank/Water-Tank System/H
x: 10 dx: 0 (0)
Inputs: None
----------
Outputs: None
----------dx indicates the time derivative of each state. The actual dx values of zero indicate that the operating point is at steady state. The desired dx value is in parentheses.
Steady-State Operating Point to Meet Output Specification
This example shows how to specify an output constraint for computing the steady-state operating point of a model.
Open Simulink model.
sys = 'watertank'; load_system(sys);
Create operating point specification object.
opspec = operspec(sys);
By default, all model states are specified to be at steady state.
Configure the output specification.
opspec.Outputs(1).y = 2000; opspec.Outputs(1).Known = true;
Find the operating point that meets the output specification.
[op,opreport] = findop(sys,opspec) bdclose(sys);
Initialize Steady-State Operating Point Search Using Simulation
This example shows how to use findop to compute an operating point of a model from specifications, where the initial state values are extracted from a simulation snapshot.
Open Simulink model.
sys = 'watertank'; load_system(sys);
Extract an operating point from simulation after 10 time units.
opsim = findop(sys,10);
Create operating point specification object.
By default, all model states are specified to be at steady state.
opspec = operspec(sys);
Configure initial values for operating point search.
opspec = initopspec(opspec,opsim);
Find the steady state operating point that meets these specifications.
[op,opreport] = findop(sys,opspec) bdclose(sys);
opreport describes the optimization algorithm status at the end of the operating point search.
Operating Report for the Model watertank.
(Time-Varying Components Evaluated at time t=0)
Operating point specifications were successfully met.
States:
----------
(1.) watertank/PID Controller/Integrator
x: 1.26 dx: 0 (0)
(2.) watertank/Water-Tank System/H
x: 10 dx: -1.1e-014 (0)
Inputs: None
----------
Outputs: None
----------dx, which is the time derivative of each state, is effectively zero. This value of the state derivative indicates that the operating point is at steady state.
Steady-State Operating Points at Simulation Snapshots
This example shows how to use findop to extract operating points of a model from specifications snapshots.
Open Simulink model.
sys = 'magball'; load_system(sys);
Extract an operating point from simulation at 10 and 20 time units.
op = findop(sys,[10,20]);
Display the first operating point.
op(1)
Operating Point for the Model magball.
(Time-Varying Components Evaluated at time t=10)
States:
----------
(1.) magball/Controller/PID Controller/Filter
x: 5.47e-007
(2.) magball/Controller/PID Controller/Integrator
x: 14
(3.) magball/Magnetic Ball Plant/Current
x: 7
(4.) magball/Magnetic Ball Plant/dhdt
x: 8.44e-008
(5.) magball/Magnetic Ball Plant/height
x: 0.05
Inputs: None
----------Display the second operating point.
op(2)
Operating Point for the Model magball.
(Time-Varying Components Evaluated at time t=20)
States:
----------
(1.) magball/Controller/PID Controller/Filter
x: 2.07e-007
(2.) magball/Controller/PID Controller/Integrator
x: 14
(3.) magball/Magnetic Ball Plant/Current
x: 7
(4.) magball/Magnetic Ball Plant/dhdt
x: 3.19e-008
(5.) magball/Magnetic Ball Plant/height
x: 0.05
Inputs: None
----------View Operating Point Object
This example shows how to use get to display the operating point states, inputs, and outputs.
sys = 'watertank'; load_system(sys); op = operpoint(sys) get(op.States(1))
Synchronize Simulink Model Changes With Operating Point Specification
This example shows how to use update to update an existing operating point specification object after you update the Simulink model.
Open Simulink model.
sys = 'scdspeedctrl'; open_system(sys);
Create operating point specification object.
By default, all model states are specified to be at steady state.
opspec = operspec(sys);
In the Simulink model window, double-click the Reference Filter block. Change the Numerator of the transfer function to [100] and the Denominator to [1 20 100]. Click OK.

Find the steady state operating point that meets these specifications.
op = findop(sys,opspec)
This command results in an error because the changes to your model are not reflected in your operating point specification object:
??? The model scdspeedctrl has been modified and the operating point object is out of date. Update the object by calling the function update on your operating point object.
Update the operating point specification object with changes to the model. Repeat the operating point search.
opspec = update(opspec); op = findop(sys,opspec) bdclose(sys);
After updating the operating point specifications object, the optimization algorithm successfully finds the operating point.
By default, findop uses the optimizer graddescent_elim. To use a different optimizer, change the value of OptimizerType in options using linoptions.
findop automatically sets these Simulink model properties for optimization:
BufferReuse = 'off'
RTWInlineParameters = 'on'
BlockReductionOpt = 'off'
After the optimization completes, Simulink restores the original model properties.
Use the Control and Estimation Tools Manager.
initopspec | linearize | linoptions | operspec

Learn more about resources for designing, testing, and implementing control systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |