Azzera filtri
Azzera filtri

Using data from a CompiledSimulink object to set model initial conditions.

1 visualizzazione (ultimi 30 giorni)
I must run an existing Simulink model with a large number of different configurations. Currently, the configuration parameters in the model are rendered through constant blocks and initial conditions using variables in the base workspace.
Since I am running many different configurations, I have decided to use the parsim() function with an array of simulationInput objects that reference this existing Simulink model. There are also many existing scripts setting variables in the base workspace that are meant to configure the simulation.
My approach for parallelizing the simulations is to save the workspace variables in a .mat for each configuration, then use the loadVariablesFromMATFile() funtion to set the model variables for each simulationInput object.
The problem I am running into is one of the variables generated in the base workspace is a CompiledSimulink object that contains member variables of interest. When blocks try to access this object's member variables (ex. CompiledObject.output.x) to set their initial values, an error is thrown, that "Dot indexing is not supported for variables of this type."
Are CompiledObjects not allowed to be used as a Simulink model variable in this way? Thank you in advance.
  1 Commento
Alvaro
Alvaro il 23 Gen 2023
Modificato: Alvaro il 23 Gen 2023
I need some clarification on a couple points:
  1. Where is the CompiledSimulink class? Is it a custom class you made? I am having trouble finding this in the documentation.
  2. Does your approach work in serial but breaks down in parallel?
Also, you should be able to attach variables as properties of the Simulink.SimulationInput objects:

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Programmatic Model Editing in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by