WOLFRAM SYSTEMMODELER TUTORIAL

Simulation CenterSimulation Settings Files

Introduction | Options | Experiment Browser | Plot Windows | 3D Animation | Initializing Experiments | FFT Analysis | Importing and Exporting | Keyboard Shortcuts | Input Variable Data Files | CombiTimeTable File | Simulation Settings Files | Simulation Result Files | Communication with Simulation

The simulation settings file (.sim) is used for passing experiment settings, initial values, and parameter values to the simulation. The file is an XML file, and all valid tags are described in this chapter. Attributes that are marked with [read-only] are not meant to be changed by the user; they only convey information about the model. An example file, a simulation settings file for the IntroductoryExamples.HelloWorld model, is shown below.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE simulation SYSTEM "simulation_settings.dtd">
<simulation version="1.0" name="HelloWorld 1" start="0.0" end="10" stepSize="0" outputSteps="2000" tolerance="1e-6" method="dassl" filePath="sme_1400057199_22750.exe" resultFilePath="sme_1400057199_22750.mat">

<model name="IntroductoryExamples.HelloWorld" description="" numOfVariables="2">
<variable name="der(x)" value="1.0" defaultValue="1.0" type="Real" kind="DERIVATIVE" direction="BIDIR" unit="" index="0" description="Derivative of x" equationBound="" protected="false" final="false"/>
<variable name="x" value="1.0" defaultValue="1.0" type="Real" kind="STATE" direction="BIDIR" unit="" index="0" description="" equationBound="" protected="false" final="false"/>
</model>
<Options>
<Option name="Solver">
<OptionValue name="MaxStepSize" value="0">
</OptionValue>
<OptionValue name="EventHysteresisEpsilon" value="1e-10">
</OptionValue>
<OptionValue name="EventDetection" value="true">
</OptionValue>
<OptionValue name="NonLinearSolverTolerance" value="1e-12">
</OptionValue>
<OptionValue name="MaxNoInternalSteps" value="0">
</OptionValue>
</Option>
<Option name="CheckMinMax">
<OptionValue name="enable" value="false">
</OptionValue>
</Option>
<Option name="StopAtSteadyState">
<OptionValue name="enable" value="false">
</OptionValue>
</Option>
<Option name="SyncWithRealTime">
<OptionValue name="enable" value="false">
</OptionValue>
</Option>
<Option name="InputVariableDataFile">
<OptionValue name="FilePath" value="">
</OptionValue>
</Option>
<Option name="OutputSettings">
<OptionValue name="StoreToFile" value="true">
</OptionValue>
<OptionValue name="StoreStates" value="true">
</OptionValue>
<OptionValue name="StoreDerivatives" value="true">
</OptionValue>
<OptionValue name="StoreAlgebraics" value="true">
</OptionValue>
<OptionValue name="StoreParameters" value="true">
</OptionValue>
<OptionValue name="StoreConstants" value="false">
</OptionValue>
<OptionValue name="StoreProtected" value="true">
</OptionValue>
<OptionValue name="StoreEventPoints" value="true">
</OptionValue>
<OptionValue name="StoreSimulationLog" value="false">
</OptionValue>
</Option>
</Options>
<ExternalLibraries>
</ExternalLibraries>
</simulation>

Element Simulation

The contents of a simulation element should be a model element and optionally an Options element. The attributes of the simulation element describe the basic experiment settings.

Attributes

  • version The .sim file format version.
  • name The display name of the simulation.
  • start Specifies the start time of simulation.
  • end Specifies the end time of simulation.
  • stepSize Specifies the length of the interval between output points from the solver. When set, outputSteps must be equal to zero.
  • outputSteps Specifies the number output intervals that the solver generates. To get Automatic, set it to -1. To use stepSize instead, set it to 0.
  • tolerance Specifies the local tolerance that is used in each solver step.
  • method Specifies the solver used to solve the dynamic system; possible values are DASSL or CVODES.
  • filePath The path to the simulation executable.
  • resultFilePath The path to the result file.

Element Model

The contents of the model element should be the number of variable elements specified by the attribute numOfVariables.

Attributes

  • name [read-only] Model name.
  • description [read-only] Model description.
  • numOfVariables [read-only] The number of variable elements in the model.

Element Variable

The variable element does not have any content; all information is stored as attributes.

Attributes

  • name [read-only] Variable name.
  • value The value of the variable.
  • defaultValue [read-only] The original value of the variable in the Modelica code.
  • type [read-only] The type of the variable (Real, Integer, Boolean, String).
  • kind [read-only] Specifies the variable kind (VARIABLE, STATE, DUMMY_DER, DUMMY_STATE, DISCRETE, PARAM, CONSTANT, DERIVATIVE).
  • direction [read-only] The direction of the variable (BIDIR, INPUTDIR, OUTPUTDIR).
  • unit [read-only] The unit of the variable.
  • index [read-only] For internal use.
  • description [read-only] The description of the variable.
  • equationBound [read-only] The equation that is used to calculate the start value of the variable (if useEquation is set to true).
  • useEquation Indicates if the bound equation should be used to calculate the start value of the variable or if the value attribute should be used.
  • protected [read-only] Flag that specifies if the variable is protected or not.
  • final [read-only] Flag that specifies whether the variable has a final modifier.

Element Options

The Options element should contain one or more Option elements.

Element Option

The Option element should contain one or more OptionValue elements. Valid option names are:

  • Solver Valid OptionValue names:
  • MaxStepSize
  • EventHysteresisEpsilon
  • EventDetection
  • NonLinearSolverTolerance
  • MaxNoInternalSteps
  • CheckMinMax Valid OptionValue names:
  • enable
  • StopAtSteadyState Valid OptionValue names:
  • enable
  • SyncWithRealTime Valid OptionValue names:
  • enable
  • InputVariableDataFile Valid OptionValue names:
  • FilePath
  • OutputSettings Valid OptionValue names:
  • StoreToFile
  • StoreStates
  • StoreDerivatives
  • StoreAlgebraics
  • StoreParameters
  • StoreConstants
  • StoreProtected
  • StoreEventPoints
  • StoreSimulationLog

Attributes

  • name The name of this Option.

Element OptionValue

Attributes

  • name The name of this OptionValue.
  • value The value of this OptionValue.

Introduction | Options | Experiment Browser | Plot Windows | 3D Animation | Initializing Experiments | FFT Analysis | Importing and Exporting | Keyboard Shortcuts | Input Variable Data Files | CombiTimeTable File | Simulation Settings Files | Simulation Result Files | Communication with Simulation