Operating point specifications
opspec = operspec(sys)
returns
the operating point specifications object for steady state operating
point analysis using opspec
= operspec(sys
)findop
.
The Simulink^{®} model must be open.

Simulink model name, specified as a string inside single
quotes ( 

Operating point specification object. After creating the operating point object, you can modify the
operating point states and input levels. For example, The operating point specification object has the following properties:

SteadyState 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. (TimeVarying Components Evaluated at time t=0) States:  (1.) watertank/PID Controller/Integrator spec: dx = 0, initial guess: 0 (2.) watertank/WaterTank 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 rootlevel inport blocks and no rootlevel 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. (TimeVarying 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/WaterTank 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.
Initialize SteadyState 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 the 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. (TimeVarying 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/WaterTank System/H x: 10 dx: 1.1e014 (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.
Operating Point (Trim Analysis) With Output Constraint
This example shows how to use addoutputspec
to
specify an output constraint to the operating point specification
object for computing the operating point.
Open Simulink model.
sys = 'scdspeed'; load_system(sys);
Create operating point specification object.
opspec = operspec(sys)
By default, opspec
specifies that the operating
point is at steady state, or equilibrium.
Operating Specification for the Model scdspeed. (TimeVarying Components Evaluated at time t=0) States:  (1.) scdspeed/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar spec: dx = 0, initial guess: 0.543 (2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s spec: dx = 0, initial guess: 209 Inputs:  (1.) scdspeed/Throttle perturbation initial guess: 0 Outputs: None 
operspec
extracts the default operating
point of the Simulink model with two states and one rootlevel
inport block. There are no rootlevel outport blocks or output constraints.
Fix the first output port of the Vehicle Dynamics to 2000 RPM.
opspec = addoutputspec(op_spec,'scdspeed/rad//s to rpm',1); opspec.Outputs.Known = 1; opspec.Outputs.y = 2000;
Find the operating point that meets this specification.
op = findop(sys,op_spec)
Operating Point Search Report:  Operating Report for the Model scdspeed. (TimeVarying Components Evaluated at time t=0) Operating point specifications were successfully met. States:  (1.) scdspeed/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar x: 0.544 dx: 2.66e013 (0) (2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s x: 209 dx: 8.48e012 (0) Inputs:  (1.) scdspeed/Throttle perturbation u: 0.00382 [Inf Inf] Outputs:  (1.) scdspeed/rad//s to rpm y: 2e+003 (2e+003)