本页对应的英文页面已更新,但尚未翻译。 若要查看最新内容,请点击此处访问英文页面。

运行多个仿真

为模型提供一组输入,并使用这些输入和 parsimbatchsim 函数运行多个仿真。

对于涉及多个并行仿真和记录大量数据的工作流,您可以使用 Simulink.SimulationInput 对象数组创建仿真集。SimulationInput 对象有助于您运行多个不同的仿真,而无需更改您的模型。SimulationInput 对象的数组使您能够运行多个仿真。

如果您拥有 Parallel Computing Toolbox™ 许可证,则可以使用 parsim 函数并行运行仿真。此函数可将多个仿真分发给并行工作进程,从而缩短整体仿真时间。带有 Parallel Computing Toolbox 的 parsim 还可以自动创建并行池、识别文件依存关系,并管理用于进行 Accelerator 和 Rapid Accelerator 仿真的工件。如果没有 Parallel Computing Toolbox 许可证, parsim 命令将串行运行多个仿真。

另外,您还可以将 batchsim 与 Parallel Computing Toolbox 和 MATLAB® Parallel Server™ 许可证结合使用。使用 batchsim 时,仿真会将其工作负载分散到一个计算群集上。您可以打开一个单独的 MATLAB 会话来访问作业和结果。

要快速入门,请参阅运行多个仿真Run Parallel Simulations Using parsim

函数

batchsimOffload simulations to run on a compute cluster
parsim以并行或串行方式进行多次动态系统仿真
applyToModelApply changes to the model specified through a SimulationInput object, in
setBlockParameterSet block parameters to be used for a specific simulation through SimulationInput object, in
setModelParameterSet model parameters to be used for a specific simulation through SimulationInput object, in
setInitialStateSet initial state to be used for a specific simulation through SimulationInput object, in
setExternalInputSet external inputs for a simulation through SimulationInput object, in
setVariable通过 SimulationInput 对象 in 设置仿真的变量
validateValidate the contents of the SimulationInput object, in
setPreSimFcnSpecify a MATLAB function to run before start of each simulation through SimulationInput object, in
setPostSimFcn Specify a MATLAB function to run after each simulation is complete through SimulationInput object, in
loadVariablesFromMATFileLoad variables from MAT-file into a Simulink.SimulationInput object, in
getSimulationJobsGet all Simulink.Simulation.Job objects from cluster

Simulink.SimulationInput创建 SimulationInput 对象以对多个或单个仿真的模型进行更改
Simulink.Simulation.Future Create Future object for simulation
Simulink.Simulation.Job Execute batchsim to create a Simulink.Simulation.Job object, simJob

工具

Simulation ManagerMonitor multiple simulations and visualize the simulation data

主题

运行多个仿真

直接从 parsimbatchsim 命令运行多个仿真。

Run Parallel Simulations Using parsim

Example of multiple parallel simulations workflows.

运行并行仿真

以编程方式并行运行模型仿真。

Multiple Simulation Workflows

Understand the similarities and differences between parsim, parsim with RunInBackground, and batchsim.

Analyze Results Using Simulation Manager

Use the Simulation Manager to visualize the simulation data, analyze the simulation results and the simulation trends.

特色示例