In this model, there is an expected steady-state operating condition when the water level is at H
= 10
.
Compute Operating Point
To linearize a model, you must first obtain an operating point for the conditions at which you want to linearize the model. One approach is to first simulate the model and extract an operating point when the simulation is near the desired value. You can then use this operating point as a starting point for an optimization-based search (trimming) for a steady-state operating point.
Using the findop
function, simulate the model and obtain an operating point using the model conditions after 10
seconds.
In this operating point, H
is not at the desired value of 10
. However, you can use this operating point to initialize a search for an operating point where H
= 10
.
To configure the operating point search, first create an operating point specification object.
Initialize the values of the states in the operating point specification with the state values in the operating point opsim
.
Trim the model using the operating point specifications.
In this operating point, H
= 10
as expected. The operating point is at a steady state since the dx
values for the model states are near zero.
Configure Linear Analysis Points
To linearize the model, you must specify the portion of the model that you want to linearize. Linear analysis points specify the inputs and outputs of a linearized model. To extract the open loop linearized model of the water-tank plant, add an input point at the output of the Controller block and an output point, with a loop opening, at the output of the Water-Tank System block.
Specify the input point.
Specify the output point with a loop opening.
Linearize and Analyze Model
You can now linearize the model using the specified operating point and linear analysis points.
The resulting model is a state-space object that you can analyze using any of the tools in the Control System Toolbox™ software. For example, view the frequency response of the linear model.