impure functionsimulate
Simulates a model.
Extends from Internal.simulationArguments (The arguments of simulate, buildModel and the other simulation calls.).
Information
Simulates a Modelica model by generating C code, building it and running the simulation executable.
simulate(className, [startTime], [stopTime], [numberOfIntervals], [stepSize], [tolerance], [method], [fileNamePrefix], [options], [outputFormat], [variableFilter], [cflags], [simflags], [resimulateExecutable])
Example command:
simulate(A);
If resimulateExecutable is given, simulate() does not translate and build the model.
It runs that executable, which an earlier buildModel() made in the current directory,
with only the flags in simflags. To change the run, give simulation flags, for example simflags="-stopTime=2".
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| TypeName | className (from simulationArguments) | The model | |
| Real | startTime (from simulationArguments) | nan() | Start time |
| Real | stopTime (from simulationArguments) | nan() | Stop time |
| Integer | numberOfIntervals (from simulationArguments) | -1 | Number of intervals |
| Real | stepSize (from simulationArguments) | nan() | Interval of the result file |
| Real | tolerance (from simulationArguments) | nan() | Integration tolerance |
| String | method (from simulationArguments) | "<default>" | Integration method |
| String | fileNamePrefix (from simulationArguments) | "<default>" | File name prefix |
| String | options (from simulationArguments) | "<default>" | Not used |
| String | outputFormat (from simulationArguments) | "<default>" | Result file format |
| String | variableFilter (from simulationArguments) | "<default>" | Variables to store |
| String | cflags (from simulationArguments) | "<default>" | Flags for the C compiler |
| String | simflags (from simulationArguments) | "<default>" | Flags for the simulation |
| String | resimulateExecutable | "" | Executable to run |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| SimulationResult | simulationResults |
Contents
| Name | Description |
|---|---|
| SimulationResult |