operpoint
Create operating point for金宝appmodel
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, thereforeop
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 thecopy
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 ----------
创建一个新的操作点object using assignment with the=
operator.
op2 = op1;
op2
is an operating-point object that points to the same underlying data asop1
. Because of this link, you cannot independently change properties of the two operating-point objects. To see this, change a property ofop2
. For instance, change the value for the first state from 0 to 2. The change shows in theStates
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 ofop1
to see that the corresponding property value ofop1
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 thecopy
function.
op3 = copy(op1);
Now, when you change a property ofop3
,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 ----------
Inop1
, the corresponding value remains 2.
op1.States(1).x
ans = 2
This copy behavior occurs because the operating-point object is ahandle object. For more information about handle objects, seeHandle 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 anOperatingPoint
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, seeSimulink 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, seeCopy an Operating Point.
Alternative Functionality
Theoperpoint
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 thefindop
function. For more information, seeCompute Steady-State Operating Points.
Version History
Introduced before R2006aR2021b:PortWidth
property of operating point inputs will be removed
Not recommended starting in R2021b
The inputPortWidth
property of operating points will be removed in a future release. Use the newNu
property instead.
To update your code, change instances ofPortWidth
toNu
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; |
Beispiel öffnen
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)