Main Content

Batch Compute Steady-State Operating Points for Multiple Specifications

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:
---------------------------------

opreport = 


 Operating point search report for the Model scdspeed.
 (Time-Varying Components Evaluated at time t=0)

Operating point specifications were successfully met.
States: 
----------
    <strong>Min</strong>        <strong>x</strong>       <strong>Max</strong>    <strong>dxMin</strong>        <strong>dx</strong>        <strong>dxMax</strong>
    <strong>____</strong>    <strong>_______</strong>    <strong>___</strong>    <strong>_____</strong>    <strong>__________</strong>    <strong>_____</strong>

(1.) scdspeed/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar
    -Inf    0.59562    Inf      0      3.4112e-09      0  
(2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s
    -Inf     157.08    Inf      0      -5.572e-07      0  

Inputs: 
----------
    <strong>Min</strong>        <strong>u</strong>       <strong>Max</strong>
    <strong>____</strong>    <strong>_______</strong>    <strong>___</strong>

(1.) scdspeed/Throttle  perturbation
    -Inf    -1.6086    Inf

Outputs: 
----------
    <strong>Min</strong>      <strong>y</strong>      <strong>Max</strong> 
    <strong>____</strong>    <strong>____</strong>    <strong>____</strong>

(1.) scdspeed/rad//s to rpm
    1500    1500    1500

 Operating point search report 2:
---------------------------------

opreport = 


 Operating point search report for the Model scdspeed.
 (Time-Varying Components Evaluated at time t=0)

Operating point specifications were successfully met.
States: 
----------
    <strong>Min</strong>        <strong>x</strong>       <strong>Max</strong>    <strong>dxMin</strong>        <strong>dx</strong>         <strong>dxMax</strong>
    <strong>____</strong>    <strong>_______</strong>    <strong>___</strong>    <strong>_____</strong>    <strong>___________</strong>    <strong>_____</strong>

(1.) scdspeed/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar
    -Inf    0.54363    Inf      0       2.6649e-13      0  
(2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s
    -Inf     209.44    Inf      0      -8.4758e-12      0  

Inputs: 
----------
    <strong>Min</strong>         <strong>u</strong>        <strong>Max</strong>
    <strong>____</strong>    <strong>_________</strong>    <strong>___</strong>

(1.) scdspeed/Throttle  perturbation
    -Inf    0.0038183    Inf

Outputs: 
----------
    <strong>Min</strong>      <strong>y</strong>      <strong>Max</strong> 
    <strong>____</strong>    <strong>____</strong>    <strong>____</strong>

(1.) scdspeed/rad//s to rpm
    2000    2000    2000

 Operating point search report 3:
---------------------------------

opreport = 


 Operating point search report for the Model scdspeed.
 (Time-Varying Components Evaluated at time t=0)

Operating point specifications were successfully met.
States: 
----------
    <strong>Min</strong>        <strong>x</strong>       <strong>Max</strong>    <strong>dxMin</strong>        <strong>dx</strong>         <strong>dxMax</strong>
    <strong>____</strong>    <strong>_______</strong>    <strong>___</strong>    <strong>_____</strong>    <strong>___________</strong>    <strong>_____</strong>

(1.) scdspeed/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar
    -Inf    0.51066    Inf      0       1.3297e-08      0  
(2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s
    -Inf      261.8    Inf      0      -7.8334e-08      0  

Inputs: 
----------
    <strong>Min</strong>       <strong>u</strong>       <strong>Max</strong>
    <strong>____</strong>    <strong>______</strong>    <strong>___</strong>

(1.) scdspeed/Throttle  perturbation
    -Inf    1.4971    Inf

Outputs: 
----------
    <strong>Min</strong>      <strong>y</strong>      <strong>Max</strong> 
    <strong>____</strong>    <strong>____</strong>    <strong>____</strong>

(1.) scdspeed/rad//s to rpm
    2500    2500    2500

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.

See Also

|

Related Topics