addoutputspec
在工作点设定中添加输出设定
说明
示例
在工作点设定对象中添加输出设定
打开 Simulink 模型。
sys = 'scdspeed';
open_system(sys)
为模型创建一个默认工作点设定对象。
opspec = operspec(sys)
opspec = Operating point specification for the Model scdspeed. (Time-Varying Components Evaluated at time t=0) States: ---------- x Known SteadyState Min Max dxMin dxMax ___________ ___________ ___________ ___________ ___________ ___________ ___________ (1.) scdspeed/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar 0.543 false true -Inf Inf -Inf Inf (2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s 209.48 false true -Inf Inf -Inf Inf Inputs: ---------- u Known Min Max _____ _____ _____ _____ (1.) scdspeed/Throttle perturbation 0 false -Inf Inf Outputs: None ----------
默认工作点设定对象没有输出设定,因为模型中没有根级输出端口。
在 rad/s to rpm 模块的输出端口添加一个输出设定。
newspec = addoutputspec(opspec,'scdspeed/rad//s to rpm',1);
为输出设定指定已知值 2000
rpm。
newspec.Outputs(1).Known = 1; newspec.Outputs(1).y = 2000;
查看更新后的工作点设定。
newspec
newspec = Operating point specification for the Model scdspeed. (Time-Varying Components Evaluated at time t=0) States: ---------- x Known SteadyState Min Max dxMin dxMax ___________ ___________ ___________ ___________ ___________ ___________ ___________ (1.) scdspeed/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar 0.543 false true -Inf Inf -Inf Inf (2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s 209.48 false true -Inf Inf -Inf Inf Inputs: ---------- u Known Min Max _____ _____ _____ _____ (1.) scdspeed/Throttle perturbation 0 false -Inf Inf Outputs: ---------- y Known Min Max _____ _____ _____ _____ (1.) scdspeed/rad//s to rpm 2000 true -Inf Inf
在多个工作点设定对象中添加输出设定
打开 Simulink 模型。
sys = 'scdspeed';
open_system(sys)
为模型创建一个由默认工作点设定对象组成的 3×1 数组。
opspec = operspec(sys,[3,1])
opspec = Array of operating point specifications for the model scdspeed. To display an operating point specification, select an element from the array.
在 rad/s to rpm 模块的输出端口添加一个输出设定。
newspec = addoutputspec(opspec,'scdspeed/rad//s to rpm',1);
此输出设定将添加到 opspec
中的所有工作点设定对象中。
您可以在 opspec
中为每个设定指定不同的输出约束。例如,为每个设定指定不同的已知值。
newspec(1,1).Outputs(1).Known = 1; newspec(1,1).Outputs(1).y = 1900; newspec(2,1).Outputs(1).Known = 1; newspec(2,1).Outputs(1).y = 2000; newspec(3,1).Outputs(1).Known = 1; newspec(3,1).Outputs(1).y = 2100;
输入参数
opspec
— 工作点设定
OperatingSpec
对象 | OperatingSpec
对象数组
Simulink 模型的工作点设定,指定为以下项之一:
OperatingSpec
对象 - 在单个OperatingSpec
对象中添加输出设定。OperatingSpec
对象数组 - 在数组中的所有OperatingSpec
对象中添加相同的输出设定。所有设定对象必须具有相同的Model
属性。
要为您的模型创建 OperatingSpec
对象,请使用 operspec
函数。
block
— Simulink 模块
字符向量 | 字符串
要向其添加输出设定的 Simulink 模块,指定为包含其模块路径的字符向量或字符串。block
必须位于在 opspec.Model
中指定的 Simulink 模型中。
port
— 输出端口
正整数
要向其添加输出设定的输出端口,指定为范围 [1
,N
] 内的正整数,其中 N
是指定的 block
上的输出端口数量。
输出参数
替代功能
稳态管理器
使用稳态管理器配平模型时,您可以通过交互方式添加输出设定。有关详细信息,请参阅Compute Operating Points from Specifications Using Steady State Manager。
Simulink 模型
您可以直接在 Simulink 模型中添加输出设定。要这样做,请右键点击要向其添加设定的信号,然后选择线性分析点 > 配平输出约束。
版本历史记录
在 R2006a 之前推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 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)