This example shows how to find operating points for multiple operating point specifications using the findop
command. You can batch linearize the model using the operating points and study the change in model behavior.
Each time you call findop
, the software compiles the Simulink model. To find operating points for multiple specifications, you can give findop
an array of operating point specifications, instead of repeatedly calling findop
within a for loop. The software uses a single model compilation to compute the multiple operating points, which is efficient, especially for models that are expensive to recompile repeatedly.
Open the Simulink model.
sys = 'scdspeed';
open_system(sys)
Create an array of default operating point specification objects.
opspec = operspec(sys,3);
To find steady-state operating points at which the output of the rad/s to rpm block is fixed, add a known output specification to each operating point specification object.
opspec = addoutputspec(opspec,[sys '/rad//s to rpm'],1); for i = 1:3 opspec(i).Outputs(1).Known = true; end
Specify different known output values for each operating point specification.
opspec(1).Outputs(1).y = 1500; opspec(2).Outputs(1).y = 2000; opspec(3).Outputs(1).y = 2500;
Alternatively, you can configure operating point specifications using the Model Linearizer and export the specifications to the MATLAB workspace. For more information, see Import and Export Specifications for Operating Point Search.
Find the operating points that meet each of the three output specifications. findop
computes all the operating points using a single model compilation.
ops = findop(sys,opspec);
Operating point search report 1: --------------------------------- Operating point search report for the Model scdspeed. (Time-Varying 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.596 dx: 3.41e-09 (0) (2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s x: 157 dx: -5.57e-07 (0) Inputs: ---------- (1.) scdspeed/Throttle perturbation u: -1.61 [-Inf Inf] Outputs: ---------- (1.) scdspeed/rad//s to rpm y: 1.5e+03 (1.5e+03) Operating point search report 2: --------------------------------- Operating point search report for the Model scdspeed. (Time-Varying 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.66e-13 (0) (2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s x: 209 dx: -8.48e-12 (0) Inputs: ---------- (1.) scdspeed/Throttle perturbation u: 0.00382 [-Inf Inf] Outputs: ---------- (1.) scdspeed/rad//s to rpm y: 2e+03 (2e+03) Operating point search report 3: --------------------------------- Operating point search report for the Model scdspeed. (Time-Varying 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.511 dx: 1.33e-08 (0) (2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s x: 262 dx: -7.83e-08 (0) Inputs: ---------- (1.) scdspeed/Throttle perturbation u: 1.5 [-Inf Inf] Outputs: ---------- (1.) scdspeed/rad//s to rpm y: 2.5e+03 (2.5e+03)
ops
is a vector of operating points for the scdspeed
model that correspond to the specifications in opspec
. The output value for each operating point matches the known value specified in the corresponding operating point specification.