运行多个仿真
parsim
函数、batchsim
函数或 Simulink® 中的“多个仿真”面板,提供输入集合以对这些输入进行建模并运行多个仿真对于涉及多个并行仿真和记录大量数据的工作流,您可以使用 parsim
或 batchsim
命令的命令行 API,或使用 Simulink 编辑器中的多个仿真面板运行仿真。
如果您拥有 Parallel Computing Toolbox™ 许可证,则可以使用 parsim
函数并行运行仿真。该函数将多个仿真分配给并行工作进程,以加快整体仿真时间。通过将 parsim
函数与 Parallel Computing Toolbox 结合使用,您可以自动创建并行池,标识文件依存关系,并管理加速和快速加速仿真的编译工件。如果没有 Parallel Computing Toolbox 许可证, parsim
命令将串行运行多个仿真。
此外,您还可以将 batchsim
函数与 Parallel Computing Toolbox 和 MATLAB® Parallel Server™ 许可证结合使用。当您使用 batchsim
函数时,仿真会将其工作负载分散到一个计算群集上。您可以打开一个单独的 MATLAB 会话来访问作业和结果。
要快速入门,请参阅Running Multiple Simulations和Run Parallel Simulations for a Thermal Model of a House Using parsim。
函数
applyToModel | Apply changes to the model specified through a SimulationInput object, in |
setBlockParameter | Set block parameters to be used for a specific
simulation through SimulationInput object, in |
setModelParameter | Set model parameters to be used for a specific
simulation through SimulationInput object, in |
setInitialState | Configure Simulink.SimulationInput object to
set initial state for simulation |
setExternalInput | Set external inputs for a simulation through SimulationInput object, in |
setVariable | 通过 SimulationInput 对象 in 设置仿真的变量 |
validate | Validate the contents of the SimulationInput
object, in |
setPreSimFcn | Specify 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 |
loadVariablesFromMATFile | Load variables from MAT-file into a Simulink.SimulationInput
object, in
|
getSimulationJobs | Get all Simulink.Simulation.Job objects from
cluster |
contents | View the contents of the Simulink.SimulationInput
object |
类
Simulink.SimulationInput | 创建 SimulationInput 对象以对多个或单个仿真的模型进行更改 |
Simulink.Simulation.Variable | Variables in Simulink.SimulationInput objects |
Simulink.Simulation.BlockParameter | Block parameters in Simulink.SimulationInput objects |
Simulink.Simulation.Future | Create Future object for simulation |
Simulink.Simulation.Job | Execute batchsim to create a
Simulink.Simulation.Job object, simJob |
工具
主题
- Running Multiple Simulations
Run multiple simulations from the
parsim
andbatchsim
commands, and the Multiple Simulations panel in Simulink Editor. - Run Parallel Simulations for a Thermal Model of a House Using parsim
Use a
Simulink.SimulationInput
object to run multiple parallel simulations command line workflow. - 运行并行仿真
以编程方式并行运行模型仿真。
- Configure and Run Simulations with Multiple Simulations Panel
Learn about the Multiple Simulations panel in the Simulink Editor.
- Comparison Between Multiple Simulation Workflows
Understand the similarities and differences between
parsim
,parsim
withRunInBackground
, andbatchsim
. - Analyze Results Using Simulation Manager
Use the Simulation Manager to visualize simulation data, analyze simulation results and trends.