Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

配置仿真条件

选择求解器、设置初始条件、选取输入数据集、设置步长

在 Simulink® 中构建模型后,您可以对仿真进行配置,使之可以快速、准确地运行,而无需对模型进行结构性更改。

配置仿真的第一步是选择求解器。默认情况下,Simulink 会自动选择变步长求解器。您可以微调求解器选项,或者在“配置参数”对话框的求解器窗格“求解器”窗格中选择不同求解器。

有时,仿真可能会减慢或停滞。使用求解器探查工具可确定仿真中的瓶颈,并获得改进求解器性能的建议。

函数

全部展开

openDialogOpen configuration parameters dialog
closeDialogClose configuration parameters dialog
Simulink.BlockDiagram.getAlgebraicLoopsIdentify and analyze algebraic loops in a model
solverprofiler.profileModelProgrammatically analyze solver performance for model using Solver Profiler

模型设置

全部展开

开始时间Simulation start time
停止时间Simulation stop time
类型Choice of variable- or fixed-step solver
求解器计算仿真状态和输出的求解器

步长和误差容限

最大步长Maximum step size for variable-step solver
最小步长Minimum step size for variable-step solver
初始步长Size of first time step for variable-step solver
连续最小步数Number of steps less than or equal to minimum step size allowed before minimum step size violation occurs
相对容差Relative tolerance for solver tolerance calculation
绝对容差Absolute tolerance for solver tolerance calculation
自动缩放绝对容差Option to scale absolute tolerance based on state values
形状保持Option to preserve shape of states using derivative information at each time step

过零检测

过零控制Option to control how zero-crossing detection is enabled in the model
算法Algorithm for zero-crossing detection with variable-step solver
时间容差Definition of consecutive zero crossings
信号阈值State value at which adaptive zero-crossing algorithm can stop bracketing
连续过零次数Threshold for issuing diagnostic due to consecutive zero crossings

求解器计算选项

积分方法Integration for nonadaptive odeN variable-step solver (自 R2020a 起)
最大阶数Order of numerical differentiation formulas used for ode15s solver
求解器重置方法Option to specify whether solver recomputes Jacobian matrix during solver reset
求解器雅可比矩阵法Method implicit solvers use to compute Jacobian matrix
外插阶数Extrapolation order for ode14x fixed-step solver
牛顿迭代次数Number of Newton's method iterations used by ode14x and ode1be solvers
Daessc 模式Mode of operation for daessc solver

任务和采样时间选项

自动处理数据传输的速率转换Option to ensure integrity of data transfer between different sample times in deployed code
允许多个任务访问输入和输出Option to treat root-level input and output ports as part of each connected task in rate-based model (自 R2021b 起)
优先级值越高,任务优先级越高Priority ordering for real-time system targets
确定性数据传输Deterministic data transfer behavior for automatically inserted Rate Transition blocks

步长

固定步长(基础采样时间)Step size for fixed-step solver

过零检测

对定步长求解器启用过零检测Option to use zero-crossing detection with fixed-step solver (自 R2022a 起)
过零控制Option to control how zero-crossing detection is enabled in the model
围捕迭代的最大次数Maximum number of iterations performed when locating zero crossing (自 R2022a 起)
每一步的最大过零次数Maximum number of zero crossings to locate in a single time step (自 R2022a 起)

求解器计算选项

求解器雅可比矩阵法Method implicit solvers use to compute Jacobian matrix
外插阶数Extrapolation order for ode14x fixed-step solver
牛顿迭代次数Number of Newton's method iterations used by ode14x and ode1be solvers

任务和采样时间选项

周期性采样时间约束Option to specify constraints on model sample times
采样时间属性Discrete sample time periods, offsets, and priorities
将每个离散速率视为单独任务Option to enable multitasking execution
允许任务在目标上并发执行Enable concurrent tasking behavior for model
自动处理数据传输的速率转换Option to ensure integrity of data transfer between different sample times in deployed code
允许多个任务访问输入和输出Option to treat root-level input and output ports as part of each connected task in rate-based model (自 R2021b 起)
优先级值越高,任务优先级越高Priority ordering for real-time system targets
确定性数据传输Deterministic data transfer behavior for automatically inserted Rate Transition blocks
代数环Diagnostic behavior when algebraic loop detected during compilation
尽量减少代数环Diagnostic behavior when the software is unable to resolve artificial algebraic loops
模块优先级违规Diagnostic behavior when the software detects block priority specification error
最小步长违规Diagnostic behavior when minimum step size violation occurs
连续过零违规Diagnostic behavior when zero-crossing violation occurs
自动求解器参数选择Diagnostic behavior when the software changes a solver parameter value
状态名称冲突Diagnostic behavior when more than one state has same name

主题

Simulink 中的求解器

状态信息

求解器探查工具

代数环