vssRunSimulation

Run the simulation of a given model.

Syntax

vssRunSimulation()

vssRunSimulation(model)

vssRunSimulation(model,context)

vssRunSimulation(model,context,workspace)

vssRunSimulation(model,context,workspace,simobject)

vssRunSimulation(model,context,workspace,simobject,raiseerror)

vssRunSimulation(model,context,workspace,simobject,raiseerror,reinitfunc)

sparams = vssRunSimulation(...)

Inputs

model
Model that will be simulated. If omitted, it is the current model by default.
Type: char
Dimension: string
context
Model context. If omitted, it is an empty struct by default.
Type: struct | environment
Dimension: scalar | vector | matrix
workspace
Workspace where the simulator will read/write the signals. If omitted, the workspace is the base environment by default.
Type: environment
Dimension: scalar | vector | matrix
simobject
Workspace where the simulator will read/write the signals. If omitted, the workspace is the base environment by default.
Type: simulation object pointer
Dimension: scalar | matrix
raiseerror
If true, the function will not popup an error dialog if the simulation object is defined, else it will throw an error. Default value is false.
Type: logical
Dimension: Boolean
reinitfunc
Function that the compiler calls after evaluation. Default value is an empty string.
Type: char
Dimension: string

Outputs

sparams
Simulation parameters handle or pointer to a simulation parameter engine structure.
Type: sparam
Dimension: -

Example

Passing arguments before running the simulation and create a new environment variable to read/write the signals with the block SignalIn and SignalOut. The handle of the current model is obtained as the first step.

model = bdeGetCurrentModel;
ctx.temperature = 100;
ctx.resistence = 15;
env = getnewenv;
vssRunSimulation(model,ctx,env);

Running current Activate model and raising error if the simulation is not successfully finished

vssRunSimulation([],[],[],[],true)