Batch Compute Steady-State Operating Points

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 a vector 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.

  1. Open Simulink model.

    sys = 'scdspeed';
  2. Create operating point specification object.

    opspec1 = operspec(sys);

    By default, all model states are specified to be at steady state.

  3. Configure the output specification.

    blk = [sys '/rad//s to rpm'];
    opspec1 = addoutputspec(opspec1,blk,1);
    opspec1.Outputs(1).Known = true;
    opspec1.Outputs(1).y = 1500;

    opspec1 specifies a stead-state operating point in which the output of the block rad/s to rpm is fixed at 500.

  4. Create and configure additional operating point specifications.

    opspec2 = copy(opspec1);
    opspec2.Outputs(1).y = 2000;
    opspec3 = copy(opspec1);
    opspec3.Outputs(1).y = 2500;

    Using the copy command creates an independent operating point specification that you can edit without changing opspec1. Here, the specifications opspec2 and opspec3 are identical to opspec1, except for the target output level.

  5. Find the operating points that meet each of the three output specifications.

    opspecs = [opspec1,opspec2,opspec3];
    ops = findop(sys,opspecs);

    Pass the three operating point specifications to findop in the vector opspecs. When you give findop a vector of operating point specifications, it finds all the operating points with only one model compilation. ops is a vector of operating point objects for the model scdspeed that correspond to the three specifications in the vector.

See Also

Related Examples

Was this topic helpful?