Batch Simulation in Simulink
In Simulink, a batch workflow typically means submitting jobs to run simulations on MATLAB workers and subsequently accessing the results of those simulations. When you run simulations in batches, you offload the execution of simulations onto a compute cluster.
The batchsim
command uses the Parallel Computing Toolbox™ and MATLAB® Distributed Computing Server™ licenses to run the simulations on MATLAB workers in parallel. batchsim
runs the simulations in serial if the Parallel Computing Toolboxlicense is not available.
Prior to R2019a, MATLAB Parallel Server was called MATLAB Distributed Computing Server.
Published: 12 Sep 2018
In Simulink, batch simulation means to submit jobs to run simulations on MATLAB workers, and subsequently access to the results of these simulations. You can now easily run your Simulink in parallel simulations in batch mode with the batchsim command.
In this example, we'll use the basic parsim command to do a parameter sweep of a vehicle suspension model. Once the simulation starts, the MATLAB Command Window stays busy. You will not be able to use the Command Window for other tasks until the simulation is done. If you close your MATLAB, you will lose your simulation data.
Let's simply change a parsim into batchsim, specify the pool size, and rerun the simulation. Now, the MATLAB Command Window will be free, and you can continue with your other work. You can close MATLAB or even your computer, without losing simulation data.
Once you restart MATLAB, you can use the Job Monitor conveniently to find a job and monitor its status. When your simulation is finished, you can either use the Job Monitor or [? Command ?] [? 9 ?] to fetch outputs for further processing.
For more information about batch simulation, please search Simulink documentation.