| Simulink® Control Design™ | ![]() |
| On this page… |
|---|
In this tutorial, you learn how to use Simulink® Control Design™ functions at the command line to accomplish the following tasks:
Compute a steady-state operating point of a Simulink® Model.
Simulating the model at the steady-state operating point.
The watertank Simulink® Model. The watertank model shown in the following figure contains the Water-Tank System plant. It also contains a simple proportional-integral-derivative controller, called Controller, in a single-loop feedback system.

To view the Water-Tank System and the Controller, double-click the corresponding subsystem in the watertank model. For descriptions of these subsystems, see the following sections:
For information about creating Simulink models, see Creating a Simulink® Model.
Water-Tank Subsystem. The Water-Tank subsystem of the watertank model appears in the following figure.

This model represents the water-tank system depicted in the following figure.

Water enters the tank from the top at a rate proportional to the voltage, V, applied to the pump. The water leaves through an opening in the tank base at a rate that is proportional to the square root of the water height in the tank. The presence of the square root in the water flow rate results in a nonlinear plant.
The following table describes the variables, parameters, differential equations, states, inputs, and outputs of the water-tank system.
| Variables | H is the height of water in the tank. Vol is the volume of water in the tank. V is the voltage applied to the pump. |
| Parameters | A is the cross-sectional area of the tank. b is a constant related to the flow rate into the tank. a is a constant related to the flow rate out of the tank. |
| Differential equation |
|
| States | H |
| Inputs | V |
| Outputs | H |
Controller Subsystem. The Controller subsystem of the watertank model appears in the following figure.

This model represents a simple proportional-integral-derivative controller that controls the height of the water in the Water-Tank System. This model contains one state, Integrator.
An operating point is a set of inputs, outputs, and states that describe the operating conditions of a system. A steady-state operating point is an operating point in which all states remain constant over time. Many real-world systems are designed to operate at steady-state operating points. Computing a steady-state operating point is required for:
Analyzing system dynamics at steady state
Linearizing a model at a steady-state operating point
Designing a compensator for use at a steady-state operating point
For more information about steady-state operating points, see Equilibrium Operating Points.
To compute a steady-state operating point:
Open the watertank model by typing the following in the MATLAB® command window:
watertank
The model opens in Simulink, as shown in the following figure.

Create an operating point specification object using the operspec command by typing the following:
watertank_spec = operspec('watertank')This command returns the following result:
Operating Specification for the Model watertank.
(Time-Varying Components Evaluated at time t=0)
States:
----------
(1.) watertank/Controller/Integrator
spec: dx = 0, initial guess: 0
(2.) watertank/Water-Tank System/H
spec: dx = 0, initial guess: 0
Inputs: None
----------
Outputs: None
----------The operating point specification object watertank_spec contains objects for all the states, inputs, and outputs in the model. You can view the operating point specification for a state using the get command. For example, to view the state H, type the following:
get(watertank_spec.States(2))
This command returns the following result:
Block: 'watertank/Water-Tank System/H'
StateName: ''
x: 0
Nx: 1
Ts: [0 0]
SampleType: 'CSTATE'
inReferencedModel: 0
Known: 0
SteadyState: 1
Min: -Inf
Max: Inf
Description: ''SteadyState defaults to a value of 1 for both states, H and Integrator. This indicates that a steady-state operating point will be computed.
Compute the operating point from the operating point specification object watertank_spec using the findop command by typing the following:
[watertank_op,op_report]=findop('watertank',watertank_spec)This command returns the following result:
Operating Point for the Model watertank.
(Time-Varying Components Evaluated at time t=0)
States:
----------
(1.) watertank/Controller/Integrator
x: 1.26
(2.) watertank/Water-Tank System/H
x: 10
Inputs: None
----------
Operating Report for the Model watertank.
(Time-Varying Components Evaluated at time t=0)
Operating point specifications were successfully met.
States:
----------
(1.) watertank/Controller/Integrator
x: 1.26 dx: 0 (0)
(2.) watertank/Water-Tank System/H
x: 10 dx: -2.66e-013 (0)
Inputs: None
----------
Outputs: None
----------
This operating point and operating point report shows the following information for each state:
Values of the states, x, in the operating point.
The values are 1.26 for the state Integrator and 10 for the state H.
Time derivatives of the states, dx, with the desired value in parentheses. For a steady-state operating point, the time derivatives of all states are very close to or equal to zero.
The time derivatives are 0 for the state Integrator and -2.66e-013 for the state H. These values show that the operating point is at steady state.
Save the operating point for future reuse using the save command by typing the following:
save watertank_op
Tip You can use the load command to reload this operating point. |
To simulate the model at the steady-state operating point you computed, perform the following steps:
Initialize the Simulink model with the steady-state operating point. See Initializing the Simulink® Model with the Steady-State Operating Point.
Simulate the initialized model. See Simulating the Initialized Model.
In this portion of the tutorial, you initialize the Simulink model using a steady-state operating point. You must have already computed this operating point, as described in Computing a Steady-State Operating Point.
To initialize the model with the steady-state operating point:
In the watertank Simulink model window, select Simulation > Configuration Parameters.
The Configuration Parameters dialog box opens.
Select the Data Import/Export node.
In the Load from workspace portion of the Data Import/Export node, do the following:
For Input, select the check box, and type getinputstruct(watertank_op).
This action sets the inputs of the model operating point to the input values in watertank_op.
For Initial State, select the check box, and type getstatestruct(watertank_op).
This action sets the initial states of the model operating point to the initial state values in watertank_op.

Click OK.
In this portion of the tutorial, you simulate the Simulink model that is initialized at the steady-state operating point.
You must have already initialized the watertank model in Initializing the Simulink® Model with the Steady-State Operating Point.
To simulate the initialized model:
Add a Scope block to each subsystem.
In the Water-Tank System model, add a Scope block to the output signal of the integrator. This signal is the state H.

In the Controller model, add a Scope block to the output signal of the integrator. This signal is the state Integrator.

Open the Scope block window for each model by double-clicking the Scope blocks in the corresponding Simulink model windows.
Simulate each model by clicking the play arrow in the Simulink model windows.
This action displays the states H and Integrator in their respective Scope windows. The Scope outputs shows these results:
The state H remains constant over time at the expected value of 10.
The state Integrator remains constant over time at the expected value of 1.2649.
Both state values match the values found during the steady-state operating point computation.
Scope Output for State H

Scope Output for State Integrator

The simulations show that both of the states in the model remain constant over time.
![]() | Tutorial — Computing a Steady-State Operating Point for a Simulink® Model Using the GUI | What Are Operating Points? | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |