主要内容

Compute Operating Points from Specifications Using Steady State Manager

You can compute a steady-state operating point of a Simulink®通过在模型状态,输出和输入上指定约束,并找到满足这些约束的模型操作条件来模型。有关稳态操作点的更多信息,请参见About Operating PointsCompute Steady-State Operating Points.

To find an operating point for your Simulink model, you can interactively trim your model using theSteady State Manager, as shown in this example.

Alternatively, you can trim your model:

In this example, you compute an operating point to meet output specifications. Using a similar approach, you can define state or input specifications. Also, you can define a combination of state, output, and input specifications; that is, you do not have to use, for example, only state specifications.

有关修剪模型以满足规格的更多信息,请参见从规格计算稳态操作点.

OpenSteady State Manager

打开Simulin金宝appk模型。

sys ='scdspeed';Open_System(SYS)

To open theSteady State Manager, 在里面Simulink model window, in theAppsgallery, clickSteady State Manager.

Define Operating Point Specifications

为了创建操作点规范,Steady State Manager, on theSteady Statetab, click修剪规范.

在里面数据浏览器, 在里面规格ssection, the software adds a default operating point specification,SPEC1. Also, the规格tab opens along with a correspondingSPEC1document.

在里面SPEC1document, in the navigation tree, select the type of specification that you want to add. For this example, you want to find a steady-state operating point at which the engine speed is fixed at 2000 rpm using an output specification. Therefore, clickOutputs.

由于模型没有任何根级输出端口或定义的TRIM输出约束,因此操作点规范没有任何输出。为了向操作点规范添加输出,规格tab, clickAdd Outputs.

在“添加输出规格”对话框中,指定要添加输出规范的信号。要将信号添加到列表中,在Simulink模型窗口中,单击金宝apprad/s至rpm堵塞。这样做将信号添加到添加输出规格对话框中。

ClickAdd Signal(s).

该软件添加this signal toSPEC1as an output specification. To view and edit the specification, in theSPEC1document, clickOutputs.

所选信号以其源块的名称为输出规范表中列出。

Tip

To go to the block in your model that is associated with a given state, input, or output specification, in the specification table, click the block name.

Specify a known speed value. In theSPEC1document, in the已知列,选择相应的行,然后在价值column set the known value to2000.

Trim Model

计算符合此输出规范的操作点,规格tab, clickTrimPlay button.

这software trims the model and generates an operating point search report. The report,report1, is added to the数据浏览器, 在里面报告部分。Also, theReporttab opens along with a correspondingreport1document.

For this example, you use default trimming options. To specify different options, such as the optimization method or a custom cost function, on the规格tab, clickTrim Options.

检查优化搜索是否收敛到满足规格的解决方案,report1document, click优化状态.

这optimization status shows that the optimization algorithm terminated successfully, finding an operating point that meets the specifications.

最大错误情节和最大错误列显示每次迭代的最大约束违规行为。这堵塞列显示了最大约束违规的块。

验证工作点

For this example, the optimization search converged to an operating point that met the specification. When the operating point search report indicates that the search was unsuccessful, you can validate your operating point against the specifications. To do so, in thereport1文档,在导航树中,选择要检查的规格。对于此示例,单击Outputs.

在规范表中,已知值以灰色突出显示,并以红色突出显示约束违规。在此示例中,没有违规行为。

You can also verify whether the operating point is at steady state. For example, in thereport1document, clickStates.

Actual dxcolumn shows the rates of change of the state values at the operating point. Since these values are near zero, the states are not changing, showing that the operating point is in a steady state.

有关验证操作点的更多信息,请参见验证规格的操作点.

不同规格的修剪模型

You can also specify bounds for your specification rather than known values. For example, suppose that you know that there is a steady-state condition in the range from 1900 to 2100 rpm. To find this operating point, first create another specification by copying and editing previous specification. In the数据浏览器, right-clickSPEC1, and select复制.

该软件添加规格2数据浏览器. To open the specification document for editing, double-click this new specification.

在里面规格2document, clickOutputs. Then, in the specification table:

  • 在里面价值列,如果有一个,请指定值的初始猜测。

  • 在里面已知column, clear the entry for the output specification.

  • 在里面最低限度最大列,指定上下约束bounds, respectively.

On the规格tab, clickTrimPlay button. The software trims the model and opens the operating point search report in thereport2document.

ClickOutputs.

As shown in theActual Valuecolumn, the trimmed output value is within the specified bounds.

从报告中提取操作点

操作点搜索报告仅阅读,并包含有关规格和修剪工作点的信息。您可以从搜索报告中提取规范或操作点对象。例如,在Reporttab forreport2, 点击Extract>Operating Point.

这software extracts the trimmed operating point,op1,从报告中将其添加到数据浏览器, 在里面操作点部分。

导出操作点数据

一旦计算出符合您规格的操作点,就可以将模型导出到MATLAB®工作区并将模型的初始条件设置为操作点中的值。为此,Operating Pointtab, click出口或者Set Initial Conditions, respectively.

For more information on setting your model initial conditions and simulating your model at a specific operating point, see在特定操作点模拟模金宝app拟模型.

See Also

相关话题