operpoint
Create operating point for Simulink model
Syntax
Description
Examples
Create Operating Point for Simulink Model
Open Simulink model.
open_system('magball')
Create operating point for the model.
op = operpoint('magball')
op = Operating point for the Model magball. (Time-Varying Components Evaluated at time t=0) States: ---------- x _______ (1.) magball/Controller/PID Controller/Filter/Cont. Filter/Filter 0 (2.) magball/Controller/PID Controller/Integrator/Continuous/Integrator 14.0071 (3.) magball/Magnetic Ball Plant/Current 7.0036 (4.) magball/Magnetic Ball Plant/dhdt 0 (5.) magball/Magnetic Ball Plant/height 0.05 Inputs: None ----------
op
lists each block in the model that has states. There are no root-level inports in this model, therefore op
does not contain inputs.
Copy an Operating Point
You can create new operating-point variables in three ways:
Using the
operpoint
functionUsing assignment with the equals (
=
) operatorUsing the
copy
function
Using the =
operator results in linked variables that both point to the same underlying data. Using the copy
function results in an independent operating-point object. In this example, create operating-point objects both ways, and examine their behavior.
mdl = 'watertank';
open_system(mdl)
op1 = operpoint(mdl)
op1 = Operating point for the Model watertank. (Time-Varying Components Evaluated at time t=0) States: ---------- x _ (1.) watertank/PID Controller/Integrator/Continuous/Integrator 0 (2.) watertank/Water-Tank System/H 1 Inputs: None ----------
Create a new operating-point object using assignment with the =
operator.
op2 = op1;
op2
is an operating-point object that points to the same underlying data as op1
. Because of this link, you cannot independently change properties of the two operating-point objects. To see this, change a property of op2
. For instance, change the value for the first state from 0 to 2. The change shows in the States
section of the display.
op2.States(1).x = 2
op2 = Operating point for the Model watertank. (Time-Varying Components Evaluated at time t=0) States: ---------- x _ (1.) watertank/PID Controller/Integrator/Continuous/Integrator 2 (2.) watertank/Water-Tank System/H 1 Inputs: None ----------
Examine the display of op1
to see that the corresponding property value of op1
also changes from 0 to 2.
op1
op1 = Operating point for the Model watertank. (Time-Varying Components Evaluated at time t=0) States: ---------- x _ (1.) watertank/PID Controller/Integrator/Continuous/Integrator 2 (2.) watertank/Water-Tank System/H 1 Inputs: None ----------
To create an independent copy of an operating-point object, use the copy
function.
op3 = copy(op1);
Now, when you change a property of op3
, op1
does not change. For instance, change the value for the first state from 2 to 4.
op3.States(1).x = 4
op3 = Operating point for the Model watertank. (Time-Varying Components Evaluated at time t=0) States: ---------- x _ (1.) watertank/PID Controller/Integrator/Continuous/Integrator 4 (2.) watertank/Water-Tank System/H 1 Inputs: None ----------
In op1
, the corresponding value remains 2.
op1.States(1).x
ans = 2
This copy behavior occurs because the operating-point object is a handle object. For more information about handle objects, see Handle Object Behavior.
Input Arguments
mdl
— Simulink model name
character vector | string
Simulink model name, specified as a character vector or string. The model must be in the current working folder or on the MATLAB® path.
Output Arguments
op
— Operating point
OperatingPoint
object
Operating point, returned as an OperatingPoint
object with the
following properties.
Property | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Model | Simulink model name, returned as a character vector. | ||||||||||||||||||
States | State operating point, returned as a vector of state objects. Each entry in For a list of supported states for operating point objects, see Simulink Model States Included in Operating Point Object. Note If the block has multiple named continuous states, Each state object has the following fields:
| ||||||||||||||||||
Inputs | Input level at the operating point, returned as a vector of input objects. Each entry
in Each input object has the following fields:
| ||||||||||||||||||
Time | Times at which any time-varying functions in the model are evaluated, returned as a vector. | ||||||||||||||||||
Version | Object version number |
Tips
You can create new operating points of in three ways:
Construct a new object using the
operpoint
function.Create a new variable by assignment with the equals (=) operator.
Copy an operating point object using the
copy
command.
Using
operpoint
orcopy
creates a new, independent object. When you use assignment, there is a link between the old and new variable. For an example, see Copy an Operating Point.
Alternative Functionality
The operpoint
function returns an operating point with the initial
state and input values of the model. To create an operating point that meets your application
specifications, use the findop
function. For more information, see
Compute Steady-State Operating Points.
Version History
Introduced before R2006aR2021b: PortWidth
property of operating point inputs will be removed
The input PortWidth
property of operating points will be removed in a
future release. Use the new Nu
property instead.
To update your code, change instances of PortWidth
to
Nu
as shown in the following table.
Not Recommended | Recommended |
---|---|
op = operpoint('scdplane'); numIn = op.Inputs(1).PortWidth; |
op = operpoint('scdplane'); numIn = op.Inputs(1).Nu; |
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)