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;
输入参数
Simulink 模型的工作点设定,指定为以下项之一:
OperatingSpec
对象 - 在单个OperatingSpec
对象中添加输出设定。OperatingSpec
对象数组 - 在数组中的所有OperatingSpec
对象中添加相同的输出设定。所有设定对象必须具有相同的Model
属性。
要为您的模型创建 OperatingSpec
对象,请使用 operspec
函数。
要向其添加输出设定的 Simulink 模块,指定为包含其模块路径的字符向量或字符串。block
必须位于在 opspec.Model
中指定的 Simulink 模型中。
要向其添加输出设定的输出端口,指定为范围 [1
,N
] 内的正整数,其中 N
是指定的 block
上的输出端口数量。
输出参量
替代功能
稳态管理器
使用稳态管理器配平模型时,您可以通过交互方式添加输出设定。有关详细信息,请参阅Compute Operating Points from Specifications Using Steady State Manager。
Simulink 模型
您可以直接在 Simulink 模型中添加输出设定。要这样做,请右键点击要向其添加设定的信号,然后选择线性分析点 > 配平输出约束。
版本历史记录
在 R2006a 之前推出
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)