File Formats—Simulation Settings Files (.sim)
System Modeler uses a number of different file formats. For a complete list, see the System Modeler File Formats page.
Simulation Settings Files
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 a selection of valid tags is 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. As an example, a simplified 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.1" name="HelloWorld 1" start="0.0" end="10" stepSize="0" outputSteps="2000" tolerance="1e-6" method="dassl" filePath="HelloWorld.exe" resultFilePath="HelloWorld.mat" unitsPath="HelloWorld_units.json">
<model name="IntroductoryExamples.HelloWorld" description="" numOfVariables="2">
<variable name="x" equationBound="1.0" initType="exact" type="Real" kind="STATE" />
<variable name="der(x)" initType="calc" direction="BIDIR" type="Real" kind="DERIVATIVE" description="Derivative of x" />
</model>
<Options>
<Option name="Solver">
<OptionValue name="MaxStepSize" value="0" />
<OptionValue name="EventDetection" value="true" />
<OptionValue name="NonLinearSolverTolerance" value="1e-12" />
<OptionValue name="MaxNoInternalSteps" value="0" />
</Option>
<Option name="CheckMinMax">
<OptionValue name="enable" value="false" />
</Option>
<Option name="StopAtSteadyState">
<OptionValue name="enable" value="false" />
</Option>
<Option name="SyncWithRealTime">
<OptionValue name="enable" value="false" />
</Option>
<Option name="InputVariableDataFile">
<OptionValue name="FilePath" value="" />
</Option>
<Option name="OutputSettings">
<OptionValue name="StoreStates" value="true" />
<OptionValue name="StoreDerivatives" value="true" />
<OptionValue name="StoreAlgebraics" value="true" />
<OptionValue name="StoreParameters" value="true" />
<OptionValue name="StoreConstants" value="false" />
<OptionValue name="StoreProtected" value="true" />
<OptionValue name="StoreEventPoints" value="true" />
</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
- 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.
- method Specifies the solver used to solve the dynamic system (possible values include dassl and cvodes).
Element Model
The contents of the model element should be the number of variable elements specified by the attribute numOfVariables.
Attributes
Element Variable
The variable element does not have any content; all information is stored as attributes.
Attributes
- value Value for initialization of the variable. When provided, takes precedence over the model's default initialization. Not applicable to variables with initType being calc.
- initType [read-only] The degree to which value may influence the variable's initialization (one of exact, approx or calc).
- equationBound [read-only] Expression describing the model's default initialization of the variable, if available. Typically, providing value will override the default initialization.
- type [read-only] The type of the variable (possible values include Real, Integer, Boolean and String).
- direction [read-only] The causality of the variable (will be INPUT for external inputs to the model).
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 include: