Ejecutar varias simulaciones
parsim
y batchsim
o el panel Multiple Simulations en Simulink®Para los flujos de trabajo que implican múltiples simulaciones paralelas y el registro de muchos datos, puede utilizar la función parsim
o batchsim
, o ejecutar las simulaciones con el panel Multiple Simulations en el editor de Simulink.
Si dispone de una licencia de Parallel Computing Toolbox™, puede utilizar la función parsim
para ejecutar las simulaciones en paralelo. La función distribuye múltiples simulaciones a workers paralelos para acelerar el tiempo total de simulación. Utilizar la función parsim
con Parallel Computing Toolbox permite automatizar la creación de pools paralelos, identifica las dependencias de los archivos y gestiona los artefactos de construcción para las simulaciones de aceleradores y aceleradores rápidos. La función parsim
ejecuta simulaciones en serie si no se dispone de una licencia de Parallel Computing Toolbox.
Puede utilizar la función batchsim
con las licencias de Parallel Computing Toolbox y MATLAB® Parallel Server™. Cuando se utiliza la función batchsim
, las simulaciones se descargan en un cluster de proceso. Puede abrir una sesión separada de MATLAB para acceder al trabajo y a los resultados.
Para empezar, consulte Running Multiple Simulations y Run Parallel Simulations for a Thermal Model of a House Using parsim.
Funciones
batchsim | Offload simulations to run on a compute cluster |
parsim | Simulate dynamic system multiple times in parallel or serial |
applyToModel | Apply configuration in SimulationIntput object to
model |
setBlockParameter | Set block parameter values for simulation using
SimulationInput or Simulation
object |
setModelParameter | Set model parameter values for simulation using
SimulationInput or Simulation
object |
setInitialState | Specify initial state for simulation using
SimulationInput or Simulation
object |
setExternalInput | Specify external input data for top-level input ports using
SimulationInput or Simulation
object |
setVariable | Set variable values for simulation using
SimulationInput or Simulation
object |
setVariantConfiguration | Set variant configuration for simulation using SimulationInput
object (desde R2024a) |
getVariantConfiguration | Get name of variant configuration from SimulationInput
object (desde R2024a) |
validate | Validate contents of SimulationInput
object |
setPreSimFcn | Specify MATLAB function to run before start of each simulation on
Simulink.SimulationInput object |
setPostSimFcn | Set MATLAB function to run after each simulation |
loadVariablesFromMATFile | Load variables from MAT file into Simulink.SimulationInput
object |
loadVariablesFromExternalSource | Load variables from a custom file into Simulink.SimulationInput
object (desde R2022b) |
getSimulationJobs | Get all Simulink.Simulation.Job objects from
cluster |
showContents | View summary of specification in SimulationInput or
Simulation object (desde R2020a) |
Clases
Simulink.SimulationInput | Create Simulink.SimulationInput objects to make changes to
model for multiple or individual simulations |
Simulink.Simulation.Variable | Variables in Simulink.SimulationInput objects (desde R2020a) |
Simulink.Simulation.BlockParameter | Block parameters in Simulink.SimulationInput objects (desde R2020a) |
Simulink.Simulation.Future | Create Future object for simulation |
Simulink.Simulation.Job |
Simulink.Simulation.Job object for batch simulations |
simulink.multisim.DesignStudy | Create design study for multiple simulations (desde R2024a) |
Herramientas
Multiple Simulations | Run multiple simulations from the Simulink Editor (desde R2021b) |
Simulation Manager | Monitor multiple simulations and visualize the simulation data |
Temas
- 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. - Run Parallel Simulations
Programmatically run model simulations in parallel.
- 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.