--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.simantics.sysdyn.help</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+Bundle-Version: 0.0.0
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Localization: plugin
+Bundle-Name: %name
+Bundle-Vendor: %providerName
+Eclipse-LazyStart: true
+Bundle-SymbolicName: org.simantics.sysdyn.ditamap; singleton:=true
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+<toc label="Simantics System Dynamics" topic="Site/sysdyn.html"><topic label="Simantics System Dynamics" href="Site/sysdyn.html"/></toc>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html
+ SYSTEM "about:legacy-compat">
+<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2018"><meta name="DC.rights.owner" content="(C) Copyright 2018"><meta name="DC.Type" content="topic"><meta name="DC.Format" content="HTML5"><meta name="DC.Identifier" content="tutorial-advanced-system-dynamics-modelling"><link rel="stylesheet" type="text/css" href="../commonltr.css"><title>Tutorial: Advanced System Dynamics Modelling</title></head><body id="tutorial-advanced-system-dynamics-modelling"><main role="main"><article role="article" aria-labelledby="ariaid-title1"><h1 class="title topictitle1" id="ariaid-title1">Tutorial: Advanced System Dynamics Modelling</h1><div class="body"><div class="div hr">
+</div><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#creating-model-and-modules">1 Creating model and modules</a></p></li><li class="li"><p class="p"><a class="xref" href="#initial-configuration">2 Initial configuration</a></p></li><li class="li"><p class="p"><a class="xref" href="#workforce-module">3 Workforce module</a></p></li><li class="li"><p class="p"><a class="xref" href="#work-module">4 Work module</a></p></li><li class="li"><p class="p"><a class="xref" href="#connecting-modules">5 Connecting modules</a></p></li><li class="li"><p class="p"><a class="xref" href="#simulating-the-model">6 Simulating the model</a></p></li></ul><p class="p">In this tutorial, we are going to bild a work model with two projects and shared workforce. Both the workforce and a separate project (work) are going to be created as modules, so they can be reused several times. Actually the model doesn't limit the number of projects at all. A <a class="xref" href="BasicTutorial.html">basic tutorial</a> is also available. This tutorial is part of the <a class="xref" href="sysdyn.html">sysdyn documentation</a>.</p></div><article class="topic nested1" aria-labelledby="ariaid-title2" id="creating-model-and-modules"><h2 class="title topictitle2" id="ariaid-title2">Creating model and modules</h2><div class="body"><div class="div hr">
+</div><p class="p">Let's start by creating the work model and the needed modules. First create a new model by right-clicking on the model browser and selecting New->Model. Alternatively you can select File->New Model from the main menu.</p><p class="p">Then create two new modules to your model. Right-click on the Modules folder and select New->Module.</p><p class="p">Name your model WorkModel and modules WorkforceModule and WorkModule. You can rename them by right-clicking on the item on the model browser and selecting Rename.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/NewModel.png"><br>
+ <p class="p imageText">Creating a new model</p>
+</div><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/NewModule.png"><br>
+ <p class="p imageText">Creating a new module</p>
+</div><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ModelStructure2.png"><br>
+ <p class="p imageText">Model after renaming</p>
+</div></div></article><article class="topic nested1" aria-labelledby="ariaid-title3" id="initial-configuration"><h2 class="title topictitle2" id="ariaid-title3">Initial configuration</h2><div class="body"><div class="div hr">
+</div><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/TwoModules.png"><br>
+ <p class="p imageText">Workforce and Work modules</p>
+</div><p class="p">We will use a top-down approach in our model, so first we will make a simple model configuration with our modules. Open our model configuration by double-clicking Configuration in your model browser.</p><p class="p">Drag one WorkforceModule and one WorkModule from your model browser to the WorkModel diagram. The modules are automatically named with a suffix number. Rename the modules to Workforce and Work1. You can rename objects on the diagram by double-clicking them or selecting them with one click and renaming them on the properties view below the diagram.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ConfigurationStart.png"><br>
+ <p class="p imageText">Workforce and Work modules, first inputs and connections</p>
+</div><p class="p">When the modules are on the diagram, we should think what values we would like to get from the modules and what values we would like to use in the modules.</p><p class="p">Workforce needs to know, how much work is required and it should provide information on how much work can be done. To provide the information on how much work can be done, we need an Input variable. Variables can be dragged to the diagram from Symbols view or by using <a class="xref" href="sysdyn.html#shortcut-and-control-keys">shortcut keys</a> (Shift+I for Input variable). Drag an input variable to the diagram and name it TotalPossibleWorkingSpeed.</p><p class="p">Work module on the other hand provides information on how much work is required in it and it needs to know when the work has to be ready. Create an input variable RequiredWorkingSpeed1 and an Auxiliary variable Work1CompletionTime and place all variables like in the picture on the right.</p><p class="p">Connect the variables to modules using dependency connections (arrows). Connections are created by holding down Alt key and first clicking on the variable where to start the connection and then clicking on the variable where to end.</p><p class="p">Now we have the initial idea of the model, so let's configure the modules.</p></div></article><article class="topic nested1" aria-labelledby="ariaid-title4" id="workforce-module"><h2 class="title topictitle2" id="ariaid-title4">Workforce module</h2><div class="body"><div class="div hr">
+</div><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/NetResourcing1.png"><br>
+ <p class="p imageText">Cloud, Valve, Flow and Stock</p>
+</div><p class="p">Open Workforce module by selecting it from the diagram, right-clicking it and selecting Show Module.</p><p class="p">Create a Stock variable and name it WorkforceStock. Stock variables are created the same way as Input and Auxiliary variables. The level of the stock is controlled with a valve and a flow. To create the flow, hold down Alt and right-click on an empty space left of the stock. Then left-click on the stock. A cloud, valve and a flow is created. Rename the valve to NetResourcing.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/NetResourcing2.png"><br>
+ <p class="p imageText">Cloud, Valve, Flow and Stock. Flow works both on directions.</p>
+</div><p class="p">NetResourcing works both ways. To display this also visually, delete the cloud by selecting it and pressing delete on your keyboard. Then create a flow starting from NetResourcing valve and ending on an empty space next to it.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/WorkforceAuxiliaries.png"><br>
+ <p class="p imageText">Auxiliaries in Workforce module</p>
+</div><p class="p">Now you have used all the basic components and connections. From now on the instructions will be a more simplified.</p><p class="p">Next we will create four Auxiliary variables: TimeToAllocateResources, WorkforceRequired, Productivity and PossibleWorkingSpeed. Place and connect them according to the picture on the right.</p><p class="p">To be able to simulate the model, all variables must have valid equations. To configure an equation, select a variable. Variable's properties are shown in the Property view and you can input the required equations in the text fields. You can copy the equations directly from here or type them manually. Variables connected to the selected variable are shown in the Variables list. To speed up typing, you can double click on a variable name and it will be inserted to the equation.</p><pre class="pre">WorkforceStock
+Initial value: 0
+
+NetResourcing
+= (WorkforceRequired - WorkforceStock)/TimeToAllocateResources
+
+TimeToAllocateResources
+= 2
+
+Productivity
+= 1
+
+PossibleWorkingSpeed
+= WorkforceStock * Productivity
+Is Output
+</pre><p class="p">Variables can be set as output by selecting Is Output option from the Equation tab.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/RequiredWorkingSpeedInput.png"><br>
+ <p class="p imageText">RequiredWorkingSpeedInput</p>
+</div><p class="p">On a previous phase, we wanted to give the value of RequiredWorkingSpeed1 to this workforce module. To get that value, we need to create an input. Create input RequiredWorkingSpeedInput, connect it to WorkforceRequired and write the following equation to WorkforceRequired.</p><pre class="pre">WorkForceRequired
+= RequiredWorkingSpeedInput/Productivity
+</pre><p class="p">Now this module is ready to be used as a part of the model.</p></div></article><article class="topic nested1" aria-labelledby="ariaid-title5" id="work-module"><h2 class="title topictitle2" id="ariaid-title5">Work module</h2><div class="body"><div class="div hr">
+</div><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/WorkStocks.png"><br>
+ <p class="p imageText">Basic work with errors</p>
+</div><p class="p">Open Work1 module by selecting it from the WorkModel diagram, right-clicking it and selecting Show Module. Alternatively you can double click Work1 on the model browser.</p><p class="p">Create the basic flow of work with stocks and flows like in the picture on the right.</p><p class="p">The idea of the model is that first there is work. Work is done at a certain speed. When working, errors are also made. When errors are found, the amount of Errors is reduced, errors are removed from WorkDone and moved back to WorkToDo.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ProjectIsReady.png"><br>
+ <p class="p imageText">Smoothener for work is done</p>
+</div><p class="p">Work needs to be stopped when the project is ready. Since the simulator might face some difficulties to determine the projects readyness when project is almost ready, we need to implement some smoothing to the limit. OpenModelica doesn't yet have a builtin function for smoothing, so we need to implement our own. Create variables and connections according to the picture on the right.</p><p class="p">Use the following equations for variables:</p><pre class="pre">ProjectIsReady
+Initial value: 0
+
+ProjectReadyness
+= (xidz(WorkDone, ProjectWorkAmount, 0.0) - ProjectIsReady) / 0.08
+</pre><p class="p">xidz is short for function X if devided by zero. This means that the simulation calculates ''WorkDone / ProjectWorkAmount''. If ProjectWorkAmount is zero, the result is the third argument ''0.0''.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ProjectWorkAmount.png"><br>
+ <p class="p imageText">ProjectWorkAmount input variable</p>
+</div><p class="p">As you can see, ProjectWorkAmount is highlighted. Your model doesn't contain such variable and it is not connected to ProjectReadyness. Create an Input variable ProjectWorkAmount with default value 1000 and connect it to ProjectReadyness. The reason we are using input variable is that you can determine the default size of a project, but if you want to change it, you can change it from outside the module.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ErrorsVariables.png"><br>
+ <p class="p imageText">Variables needed for error handling</p>
+</div><p class="p">Next we need to define how errors are found. For that we need new variables: WorkQuality and ErrorsFoundTime. Create the variables and connections according to the picture and give variables their equations.</p><pre class="pre">ErrorsGenerated
+= (1-WorkQuality) * WorkingSpeed
+
+ErrorsFoundRate
+= Errors/ErrorsFoundTime
+
+WorkQuality
+= 0.9
+
+ErrorsFoundTime
+Type: WithLookup
+With Lookup: xidz(WorkDone, ProjectWorkAmount, 0.0)
+Lookup table: {{0,5},{0.5,3},{1,0.5},{2,0.5}}
+</pre><p class="p">WithLookup is a variable type where the value is interpolated from a 2-dimensional table (Lookup table) using the value determined in the "With Lookup" field. Type can be changed from the drop-down menu Type.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/WorkAllocation.png"><br>
+ <p class="p imageText">WorkAllocation and RequiredWorkingSpeed</p>
+</div><p class="p">To calculate our own need for workforce we need to create and connect WorkCompletionTime input variable and the following auxliary variables:</p><pre class="pre">RequiredWorkingSpeed
+= if ProjectIsReady < 1 then xidz(WorkToDo, TimeToDeadline, MaximumWorkingSpeed) else 0
+Is Output
+
+MaximumWorkingSpeed
+= 500
+
+TimeToDeadline
+= max(0, WorkCompletionTime-time)
+</pre><p class="p">time is a universal variable that gives the current simulation time.</p><p class="p">We need to decide how the workforce is allocated between all the work modules that are using the same workforce. For that we need to know how much work can be done and how much workforce other works require.</p><p class="p">Create two Inputs, RequiredWorkingSpeedTotalInput and PossibleWorkingSpeedInput, and an auxiliary variable WorkAllocation. Connect the variables like int the picture.</p><pre class="pre">WorkAllocation
+= xidz(RequiredWorkingSpeed, RequiredWorkingSpeedTotalInput, 0.0) * PossibleWorkingSpeedInput
+</pre><p class="p">Finally let's give initial values for all the remaining variables:</p><pre class="pre">WorkingSpeed
+= if ProjectIsReady < 1 then WorkAllocation else 0
+
+WorkToDo
+Initial value: ProjectWorkAmount
+
+WorkDone
+Initial value: 0
+
+Errors
+Initial value: 0
+</pre></div></article><article class="topic nested1" aria-labelledby="ariaid-title6" id="connecting-modules"><h2 class="title topictitle2" id="ariaid-title6">Connecting modules</h2><div class="body"><div class="div hr">
+</div><p class="p">Our modules are complete. Let's get back to the WorkModel Configuration.</p><pre class="pre">Set Work1CompletionTime to 10.
+</pre><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ModuleConnections1.png"><br>
+ <p class="p imageText">Module input connections</p>
+</div><p class="p">Connections between modules are made in the properties of the module. Select Work1 and open tab Inputs from the properties. The table lists all input variables in the module that are available. Clicking on the Refers to output column will open a drop-down menu that shows all available variables that are connected to the module. By selecting a variable, you connect that variable to the input.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ModuleConnections2.png"><br>
+ <p class="p imageText">Module input connections</p>
+</div><p class="p">Work1 need also information on how much working speed is required by all works. Since Work1 is the only work, create a dependency connection from RequiredWorkingSpeed1 to Work1 and in Work1's properties connect it to RequiredWorkingSpeedTotalInput.</p><p class="p">In Outputs tab, make the only possible connection: from RequiredWorkingSpeed to RequiredWorkingSpeed1.</p><p class="p">Workforce module has only one input and one output. Create the only possible connections:
+(Inputs) RequiredWorkingSpeedInput -> RequiredWorkingSpeed1
+(Outputs) PossibleWorkingSpeed -> TotalPossibleWorkingSpeed</p><p class="p">Now your model is ready for simulation!</p></div></article><article class="topic nested1" aria-labelledby="ariaid-title7" id="simulating-the-model"><h2 class="title topictitle2" id="ariaid-title7">Simulating the model</h2><div class="body"><div class="div hr">
+</div><p class="p">To make the simulation time longer, select Configuration on the model browser. Give the model Stop time 24.0</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ActivateExperiment.png"><br>
+ <p class="p imageText">Experiment activation</p>
+</div><div class="p">To run simulations, you must activate an experiment. Expand the experiments folder on your model browser. There is one ready-made experiment. Double click on the experiment and the experiment control buttons appear on the toolbar. To simulate the model, press the play button: <div class="div image">
+<img class="image" src="AdvancedTutorialImages/ExperimentPlay.png"><br><p class="p">System shows the simulation progress in the progress bar on the lower right corner of the screen.</p><div class="div image">
+ <img class="image" src="AdvancedTutorialImages/SimulationProgress.png"><br>
+</div><p class="p">When the progress indicator disappears, the simulation is complete.</p><p class="p">If the Console view pops up and shows an error "Error: Too few equations, underdetermined system. The model has X equation(s) and Y variable(s)", the simulation has failed. The reason might be that you forgot to assign an equation to some variable or some connection in modules. See through all the variables, write the missing equation and simulate again.</p><p class="p">After the simulation is succesfully run, you can select a variable and see its simulation results in the trend view. For example WorkDone variable in Work1 module will give the following graph.</p><div class="div image">
+ <img class="image" src="AdvancedTutorialImages/FirstSimulation.png"><br>
+</div></div></div><article class="topic nested2" aria-labelledby="ariaid-title8" id="adding-modules"><h3 class="title topictitle3" id="ariaid-title8">Adding modules</h3><div class="body"><div class="div hr">
+</div><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ModulesFinal.png"><br>
+ <p class="p imageText">Final configuration with two modules</p>
+</div><p class="p">We created the WorkModule to be reusable. To use two WorkModules in the model, you must do the following.</p><p class="p">Populate a second WorkModule to WorkModel configuration and name it Work2.</p><p class="p">Create RequiredWorkingSpeed2 input variable and Work2CompletionTime auxiliary variable.</p><p class="p">We need a sum of all working speed requirements to give to the work modules. For this purpose, create an auxiliary variable RequiredWorkingSpeedTotal which sums the requirements.</p><p class="p">You can also have a different size work. To make Work2 smaller, create an auxiliary variable Work2Amount.</p><p class="p">Use the following equations:</p><pre class="pre">Work2CompletionTime
+= 13
+
+Work2Amount
+= 800
+
+RequiredWorkingSpeedTotal
+= RequiredWorkingSpeed1 + RequiredWorkingSpeed2
+</pre><p class="p">Update connections to match connections shown in the picture and connect the inputs and outputs to the modules.</p><pre class="pre">Workforce
+RequiredWorkingSpeedInput -> RequiredWorkingSpeedTotal
+
+Work1 Inputs
+RequiredWorkingSpeedTotalInput -> RequiredWorkingSpeedTotal
+
+Work2 Outputs
+RequiredWorkingSpeed -> RequiredWorkingSpeed2
+
+Work2 Inputs
+</pre><div class="div image">
+ <img class="image" src="AdvancedTutorialImages/Module2Inputs.png"><br>
+</div><p class="p">When all the connections are made, you can simulate the model again. Now you have model with two work modules. Select variables from both modules in model browser to display them in trend view.</p><div class="div image">
+ <img class="image" src="AdvancedTutorialImages/SecondSimulation.png"><br>
+</div></div></article></div></article></article></main></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html
+ SYSTEM "about:legacy-compat">
+<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2018"><meta name="DC.rights.owner" content="(C) Copyright 2018"><meta name="DC.Type" content="topic"><meta name="DC.Format" content="HTML5"><meta name="DC.Identifier" content="tutorial-basic-system-dynamics-modelling"><link rel="stylesheet" type="text/css" href="../commonltr.css"><title>Tutorial: Basic System Dynamics Modelling</title></head><body id="tutorial-basic-system-dynamics-modelling"><main role="main"><article role="article" aria-labelledby="ariaid-title1"><h1 class="title topictitle1" id="ariaid-title1">Tutorial: Basic System Dynamics Modelling</h1><div class="body"><div class="div hr">
+</div><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#model">1 Model</a></p></li><li class="li"><p class="p"><a class="xref" href="#configuring-the-model-structure">2 Configuring the model structure</a></p></li><li class="li"><p class="p"><a class="xref" href="#equations">3 Equations</a></p></li><li class="li"><p class="p"><a class="xref" href="#simulating-the-model">4 Simulating the model</a></p></li></ul><p class="p">This tutorial introduces you to the basic components and concepts of the System dynamics modelling tool for Simantics. After completing this tutorial, you know how to configure and simulate a system dynamics model. An <a class="xref" href="AdvancedTutorial.html">advanced tutorial</a> is also available. This tutorial is part of the <a class="xref" href="sysdyn.html">sysdyn documentation</a>.</p></div><article class="topic nested1" aria-labelledby="ariaid-title2" id="model"><h2 class="title topictitle2" id="ariaid-title2">Model</h2><div class="body"><div class="div hr">
+</div><p class="p">We are going to create a simple population model. The model consists of the basic components: Auxiliaries, valves, stocks, dependencies and flows.</p><p class="p">Start by creating a new model. Right-click on the model browser and select New -> Model.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/NewModel.png"><br>
+ <p class="p imageText">Creating a new model</p>
+</div><p class="p">Rename the model to Population. Right-click on Model1 and select Rename.</p><p class="p">Expand the model tree and double-click on Configuration. The model configuration diagram opens in a new editor.</p></div></article><article class="topic nested1" aria-labelledby="ariaid-title3" id="configuring-the-model-structure"><h2 class="title topictitle2" id="ariaid-title3">Configuring the model structure</h2><div class="body"><div class="div hr">
+</div><p class="p">Our model is now empty. Let's build a population model for mice.</p><p class="p">Open Symbols view and expand BasicSymbols. If BasicSymbols are not visible, make sure that you have the diagram open. The contents of the Symbols view depends on the active diagram editor.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/SymbolsView.png"><br>
+ <p class="p imageText">Symbols view</p>
+</div><p class="p">These are the basic symbols in System dynamics modelling. We will use these to create the model.</p><p class="p">Drag one stock variable from Symbols view to the diagram. You can zoom and move on the diagram using <a class="xref" href="sysdyn.html#shortcut-and-control-keys">shortcut keys</a></p><p class="p">Select the variable. Properties view on the bottom of the screen shows the properties of the selected variable. Change the name to Mice and press enter.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/Mice.png"><br>
+ <p class="p imageText">Stock variable Mice</p>
+</div><p class="p">Next we will draw flows in and out of Mice. Drag one cloud variable from Symbols view to the left hand side of Mice. Hold down Alt and right-click on the cloud. Move cursor on top of Mice and left-click. The system creates a flow from the cloud to Mice and a valve in the middle of the flow. The valve controls the speed of the flow. Flow from Mice is created the same way. Drag one cloud variable from Symbols view to the right hand side of Mice. Hold down Alt and right-click on Mice. Move cursor on top of the cloud and left-click. Rename the valves to MouseBirths and MouseDeaths.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/MiceFlows.png"><br>
+ <p class="p imageText">Flows in and out of Mice</p>
+</div><p class="p">Of course mice are not alone in the world. There are also owls that hunt mice. Create a similar structure below mice for owls.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/MiceAndOwls.png"><br>
+ <p class="p imageText">Owls and mice</p>
+</div><p class="p">To control the births and deaths, we need auxiliary variables. Auxiliary variables can be dragged from Symbols view just like Stock variables. We need one variable for each valve to control it. Drag the variables and rename them according to the picture below.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/Auxiliaries.png"><br>
+ <p class="p imageText">Auxiliaries for valves</p>
+</div><p class="p">Arrow connections, dependencies, are created almost like flows. The difference is that the connection is started and ended with a left click and the connection can only be made between two existing variables. Connect the auxiliary variables and valves like in the picture below.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/Dependency_connections.png"><br>
+ <p class="p imageText">Dependency connections</p>
+</div></div></article><article class="topic nested1" aria-labelledby="ariaid-title4" id="equations"><h2 class="title topictitle2" id="ariaid-title4">Equations</h2><div class="body"><div class="div hr">
+</div><p class="p">As you can see from the model, we have made some shortcuts in our model to make it more simple. In reality, there are lots of other factors that affect mouse and owl populations. Let's however use this model as an example.</p><p class="p">For the model to be simulated, each variable needs to have an equation. Equations can be configured from the property view, like the names. Input the following equations into the corresponding variables:</p><pre class="pre">MouseBirths
+= MouseBirthRate * Mice
+
+MouseDeaths
+= Mice * MouseDeathsDueToOwls * Owls
+
+OwlBirths
+= OwlsFromMice * MouseDeaths
+
+OwlDeaths
+= OwlDeathRate * Owls
+
+MouseBirthRate
+= 0.04
+
+MouseDeathsDueToOwls
+= 0.0005
+
+OwlsFromMice
+= 0.1
+
+OwlDeathRate
+= 0.09
+</pre><p class="p">Finally we need initial values for our populations.</p><pre class="pre">Mice
+Initial Value: 700
+
+Owls
+Initial Value: 10
+</pre></div></article><article class="topic nested1" aria-labelledby="ariaid-title5" id="simulating-the-model"><h2 class="title topictitle2" id="ariaid-title5">Simulating the model</h2><div class="body"><div class="div hr">
+</div><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/ActivatePopulationExperiment.png"><br>
+ <p class="p imageText">Experiment activation</p>
+</div><div class="p">Now the model is configured and ready for simulation. Switch Symbols view back to Model Browser. Expand the Experiments folder on your model and double-click on Experiment. This activates the experiment. Experiment needs to be active before the model can be simulated. Experiment activations adds experiment control buttons to the toolbar. To simulate the model, press the play button: <div class="div image">
+<img class="image" src="BasicTutorialImages/ExperimentPlay.png"><br><p class="p">System shows the simulation progress in the progress bar on the lower right corner of the screen.</p><div class="div image">
+ <img class="image" src="BasicTutorialImages/SimulationProgress.png"><br>
+</div><p class="p">When the progress indicator disappears, the simulation is complete.</p><p class="p">After the simulation has run, you can select variables from the diagram or model browser and their values over the simulation time will be shown on Trend View. You can select multiple variables from the diagram by holding down Ctrl key. Select Mice and Owls.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/MiceAndOwlResults1.png"><br>
+ <p class="p imageText">Results for Mice and Owls</p>
+</div><p class="p">As you can see, the simulation is complete, but the results do not reveal any interesting behavior. Let's extend the simulation time.</p><p class="p">Select Configuration from the model browser. In the properties-view change stop time to 300.0 and simulate again.</p><p class="p">After the simualtion is complete, Select Mice and Owls again.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/MiceAndOwlResults2.png"><br>
+ <p class="p imageText">Results for Mice and Owls, Extended simulation time</p>
+</div><p class="p">Now the simulation reveals the traditional behavior of predator-prey models. Feel free to adjust the parameters and try the simulations again.</p></div></div></div></article></article></main></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html
+ SYSTEM "about:legacy-compat">
+<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2018"><meta name="DC.rights.owner" content="(C) Copyright 2018"><meta name="DC.Type" content="topic"><meta name="DC.Format" content="HTML5"><meta name="DC.Identifier" content="simantics-system-dynamics"><link rel="stylesheet" type="text/css" href="../commonltr.css"><title>Simantics System Dynamics</title></head><body><main role="main"><article role="article" aria-labelledby="ariaid-title1"><article class="nested0" aria-labelledby="ariaid-title1" id="simantics-system-dynamics"><h1 class="title topictitle1" id="ariaid-title1">Simantics System Dynamics</h1><div class="body"></div><article class="topic nested1" aria-labelledby="ariaid-title2" id="contents"><h2 class="title topictitle2" id="ariaid-title2">Contents</h2><div class="body"><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#what-is-simantics-system-dynamics">1 What is Simantics System Dynamics</a></p></li><li class="li"><p class="p"><a class="xref" href="#introduction-to-system-dynamics-simulation">2 Introduction to System Dynamics Simulation</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#system-dynamics">2.1 System Dynamics</a></p></li><li class="li"><p class="p"><a class="xref" href="#model">2.2 Model</a></p></li><li class="li"><p class="p"><a class="xref" href="#components">2.3 Components</a></p></li><li class="li"><p class="p"><a class="xref" href="#modeling-principles">2.4 Modeling Principles</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#installation-instructions">3 Installation Instructions</a></p></li><li class="li"><p class="p"><a class="xref" href="#workbench">4 Workbench</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#global-preferences">4.1 Global Preferences</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#modelling">5 Modelling</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#basic-modelling">5.1 Basic Modelling</a></p></li><li class="li"><p class="p"><a class="xref" href="#model-properties">5.2 Model Properties</a></p></li><li class="li"><p class="p"><a class="xref" href="#special-variables">5.3 Special Variables</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#withlookup">5.3.1 WithLookup</a></p></li><li class="li"><p class="p"><a class="xref" href="#delay">5.3.2 Delay</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#shortcut-and-control-keys">5.4 Shortcut and Control Keys</a></p></li><li class="li"><p class="p"><a class="xref" href="#unit-validation">5.5 Unit Validation</a></p></li><li class="li"><p class="p"><a class="xref" href="#diagram-profiles">5.6 Diagram Profiles</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#visual-model-elements">6 Visual model elements</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#fonts-and-colors">6.1 Fonts and colors</a></p></li><li class="li"><p class="p"><a class="xref" href="#dependency-properties">6.2 Dependency properties</a></p></li><li class="li"><p class="p"><a class="xref" href="#loops">6.3 Loops</a></p></li><li class="li"><p class="p"><a class="xref" href="#comments">6.4 Comments</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#simulation">7 Simulation</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#experiments">7.1 Experiments</a></p></li><li class="li"><p class="p"><a class="xref" href="#solvers">7.2 Solvers</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#simulation-result-and-model-structure-analysis">8 Simulation Result and Model Structure Analysis</a></p></li><li class="li"><p class="p"><a class="xref" href="#custom-charts">9 Custom Charts</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#line-chart">9.1 Line Chart</a></p></li><li class="li"><p class="p"><a class="xref" href="#sensitivity-chart">9.2 Sensitivity Chart</a></p></li><li class="li"><p class="p"><a class="xref" href="#bar-chart">9.3 Bar Chart</a></p></li><li class="li"><p class="p"><a class="xref" href="#pie-chart">9.4 Pie Chart</a></p></li><li class="li"><p class="p"><a class="xref" href="#chart-panel">9.5 Chart Panel</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#multidimensional-variables">10 Multidimensional Variables</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#modeling">10.1 Modeling</a></p></li><li class="li"><p class="p"><a class="xref" href="#expressions">10.2 Expressions</a></p></li><li class="li"><p class="p"><a class="xref" href="#array-slices">10.3 Array Slices</a></p></li><li class="li"><p class="p"><a class="xref" href="#arithmetic-operators">10.4 Arithmetic Operators</a></p></li><li class="li"><p class="p"><a class="xref" href="#builtin-modelica-functions">10.5 Builtin Modelica Functions</a></p></li><li class="li"><p class="p"><a class="xref" href="#simulation-results">10.6 Simulation Results</a></p></li><li class="li"><p class="p"><a class="xref" href="#array-variables-in-modules">10.7 Array Variables in Modules</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#functions">11 Functions</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#creating-functions">11.1 Creating Functions</a></p></li><li class="li"><p class="p"><a class="xref" href="#function-libraries">11.2 Function Libraries</a></p></li><li class="li"><p class="p"><a class="xref" href="#external-functions">11.3 External Functions</a></p></li><li class="li"><p class="p"><a class="xref" href="#modelica-functions">11.4 Modelica Functions</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#spreadsheets">12 Spreadsheets</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#variable-values">12.1 Variable Values</a></p></li><li class="li"><p class="p"><a class="xref" href="#history-data">12.2 History Data</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#vensim-model-import">13 Vensim Model Import</a></p></li><li class="li"><p class="p"><a class="xref" href="#sample-models-and-molecules">14 Sample Models and Molecules</a></p></li></ul></div></article></article><article class="topic nested0" aria-labelledby="ariaid-title3" id="what-is-simantics-system-dynamics"><h1 class="title topictitle1" id="ariaid-title3">What is Simantics System Dynamics</h1><div class="body"><div class="div hr">
+</div><p class="p"><em class="ph i">Simantics System Dynamics</em> is currently the only open source modelling and simulating tool for Simantics. Simantics System Dynamics is under development and will go through some changes in the future. New features will be added and old ones improved according to the needs of the modellers.</p><p class="p">This documentation introduces you to the current version of Simantics System Dynamics. Documentation includes the basic modelling principles and a guide on how to model system dynamics models with Simantics System Dynamics. If you like to get to know the tool better and try modelling and simulating yourself, <a class="xref" href="#installation-instructions">install</a> the software and try our <a class="xref" href="BasicTutorial.html">basic</a> and <a class="xref" href="AdvancedTutorial.html">advanced</a> tutorials!</p></div></article><article class="topic nested0" aria-labelledby="ariaid-title4" id="introduction-to-system-dynamics-simulation"><h1 class="title topictitle1" id="ariaid-title4">Introduction to System Dynamics Simulation</h1><div class="body"><div class="div hr">
+</div></div><article class="topic nested1" aria-labelledby="ariaid-title5" id="system-dynamics"><h2 class="title topictitle2" id="ariaid-title5">System Dynamics</h2><div class="body"><p class="p">System dynamics is an approach to understanding different organizations, markets and other complex systems and their dynamic behavior. Simantics System Dynamics is a free modelling tool for system dynamics modeling and simulation. See <a class="xref" href="#installation-instructions">installation instructions</a>.</p></div></article><article class="topic nested1" aria-labelledby="ariaid-title6" id="model"><h2 class="title topictitle2" id="ariaid-title6">Model</h2><div class="body"><p class="p">System dynamics model is generally understood as the model configuration. In this tool, the model contains also other components: <a class="xref" href="#experiments">Experiments</a> are the way to simulate the model. You can have experiments with different configurations, for example different initial values for some parameters. In that way, you don't have to always configure the model for different scenarios. <a class="xref" href="#basic-modelling">Module types</a> allow user to create reusable component types which can be instantiated as Modules. The Modules folder contains all the different module types in your model and you can create new module types there. The <a class="xref" href="#functions">Functions</a> folder contains built-in and user-defined functions.</p><div class="div imageBorder">
+ <img class="image" src="Images/ModelStructure.png"><br>
+ <p class="p imageText">Model structure</p>
+</div></div></article><article class="topic nested1" aria-labelledby="ariaid-title7" id="components"><h2 class="title topictitle2" id="ariaid-title7">Components</h2><div class="body"><p class="p">Most of the components you can use in your models are basic system dynamics components. The modularity of the models introduces two additional components, Modules and Inputs. All the components are explained below.</p><div class="div imageBorder">
+ <img class="image" src="Images/ComponentTypes.png"><br>
+ <p class="p imageText">Component types</p>
+</div><p class="p"><strong class="ph b">Auxiliary</strong></p><p class="p">Auxiliary is the most basic variable you can use. It represents a single value or a mathematical expression. There are different types of auxiliary variables currently in the system: <em class="ph i">Auxiliary</em>, <em class="ph i">Parameter</em>, <em class="ph i">Constant</em>, <a class="xref" href="#delay"><em class="ph i">Delay</em></a> and <a class="xref" href="#withlookup"><em class="ph i">WithLookup</em></a>. Auxiliary is the default type. Parameters are static values that the user can change. When only parameters are changed, the model simulates faster, because the system does not have to recompile the model. WithLookup and Delay are special variables. WithLookup has an expression and a lookup table. The expression defines what value is taken from the defined table. Delay variable delays an equation a given time with a given delay order.</p><p class="p"><strong class="ph b">Dependency</strong></p><p class="p">Dependency is an arrow that connects two components. It means that the value of the variable from which the arrow starts is used to calculate the value of the variable where the arrow ends. Dependencies that are used for a stock initial value only are colored grey by default, in contrast to the regular blue dependency arrows.</p><p class="p"><strong class="ph b">Flow</strong></p><p class="p">Flow connects clouds, valves and stocks. Flow represents an actual flow of something from stocks or clouds to stocks or clouds. There has to be at least one valve in a flow and the system creates it automatically, if none of the ends of the flow is a valve.</p><p class="p"><strong class="ph b">Valve</strong></p><p class="p">Valve regulates the rate of a flow. The value of a valve is automatically used in calculating the level of an adjacent stock. Valves behave just like Auxiliary variables but look different and you can connect also flows to them.</p><p class="p"><strong class="ph b">Stock</strong></p><p class="p">The value of a stock variable is an integral of flows leaving and flows arriving to the variable. The integral is calculated automatically from the valves that are connected to the variable with flow connections. Alternatively, the equation that is integrated can be defined manually by user. A stock must be given an initial value. Initial value can be a single value or an equation. You can use values of other variables to calculate the initial value.</p><p class="p"><strong class="ph b">Cloud</strong></p><p class="p">Cloud is not a variable. It represents a starting or ending point of a flow, if it is not in the scope of the model.</p><p class="p"><strong class="ph b">Module</strong></p><p class="p">Modules enable structural modeling. Modules are defined just like the basic model configuration, but the module component hides the actual configuration. You can only connect dependency connections into the module and dependency connections from the module must end to Input variables. The interface of the module is defined using input and output variables in the configuration of the module. All variable types can be set as output variables. If a variable is an output variable, its font is bold.</p><p class="p"><strong class="ph b">Input</strong></p><p class="p">Input variables are the way of getting values from other modules. Inputs look like auxiliary variables except their font is italics. You can set a default value to the input variable in case it is not connected to any variable. Connections are made from the modules properties, when the module is populated. Input doesn't have to be connected with an arrow to a module. If the variable has no connections, it can get values from a higher level in the hierarchy. If an input is connected to an output, the output and its module are shown below the variable using dot notation.</p><p class="p"><strong class="ph b">Shadow</strong></p><p class="p">A shadow variable is a reference to a variable defined elsewhere on the diagram. The referred variable can be an auxiliary, a valve, a stock, or an input. Dependency and flow arrows can be drawn out of a shadow variable, but no arrows can be drawn into a shadow variable. Shadow variables are used to improve the readability of the model.</p><p class="p"><strong class="ph b">Loop</strong></p><p class="p">A loop element is a graphical component for highlighting selected feedback loops in a model.</p><p class="p"><strong class="ph b">Comment</strong></p><p class="p">A comment element is a string of text on diagram.</p></div></article><article class="topic nested1" aria-labelledby="ariaid-title8" id="modeling-principles"><h2 class="title topictitle2" id="ariaid-title8">Modeling Principles</h2><div class="body"><p class="p">System dynamics modelling is much more than just mathematical formulas and nice graphs. Models are ways of communicating. There are some basic principles in system dynamics modelling that make the models easier to read and understand. You do not have to apply these principles to simulate models, but using them makes it easier for you to communicate your model to others.</p><p class="p"><strong class="ph b">Variable names</strong></p><p class="p">Variables names should be nouns, not verbs. The names should be positive: for example it is easier to understand that satisfaction decreases than dissatisfaction rises. Variable names can and should have multiple words, if they are needed. Note that due to the reserved words in Modelica, variable names such as <em class="ph i">Carbon in Atmosphere</em> cannot be used (<em class="ph i">in</em> is a reserved word). Capitalizing the reserved (<em class="ph i">in</em> --> <em class="ph i">In</em>) word can be used to sidestep the problem.</p><p class="p"><strong class="ph b">Connections</strong></p><p class="p">You should usually try to avoid overlapping dependency arrows. Organizing the variables on the diagram and using shadow variables can be used for that purpose. Dependencies should also form distinctive loops, if there is a loop. It makes it easier to read and understand the model and its behavior.</p><p class="p"><strong class="ph b">Graphical annotations</strong></p><p class="p">System dynamics contains usually annotations for loops, polarities, delays and so on. Annotations are important, for communicating the behavior of the model.</p></div></article></article><article class="topic nested0" aria-labelledby="ariaid-title9" id="installation-instructions"><h1 class="title topictitle1" id="ariaid-title9">Installation Instructions</h1><div class="body"><div class="div hr">
+</div><p class="p">System dynamics tool is provided with the Simantics platform.</p><ol class="ol"><li class="li"><p class="p"><a class="xref" href="http://sysdyn.simantics.org/" target="_blank">Download installer from the tool's download page</a></p></li><li class="li"><p class="p">Install the program to a directory without spaces (limitation inherited from OpenModelica).</p></li><li class="li"><p class="p">Run the application through the launcher generated by the installer</p><p class="p">(default: Simantics\Simantics-1.8.0-Sysdyn-32\Simantics-1.8.0-Sysdyn-32)</p></li></ol><p class="p"><a class="xref" href="http://www.openmodelica.org/" target="_blank">OpenModelica</a> is used to build and simulate the models. Simantics platform has integrated OpenModelica 1.9.0 beta4 for Windows environments. For other versions and other environments you need to install <a class="xref" href="https://www.openmodelica.org/download/download-windows" target="_blank">OpenModelica</a>. In addition to OpenModelica, a development version of a <a class="xref" href="#solvers">purpose-built Modelica solver</a> is embedded in the tool.</p></div></article><article class="topic nested0" aria-labelledby="ariaid-title10" id="workbench"><h1 class="title topictitle1" id="ariaid-title10">Workbench</h1><div class="body"><div class="div hr">
+</div><div class="div image">
+ <img class="image" src="Images/BasicWorkbench.png"><br>
+</div><p class="p">1 <strong class="ph b">Diagram</strong></p><p class="p">Diagram is the area where you will graphically modify your model. Diagrams are built from elements that can be dragged from Symbols view or populated using shortcut keys.</p><p class="p">2 <strong class="ph b">Model Browser</strong></p><p class="p">Model browser shows the structure of your model and all items related to it.</p><p class="p"><strong class="ph b">Symbols</strong></p><p class="p">Symbols view (stacked with the model browser) is used for dragging elements to diagrams.</p><p class="p"><strong class="ph b">Search</strong></p><p class="p">Search view (stacked with the model browser) is used for searching elements in all models. Search can be launched also from the search field in the bottom right corner or by Ctrl+F.</p><p class="p">3 <strong class="ph b">Properties</strong></p><p class="p">Property view shows the selected variable's properties. Property view has a different layout depending on the type of the selected component. The view can also have different tabs depending on the component type. Basic tabs for variables are Equation, Indexes, and Additional information.</p><p class="p"><strong class="ph b">Console</strong></p><p class="p">Console view (stacked with the property view) shows console messages from the simulator. Console can be used for debugging models simulated using OpenModelica.</p><p class="p"><strong class="ph b">Issues</strong></p><p class="p">Issue view (stacked with the property view) shows the errors and warnings in all models.</p><p class="p"><strong class="ph b">Profiles</strong></p><p class="p"><a class="xref" href="#diagram-profiles">Profiles</a> view (stacked with the property view) allows enabling/disabling some visual diagram effects.</p><p class="p"><strong class="ph b">Trend</strong></p><p class="p"><a class="xref" href="#simulation-result-and-model-structure-analysis">Trend</a> view shows the graphical representation of the values of the selected value over time. For the trend to be shown, a simulation has to be run. The view shows always the results of the latest run, but you can save results of a simulation and show them in the same trend with results from another simulation.</p><p class="p"><strong class="ph b">Structure</strong></p><p class="p">The <a class="xref" href="#simulation-result-and-model-structure-analysis">structure</a> view (stacked with the trend view) can be used for analyzing the varaible dependencies, loops, and the structure of the model.</p><p class="p"><strong class="ph b">Values</strong></p><p class="p">The <a class="xref" href="#simulation-result-and-model-structure-analysis">values</a> view (stacked with the trend view) shows the values of the selected value over time. For the values to be shown, a simulation has to be run.</p><p class="p">5 <strong class="ph b">Save and save as...</strong></p><p class="p">Save buttons can be used to export the selected model as .sysdyn file. The buttons save that model which is selected in the model browser or, if the focus is on the diagram, the model that is currently open on the diagram.</p><p class="p">6 <strong class="ph b">Diagram tool mode</strong></p><p class="p">With the diagram tool mode, you can select how the elements on the diagram are edited. The Lock mode prohibits editing diagram elements, the pointer mode allows moving and editing diagram elements, and with the dependency and flow modes arrows can be drawn using only mouse1 and mouse2.</p><p class="p">7 <strong class="ph b">Experiment controls</strong></p><p class="p">Experiment controls are shown when an experiment is active. Experiment is activated by double clicking an experiment in the model browser. With the experiment control, you can start simulation runs and save simulation results.</p><p class="p">8 <strong class="ph b">Perspectives</strong></p><div class="p">Perspectives allow changing between different layouts of the views. On start-up, only the default perspective is open. Try adding the two predefined perspectives by clicking the Open Perspective button: <div class="div image">
+<img class="image" src="Images/OpenPerspective.png"><br><p class="p">9 <strong class="ph b">Chart Panel</strong></p><p class="p"><a class="xref" href="#chart-panel">Chart panel</a> is able to house multiple <a class="xref" href="#custom-charts">charts</a> at the same time. Charts are added to the panel by dragging from model browser.</p><p class="p"><strong class="ph b">TIP!</strong> If you accidentally close a view, you can reopen them from Window->Show View->Other...</p><p class="p"><strong class="ph b">TIP!</strong> Try dragging the views to different positions (e.g. the property view to the right pane).</p></div><article class="topic nested1" aria-labelledby="ariaid-title11" id="global-preferences"><h2 class="title topictitle2" id="ariaid-title11">Global Preferences</h2><div class="body"><p class="p">Global preferences of Simantics System Dynamics are located under Window -> Preferences. Feel free to browse the contents yourself. A few notable items on the list are described below.</p><div class="div image">
+ <img class="image" src="Images/Preferences.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="global-preferences__entry__1"><strong class="ph b">Category</strong></th><th class="entry" id="global-preferences__entry__2"><strong class="ph b">Description</strong></th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="global-preferences__entry__1 "><strong class="ph b">General -> Keys</strong></td><td class="entry" headers="global-preferences__entry__2 ">All <a class="xref" href="#shortcut-and-control-keys">keyboard shortcuts</a> available.</td></tr><tr class="row"><td class="entry" headers="global-preferences__entry__1 "><strong class="ph b">Modelica</strong></td><td class="entry" headers="global-preferences__entry__2 ">The location of OpenModelica solver on file system.</td></tr><tr class="row"><td class="entry" headers="global-preferences__entry__1 "><strong class="ph b">Solver</strong></td><td class="entry" headers="global-preferences__entry__2 "><a class="xref" href="#solvers">Solver</a> to be used for simulation. OpenModelica or internal custom solver (experimental) can be selected.</td></tr><tr class="row"><td class="entry" headers="global-preferences__entry__1 "><strong class="ph b">Sysdyn Diagrams</strong></td><td class="entry" headers="global-preferences__entry__2 ">Sysdyn Diagrams allows customize default colors and fonts of diagram elements.</td></tr></tbody></table></div></article></div><article class="topic nested1" aria-labelledby="ariaid-title12" id="modelling"><h2 class="title topictitle2" id="ariaid-title12">Modelling</h2><div class="body"><div class="div hr">
+</div></div><article class="topic nested2" aria-labelledby="ariaid-title13" id="basic-modelling"><h3 class="title topictitle3" id="ariaid-title13">Basic Modelling</h3><div class="body"><p class="p">Basic modelling functions enable you to create and configure models. System dynamics modeling is basically pretty simple, so with these instructions you can build small and also very large models. The tricky part is writing all the expressions and adjusting the model so that it actually tells you something.</p><div class="div image">
+ <img class="image" src="Images/Basic_1.png"><br>
+</div><p class="p"><strong class="ph b">Creating a new model</strong></p><p class="p">Start a new model by right-clicking the model browser and selecting New -> Model or from the main menu File -> New -> SD Model.</p><div class="div image">
+ <img class="image" src="Images/Basic_2.png"><br>
+</div><p class="p"><strong class="ph b">Creating a new module type</strong></p><p class="p">Create a new module type by right-clicking on the Modules-folder and selecting New -> Module type. This creates a new module type that you can populate to your other modules and the model configuration.</p><p class="p"><strong class="ph b">Configuring a model</strong></p><p class="p">Model configuration can be opened by double clicking Configuration in the model browser.</p><p class="p"><strong class="ph b">Configuring modules</strong></p><p class="p">Configuration of a module type can be opened by double clicking the module type you want to configure. You can also open the configuration of a module from a diagram, when a module has been populated to that diagram, by right-clicking the module and selecting Show Module. When opening modules from diagram, the opened diagram knows to which diagram the module has been populated and can show the connections between the modules. Keep in mind that when making changes to a module, the changes apply to all instances of the respective module type!</p><p class="p"><strong class="ph b">Populate variables</strong></p><p class="p">You can drag variables to a diagram from symbol view. You can also populate variables using <a class="xref" href="#shortcut-and-control-keys">shortcut keys</a>. Variables can be divided into multiple lines by resizing the variable on diagram.</p><p class="p"><strong class="ph b">Populate modules</strong></p><p class="p">Modules are populated from the model browser. Just drag the module you want to populate from the Modules folder to a diagram.</p><p class="p"><strong class="ph b">Create connections</strong></p><p class="p">There are two types of connections: dependencies and flows. Both are created basically the same way. Hold Alt down and click on a variable. Left click starts a dependency, right click starts a flow. Both are ended to another variable with a left click. Dependencies and flows can also be created without Alt key by selecting dependency or flow mode on the toolbar.</p><p class="p">Flows can also be started and ended to an empty spot in the diagram. If there is no start or end variable, a cloud will be created. Also if start or end is not a valve, a new valve is created in the middle of the flow.</p><p class="p">There are some restrictions on what connections can be made, but don't worry, the user interface won't let you do connections that are not allowed.</p><p class="p"><strong class="ph b">Connections between modules</strong></p><p class="p"><strong class="ph b">Outside the module</strong></p><p class="p">You can connect variables to variables in modules like this:</p><pre class="pre">MODULE -----> INPUT
+or
+ANY VARIABLE -----> MODULE
+</pre><p class="p">This is just the visual configuration, but you need those connections to really connect variables in the module's properties.</p><p class="p">In the <em class="ph i">Inputs</em> tab stacked under <em class="ph i">Module Properties</em> you can select which variables you connect to inputs inside the module. In the <em class="ph i">Outputs</em> tab you can select which variables you lift from the module to inputs outside it.</p><p class="p"><strong class="ph b">Inside the module</strong></p><p class="p">Input variables get values from outside the module</p><p class="p">Output variables can send their values outside the module. From the variable properties, select Additional Information and press Is Output</p><p class="p"><strong class="ph b">Configure variables</strong></p><p class="p">Select a single variable from diagram or model browser. The properties of the variables are shown in the equation view and you can modify them.</p><p class="p"><strong class="ph b">Export model</strong></p><p class="p">To export your model to a file, select your model from the model browser, right-click and from the context menu choose Export->Model. Select the folder where to export your model, give the file a name and press Save. You do not need to export a model to Save it, the model is automatically saved in your database. Export can be used, for example, to create different versions of a model, create backups or to transport a model to another database.</p><p class="p"><strong class="ph b">Import model</strong></p><p class="p">Right-click on the model browser and select Import->Model. Browse to your .sysdyn file and select open. The model is added to your model browser.</p><p class="p"><strong class="ph b">Export module</strong></p><p class="p">To export a module to a file, select the module from the model browser, right-click and from the context menu choose Export->Module. Select the folder where to export your model, give the file a name and press Save. Module export can be used, for example, to transport a module to another model or another database.</p><p class="p"><strong class="ph b">Import module</strong></p><p class="p">Right-click the Modules folder of a model and select Import->Module. Browse to your .sysdynModule file and select open. The module is added to your model.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title14" id="model-properties"><h3 class="title topictitle3" id="ariaid-title14">Model Properties</h3><div class="body"><p class="p">Model properties can be viewed by selecting either the model or its configuration on the model browser.</p><div class="div image">
+ <img class="image" src="Images/ModelProperties.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="model-properties__entry__1"><strong class="ph b">Property</strong></th><th class="entry" id="model-properties__entry__2"><strong class="ph b">Description</strong></th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Name</strong></td><td class="entry" headers="model-properties__entry__2 ">The name of the model</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Start time</strong></td><td class="entry" headers="model-properties__entry__2 ">The start time of the simulation.</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Stop time</strong></td><td class="entry" headers="model-properties__entry__2 ">The stop time of the simulation.</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Step length</strong></td><td class="entry" headers="model-properties__entry__2 ">The length of the simulation step.</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Output interval</strong></td><td class="entry" headers="model-properties__entry__2 ">Interval of witch the simulation result is presented. If the field is left empty, all steps of the output are presented.</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Method</strong></td><td class="entry" headers="model-properties__entry__2 ">The simulation solver (only OpenModelica).</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Validate units</strong></td><td class="entry" headers="model-properties__entry__2 "><a class="xref" href="#unit-validation">Unit validation</a> on/off. If unit validation is enabled, the unit of the simulation time is selected from the pull-down menu.</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Unit equivalents</strong></td><td class="entry" headers="model-properties__entry__2 ">Define if different forms of predefined units are considered equal (e.g. dollars = dollar = $) in unit validation.</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Tolerance</strong></td><td class="entry" headers="model-properties__entry__2 ">Integrator error tolerance (only OpenModelica)</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Variable filter</strong></td><td class="entry" headers="model-properties__entry__2 ">Define which variables are presented (only OpenModelica)</td></tr></tbody></table></div></article><article class="topic nested2" aria-labelledby="ariaid-title15" id="special-variables"><h3 class="title topictitle3" id="ariaid-title15">Special Variables</h3><div class="body"><p class="p">Auxiliary and valve variables have two special types: WithLookup and Delay. These types are selected from Type drop down menu in the variable's properties. The variable types offer more specific functionalities than normal variables, but the same functionality could be achieved using normal variables.</p></div><article class="topic nested3" aria-labelledby="ariaid-title16" id="withlookup"><h4 class="title topictitle4" id="ariaid-title16">WithLookup</h4><div class="body"><p class="p">WithLookup variable has two equation fields, WithLookup and Lookup table. Lookup table has a table from which the value of the variable is interpolated using the value of WithLookup field.</p><div class="div image">
+ <img class="image" src="Images/WithLookup1.png"><br>
+</div><p class="p">You do not need to manually input the Lookup table. WithLookup variable type offers an additional Lookup table tab in the property view. In this view you can add and modify points in the lookup table. Points can be added either by clickin on the chart or by using the input fields and Add button. Points can be modified by dragging them on the chart or modifying values in the table. Points are removed by clicking them with right mouse click.</p><div class="div image">
+ <img class="image" src="Images/WithLookup2.png"><br>
+</div></div></article><article class="topic nested3" aria-labelledby="ariaid-title17" id="delay"><h4 class="title topictitle4" id="ariaid-title17">Delay</h4><div class="body"><p class="p">Delay variables build equations for Nth order delays. Users can set the equation for the value that is to be delayed, the time and order of the delay and a possible start value. If start value is empty, the start value is set automatically.</p><div class="div image">
+ <img class="image" src="Images/Delay1.png"><br>
+</div><p class="p">Different order delays have slightly different curves when a step change is triggered. The example picture below shows a step change from 0 to 1 at time 1 with four different delays: 1st, 2nd, 3rd and 10th order delays.</p><div class="div image">
+ <img class="image" src="Images/Delay2.png"><br>
+</div><p class="p">For further information on how the delays work, you can look at the equations that are created by the delay variable. Below is a third order delay. Delay3 is the actual variable that is seen by users. DelayClass has as many level (LV) variables as the order of the delay is.</p><p class="p">Definitions:</p><pre class="pre">Real Delay3;
+Delay3_delayClass Delay3_delayClass_instance(initialValue = 0, delayTime = 1);
+class Delay3_delayClass
+ parameter Real DL = delayTime/3;
+ parameter Real delayTime;
+ parameter Real initialValue;
+ Real delay0;
+ Real LV1(fixed=true, start=initialValue * DL);
+ Real delay1;
+ Real LV2(fixed=true, start=initialValue * DL);
+ Real delay2;
+ Real LV3(fixed=true, start=initialValue * DL);
+ Real delay3;
+equation
+ der(LV1) = - delay1 + delay0;
+ delay1 = LV1 /DL;
+ der(LV2) = - delay2 + delay1;
+ delay2 = LV2 /DL;
+ der(LV3) = - delay3 + delay2;
+ delay3 = LV3 /DL;
+end Delay3_delayClass;
+</pre><p class="p">The above definitions can be seen as a line of stocks and valves. The first valve, delay0, is given the value of the delayed expression. Delay3 is given the value of the valve that is coming from the last stock.</p><p class="p">Equations:</p><pre class="pre">Delay3_delayClass_instance.delay0 = Step1;
+Delay3 = Delay3_delayClass_instance.delay3;
+</pre></div></article></article><article class="topic nested2" aria-labelledby="ariaid-title18" id="shortcut-and-control-keys"><h3 class="title topictitle3" id="ariaid-title18">Shortcut and Control Keys</h3><div class="body"><p class="p">Shortcut keys for configuring a model on diagram.</p><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="shortcut-and-control-keys__entry__1">Key</th><th class="entry" id="shortcut-and-control-keys__entry__2">Action</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Esc</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Cancel operations (e.g. connection and rename).</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Shift + A</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Hover Auxiliary at the cursor position, populate with left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Shift + S</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Hover Stock at the cursor position, populate with left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Shift + C</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Hover Cloud at the cursor position, populate with left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Shift + V</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Hover Valve at the cursor position, populate with left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Shift + I</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Hover Input at the cursor position, populate with left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Shift + G</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Hover Shadow (Ghost) variable at the cursor position, populate with left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Alt + left mouse button</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Start an arrow from a variable. End to another variable by clicking left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Alt + right mouse button</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Start flow from a variable. End by clicking left mouse button. If a flow is not started or ended on to a variable, a cloud will be created to that end. If a new flow does not have a valve at either end, a valve will be created in the middle of the flow.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Delete</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Remove selected variables</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">F2</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Rename selected variable</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Ctrl + left mouse button</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Select multiple variables</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Mouse wheel or + or -</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Diagram zoom</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">drag(mouse3)</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Diagram pan</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">drag(shift + any mouse button)</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Diagram pan</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">↓, ←, ↑, → (arrow keys)</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Diagram pan</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Ctrl + C</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Copy selected elements</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Ctrl + X</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Cut selected elements</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Ctrl + V</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Paste copied or cut elements</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Ctrl + F</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Find element in current diagram or all models</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">G</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Show / hide grid</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">R</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Show / hide ruler</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">1</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Fit diagram contents to screen</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Ctrl + Space</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Content assist in equation editor</td></tr></tbody></table><p class="p">Other shortcut keys can be found selecting Window -> Preferences from the main menu. Keys are located in General -> Keys.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title19" id="unit-validation"><h3 class="title topictitle3" id="ariaid-title19">Unit Validation</h3><div class="body"><p class="p">Unit validation is useful for finding errors in the model. With unit validation, the consistency of the measurement units of variables is checked. For unit validation, the units of all variables in the model must be defined. If a variable is dimensionless, use 1 as the unit. In certain constructs, a dimensionless variable can be used as "a wild card", e.g., adding a dimensionless variable with a dimensioned one is OK.</p><p class="p">Common error sources of unit validation include the following. The respective issues are shown in the picture below.</p><div class="div image">
+ <img class="image" src="Images/UnitValidation.png"><br>
+</div><ul class="ul"><li class="li"><p class="p">The equation of a variable yields a different unit than that defined for the variable.</p></li><li class="li"><p class="p">Two variables which have different units are added (+), subtracted (-), or compared (>, <, =, ...).</p></li><li class="li"><p class="p">The output unit of a function is used in an inconsistent manner. (The unit validation for the output unit of a function behaves equivalently to the unit of a variable.)</p></li><li class="li"><p class="p">A function is called with an argument of a prohibited unit.</p></li><li class="li"><p class="p">A variable has an empty unit.</p></li><li class="li"><p class="p">A variable has a misspelled unit.</p></li></ul><p class="p">Unit validation is enabled for a model by selecting the model or its configuration on the model browser and enabling "Validate units" on the properties tab. The unit warnings are shown on Issues view and, supposing the respective profile has been enabled, on the diagram as well. Warnings from unit validation do not prevent simulation.</p><p class="p">For models that have stocks (i.e., integration), the simulation time unit must be selected from the pull-down menu next to the "Validate units" checkbox in Model Properties tab.</p><p class="p">Unit validation can also cope with certain different forms of units, e.g., you can write dollars, dollar, or $ and the validator considers these equal. This functionality can be disabled from Model Properties tab checkbox "Unit equivalents".</p><p class="p">As there may be cases for which the unit validation is for some reason not working as desired, the unitCast() function can be used in the equation of a variable to cast the unit of any expression within the equation to a wildcard. E.g., if expression</p><pre class="pre"> Aux1 + time
+</pre><p class="p">yields a warning, it can be fixed be changing the expression to</p><pre class="pre"> unitCast(Aux1) + time
+</pre><p class="p">, in which case the unit of the expression is that of time, or to</p><pre class="pre"> Aux1 + unitCast(time)
+</pre><p class="p">, in which case the unit of the expression is that of Aux1.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title20" id="diagram-profiles"><h3 class="title topictitle3" id="ariaid-title20">Diagram Profiles</h3><div class="body"><p class="p">Diagram profiles allow selecting which visual effects are enabled. Currently the following profiles can be used:</p><p class="p"><strong class="ph b">Default</strong></p><p class="p"><strong class="ph b">Issue warnings</strong></p><p class="p">When enabled, an error or a warning symbol is attached to diagram elements in which there are errors or warnings (usually in the equations).</p><p class="p"><strong class="ph b">Shadow variable visualizations</strong></p><p class="p">When enabled, the original and all the shadow variables are highlighted when one is selected.</p><p class="p"><strong class="ph b">Simulation Playback</strong></p><p class="p"><strong class="ph b">Playback Colors</strong></p><p class="p">When enabled, colors of the elements on diagram change during a playback experiment.</p></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title21" id="visual-model-elements"><h2 class="title topictitle2" id="ariaid-title21">Visual model elements</h2><div class="body"><div class="div hr">
+</div><p class="p">The visual appearance of the elements on diagram can be modified in various ways. In addition, the tool offers are comment symbols which do not affect simulation but help the understandability of models.</p></div><article class="topic nested2" aria-labelledby="ariaid-title22" id="fonts-and-colors"><h3 class="title topictitle3" id="ariaid-title22">Fonts and colors</h3><div class="body"><p class="p">Fonts and colors of diagram elements can be changed by right-clicking the element and selecting Font... The default fonts and colors for each diagram element type can be changed in Window -> Preferences -> Sysdyn Diagrams.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title23" id="dependency-properties"><h3 class="title topictitle3" id="ariaid-title23">Dependency properties</h3><div class="body"><p class="p">Dependency arrow properties can be changed on the property view:</p><p class="p"><strong class="ph b">Polarity</strong></p><p class="p">Polarity sign can be used to indicate whether the dependency increases or decreases the variable it is pointing to. The polarities serve no function for simulation, however, they are used in loop type automatic determination.</p><p class="p"><strong class="ph b">Location</strong></p><p class="p">Location of the polarity mark</p><p class="p"><strong class="ph b">Arrowhead</strong></p><p class="p">Toggle for showing arrowhead</p><p class="p"><strong class="ph b">Delay mark</strong></p><p class="p">Delay mark is a visual cue for helping understandability of the dynamics of the model when there are (information) delays. A delay mark is usually added to the dependency arrow when the effect the tail of the dependency has on the head of the dependency is delayed.</p><p class="p"><strong class="ph b">Line thickness</strong></p><p class="p">Thickness of the arrow</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title24" id="loops"><h3 class="title topictitle3" id="ariaid-title24">Loops</h3><div class="body"><p class="p">A loop element is a graphical component for highlighting feedback loops in a model. Usually the most interesting feedback loops that affect the behaviour of the model most are marked with a loop symbol.</p><p class="p"><strong class="ph b">Loop Items</strong></p><p class="p">The loop of variables which the loop symbol refers can be selected for visualization purposes.</p><p class="p"><strong class="ph b">Comment</strong></p><p class="p">Comment inside the loop. Usually characters 'B' and 'R' are used to denote balancing and reinforcing loops, respectfully. A feedback loop is reinforcing if and only if it has an even number of negative dependencies. Selecting 'Auto' determines automatically the type of the loop.</p><p class="p"><strong class="ph b">Direction of Rotation</strong></p><p class="p">Direction to which the loop rotates on diagram.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title25" id="comments"><h3 class="title topictitle3" id="ariaid-title25">Comments</h3><div class="body"><p class="p">Comments are just strings of text.</p></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title26" id="simulation"><h2 class="title topictitle2" id="ariaid-title26">Simulation</h2><div class="body"><div class="div hr">
+</div></div><article class="topic nested2" aria-labelledby="ariaid-title27" id="experiments"><h3 class="title topictitle3" id="ariaid-title27">Experiments</h3><div class="body"><p class="p">There are three different ways for simulating a model. Different simulations are represented as different types of experiments in Simantics System Dynamics.</p><p class="p">Experiments are created from the context menu of experiments folder in a model.</p><div class="div image">
+ <img class="image" src="Images/NewExperiment.png"><br>
+</div><p class="p">Double-click on an experiment activates it and displays experiment type specific controls in the main tool bar.</p><p class="p"><strong class="ph b">Normal simulation</strong></p><p class="p">Experiment is the basic simulation type. It simulates a model from start time to end time and results can be viewed after the simulation has been run.</p><p class="p"><strong class="ph b">Game simulation</strong></p><p class="p">Game simulations allow simulating an arbitrary number of steps, changing parameter values and continuing simulation with the new values from where it previously ended.</p><p class="p"><strong class="ph b">Simulation playback</strong></p><p class="p">Simulation playback works essentially as the basic experiment, but it offers some additional visualization options.</p><p class="p"><strong class="ph b">Sensitivity analysis simulation</strong></p><p class="p">Sensitivity analysis allows running <a class="xref" href="http://en.wikipedia.org/wiki/Multivariate_analysis" target="_blank">multivariate</a> <a class="xref" href="http://en.wikipedia.org/wiki/Monte_Carlo_method" target="_blank">Monte Carlo simulations</a> with different parameter value sets and to visualize how much the simulation result depends on changes in the selected parameters.</p><div class="div image">
+ <img class="image" src="Images/SensitivityExperiment.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="experiments__entry__1"><strong class="ph b">General</strong></th><th class="entry" id="experiments__entry__2">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="experiments__entry__1 ">Name</td><td class="entry" headers="experiments__entry__2 ">The name of the sensitivity analysis experiment. Displayed in e.g. model browser.</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Number of runs</td><td class="entry" headers="experiments__entry__2 ">The total amount of individual simulation runs</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Method</td><td class="entry" headers="experiments__entry__2 ">The method of how the parameter values are selected from the distribution(s). Selecting "Random" yields <a class="xref" href="http://en.wikipedia.org/wiki/Random_number_generation#.22True.22_random_numbers_vs._pseudo-random_numbers" target="_blank">pseudo-random</a> values, i.e., randomly selected from the distribution(s). Selecting "Halton" yields a <a class="xref" href="http://en.wikipedia.org/wiki/Quasi-random" target="_blank">quasi-random</a> <a class="xref" href="http://en.wikipedia.org/wiki/Halton_sequence" target="_blank">Halton sequence</a> of values selected deterministically to represent the distribution(s) better than a pseudo-random series.</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Seed</td><td class="entry" headers="experiments__entry__2 ">The seed number for pseudo-random generator</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Add parameter</td><td class="entry" headers="experiments__entry__2 ">Adds a new parameter to be varied</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Remove</td><td class="entry" headers="experiments__entry__2 ">Removes a parameter</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 "><strong class="ph b">Parameter properties</strong></td><td class="entry" headers="experiments__entry__2 ">-</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Variable</td><td class="entry" headers="experiments__entry__2 ">The full path of the variable of which value is varied. This field has content assistant, which shows the possible variables as you type.</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Range</td><td class="entry" headers="experiments__entry__2 ">Used with multidimensional values to select which dimensions are varied.</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Distribution</td><td class="entry" headers="experiments__entry__2 ">Probability distribution for the varied parameter. "Normal" is for <a class="xref" href="http://en.wikipedia.org/wiki/Truncated_normal_distribution" target="_blank">truncated normal distribution</a> and "Uniform" for <a class="xref" href="http://en.wikipedia.org/wiki/Uniform_distribution_(continuous)" target="_blank">uniform distribution</a>. With "Interval" the values have equal intervals between each other and are selected in increasing order. In multivariate sensitivity analyses, it is recommended to select either "Normal" or "Uniform".</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 "><strong class="ph b">Distribution properties</strong></td><td class="entry" headers="experiments__entry__2 ">-</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Min value</td><td class="entry" headers="experiments__entry__2 ">Minimum value of the distribution</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Max value</td><td class="entry" headers="experiments__entry__2 ">Maximum value of the distribution</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Mean</td><td class="entry" headers="experiments__entry__2 ">Mean of the normal distribution</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Standard deviation</td><td class="entry" headers="experiments__entry__2 ">Standard deviation of the normal distribution</td></tr></tbody></table></div></article><article class="topic nested2" aria-labelledby="ariaid-title28" id="solvers"><h3 class="title topictitle3" id="ariaid-title28">Solvers</h3><div class="body"><p class="p">Simantics System Dynamics allows using the multiple solvers provided by OpenModelica, like Euler, Runge-Kutta, DASSL, etc. OpenModelica is currently the main simulation environment behind the tool and all functionalities are supported with OpenModelica.</p><p class="p">Alternatively to OpenModelica, an internal custom Modelica solver is included in Simantics System Dynamics. The custom solver is currently at an experimental state, and thus all functionalities of the tool are not yet supported, e.g., only the basic experiment can be run with it. The advantage of the custom solver is, however, that simulation is usually a lot faster than with OpenModelica. Try out yourself which solver suits best for your needs.</p><p class="p">The solver can be changed in Windows -> Preferences -> Solver.</p></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title29" id="simulation-result-and-model-structure-analysis"><h2 class="title topictitle2" id="ariaid-title29">Simulation Result and Model Structure Analysis</h2><div class="body"><div class="div hr">
+</div><p class="p">Simulation results can be viewed as trends in the trend view or as plain numbers in the values view. The views display results of variables that are selected in the workbench. Users can also create <a class="xref" href="#custom-charts">custom charts</a>.</p><p class="p">Model structure can be examined in the Structure view. There are three options: dependency structures of individual variables, the complete hierarchy structure of the model, or the feedback loops which individual variables belong to.</p><p class="p"><strong class="ph b">Trend</strong></p><p class="p">Shows you the values of the selected variable(s) graphically over the simulation time. You can modify the trend and zoom it using the context menu (right-click) of the trend.</p><div class="div image">
+ <img class="image" src="Images/Trend.png"><br>
+</div><p class="p"><strong class="ph b">Values</strong></p><p class="p">Shows you the values of the selected variable(s) in a table form. If the value has a star (*) at the end, it means that the value is an approximate. There is no value for that variable for the given time step. Selected values can be copied to other software in csv format.</p><div class="div image">
+ <img class="image" src="Images/Values.png"><br>
+</div><p class="p"><strong class="ph b">Compare results</strong></p><p class="p">You can compare different results of the same model by saving simulation results and displaying the saved results side by side with other results. You can save your results after simulating by clicking the Save Results button:</p><div class="div image">
+ <img class="image" src="Images/Saveresults.png"><br>
+</div><p class="p">on your experiment controls. The saved results appear to model browser under the active experiment. To show the results on trends and tables, right-click on the result and select Show on charts.</p><div class="div image">
+ <img class="image" src="Images/CompareTrend.png"><br>
+</div><p class="p"><strong class="ph b">Dependencies</strong></p><p class="p">Dependencies display which variables affect and which are affected by the selected variable. The direction and number of steps that are traveled from the selected variable can be configured at the bottom of the view.</p><div class="div image">
+ <img class="image" src="Images/Dependencies.png"><br>
+</div><p class="p"><strong class="ph b">Model Hierarchy</strong></p><p class="p">Model Hierarchy displays the hierarchical structure of the model. The module type where a selected variable is located is highlighted.</p><div class="div image">
+ <img class="image" src="Images/ModelHierarchy.png"><br>
+</div><p class="p"><strong class="ph b">Loops</strong></p><p class="p">Loops display all feedback loops which the selected variable belongs to.</p><div class="div image">
+ <img class="image" src="Images/Loops.png"><br>
+</div></div></article><article class="topic nested1" aria-labelledby="ariaid-title30" id="custom-charts"><h2 class="title topictitle2" id="ariaid-title30">Custom Charts</h2><div class="body"><div class="div hr">
+</div><p class="p">Custom charts are user-defined displays of simulation result data. They can be used and re-used in various places. The four types of custom charts (line, sensitivity, bar, and pie charts) provide model developers means for examining and developing their models and communicating the simulation results to others.</p><p class="p">Custom charts are created to the Charts folder in model browser.</p><div class="div image">
+ <img class="image" src="Images/NewChart.png"><br>
+</div><p class="p">Charts are configured the same way as variables: first select the chart from model browser and then configure it in the property view. Charts can be viewed in the same active trend view as any variable by selecting the chart from model browser. In addition to trend view, charts can be populated directly to the model diagram by dragging them from the model browser. Charts can also be added to a separate chart panel which can contain multiple charts.</p></div><article class="topic nested2" aria-labelledby="ariaid-title31" id="line-chart"><h3 class="title topictitle3" id="ariaid-title31">Line Chart</h3><div class="body"><p class="p">Line chart shows the time series of a variable. It is capable of displaying multiple multi-dimensional variables at the same time. Simulation playback mode adds a marker to the chart to display the current time in playback simulation. Below is an example chart and its settings.</p><div class="div image">
+ <img class="image" src="Images/LineChart.png"><br>
+</div><div class="div image">
+ <img class="image" src="Images/LineChartGeneral.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="line-chart__entry__1"><strong class="ph b">General</strong></th><th class="entry" id="line-chart__entry__2">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Name</td><td class="entry" headers="line-chart__entry__2 ">The name of the chart. Displayed in e.g. model browser</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Title</td><td class="entry" headers="line-chart__entry__2 ">The title of the chart. Displayed in the chart</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Type</td><td class="entry" headers="line-chart__entry__2 ">Line chart (default) or area chart</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Hide</td><td class="entry" headers="line-chart__entry__2 ">Options to hide chart grid, title or legend</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 "><strong class="ph b">X-axis</strong></td><td class="entry" headers="line-chart__entry__2 ">-</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Variable</td><td class="entry" headers="line-chart__entry__2 ">A variable that is used as the x-axis variable. The default variable is time and it needs not to be typed in the field.</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Label</td><td class="entry" headers="line-chart__entry__2 ">Optional other label for the variable than its name</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Min</td><td class="entry" headers="line-chart__entry__2 ">Minimum value of the x-axis</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Max</td><td class="entry" headers="line-chart__entry__2 ">Maximum value of the x-axis</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Hide</td><td class="entry" headers="line-chart__entry__2 ">Options to hide x-axis label, line, tick marks and tick labels</td></tr></tbody></table><div class="div image">
+ <img class="image" src="Images/LineChartAxisAndVariables.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="line-chart__entry__23"><strong class="ph b">Variable</strong></th><th class="entry" id="line-chart__entry__24">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="line-chart__entry__23 ">Variable</td><td class="entry" headers="line-chart__entry__24 ">The full path of the variable. This field has content assistant, which shows the possible variables as you type.</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__23 ">Range</td><td class="entry" headers="line-chart__entry__24 ">If the variable has multiple dimensions, this field allows to select, which dimensions are displayed. It is also possible to sum the variables in the dimensions.</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__23 ">Label</td><td class="entry" headers="line-chart__entry__24 ">Optional label for the variable. If label is empty, the variable name is displayed.</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__23 ">Color</td><td class="entry" headers="line-chart__entry__24 ">Color for the lines of this variable</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__23 ">Line width</td><td class="entry" headers="line-chart__entry__24 ">The width of the lines drawn for this variable</td></tr></tbody></table><p class="p">There are also configuration options for y-axis. They are displayed when an axis is selected in the Axis and variables tab.</p><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="line-chart__entry__35"><strong class="ph b">Y-axis</strong></th><th class="entry" id="line-chart__entry__36">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="line-chart__entry__35 ">Label</td><td class="entry" headers="line-chart__entry__36 ">Label of the axis</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__35 ">Min</td><td class="entry" headers="line-chart__entry__36 ">Minimum value in the axis</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__35 ">Max</td><td class="entry" headers="line-chart__entry__36 ">Maximum value in the axis</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__35 ">Color</td><td class="entry" headers="line-chart__entry__36 ">The color of the axis lines, ticks and labels</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__35 ">Hide</td><td class="entry" headers="line-chart__entry__36 ">Options to hide parts of the axis: label, axis line, tick marks, tick labels</td></tr></tbody></table></div></article><article class="topic nested2" aria-labelledby="ariaid-title32" id="sensitivity-chart"><h3 class="title topictitle3" id="ariaid-title32">Sensitivity Chart</h3><div class="body"><p class="p">Sensitivity chart shows the time series of a variable with confidence bounds. Below is an example chart and its settings. The general settings are defined similarly to those of a line chart explained above.</p><div class="div image">
+ <img class="image" src="Images/SensitivityChart.png"><br>
+</div><div class="div image">
+ <img class="image" src="Images/SensitivityChartAxisAndVariables.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="sensitivity-chart__entry__1"><strong class="ph b">Axis and Variables</strong></th><th class="entry" id="sensitivity-chart__entry__2">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="sensitivity-chart__entry__1 ">Variable</td><td class="entry" headers="sensitivity-chart__entry__2 ">The full path of the variable. This field has content assistant, which shows the possible variables as you type.</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__1 ">Range</td><td class="entry" headers="sensitivity-chart__entry__2 ">If the variable has multiple dimensions, this field allows to select, which dimensions are displayed. It is also possible to sum the variables in the dimensions.</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__1 ">Display median</td><td class="entry" headers="sensitivity-chart__entry__2 ">Display the median value of the variable at each time step.</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__1 ">Confidence bounds and colors</td><td class="entry" headers="sensitivity-chart__entry__2 ">The confidence bounds in percents and colors for them.</td></tr></tbody></table><p class="p">There are also configuration options for y-axis. They are displayed when an axis is selected in the Axis and variables tab.</p><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="sensitivity-chart__entry__11"><strong class="ph b">Y-axis</strong></th><th class="entry" id="sensitivity-chart__entry__12">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="sensitivity-chart__entry__11 ">Label</td><td class="entry" headers="sensitivity-chart__entry__12 ">Label of the axis</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__11 ">Min</td><td class="entry" headers="sensitivity-chart__entry__12 ">Minimum value in the axis</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__11 ">Max</td><td class="entry" headers="sensitivity-chart__entry__12 ">Maximum value in the axis</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__11 ">Color</td><td class="entry" headers="sensitivity-chart__entry__12 ">The color of the axis lines, ticks and labels</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__11 ">Hide</td><td class="entry" headers="sensitivity-chart__entry__12 ">Options to hide parts of the axis: label, axis line, tick marks, tick labels</td></tr></tbody></table></div></article><article class="topic nested2" aria-labelledby="ariaid-title33" id="bar-chart"><h3 class="title topictitle3" id="ariaid-title33">Bar Chart</h3><div class="body"><p class="p">Bar charts display variables in a certain point in time. The point can be defined for the complete chart in chart's general settings and individually for each variable in variable's settings. If no time is defined, the last simulation step is shown in game or normal simulation mode. Playback mode displays the current playback time.</p><div class="div image">
+ <img class="image" src="Images/BarChartGeneral.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="bar-chart__entry__1"><strong class="ph b">General</strong></th><th class="entry" id="bar-chart__entry__2">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="bar-chart__entry__1 ">Name</td><td class="entry" headers="bar-chart__entry__2 ">The name of the chart. Name is displayed in model browser.</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__1 ">Title</td><td class="entry" headers="bar-chart__entry__2 ">The title of the chart. Title is displayed in the chart, if not hidden</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__1 ">Type</td><td class="entry" headers="bar-chart__entry__2 ">Normal or stacked. Normal type displays all variables in separate bars. Stacked mode is able to display one-dimensional array variables in stacks.</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__1 ">Time</td><td class="entry" headers="bar-chart__entry__2 ">A general time setting for the entire chart. The values at this time are displayed in the chart</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__1 ">Hide</td><td class="entry" headers="bar-chart__entry__2 ">Option for hiding grid, title and Legend. Legend is hidden by default since it only contains the information that the current simulation is displayed.</td></tr></tbody></table><div class="div image">
+ <img class="image" src="Images/BarChartInDiagram.png"><br>
+</div><p class="p">Charts can be added to model diagrams simply by dragging the chart from model browser to diagram.</p><div class="div image">
+ <img class="image" src="Images/BarChartVariable.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="bar-chart__entry__13"><strong class="ph b">Variable</strong></th><th class="entry" id="bar-chart__entry__14">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="bar-chart__entry__13 ">Add / Remove</td><td class="entry" headers="bar-chart__entry__14 ">Add or remove variables</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__13 ">Variable</td><td class="entry" headers="bar-chart__entry__14 ">The full path of the variable. This field has content assistant, which shows the possible variables as you type.</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__13 ">Range</td><td class="entry" headers="bar-chart__entry__14 ">If the variable has multiple dimensions, this field allows to select, which dimensions are displayed. It is also possible to sum the variables in the dimensions.</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__13 ">Label</td><td class="entry" headers="bar-chart__entry__14 ">Optional label for the variable. If label is empty, the variable name is displayed</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__13 ">Time</td><td class="entry" headers="bar-chart__entry__14 ">The time for which the value of this variable is displayed. If this is empty, a general (or default) value of the time is used.</td></tr></tbody></table><div class="div image">
+ <img class="image" src="Images/BarChartAxis.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="bar-chart__entry__25"><strong class="ph b">Domain axis</strong></th><th class="entry" id="bar-chart__entry__26">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Label</td><td class="entry" headers="bar-chart__entry__26 ">An optional label for x axis</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Label angle</td><td class="entry" headers="bar-chart__entry__26 ">Axis labels can be displayed in an angle. This value determines the angle in degrees.</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Color</td><td class="entry" headers="bar-chart__entry__26 ">The color of the axis line, tick lines and labels</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Hide</td><td class="entry" headers="bar-chart__entry__26 ">Options for hiding axis label, line, tick marks and tick labels</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 "><strong class="ph b">Range axis</strong></td><td class="entry" headers="bar-chart__entry__26 ">-</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Label</td><td class="entry" headers="bar-chart__entry__26 ">An optional label for y axis</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Min</td><td class="entry" headers="bar-chart__entry__26 ">Minimum value of y axis</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Max</td><td class="entry" headers="bar-chart__entry__26 ">Maximum value of y axis</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Color</td><td class="entry" headers="bar-chart__entry__26 ">The color of the axis line, tick lines and labels</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Hide</td><td class="entry" headers="bar-chart__entry__26 ">Options for hiding axis label, line, tick marks and tick labels</td></tr></tbody></table></div></article><article class="topic nested2" aria-labelledby="ariaid-title34" id="pie-chart"><h3 class="title topictitle3" id="ariaid-title34">Pie Chart</h3><div class="body"><p class="p">Pie charts display proportions of variables at a certain time. The time, similar to bar charts, can be configured for the whole chart and individually for each variable. If no time is configured, the value at the latest time step (or the time of simulation playback) is displayed.</p><div class="div image">
+ <img class="image" src="Images/PieChartGeneral.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="pie-chart__entry__1"><strong class="ph b">General</strong></th><th class="entry" id="pie-chart__entry__2">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="pie-chart__entry__1 ">Name</td><td class="entry" headers="pie-chart__entry__2 ">The name of the chart. Displayed in e.g. model browser</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__1 ">Title</td><td class="entry" headers="pie-chart__entry__2 ">Title The title of the chart. Displayed in the chart</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__1 ">Time</td><td class="entry" headers="pie-chart__entry__2 ">A general time setting for the entire chart. The values at this time are displayed in the chart</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__1 ">Hide</td><td class="entry" headers="pie-chart__entry__2 ">Options for hiding title, section labels and legend</td></tr></tbody></table><div class="div image">
+ <img class="image" src="Images/PieChartVariable.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="pie-chart__entry__11"><strong class="ph b">Variables</strong></th><th class="entry" id="pie-chart__entry__12">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Add / Remove</td><td class="entry" headers="pie-chart__entry__12 ">Add or remove variables</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Variable</td><td class="entry" headers="pie-chart__entry__12 ">The full path of the variable. This field has content assistant, which shows the possible variables as you type.</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Range</td><td class="entry" headers="pie-chart__entry__12 ">If the variable has multiple dimensions, this field allows to select, which dimensions are displayed. It is also possible to sum the variables in the dimensions.</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Label</td><td class="entry" headers="pie-chart__entry__12 ">Optional label for the variable. If label is empty, the variable name is displayed</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Color</td><td class="entry" headers="pie-chart__entry__12 ">Color for the sector of this variable</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Time</td><td class="entry" headers="pie-chart__entry__12 ">The time for which the value of this variable is displayed. If this is empty, a general (or default) value of the time is used.</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Exploded</td><td class="entry" headers="pie-chart__entry__12 ">If set, the sector(s) of the variable(s) are "exploded" away from the center of the pie chart</td></tr></tbody></table><div class="div image">
+ <img class="image" src="Images/PieChartChartPanel.png"><br>
+</div></div></article><article class="topic nested2" aria-labelledby="ariaid-title35" id="chart-panel"><h3 class="title topictitle3" id="ariaid-title35">Chart Panel</h3><div class="body"><p class="p">Chart panel is able to house multiple charts at the same time. Chart panel is a normal view in the workbench, which means it can be resized and located anywhere in the workbench. Eclipse also allows detaching the tab completely from the workbench, which means that the chart panel can be dragged to another screen.</p><div class="div image">
+ <img class="image" src="Images/ChartPanel.png"><br>
+</div><p class="p">Chart panel can be either horizontally or vertically oriented. Different orientations help in configuring the workbench perspective.</p><div class="div image">
+ <img class="image" src="Images/ChartPanelOrientation.png"><br>
+</div><p class="p">Charts are added to the panel by dragging from model browser. The order of the charts is easily changed by dragging charts from their header. Charts can be minimized or completely removed from the buttons in their headers.</p><p class="p">By default, chart panel is hidden in the upper-right corner of the system dynamics perspective.</p></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title36" id="multidimensional-variables"><h2 class="title topictitle2" id="ariaid-title36">Multidimensional Variables</h2><div class="body"><div class="div hr">
+</div></div><article class="topic nested2" aria-labelledby="ariaid-title37" id="modeling"><h3 class="title topictitle3" id="ariaid-title37">Modeling</h3><div class="body"><p class="p">Models with multidimensional variables look just like any other models. The structure of the models is replicated givin multiple indexes to variables. For users with programming background, notation Variable<span class="xref"></span> may be familiar. In system dynamic modeling we need to give names to the indexes. Instead of using numbers to define the indexes, like in normal programming, we use enumerations. The steps to create a model with multidimensional variables are as follows (with examples):</p><p class="p">1 <strong class="ph b">Create the model structure</strong></p><p class="p">Model with multidimensional variables looks just like any other model.</p><div class="div image">
+ <img class="image" src="Images/ModelWithMultidimensionalVariables.png"><br>
+</div><p class="p">2 <strong class="ph b">Create Enumerations and define the indexes</strong></p><p class="p">Enumerations are created by right-clicking configuration and selecting New->Enumeration.</p><div class="div image">
+ <img class="image" src="Images/NewEnumeration.png"><br>
+</div><p class="p">Define enumeration indexes by adding as many indexes as you want. Rename the indexes by selecting them and then clicking on them again.</p><div class="div image">
+ <img class="image" src="Images/DefineIndexes.png"><br>
+</div><p class="p">3 <strong class="ph b">Add Enumerations for variables</strong></p><p class="p">Select the variable that you want to be multidimensional. From the Indexes -tab in the property view, move the wanted enumerations to the right. The order of the enumerations does matter.</p><div class="div image">
+ <img class="image" src="Images/SelectEnumerations.png"><br>
+</div><p class="p">4 <strong class="ph b">Define equations for all possible indexes</strong></p><p class="p">Multidimensional variable can be thought as a multidimensional table. Each cell of the table needs to have an expression or a value. A cell cannot have multiple definitions. All cells can be defined in one expression like in the following example. E1 and E2 have both three indexes, so the resulting definition can be {{1,2,3},{4,5,6},{7,8,9}}.</p><div class="div image">
+ <img class="image" src="Images/DefineEquations.png"><br>
+</div></div></article><article class="topic nested2" aria-labelledby="ariaid-title38" id="expressions"><h3 class="title topictitle3" id="ariaid-title38">Expressions</h3><div class="body"><p class="p">Values for all cells in the variable matrix can be defined in a single expression.</p><div class="div image">
+ <img class="image" src="Images/DefineEquations.png"><br>
+</div><div class="div image">
+ <img class="image" src="Images/DefineEquations2.png"><br>
+</div><p class="p">In many situations, it is however more clear to define separate expressions for each cell or blocks.</p><p class="p">1 <strong class="ph b">Define range for the expression</strong></p><div class="div image">
+ <img class="image" src="Images/DefineRange.png"><br>
+</div><p class="p">2 <strong class="ph b">Define the expression</strong> (dimensions of the defined range and the result of the expression must match!)</p><div class="div image">
+ <img class="image" src="Images/DefineEquations3.png"><br>
+</div><p class="p">3 <strong class="ph b">Create a new expression</strong></p><div class="div image">
+ <img class="image" src="Images/CreateNewExpression.png"><br>
+</div><p class="p">4 <strong class="ph b">Select the new expression</strong></p><div class="div image">
+ <img class="image" src="Images/SelectNewExpression.png"><br>
+</div><p class="p">Repeat until there is value for each cell. There must be exactly one value for each cell.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title39" id="array-slices"><h3 class="title topictitle3" id="ariaid-title39">Array Slices</h3><div class="body"><p class="p">Many times it is useful to access a slice of a multidimensional variable. In this chapter, we will use the following example variable:</p><pre class="pre"> enumeration E1 = one, two, three
+ enumeration E2 = eins, zwei, drei
+ Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}
+</pre><p class="p">The whole variable can be accessed in three different ways:</p><ol class="ol"><li class="li"><p class="p"><code class="ph codeph">Auxiliary</code></p></li><li class="li"><p class="p"><code class="ph codeph">Auxiliary[E1, E2]</code></p></li><li class="li"><p class="p"><code class="ph codeph">Auxiliary[:, :]</code></p></li></ol><p class="p">The following explains different methods for accessing parts of the variable</p><pre class="pre"> // Single cell
+ Auxiliary[one, eins] = 1
+</pre><pre class="pre"> // Slices
+ Auxiliary[one, E2] = {1,2,3}
+ Auxiliary[E1, zwei] = {{2},{5},{8}}
+
+ // In addition to single cells and the whole enumeration range, a subrange of the enumeration can be used
+ Auxiliary[two : three, E2] = {{4,5,6},{7,8,9}}
+ Auxiliary[one : two, zwei : drei] = {{2,3},{5,6}}
+</pre><p class="p">The syntax for accessing parts of variables can be used in both expression range definitions and in expressions.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title40" id="arithmetic-operators"><h3 class="title topictitle3" id="ariaid-title40">Arithmetic Operators</h3><div class="body"><p class="p">Arithmetic operations are defined in Modelica. Below are examples of different operations.</p><p class="p"><strong class="ph b">Addition and substraction</strong></p><p class="p">Addition and substraction are calculated elementwise</p><pre class="pre"> {1,2,3} - {0,2,3} = {1,0,0}
+ {{2,2},{4,4}} + {{8,8},{1,1}} = {{10,10},{5,5}}
+ {1,2,3} - {1,2} = ERROR! Different array sizes
+</pre><p class="p"><strong class="ph b">Division</strong></p><p class="p">Division with a scalar</p><pre class="pre"> {5,10,15} / 5 = {1,2,3}
+ 5 / {5,10,15} = ERROR! not allowed
+</pre><p class="p">Division with an array</p><pre class="pre"> {1,2,3} / {1,2,3} = ERROR! not allowed
+
+ // Elementwise
+ {1,2,3} ./ {1,2,3} = {1,1,1}
+</pre><p class="p"><strong class="ph b">Multiplication</strong></p><p class="p">Multiplication with a scalar</p><pre class="pre"> {1,2,3} * 2 = {2,4,6}
+ 5 * {1,2,3} = {5,10,15}
+</pre><p class="p">Matrix multiplication with an array</p><pre class="pre"> {{3,4},{5,6}} * {1,2} = {11,17}
+ {{3,4},{5,6}} * {1,2,3} = ERROR! incompatible array sizes
+
+ //Elementwise
+ {1,2} .* {1,2} = {1,4}
+
+ Real[3,2] c = {{1,2},{3,4},{5,6}};
+ Real[2,2] d = {{3,4},{5,6}};
+ Real[2,2] cd;
+ cd = c[2:3, :] .* d; // Result: {{9,16},{25,36}}
+</pre><p class="p"><strong class="ph b">Power</strong></p><p class="p">Elementwise power of array variable</p><pre class="pre"> {1,2} .^ 2 = {1,4}
+</pre></div></article><article class="topic nested2" aria-labelledby="ariaid-title41" id="builtin-modelica-functions"><h3 class="title topictitle3" id="ariaid-title41">Builtin Modelica Functions</h3><div class="body"><p class="p">Modelica has some builtin functions that help using multidimensional variables. This chapter introduces some of the builtin functions.</p><p class="p"><strong class="ph b">Dimension and size functions</strong></p><p class="p">We will use the same example variable as previously.</p><pre class="pre"> enumeration E1 = one, two, three
+ enumeration E2 = eins, zwei, drei
+
+ Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}
+</pre><p class="p"><strong class="ph b">ndims(A)</strong></p><p class="p">The number of dimensions in array A</p><pre class="pre"> ndims(Auxiliary) = 2
+</pre><p class="p"><strong class="ph b">size(A, i)</strong></p><p class="p">The size of dimension i in array A</p><pre class="pre"> size(Auxiliary, 2) = 3
+</pre><p class="p"><strong class="ph b">size(A)</strong></p><p class="p">A vector of length ndims(A) containing the dimension sizes of A</p><pre class="pre"> size(Auxiliary) = {3,3}
+</pre><p class="p"><strong class="ph b">Construction functions</strong></p><p class="p">In addition to normal array constructing, a special construction functions can be used.</p><p class="p"><strong class="ph b">zeros(n1,n2,n3,...)</strong></p><p class="p">An array full of zeros with dimensions n1 x n2 x n2 x ...</p><pre class="pre"> zeros(2, 2) = {{0,0}, {0,0}}
+</pre><p class="p"><strong class="ph b">ones(n1,n2,n3,...)</strong></p><p class="p">An array full of ones with dimensions n1 x n2 x n2 x ...</p><pre class="pre"> ones(2, 2) = {{1,1}, {1,1}}
+</pre><p class="p"><strong class="ph b">fill(s,n1,n2,n3)</strong></p><p class="p">Like zeros() and ones(), but with user defined value (s) for array elements.</p><pre class="pre"> fill(3,2,2) = {{3,3}, {3,3}}
+</pre><p class="p"><strong class="ph b">identity(n)</strong></p><p class="p">Creates an n x n integer identity matrix with ones on the diagonal and all other elements zero.</p><pre class="pre"> identity(3) =
+ 1 0 0
+ 0 1 0
+ 0 0 1
+</pre><p class="p"><strong class="ph b">diagonal(v)</strong></p><p class="p">Constructs a square matrix with elements of vector v on the diagonal and all other elements zero.</p><pre class="pre"> diagonal({1,2,3}) =
+ 1 0 0
+ 0 2 0
+ 0 0 3
+</pre><p class="p"><strong class="ph b">linspace(x1,x2,n)</strong></p><p class="p">Constracts a Real vector from x1 to x2 with n equally spaced elements.</p><pre class="pre"> linspace(2,5,4) = {2,3,4,5}
+</pre><p class="p"><strong class="ph b">Reduction functions</strong></p><p class="p">Reduction functions reduce arrays to scalars.</p><p class="p"><strong class="ph b">min(A)</strong></p><p class="p">Returns the minimum value in array A.</p><pre class="pre"> Real A = {{1,2},{3,4}}
+ min(A) = 1
+</pre><p class="p"><strong class="ph b">max(A)</strong></p><p class="p">Returns the maximum value in array A.</p><pre class="pre"> Real A = {{1,2},{3,4}}
+ max(A) = 4
+</pre><p class="p"><strong class="ph b">sum(A)</strong></p><p class="p">Returns the sum of values in array A.</p><pre class="pre"> Real A = {{1,2},{3,4}}
+ sum(A) = 10 // 1 + 2 + 3 + 4
+</pre><p class="p"><strong class="ph b">product(A)</strong></p><p class="p">Returns the product of values in array A.</p><pre class="pre"> Real A = {{1,2},{3,4}}
+ product(A) = 24 // 1 * 2 * 3 * 4
+</pre><p class="p"><strong class="ph b">Using functions with iterators</strong></p><p class="p">Functions min(A), max(A), sum(A) and product(A) reduce arrays to scalars. When you use multidimensional variables, you will most probably like to reduce less dimensions. This can be achieved using iterators with reduction functions. The result is constructed as an array, if curly brackets {} are used to enclose the expression.</p><pre class="pre"> enumeration E1 = one, two, three
+ enumeration E2 = eins, zwei, drei
+ Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}
+
+ AuxiliarySum[E1] = {sum( Auxiliary[ i , E2 ] ) for i in E1} // Result: {6, 15, 24}
+
+ /* Same as:
+ {sum(Auxiliary[one, E2]), sum(Auxiliary[two, E2]), sum(Auxiliary[three, E2])}
+ {sum({1,2,3}), sum({4,5,6}), sum({7,8,9})}
+ */
+</pre><p class="p">One expression can have multiple iterators. The Modelica specification defines the following format, but it is NOT yet supported in OpenModelica:</p><pre class="pre"> {sum(Array[ i, j, E3]) for i in E1, j in E2} // Dimensions reduced from 3 to 2
+</pre><p class="p">To use multiple iterators, use the following format (NOTE the reversed order of iterators!):</p><pre class="pre"> {{sum(Array[ i, j, E3]) for j in E2} for i in E1} // Dimensions reduced from 3 to 2
+</pre><p class="p">The range doesn't have to be the whole enumeration. Subranges can also be used.</p><pre class="pre"> {sum( Auxiliary[ i , eins : zwei ] ) for i in E1.one : E1.two} // Result: {3, 9}
+
+ /* Same as
+ {sum(Auxiliary[one, eins : zwei]), sum(Auxiliary[two, eins : zwei])}
+ {sum({1,2}), sum({4,5})}
+ */
+</pre></div></article><article class="topic nested2" aria-labelledby="ariaid-title42" id="simulation-results"><h3 class="title topictitle3" id="ariaid-title42">Simulation Results</h3><div class="body"><p class="p">Multidimensional variables provide multiple results for the same variable. One result for each index. The trend view clutters very quickly when you add dimensions to the variables.</p><div class="div image">
+ <img class="image" src="Images/3x3trend.png"><br>
+</div><p class="p">The clutter can be reduced by selecting which enumeration indexes are shown in charts. Select an enumeration and tick the indexes that you want to show. The same settings apply to each variable that uses the enumeration. This way you can follow an interesting index throughout the model.</p><div class="div image">
+ <img class="image" src="Images/ShowInCharts.png"><br>
+</div></div></article><article class="topic nested2" aria-labelledby="ariaid-title43" id="array-variables-in-modules"><h3 class="title topictitle3" id="ariaid-title43">Array Variables in Modules</h3><div class="body"><div class="div imageBorder">
+ <img class="image" src="Images/Replaceable.png"><br>
+ <p class="p imageText">Replaceable enumeration inside a module</p>
+</div><p class="p">You can also use array variables inside modules. Enumeration need to be defined separately for each module type and added to all necessary variables, also inputs and outputs (see <a class="xref" href="#modeling">Modeling</a>).</p><p class="p">When defining a module, modeler may not want to restrict the size of the array variable. In many cases the same module structure could be used for both large and small arrays. For example if the module is a project, a project may have three or even twenty phases. In this case the enumerations inside modules need to be set as replaceable.</p><p class="p">In this example, the original enumeration that the modeler used had two indexes. We are using an instance of this module, but we need to use array variables that have three indexes instead of two. We are using two variables and an instance of the module.</p><div class="div imageBorder">
+ <img class="image" src="Images/ReplacingEnumerationConfiguration.png"><br>
+ <p class="p imageText">Module configuration for replacing enumerations inside the module</p>
+</div><p class="p">In the parent configuration, we have used an enumeration with three indexes in the two variables.</p><div class="div imageBorder">
+ <img class="image" src="Images/Replacing.png"><br>
+ <p class="p imageText">Enumeration in the parent configuration that will replace the enumeration in the module</p>
+</div><p class="p">The replacement can be defined in the properties of the module instance. When the module instance is selected, a table with all the replaceable enumerations is shown. By clickin on the cell next to the enumeration, a drop-down box is shown with all the enumerations in the parent module. If an enumeration is selected, it will replace the enumeration inside the module during simulation. The replacement will not, however, show elsewhere in the model.</p><div class="div imageBorder">
+ <img class="image" src="Images/ReplacingEnumeration.png"><br>
+ <p class="p imageText">Enumeration in the parent configuration that will replace the enumeration in the module</p>
+</div><p class="p">When creating replaceable enumerations in modules, modelers need to be very careful. Direct references to single enumeration elements are not allowed, since the enumeration elements will change, if the enumeration is replaced for simulation!</p></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title44" id="functions"><h2 class="title topictitle2" id="ariaid-title44">Functions</h2><div class="body"><div class="div hr">
+</div><p class="p">Modelica provides a convenient way to use functions in your models. You can create your own functions, export and import complete function libraries and share function libraries to be used in all of your models.</p></div><article class="topic nested2" aria-labelledby="ariaid-title45" id="creating-functions"><h3 class="title topictitle3" id="ariaid-title45">Creating Functions</h3><div class="body"><div class="div image">
+ <img class="image" src="Images/NewFunction.png"><br>
+</div><p class="p">You can create new functions to the Functions -folder in your model or to function library folders. Right-click on the folder and select New->Function.</p><p class="p">Functions that can be found from Functions -folder can be used in your variable definitions.</p><p class="p">Functions are defined using Modelica language. The variables used in the function are defined in the declaration section. Function needs an output and an arbitrary number of inputs. Modelica specification enables use of multiple outputs, but this feature is not supported. The inputs are given in the same order as they are used in calling the function.</p><p class="p">Algorithm section defines the actual functionality of the function. In algorithm sections you must use assignments ":=" instead of just plain "=". All the assignments are calculated in the order they are written.</p><p class="p">Below is an example of a simple function. For more examples, see the built-in functions provided with the tool and <a class="xref" href="https://www.modelica.org/documents/" target="_blank">Modelica specifications</a>.</p><div class="div image">
+ <img class="image" src="Images/ExampleFunction.png"><br>
+</div></div></article><article class="topic nested2" aria-labelledby="ariaid-title46" id="function-libraries"><h3 class="title topictitle3" id="ariaid-title46">Function Libraries</h3><div class="body"><p class="p">Functions can be collected into libraries. This is a good way of organizing your functions. If function is located in a library, you need to append the library name to the function call (e.g. ExampleFunctionLibrary.ExampleFunction(arg1, arg2)). With libraries, you can also have functions with same names (e.g. library1.func(arg) and library2.func(arg)).</p><div class="div image">
+ <img class="image" src="Images/NewFunctionLibrary.png"><br>
+</div><p class="p">There are three types of function libraries: normal function library, built-in function library and shared function library. Normal function libraries can be created to a model and are available only in that model. Built-in libraries are available in all models and calls to built-in functions should not include the library name. Shared functions are available to all models in your workspace, but you need to enable them to each model individually.</p><p class="p">Create a new function library by right-clicking on Functions folder, Shared functions folder or other module library.</p><p class="p">A function library can be exported by right clicking the function library and selecting Export -> Function library. A function library can be imported by right clicking the Functions folder and selecting Import -> Function library. Functions themselves cannot be exported or imported. To export a function, add it into a function library and export that function library.</p><p class="p">If you create a shared function library, the library can be added to other models or removed from current model by selecting the Shared Functions -folder and using the properties view.</p><div class="div image">
+ <img class="image" src="Images/SharedFunctions.png"><br>
+</div></div></article><article class="topic nested2" aria-labelledby="ariaid-title47" id="external-functions"><h3 class="title topictitle3" id="ariaid-title47">External Functions</h3><div class="body"><p class="p">Modelica allows you to use external functions that are programmed using C language. To use this feature, you need to have the Sysdyn version with OpenModelica included and OpenModelica set as the solver in the Preferences (Window -> Preferences -> Solver). The installation package with OpenModelica has also MinGW C compiler included that allows to build object files from C source code.</p><p class="p">Below is a simple example of using a function that returns the sum of two arguments.</p><pre class="pre"> double exampleCFunction(double x, double y)
+ {
+ double res;
+ res = x + y;
+ return res;
+ }
+</pre><div class="div image">
+ <img class="image" src="Images/ImportCFunctionLibrary.png"><br>
+</div><p class="p">You need to create an Object file (.o) of your code, import it to a function and define the function to use the library and function that you created. If you don’t have a C-compiler, you can use the one provided by the Simantics installation (e.g. simantics_home/plugins/org.simantics.openmodelica.win32_x/MinGW/bin/mingw32_gcc.exe -g -O -c ExampleCFunctionCode.c).</p><div class="div image">
+ <img class="image" src="Images/ExampleExternalFunction.png"><br>
+</div><p class="p">You can use the external function like any other function in your variables. Using equation ExampleExternalFunction(Stock1, 10) in an auxiliary variable (Auxiliary2) gives the following result.</p><div class="div image">
+ <img class="image" src="Images/ExternalFunctionResult.png"><br>
+</div><p class="p">In addition to .o -files, you can import .c and .h files. By including these to the function, the source code can be reviewed and later by you or others that use the function.</p><p class="p">Small external C function can also be written directly to the function code in Simantics Sysdyn:</p><pre class="pre"> function ExampleExternalFunction
+ input Real x;
+ input Real y;
+ output Real z;
+ external "C" z=exampleCFunction(x,y) annotation(Include="
+ double exampleCFunction(double x, double y)
+ {
+ double res;
+ res = x + y;
+ return res;
+ }");
+ end ExampleExternalFunction;
+</pre></div></article><article class="topic nested2" aria-labelledby="ariaid-title48" id="modelica-functions"><h3 class="title topictitle3" id="ariaid-title48">Modelica Functions</h3><div class="body"><p class="p">Modelica has built-in functions that can be used anywhere and are not visible in function libraries. This section covers a large number of those functions. For functions related to array variables, see see <a class="xref" href="#builtin-modelica-functions">builtin functions for arrays</a>.</p><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="modelica-functions__entry__1"><strong class="ph b">Function</strong></th><th class="entry" id="modelica-functions__entry__2"><strong class="ph b">Description</strong></th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">abs(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the absolute value of x. Expanded into "(if x >= 0 then x else -x)".</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">acos(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Inverse cosine.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">asin(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Inverse sine.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">atan(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Inverse tangent.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">atan2(x1,x2)</td><td class="entry" headers="modelica-functions__entry__2 ">four quadrant inverse tangent.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">cat(n,A,B,...)</td><td class="entry" headers="modelica-functions__entry__2 ">General concatenation function that concatenates arrays A,B,... along the nth dimension.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">ceil(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the smallest integer not less than x, the closest integer above x.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">cos(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Cosine.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">cosh(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Hyperbolic cosine.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">cross(x,y)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the 3-vector cross product of the 3-vectors x and y.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">delay(expr, delayTime)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the value of expr at the time time-delayTime. The value of expr is returned when time <= time.start + delayTime.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">der(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Time derivative of x. X must be have continuous-time variability.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">div(x, y)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the algebraic quotient x/y with any fractional part discarted. E.g. div(10,3) = 3.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">edge(b)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns true when the value of the boolean expression b changes. Expanded into (b and not pre(b)).</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">exp(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Exponential, base e.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">floor(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the largest integer not greater than x, the closest integer below x.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">initial()</td><td class="entry" headers="modelica-functions__entry__2 ">Returns true at the beginning of the simulation.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">integer(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the largest integer not greater than x as an integer.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">log(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Natural logarithm. (base e, x > 0)</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">log10(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Base 10 logarithm. (x > 0)</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">mod(x, y)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the integer modulus of x/y: mod(x,y) = x - floor(x/y) * y.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">noEvent(expr)</td><td class="entry" headers="modelica-functions__entry__2 ">noEvent around an expression causes the expression to NOT generate event. <strong class="ph b">Important:</strong> If you want a condition to be checked only on time steps, use noEvent. (e.g. if noEvent(value >= 1) then ... else ...)</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">pre(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the preceding value of y from time event that has occured before current time.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">rem(x, y)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the integer remainder of x/y: rem(x,y) = x - div(x,y) * y.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">sample(start, interval)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns true and triggers time events at times start + i * interval (i=0,1,...).</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">sign(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns -1 if x is negative, 1 if x is positive. Expanded into "(if x > 0 then 1 else if x < 0 then -1 else 0)".</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">sin(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Sine.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">sinh(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Hyperbolic sine.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">sqrt(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Square root of x. The value of x must be greater or equal to 0 or an assertion error occurs.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">tan(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Tangent.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">tanh(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Hyperbolic tangent.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">terminal()</td><td class="entry" headers="modelica-functions__entry__2 ">Returns true at the end of a successful simulation.</td></tr></tbody></table></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title49" id="spreadsheets"><h2 class="title topictitle2" id="ariaid-title49">Spreadsheets</h2><div class="body"><div class="div hr">
+</div><p class="p">Spreadsheets allow storing and maintaining values in a familiar format. The current spreadsheet implementation is experimental and does not provide much functionality.</p></div><article class="topic nested2" aria-labelledby="ariaid-title50" id="variable-values"><h3 class="title topictitle3" id="ariaid-title50">Variable Values</h3><div class="body"><p class="p">Spreadsheets are an easy way to import and manage parameter values. Sheet shells can be referenced to in models with the syntax SheetName(CellReference). Below is an example of getting a value for Auxiliary. The text "Auxiliary" is not necessary in the spreadsheet, but it helps maintaining the sheet.</p><div class="div image">
+ <img class="image" src="Images/AuxiliarySheetReference.png"><br>
+ <img class="image" src="Images/AuxiliarySheet.png"><br>
+</div><p class="p">You can also refer to sheets with array variables. Reference is simple with one and two dimensional array variables. Below is an example of a sheet with values for two different variables. The names of the indexes are not mandatory, but help reading and maintaining the sheet.</p><div class="div image">
+ <img class="image" src="Images/SheetForMultidim.png"><br>
+</div><p class="p">Reference to a sheet range creates an array variable.</p><div class="div image">
+ <img class="image" src="Images/SheetMultidim1.png"><br>
+</div><p class="p">ArrayTest2 has two dimensions. Reference to a larger range creates a two-dimensional variable. By default, the indexes are ordered as in this example. However, if you wish to present the indexes in a different order in the spreadsheet, you can transpose the sheet reference (e.g. transpose(ArrayTestSheet(E2:G3)))</p><div class="div image">
+ <img class="image" src="Images/SheetMultidim2.png"><br>
+</div></div></article><article class="topic nested2" aria-labelledby="ariaid-title51" id="history-data"><h3 class="title topictitle3" id="ariaid-title51">History Data</h3><div class="body"><p class="p">Spreadsheets can be used to store and display external history data e.g. from some statistics. The history data should be arranged as columns or rows and include a time variable. Reference variables need to be given the exactly same name as their counterparts in model.</p><div class="div image">
+ <img class="image" src="Images/Sheet.png"><br>
+</div><p class="p">History data is used by creating a History dataset to an experiment. The dataset is activated and deactivated in charts by double-clicking the dataset. History data reference is set in the properties of the history dataset.</p><div class="div image">
+ <img class="image" src="Images/HistoryDataSettings.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="history-data__entry__1"><strong class="ph b">History data properties</strong></th><th class="entry" id="history-data__entry__2">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="history-data__entry__1 ">Name</td><td class="entry" headers="history-data__entry__2 ">Name of the history dataset</td></tr><tr class="row"><td class="entry" headers="history-data__entry__1 ">Sheet</td><td class="entry" headers="history-data__entry__2 ">Combo box for selecting a sheet where the history data is located</td></tr><tr class="row"><td class="entry" headers="history-data__entry__1 ">Orientation</td><td class="entry" headers="history-data__entry__2 ">Columns or rows. How the data is arranged in the sheet.</td></tr><tr class="row"><td class="entry" headers="history-data__entry__1 ">Range start</td><td class="entry" headers="history-data__entry__2 ">The upper-left corner cell of the history data range</td></tr><tr class="row"><td class="entry" headers="history-data__entry__1 ">Range end</td><td class="entry" headers="history-data__entry__2 ">The lower-right corner cell of the history data range</td></tr><tr class="row"><td class="entry" headers="history-data__entry__1 ">Time variable</td><td class="entry" headers="history-data__entry__2 ">The name of the time variable in the history data, if it is different than "time"</td></tr><tr class="row"><td class="entry" headers="history-data__entry__1 ">Variables in range</td><td class="entry" headers="history-data__entry__2 ">This text field displays the found variables in the given sheet and range</td></tr></tbody></table><p class="p">If the history dataset is activated, history data is displayed whenever it is available for a variable that is displayed in a chart.</p><div class="div image">
+ <img class="image" src="Images/HistoryData.png"><br>
+</div></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title52" id="vensim-model-import"><h2 class="title topictitle2" id="ariaid-title52">Vensim Model Import</h2><div class="body"><div class="div hr">
+</div><p class="p">The tool also has a limited support for importing system dynamics models created with the simulation and modelling tool <a class="xref" href="http://vensim.com/" target="_blank">Vensim</a>. This functionality is used similarly to the regular model import, so by right-clicking the browser and selecting "Import" -> "Vensim Model (.mdl)".</p><p class="p">The import process has several known limitations:</p><ul class="ul"><li class="li"><p class="p">The Vensim model must be in the .mdl file format, the other Vensim file formats are proprietary and thus not supported.</p></li><li class="li"><p class="p">Only variables and connections are imported.</p></li><li class="li"><p class="p">Many advanced Vensim features, such as input and output objects (e.g. graphs and parameter value editors) and other diagram customizations, are not supported.</p></li><li class="li"><p class="p">Variable value range data is not always imported correctly.</p></li><li class="li"><p class="p">Subscripts are automatically converted to enumerations which may sometimes lead into problems as the constructions are not exactly equivalent.</p></li><li class="li"><p class="p">Dimensionless units are currently not converted correctly (in Simantics System Dynamics, dimensionless should be indicated with a constant).</p></li><li class="li"><p class="p">Non-shadow duplicate variables are sometimes very problematic and may be imported incorrectly, shadow variables should work fine.</p></li><li class="li"><p class="p">Only a limited subset of Vensim functions is currently implemented in Simantics System Dynamics, so some equations might require additional work before they can be evaluated correctly.</p></li></ul></div></article><article class="topic nested1" aria-labelledby="ariaid-title53" id="sample-models-and-molecules"><h2 class="title topictitle2" id="ariaid-title53">Sample Models and Molecules</h2><div class="body"><div class="div hr">
+</div><p class="p">There are some sample models located in the sampleModels folder found in the installation folder. The sample models can be imported by right-clicking on the model browser and select Import->Model.</p><p class="p"><a class="xref" href="https://www.simantics.org/end_user_wiki/index.php/Introduction_to_Simantics" target="_blank">Simantics</a> | <em class="ph i">System Dynamics Modelling</em></p><div class="div hr">
+</div><p class="p"><a class="xref" href="BasicTutorial.html"><strong class="ph b">Tutorial: Basic System Dynamics Modelling</strong></a></p><p class="p">System dynamics modelling in Simantics is a free modelling tool that is included into the basic installation. This tutorial introduces the basic features of the system dynamics modelling tool.</p><p class="p"><a class="xref" href="AdvancedTutorial.html"><strong class="ph b">Tutorial: Advanced System Dynamics Modelling</strong></a></p><p class="p">This tutorial introduces the more advanced features of the system dynamics modelling tool: Modules and Operating interfaces</p></div></article></div></article></article></main></body></html>
\ No newline at end of file
--- /dev/null
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ index.xml,\
+ commonrtl.css,\
+ commonltr.css,\
+ Site/,\
+ SYSDYN.xml
--- /dev/null
+/*
+ | This file is part of the DITA Open Toolkit project.
+ | See the accompanying LICENSE file for applicable license.
+*/
+/*
+ | (c) Copyright 2004, 2005 IBM Corporation
+ */
+.unresolved {
+ background-color: skyblue;
+}
+.noTemplate {
+ background-color: yellow;
+}
+.base {
+ background-color: #ffffff;
+}
+/* Add space for top level topics */
+.nested0 {
+ margin-top: 1em;
+}
+/* div with class=p is used for paragraphs that contain blocks, to keep the XHTML valid */
+.p {
+ margin-top: 1em;
+}
+/* Default of italics to set apart figure captions */
+.figcap {
+ font-style: italic;
+}
+.figdesc {
+ font-style: normal;
+}
+/* Use @frame to create frames on figures */
+.figborder {
+ border-style: solid;
+ padding-left: 3px;
+ border-width: 2px;
+ padding-right: 3px;
+ margin-top: 1em;
+ border-color: Silver;
+}
+.figsides {
+ border-left: 2px solid;
+ padding-left: 3px;
+ border-right: 2px solid;
+ padding-right: 3px;
+ margin-top: 1em;
+ border-color: Silver;
+}
+.figtop {
+ border-top: 2px solid;
+ margin-top: 1em;
+ border-color: Silver;
+}
+.figbottom {
+ border-bottom: 2px solid;
+ border-color: Silver;
+}
+.figtopbot {
+ border-top: 2px solid;
+ border-bottom: 2px solid;
+ margin-top: 1em;
+ border-color: Silver;
+}
+/* Most link groups are created with <div>. Ensure they have space before and after. */
+.ullinks {
+ list-style-type: none;
+}
+.ulchildlink {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.olchildlink {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.linklist {
+ margin-bottom: 1em;
+}
+ul.linklist {
+ margin-top: 0;
+ list-style-type: none;
+ padding-left: 0;
+}
+li.linklist {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+.linklistwithchild {
+ margin-left: 1.5em;
+ margin-bottom: 1em;
+}
+.sublinklist {
+ margin-left: 1.5em;
+ margin-bottom: 1em;
+}
+.relconcepts {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.reltasks {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.relref {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.relinfo {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.breadcrumb {
+ font-size: smaller;
+ margin-bottom: 1em;
+}
+dt.prereq {
+ margin-left: 20px;
+}
+/* Set heading sizes, getting smaller for deeper nesting */
+.topictitle1 {
+ margin-top: 0;
+ margin-bottom: .1em;
+ font-size: 1.34em;
+}
+.topictitle2 {
+ margin-top: 1pc;
+ margin-bottom: .45em;
+ font-size: 1.17em;
+}
+.topictitle3 {
+ margin-top: 1pc;
+ margin-bottom: .17em;
+ font-size: 1.17em;
+ font-weight: bold;
+}
+.topictitle4 {
+ margin-top: .83em;
+ font-size: 1.17em;
+ font-weight: bold;
+}
+.topictitle5 {
+ font-size: 1.17em;
+ font-weight: bold;
+}
+.topictitle6 {
+ font-size: 1.17em;
+ font-style: italic;
+}
+.sectiontitle {
+ margin-top: 1em;
+ margin-bottom: 0;
+ color: black;
+ font-size: 1.17em;
+ font-weight: bold;
+}
+.section {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.example {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+div.tasklabel {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+h2.tasklabel,
+h3.tasklabel,
+h4.tasklabel,
+h5.tasklabel,
+h6.tasklabel {
+ font-size: 100%;
+}
+/* All note formats have the same default presentation */
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.notetitle {
+ font-weight: bold;
+}
+.notelisttitle {
+ font-weight: bold;
+}
+.tip {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.tiptitle {
+ font-weight: bold;
+}
+.fastpath {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.fastpathtitle {
+ font-weight: bold;
+}
+.important {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.importanttitle {
+ font-weight: bold;
+}
+.remember {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.remembertitle {
+ font-weight: bold;
+}
+.restriction {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.restrictiontitle {
+ font-weight: bold;
+}
+.attention {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.attentiontitle {
+ font-weight: bold;
+}
+.dangertitle {
+ font-weight: bold;
+}
+.danger {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.cautiontitle {
+ font-weight: bold;
+}
+.caution {
+ font-weight: bold;
+ margin-bottom: 1em;
+}
+.warning {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.warningtitle {
+ font-weight: bold;
+}
+/* Simple lists do not get a bullet */
+ul.simple {
+ list-style-type: none;
+}
+/* Used on the first column of a table, when rowheader="firstcol" is used */
+.firstcol {
+ font-weight: bold;
+}
+/* Various basic phrase styles */
+.bold {
+ font-weight: bold;
+}
+.boldItalic {
+ font-weight: bold;
+ font-style: italic;
+}
+.italic {
+ font-style: italic;
+}
+.underlined {
+ text-decoration: underline;
+}
+.uicontrol {
+ font-weight: bold;
+}
+.wintitle {
+ font-weight: bold;
+}
+.parmname {
+ font-weight: bold;
+}
+.kwd {
+ font-weight: bold;
+}
+.defkwd {
+ font-weight: bold;
+ text-decoration: underline;
+}
+.var {
+ font-style: italic;
+}
+.shortcut {
+ text-decoration: underline;
+}
+.menucascade > abbr {
+ text-decoration: none;
+}
+/* Default of bold for definition list terms */
+.dlterm {
+ font-weight: bold;
+}
+/* Use CSS to expand lists with @compact="no" */
+.dltermexpand {
+ font-weight: bold;
+ margin-top: 1em;
+}
+*[compact="yes"] > li {
+ margin-top: 0;
+}
+*[compact="no"] > li {
+ margin-top: .53em;
+}
+.liexpand {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.sliexpand {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.dlexpand {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.ddexpand {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.stepexpand {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.substepexpand {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+/* Align images based on @align on topic/image */
+div.imageleft {
+ text-align: left;
+}
+div.imagecenter {
+ text-align: center;
+}
+div.imageright {
+ text-align: right;
+}
+div.imagejustify {
+ text-align: justify;
+}
+/* The cell border can be turned on with
+ {border-right:solid}
+ This value creates a very thick border in Firefox (does not match other tables)
+
+ Firefox works with
+ {border-right:solid 1pt}
+ but this causes a barely visible line in IE */
+.cellrowborder {
+ border-left: none;
+ border-top: none;
+ border-right: solid 1px;
+ border-bottom: solid 1px;
+}
+.row-nocellborder {
+ border-left: none;
+ border-top: none;
+ border-right: hidden;
+ border-bottom: solid 1px;
+}
+.cell-norowborder {
+ border-top: none;
+ border-left: none;
+ border-bottom: hidden;
+ border-right: solid 1px;
+}
+.nocellnorowborder {
+ border: none;
+ border-right: hidden;
+ border-bottom: hidden;
+}
+pre.screen {
+ padding: 5px 5px 5px 5px;
+ border: outset;
+ background-color: #CCCCCC;
+ margin-top: 2px;
+ margin-bottom: 2px;
+ white-space: pre;
+}
+span.filepath,
+samp.codeph,
+pre.codeblock {
+ font-family: monospace;
+}
+
+/*!
+ * Custom CSS declarations, to be appended to the end of existing declarations
+ */
+
+.imageText {
+ padding: 1px;
+ border: 1px solid;
+ text-align: center;
+ border-color: #c8ccd1;
+}
+
+.imageBorder {
+ padding: 4px;
+ border: 1px solid;
+ border-color: #c8ccd1;
+ display: table;
+ background-color: #f8f9fa;
+}
+
+ .box {
+ display: flex;
+ align-items:left;
+}
+
+center {
+ margin: auto;
+ width: 50%;
+}
+
+.hr{
+ border-top: 1px solid black;
+}
+
+ pre {
+ color: #000000;
+ display: block;
+ white-space: pre-wrap;
+ margin: 1em 0;
+ background-color: #f8f9fa;
+ border: 1px solid #eaecf0;
+ padding: 0;
+}
--- /dev/null
+/*
+ | This file is part of the DITA Open Toolkit project.
+ | See the accompanying LICENSE file for applicable license.
+*/
+/*
+ | (c) Copyright 2004, 2005 IBM Corporation
+ */
+.unresolved {
+ background-color: skyblue;
+}
+.noTemplate {
+ background-color: yellow;
+}
+.base {
+ background-color: #ffffff;
+}
+/* Add space for top level topics */
+.nested0 {
+ margin-top: 1em;
+}
+/* div with class=p is used for paragraphs that contain blocks, to keep the XHTML valid */
+.p {
+ margin-top: 1em;
+}
+/* Default of italics to set apart figure captions */
+.figcap {
+ font-style: italic;
+}
+.figdesc {
+ font-style: normal;
+}
+/* Use @frame to create frames on figures */
+.figborder {
+ border-style: solid;
+ padding-left: 3px;
+ border-width: 2px;
+ padding-right: 3px;
+ margin-top: 1em;
+ border-color: Silver;
+}
+.figsides {
+ border-left: 2px solid;
+ padding-left: 3px;
+ border-right: 2px solid;
+ padding-right: 3px;
+ margin-top: 1em;
+ border-color: Silver;
+}
+.figtop {
+ border-top: 2px solid;
+ margin-top: 1em;
+ border-color: Silver;
+}
+.figbottom {
+ border-bottom: 2px solid;
+ border-color: Silver;
+}
+.figtopbot {
+ border-top: 2px solid;
+ border-bottom: 2px solid;
+ margin-top: 1em;
+ border-color: Silver;
+}
+/* Most link groups are created with <div>. Ensure they have space before and after. */
+.ullinks {
+ list-style-type: none;
+}
+.ulchildlink {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.olchildlink {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.linklist {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+ul.linklist {
+ margin-top: 0;
+ list-style-type: none;
+ padding-right: 0;
+}
+
+li.linklist {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+.linklistwithchild {
+ margin-top: 1em;
+ margin-right: 1.5em;
+ margin-bottom: 1em;
+}
+.sublinklist {
+ margin-top: 1em;
+ margin-right: 1.5em;
+ margin-bottom: 1em;
+}
+.relconcepts {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.reltasks {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.relref {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.relinfo {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.breadcrumb {
+ font-size: smaller;
+ margin-bottom: 1em;
+}
+dt.prereq {
+ margin-right: 20px;
+}
+/* Set heading sizes, getting smaller for deeper nesting */
+.topictitle1 {
+ margin-top: 0;
+ margin-bottom: .1em;
+ font-size: 1.34em;
+}
+.topictitle2 {
+ margin-top: 1pc;
+ margin-bottom: .45em;
+ font-size: 1.17em;
+}
+.topictitle3 {
+ margin-top: 1pc;
+ margin-bottom: .17em;
+ font-size: 1.17em;
+ font-weight: bold;
+}
+.topictitle4 {
+ margin-top: .83em;
+ font-size: 1.17em;
+ font-weight: bold;
+}
+.topictitle5 {
+ font-size: 1.17em;
+ font-weight: bold;
+}
+.topictitle6 {
+ font-size: 1.17em;
+ font-style: italic;
+}
+.sectiontitle {
+ margin-top: 1em;
+ margin-bottom: 0;
+ color: black;
+ font-size: 1.17em;
+ font-weight: bold;
+}
+.section {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.example {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+div.tasklabel {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+h2.tasklabel,
+h3.tasklabel,
+h4.tasklabel,
+h5.tasklabel,
+h6.tasklabel {
+ font-size: 100%;
+}
+/* All note formats have the same default presentation */
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.notetitle {
+ font-weight: bold;
+}
+.notelisttitle {
+ font-weight: bold;
+}
+.tip {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.tiptitle {
+ font-weight: bold;
+}
+.fastpath {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.fastpathtitle {
+ font-weight: bold;
+}
+.important {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.importanttitle {
+ font-weight: bold;
+}
+.remember {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.remembertitle {
+ font-weight: bold;
+}
+.restriction {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.restrictiontitle {
+ font-weight: bold;
+}
+.attention {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.attentiontitle {
+ font-weight: bold;
+}
+.dangertitle {
+ font-weight: bold;
+}
+.danger {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.cautiontitle {
+ font-weight: bold;
+}
+.caution {
+ font-weight: bold;
+ margin-bottom: 1em;
+}
+.warning {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.warningtitle {
+ font-weight: bold;
+}
+/* Simple lists do not get a bullet */
+ul.simple {
+ list-style-type: none;
+}
+/* Used on the first column of a table, when rowheader="firstcol" is used */
+.firstcol {
+ font-weight: bold;
+}
+/* Various basic phrase styles */
+.bold {
+ font-weight: bold;
+}
+.boldItalic {
+ font-weight: bold;
+ font-style: italic;
+}
+.italic {
+ font-style: italic;
+}
+.underlined {
+ text-decoration: underline;
+}
+.uicontrol {
+ font-weight: bold;
+}
+.wintitle {
+ font-weight: bold;
+}
+.parmname {
+ font-weight: bold;
+}
+.kwd {
+ font-weight: bold;
+}
+.defkwd {
+ font-weight: bold;
+ text-decoration: underline;
+}
+.var {
+ font-style: italic;
+}
+.shortcut {
+ text-decoration: underline;
+}
+.menucascade > abbr {
+ text-decoration: none;
+}
+/* Default of bold for definition list terms */
+.dlterm {
+ font-weight: bold;
+}
+/* Use CSS to expand lists with @compact="no" */
+.dltermexpand {
+ font-weight: bold;
+ margin-top: 1em;
+}
+*[compact="yes"] > li {
+ margin-top: 0;
+}
+*[compact="no"] > li {
+ margin-top: .53em;
+}
+.liexpand {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.sliexpand {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.dlexpand {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.ddexpand {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.stepexpand {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+.substepexpand {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+/* Align images based on @align on topic/image */
+div.imageleft {
+ text-align: left;
+}
+div.imagecenter {
+ text-align: center;
+}
+div.imageright {
+ text-align: right;
+}
+div.imagejustify {
+ text-align: justify;
+}
+/* The cell border can be turned on with
+ {border-right:solid}
+ This value creates a very thick border in Firefox (does not match other tables)
+
+ Firefox works with
+ {border-right:solid 1pt}
+ but this causes a barely visible line in IE */
+.cellrowborder {
+ border-right: none;
+ border-top: none;
+ border-left: solid 1px;
+ border-bottom: solid 1px;
+}
+.row-nocellborder {
+ border-right: none;
+ border-top: none;
+ border-left: hidden;
+ border-bottom: solid 1px;
+}
+.cell-norowborder {
+ border-top: none;
+ border-right: none;
+ border-bottom: hidden;
+ border-left: solid 1px;
+}
+.nocellnorowborder {
+ border: none;
+ border-left: hidden;
+ border-bottom: hidden;
+}
+pre.screen {
+ padding: 5px 5px 5px 5px;
+ border: outset;
+ background-color: #CCCCCC;
+ margin-top: 2px;
+ margin-bottom: 2px;
+ white-space: pre;
+}
+span.filepath,
+samp.codeph,
+pre.codeblock {
+ font-family: monospace;
+}
+
+/*!
+ * Custom CSS declarations, to be appended to the end of existing declarations
+ */
+
+.imageText {
+ padding: 1px;
+ border: 1px solid;
+ text-align: center;
+ border-color: #c8ccd1;
+}
+
+.imageBorder {
+ padding: 4px;
+ border: 1px solid;
+ border-color: #c8ccd1;
+ display: table;
+ background-color: #f8f9fa;
+}
+
+ .box {
+ display: flex;
+ align-items:left;
+}
+
+center {
+ margin: auto;
+ width: 50%;
+}
+
+.hr{
+ border-top: 1px solid black;
+}
+
+ pre {
+ color: #000000;
+ display: block;
+ white-space: pre-wrap;
+ margin: 1em 0;
+ background-color: #f8f9fa;
+ border: 1px solid #eaecf0;
+ padding: 0;
+}
--- /dev/null
+<?xml version="1.0" ?><index></index>
\ No newline at end of file
--- /dev/null
+# NLS_MESSAGEFORMAT_NONE
+# NLS_ENCODING=UTF-8
+name=Simantics System Dynamics
+providerName=DITA
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<plugin>
+ <extension point="org.eclipse.help.toc">
+ <toc file="SYSDYN.xml" primary="true"/>
+ </extension>
+ <extension point="org.eclipse.help.index">
+ <index file="index.xml"/>
+ </extension>
+</plugin>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.simantics.sysdyn.wiki</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
--- /dev/null
+<!DOCTYPE html
+ SYSTEM "about:legacy-compat">
+<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2018"><meta name="DC.rights.owner" content="(C) Copyright 2018"><meta name="DC.Type" content="topic"><meta name="DC.Format" content="HTML5"><meta name="DC.Identifier" content="tutorial-advanced-system-dynamics-modelling"><link rel="stylesheet" type="text/css" href="../commonltr.css"><title>Tutorial: Advanced System Dynamics Modelling</title></head><body id="tutorial-advanced-system-dynamics-modelling"><main role="main"><article role="article" aria-labelledby="ariaid-title1"><h1 class="title topictitle1" id="ariaid-title1">Tutorial: Advanced System Dynamics Modelling</h1><div class="body"><div class="div hr">
+</div><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#creating-model-and-modules">1 Creating model and modules</a></p></li><li class="li"><p class="p"><a class="xref" href="#initial-configuration">2 Initial configuration</a></p></li><li class="li"><p class="p"><a class="xref" href="#workforce-module">3 Workforce module</a></p></li><li class="li"><p class="p"><a class="xref" href="#work-module">4 Work module</a></p></li><li class="li"><p class="p"><a class="xref" href="#connecting-modules">5 Connecting modules</a></p></li><li class="li"><p class="p"><a class="xref" href="#simulating-the-model">6 Simulating the model</a></p></li></ul><p class="p">In this tutorial, we are going to bild a work model with two projects and shared workforce. Both the workforce and a separate project (work) are going to be created as modules, so they can be reused several times. Actually the model doesn't limit the number of projects at all. A <a class="xref" href="BasicTutorial.html">basic tutorial</a> is also available. This tutorial is part of the <a class="xref" href="sysdyn.html">sysdyn documentation</a>.</p></div><article class="topic nested1" aria-labelledby="ariaid-title2" id="creating-model-and-modules"><h2 class="title topictitle2" id="ariaid-title2">Creating model and modules</h2><div class="body"><div class="div hr">
+</div><p class="p">Let's start by creating the work model and the needed modules. First create a new model by right-clicking on the model browser and selecting New->Model. Alternatively you can select File->New Model from the main menu.</p><p class="p">Then create two new modules to your model. Right-click on the Modules folder and select New->Module.</p><p class="p">Name your model WorkModel and modules WorkforceModule and WorkModule. You can rename them by right-clicking on the item on the model browser and selecting Rename.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/NewModel.png"><br>
+ <p class="p imageText">Creating a new model</p>
+</div><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/NewModule.png"><br>
+ <p class="p imageText">Creating a new module</p>
+</div><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ModelStructure2.png"><br>
+ <p class="p imageText">Model after renaming</p>
+</div></div></article><article class="topic nested1" aria-labelledby="ariaid-title3" id="initial-configuration"><h2 class="title topictitle2" id="ariaid-title3">Initial configuration</h2><div class="body"><div class="div hr">
+</div><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/TwoModules.png"><br>
+ <p class="p imageText">Workforce and Work modules</p>
+</div><p class="p">We will use a top-down approach in our model, so first we will make a simple model configuration with our modules. Open our model configuration by double-clicking Configuration in your model browser.</p><p class="p">Drag one WorkforceModule and one WorkModule from your model browser to the WorkModel diagram. The modules are automatically named with a suffix number. Rename the modules to Workforce and Work1. You can rename objects on the diagram by double-clicking them or selecting them with one click and renaming them on the properties view below the diagram.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ConfigurationStart.png"><br>
+ <p class="p imageText">Workforce and Work modules, first inputs and connections</p>
+</div><p class="p">When the modules are on the diagram, we should think what values we would like to get from the modules and what values we would like to use in the modules.</p><p class="p">Workforce needs to know, how much work is required and it should provide information on how much work can be done. To provide the information on how much work can be done, we need an Input variable. Variables can be dragged to the diagram from Symbols view or by using <a class="xref" href="sysdyn.html#shortcut-and-control-keys">shortcut keys</a> (Shift+I for Input variable). Drag an input variable to the diagram and name it TotalPossibleWorkingSpeed.</p><p class="p">Work module on the other hand provides information on how much work is required in it and it needs to know when the work has to be ready. Create an input variable RequiredWorkingSpeed1 and an Auxiliary variable Work1CompletionTime and place all variables like in the picture on the right.</p><p class="p">Connect the variables to modules using dependency connections (arrows). Connections are created by holding down Alt key and first clicking on the variable where to start the connection and then clicking on the variable where to end.</p><p class="p">Now we have the initial idea of the model, so let's configure the modules.</p></div></article><article class="topic nested1" aria-labelledby="ariaid-title4" id="workforce-module"><h2 class="title topictitle2" id="ariaid-title4">Workforce module</h2><div class="body"><div class="div hr">
+</div><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/NetResourcing1.png"><br>
+ <p class="p imageText">Cloud, Valve, Flow and Stock</p>
+</div><p class="p">Open Workforce module by selecting it from the diagram, right-clicking it and selecting Show Module.</p><p class="p">Create a Stock variable and name it WorkforceStock. Stock variables are created the same way as Input and Auxiliary variables. The level of the stock is controlled with a valve and a flow. To create the flow, hold down Alt and right-click on an empty space left of the stock. Then left-click on the stock. A cloud, valve and a flow is created. Rename the valve to NetResourcing.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/NetResourcing2.png"><br>
+ <p class="p imageText">Cloud, Valve, Flow and Stock. Flow works both on directions.</p>
+</div><p class="p">NetResourcing works both ways. To display this also visually, delete the cloud by selecting it and pressing delete on your keyboard. Then create a flow starting from NetResourcing valve and ending on an empty space next to it.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/WorkforceAuxiliaries.png"><br>
+ <p class="p imageText">Auxiliaries in Workforce module</p>
+</div><p class="p">Now you have used all the basic components and connections. From now on the instructions will be a more simplified.</p><p class="p">Next we will create four Auxiliary variables: TimeToAllocateResources, WorkforceRequired, Productivity and PossibleWorkingSpeed. Place and connect them according to the picture on the right.</p><p class="p">To be able to simulate the model, all variables must have valid equations. To configure an equation, select a variable. Variable's properties are shown in the Property view and you can input the required equations in the text fields. You can copy the equations directly from here or type them manually. Variables connected to the selected variable are shown in the Variables list. To speed up typing, you can double click on a variable name and it will be inserted to the equation.</p><pre class="pre">WorkforceStock
+Initial value: 0
+
+NetResourcing
+= (WorkforceRequired - WorkforceStock)/TimeToAllocateResources
+
+TimeToAllocateResources
+= 2
+
+Productivity
+= 1
+
+PossibleWorkingSpeed
+= WorkforceStock * Productivity
+Is Output
+</pre><p class="p">Variables can be set as output by selecting Is Output option from the Equation tab.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/RequiredWorkingSpeedInput.png"><br>
+ <p class="p imageText">RequiredWorkingSpeedInput</p>
+</div><p class="p">On a previous phase, we wanted to give the value of RequiredWorkingSpeed1 to this workforce module. To get that value, we need to create an input. Create input RequiredWorkingSpeedInput, connect it to WorkforceRequired and write the following equation to WorkforceRequired.</p><pre class="pre">WorkForceRequired
+= RequiredWorkingSpeedInput/Productivity
+</pre><p class="p">Now this module is ready to be used as a part of the model.</p></div></article><article class="topic nested1" aria-labelledby="ariaid-title5" id="work-module"><h2 class="title topictitle2" id="ariaid-title5">Work module</h2><div class="body"><div class="div hr">
+</div><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/WorkStocks.png"><br>
+ <p class="p imageText">Basic work with errors</p>
+</div><p class="p">Open Work1 module by selecting it from the WorkModel diagram, right-clicking it and selecting Show Module. Alternatively you can double click Work1 on the model browser.</p><p class="p">Create the basic flow of work with stocks and flows like in the picture on the right.</p><p class="p">The idea of the model is that first there is work. Work is done at a certain speed. When working, errors are also made. When errors are found, the amount of Errors is reduced, errors are removed from WorkDone and moved back to WorkToDo.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ProjectIsReady.png"><br>
+ <p class="p imageText">Smoothener for work is done</p>
+</div><p class="p">Work needs to be stopped when the project is ready. Since the simulator might face some difficulties to determine the projects readyness when project is almost ready, we need to implement some smoothing to the limit. OpenModelica doesn't yet have a builtin function for smoothing, so we need to implement our own. Create variables and connections according to the picture on the right.</p><p class="p">Use the following equations for variables:</p><pre class="pre">ProjectIsReady
+Initial value: 0
+
+ProjectReadyness
+= (xidz(WorkDone, ProjectWorkAmount, 0.0) - ProjectIsReady) / 0.08
+</pre><p class="p">xidz is short for function X if devided by zero. This means that the simulation calculates ''WorkDone / ProjectWorkAmount''. If ProjectWorkAmount is zero, the result is the third argument ''0.0''.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ProjectWorkAmount.png"><br>
+ <p class="p imageText">ProjectWorkAmount input variable</p>
+</div><p class="p">As you can see, ProjectWorkAmount is highlighted. Your model doesn't contain such variable and it is not connected to ProjectReadyness. Create an Input variable ProjectWorkAmount with default value 1000 and connect it to ProjectReadyness. The reason we are using input variable is that you can determine the default size of a project, but if you want to change it, you can change it from outside the module.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ErrorsVariables.png"><br>
+ <p class="p imageText">Variables needed for error handling</p>
+</div><p class="p">Next we need to define how errors are found. For that we need new variables: WorkQuality and ErrorsFoundTime. Create the variables and connections according to the picture and give variables their equations.</p><pre class="pre">ErrorsGenerated
+= (1-WorkQuality) * WorkingSpeed
+
+ErrorsFoundRate
+= Errors/ErrorsFoundTime
+
+WorkQuality
+= 0.9
+
+ErrorsFoundTime
+Type: WithLookup
+With Lookup: xidz(WorkDone, ProjectWorkAmount, 0.0)
+Lookup table: {{0,5},{0.5,3},{1,0.5},{2,0.5}}
+</pre><p class="p">WithLookup is a variable type where the value is interpolated from a 2-dimensional table (Lookup table) using the value determined in the "With Lookup" field. Type can be changed from the drop-down menu Type.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/WorkAllocation.png"><br>
+ <p class="p imageText">WorkAllocation and RequiredWorkingSpeed</p>
+</div><p class="p">To calculate our own need for workforce we need to create and connect WorkCompletionTime input variable and the following auxliary variables:</p><pre class="pre">RequiredWorkingSpeed
+= if ProjectIsReady < 1 then xidz(WorkToDo, TimeToDeadline, MaximumWorkingSpeed) else 0
+Is Output
+
+MaximumWorkingSpeed
+= 500
+
+TimeToDeadline
+= max(0, WorkCompletionTime-time)
+</pre><p class="p">time is a universal variable that gives the current simulation time.</p><p class="p">We need to decide how the workforce is allocated between all the work modules that are using the same workforce. For that we need to know how much work can be done and how much workforce other works require.</p><p class="p">Create two Inputs, RequiredWorkingSpeedTotalInput and PossibleWorkingSpeedInput, and an auxiliary variable WorkAllocation. Connect the variables like int the picture.</p><pre class="pre">WorkAllocation
+= xidz(RequiredWorkingSpeed, RequiredWorkingSpeedTotalInput, 0.0) * PossibleWorkingSpeedInput
+</pre><p class="p">Finally let's give initial values for all the remaining variables:</p><pre class="pre">WorkingSpeed
+= if ProjectIsReady < 1 then WorkAllocation else 0
+
+WorkToDo
+Initial value: ProjectWorkAmount
+
+WorkDone
+Initial value: 0
+
+Errors
+Initial value: 0
+</pre></div></article><article class="topic nested1" aria-labelledby="ariaid-title6" id="connecting-modules"><h2 class="title topictitle2" id="ariaid-title6">Connecting modules</h2><div class="body"><div class="div hr">
+</div><p class="p">Our modules are complete. Let's get back to the WorkModel Configuration.</p><pre class="pre">Set Work1CompletionTime to 10.
+</pre><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ModuleConnections1.png"><br>
+ <p class="p imageText">Module input connections</p>
+</div><p class="p">Connections between modules are made in the properties of the module. Select Work1 and open tab Inputs from the properties. The table lists all input variables in the module that are available. Clicking on the Refers to output column will open a drop-down menu that shows all available variables that are connected to the module. By selecting a variable, you connect that variable to the input.</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ModuleConnections2.png"><br>
+ <p class="p imageText">Module input connections</p>
+</div><p class="p">Work1 need also information on how much working speed is required by all works. Since Work1 is the only work, create a dependency connection from RequiredWorkingSpeed1 to Work1 and in Work1's properties connect it to RequiredWorkingSpeedTotalInput.</p><p class="p">In Outputs tab, make the only possible connection: from RequiredWorkingSpeed to RequiredWorkingSpeed1.</p><p class="p">Workforce module has only one input and one output. Create the only possible connections:
+(Inputs) RequiredWorkingSpeedInput -> RequiredWorkingSpeed1
+(Outputs) PossibleWorkingSpeed -> TotalPossibleWorkingSpeed</p><p class="p">Now your model is ready for simulation!</p></div></article><article class="topic nested1" aria-labelledby="ariaid-title7" id="simulating-the-model"><h2 class="title topictitle2" id="ariaid-title7">Simulating the model</h2><div class="body"><div class="div hr">
+</div><p class="p">To make the simulation time longer, select Configuration on the model browser. Give the model Stop time 24.0</p><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ActivateExperiment.png"><br>
+ <p class="p imageText">Experiment activation</p>
+</div><div class="p">To run simulations, you must activate an experiment. Expand the experiments folder on your model browser. There is one ready-made experiment. Double click on the experiment and the experiment control buttons appear on the toolbar. To simulate the model, press the play button: <div class="div image">
+<img class="image" src="AdvancedTutorialImages/ExperimentPlay.png"><br><p class="p">System shows the simulation progress in the progress bar on the lower right corner of the screen.</p><div class="div image">
+ <img class="image" src="AdvancedTutorialImages/SimulationProgress.png"><br>
+</div><p class="p">When the progress indicator disappears, the simulation is complete.</p><p class="p">If the Console view pops up and shows an error "Error: Too few equations, underdetermined system. The model has X equation(s) and Y variable(s)", the simulation has failed. The reason might be that you forgot to assign an equation to some variable or some connection in modules. See through all the variables, write the missing equation and simulate again.</p><p class="p">After the simulation is succesfully run, you can select a variable and see its simulation results in the trend view. For example WorkDone variable in Work1 module will give the following graph.</p><div class="div image">
+ <img class="image" src="AdvancedTutorialImages/FirstSimulation.png"><br>
+</div></div></div><article class="topic nested2" aria-labelledby="ariaid-title8" id="adding-modules"><h3 class="title topictitle3" id="ariaid-title8">Adding modules</h3><div class="body"><div class="div hr">
+</div><div class="div imageBorder">
+ <img class="image" src="AdvancedTutorialImages/ModulesFinal.png"><br>
+ <p class="p imageText">Final configuration with two modules</p>
+</div><p class="p">We created the WorkModule to be reusable. To use two WorkModules in the model, you must do the following.</p><p class="p">Populate a second WorkModule to WorkModel configuration and name it Work2.</p><p class="p">Create RequiredWorkingSpeed2 input variable and Work2CompletionTime auxiliary variable.</p><p class="p">We need a sum of all working speed requirements to give to the work modules. For this purpose, create an auxiliary variable RequiredWorkingSpeedTotal which sums the requirements.</p><p class="p">You can also have a different size work. To make Work2 smaller, create an auxiliary variable Work2Amount.</p><p class="p">Use the following equations:</p><pre class="pre">Work2CompletionTime
+= 13
+
+Work2Amount
+= 800
+
+RequiredWorkingSpeedTotal
+= RequiredWorkingSpeed1 + RequiredWorkingSpeed2
+</pre><p class="p">Update connections to match connections shown in the picture and connect the inputs and outputs to the modules.</p><pre class="pre">Workforce
+RequiredWorkingSpeedInput -> RequiredWorkingSpeedTotal
+
+Work1 Inputs
+RequiredWorkingSpeedTotalInput -> RequiredWorkingSpeedTotal
+
+Work2 Outputs
+RequiredWorkingSpeed -> RequiredWorkingSpeed2
+
+Work2 Inputs
+</pre><div class="div image">
+ <img class="image" src="AdvancedTutorialImages/Module2Inputs.png"><br>
+</div><p class="p">When all the connections are made, you can simulate the model again. Now you have model with two work modules. Select variables from both modules in model browser to display them in trend view.</p><div class="div image">
+ <img class="image" src="AdvancedTutorialImages/SecondSimulation.png"><br>
+</div></div></article></div></article></article></main></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html
+ SYSTEM "about:legacy-compat">
+<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2018"><meta name="DC.rights.owner" content="(C) Copyright 2018"><meta name="DC.Type" content="topic"><meta name="DC.Format" content="HTML5"><meta name="DC.Identifier" content="tutorial-basic-system-dynamics-modelling"><link rel="stylesheet" type="text/css" href="../commonltr.css"><title>Tutorial: Basic System Dynamics Modelling</title></head><body id="tutorial-basic-system-dynamics-modelling"><main role="main"><article role="article" aria-labelledby="ariaid-title1"><h1 class="title topictitle1" id="ariaid-title1">Tutorial: Basic System Dynamics Modelling</h1><div class="body"><div class="div hr">
+</div><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#model">1 Model</a></p></li><li class="li"><p class="p"><a class="xref" href="#configuring-the-model-structure">2 Configuring the model structure</a></p></li><li class="li"><p class="p"><a class="xref" href="#equations">3 Equations</a></p></li><li class="li"><p class="p"><a class="xref" href="#simulating-the-model">4 Simulating the model</a></p></li></ul><p class="p">This tutorial introduces you to the basic components and concepts of the System dynamics modelling tool for Simantics. After completing this tutorial, you know how to configure and simulate a system dynamics model. An <a class="xref" href="AdvancedTutorial.html">advanced tutorial</a> is also available. This tutorial is part of the <a class="xref" href="sysdyn.html">sysdyn documentation</a>.</p></div><article class="topic nested1" aria-labelledby="ariaid-title2" id="model"><h2 class="title topictitle2" id="ariaid-title2">Model</h2><div class="body"><div class="div hr">
+</div><p class="p">We are going to create a simple population model. The model consists of the basic components: Auxiliaries, valves, stocks, dependencies and flows.</p><p class="p">Start by creating a new model. Right-click on the model browser and select New -> Model.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/NewModel.png"><br>
+ <p class="p imageText">Creating a new model</p>
+</div><p class="p">Rename the model to Population. Right-click on Model1 and select Rename.</p><p class="p">Expand the model tree and double-click on Configuration. The model configuration diagram opens in a new editor.</p></div></article><article class="topic nested1" aria-labelledby="ariaid-title3" id="configuring-the-model-structure"><h2 class="title topictitle2" id="ariaid-title3">Configuring the model structure</h2><div class="body"><div class="div hr">
+</div><p class="p">Our model is now empty. Let's build a population model for mice.</p><p class="p">Open Symbols view and expand BasicSymbols. If BasicSymbols are not visible, make sure that you have the diagram open. The contents of the Symbols view depends on the active diagram editor.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/SymbolsView.png"><br>
+ <p class="p imageText">Symbols view</p>
+</div><p class="p">These are the basic symbols in System dynamics modelling. We will use these to create the model.</p><p class="p">Drag one stock variable from Symbols view to the diagram. You can zoom and move on the diagram using <a class="xref" href="sysdyn.html#shortcut-and-control-keys">shortcut keys</a></p><p class="p">Select the variable. Properties view on the bottom of the screen shows the properties of the selected variable. Change the name to Mice and press enter.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/Mice.png"><br>
+ <p class="p imageText">Stock variable Mice</p>
+</div><p class="p">Next we will draw flows in and out of Mice. Drag one cloud variable from Symbols view to the left hand side of Mice. Hold down Alt and right-click on the cloud. Move cursor on top of Mice and left-click. The system creates a flow from the cloud to Mice and a valve in the middle of the flow. The valve controls the speed of the flow. Flow from Mice is created the same way. Drag one cloud variable from Symbols view to the right hand side of Mice. Hold down Alt and right-click on Mice. Move cursor on top of the cloud and left-click. Rename the valves to MouseBirths and MouseDeaths.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/MiceFlows.png"><br>
+ <p class="p imageText">Flows in and out of Mice</p>
+</div><p class="p">Of course mice are not alone in the world. There are also owls that hunt mice. Create a similar structure below mice for owls.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/MiceAndOwls.png"><br>
+ <p class="p imageText">Owls and mice</p>
+</div><p class="p">To control the births and deaths, we need auxiliary variables. Auxiliary variables can be dragged from Symbols view just like Stock variables. We need one variable for each valve to control it. Drag the variables and rename them according to the picture below.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/Auxiliaries.png"><br>
+ <p class="p imageText">Auxiliaries for valves</p>
+</div><p class="p">Arrow connections, dependencies, are created almost like flows. The difference is that the connection is started and ended with a left click and the connection can only be made between two existing variables. Connect the auxiliary variables and valves like in the picture below.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/Dependency_connections.png"><br>
+ <p class="p imageText">Dependency connections</p>
+</div></div></article><article class="topic nested1" aria-labelledby="ariaid-title4" id="equations"><h2 class="title topictitle2" id="ariaid-title4">Equations</h2><div class="body"><div class="div hr">
+</div><p class="p">As you can see from the model, we have made some shortcuts in our model to make it more simple. In reality, there are lots of other factors that affect mouse and owl populations. Let's however use this model as an example.</p><p class="p">For the model to be simulated, each variable needs to have an equation. Equations can be configured from the property view, like the names. Input the following equations into the corresponding variables:</p><pre class="pre">MouseBirths
+= MouseBirthRate * Mice
+
+MouseDeaths
+= Mice * MouseDeathsDueToOwls * Owls
+
+OwlBirths
+= OwlsFromMice * MouseDeaths
+
+OwlDeaths
+= OwlDeathRate * Owls
+
+MouseBirthRate
+= 0.04
+
+MouseDeathsDueToOwls
+= 0.0005
+
+OwlsFromMice
+= 0.1
+
+OwlDeathRate
+= 0.09
+</pre><p class="p">Finally we need initial values for our populations.</p><pre class="pre">Mice
+Initial Value: 700
+
+Owls
+Initial Value: 10
+</pre></div></article><article class="topic nested1" aria-labelledby="ariaid-title5" id="simulating-the-model"><h2 class="title topictitle2" id="ariaid-title5">Simulating the model</h2><div class="body"><div class="div hr">
+</div><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/ActivatePopulationExperiment.png"><br>
+ <p class="p imageText">Experiment activation</p>
+</div><div class="p">Now the model is configured and ready for simulation. Switch Symbols view back to Model Browser. Expand the Experiments folder on your model and double-click on Experiment. This activates the experiment. Experiment needs to be active before the model can be simulated. Experiment activations adds experiment control buttons to the toolbar. To simulate the model, press the play button: <div class="div image">
+<img class="image" src="BasicTutorialImages/ExperimentPlay.png"><br><p class="p">System shows the simulation progress in the progress bar on the lower right corner of the screen.</p><div class="div image">
+ <img class="image" src="BasicTutorialImages/SimulationProgress.png"><br>
+</div><p class="p">When the progress indicator disappears, the simulation is complete.</p><p class="p">After the simulation has run, you can select variables from the diagram or model browser and their values over the simulation time will be shown on Trend View. You can select multiple variables from the diagram by holding down Ctrl key. Select Mice and Owls.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/MiceAndOwlResults1.png"><br>
+ <p class="p imageText">Results for Mice and Owls</p>
+</div><p class="p">As you can see, the simulation is complete, but the results do not reveal any interesting behavior. Let's extend the simulation time.</p><p class="p">Select Configuration from the model browser. In the properties-view change stop time to 300.0 and simulate again.</p><p class="p">After the simualtion is complete, Select Mice and Owls again.</p><div class="div imageBorder">
+ <img class="image" src="BasicTutorialImages/MiceAndOwlResults2.png"><br>
+ <p class="p imageText">Results for Mice and Owls, Extended simulation time</p>
+</div><p class="p">Now the simulation reveals the traditional behavior of predator-prey models. Feel free to adjust the parameters and try the simulations again.</p></div></div></div></article></article></main></body></html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html
+ SYSTEM "about:legacy-compat">
+<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2018"><meta name="DC.rights.owner" content="(C) Copyright 2018"><meta name="DC.Type" content="topic"><meta name="DC.Format" content="HTML5"><meta name="DC.Identifier" content="simantics-system-dynamics"><link rel="stylesheet" type="text/css" href="../commonltr.css"><title>Simantics System Dynamics</title></head><body><main role="main"><article role="article" aria-labelledby="ariaid-title1"><article class="nested0" aria-labelledby="ariaid-title1" id="simantics-system-dynamics"><h1 class="title topictitle1" id="ariaid-title1">Simantics System Dynamics</h1><div class="body"></div><article class="topic nested1" aria-labelledby="ariaid-title2" id="contents"><h2 class="title topictitle2" id="ariaid-title2">Contents</h2><div class="body"><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#what-is-simantics-system-dynamics">1 What is Simantics System Dynamics</a></p></li><li class="li"><p class="p"><a class="xref" href="#introduction-to-system-dynamics-simulation">2 Introduction to System Dynamics Simulation</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#system-dynamics">2.1 System Dynamics</a></p></li><li class="li"><p class="p"><a class="xref" href="#model">2.2 Model</a></p></li><li class="li"><p class="p"><a class="xref" href="#components">2.3 Components</a></p></li><li class="li"><p class="p"><a class="xref" href="#modeling-principles">2.4 Modeling Principles</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#installation-instructions">3 Installation Instructions</a></p></li><li class="li"><p class="p"><a class="xref" href="#workbench">4 Workbench</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#global-preferences">4.1 Global Preferences</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#modelling">5 Modelling</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#basic-modelling">5.1 Basic Modelling</a></p></li><li class="li"><p class="p"><a class="xref" href="#model-properties">5.2 Model Properties</a></p></li><li class="li"><p class="p"><a class="xref" href="#special-variables">5.3 Special Variables</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#withlookup">5.3.1 WithLookup</a></p></li><li class="li"><p class="p"><a class="xref" href="#delay">5.3.2 Delay</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#shortcut-and-control-keys">5.4 Shortcut and Control Keys</a></p></li><li class="li"><p class="p"><a class="xref" href="#unit-validation">5.5 Unit Validation</a></p></li><li class="li"><p class="p"><a class="xref" href="#diagram-profiles">5.6 Diagram Profiles</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#visual-model-elements">6 Visual model elements</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#fonts-and-colors">6.1 Fonts and colors</a></p></li><li class="li"><p class="p"><a class="xref" href="#dependency-properties">6.2 Dependency properties</a></p></li><li class="li"><p class="p"><a class="xref" href="#loops">6.3 Loops</a></p></li><li class="li"><p class="p"><a class="xref" href="#comments">6.4 Comments</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#simulation">7 Simulation</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#experiments">7.1 Experiments</a></p></li><li class="li"><p class="p"><a class="xref" href="#solvers">7.2 Solvers</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#simulation-result-and-model-structure-analysis">8 Simulation Result and Model Structure Analysis</a></p></li><li class="li"><p class="p"><a class="xref" href="#custom-charts">9 Custom Charts</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#line-chart">9.1 Line Chart</a></p></li><li class="li"><p class="p"><a class="xref" href="#sensitivity-chart">9.2 Sensitivity Chart</a></p></li><li class="li"><p class="p"><a class="xref" href="#bar-chart">9.3 Bar Chart</a></p></li><li class="li"><p class="p"><a class="xref" href="#pie-chart">9.4 Pie Chart</a></p></li><li class="li"><p class="p"><a class="xref" href="#chart-panel">9.5 Chart Panel</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#multidimensional-variables">10 Multidimensional Variables</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#modeling">10.1 Modeling</a></p></li><li class="li"><p class="p"><a class="xref" href="#expressions">10.2 Expressions</a></p></li><li class="li"><p class="p"><a class="xref" href="#array-slices">10.3 Array Slices</a></p></li><li class="li"><p class="p"><a class="xref" href="#arithmetic-operators">10.4 Arithmetic Operators</a></p></li><li class="li"><p class="p"><a class="xref" href="#builtin-modelica-functions">10.5 Builtin Modelica Functions</a></p></li><li class="li"><p class="p"><a class="xref" href="#simulation-results">10.6 Simulation Results</a></p></li><li class="li"><p class="p"><a class="xref" href="#array-variables-in-modules">10.7 Array Variables in Modules</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#functions">11 Functions</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#creating-functions">11.1 Creating Functions</a></p></li><li class="li"><p class="p"><a class="xref" href="#function-libraries">11.2 Function Libraries</a></p></li><li class="li"><p class="p"><a class="xref" href="#external-functions">11.3 External Functions</a></p></li><li class="li"><p class="p"><a class="xref" href="#modelica-functions">11.4 Modelica Functions</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#spreadsheets">12 Spreadsheets</a></p><ul class="ul"><li class="li"><p class="p"><a class="xref" href="#variable-values">12.1 Variable Values</a></p></li><li class="li"><p class="p"><a class="xref" href="#history-data">12.2 History Data</a></p></li></ul></li><li class="li"><p class="p"><a class="xref" href="#vensim-model-import">13 Vensim Model Import</a></p></li><li class="li"><p class="p"><a class="xref" href="#sample-models-and-molecules">14 Sample Models and Molecules</a></p></li></ul></div></article></article><article class="topic nested0" aria-labelledby="ariaid-title3" id="what-is-simantics-system-dynamics"><h1 class="title topictitle1" id="ariaid-title3">What is Simantics System Dynamics</h1><div class="body"><div class="div hr">
+</div><p class="p"><em class="ph i">Simantics System Dynamics</em> is currently the only open source modelling and simulating tool for Simantics. Simantics System Dynamics is under development and will go through some changes in the future. New features will be added and old ones improved according to the needs of the modellers.</p><p class="p">This documentation introduces you to the current version of Simantics System Dynamics. Documentation includes the basic modelling principles and a guide on how to model system dynamics models with Simantics System Dynamics. If you like to get to know the tool better and try modelling and simulating yourself, <a class="xref" href="#installation-instructions">install</a> the software and try our <a class="xref" href="BasicTutorial.html">basic</a> and <a class="xref" href="AdvancedTutorial.html">advanced</a> tutorials!</p></div></article><article class="topic nested0" aria-labelledby="ariaid-title4" id="introduction-to-system-dynamics-simulation"><h1 class="title topictitle1" id="ariaid-title4">Introduction to System Dynamics Simulation</h1><div class="body"><div class="div hr">
+</div></div><article class="topic nested1" aria-labelledby="ariaid-title5" id="system-dynamics"><h2 class="title topictitle2" id="ariaid-title5">System Dynamics</h2><div class="body"><p class="p">System dynamics is an approach to understanding different organizations, markets and other complex systems and their dynamic behavior. Simantics System Dynamics is a free modelling tool for system dynamics modeling and simulation. See <a class="xref" href="#installation-instructions">installation instructions</a>.</p></div></article><article class="topic nested1" aria-labelledby="ariaid-title6" id="model"><h2 class="title topictitle2" id="ariaid-title6">Model</h2><div class="body"><p class="p">System dynamics model is generally understood as the model configuration. In this tool, the model contains also other components: <a class="xref" href="#experiments">Experiments</a> are the way to simulate the model. You can have experiments with different configurations, for example different initial values for some parameters. In that way, you don't have to always configure the model for different scenarios. <a class="xref" href="#basic-modelling">Module types</a> allow user to create reusable component types which can be instantiated as Modules. The Modules folder contains all the different module types in your model and you can create new module types there. The <a class="xref" href="#functions">Functions</a> folder contains built-in and user-defined functions.</p><div class="div imageBorder">
+ <img class="image" src="Images/ModelStructure.png"><br>
+ <p class="p imageText">Model structure</p>
+</div></div></article><article class="topic nested1" aria-labelledby="ariaid-title7" id="components"><h2 class="title topictitle2" id="ariaid-title7">Components</h2><div class="body"><p class="p">Most of the components you can use in your models are basic system dynamics components. The modularity of the models introduces two additional components, Modules and Inputs. All the components are explained below.</p><div class="div imageBorder">
+ <img class="image" src="Images/ComponentTypes.png"><br>
+ <p class="p imageText">Component types</p>
+</div><p class="p"><strong class="ph b">Auxiliary</strong></p><p class="p">Auxiliary is the most basic variable you can use. It represents a single value or a mathematical expression. There are different types of auxiliary variables currently in the system: <em class="ph i">Auxiliary</em>, <em class="ph i">Parameter</em>, <em class="ph i">Constant</em>, <a class="xref" href="#delay"><em class="ph i">Delay</em></a> and <a class="xref" href="#withlookup"><em class="ph i">WithLookup</em></a>. Auxiliary is the default type. Parameters are static values that the user can change. When only parameters are changed, the model simulates faster, because the system does not have to recompile the model. WithLookup and Delay are special variables. WithLookup has an expression and a lookup table. The expression defines what value is taken from the defined table. Delay variable delays an equation a given time with a given delay order.</p><p class="p"><strong class="ph b">Dependency</strong></p><p class="p">Dependency is an arrow that connects two components. It means that the value of the variable from which the arrow starts is used to calculate the value of the variable where the arrow ends. Dependencies that are used for a stock initial value only are colored grey by default, in contrast to the regular blue dependency arrows.</p><p class="p"><strong class="ph b">Flow</strong></p><p class="p">Flow connects clouds, valves and stocks. Flow represents an actual flow of something from stocks or clouds to stocks or clouds. There has to be at least one valve in a flow and the system creates it automatically, if none of the ends of the flow is a valve.</p><p class="p"><strong class="ph b">Valve</strong></p><p class="p">Valve regulates the rate of a flow. The value of a valve is automatically used in calculating the level of an adjacent stock. Valves behave just like Auxiliary variables but look different and you can connect also flows to them.</p><p class="p"><strong class="ph b">Stock</strong></p><p class="p">The value of a stock variable is an integral of flows leaving and flows arriving to the variable. The integral is calculated automatically from the valves that are connected to the variable with flow connections. Alternatively, the equation that is integrated can be defined manually by user. A stock must be given an initial value. Initial value can be a single value or an equation. You can use values of other variables to calculate the initial value.</p><p class="p"><strong class="ph b">Cloud</strong></p><p class="p">Cloud is not a variable. It represents a starting or ending point of a flow, if it is not in the scope of the model.</p><p class="p"><strong class="ph b">Module</strong></p><p class="p">Modules enable structural modeling. Modules are defined just like the basic model configuration, but the module component hides the actual configuration. You can only connect dependency connections into the module and dependency connections from the module must end to Input variables. The interface of the module is defined using input and output variables in the configuration of the module. All variable types can be set as output variables. If a variable is an output variable, its font is bold.</p><p class="p"><strong class="ph b">Input</strong></p><p class="p">Input variables are the way of getting values from other modules. Inputs look like auxiliary variables except their font is italics. You can set a default value to the input variable in case it is not connected to any variable. Connections are made from the modules properties, when the module is populated. Input doesn't have to be connected with an arrow to a module. If the variable has no connections, it can get values from a higher level in the hierarchy. If an input is connected to an output, the output and its module are shown below the variable using dot notation.</p><p class="p"><strong class="ph b">Shadow</strong></p><p class="p">A shadow variable is a reference to a variable defined elsewhere on the diagram. The referred variable can be an auxiliary, a valve, a stock, or an input. Dependency and flow arrows can be drawn out of a shadow variable, but no arrows can be drawn into a shadow variable. Shadow variables are used to improve the readability of the model.</p><p class="p"><strong class="ph b">Loop</strong></p><p class="p">A loop element is a graphical component for highlighting selected feedback loops in a model.</p><p class="p"><strong class="ph b">Comment</strong></p><p class="p">A comment element is a string of text on diagram.</p></div></article><article class="topic nested1" aria-labelledby="ariaid-title8" id="modeling-principles"><h2 class="title topictitle2" id="ariaid-title8">Modeling Principles</h2><div class="body"><p class="p">System dynamics modelling is much more than just mathematical formulas and nice graphs. Models are ways of communicating. There are some basic principles in system dynamics modelling that make the models easier to read and understand. You do not have to apply these principles to simulate models, but using them makes it easier for you to communicate your model to others.</p><p class="p"><strong class="ph b">Variable names</strong></p><p class="p">Variables names should be nouns, not verbs. The names should be positive: for example it is easier to understand that satisfaction decreases than dissatisfaction rises. Variable names can and should have multiple words, if they are needed. Note that due to the reserved words in Modelica, variable names such as <em class="ph i">Carbon in Atmosphere</em> cannot be used (<em class="ph i">in</em> is a reserved word). Capitalizing the reserved (<em class="ph i">in</em> --> <em class="ph i">In</em>) word can be used to sidestep the problem.</p><p class="p"><strong class="ph b">Connections</strong></p><p class="p">You should usually try to avoid overlapping dependency arrows. Organizing the variables on the diagram and using shadow variables can be used for that purpose. Dependencies should also form distinctive loops, if there is a loop. It makes it easier to read and understand the model and its behavior.</p><p class="p"><strong class="ph b">Graphical annotations</strong></p><p class="p">System dynamics contains usually annotations for loops, polarities, delays and so on. Annotations are important, for communicating the behavior of the model.</p></div></article></article><article class="topic nested0" aria-labelledby="ariaid-title9" id="installation-instructions"><h1 class="title topictitle1" id="ariaid-title9">Installation Instructions</h1><div class="body"><div class="div hr">
+</div><p class="p">System dynamics tool is provided with the Simantics platform.</p><ol class="ol"><li class="li"><p class="p"><a class="xref" href="http://sysdyn.simantics.org/" target="_blank">Download installer from the tool's download page</a></p></li><li class="li"><p class="p">Install the program to a directory without spaces (limitation inherited from OpenModelica).</p></li><li class="li"><p class="p">Run the application through the launcher generated by the installer</p><p class="p">(default: Simantics\Simantics-1.8.0-Sysdyn-32\Simantics-1.8.0-Sysdyn-32)</p></li></ol><p class="p"><a class="xref" href="http://www.openmodelica.org/" target="_blank">OpenModelica</a> is used to build and simulate the models. Simantics platform has integrated OpenModelica 1.9.0 beta4 for Windows environments. For other versions and other environments you need to install <a class="xref" href="https://www.openmodelica.org/download/download-windows" target="_blank">OpenModelica</a>. In addition to OpenModelica, a development version of a <a class="xref" href="#solvers">purpose-built Modelica solver</a> is embedded in the tool.</p></div></article><article class="topic nested0" aria-labelledby="ariaid-title10" id="workbench"><h1 class="title topictitle1" id="ariaid-title10">Workbench</h1><div class="body"><div class="div hr">
+</div><div class="div image">
+ <img class="image" src="Images/BasicWorkbench.png"><br>
+</div><p class="p">1 <strong class="ph b">Diagram</strong></p><p class="p">Diagram is the area where you will graphically modify your model. Diagrams are built from elements that can be dragged from Symbols view or populated using shortcut keys.</p><p class="p">2 <strong class="ph b">Model Browser</strong></p><p class="p">Model browser shows the structure of your model and all items related to it.</p><p class="p"><strong class="ph b">Symbols</strong></p><p class="p">Symbols view (stacked with the model browser) is used for dragging elements to diagrams.</p><p class="p"><strong class="ph b">Search</strong></p><p class="p">Search view (stacked with the model browser) is used for searching elements in all models. Search can be launched also from the search field in the bottom right corner or by Ctrl+F.</p><p class="p">3 <strong class="ph b">Properties</strong></p><p class="p">Property view shows the selected variable's properties. Property view has a different layout depending on the type of the selected component. The view can also have different tabs depending on the component type. Basic tabs for variables are Equation, Indexes, and Additional information.</p><p class="p"><strong class="ph b">Console</strong></p><p class="p">Console view (stacked with the property view) shows console messages from the simulator. Console can be used for debugging models simulated using OpenModelica.</p><p class="p"><strong class="ph b">Issues</strong></p><p class="p">Issue view (stacked with the property view) shows the errors and warnings in all models.</p><p class="p"><strong class="ph b">Profiles</strong></p><p class="p"><a class="xref" href="#diagram-profiles">Profiles</a> view (stacked with the property view) allows enabling/disabling some visual diagram effects.</p><p class="p"><strong class="ph b">Trend</strong></p><p class="p"><a class="xref" href="#simulation-result-and-model-structure-analysis">Trend</a> view shows the graphical representation of the values of the selected value over time. For the trend to be shown, a simulation has to be run. The view shows always the results of the latest run, but you can save results of a simulation and show them in the same trend with results from another simulation.</p><p class="p"><strong class="ph b">Structure</strong></p><p class="p">The <a class="xref" href="#simulation-result-and-model-structure-analysis">structure</a> view (stacked with the trend view) can be used for analyzing the varaible dependencies, loops, and the structure of the model.</p><p class="p"><strong class="ph b">Values</strong></p><p class="p">The <a class="xref" href="#simulation-result-and-model-structure-analysis">values</a> view (stacked with the trend view) shows the values of the selected value over time. For the values to be shown, a simulation has to be run.</p><p class="p">5 <strong class="ph b">Save and save as...</strong></p><p class="p">Save buttons can be used to export the selected model as .sysdyn file. The buttons save that model which is selected in the model browser or, if the focus is on the diagram, the model that is currently open on the diagram.</p><p class="p">6 <strong class="ph b">Diagram tool mode</strong></p><p class="p">With the diagram tool mode, you can select how the elements on the diagram are edited. The Lock mode prohibits editing diagram elements, the pointer mode allows moving and editing diagram elements, and with the dependency and flow modes arrows can be drawn using only mouse1 and mouse2.</p><p class="p">7 <strong class="ph b">Experiment controls</strong></p><p class="p">Experiment controls are shown when an experiment is active. Experiment is activated by double clicking an experiment in the model browser. With the experiment control, you can start simulation runs and save simulation results.</p><p class="p">8 <strong class="ph b">Perspectives</strong></p><div class="p">Perspectives allow changing between different layouts of the views. On start-up, only the default perspective is open. Try adding the two predefined perspectives by clicking the Open Perspective button: <div class="div image">
+<img class="image" src="Images/OpenPerspective.png"><br><p class="p">9 <strong class="ph b">Chart Panel</strong></p><p class="p"><a class="xref" href="#chart-panel">Chart panel</a> is able to house multiple <a class="xref" href="#custom-charts">charts</a> at the same time. Charts are added to the panel by dragging from model browser.</p><p class="p"><strong class="ph b">TIP!</strong> If you accidentally close a view, you can reopen them from Window->Show View->Other...</p><p class="p"><strong class="ph b">TIP!</strong> Try dragging the views to different positions (e.g. the property view to the right pane).</p></div><article class="topic nested1" aria-labelledby="ariaid-title11" id="global-preferences"><h2 class="title topictitle2" id="ariaid-title11">Global Preferences</h2><div class="body"><p class="p">Global preferences of Simantics System Dynamics are located under Window -> Preferences. Feel free to browse the contents yourself. A few notable items on the list are described below.</p><div class="div image">
+ <img class="image" src="Images/Preferences.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="global-preferences__entry__1"><strong class="ph b">Category</strong></th><th class="entry" id="global-preferences__entry__2"><strong class="ph b">Description</strong></th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="global-preferences__entry__1 "><strong class="ph b">General -> Keys</strong></td><td class="entry" headers="global-preferences__entry__2 ">All <a class="xref" href="#shortcut-and-control-keys">keyboard shortcuts</a> available.</td></tr><tr class="row"><td class="entry" headers="global-preferences__entry__1 "><strong class="ph b">Modelica</strong></td><td class="entry" headers="global-preferences__entry__2 ">The location of OpenModelica solver on file system.</td></tr><tr class="row"><td class="entry" headers="global-preferences__entry__1 "><strong class="ph b">Solver</strong></td><td class="entry" headers="global-preferences__entry__2 "><a class="xref" href="#solvers">Solver</a> to be used for simulation. OpenModelica or internal custom solver (experimental) can be selected.</td></tr><tr class="row"><td class="entry" headers="global-preferences__entry__1 "><strong class="ph b">Sysdyn Diagrams</strong></td><td class="entry" headers="global-preferences__entry__2 ">Sysdyn Diagrams allows customize default colors and fonts of diagram elements.</td></tr></tbody></table></div></article></div><article class="topic nested1" aria-labelledby="ariaid-title12" id="modelling"><h2 class="title topictitle2" id="ariaid-title12">Modelling</h2><div class="body"><div class="div hr">
+</div></div><article class="topic nested2" aria-labelledby="ariaid-title13" id="basic-modelling"><h3 class="title topictitle3" id="ariaid-title13">Basic Modelling</h3><div class="body"><p class="p">Basic modelling functions enable you to create and configure models. System dynamics modeling is basically pretty simple, so with these instructions you can build small and also very large models. The tricky part is writing all the expressions and adjusting the model so that it actually tells you something.</p><div class="div image">
+ <img class="image" src="Images/Basic_1.png"><br>
+</div><p class="p"><strong class="ph b">Creating a new model</strong></p><p class="p">Start a new model by right-clicking the model browser and selecting New -> Model or from the main menu File -> New -> SD Model.</p><div class="div image">
+ <img class="image" src="Images/Basic_2.png"><br>
+</div><p class="p"><strong class="ph b">Creating a new module type</strong></p><p class="p">Create a new module type by right-clicking on the Modules-folder and selecting New -> Module type. This creates a new module type that you can populate to your other modules and the model configuration.</p><p class="p"><strong class="ph b">Configuring a model</strong></p><p class="p">Model configuration can be opened by double clicking Configuration in the model browser.</p><p class="p"><strong class="ph b">Configuring modules</strong></p><p class="p">Configuration of a module type can be opened by double clicking the module type you want to configure. You can also open the configuration of a module from a diagram, when a module has been populated to that diagram, by right-clicking the module and selecting Show Module. When opening modules from diagram, the opened diagram knows to which diagram the module has been populated and can show the connections between the modules. Keep in mind that when making changes to a module, the changes apply to all instances of the respective module type!</p><p class="p"><strong class="ph b">Populate variables</strong></p><p class="p">You can drag variables to a diagram from symbol view. You can also populate variables using <a class="xref" href="#shortcut-and-control-keys">shortcut keys</a>. Variables can be divided into multiple lines by resizing the variable on diagram.</p><p class="p"><strong class="ph b">Populate modules</strong></p><p class="p">Modules are populated from the model browser. Just drag the module you want to populate from the Modules folder to a diagram.</p><p class="p"><strong class="ph b">Create connections</strong></p><p class="p">There are two types of connections: dependencies and flows. Both are created basically the same way. Hold Alt down and click on a variable. Left click starts a dependency, right click starts a flow. Both are ended to another variable with a left click. Dependencies and flows can also be created without Alt key by selecting dependency or flow mode on the toolbar.</p><p class="p">Flows can also be started and ended to an empty spot in the diagram. If there is no start or end variable, a cloud will be created. Also if start or end is not a valve, a new valve is created in the middle of the flow.</p><p class="p">There are some restrictions on what connections can be made, but don't worry, the user interface won't let you do connections that are not allowed.</p><p class="p"><strong class="ph b">Connections between modules</strong></p><p class="p"><strong class="ph b">Outside the module</strong></p><p class="p">You can connect variables to variables in modules like this:</p><pre class="pre">MODULE -----> INPUT
+or
+ANY VARIABLE -----> MODULE
+</pre><p class="p">This is just the visual configuration, but you need those connections to really connect variables in the module's properties.</p><p class="p">In the <em class="ph i">Inputs</em> tab stacked under <em class="ph i">Module Properties</em> you can select which variables you connect to inputs inside the module. In the <em class="ph i">Outputs</em> tab you can select which variables you lift from the module to inputs outside it.</p><p class="p"><strong class="ph b">Inside the module</strong></p><p class="p">Input variables get values from outside the module</p><p class="p">Output variables can send their values outside the module. From the variable properties, select Additional Information and press Is Output</p><p class="p"><strong class="ph b">Configure variables</strong></p><p class="p">Select a single variable from diagram or model browser. The properties of the variables are shown in the equation view and you can modify them.</p><p class="p"><strong class="ph b">Export model</strong></p><p class="p">To export your model to a file, select your model from the model browser, right-click and from the context menu choose Export->Model. Select the folder where to export your model, give the file a name and press Save. You do not need to export a model to Save it, the model is automatically saved in your database. Export can be used, for example, to create different versions of a model, create backups or to transport a model to another database.</p><p class="p"><strong class="ph b">Import model</strong></p><p class="p">Right-click on the model browser and select Import->Model. Browse to your .sysdyn file and select open. The model is added to your model browser.</p><p class="p"><strong class="ph b">Export module</strong></p><p class="p">To export a module to a file, select the module from the model browser, right-click and from the context menu choose Export->Module. Select the folder where to export your model, give the file a name and press Save. Module export can be used, for example, to transport a module to another model or another database.</p><p class="p"><strong class="ph b">Import module</strong></p><p class="p">Right-click the Modules folder of a model and select Import->Module. Browse to your .sysdynModule file and select open. The module is added to your model.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title14" id="model-properties"><h3 class="title topictitle3" id="ariaid-title14">Model Properties</h3><div class="body"><p class="p">Model properties can be viewed by selecting either the model or its configuration on the model browser.</p><div class="div image">
+ <img class="image" src="Images/ModelProperties.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="model-properties__entry__1"><strong class="ph b">Property</strong></th><th class="entry" id="model-properties__entry__2"><strong class="ph b">Description</strong></th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Name</strong></td><td class="entry" headers="model-properties__entry__2 ">The name of the model</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Start time</strong></td><td class="entry" headers="model-properties__entry__2 ">The start time of the simulation.</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Stop time</strong></td><td class="entry" headers="model-properties__entry__2 ">The stop time of the simulation.</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Step length</strong></td><td class="entry" headers="model-properties__entry__2 ">The length of the simulation step.</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Output interval</strong></td><td class="entry" headers="model-properties__entry__2 ">Interval of witch the simulation result is presented. If the field is left empty, all steps of the output are presented.</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Method</strong></td><td class="entry" headers="model-properties__entry__2 ">The simulation solver (only OpenModelica).</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Validate units</strong></td><td class="entry" headers="model-properties__entry__2 "><a class="xref" href="#unit-validation">Unit validation</a> on/off. If unit validation is enabled, the unit of the simulation time is selected from the pull-down menu.</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Unit equivalents</strong></td><td class="entry" headers="model-properties__entry__2 ">Define if different forms of predefined units are considered equal (e.g. dollars = dollar = $) in unit validation.</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Tolerance</strong></td><td class="entry" headers="model-properties__entry__2 ">Integrator error tolerance (only OpenModelica)</td></tr><tr class="row"><td class="entry" headers="model-properties__entry__1 "><strong class="ph b">Variable filter</strong></td><td class="entry" headers="model-properties__entry__2 ">Define which variables are presented (only OpenModelica)</td></tr></tbody></table></div></article><article class="topic nested2" aria-labelledby="ariaid-title15" id="special-variables"><h3 class="title topictitle3" id="ariaid-title15">Special Variables</h3><div class="body"><p class="p">Auxiliary and valve variables have two special types: WithLookup and Delay. These types are selected from Type drop down menu in the variable's properties. The variable types offer more specific functionalities than normal variables, but the same functionality could be achieved using normal variables.</p></div><article class="topic nested3" aria-labelledby="ariaid-title16" id="withlookup"><h4 class="title topictitle4" id="ariaid-title16">WithLookup</h4><div class="body"><p class="p">WithLookup variable has two equation fields, WithLookup and Lookup table. Lookup table has a table from which the value of the variable is interpolated using the value of WithLookup field.</p><div class="div image">
+ <img class="image" src="Images/WithLookup1.png"><br>
+</div><p class="p">You do not need to manually input the Lookup table. WithLookup variable type offers an additional Lookup table tab in the property view. In this view you can add and modify points in the lookup table. Points can be added either by clickin on the chart or by using the input fields and Add button. Points can be modified by dragging them on the chart or modifying values in the table. Points are removed by clicking them with right mouse click.</p><div class="div image">
+ <img class="image" src="Images/WithLookup2.png"><br>
+</div></div></article><article class="topic nested3" aria-labelledby="ariaid-title17" id="delay"><h4 class="title topictitle4" id="ariaid-title17">Delay</h4><div class="body"><p class="p">Delay variables build equations for Nth order delays. Users can set the equation for the value that is to be delayed, the time and order of the delay and a possible start value. If start value is empty, the start value is set automatically.</p><div class="div image">
+ <img class="image" src="Images/Delay1.png"><br>
+</div><p class="p">Different order delays have slightly different curves when a step change is triggered. The example picture below shows a step change from 0 to 1 at time 1 with four different delays: 1st, 2nd, 3rd and 10th order delays.</p><div class="div image">
+ <img class="image" src="Images/Delay2.png"><br>
+</div><p class="p">For further information on how the delays work, you can look at the equations that are created by the delay variable. Below is a third order delay. Delay3 is the actual variable that is seen by users. DelayClass has as many level (LV) variables as the order of the delay is.</p><p class="p">Definitions:</p><pre class="pre">Real Delay3;
+Delay3_delayClass Delay3_delayClass_instance(initialValue = 0, delayTime = 1);
+class Delay3_delayClass
+ parameter Real DL = delayTime/3;
+ parameter Real delayTime;
+ parameter Real initialValue;
+ Real delay0;
+ Real LV1(fixed=true, start=initialValue * DL);
+ Real delay1;
+ Real LV2(fixed=true, start=initialValue * DL);
+ Real delay2;
+ Real LV3(fixed=true, start=initialValue * DL);
+ Real delay3;
+equation
+ der(LV1) = - delay1 + delay0;
+ delay1 = LV1 /DL;
+ der(LV2) = - delay2 + delay1;
+ delay2 = LV2 /DL;
+ der(LV3) = - delay3 + delay2;
+ delay3 = LV3 /DL;
+end Delay3_delayClass;
+</pre><p class="p">The above definitions can be seen as a line of stocks and valves. The first valve, delay0, is given the value of the delayed expression. Delay3 is given the value of the valve that is coming from the last stock.</p><p class="p">Equations:</p><pre class="pre">Delay3_delayClass_instance.delay0 = Step1;
+Delay3 = Delay3_delayClass_instance.delay3;
+</pre></div></article></article><article class="topic nested2" aria-labelledby="ariaid-title18" id="shortcut-and-control-keys"><h3 class="title topictitle3" id="ariaid-title18">Shortcut and Control Keys</h3><div class="body"><p class="p">Shortcut keys for configuring a model on diagram.</p><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="shortcut-and-control-keys__entry__1">Key</th><th class="entry" id="shortcut-and-control-keys__entry__2">Action</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Esc</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Cancel operations (e.g. connection and rename).</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Shift + A</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Hover Auxiliary at the cursor position, populate with left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Shift + S</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Hover Stock at the cursor position, populate with left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Shift + C</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Hover Cloud at the cursor position, populate with left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Shift + V</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Hover Valve at the cursor position, populate with left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Shift + I</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Hover Input at the cursor position, populate with left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Shift + G</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Hover Shadow (Ghost) variable at the cursor position, populate with left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Alt + left mouse button</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Start an arrow from a variable. End to another variable by clicking left mouse button.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Alt + right mouse button</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Start flow from a variable. End by clicking left mouse button. If a flow is not started or ended on to a variable, a cloud will be created to that end. If a new flow does not have a valve at either end, a valve will be created in the middle of the flow.</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Delete</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Remove selected variables</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">F2</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Rename selected variable</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Ctrl + left mouse button</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Select multiple variables</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Mouse wheel or + or -</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Diagram zoom</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">drag(mouse3)</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Diagram pan</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">drag(shift + any mouse button)</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Diagram pan</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">↓, ←, ↑, → (arrow keys)</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Diagram pan</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Ctrl + C</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Copy selected elements</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Ctrl + X</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Cut selected elements</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Ctrl + V</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Paste copied or cut elements</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Ctrl + F</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Find element in current diagram or all models</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">G</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Show / hide grid</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">R</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Show / hide ruler</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">1</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Fit diagram contents to screen</td></tr><tr class="row"><td class="entry" headers="shortcut-and-control-keys__entry__1 ">Ctrl + Space</td><td class="entry" headers="shortcut-and-control-keys__entry__2 ">Content assist in equation editor</td></tr></tbody></table><p class="p">Other shortcut keys can be found selecting Window -> Preferences from the main menu. Keys are located in General -> Keys.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title19" id="unit-validation"><h3 class="title topictitle3" id="ariaid-title19">Unit Validation</h3><div class="body"><p class="p">Unit validation is useful for finding errors in the model. With unit validation, the consistency of the measurement units of variables is checked. For unit validation, the units of all variables in the model must be defined. If a variable is dimensionless, use 1 as the unit. In certain constructs, a dimensionless variable can be used as "a wild card", e.g., adding a dimensionless variable with a dimensioned one is OK.</p><p class="p">Common error sources of unit validation include the following. The respective issues are shown in the picture below.</p><div class="div image">
+ <img class="image" src="Images/UnitValidation.png"><br>
+</div><ul class="ul"><li class="li"><p class="p">The equation of a variable yields a different unit than that defined for the variable.</p></li><li class="li"><p class="p">Two variables which have different units are added (+), subtracted (-), or compared (>, <, =, ...).</p></li><li class="li"><p class="p">The output unit of a function is used in an inconsistent manner. (The unit validation for the output unit of a function behaves equivalently to the unit of a variable.)</p></li><li class="li"><p class="p">A function is called with an argument of a prohibited unit.</p></li><li class="li"><p class="p">A variable has an empty unit.</p></li><li class="li"><p class="p">A variable has a misspelled unit.</p></li></ul><p class="p">Unit validation is enabled for a model by selecting the model or its configuration on the model browser and enabling "Validate units" on the properties tab. The unit warnings are shown on Issues view and, supposing the respective profile has been enabled, on the diagram as well. Warnings from unit validation do not prevent simulation.</p><p class="p">For models that have stocks (i.e., integration), the simulation time unit must be selected from the pull-down menu next to the "Validate units" checkbox in Model Properties tab.</p><p class="p">Unit validation can also cope with certain different forms of units, e.g., you can write dollars, dollar, or $ and the validator considers these equal. This functionality can be disabled from Model Properties tab checkbox "Unit equivalents".</p><p class="p">As there may be cases for which the unit validation is for some reason not working as desired, the unitCast() function can be used in the equation of a variable to cast the unit of any expression within the equation to a wildcard. E.g., if expression</p><pre class="pre"> Aux1 + time
+</pre><p class="p">yields a warning, it can be fixed be changing the expression to</p><pre class="pre"> unitCast(Aux1) + time
+</pre><p class="p">, in which case the unit of the expression is that of time, or to</p><pre class="pre"> Aux1 + unitCast(time)
+</pre><p class="p">, in which case the unit of the expression is that of Aux1.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title20" id="diagram-profiles"><h3 class="title topictitle3" id="ariaid-title20">Diagram Profiles</h3><div class="body"><p class="p">Diagram profiles allow selecting which visual effects are enabled. Currently the following profiles can be used:</p><p class="p"><strong class="ph b">Default</strong></p><p class="p"><strong class="ph b">Issue warnings</strong></p><p class="p">When enabled, an error or a warning symbol is attached to diagram elements in which there are errors or warnings (usually in the equations).</p><p class="p"><strong class="ph b">Shadow variable visualizations</strong></p><p class="p">When enabled, the original and all the shadow variables are highlighted when one is selected.</p><p class="p"><strong class="ph b">Simulation Playback</strong></p><p class="p"><strong class="ph b">Playback Colors</strong></p><p class="p">When enabled, colors of the elements on diagram change during a playback experiment.</p></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title21" id="visual-model-elements"><h2 class="title topictitle2" id="ariaid-title21">Visual model elements</h2><div class="body"><div class="div hr">
+</div><p class="p">The visual appearance of the elements on diagram can be modified in various ways. In addition, the tool offers are comment symbols which do not affect simulation but help the understandability of models.</p></div><article class="topic nested2" aria-labelledby="ariaid-title22" id="fonts-and-colors"><h3 class="title topictitle3" id="ariaid-title22">Fonts and colors</h3><div class="body"><p class="p">Fonts and colors of diagram elements can be changed by right-clicking the element and selecting Font... The default fonts and colors for each diagram element type can be changed in Window -> Preferences -> Sysdyn Diagrams.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title23" id="dependency-properties"><h3 class="title topictitle3" id="ariaid-title23">Dependency properties</h3><div class="body"><p class="p">Dependency arrow properties can be changed on the property view:</p><p class="p"><strong class="ph b">Polarity</strong></p><p class="p">Polarity sign can be used to indicate whether the dependency increases or decreases the variable it is pointing to. The polarities serve no function for simulation, however, they are used in loop type automatic determination.</p><p class="p"><strong class="ph b">Location</strong></p><p class="p">Location of the polarity mark</p><p class="p"><strong class="ph b">Arrowhead</strong></p><p class="p">Toggle for showing arrowhead</p><p class="p"><strong class="ph b">Delay mark</strong></p><p class="p">Delay mark is a visual cue for helping understandability of the dynamics of the model when there are (information) delays. A delay mark is usually added to the dependency arrow when the effect the tail of the dependency has on the head of the dependency is delayed.</p><p class="p"><strong class="ph b">Line thickness</strong></p><p class="p">Thickness of the arrow</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title24" id="loops"><h3 class="title topictitle3" id="ariaid-title24">Loops</h3><div class="body"><p class="p">A loop element is a graphical component for highlighting feedback loops in a model. Usually the most interesting feedback loops that affect the behaviour of the model most are marked with a loop symbol.</p><p class="p"><strong class="ph b">Loop Items</strong></p><p class="p">The loop of variables which the loop symbol refers can be selected for visualization purposes.</p><p class="p"><strong class="ph b">Comment</strong></p><p class="p">Comment inside the loop. Usually characters 'B' and 'R' are used to denote balancing and reinforcing loops, respectfully. A feedback loop is reinforcing if and only if it has an even number of negative dependencies. Selecting 'Auto' determines automatically the type of the loop.</p><p class="p"><strong class="ph b">Direction of Rotation</strong></p><p class="p">Direction to which the loop rotates on diagram.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title25" id="comments"><h3 class="title topictitle3" id="ariaid-title25">Comments</h3><div class="body"><p class="p">Comments are just strings of text.</p></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title26" id="simulation"><h2 class="title topictitle2" id="ariaid-title26">Simulation</h2><div class="body"><div class="div hr">
+</div></div><article class="topic nested2" aria-labelledby="ariaid-title27" id="experiments"><h3 class="title topictitle3" id="ariaid-title27">Experiments</h3><div class="body"><p class="p">There are three different ways for simulating a model. Different simulations are represented as different types of experiments in Simantics System Dynamics.</p><p class="p">Experiments are created from the context menu of experiments folder in a model.</p><div class="div image">
+ <img class="image" src="Images/NewExperiment.png"><br>
+</div><p class="p">Double-click on an experiment activates it and displays experiment type specific controls in the main tool bar.</p><p class="p"><strong class="ph b">Normal simulation</strong></p><p class="p">Experiment is the basic simulation type. It simulates a model from start time to end time and results can be viewed after the simulation has been run.</p><p class="p"><strong class="ph b">Game simulation</strong></p><p class="p">Game simulations allow simulating an arbitrary number of steps, changing parameter values and continuing simulation with the new values from where it previously ended.</p><p class="p"><strong class="ph b">Simulation playback</strong></p><p class="p">Simulation playback works essentially as the basic experiment, but it offers some additional visualization options.</p><p class="p"><strong class="ph b">Sensitivity analysis simulation</strong></p><p class="p">Sensitivity analysis allows running <a class="xref" href="http://en.wikipedia.org/wiki/Multivariate_analysis" target="_blank">multivariate</a> <a class="xref" href="http://en.wikipedia.org/wiki/Monte_Carlo_method" target="_blank">Monte Carlo simulations</a> with different parameter value sets and to visualize how much the simulation result depends on changes in the selected parameters.</p><div class="div image">
+ <img class="image" src="Images/SensitivityExperiment.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="experiments__entry__1"><strong class="ph b">General</strong></th><th class="entry" id="experiments__entry__2">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="experiments__entry__1 ">Name</td><td class="entry" headers="experiments__entry__2 ">The name of the sensitivity analysis experiment. Displayed in e.g. model browser.</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Number of runs</td><td class="entry" headers="experiments__entry__2 ">The total amount of individual simulation runs</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Method</td><td class="entry" headers="experiments__entry__2 ">The method of how the parameter values are selected from the distribution(s). Selecting "Random" yields <a class="xref" href="http://en.wikipedia.org/wiki/Random_number_generation#.22True.22_random_numbers_vs._pseudo-random_numbers" target="_blank">pseudo-random</a> values, i.e., randomly selected from the distribution(s). Selecting "Halton" yields a <a class="xref" href="http://en.wikipedia.org/wiki/Quasi-random" target="_blank">quasi-random</a> <a class="xref" href="http://en.wikipedia.org/wiki/Halton_sequence" target="_blank">Halton sequence</a> of values selected deterministically to represent the distribution(s) better than a pseudo-random series.</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Seed</td><td class="entry" headers="experiments__entry__2 ">The seed number for pseudo-random generator</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Add parameter</td><td class="entry" headers="experiments__entry__2 ">Adds a new parameter to be varied</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Remove</td><td class="entry" headers="experiments__entry__2 ">Removes a parameter</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 "><strong class="ph b">Parameter properties</strong></td><td class="entry" headers="experiments__entry__2 ">-</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Variable</td><td class="entry" headers="experiments__entry__2 ">The full path of the variable of which value is varied. This field has content assistant, which shows the possible variables as you type.</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Range</td><td class="entry" headers="experiments__entry__2 ">Used with multidimensional values to select which dimensions are varied.</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Distribution</td><td class="entry" headers="experiments__entry__2 ">Probability distribution for the varied parameter. "Normal" is for <a class="xref" href="http://en.wikipedia.org/wiki/Truncated_normal_distribution" target="_blank">truncated normal distribution</a> and "Uniform" for <a class="xref" href="http://en.wikipedia.org/wiki/Uniform_distribution_(continuous)" target="_blank">uniform distribution</a>. With "Interval" the values have equal intervals between each other and are selected in increasing order. In multivariate sensitivity analyses, it is recommended to select either "Normal" or "Uniform".</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 "><strong class="ph b">Distribution properties</strong></td><td class="entry" headers="experiments__entry__2 ">-</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Min value</td><td class="entry" headers="experiments__entry__2 ">Minimum value of the distribution</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Max value</td><td class="entry" headers="experiments__entry__2 ">Maximum value of the distribution</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Mean</td><td class="entry" headers="experiments__entry__2 ">Mean of the normal distribution</td></tr><tr class="row"><td class="entry" headers="experiments__entry__1 ">Standard deviation</td><td class="entry" headers="experiments__entry__2 ">Standard deviation of the normal distribution</td></tr></tbody></table></div></article><article class="topic nested2" aria-labelledby="ariaid-title28" id="solvers"><h3 class="title topictitle3" id="ariaid-title28">Solvers</h3><div class="body"><p class="p">Simantics System Dynamics allows using the multiple solvers provided by OpenModelica, like Euler, Runge-Kutta, DASSL, etc. OpenModelica is currently the main simulation environment behind the tool and all functionalities are supported with OpenModelica.</p><p class="p">Alternatively to OpenModelica, an internal custom Modelica solver is included in Simantics System Dynamics. The custom solver is currently at an experimental state, and thus all functionalities of the tool are not yet supported, e.g., only the basic experiment can be run with it. The advantage of the custom solver is, however, that simulation is usually a lot faster than with OpenModelica. Try out yourself which solver suits best for your needs.</p><p class="p">The solver can be changed in Windows -> Preferences -> Solver.</p></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title29" id="simulation-result-and-model-structure-analysis"><h2 class="title topictitle2" id="ariaid-title29">Simulation Result and Model Structure Analysis</h2><div class="body"><div class="div hr">
+</div><p class="p">Simulation results can be viewed as trends in the trend view or as plain numbers in the values view. The views display results of variables that are selected in the workbench. Users can also create <a class="xref" href="#custom-charts">custom charts</a>.</p><p class="p">Model structure can be examined in the Structure view. There are three options: dependency structures of individual variables, the complete hierarchy structure of the model, or the feedback loops which individual variables belong to.</p><p class="p"><strong class="ph b">Trend</strong></p><p class="p">Shows you the values of the selected variable(s) graphically over the simulation time. You can modify the trend and zoom it using the context menu (right-click) of the trend.</p><div class="div image">
+ <img class="image" src="Images/Trend.png"><br>
+</div><p class="p"><strong class="ph b">Values</strong></p><p class="p">Shows you the values of the selected variable(s) in a table form. If the value has a star (*) at the end, it means that the value is an approximate. There is no value for that variable for the given time step. Selected values can be copied to other software in csv format.</p><div class="div image">
+ <img class="image" src="Images/Values.png"><br>
+</div><p class="p"><strong class="ph b">Compare results</strong></p><p class="p">You can compare different results of the same model by saving simulation results and displaying the saved results side by side with other results. You can save your results after simulating by clicking the Save Results button:</p><div class="div image">
+ <img class="image" src="Images/Saveresults.png"><br>
+</div><p class="p">on your experiment controls. The saved results appear to model browser under the active experiment. To show the results on trends and tables, right-click on the result and select Show on charts.</p><div class="div image">
+ <img class="image" src="Images/CompareTrend.png"><br>
+</div><p class="p"><strong class="ph b">Dependencies</strong></p><p class="p">Dependencies display which variables affect and which are affected by the selected variable. The direction and number of steps that are traveled from the selected variable can be configured at the bottom of the view.</p><div class="div image">
+ <img class="image" src="Images/Dependencies.png"><br>
+</div><p class="p"><strong class="ph b">Model Hierarchy</strong></p><p class="p">Model Hierarchy displays the hierarchical structure of the model. The module type where a selected variable is located is highlighted.</p><div class="div image">
+ <img class="image" src="Images/ModelHierarchy.png"><br>
+</div><p class="p"><strong class="ph b">Loops</strong></p><p class="p">Loops display all feedback loops which the selected variable belongs to.</p><div class="div image">
+ <img class="image" src="Images/Loops.png"><br>
+</div></div></article><article class="topic nested1" aria-labelledby="ariaid-title30" id="custom-charts"><h2 class="title topictitle2" id="ariaid-title30">Custom Charts</h2><div class="body"><div class="div hr">
+</div><p class="p">Custom charts are user-defined displays of simulation result data. They can be used and re-used in various places. The four types of custom charts (line, sensitivity, bar, and pie charts) provide model developers means for examining and developing their models and communicating the simulation results to others.</p><p class="p">Custom charts are created to the Charts folder in model browser.</p><div class="div image">
+ <img class="image" src="Images/NewChart.png"><br>
+</div><p class="p">Charts are configured the same way as variables: first select the chart from model browser and then configure it in the property view. Charts can be viewed in the same active trend view as any variable by selecting the chart from model browser. In addition to trend view, charts can be populated directly to the model diagram by dragging them from the model browser. Charts can also be added to a separate chart panel which can contain multiple charts.</p></div><article class="topic nested2" aria-labelledby="ariaid-title31" id="line-chart"><h3 class="title topictitle3" id="ariaid-title31">Line Chart</h3><div class="body"><p class="p">Line chart shows the time series of a variable. It is capable of displaying multiple multi-dimensional variables at the same time. Simulation playback mode adds a marker to the chart to display the current time in playback simulation. Below is an example chart and its settings.</p><div class="div image">
+ <img class="image" src="Images/LineChart.png"><br>
+</div><div class="div image">
+ <img class="image" src="Images/LineChartGeneral.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="line-chart__entry__1"><strong class="ph b">General</strong></th><th class="entry" id="line-chart__entry__2">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Name</td><td class="entry" headers="line-chart__entry__2 ">The name of the chart. Displayed in e.g. model browser</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Title</td><td class="entry" headers="line-chart__entry__2 ">The title of the chart. Displayed in the chart</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Type</td><td class="entry" headers="line-chart__entry__2 ">Line chart (default) or area chart</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Hide</td><td class="entry" headers="line-chart__entry__2 ">Options to hide chart grid, title or legend</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 "><strong class="ph b">X-axis</strong></td><td class="entry" headers="line-chart__entry__2 ">-</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Variable</td><td class="entry" headers="line-chart__entry__2 ">A variable that is used as the x-axis variable. The default variable is time and it needs not to be typed in the field.</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Label</td><td class="entry" headers="line-chart__entry__2 ">Optional other label for the variable than its name</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Min</td><td class="entry" headers="line-chart__entry__2 ">Minimum value of the x-axis</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Max</td><td class="entry" headers="line-chart__entry__2 ">Maximum value of the x-axis</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__1 ">Hide</td><td class="entry" headers="line-chart__entry__2 ">Options to hide x-axis label, line, tick marks and tick labels</td></tr></tbody></table><div class="div image">
+ <img class="image" src="Images/LineChartAxisAndVariables.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="line-chart__entry__23"><strong class="ph b">Variable</strong></th><th class="entry" id="line-chart__entry__24">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="line-chart__entry__23 ">Variable</td><td class="entry" headers="line-chart__entry__24 ">The full path of the variable. This field has content assistant, which shows the possible variables as you type.</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__23 ">Range</td><td class="entry" headers="line-chart__entry__24 ">If the variable has multiple dimensions, this field allows to select, which dimensions are displayed. It is also possible to sum the variables in the dimensions.</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__23 ">Label</td><td class="entry" headers="line-chart__entry__24 ">Optional label for the variable. If label is empty, the variable name is displayed.</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__23 ">Color</td><td class="entry" headers="line-chart__entry__24 ">Color for the lines of this variable</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__23 ">Line width</td><td class="entry" headers="line-chart__entry__24 ">The width of the lines drawn for this variable</td></tr></tbody></table><p class="p">There are also configuration options for y-axis. They are displayed when an axis is selected in the Axis and variables tab.</p><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="line-chart__entry__35"><strong class="ph b">Y-axis</strong></th><th class="entry" id="line-chart__entry__36">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="line-chart__entry__35 ">Label</td><td class="entry" headers="line-chart__entry__36 ">Label of the axis</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__35 ">Min</td><td class="entry" headers="line-chart__entry__36 ">Minimum value in the axis</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__35 ">Max</td><td class="entry" headers="line-chart__entry__36 ">Maximum value in the axis</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__35 ">Color</td><td class="entry" headers="line-chart__entry__36 ">The color of the axis lines, ticks and labels</td></tr><tr class="row"><td class="entry" headers="line-chart__entry__35 ">Hide</td><td class="entry" headers="line-chart__entry__36 ">Options to hide parts of the axis: label, axis line, tick marks, tick labels</td></tr></tbody></table></div></article><article class="topic nested2" aria-labelledby="ariaid-title32" id="sensitivity-chart"><h3 class="title topictitle3" id="ariaid-title32">Sensitivity Chart</h3><div class="body"><p class="p">Sensitivity chart shows the time series of a variable with confidence bounds. Below is an example chart and its settings. The general settings are defined similarly to those of a line chart explained above.</p><div class="div image">
+ <img class="image" src="Images/SensitivityChart.png"><br>
+</div><div class="div image">
+ <img class="image" src="Images/SensitivityChartAxisAndVariables.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="sensitivity-chart__entry__1"><strong class="ph b">Axis and Variables</strong></th><th class="entry" id="sensitivity-chart__entry__2">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="sensitivity-chart__entry__1 ">Variable</td><td class="entry" headers="sensitivity-chart__entry__2 ">The full path of the variable. This field has content assistant, which shows the possible variables as you type.</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__1 ">Range</td><td class="entry" headers="sensitivity-chart__entry__2 ">If the variable has multiple dimensions, this field allows to select, which dimensions are displayed. It is also possible to sum the variables in the dimensions.</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__1 ">Display median</td><td class="entry" headers="sensitivity-chart__entry__2 ">Display the median value of the variable at each time step.</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__1 ">Confidence bounds and colors</td><td class="entry" headers="sensitivity-chart__entry__2 ">The confidence bounds in percents and colors for them.</td></tr></tbody></table><p class="p">There are also configuration options for y-axis. They are displayed when an axis is selected in the Axis and variables tab.</p><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="sensitivity-chart__entry__11"><strong class="ph b">Y-axis</strong></th><th class="entry" id="sensitivity-chart__entry__12">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="sensitivity-chart__entry__11 ">Label</td><td class="entry" headers="sensitivity-chart__entry__12 ">Label of the axis</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__11 ">Min</td><td class="entry" headers="sensitivity-chart__entry__12 ">Minimum value in the axis</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__11 ">Max</td><td class="entry" headers="sensitivity-chart__entry__12 ">Maximum value in the axis</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__11 ">Color</td><td class="entry" headers="sensitivity-chart__entry__12 ">The color of the axis lines, ticks and labels</td></tr><tr class="row"><td class="entry" headers="sensitivity-chart__entry__11 ">Hide</td><td class="entry" headers="sensitivity-chart__entry__12 ">Options to hide parts of the axis: label, axis line, tick marks, tick labels</td></tr></tbody></table></div></article><article class="topic nested2" aria-labelledby="ariaid-title33" id="bar-chart"><h3 class="title topictitle3" id="ariaid-title33">Bar Chart</h3><div class="body"><p class="p">Bar charts display variables in a certain point in time. The point can be defined for the complete chart in chart's general settings and individually for each variable in variable's settings. If no time is defined, the last simulation step is shown in game or normal simulation mode. Playback mode displays the current playback time.</p><div class="div image">
+ <img class="image" src="Images/BarChartGeneral.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="bar-chart__entry__1"><strong class="ph b">General</strong></th><th class="entry" id="bar-chart__entry__2">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="bar-chart__entry__1 ">Name</td><td class="entry" headers="bar-chart__entry__2 ">The name of the chart. Name is displayed in model browser.</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__1 ">Title</td><td class="entry" headers="bar-chart__entry__2 ">The title of the chart. Title is displayed in the chart, if not hidden</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__1 ">Type</td><td class="entry" headers="bar-chart__entry__2 ">Normal or stacked. Normal type displays all variables in separate bars. Stacked mode is able to display one-dimensional array variables in stacks.</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__1 ">Time</td><td class="entry" headers="bar-chart__entry__2 ">A general time setting for the entire chart. The values at this time are displayed in the chart</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__1 ">Hide</td><td class="entry" headers="bar-chart__entry__2 ">Option for hiding grid, title and Legend. Legend is hidden by default since it only contains the information that the current simulation is displayed.</td></tr></tbody></table><div class="div image">
+ <img class="image" src="Images/BarChartInDiagram.png"><br>
+</div><p class="p">Charts can be added to model diagrams simply by dragging the chart from model browser to diagram.</p><div class="div image">
+ <img class="image" src="Images/BarChartVariable.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="bar-chart__entry__13"><strong class="ph b">Variable</strong></th><th class="entry" id="bar-chart__entry__14">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="bar-chart__entry__13 ">Add / Remove</td><td class="entry" headers="bar-chart__entry__14 ">Add or remove variables</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__13 ">Variable</td><td class="entry" headers="bar-chart__entry__14 ">The full path of the variable. This field has content assistant, which shows the possible variables as you type.</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__13 ">Range</td><td class="entry" headers="bar-chart__entry__14 ">If the variable has multiple dimensions, this field allows to select, which dimensions are displayed. It is also possible to sum the variables in the dimensions.</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__13 ">Label</td><td class="entry" headers="bar-chart__entry__14 ">Optional label for the variable. If label is empty, the variable name is displayed</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__13 ">Time</td><td class="entry" headers="bar-chart__entry__14 ">The time for which the value of this variable is displayed. If this is empty, a general (or default) value of the time is used.</td></tr></tbody></table><div class="div image">
+ <img class="image" src="Images/BarChartAxis.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="bar-chart__entry__25"><strong class="ph b">Domain axis</strong></th><th class="entry" id="bar-chart__entry__26">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Label</td><td class="entry" headers="bar-chart__entry__26 ">An optional label for x axis</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Label angle</td><td class="entry" headers="bar-chart__entry__26 ">Axis labels can be displayed in an angle. This value determines the angle in degrees.</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Color</td><td class="entry" headers="bar-chart__entry__26 ">The color of the axis line, tick lines and labels</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Hide</td><td class="entry" headers="bar-chart__entry__26 ">Options for hiding axis label, line, tick marks and tick labels</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 "><strong class="ph b">Range axis</strong></td><td class="entry" headers="bar-chart__entry__26 ">-</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Label</td><td class="entry" headers="bar-chart__entry__26 ">An optional label for y axis</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Min</td><td class="entry" headers="bar-chart__entry__26 ">Minimum value of y axis</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Max</td><td class="entry" headers="bar-chart__entry__26 ">Maximum value of y axis</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Color</td><td class="entry" headers="bar-chart__entry__26 ">The color of the axis line, tick lines and labels</td></tr><tr class="row"><td class="entry" headers="bar-chart__entry__25 ">Hide</td><td class="entry" headers="bar-chart__entry__26 ">Options for hiding axis label, line, tick marks and tick labels</td></tr></tbody></table></div></article><article class="topic nested2" aria-labelledby="ariaid-title34" id="pie-chart"><h3 class="title topictitle3" id="ariaid-title34">Pie Chart</h3><div class="body"><p class="p">Pie charts display proportions of variables at a certain time. The time, similar to bar charts, can be configured for the whole chart and individually for each variable. If no time is configured, the value at the latest time step (or the time of simulation playback) is displayed.</p><div class="div image">
+ <img class="image" src="Images/PieChartGeneral.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="pie-chart__entry__1"><strong class="ph b">General</strong></th><th class="entry" id="pie-chart__entry__2">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="pie-chart__entry__1 ">Name</td><td class="entry" headers="pie-chart__entry__2 ">The name of the chart. Displayed in e.g. model browser</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__1 ">Title</td><td class="entry" headers="pie-chart__entry__2 ">Title The title of the chart. Displayed in the chart</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__1 ">Time</td><td class="entry" headers="pie-chart__entry__2 ">A general time setting for the entire chart. The values at this time are displayed in the chart</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__1 ">Hide</td><td class="entry" headers="pie-chart__entry__2 ">Options for hiding title, section labels and legend</td></tr></tbody></table><div class="div image">
+ <img class="image" src="Images/PieChartVariable.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="pie-chart__entry__11"><strong class="ph b">Variables</strong></th><th class="entry" id="pie-chart__entry__12">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Add / Remove</td><td class="entry" headers="pie-chart__entry__12 ">Add or remove variables</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Variable</td><td class="entry" headers="pie-chart__entry__12 ">The full path of the variable. This field has content assistant, which shows the possible variables as you type.</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Range</td><td class="entry" headers="pie-chart__entry__12 ">If the variable has multiple dimensions, this field allows to select, which dimensions are displayed. It is also possible to sum the variables in the dimensions.</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Label</td><td class="entry" headers="pie-chart__entry__12 ">Optional label for the variable. If label is empty, the variable name is displayed</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Color</td><td class="entry" headers="pie-chart__entry__12 ">Color for the sector of this variable</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Time</td><td class="entry" headers="pie-chart__entry__12 ">The time for which the value of this variable is displayed. If this is empty, a general (or default) value of the time is used.</td></tr><tr class="row"><td class="entry" headers="pie-chart__entry__11 ">Exploded</td><td class="entry" headers="pie-chart__entry__12 ">If set, the sector(s) of the variable(s) are "exploded" away from the center of the pie chart</td></tr></tbody></table><div class="div image">
+ <img class="image" src="Images/PieChartChartPanel.png"><br>
+</div></div></article><article class="topic nested2" aria-labelledby="ariaid-title35" id="chart-panel"><h3 class="title topictitle3" id="ariaid-title35">Chart Panel</h3><div class="body"><p class="p">Chart panel is able to house multiple charts at the same time. Chart panel is a normal view in the workbench, which means it can be resized and located anywhere in the workbench. Eclipse also allows detaching the tab completely from the workbench, which means that the chart panel can be dragged to another screen.</p><div class="div image">
+ <img class="image" src="Images/ChartPanel.png"><br>
+</div><p class="p">Chart panel can be either horizontally or vertically oriented. Different orientations help in configuring the workbench perspective.</p><div class="div image">
+ <img class="image" src="Images/ChartPanelOrientation.png"><br>
+</div><p class="p">Charts are added to the panel by dragging from model browser. The order of the charts is easily changed by dragging charts from their header. Charts can be minimized or completely removed from the buttons in their headers.</p><p class="p">By default, chart panel is hidden in the upper-right corner of the system dynamics perspective.</p></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title36" id="multidimensional-variables"><h2 class="title topictitle2" id="ariaid-title36">Multidimensional Variables</h2><div class="body"><div class="div hr">
+</div></div><article class="topic nested2" aria-labelledby="ariaid-title37" id="modeling"><h3 class="title topictitle3" id="ariaid-title37">Modeling</h3><div class="body"><p class="p">Models with multidimensional variables look just like any other models. The structure of the models is replicated givin multiple indexes to variables. For users with programming background, notation Variable<span class="xref"></span> may be familiar. In system dynamic modeling we need to give names to the indexes. Instead of using numbers to define the indexes, like in normal programming, we use enumerations. The steps to create a model with multidimensional variables are as follows (with examples):</p><p class="p">1 <strong class="ph b">Create the model structure</strong></p><p class="p">Model with multidimensional variables looks just like any other model.</p><div class="div image">
+ <img class="image" src="Images/ModelWithMultidimensionalVariables.png"><br>
+</div><p class="p">2 <strong class="ph b">Create Enumerations and define the indexes</strong></p><p class="p">Enumerations are created by right-clicking configuration and selecting New->Enumeration.</p><div class="div image">
+ <img class="image" src="Images/NewEnumeration.png"><br>
+</div><p class="p">Define enumeration indexes by adding as many indexes as you want. Rename the indexes by selecting them and then clicking on them again.</p><div class="div image">
+ <img class="image" src="Images/DefineIndexes.png"><br>
+</div><p class="p">3 <strong class="ph b">Add Enumerations for variables</strong></p><p class="p">Select the variable that you want to be multidimensional. From the Indexes -tab in the property view, move the wanted enumerations to the right. The order of the enumerations does matter.</p><div class="div image">
+ <img class="image" src="Images/SelectEnumerations.png"><br>
+</div><p class="p">4 <strong class="ph b">Define equations for all possible indexes</strong></p><p class="p">Multidimensional variable can be thought as a multidimensional table. Each cell of the table needs to have an expression or a value. A cell cannot have multiple definitions. All cells can be defined in one expression like in the following example. E1 and E2 have both three indexes, so the resulting definition can be {{1,2,3},{4,5,6},{7,8,9}}.</p><div class="div image">
+ <img class="image" src="Images/DefineEquations.png"><br>
+</div></div></article><article class="topic nested2" aria-labelledby="ariaid-title38" id="expressions"><h3 class="title topictitle3" id="ariaid-title38">Expressions</h3><div class="body"><p class="p">Values for all cells in the variable matrix can be defined in a single expression.</p><div class="div image">
+ <img class="image" src="Images/DefineEquations.png"><br>
+</div><div class="div image">
+ <img class="image" src="Images/DefineEquations2.png"><br>
+</div><p class="p">In many situations, it is however more clear to define separate expressions for each cell or blocks.</p><p class="p">1 <strong class="ph b">Define range for the expression</strong></p><div class="div image">
+ <img class="image" src="Images/DefineRange.png"><br>
+</div><p class="p">2 <strong class="ph b">Define the expression</strong> (dimensions of the defined range and the result of the expression must match!)</p><div class="div image">
+ <img class="image" src="Images/DefineEquations3.png"><br>
+</div><p class="p">3 <strong class="ph b">Create a new expression</strong></p><div class="div image">
+ <img class="image" src="Images/CreateNewExpression.png"><br>
+</div><p class="p">4 <strong class="ph b">Select the new expression</strong></p><div class="div image">
+ <img class="image" src="Images/SelectNewExpression.png"><br>
+</div><p class="p">Repeat until there is value for each cell. There must be exactly one value for each cell.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title39" id="array-slices"><h3 class="title topictitle3" id="ariaid-title39">Array Slices</h3><div class="body"><p class="p">Many times it is useful to access a slice of a multidimensional variable. In this chapter, we will use the following example variable:</p><pre class="pre"> enumeration E1 = one, two, three
+ enumeration E2 = eins, zwei, drei
+ Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}
+</pre><p class="p">The whole variable can be accessed in three different ways:</p><ol class="ol"><li class="li"><p class="p"><code class="ph codeph">Auxiliary</code></p></li><li class="li"><p class="p"><code class="ph codeph">Auxiliary[E1, E2]</code></p></li><li class="li"><p class="p"><code class="ph codeph">Auxiliary[:, :]</code></p></li></ol><p class="p">The following explains different methods for accessing parts of the variable</p><pre class="pre"> // Single cell
+ Auxiliary[one, eins] = 1
+</pre><pre class="pre"> // Slices
+ Auxiliary[one, E2] = {1,2,3}
+ Auxiliary[E1, zwei] = {{2},{5},{8}}
+
+ // In addition to single cells and the whole enumeration range, a subrange of the enumeration can be used
+ Auxiliary[two : three, E2] = {{4,5,6},{7,8,9}}
+ Auxiliary[one : two, zwei : drei] = {{2,3},{5,6}}
+</pre><p class="p">The syntax for accessing parts of variables can be used in both expression range definitions and in expressions.</p></div></article><article class="topic nested2" aria-labelledby="ariaid-title40" id="arithmetic-operators"><h3 class="title topictitle3" id="ariaid-title40">Arithmetic Operators</h3><div class="body"><p class="p">Arithmetic operations are defined in Modelica. Below are examples of different operations.</p><p class="p"><strong class="ph b">Addition and substraction</strong></p><p class="p">Addition and substraction are calculated elementwise</p><pre class="pre"> {1,2,3} - {0,2,3} = {1,0,0}
+ {{2,2},{4,4}} + {{8,8},{1,1}} = {{10,10},{5,5}}
+ {1,2,3} - {1,2} = ERROR! Different array sizes
+</pre><p class="p"><strong class="ph b">Division</strong></p><p class="p">Division with a scalar</p><pre class="pre"> {5,10,15} / 5 = {1,2,3}
+ 5 / {5,10,15} = ERROR! not allowed
+</pre><p class="p">Division with an array</p><pre class="pre"> {1,2,3} / {1,2,3} = ERROR! not allowed
+
+ // Elementwise
+ {1,2,3} ./ {1,2,3} = {1,1,1}
+</pre><p class="p"><strong class="ph b">Multiplication</strong></p><p class="p">Multiplication with a scalar</p><pre class="pre"> {1,2,3} * 2 = {2,4,6}
+ 5 * {1,2,3} = {5,10,15}
+</pre><p class="p">Matrix multiplication with an array</p><pre class="pre"> {{3,4},{5,6}} * {1,2} = {11,17}
+ {{3,4},{5,6}} * {1,2,3} = ERROR! incompatible array sizes
+
+ //Elementwise
+ {1,2} .* {1,2} = {1,4}
+
+ Real[3,2] c = {{1,2},{3,4},{5,6}};
+ Real[2,2] d = {{3,4},{5,6}};
+ Real[2,2] cd;
+ cd = c[2:3, :] .* d; // Result: {{9,16},{25,36}}
+</pre><p class="p"><strong class="ph b">Power</strong></p><p class="p">Elementwise power of array variable</p><pre class="pre"> {1,2} .^ 2 = {1,4}
+</pre></div></article><article class="topic nested2" aria-labelledby="ariaid-title41" id="builtin-modelica-functions"><h3 class="title topictitle3" id="ariaid-title41">Builtin Modelica Functions</h3><div class="body"><p class="p">Modelica has some builtin functions that help using multidimensional variables. This chapter introduces some of the builtin functions.</p><p class="p"><strong class="ph b">Dimension and size functions</strong></p><p class="p">We will use the same example variable as previously.</p><pre class="pre"> enumeration E1 = one, two, three
+ enumeration E2 = eins, zwei, drei
+
+ Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}
+</pre><p class="p"><strong class="ph b">ndims(A)</strong></p><p class="p">The number of dimensions in array A</p><pre class="pre"> ndims(Auxiliary) = 2
+</pre><p class="p"><strong class="ph b">size(A, i)</strong></p><p class="p">The size of dimension i in array A</p><pre class="pre"> size(Auxiliary, 2) = 3
+</pre><p class="p"><strong class="ph b">size(A)</strong></p><p class="p">A vector of length ndims(A) containing the dimension sizes of A</p><pre class="pre"> size(Auxiliary) = {3,3}
+</pre><p class="p"><strong class="ph b">Construction functions</strong></p><p class="p">In addition to normal array constructing, a special construction functions can be used.</p><p class="p"><strong class="ph b">zeros(n1,n2,n3,...)</strong></p><p class="p">An array full of zeros with dimensions n1 x n2 x n2 x ...</p><pre class="pre"> zeros(2, 2) = {{0,0}, {0,0}}
+</pre><p class="p"><strong class="ph b">ones(n1,n2,n3,...)</strong></p><p class="p">An array full of ones with dimensions n1 x n2 x n2 x ...</p><pre class="pre"> ones(2, 2) = {{1,1}, {1,1}}
+</pre><p class="p"><strong class="ph b">fill(s,n1,n2,n3)</strong></p><p class="p">Like zeros() and ones(), but with user defined value (s) for array elements.</p><pre class="pre"> fill(3,2,2) = {{3,3}, {3,3}}
+</pre><p class="p"><strong class="ph b">identity(n)</strong></p><p class="p">Creates an n x n integer identity matrix with ones on the diagonal and all other elements zero.</p><pre class="pre"> identity(3) =
+ 1 0 0
+ 0 1 0
+ 0 0 1
+</pre><p class="p"><strong class="ph b">diagonal(v)</strong></p><p class="p">Constructs a square matrix with elements of vector v on the diagonal and all other elements zero.</p><pre class="pre"> diagonal({1,2,3}) =
+ 1 0 0
+ 0 2 0
+ 0 0 3
+</pre><p class="p"><strong class="ph b">linspace(x1,x2,n)</strong></p><p class="p">Constracts a Real vector from x1 to x2 with n equally spaced elements.</p><pre class="pre"> linspace(2,5,4) = {2,3,4,5}
+</pre><p class="p"><strong class="ph b">Reduction functions</strong></p><p class="p">Reduction functions reduce arrays to scalars.</p><p class="p"><strong class="ph b">min(A)</strong></p><p class="p">Returns the minimum value in array A.</p><pre class="pre"> Real A = {{1,2},{3,4}}
+ min(A) = 1
+</pre><p class="p"><strong class="ph b">max(A)</strong></p><p class="p">Returns the maximum value in array A.</p><pre class="pre"> Real A = {{1,2},{3,4}}
+ max(A) = 4
+</pre><p class="p"><strong class="ph b">sum(A)</strong></p><p class="p">Returns the sum of values in array A.</p><pre class="pre"> Real A = {{1,2},{3,4}}
+ sum(A) = 10 // 1 + 2 + 3 + 4
+</pre><p class="p"><strong class="ph b">product(A)</strong></p><p class="p">Returns the product of values in array A.</p><pre class="pre"> Real A = {{1,2},{3,4}}
+ product(A) = 24 // 1 * 2 * 3 * 4
+</pre><p class="p"><strong class="ph b">Using functions with iterators</strong></p><p class="p">Functions min(A), max(A), sum(A) and product(A) reduce arrays to scalars. When you use multidimensional variables, you will most probably like to reduce less dimensions. This can be achieved using iterators with reduction functions. The result is constructed as an array, if curly brackets {} are used to enclose the expression.</p><pre class="pre"> enumeration E1 = one, two, three
+ enumeration E2 = eins, zwei, drei
+ Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}
+
+ AuxiliarySum[E1] = {sum( Auxiliary[ i , E2 ] ) for i in E1} // Result: {6, 15, 24}
+
+ /* Same as:
+ {sum(Auxiliary[one, E2]), sum(Auxiliary[two, E2]), sum(Auxiliary[three, E2])}
+ {sum({1,2,3}), sum({4,5,6}), sum({7,8,9})}
+ */
+</pre><p class="p">One expression can have multiple iterators. The Modelica specification defines the following format, but it is NOT yet supported in OpenModelica:</p><pre class="pre"> {sum(Array[ i, j, E3]) for i in E1, j in E2} // Dimensions reduced from 3 to 2
+</pre><p class="p">To use multiple iterators, use the following format (NOTE the reversed order of iterators!):</p><pre class="pre"> {{sum(Array[ i, j, E3]) for j in E2} for i in E1} // Dimensions reduced from 3 to 2
+</pre><p class="p">The range doesn't have to be the whole enumeration. Subranges can also be used.</p><pre class="pre"> {sum( Auxiliary[ i , eins : zwei ] ) for i in E1.one : E1.two} // Result: {3, 9}
+
+ /* Same as
+ {sum(Auxiliary[one, eins : zwei]), sum(Auxiliary[two, eins : zwei])}
+ {sum({1,2}), sum({4,5})}
+ */
+</pre></div></article><article class="topic nested2" aria-labelledby="ariaid-title42" id="simulation-results"><h3 class="title topictitle3" id="ariaid-title42">Simulation Results</h3><div class="body"><p class="p">Multidimensional variables provide multiple results for the same variable. One result for each index. The trend view clutters very quickly when you add dimensions to the variables.</p><div class="div image">
+ <img class="image" src="Images/3x3trend.png"><br>
+</div><p class="p">The clutter can be reduced by selecting which enumeration indexes are shown in charts. Select an enumeration and tick the indexes that you want to show. The same settings apply to each variable that uses the enumeration. This way you can follow an interesting index throughout the model.</p><div class="div image">
+ <img class="image" src="Images/ShowInCharts.png"><br>
+</div></div></article><article class="topic nested2" aria-labelledby="ariaid-title43" id="array-variables-in-modules"><h3 class="title topictitle3" id="ariaid-title43">Array Variables in Modules</h3><div class="body"><div class="div imageBorder">
+ <img class="image" src="Images/Replaceable.png"><br>
+ <p class="p imageText">Replaceable enumeration inside a module</p>
+</div><p class="p">You can also use array variables inside modules. Enumeration need to be defined separately for each module type and added to all necessary variables, also inputs and outputs (see <a class="xref" href="#modeling">Modeling</a>).</p><p class="p">When defining a module, modeler may not want to restrict the size of the array variable. In many cases the same module structure could be used for both large and small arrays. For example if the module is a project, a project may have three or even twenty phases. In this case the enumerations inside modules need to be set as replaceable.</p><p class="p">In this example, the original enumeration that the modeler used had two indexes. We are using an instance of this module, but we need to use array variables that have three indexes instead of two. We are using two variables and an instance of the module.</p><div class="div imageBorder">
+ <img class="image" src="Images/ReplacingEnumerationConfiguration.png"><br>
+ <p class="p imageText">Module configuration for replacing enumerations inside the module</p>
+</div><p class="p">In the parent configuration, we have used an enumeration with three indexes in the two variables.</p><div class="div imageBorder">
+ <img class="image" src="Images/Replacing.png"><br>
+ <p class="p imageText">Enumeration in the parent configuration that will replace the enumeration in the module</p>
+</div><p class="p">The replacement can be defined in the properties of the module instance. When the module instance is selected, a table with all the replaceable enumerations is shown. By clickin on the cell next to the enumeration, a drop-down box is shown with all the enumerations in the parent module. If an enumeration is selected, it will replace the enumeration inside the module during simulation. The replacement will not, however, show elsewhere in the model.</p><div class="div imageBorder">
+ <img class="image" src="Images/ReplacingEnumeration.png"><br>
+ <p class="p imageText">Enumeration in the parent configuration that will replace the enumeration in the module</p>
+</div><p class="p">When creating replaceable enumerations in modules, modelers need to be very careful. Direct references to single enumeration elements are not allowed, since the enumeration elements will change, if the enumeration is replaced for simulation!</p></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title44" id="functions"><h2 class="title topictitle2" id="ariaid-title44">Functions</h2><div class="body"><div class="div hr">
+</div><p class="p">Modelica provides a convenient way to use functions in your models. You can create your own functions, export and import complete function libraries and share function libraries to be used in all of your models.</p></div><article class="topic nested2" aria-labelledby="ariaid-title45" id="creating-functions"><h3 class="title topictitle3" id="ariaid-title45">Creating Functions</h3><div class="body"><div class="div image">
+ <img class="image" src="Images/NewFunction.png"><br>
+</div><p class="p">You can create new functions to the Functions -folder in your model or to function library folders. Right-click on the folder and select New->Function.</p><p class="p">Functions that can be found from Functions -folder can be used in your variable definitions.</p><p class="p">Functions are defined using Modelica language. The variables used in the function are defined in the declaration section. Function needs an output and an arbitrary number of inputs. Modelica specification enables use of multiple outputs, but this feature is not supported. The inputs are given in the same order as they are used in calling the function.</p><p class="p">Algorithm section defines the actual functionality of the function. In algorithm sections you must use assignments ":=" instead of just plain "=". All the assignments are calculated in the order they are written.</p><p class="p">Below is an example of a simple function. For more examples, see the built-in functions provided with the tool and <a class="xref" href="https://www.modelica.org/documents/" target="_blank">Modelica specifications</a>.</p><div class="div image">
+ <img class="image" src="Images/ExampleFunction.png"><br>
+</div></div></article><article class="topic nested2" aria-labelledby="ariaid-title46" id="function-libraries"><h3 class="title topictitle3" id="ariaid-title46">Function Libraries</h3><div class="body"><p class="p">Functions can be collected into libraries. This is a good way of organizing your functions. If function is located in a library, you need to append the library name to the function call (e.g. ExampleFunctionLibrary.ExampleFunction(arg1, arg2)). With libraries, you can also have functions with same names (e.g. library1.func(arg) and library2.func(arg)).</p><div class="div image">
+ <img class="image" src="Images/NewFunctionLibrary.png"><br>
+</div><p class="p">There are three types of function libraries: normal function library, built-in function library and shared function library. Normal function libraries can be created to a model and are available only in that model. Built-in libraries are available in all models and calls to built-in functions should not include the library name. Shared functions are available to all models in your workspace, but you need to enable them to each model individually.</p><p class="p">Create a new function library by right-clicking on Functions folder, Shared functions folder or other module library.</p><p class="p">A function library can be exported by right clicking the function library and selecting Export -> Function library. A function library can be imported by right clicking the Functions folder and selecting Import -> Function library. Functions themselves cannot be exported or imported. To export a function, add it into a function library and export that function library.</p><p class="p">If you create a shared function library, the library can be added to other models or removed from current model by selecting the Shared Functions -folder and using the properties view.</p><div class="div image">
+ <img class="image" src="Images/SharedFunctions.png"><br>
+</div></div></article><article class="topic nested2" aria-labelledby="ariaid-title47" id="external-functions"><h3 class="title topictitle3" id="ariaid-title47">External Functions</h3><div class="body"><p class="p">Modelica allows you to use external functions that are programmed using C language. To use this feature, you need to have the Sysdyn version with OpenModelica included and OpenModelica set as the solver in the Preferences (Window -> Preferences -> Solver). The installation package with OpenModelica has also MinGW C compiler included that allows to build object files from C source code.</p><p class="p">Below is a simple example of using a function that returns the sum of two arguments.</p><pre class="pre"> double exampleCFunction(double x, double y)
+ {
+ double res;
+ res = x + y;
+ return res;
+ }
+</pre><div class="div image">
+ <img class="image" src="Images/ImportCFunctionLibrary.png"><br>
+</div><p class="p">You need to create an Object file (.o) of your code, import it to a function and define the function to use the library and function that you created. If you don’t have a C-compiler, you can use the one provided by the Simantics installation (e.g. simantics_home/plugins/org.simantics.openmodelica.win32_x/MinGW/bin/mingw32_gcc.exe -g -O -c ExampleCFunctionCode.c).</p><div class="div image">
+ <img class="image" src="Images/ExampleExternalFunction.png"><br>
+</div><p class="p">You can use the external function like any other function in your variables. Using equation ExampleExternalFunction(Stock1, 10) in an auxiliary variable (Auxiliary2) gives the following result.</p><div class="div image">
+ <img class="image" src="Images/ExternalFunctionResult.png"><br>
+</div><p class="p">In addition to .o -files, you can import .c and .h files. By including these to the function, the source code can be reviewed and later by you or others that use the function.</p><p class="p">Small external C function can also be written directly to the function code in Simantics Sysdyn:</p><pre class="pre"> function ExampleExternalFunction
+ input Real x;
+ input Real y;
+ output Real z;
+ external "C" z=exampleCFunction(x,y) annotation(Include="
+ double exampleCFunction(double x, double y)
+ {
+ double res;
+ res = x + y;
+ return res;
+ }");
+ end ExampleExternalFunction;
+</pre></div></article><article class="topic nested2" aria-labelledby="ariaid-title48" id="modelica-functions"><h3 class="title topictitle3" id="ariaid-title48">Modelica Functions</h3><div class="body"><p class="p">Modelica has built-in functions that can be used anywhere and are not visible in function libraries. This section covers a large number of those functions. For functions related to array variables, see see <a class="xref" href="#builtin-modelica-functions">builtin functions for arrays</a>.</p><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="modelica-functions__entry__1"><strong class="ph b">Function</strong></th><th class="entry" id="modelica-functions__entry__2"><strong class="ph b">Description</strong></th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">abs(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the absolute value of x. Expanded into "(if x >= 0 then x else -x)".</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">acos(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Inverse cosine.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">asin(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Inverse sine.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">atan(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Inverse tangent.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">atan2(x1,x2)</td><td class="entry" headers="modelica-functions__entry__2 ">four quadrant inverse tangent.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">cat(n,A,B,...)</td><td class="entry" headers="modelica-functions__entry__2 ">General concatenation function that concatenates arrays A,B,... along the nth dimension.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">ceil(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the smallest integer not less than x, the closest integer above x.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">cos(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Cosine.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">cosh(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Hyperbolic cosine.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">cross(x,y)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the 3-vector cross product of the 3-vectors x and y.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">delay(expr, delayTime)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the value of expr at the time time-delayTime. The value of expr is returned when time <= time.start + delayTime.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">der(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Time derivative of x. X must be have continuous-time variability.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">div(x, y)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the algebraic quotient x/y with any fractional part discarted. E.g. div(10,3) = 3.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">edge(b)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns true when the value of the boolean expression b changes. Expanded into (b and not pre(b)).</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">exp(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Exponential, base e.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">floor(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the largest integer not greater than x, the closest integer below x.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">initial()</td><td class="entry" headers="modelica-functions__entry__2 ">Returns true at the beginning of the simulation.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">integer(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the largest integer not greater than x as an integer.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">log(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Natural logarithm. (base e, x > 0)</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">log10(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Base 10 logarithm. (x > 0)</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">mod(x, y)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the integer modulus of x/y: mod(x,y) = x - floor(x/y) * y.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">noEvent(expr)</td><td class="entry" headers="modelica-functions__entry__2 ">noEvent around an expression causes the expression to NOT generate event. <strong class="ph b">Important:</strong> If you want a condition to be checked only on time steps, use noEvent. (e.g. if noEvent(value >= 1) then ... else ...)</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">pre(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the preceding value of y from time event that has occured before current time.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">rem(x, y)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns the integer remainder of x/y: rem(x,y) = x - div(x,y) * y.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">sample(start, interval)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns true and triggers time events at times start + i * interval (i=0,1,...).</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">sign(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Returns -1 if x is negative, 1 if x is positive. Expanded into "(if x > 0 then 1 else if x < 0 then -1 else 0)".</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">sin(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Sine.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">sinh(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Hyperbolic sine.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">sqrt(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Square root of x. The value of x must be greater or equal to 0 or an assertion error occurs.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">tan(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Tangent.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">tanh(x)</td><td class="entry" headers="modelica-functions__entry__2 ">Hyperbolic tangent.</td></tr><tr class="row"><td class="entry" headers="modelica-functions__entry__1 ">terminal()</td><td class="entry" headers="modelica-functions__entry__2 ">Returns true at the end of a successful simulation.</td></tr></tbody></table></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title49" id="spreadsheets"><h2 class="title topictitle2" id="ariaid-title49">Spreadsheets</h2><div class="body"><div class="div hr">
+</div><p class="p">Spreadsheets allow storing and maintaining values in a familiar format. The current spreadsheet implementation is experimental and does not provide much functionality.</p></div><article class="topic nested2" aria-labelledby="ariaid-title50" id="variable-values"><h3 class="title topictitle3" id="ariaid-title50">Variable Values</h3><div class="body"><p class="p">Spreadsheets are an easy way to import and manage parameter values. Sheet shells can be referenced to in models with the syntax SheetName(CellReference). Below is an example of getting a value for Auxiliary. The text "Auxiliary" is not necessary in the spreadsheet, but it helps maintaining the sheet.</p><div class="div image">
+ <img class="image" src="Images/AuxiliarySheetReference.png"><br>
+ <img class="image" src="Images/AuxiliarySheet.png"><br>
+</div><p class="p">You can also refer to sheets with array variables. Reference is simple with one and two dimensional array variables. Below is an example of a sheet with values for two different variables. The names of the indexes are not mandatory, but help reading and maintaining the sheet.</p><div class="div image">
+ <img class="image" src="Images/SheetForMultidim.png"><br>
+</div><p class="p">Reference to a sheet range creates an array variable.</p><div class="div image">
+ <img class="image" src="Images/SheetMultidim1.png"><br>
+</div><p class="p">ArrayTest2 has two dimensions. Reference to a larger range creates a two-dimensional variable. By default, the indexes are ordered as in this example. However, if you wish to present the indexes in a different order in the spreadsheet, you can transpose the sheet reference (e.g. transpose(ArrayTestSheet(E2:G3)))</p><div class="div image">
+ <img class="image" src="Images/SheetMultidim2.png"><br>
+</div></div></article><article class="topic nested2" aria-labelledby="ariaid-title51" id="history-data"><h3 class="title topictitle3" id="ariaid-title51">History Data</h3><div class="body"><p class="p">Spreadsheets can be used to store and display external history data e.g. from some statistics. The history data should be arranged as columns or rows and include a time variable. Reference variables need to be given the exactly same name as their counterparts in model.</p><div class="div image">
+ <img class="image" src="Images/Sheet.png"><br>
+</div><p class="p">History data is used by creating a History dataset to an experiment. The dataset is activated and deactivated in charts by double-clicking the dataset. History data reference is set in the properties of the history dataset.</p><div class="div image">
+ <img class="image" src="Images/HistoryDataSettings.png"><br>
+</div><table class="table"><caption></caption><colgroup><col><col></colgroup><thead class="thead"><tr class="row"><th class="entry" id="history-data__entry__1"><strong class="ph b">History data properties</strong></th><th class="entry" id="history-data__entry__2">-</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry" headers="history-data__entry__1 ">Name</td><td class="entry" headers="history-data__entry__2 ">Name of the history dataset</td></tr><tr class="row"><td class="entry" headers="history-data__entry__1 ">Sheet</td><td class="entry" headers="history-data__entry__2 ">Combo box for selecting a sheet where the history data is located</td></tr><tr class="row"><td class="entry" headers="history-data__entry__1 ">Orientation</td><td class="entry" headers="history-data__entry__2 ">Columns or rows. How the data is arranged in the sheet.</td></tr><tr class="row"><td class="entry" headers="history-data__entry__1 ">Range start</td><td class="entry" headers="history-data__entry__2 ">The upper-left corner cell of the history data range</td></tr><tr class="row"><td class="entry" headers="history-data__entry__1 ">Range end</td><td class="entry" headers="history-data__entry__2 ">The lower-right corner cell of the history data range</td></tr><tr class="row"><td class="entry" headers="history-data__entry__1 ">Time variable</td><td class="entry" headers="history-data__entry__2 ">The name of the time variable in the history data, if it is different than "time"</td></tr><tr class="row"><td class="entry" headers="history-data__entry__1 ">Variables in range</td><td class="entry" headers="history-data__entry__2 ">This text field displays the found variables in the given sheet and range</td></tr></tbody></table><p class="p">If the history dataset is activated, history data is displayed whenever it is available for a variable that is displayed in a chart.</p><div class="div image">
+ <img class="image" src="Images/HistoryData.png"><br>
+</div></div></article></article><article class="topic nested1" aria-labelledby="ariaid-title52" id="vensim-model-import"><h2 class="title topictitle2" id="ariaid-title52">Vensim Model Import</h2><div class="body"><div class="div hr">
+</div><p class="p">The tool also has a limited support for importing system dynamics models created with the simulation and modelling tool <a class="xref" href="http://vensim.com/" target="_blank">Vensim</a>. This functionality is used similarly to the regular model import, so by right-clicking the browser and selecting "Import" -> "Vensim Model (.mdl)".</p><p class="p">The import process has several known limitations:</p><ul class="ul"><li class="li"><p class="p">The Vensim model must be in the .mdl file format, the other Vensim file formats are proprietary and thus not supported.</p></li><li class="li"><p class="p">Only variables and connections are imported.</p></li><li class="li"><p class="p">Many advanced Vensim features, such as input and output objects (e.g. graphs and parameter value editors) and other diagram customizations, are not supported.</p></li><li class="li"><p class="p">Variable value range data is not always imported correctly.</p></li><li class="li"><p class="p">Subscripts are automatically converted to enumerations which may sometimes lead into problems as the constructions are not exactly equivalent.</p></li><li class="li"><p class="p">Dimensionless units are currently not converted correctly (in Simantics System Dynamics, dimensionless should be indicated with a constant).</p></li><li class="li"><p class="p">Non-shadow duplicate variables are sometimes very problematic and may be imported incorrectly, shadow variables should work fine.</p></li><li class="li"><p class="p">Only a limited subset of Vensim functions is currently implemented in Simantics System Dynamics, so some equations might require additional work before they can be evaluated correctly.</p></li></ul></div></article><article class="topic nested1" aria-labelledby="ariaid-title53" id="sample-models-and-molecules"><h2 class="title topictitle2" id="ariaid-title53">Sample Models and Molecules</h2><div class="body"><div class="div hr">
+</div><p class="p">There are some sample models located in the sampleModels folder found in the installation folder. The sample models can be imported by right-clicking on the model browser and select Import->Model.</p><p class="p"><a class="xref" href="https://www.simantics.org/end_user_wiki/index.php/Introduction_to_Simantics" target="_blank">Simantics</a> | <em class="ph i">System Dynamics Modelling</em></p><div class="div hr">
+</div><p class="p"><a class="xref" href="BasicTutorial.html"><strong class="ph b">Tutorial: Basic System Dynamics Modelling</strong></a></p><p class="p">System dynamics modelling in Simantics is a free modelling tool that is included into the basic installation. This tutorial introduces the basic features of the system dynamics modelling tool.</p><p class="p"><a class="xref" href="AdvancedTutorial.html"><strong class="ph b">Tutorial: Advanced System Dynamics Modelling</strong></a></p><p class="p">This tutorial introduces the more advanced features of the system dynamics modelling tool: Modules and Operating interfaces</p></div></article></div></article></article></main></body></html>
\ No newline at end of file
--- /dev/null
+/*!
+ * This file is part of the DITA Open Toolkit project.
+ *
+ * Copyright 2004, 2005 IBM Corporation
+ *
+ * See the accompanying LICENSE file for applicable license.
+ */
+.codeblock {
+ font-family: monospace;
+}
+
+.codeph {
+ font-family: monospace;
+}
+
+.kwd {
+ font-weight: bold;
+}
+
+.parmname {
+ font-weight: bold;
+}
+
+.var {
+ font-style: italic;
+}
+
+.filepath {
+ font-family: monospace;
+}
+
+div.tasklabel {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+h2.tasklabel,
+h3.tasklabel,
+h4.tasklabel,
+h5.tasklabel,
+h6.tasklabel {
+ font-size: 100%;
+}
+
+.screen {
+ padding: 5px 5px 5px 5px;
+ border: outset;
+ background-color: #CCCCCC;
+ margin-top: 2px;
+ margin-bottom: 2px;
+ white-space: pre;
+}
+
+.wintitle {
+ font-weight: bold;
+}
+
+.numcharref {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.parameterentity {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.textentity {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.xmlatt {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.xmlelement {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.xmlnsname {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.xmlpi {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.frame-top {
+ border-top: solid 1px;
+ border-right: 0;
+ border-bottom: 0;
+ border-left: 0;
+}
+
+.frame-bottom {
+ border-top: 0;
+ border-right: 0;
+ border-bottom: solid 1px;
+ border-left: 0;
+}
+
+.frame-topbot {
+ border-top: solid 1px;
+ border-right: 0;
+ border-bottom: solid 1px;
+ border-left: 0;
+}
+
+.frame-all {
+ border: solid 1px;
+}
+
+.frame-sides {
+ border-top: 0;
+ border-left: solid 1px;
+ border-right: solid 1px;
+ border-bottom: 0;
+}
+
+.frame-none {
+ border: 0;
+}
+
+.scale-50 {
+ font-size: 50%;
+}
+
+.scale-60 {
+ font-size: 60%;
+}
+
+.scale-70 {
+ font-size: 70%;
+}
+
+.scale-80 {
+ font-size: 80%;
+}
+
+.scale-90 {
+ font-size: 90%;
+}
+
+.scale-100 {
+ font-size: 100%;
+}
+
+.scale-110 {
+ font-size: 110%;
+}
+
+.scale-120 {
+ font-size: 120%;
+}
+
+.scale-140 {
+ font-size: 140%;
+}
+
+.scale-160 {
+ font-size: 160%;
+}
+
+.scale-180 {
+ font-size: 180%;
+}
+
+.scale-200 {
+ font-size: 200%;
+}
+
+.expanse-page, .expanse-spread {
+ width: 100%;
+}
+
+.fig {
+ /* Default of italics to set apart figure captions */
+ /* Use @frame to create frames on figures */
+}
+
+.figcap {
+ font-style: italic;
+}
+
+.figdesc {
+ font-style: normal;
+}
+
+.figborder {
+ border-color: Silver;
+ border-style: solid;
+ border-width: 2px;
+ margin-top: 1em;
+ padding-left: 3px;
+ padding-right: 3px;
+}
+
+.figsides {
+ border-color: Silver;
+ border-left: 2px solid;
+ border-right: 2px solid;
+ margin-top: 1em;
+ padding-left: 3px;
+ padding-right: 3px;
+}
+
+.figtop {
+ border-color: Silver;
+ border-top: 2px solid;
+ margin-top: 1em;
+}
+
+.figbottom {
+ border-bottom: 2px solid;
+ border-color: Silver;
+}
+
+.figtopbot {
+ border-bottom: 2px solid;
+ border-color: Silver;
+ border-top: 2px solid;
+ margin-top: 1em;
+}
+
+/* Align images based on @align on topic/image */
+div.imageleft {
+ text-align: left;
+}
+
+div.imagecenter {
+ text-align: center;
+}
+
+div.imageright {
+ text-align: right;
+}
+
+div.imagejustify {
+ text-align: justify;
+}
+
+/* Set heading sizes, getting smaller for deeper nesting */
+.topictitle1 {
+ font-size: 1.34em;
+ margin-bottom: 0.1em;
+ margin-top: 0;
+}
+
+.topictitle2 {
+ font-size: 1.17em;
+ margin-bottom: 0.45em;
+ margin-top: 1pc;
+}
+
+.topictitle3 {
+ font-size: 1.17em;
+ font-weight: bold;
+ margin-bottom: 0.17em;
+ margin-top: 1pc;
+}
+
+.topictitle4 {
+ font-size: 1.17em;
+ font-weight: bold;
+ margin-top: 0.83em;
+}
+
+.topictitle5 {
+ font-size: 1.17em;
+ font-weight: bold;
+}
+
+.topictitle6 {
+ font-size: 1.17em;
+ font-style: italic;
+}
+
+.sectiontitle {
+ color: #000;
+ font-size: 1.17em;
+ font-weight: bold;
+ margin-bottom: 0;
+ margin-top: 1em;
+}
+
+.section {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.example {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+/* Most link groups are created with <div>. Ensure they have space before and after. */
+.ullinks {
+ list-style-type: none;
+}
+
+.ulchildlink {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.olchildlink {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.linklist {
+ margin-bottom: 1em;
+}
+
+ul.linklist {
+ margin-top: 0;
+ list-style-type: none;
+ padding-left: 0;
+}
+
+li.linklist {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+.linklistwithchild {
+ margin-bottom: 1em;
+ margin-left: 1.5em;
+}
+
+.sublinklist {
+ margin-bottom: 1em;
+ margin-left: 1.5em;
+}
+
+.relconcepts {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.reltasks {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.relref {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.relinfo {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.breadcrumb {
+ font-size: smaller;
+ margin-bottom: 1em;
+}
+
+/* Simple lists do not get a bullet */
+ul.simple {
+ list-style-type: none;
+}
+
+/* Default of bold for definition list terms */
+.dlterm {
+ font-weight: bold;
+}
+
+/* Use CSS to expand lists with @compact="no" */
+.dltermexpand {
+ font-weight: bold;
+ margin-top: 1em;
+}
+
+*[compact="yes"] > li {
+ margin-top: 0;
+}
+
+*[compact="no"] > li {
+ margin-top: 0.53em;
+}
+
+.liexpand {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.sliexpand {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.dlexpand {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.ddexpand {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.stepexpand {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.substepexpand {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+dt.prereq {
+ margin-left: 20px;
+}
+
+/* All note formats have the same default presentation */
+.note {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.note .notetitle, .note .notelisttitle,
+.note .note__title {
+ font-weight: bold;
+}
+
+/* Various basic phrase styles */
+.bold {
+ font-weight: bold;
+}
+
+.bolditalic {
+ font-style: italic;
+ font-weight: bold;
+}
+
+.italic {
+ font-style: italic;
+}
+
+.underlined {
+ text-decoration: underline;
+}
+
+.uicontrol {
+ font-weight: bold;
+}
+
+.defkwd {
+ font-weight: bold;
+ text-decoration: underline;
+}
+
+.shortcut {
+ text-decoration: underline;
+}
+
+.menucascade > abbr {
+ text-decoration: none;
+}
+
+table {
+ border-collapse: collapse;
+}
+
+table .desc {
+ display: block;
+ font-style: italic;
+}
+
+.cellrowborder {
+ border-bottom: solid 1px;
+ border-left: 0;
+ border-right: solid 1px;
+ border-top: 0;
+}
+
+.row-nocellborder {
+ border-bottom: solid 1px;
+ border-left: 0;
+ border-top: 0;
+}
+
+.cell-norowborder {
+ border-left: 0;
+ border-right: solid 1px;
+ border-top: 0;
+}
+
+.nocellnorowborder {
+ border: 0;
+}
+
+.firstcol {
+ font-weight: bold;
+}
+
+.table--pgwide-1 {
+ width: 100%;
+}
+
+.align-left {
+ text-align: left;
+}
+
+.align-right {
+ text-align: right;
+}
+
+.align-center {
+ text-align: center;
+}
+
+.align-justify {
+ text-align: justify;
+}
+
+.align-char {
+ text-align: char;
+}
+
+.valign-top {
+ vertical-align: top;
+}
+
+.valign-bottom {
+ vertical-align: bottom;
+}
+
+.valign-middle {
+ vertical-align: middle;
+}
+
+.colsep-0 {
+ border-right: 0;
+}
+
+.colsep-1 {
+ border-right: 1px solid;
+}
+
+.rowsep-0 {
+ border-bottom: 0;
+}
+
+.rowsep-1 {
+ border-bottom: 1px solid;
+}
+
+.stentry {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+}
+
+.stentry:last-child {
+ border-right: 0;
+}
+
+.strow:last-child .stentry {
+ border-bottom: 0;
+}
+
+/* Add space for top level topics */
+.nested0 {
+ margin-top: 1em;
+}
+
+/* div with class=p is used for paragraphs that contain blocks, to keep the XHTML valid */
+.p {
+ margin-top: 1em;
+}
+
+/*!
+ * Custom CSS declarations, to be appended to the end of existing declarations
+ */
+
+.imageText {
+ padding: 1px;
+ border: 1px solid;
+ text-align: center;
+ border-color: #c8ccd1;
+}
+
+.imageBorder {
+ padding: 4px;
+ border: 1px solid;
+ border-color: #c8ccd1;
+ display: table;
+ background-color: #f8f9fa;
+}
+
+ .box {
+ display: flex;
+ align-items:left;
+}
+
+center {
+ margin: auto;
+ width: 50%;
+}
+
+.hr{
+ border-top: 1px solid black;
+}
+
+ pre {
+ color: #000000;
+ display: block;
+ white-space: pre-wrap;
+ margin: 1em 0;
+ background-color: #f8f9fa;
+ border: 1px solid #eaecf0;
+ padding: 0;
+}
--- /dev/null
+/*!
+ * This file is part of the DITA Open Toolkit project.
+ *
+ * Copyright 2015 Jarno Elovirta
+ *
+ * See the accompanying LICENSE file for applicable license.
+ */
+/*!
+ * This file is part of the DITA Open Toolkit project.
+ *
+ * Copyright 2004, 2005 IBM Corporation
+ *
+ * See the accompanying LICENSE file for applicable license.
+ */
+.codeblock {
+ font-family: monospace;
+}
+
+.codeph {
+ font-family: monospace;
+}
+
+.kwd {
+ font-weight: bold;
+}
+
+.parmname {
+ font-weight: bold;
+}
+
+.var {
+ font-style: italic;
+}
+
+.filepath {
+ font-family: monospace;
+}
+
+div.tasklabel {
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+h2.tasklabel,
+h3.tasklabel,
+h4.tasklabel,
+h5.tasklabel,
+h6.tasklabel {
+ font-size: 100%;
+}
+
+.screen {
+ padding: 5px 5px 5px 5px;
+ border: outset;
+ background-color: #CCCCCC;
+ margin-top: 2px;
+ margin-bottom: 2px;
+ white-space: pre;
+}
+
+.wintitle {
+ font-weight: bold;
+}
+
+.numcharref {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.parameterentity {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.textentity {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.xmlatt {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.xmlelement {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.xmlnsname {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.xmlpi {
+ color: #663399;
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+
+.frame-top {
+ border-top: solid 1px;
+ border-right: 0;
+ border-bottom: 0;
+ border-left: 0;
+}
+
+.frame-bottom {
+ border-top: 0;
+ border-right: 0;
+ border-bottom: solid 1px;
+ border-left: 0;
+}
+
+.frame-topbot {
+ border-top: solid 1px;
+ border-right: 0;
+ border-bottom: solid 1px;
+ border-left: 0;
+}
+
+.frame-all {
+ border: solid 1px;
+}
+
+.frame-sides {
+ border-top: 0;
+ border-left: solid 1px;
+ border-right: solid 1px;
+ border-bottom: 0;
+}
+
+.frame-none {
+ border: 0;
+}
+
+.scale-50 {
+ font-size: 50%;
+}
+
+.scale-60 {
+ font-size: 60%;
+}
+
+.scale-70 {
+ font-size: 70%;
+}
+
+.scale-80 {
+ font-size: 80%;
+}
+
+.scale-90 {
+ font-size: 90%;
+}
+
+.scale-100 {
+ font-size: 100%;
+}
+
+.scale-110 {
+ font-size: 110%;
+}
+
+.scale-120 {
+ font-size: 120%;
+}
+
+.scale-140 {
+ font-size: 140%;
+}
+
+.scale-160 {
+ font-size: 160%;
+}
+
+.scale-180 {
+ font-size: 180%;
+}
+
+.scale-200 {
+ font-size: 200%;
+}
+
+.expanse-page, .expanse-spread {
+ width: 100%;
+}
+
+.fig {
+ /* Default of italics to set apart figure captions */
+ /* Use @frame to create frames on figures */
+}
+
+.figcap {
+ font-style: italic;
+}
+
+.figdesc {
+ font-style: normal;
+}
+
+.figborder {
+ border-color: Silver;
+ border-style: solid;
+ border-width: 2px;
+ margin-top: 1em;
+ padding-left: 3px;
+ padding-right: 3px;
+}
+
+.figsides {
+ border-color: Silver;
+ border-left: 2px solid;
+ border-right: 2px solid;
+ margin-top: 1em;
+ padding-left: 3px;
+ padding-right: 3px;
+}
+
+.figtop {
+ border-color: Silver;
+ border-top: 2px solid;
+ margin-top: 1em;
+}
+
+.figbottom {
+ border-bottom: 2px solid;
+ border-color: Silver;
+}
+
+.figtopbot {
+ border-bottom: 2px solid;
+ border-color: Silver;
+ border-top: 2px solid;
+ margin-top: 1em;
+}
+
+/* Align images based on @align on topic/image */
+div.imageleft {
+ text-align: left;
+}
+
+div.imagecenter {
+ text-align: center;
+}
+
+div.imageright {
+ text-align: right;
+}
+
+div.imagejustify {
+ text-align: justify;
+}
+
+/* Set heading sizes, getting smaller for deeper nesting */
+.topictitle1 {
+ font-size: 1.34em;
+ margin-bottom: 0.1em;
+ margin-top: 0;
+}
+
+.topictitle2 {
+ font-size: 1.17em;
+ margin-bottom: 0.45em;
+ margin-top: 1pc;
+}
+
+.topictitle3 {
+ font-size: 1.17em;
+ font-weight: bold;
+ margin-bottom: 0.17em;
+ margin-top: 1pc;
+}
+
+.topictitle4 {
+ font-size: 1.17em;
+ font-weight: bold;
+ margin-top: 0.83em;
+}
+
+.topictitle5 {
+ font-size: 1.17em;
+ font-weight: bold;
+}
+
+.topictitle6 {
+ font-size: 1.17em;
+ font-style: italic;
+}
+
+.sectiontitle {
+ color: #000;
+ font-size: 1.17em;
+ font-weight: bold;
+ margin-bottom: 0;
+ margin-top: 1em;
+}
+
+.section {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.example {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+/* Most link groups are created with <div>. Ensure they have space before and after. */
+.ullinks {
+ list-style-type: none;
+}
+
+.ulchildlink {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.olchildlink {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.linklist {
+ margin-bottom: 1em;
+}
+
+ul.linklist {
+ margin-top: 0;
+ list-style-type: none;
+ padding-left: 0;
+}
+
+li.linklist {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+.linklistwithchild {
+ margin-bottom: 1em;
+ margin-left: 1.5em;
+}
+
+.sublinklist {
+ margin-bottom: 1em;
+ margin-left: 1.5em;
+}
+
+.relconcepts {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.reltasks {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.relref {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.relinfo {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.breadcrumb {
+ font-size: smaller;
+ margin-bottom: 1em;
+}
+
+/* Simple lists do not get a bullet */
+ul.simple {
+ list-style-type: none;
+}
+
+/* Default of bold for definition list terms */
+.dlterm {
+ font-weight: bold;
+}
+
+/* Use CSS to expand lists with @compact="no" */
+.dltermexpand {
+ font-weight: bold;
+ margin-top: 1em;
+}
+
+*[compact="yes"] > li {
+ margin-top: 0;
+}
+
+*[compact="no"] > li {
+ margin-top: 0.53em;
+}
+
+.liexpand {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.sliexpand {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.dlexpand {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.ddexpand {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.stepexpand {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.substepexpand {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+dt.prereq {
+ margin-left: 20px;
+}
+
+/* All note formats have the same default presentation */
+.note {
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+.note .notetitle, .note .notelisttitle,
+.note .note__title {
+ font-weight: bold;
+}
+
+/* Various basic phrase styles */
+.bold {
+ font-weight: bold;
+}
+
+.bolditalic {
+ font-style: italic;
+ font-weight: bold;
+}
+
+.italic {
+ font-style: italic;
+}
+
+.underlined {
+ text-decoration: underline;
+}
+
+.uicontrol {
+ font-weight: bold;
+}
+
+.defkwd {
+ font-weight: bold;
+ text-decoration: underline;
+}
+
+.shortcut {
+ text-decoration: underline;
+}
+
+.menucascade > abbr {
+ text-decoration: none;
+}
+
+table {
+ border-collapse: collapse;
+}
+
+table .desc {
+ display: block;
+ font-style: italic;
+}
+
+.cellrowborder {
+ border-bottom: solid 1px;
+ border-left: 0;
+ border-right: solid 1px;
+ border-top: 0;
+}
+
+.row-nocellborder {
+ border-bottom: solid 1px;
+ border-left: 0;
+ border-top: 0;
+}
+
+.cell-norowborder {
+ border-left: 0;
+ border-right: solid 1px;
+ border-top: 0;
+}
+
+.nocellnorowborder {
+ border: 0;
+}
+
+.firstcol {
+ font-weight: bold;
+}
+
+.table--pgwide-1 {
+ width: 100%;
+}
+
+.align-left {
+ text-align: left;
+}
+
+.align-right {
+ text-align: right;
+}
+
+.align-center {
+ text-align: center;
+}
+
+.align-justify {
+ text-align: justify;
+}
+
+.align-char {
+ text-align: char;
+}
+
+.valign-top {
+ vertical-align: top;
+}
+
+.valign-bottom {
+ vertical-align: bottom;
+}
+
+.valign-middle {
+ vertical-align: middle;
+}
+
+.colsep-0 {
+ border-right: 0;
+}
+
+.colsep-1 {
+ border-right: 1px solid;
+}
+
+.rowsep-0 {
+ border-bottom: 0;
+}
+
+.rowsep-1 {
+ border-bottom: 1px solid;
+}
+
+.stentry {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+}
+
+.stentry:last-child {
+ border-right: 0;
+}
+
+.strow:last-child .stentry {
+ border-bottom: 0;
+}
+
+/* Add space for top level topics */
+.nested0 {
+ margin-top: 1em;
+}
+
+/* div with class=p is used for paragraphs that contain blocks, to keep the XHTML valid */
+.p {
+ margin-top: 1em;
+}
+
+.linklist {
+ margin-bottom: 1em;
+}
+
+ul.linklist {
+ margin-top: 0;
+ list-style-type: none;
+ padding-right: 0;
+}
+
+.linklistwithchild {
+ margin-right: 1.5em;
+ margin-top: 1em;
+}
+
+.sublinklist {
+ margin-right: 1.5em;
+ margin-top: 1em;
+}
+
+dt.prereq {
+ margin-right: 20px;
+}
+
+.cellrowborder {
+ border-left: solid 1px;
+ border-right: none;
+}
+
+.row-nocellborder {
+ border-left: hidden;
+ border-right: none;
+}
+
+.cell-norowborder {
+ border-left: solid 1px;
+ border-right: none;
+}
+
+.nocellnorowborder {
+ border-left: hidden;
+}
+
+/*!
+ * Custom CSS declarations, to be appended to the end of existing declarations
+ */
+
+.imageText {
+ padding: 1px;
+ border: 1px solid;
+ text-align: center;
+ border-color: #c8ccd1;
+}
+
+.imageBorder {
+ padding: 4px;
+ border: 1px solid;
+ border-color: #c8ccd1;
+ display: table;
+ background-color: #f8f9fa;
+}
+
+ .box {
+ display: flex;
+ align-items:left;
+}
+
+center {
+ margin: auto;
+ width: 50%;
+}
+
+.hr{
+ border-top: 1px solid black;
+}
+
+ pre {
+ color: #000000;
+ display: block;
+ white-space: pre-wrap;
+ margin: 1em 0;
+ background-color: #f8f9fa;
+ border: 1px solid #eaecf0;
+ padding: 0;
+}
--- /dev/null
+<!DOCTYPE html
+ SYSTEM "about:legacy-compat">
+<html lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta charset="UTF-8">
+ <meta name="copyright" content="(C) Copyright 2018">
+ <meta name="DC.rights.owner" content="(C) Copyright 2018">
+ <meta name="DC.Type" content="map">
+ <meta name="DC.Format" content="HTML5">
+ <meta name="DC.Identifier" content="org.simantics.sysdyn.ditamap">
+ <link rel="stylesheet" type="text/css" href="commonltr.css">
+ <title>Simantics System Dynamics</title>
+ </head>
+ <body id="org.simantics.sysdyn.ditamap">
+ <h1 class="title topictitle1">Simantics System Dynamics</h1>
+ <nav xmlns:dita="http://dita-ot.sourceforge.net">
+ <ul class="map">
+ <li class="topicref"><a href="Site/sysdyn.html">Simantics System Dynamics</a></li>
+ </ul>
+ </nav>
+ </body>
+</html>
\ No newline at end of file
<module>org.simantics.sysdyn.product</module>
<module>org.simantics.sysdyn.ui</module>
<module>org.simantics.sysdyn.xmile</module>
+ <module>org.simantics.sysdyn.help</module>
</modules>
</project>
--- /dev/null
+# Building dita docs from source markdown
+
+1. Download and install dita-ot: https://www.dita-ot.org/3.1/topics/installing-client.html
+2. Add dita to your PATH
+3. Edit the custom.css file
+4. Run the .bat file or .sh file
+5. To run with debug mode enabled, pass a single arg to the .bat or .sh: "-d" (without quotation marks)
+
+Note:
+
+When building, make sure to update build.properties if required.
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
+<map id="org.simantics.sysdyn.ditamap">
+ <title>Simantics System Dynamics</title>
+ <topicref href="Site/sysdyn.md" format="markdown"/>
+</map>
--- /dev/null
+# Tutorial: Advanced System Dynamics Modelling
+<div outputclass="hr"/>
+
+In this tutorial, we are going to bild a work model with two projects and shared workforce. Both the workforce and a separate project (work) are going to be created as modules, so they can be reused several times. Actually the model doesn't limit the number of projects at all. A [basic tutorial](BasicTutorial.md) is also available. This tutorial is part of the [sysdyn documentation](sysdyn.md).
+
+## Creating model and modules
+<div outputclass="hr"/>
+
+Let's start by creating the work model and the needed modules. First create a new model by right-clicking on the model browser and selecting New->Model. Alternatively you can select File->New Model from the main menu.
+
+Then create two new modules to your model. Right-click on the Modules folder and select New->Module.
+
+Name your model WorkModel and modules WorkforceModule and WorkModule. You can rename them by right-clicking on the item on the model browser and selecting Rename.
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/NewModel.png">
+ <p class="imageText">Creating a new model</p>
+</div>
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/NewModule.png">
+ <p class="imageText">Creating a new module</p>
+</div>
+<div class="imageBorder" width="198">
+ <img src="AdvancedTutorialImages/ModelStructure2.png">
+ <p class="imageText">Model after renaming</p>
+</div>
+
+## Initial configuration
+<div outputclass="hr"/>
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/TwoModules.png">
+ <p class="imageText">Workforce and Work modules</p>
+</div>
+
+We will use a top-down approach in our model, so first we will make a simple model configuration with our modules. Open our model configuration by double-clicking Configuration in your model browser.
+
+Drag one WorkforceModule and one WorkModule from your model browser to the WorkModel diagram. The modules are automatically named with a suffix number. Rename the modules to Workforce and Work1. You can rename objects on the diagram by double-clicking them or selecting them with one click and renaming them on the properties view below the diagram.
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/ConfigurationStart.png">
+ <p class="imageText">Workforce and Work modules, first inputs and connections</p>
+</div>
+
+When the modules are on the diagram, we should think what values we would like to get from the modules and what values we would like to use in the modules.
+
+Workforce needs to know, how much work is required and it should provide information on how much work can be done. To provide the information on how much work can be done, we need an Input variable. Variables can be dragged to the diagram from Symbols view or by using [shortcut keys](sysdyn.md#shortcut-and-control-keys) (Shift+I for Input variable). Drag an input variable to the diagram and name it TotalPossibleWorkingSpeed.
+
+Work module on the other hand provides information on how much work is required in it and it needs to know when the work has to be ready. Create an input variable RequiredWorkingSpeed1 and an Auxiliary variable Work1CompletionTime and place all variables like in the picture on the right.
+
+Connect the variables to modules using dependency connections (arrows). Connections are created by holding down Alt key and first clicking on the variable where to start the connection and then clicking on the variable where to end.
+
+Now we have the initial idea of the model, so let's configure the modules.
+
+
+## Workforce module
+<div outputclass="hr"/>
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/NetResourcing1.png">
+ <p class="imageText">Cloud, Valve, Flow and Stock</p>
+</div>
+
+Open Workforce module by selecting it from the diagram, right-clicking it and selecting Show Module.
+
+Create a Stock variable and name it WorkforceStock. Stock variables are created the same way as Input and Auxiliary variables. The level of the stock is controlled with a valve and a flow. To create the flow, hold down Alt and right-click on an empty space left of the stock. Then left-click on the stock. A cloud, valve and a flow is created. Rename the valve to NetResourcing.
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/NetResourcing2.png">
+ <p class="imageText">Cloud, Valve, Flow and Stock. Flow works both on directions.</p>
+</div>
+
+NetResourcing works both ways. To display this also visually, delete the cloud by selecting it and pressing delete on your keyboard. Then create a flow starting from NetResourcing valve and ending on an empty space next to it.
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/WorkforceAuxiliaries.png">
+ <p class="imageText">Auxiliaries in Workforce module</p>
+</div>
+
+Now you have used all the basic components and connections. From now on the instructions will be a more simplified.
+
+Next we will create four Auxiliary variables: TimeToAllocateResources, WorkforceRequired, Productivity and PossibleWorkingSpeed. Place and connect them according to the picture on the right.
+
+To be able to simulate the model, all variables must have valid equations. To configure an equation, select a variable. Variable's properties are shown in the Property view and you can input the required equations in the text fields. You can copy the equations directly from here or type them manually. Variables connected to the selected variable are shown in the Variables list. To speed up typing, you can double click on a variable name and it will be inserted to the equation.
+
+<pre>
+WorkforceStock
+Initial value: 0
+
+NetResourcing
+= (WorkforceRequired - WorkforceStock)/TimeToAllocateResources
+
+TimeToAllocateResources
+= 2
+
+Productivity
+= 1
+
+PossibleWorkingSpeed
+= WorkforceStock * Productivity
+Is Output
+</pre>
+
+Variables can be set as output by selecting Is Output option from the Equation tab.
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/RequiredWorkingSpeedInput.png">
+ <p class="imageText">RequiredWorkingSpeedInput</p>
+</div>
+
+On a previous phase, we wanted to give the value of RequiredWorkingSpeed1 to this workforce module. To get that value, we need to create an input. Create input RequiredWorkingSpeedInput, connect it to WorkforceRequired and write the following equation to WorkforceRequired.
+
+<pre>
+WorkForceRequired
+= RequiredWorkingSpeedInput/Productivity
+</pre>
+
+Now this module is ready to be used as a part of the model.
+
+## Work module
+<div outputclass="hr"/>
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/WorkStocks.png">
+ <p class="imageText">Basic work with errors</p>
+</div>
+
+Open Work1 module by selecting it from the WorkModel diagram, right-clicking it and selecting Show Module. Alternatively you can double click Work1 on the model browser.
+
+Create the basic flow of work with stocks and flows like in the picture on the right.
+
+The idea of the model is that first there is work. Work is done at a certain speed. When working, errors are also made. When errors are found, the amount of Errors is reduced, errors are removed from WorkDone and moved back to WorkToDo.
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/ProjectIsReady.png">
+ <p class="imageText">Smoothener for work is done</p>
+</div>
+
+Work needs to be stopped when the project is ready. Since the simulator might face some difficulties to determine the projects readyness when project is almost ready, we need to implement some smoothing to the limit. OpenModelica doesn't yet have a builtin function for smoothing, so we need to implement our own. Create variables and connections according to the picture on the right.
+
+Use the following equations for variables:
+
+<pre>
+ProjectIsReady
+Initial value: 0
+
+ProjectReadyness
+= (xidz(WorkDone, ProjectWorkAmount, 0.0) - ProjectIsReady) / 0.08
+</pre>
+
+xidz is short for function X if devided by zero. This means that the simulation calculates ''WorkDone / ProjectWorkAmount''. If ProjectWorkAmount is zero, the result is the third argument ''0.0''.
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/ProjectWorkAmount.png">
+ <p class="imageText">ProjectWorkAmount input variable</p>
+</div>
+
+As you can see, ProjectWorkAmount is highlighted. Your model doesn't contain such variable and it is not connected to ProjectReadyness. Create an Input variable ProjectWorkAmount with default value 1000 and connect it to ProjectReadyness. The reason we are using input variable is that you can determine the default size of a project, but if you want to change it, you can change it from outside the module.
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/ErrorsVariables.png">
+ <p class="imageText">Variables needed for error handling</p>
+</div>
+
+Next we need to define how errors are found. For that we need new variables: WorkQuality and ErrorsFoundTime. Create the variables and connections according to the picture and give variables their equations.
+
+<pre>
+ErrorsGenerated
+= (1-WorkQuality) * WorkingSpeed
+
+ErrorsFoundRate
+= Errors/ErrorsFoundTime
+
+WorkQuality
+= 0.9
+
+ErrorsFoundTime
+Type: WithLookup
+With Lookup: xidz(WorkDone, ProjectWorkAmount, 0.0)
+Lookup table: {{0,5},{0.5,3},{1,0.5},{2,0.5}}
+</pre>
+
+WithLookup is a variable type where the value is interpolated from a 2-dimensional table (Lookup table) using the value determined in the "With Lookup" field. Type can be changed from the drop-down menu Type.
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/WorkAllocation.png">
+ <p class="imageText">WorkAllocation and RequiredWorkingSpeed</p>
+</div>
+
+To calculate our own need for workforce we need to create and connect WorkCompletionTime input variable and the following auxliary variables:
+
+<pre>
+RequiredWorkingSpeed
+= if ProjectIsReady < 1 then xidz(WorkToDo, TimeToDeadline, MaximumWorkingSpeed) else 0
+Is Output
+
+MaximumWorkingSpeed
+= 500
+
+TimeToDeadline
+= max(0, WorkCompletionTime-time)
+</pre>
+
+time is a universal variable that gives the current simulation time.
+
+We need to decide how the workforce is allocated between all the work modules that are using the same workforce. For that we need to know how much work can be done and how much workforce other works require.
+
+Create two Inputs, RequiredWorkingSpeedTotalInput and PossibleWorkingSpeedInput, and an auxiliary variable WorkAllocation. Connect the variables like int the picture.
+
+<pre>
+WorkAllocation
+= xidz(RequiredWorkingSpeed, RequiredWorkingSpeedTotalInput, 0.0) * PossibleWorkingSpeedInput
+</pre>
+
+Finally let's give initial values for all the remaining variables:
+
+<pre>
+WorkingSpeed
+= if ProjectIsReady < 1 then WorkAllocation else 0
+
+WorkToDo
+Initial value: ProjectWorkAmount
+
+WorkDone
+Initial value: 0
+
+Errors
+Initial value: 0
+</pre>
+
+## Connecting modules
+<div outputclass="hr"/>
+
+Our modules are complete. Let's get back to the WorkModel Configuration.
+
+<pre>
+Set Work1CompletionTime to 10.
+</pre>
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/ModuleConnections1.png">
+ <p class="imageText">Module input connections</p>
+</div>
+
+Connections between modules are made in the properties of the module. Select Work1 and open tab Inputs from the properties. The table lists all input variables in the module that are available. Clicking on the Refers to output column will open a drop-down menu that shows all available variables that are connected to the module. By selecting a variable, you connect that variable to the input.
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/ModuleConnections2.png">
+ <p class="imageText">Module input connections</p>
+</div>
+
+Work1 need also information on how much working speed is required by all works. Since Work1 is the only work, create a dependency connection from RequiredWorkingSpeed1 to Work1 and in Work1's properties connect it to RequiredWorkingSpeedTotalInput.
+
+In Outputs tab, make the only possible connection: from RequiredWorkingSpeed to RequiredWorkingSpeed1.
+
+Workforce module has only one input and one output. Create the only possible connections:
+(Inputs) RequiredWorkingSpeedInput -> RequiredWorkingSpeed1
+(Outputs) PossibleWorkingSpeed -> TotalPossibleWorkingSpeed
+
+Now your model is ready for simulation!
+
+## Simulating the model
+<div outputclass="hr"/>
+
+To make the simulation time longer, select Configuration on the model browser. Give the model Stop time 24.0
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/ActivateExperiment.png">
+ <p class="imageText">Experiment activation</p>
+</div>
+
+To run simulations, you must activate an experiment. Expand the experiments folder on your model browser. There is one ready-made experiment. Double click on the experiment and the experiment control buttons appear on the toolbar. To simulate the model, press the play button: <div class="image">
+ <img src="AdvancedTutorialImages/ExperimentPlay.png">
+</div>
+
+System shows the simulation progress in the progress bar on the lower right corner of the screen.
+
+<div class="image">
+ <img src="AdvancedTutorialImages/SimulationProgress.png">
+</div>
+
+When the progress indicator disappears, the simulation is complete.
+
+If the Console view pops up and shows an error "Error: Too few equations, underdetermined system. The model has X equation(s) and Y variable(s)", the simulation has failed. The reason might be that you forgot to assign an equation to some variable or some connection in modules. See through all the variables, write the missing equation and simulate again.
+
+After the simulation is succesfully run, you can select a variable and see its simulation results in the trend view. For example WorkDone variable in Work1 module will give the following graph.
+
+<div class="image">
+ <img src="AdvancedTutorialImages/FirstSimulation.png">
+</div>
+
+## Adding modules
+<div outputclass="hr"/>
+
+<div class="imageBorder">
+ <img src="AdvancedTutorialImages/ModulesFinal.png">
+ <p class="imageText">Final configuration with two modules</p>
+</div>
+
+We created the WorkModule to be reusable. To use two WorkModules in the model, you must do the following.
+
+Populate a second WorkModule to WorkModel configuration and name it Work2.
+
+Create RequiredWorkingSpeed2 input variable and Work2CompletionTime auxiliary variable.
+
+We need a sum of all working speed requirements to give to the work modules. For this purpose, create an auxiliary variable RequiredWorkingSpeedTotal which sums the requirements.
+
+You can also have a different size work. To make Work2 smaller, create an auxiliary variable Work2Amount.
+
+Use the following equations:
+
+<pre>
+Work2CompletionTime
+= 13
+
+Work2Amount
+= 800
+
+RequiredWorkingSpeedTotal
+= RequiredWorkingSpeed1 + RequiredWorkingSpeed2
+</pre>
+
+Update connections to match connections shown in the picture and connect the inputs and outputs to the modules.
+
+<pre>
+Workforce
+RequiredWorkingSpeedInput -> RequiredWorkingSpeedTotal
+
+Work1 Inputs
+RequiredWorkingSpeedTotalInput -> RequiredWorkingSpeedTotal
+
+Work2 Outputs
+RequiredWorkingSpeed -> RequiredWorkingSpeed2
+
+Work2 Inputs
+</pre>
+
+<div class="image">
+ <img src="AdvancedTutorialImages/Module2Inputs.png">
+</div>
+
+When all the connections are made, you can simulate the model again. Now you have model with two work modules. Select variables from both modules in model browser to display them in trend view.
+
+<div class="image">
+ <img src="AdvancedTutorialImages/SecondSimulation.png">
+</div>
--- /dev/null
+# Tutorial: Basic System Dynamics Modelling
+<div outputclass="hr"/>
+
+* [1 Model](#model)
+* [2 Configuring the model structure](#configuring-the-model-structure)
+* [3 Equations](#equations)
+* [4 Simulating the model](#simulating-the-model)
+
+This tutorial introduces you to the basic components and concepts of the System dynamics modelling tool for Simantics. After completing this tutorial, you know how to configure and simulate a system dynamics model. An [advanced tutorial](AdvancedTutorial.md) is also available. This tutorial is part of the [sysdyn documentation](sysdyn.md).
+
+## Model
+<div outputclass="hr"/>
+
+We are going to create a simple population model. The model consists of the basic components: Auxiliaries, valves, stocks, dependencies and flows.
+
+Start by creating a new model. Right-click on the model browser and select New -> Model.
+
+<div class="imageBorder">
+ <img src="BasicTutorialImages/NewModel.png">
+ <p class="imageText">Creating a new model</p>
+</div>
+
+Rename the model to Population. Right-click on Model1 and select Rename.
+
+Expand the model tree and double-click on Configuration. The model configuration diagram opens in a new editor.
+
+## Configuring the model structure
+<div outputclass="hr"/>
+
+Our model is now empty. Let's build a population model for mice.
+
+Open Symbols view and expand BasicSymbols. If BasicSymbols are not visible, make sure that you have the diagram open. The contents of the Symbols view depends on the active diagram editor.
+
+<div class="imageBorder">
+ <img src="BasicTutorialImages/SymbolsView.png">
+ <p class="imageText">Symbols view</p>
+</div>
+
+These are the basic symbols in System dynamics modelling. We will use these to create the model.
+
+Drag one stock variable from Symbols view to the diagram. You can zoom and move on the diagram using [shortcut keys](sysdyn.md#shortcut-and-control-keys)
+
+Select the variable. Properties view on the bottom of the screen shows the properties of the selected variable. Change the name to Mice and press enter.
+
+<div class="imageBorder">
+ <img src="BasicTutorialImages/Mice.png">
+ <p class="imageText">Stock variable Mice</p>
+</div>
+
+Next we will draw flows in and out of Mice. Drag one cloud variable from Symbols view to the left hand side of Mice. Hold down Alt and right-click on the cloud. Move cursor on top of Mice and left-click. The system creates a flow from the cloud to Mice and a valve in the middle of the flow. The valve controls the speed of the flow. Flow from Mice is created the same way. Drag one cloud variable from Symbols view to the right hand side of Mice. Hold down Alt and right-click on Mice. Move cursor on top of the cloud and left-click. Rename the valves to MouseBirths and MouseDeaths.
+
+<div class="imageBorder">
+ <img src="BasicTutorialImages/MiceFlows.png">
+ <p class="imageText">Flows in and out of Mice</p>
+</div>
+
+Of course mice are not alone in the world. There are also owls that hunt mice. Create a similar structure below mice for owls.
+
+<div class="imageBorder">
+ <img src="BasicTutorialImages/MiceAndOwls.png">
+ <p class="imageText">Owls and mice</p>
+</div>
+
+To control the births and deaths, we need auxiliary variables. Auxiliary variables can be dragged from Symbols view just like Stock variables. We need one variable for each valve to control it. Drag the variables and rename them according to the picture below.
+
+<div class="imageBorder">
+ <img src="BasicTutorialImages/Auxiliaries.png">
+ <p class="imageText">Auxiliaries for valves</p>
+</div>
+
+Arrow connections, dependencies, are created almost like flows. The difference is that the connection is started and ended with a left click and the connection can only be made between two existing variables. Connect the auxiliary variables and valves like in the picture below.
+
+<div class="imageBorder">
+ <img src="BasicTutorialImages/Dependency_connections.png">
+ <p class="imageText">Dependency connections</p>
+</div>
+
+## Equations
+<div outputclass="hr"/>
+
+As you can see from the model, we have made some shortcuts in our model to make it more simple. In reality, there are lots of other factors that affect mouse and owl populations. Let's however use this model as an example.
+
+For the model to be simulated, each variable needs to have an equation. Equations can be configured from the property view, like the names. Input the following equations into the corresponding variables:
+
+<pre>
+MouseBirths
+= MouseBirthRate * Mice
+
+MouseDeaths
+= Mice * MouseDeathsDueToOwls * Owls
+
+OwlBirths
+= OwlsFromMice * MouseDeaths
+
+OwlDeaths
+= OwlDeathRate * Owls
+
+MouseBirthRate
+= 0.04
+
+MouseDeathsDueToOwls
+= 0.0005
+
+OwlsFromMice
+= 0.1
+
+OwlDeathRate
+= 0.09
+</pre>
+
+Finally we need initial values for our populations.
+
+<pre>
+Mice
+Initial Value: 700
+
+Owls
+Initial Value: 10
+</pre>
+
+## Simulating the model
+<div outputclass="hr"/>
+
+<div class="imageBorder">
+ <img src="BasicTutorialImages/ActivatePopulationExperiment.png">
+ <p class="imageText">Experiment activation</p>
+</div>
+
+Now the model is configured and ready for simulation. Switch Symbols view back to Model Browser. Expand the Experiments folder on your model and double-click on Experiment. This activates the experiment. Experiment needs to be active before the model can be simulated. Experiment activations adds experiment control buttons to the toolbar. To simulate the model, press the play button: <div class="image">
+ <img src="BasicTutorialImages/ExperimentPlay.png">
+</div>
+
+System shows the simulation progress in the progress bar on the lower right corner of the screen.
+
+<div class="image">
+ <img src="BasicTutorialImages/SimulationProgress.png">
+</div>
+
+When the progress indicator disappears, the simulation is complete.
+
+After the simulation has run, you can select variables from the diagram or model browser and their values over the simulation time will be shown on Trend View. You can select multiple variables from the diagram by holding down Ctrl key. Select Mice and Owls.
+
+<div class="imageBorder">
+ <img src="BasicTutorialImages/MiceAndOwlResults1.png">
+ <p class="imageText">Results for Mice and Owls</p>
+</div>
+
+As you can see, the simulation is complete, but the results do not reveal any interesting behavior. Let's extend the simulation time.
+
+Select Configuration from the model browser. In the properties-view change stop time to 300.0 and simulate again.
+
+After the simualtion is complete, Select Mice and Owls again.
+
+<div class="imageBorder">
+ <img src="BasicTutorialImages/MiceAndOwlResults2.png">
+ <p class="imageText">Results for Mice and Owls, Extended simulation time</p>
+</div>
+
+Now the simulation reveals the traditional behavior of predator-prey models. Feel free to adjust the parameters and try the simulations again.
--- /dev/null
+# Simantics System Dynamics
+
+## Contents
+
+* [1 What is Simantics System Dynamics](#what-is-simantics-system-dynamics)
+* [2 Introduction to System Dynamics Simulation](#introduction-to-system-dynamics-simulation)
+ * [2.1 System Dynamics](#system-dynamics)
+ * [2.2 Model](#model)
+ * [2.3 Components](#components)
+ * [2.4 Modeling Principles](#modeling-principles)
+* [3 Installation Instructions](#installation-instructions)
+* [4 Workbench](#workbench)
+ * [4.1 Global Preferences](#global-preferences)
+* [5 Modelling](#modelling)
+ * [5.1 Basic Modelling](#basic-modelling)
+ * [5.2 Model Properties](#model-properties)
+ * [5.3 Special Variables](#special-variables)
+ * [5.3.1 WithLookup](#withlookup)
+ * [5.3.2 Delay](#delay)
+ * [5.4 Shortcut and Control Keys](#shortcut-and-control-keys)
+ * [5.5 Unit Validation](#unit-validation)
+ * [5.6 Diagram Profiles](#diagram-profiles)
+* [6 Visual model elements](#visual-model-elements)
+ * [6.1 Fonts and colors](#fonts-and-colors)
+ * [6.2 Dependency properties](#dependency-properties)
+ * [6.3 Loops](#loops)
+ * [6.4 Comments](#comments)
+* [7 Simulation](#simulation)
+ * [7.1 Experiments](#experiments)
+ * [7.2 Solvers](#solvers)
+* [8 Simulation Result and Model Structure Analysis](#simulation-result-and-model-structure-analysis)
+* [9 Custom Charts](#custom-charts)
+ * [9.1 Line Chart](#line-chart)
+ * [9.2 Sensitivity Chart](#sensitivity-chart)
+ * [9.3 Bar Chart](#bar-chart)
+ * [9.4 Pie Chart](#pie-chart)
+ * [9.5 Chart Panel](#chart-panel)
+* [10 Multidimensional Variables](#multidimensional-variables)
+ * [10.1 Modeling](#modeling)
+ * [10.2 Expressions](#expressions)
+ * [10.3 Array Slices](#array-slices)
+ * [10.4 Arithmetic Operators](#arithmetic-operators)
+ * [10.5 Builtin Modelica Functions](#builtin-modelica-functions)
+ * [10.6 Simulation Results](#simulation-results)
+ * [10.7 Array Variables in Modules](#array-variables-in-modules)
+* [11 Functions](#functions)
+ * [11.1 Creating Functions](#creating-functions)
+ * [11.2 Function Libraries](#function-libraries)
+ * [11.3 External Functions](#external-functions)
+ * [11.4 Modelica Functions](#modelica-functions)
+* [12 Spreadsheets](#spreadsheets)
+ * [12.1 Variable Values](#variable-values)
+ * [12.2 History Data](#history-data)
+* [13 Vensim Model Import](#vensim-model-import)
+* [14 Sample Models and Molecules](#sample-models-and-molecules)
+
+# What is Simantics System Dynamics
+<div outputclass="hr"/>
+
+*Simantics System Dynamics* is currently the only open source modelling and simulating tool for Simantics. Simantics System Dynamics is under development and will go through some changes in the future. New features will be added and old ones improved according to the needs of the modellers.
+
+This documentation introduces you to the current version of Simantics System Dynamics. Documentation includes the basic modelling principles and a guide on how to model system dynamics models with Simantics System Dynamics. If you like to get to know the tool better and try modelling and simulating yourself, [install](#installation-instructions) the software and try our [basic](BasicTutorial.md) and [advanced](AdvancedTutorial.md) tutorials!
+
+# Introduction to System Dynamics Simulation
+<div outputclass="hr"/>
+
+## System Dynamics
+
+System dynamics is an approach to understanding different organizations, markets and other complex systems and their dynamic behavior. Simantics System Dynamics is a free modelling tool for system dynamics modeling and simulation. See [installation instructions](#installation-instructions).
+
+## Model
+
+System dynamics model is generally understood as the model configuration. In this tool, the model contains also other components: [Experiments](#experiments) are the way to simulate the model. You can have experiments with different configurations, for example different initial values for some parameters. In that way, you don't have to always configure the model for different scenarios. [Module types](#basic-modelling) allow user to create reusable component types which can be instantiated as Modules. The Modules folder contains all the different module types in your model and you can create new module types there. The [Functions](#functions) folder contains built-in and user-defined functions.
+
+<div class="imageBorder">
+ <img src="Images/ModelStructure.png">
+ <p class="imageText">Model structure</p>
+</div>
+
+## Components
+
+Most of the components you can use in your models are basic system dynamics components. The modularity of the models introduces two additional components, Modules and Inputs. All the components are explained below.
+
+<div class="imageBorder">
+ <img src="Images/ComponentTypes.png">
+ <p class="imageText">Component types</p>
+</div>
+
+**Auxiliary**
+
+Auxiliary is the most basic variable you can use. It represents a single value or a mathematical expression. There are different types of auxiliary variables currently in the system: *Auxiliary*, *Parameter*, *Constant*, [*Delay*](#delay) and [*WithLookup*](#withlookup). Auxiliary is the default type. Parameters are static values that the user can change. When only parameters are changed, the model simulates faster, because the system does not have to recompile the model. WithLookup and Delay are special variables. WithLookup has an expression and a lookup table. The expression defines what value is taken from the defined table. Delay variable delays an equation a given time with a given delay order.
+
+**Dependency**
+
+Dependency is an arrow that connects two components. It means that the value of the variable from which the arrow starts is used to calculate the value of the variable where the arrow ends. Dependencies that are used for a stock initial value only are colored grey by default, in contrast to the regular blue dependency arrows.
+
+**Flow**
+
+Flow connects clouds, valves and stocks. Flow represents an actual flow of something from stocks or clouds to stocks or clouds. There has to be at least one valve in a flow and the system creates it automatically, if none of the ends of the flow is a valve.
+
+**Valve**
+
+Valve regulates the rate of a flow. The value of a valve is automatically used in calculating the level of an adjacent stock. Valves behave just like Auxiliary variables but look different and you can connect also flows to them.
+
+**Stock**
+
+The value of a stock variable is an integral of flows leaving and flows arriving to the variable. The integral is calculated automatically from the valves that are connected to the variable with flow connections. Alternatively, the equation that is integrated can be defined manually by user. A stock must be given an initial value. Initial value can be a single value or an equation. You can use values of other variables to calculate the initial value.
+
+**Cloud**
+
+Cloud is not a variable. It represents a starting or ending point of a flow, if it is not in the scope of the model.
+
+**Module**
+
+Modules enable structural modeling. Modules are defined just like the basic model configuration, but the module component hides the actual configuration. You can only connect dependency connections into the module and dependency connections from the module must end to Input variables. The interface of the module is defined using input and output variables in the configuration of the module. All variable types can be set as output variables. If a variable is an output variable, its font is bold.
+
+**Input**
+
+Input variables are the way of getting values from other modules. Inputs look like auxiliary variables except their font is italics. You can set a default value to the input variable in case it is not connected to any variable. Connections are made from the modules properties, when the module is populated. Input doesn't have to be connected with an arrow to a module. If the variable has no connections, it can get values from a higher level in the hierarchy. If an input is connected to an output, the output and its module are shown below the variable using dot notation.
+
+**Shadow**
+
+A shadow variable is a reference to a variable defined elsewhere on the diagram. The referred variable can be an auxiliary, a valve, a stock, or an input. Dependency and flow arrows can be drawn out of a shadow variable, but no arrows can be drawn into a shadow variable. Shadow variables are used to improve the readability of the model.
+
+**Loop**
+
+A loop element is a graphical component for highlighting selected feedback loops in a model.
+
+**Comment**
+
+A comment element is a string of text on diagram.
+
+## Modeling Principles
+
+System dynamics modelling is much more than just mathematical formulas and nice graphs. Models are ways of communicating. There are some basic principles in system dynamics modelling that make the models easier to read and understand. You do not have to apply these principles to simulate models, but using them makes it easier for you to communicate your model to others.
+
+**Variable names**
+
+Variables names should be nouns, not verbs. The names should be positive: for example it is easier to understand that satisfaction decreases than dissatisfaction rises. Variable names can and should have multiple words, if they are needed. Note that due to the reserved words in Modelica, variable names such as *Carbon in Atmosphere* cannot be used (*in* is a reserved word). Capitalizing the reserved (*in* --> *In*) word can be used to sidestep the problem.
+
+**Connections**
+
+You should usually try to avoid overlapping dependency arrows. Organizing the variables on the diagram and using shadow variables can be used for that purpose. Dependencies should also form distinctive loops, if there is a loop. It makes it easier to read and understand the model and its behavior.
+
+**Graphical annotations**
+
+System dynamics contains usually annotations for loops, polarities, delays and so on. Annotations are important, for communicating the behavior of the model.
+
+# Installation Instructions
+<div outputclass="hr"/>
+
+System dynamics tool is provided with the Simantics platform.
+
+1. [Download installer from the tool's download page](http://sysdyn.simantics.org/)
+2. Install the program to a directory without spaces (limitation inherited from OpenModelica).
+3. Run the application through the launcher generated by the installer
+
+ (default: Simantics\Simantics-1.8.0-Sysdyn-32\Simantics-1.8.0-Sysdyn-32)
+
+[OpenModelica](http://www.openmodelica.org/) is used to build and simulate the models. Simantics platform has integrated OpenModelica 1.9.0 beta4 for Windows environments. For other versions and other environments you need to install [OpenModelica](https://www.openmodelica.org/download/download-windows). In addition to OpenModelica, a development version of a [purpose-built Modelica solver](#solvers) is embedded in the tool.
+
+# Workbench
+<div outputclass="hr"/>
+
+<div class="image">
+ <img src="Images/BasicWorkbench.png">
+</div>
+
+1 **Diagram**
+
+Diagram is the area where you will graphically modify your model. Diagrams are built from elements that can be dragged from Symbols view or populated using shortcut keys.
+
+2 **Model Browser**
+
+Model browser shows the structure of your model and all items related to it.
+
+**Symbols**
+
+Symbols view (stacked with the model browser) is used for dragging elements to diagrams.
+
+**Search**
+
+Search view (stacked with the model browser) is used for searching elements in all models. Search can be launched also from the search field in the bottom right corner or by Ctrl+F.
+
+3 **Properties**
+
+Property view shows the selected variable's properties. Property view has a different layout depending on the type of the selected component. The view can also have different tabs depending on the component type. Basic tabs for variables are Equation, Indexes, and Additional information.
+
+**Console**
+
+Console view (stacked with the property view) shows console messages from the simulator. Console can be used for debugging models simulated using OpenModelica.
+
+**Issues**
+
+Issue view (stacked with the property view) shows the errors and warnings in all models.
+
+**Profiles**
+
+[Profiles](#diagram-profiles) view (stacked with the property view) allows enabling/disabling some visual diagram effects.
+
+**Trend**
+
+[Trend](#simulation-result-and-model-structure-analysis) view shows the graphical representation of the values of the selected value over time. For the trend to be shown, a simulation has to be run. The view shows always the results of the latest run, but you can save results of a simulation and show them in the same trend with results from another simulation.
+
+**Structure**
+
+The [structure](#simulation-result-and-model-structure-analysis) view (stacked with the trend view) can be used for analyzing the varaible dependencies, loops, and the structure of the model.
+
+**Values**
+
+The [values](#simulation-result-and-model-structure-analysis) view (stacked with the trend view) shows the values of the selected value over time. For the values to be shown, a simulation has to be run.
+
+5 **Save and save as...**
+
+Save buttons can be used to export the selected model as .sysdyn file. The buttons save that model which is selected in the model browser or, if the focus is on the diagram, the model that is currently open on the diagram.
+
+6 **Diagram tool mode**
+
+With the diagram tool mode, you can select how the elements on the diagram are edited. The Lock mode prohibits editing diagram elements, the pointer mode allows moving and editing diagram elements, and with the dependency and flow modes arrows can be drawn using only mouse1 and mouse2.
+
+7 **Experiment controls**
+
+Experiment controls are shown when an experiment is active. Experiment is activated by double clicking an experiment in the model browser. With the experiment control, you can start simulation runs and save simulation results.
+
+8 **Perspectives**
+
+Perspectives allow changing between different layouts of the views. On start-up, only the default perspective is open. Try adding the two predefined perspectives by clicking the Open Perspective button: <div class="image">
+ <img src="Images/OpenPerspective.png">
+</div>
+
+9 **Chart Panel**
+
+[Chart panel](#chart-panel) is able to house multiple [charts](#custom-charts) at the same time. Charts are added to the panel by dragging from model browser.
+
+**TIP!** If you accidentally close a view, you can reopen them from Window->Show View->Other...
+
+**TIP!** Try dragging the views to different positions (e.g. the property view to the right pane).
+
+## Global Preferences
+
+Global preferences of Simantics System Dynamics are located under Window -> Preferences. Feel free to browse the contents yourself. A few notable items on the list are described below.
+
+<div class="image">
+ <img src="Images/Preferences.png">
+</div>
+
+**Category** | **Description**
+--- | ---
+**General -> Keys** | All [keyboard shortcuts](#shortcut-and-control-keys) available.
+**Modelica** | The location of OpenModelica solver on file system.
+**Solver** | [Solver](#solvers) to be used for simulation. OpenModelica or internal custom solver (experimental) can be selected.
+**Sysdyn Diagrams** | Sysdyn Diagrams allows customize default colors and fonts of diagram elements.
+
+# Modelling
+<div outputclass="hr"/>
+
+## Basic Modelling
+
+Basic modelling functions enable you to create and configure models. System dynamics modeling is basically pretty simple, so with these instructions you can build small and also very large models. The tricky part is writing all the expressions and adjusting the model so that it actually tells you something.
+
+<div class="image">
+ <img src="Images/Basic_1.png">
+</div>
+
+**Creating a new model**
+
+Start a new model by right-clicking the model browser and selecting New -> Model or from the main menu File -> New -> SD Model.
+
+<div class="image">
+ <img src="Images/Basic_2.png">
+</div>
+
+**Creating a new module type**
+
+Create a new module type by right-clicking on the Modules-folder and selecting New -> Module type. This creates a new module type that you can populate to your other modules and the model configuration.
+
+**Configuring a model**
+
+Model configuration can be opened by double clicking Configuration in the model browser.
+
+**Configuring modules**
+
+Configuration of a module type can be opened by double clicking the module type you want to configure. You can also open the configuration of a module from a diagram, when a module has been populated to that diagram, by right-clicking the module and selecting Show Module. When opening modules from diagram, the opened diagram knows to which diagram the module has been populated and can show the connections between the modules. Keep in mind that when making changes to a module, the changes apply to all instances of the respective module type!
+
+**Populate variables**
+
+You can drag variables to a diagram from symbol view. You can also populate variables using [shortcut keys](#shortcut-and-control-keys). Variables can be divided into multiple lines by resizing the variable on diagram.
+
+**Populate modules**
+
+Modules are populated from the model browser. Just drag the module you want to populate from the Modules folder to a diagram.
+
+**Create connections**
+
+There are two types of connections: dependencies and flows. Both are created basically the same way. Hold Alt down and click on a variable. Left click starts a dependency, right click starts a flow. Both are ended to another variable with a left click. Dependencies and flows can also be created without Alt key by selecting dependency or flow mode on the toolbar.
+
+Flows can also be started and ended to an empty spot in the diagram. If there is no start or end variable, a cloud will be created. Also if start or end is not a valve, a new valve is created in the middle of the flow.
+
+There are some restrictions on what connections can be made, but don't worry, the user interface won't let you do connections that are not allowed.
+
+**Connections between modules**
+
+**Outside the module**
+
+You can connect variables to variables in modules like this:
+<pre>
+MODULE -----> INPUT
+or
+ANY VARIABLE -----> MODULE
+</pre>
+
+This is just the visual configuration, but you need those connections to really connect variables in the module's properties.
+
+In the *Inputs* tab stacked under *Module Properties* you can select which variables you connect to inputs inside the module. In the *Outputs* tab you can select which variables you lift from the module to inputs outside it.
+
+**Inside the module**
+
+Input variables get values from outside the module
+
+Output variables can send their values outside the module. From the variable properties, select Additional Information and press Is Output
+
+**Configure variables**
+
+Select a single variable from diagram or model browser. The properties of the variables are shown in the equation view and you can modify them.
+
+**Export model**
+
+To export your model to a file, select your model from the model browser, right-click and from the context menu choose Export->Model. Select the folder where to export your model, give the file a name and press Save. You do not need to export a model to Save it, the model is automatically saved in your database. Export can be used, for example, to create different versions of a model, create backups or to transport a model to another database.
+
+**Import model**
+
+Right-click on the model browser and select Import->Model. Browse to your .sysdyn file and select open. The model is added to your model browser.
+
+**Export module**
+
+To export a module to a file, select the module from the model browser, right-click and from the context menu choose Export->Module. Select the folder where to export your model, give the file a name and press Save. Module export can be used, for example, to transport a module to another model or another database.
+
+**Import module**
+
+Right-click the Modules folder of a model and select Import->Module. Browse to your .sysdynModule file and select open. The module is added to your model.
+
+## Model Properties
+
+Model properties can be viewed by selecting either the model or its configuration on the model browser.
+
+<div class="image">
+ <img src="Images/ModelProperties.png">
+</div>
+
+**Property** | **Description**
+--- | ---
+**Name** | The name of the model
+**Start time** | The start time of the simulation.
+**Stop time** | The stop time of the simulation.
+**Step length** | The length of the simulation step.
+**Output interval** | Interval of witch the simulation result is presented. If the field is left empty, all steps of the output are presented.
+**Method** | The simulation solver (only OpenModelica).
+**Validate units** | [Unit validation](#unit-validation) on/off. If unit validation is enabled, the unit of the simulation time is selected from the pull-down menu.
+**Unit equivalents** | Define if different forms of predefined units are considered equal (e.g. dollars = dollar = $) in unit validation.
+**Tolerance** | Integrator error tolerance (only OpenModelica)
+**Variable filter** | Define which variables are presented (only OpenModelica)
+
+## Special Variables
+
+Auxiliary and valve variables have two special types: WithLookup and Delay. These types are selected from Type drop down menu in the variable's properties. The variable types offer more specific functionalities than normal variables, but the same functionality could be achieved using normal variables.
+
+### WithLookup
+WithLookup variable has two equation fields, WithLookup and Lookup table. Lookup table has a table from which the value of the variable is interpolated using the value of WithLookup field.
+
+<div class="image">
+ <img src="Images/WithLookup1.png">
+</div>
+
+You do not need to manually input the Lookup table. WithLookup variable type offers an additional Lookup table tab in the property view. In this view you can add and modify points in the lookup table. Points can be added either by clickin on the chart or by using the input fields and Add button. Points can be modified by dragging them on the chart or modifying values in the table. Points are removed by clicking them with right mouse click.
+
+<div class="image">
+ <img src="Images/WithLookup2.png">
+</div>
+
+### Delay
+Delay variables build equations for Nth order delays. Users can set the equation for the value that is to be delayed, the time and order of the delay and a possible start value. If start value is empty, the start value is set automatically.
+
+<div class="image">
+ <img src="Images/Delay1.png">
+</div>
+
+Different order delays have slightly different curves when a step change is triggered. The example picture below shows a step change from 0 to 1 at time 1 with four different delays: 1st, 2nd, 3rd and 10th order delays.
+
+<div class="image">
+ <img src="Images/Delay2.png">
+</div>
+
+For further information on how the delays work, you can look at the equations that are created by the delay variable. Below is a third order delay. Delay3 is the actual variable that is seen by users. DelayClass has as many level (LV) variables as the order of the delay is.
+
+Definitions:
+<pre>
+Real Delay3;
+Delay3_delayClass Delay3_delayClass_instance(initialValue = 0, delayTime = 1);
+class Delay3_delayClass
+ parameter Real DL = delayTime/3;
+ parameter Real delayTime;
+ parameter Real initialValue;
+ Real delay0;
+ Real LV1(fixed=true, start=initialValue * DL);
+ Real delay1;
+ Real LV2(fixed=true, start=initialValue * DL);
+ Real delay2;
+ Real LV3(fixed=true, start=initialValue * DL);
+ Real delay3;
+equation
+ der(LV1) = - delay1 + delay0;
+ delay1 = LV1 /DL;
+ der(LV2) = - delay2 + delay1;
+ delay2 = LV2 /DL;
+ der(LV3) = - delay3 + delay2;
+ delay3 = LV3 /DL;
+end Delay3_delayClass;
+</pre>
+
+The above definitions can be seen as a line of stocks and valves. The first valve, delay0, is given the value of the delayed expression. Delay3 is given the value of the valve that is coming from the last stock.
+
+Equations:
+<pre>
+Delay3_delayClass_instance.delay0 = Step1;
+Delay3 = Delay3_delayClass_instance.delay3;
+</pre>
+
+## Shortcut and Control Keys
+
+Shortcut keys for configuring a model on diagram.
+
+Key | Action
+--- | ---
+Esc | Cancel operations (e.g. connection and rename).
+Shift + A | Hover Auxiliary at the cursor position, populate with left mouse button.
+Shift + S | Hover Stock at the cursor position, populate with left mouse button.
+Shift + C | Hover Cloud at the cursor position, populate with left mouse button.
+Shift + V | Hover Valve at the cursor position, populate with left mouse button.
+Shift + I | Hover Input at the cursor position, populate with left mouse button.
+Shift + G | Hover Shadow (Ghost) variable at the cursor position, populate with left mouse button.
+Alt + left mouse button | Start an arrow from a variable. End to another variable by clicking left mouse button.
+Alt + right mouse button | Start flow from a variable. End by clicking left mouse button. If a flow is not started or ended on to a variable, a cloud will be created to that end. If a new flow does not have a valve at either end, a valve will be created in the middle of the flow.
+Delete | Remove selected variables
+F2 | Rename selected variable
+Ctrl + left mouse button | Select multiple variables
+Mouse wheel or + or - | Diagram zoom
+drag(mouse3) | Diagram pan
+drag(shift + any mouse button) | Diagram pan
+↓, ←, ↑, → (arrow keys) | Diagram pan
+Ctrl + C | Copy selected elements
+Ctrl + X | Cut selected elements
+Ctrl + V | Paste copied or cut elements
+Ctrl + F | Find element in current diagram or all models
+G | Show / hide grid
+R | Show / hide ruler
+1 | Fit diagram contents to screen
+Ctrl + Space | Content assist in equation editor
+
+Other shortcut keys can be found selecting Window -> Preferences from the main menu. Keys are located in General -> Keys.
+
+## Unit Validation
+
+Unit validation is useful for finding errors in the model. With unit validation, the consistency of the measurement units of variables is checked. For unit validation, the units of all variables in the model must be defined. If a variable is dimensionless, use 1 as the unit. In certain constructs, a dimensionless variable can be used as "a wild card", e.g., adding a dimensionless variable with a dimensioned one is OK.
+
+Common error sources of unit validation include the following. The respective issues are shown in the picture below.
+
+<div class="image">
+ <img src="Images/UnitValidation.png">
+</div>
+
+* The equation of a variable yields a different unit than that defined for the variable.
+* Two variables which have different units are added (+), subtracted (-), or compared (>, <, =, ...).
+* The output unit of a function is used in an inconsistent manner. (The unit validation for the output unit of a function behaves equivalently to the unit of a variable.)
+* A function is called with an argument of a prohibited unit.
+* A variable has an empty unit.
+* A variable has a misspelled unit.
+
+Unit validation is enabled for a model by selecting the model or its configuration on the model browser and enabling "Validate units" on the properties tab. The unit warnings are shown on Issues view and, supposing the respective profile has been enabled, on the diagram as well. Warnings from unit validation do not prevent simulation.
+
+For models that have stocks (i.e., integration), the simulation time unit must be selected from the pull-down menu next to the "Validate units" checkbox in Model Properties tab.
+
+Unit validation can also cope with certain different forms of units, e.g., you can write dollars, dollar, or $ and the validator considers these equal. This functionality can be disabled from Model Properties tab checkbox "Unit equivalents".
+
+As there may be cases for which the unit validation is for some reason not working as desired, the unitCast() function can be used in the equation of a variable to cast the unit of any expression within the equation to a wildcard. E.g., if expression
+<pre>
+ Aux1 + time
+</pre>
+yields a warning, it can be fixed be changing the expression to
+<pre>
+ unitCast(Aux1) + time
+</pre>
+, in which case the unit of the expression is that of time, or to
+<pre>
+ Aux1 + unitCast(time)
+</pre>
+, in which case the unit of the expression is that of Aux1.
+
+## Diagram Profiles
+
+Diagram profiles allow selecting which visual effects are enabled. Currently the following profiles can be used:
+
+**Default**
+
+**Issue warnings**
+
+When enabled, an error or a warning symbol is attached to diagram elements in which there are errors or warnings (usually in the equations).
+
+**Shadow variable visualizations**
+
+When enabled, the original and all the shadow variables are highlighted when one is selected.
+
+**Simulation Playback**
+
+**Playback Colors**
+
+When enabled, colors of the elements on diagram change during a playback experiment.
+
+# Visual model elements
+<div outputclass="hr"/>
+
+The visual appearance of the elements on diagram can be modified in various ways. In addition, the tool offers are comment symbols which do not affect simulation but help the understandability of models.
+
+## Fonts and colors
+
+Fonts and colors of diagram elements can be changed by right-clicking the element and selecting Font... The default fonts and colors for each diagram element type can be changed in Window -> Preferences -> Sysdyn Diagrams.
+
+## Dependency properties
+
+Dependency arrow properties can be changed on the property view:
+
+**Polarity**
+
+Polarity sign can be used to indicate whether the dependency increases or decreases the variable it is pointing to. The polarities serve no function for simulation, however, they are used in loop type automatic determination.
+
+**Location**
+
+Location of the polarity mark
+
+**Arrowhead**
+
+Toggle for showing arrowhead
+
+**Delay mark**
+
+Delay mark is a visual cue for helping understandability of the dynamics of the model when there are (information) delays. A delay mark is usually added to the dependency arrow when the effect the tail of the dependency has on the head of the dependency is delayed.
+
+**Line thickness**
+
+Thickness of the arrow
+
+## Loops
+
+A loop element is a graphical component for highlighting feedback loops in a model. Usually the most interesting feedback loops that affect the behaviour of the model most are marked with a loop symbol.
+
+
+**Loop Items**
+
+The loop of variables which the loop symbol refers can be selected for visualization purposes.
+
+**Comment**
+
+Comment inside the loop. Usually characters 'B' and 'R' are used to denote balancing and reinforcing loops, respectfully. A feedback loop is reinforcing if and only if it has an even number of negative dependencies. Selecting 'Auto' determines automatically the type of the loop.
+
+**Direction of Rotation**
+
+Direction to which the loop rotates on diagram.
+
+## Comments
+
+Comments are just strings of text.
+
+# Simulation
+<div outputclass="hr"/>
+
+## Experiments
+
+There are three different ways for simulating a model. Different simulations are represented as different types of experiments in Simantics System Dynamics.
+
+Experiments are created from the context menu of experiments folder in a model.
+
+<div class="image">
+ <img src="Images/NewExperiment.png">
+</div>
+
+Double-click on an experiment activates it and displays experiment type specific controls in the main tool bar.
+
+**Normal simulation**
+
+Experiment is the basic simulation type. It simulates a model from start time to end time and results can be viewed after the simulation has been run.
+
+**Game simulation**
+
+Game simulations allow simulating an arbitrary number of steps, changing parameter values and continuing simulation with the new values from where it previously ended.
+
+**Simulation playback**
+
+Simulation playback works essentially as the basic experiment, but it offers some additional visualization options.
+
+**Sensitivity analysis simulation**
+
+Sensitivity analysis allows running [multivariate](http://en.wikipedia.org/wiki/Multivariate_analysis) [Monte Carlo simulations](http://en.wikipedia.org/wiki/Monte_Carlo_method) with different parameter value sets and to visualize how much the simulation result depends on changes in the selected parameters.
+
+<div class="image">
+ <img src="Images/SensitivityExperiment.png">
+</div>
+
+**General** | -
+--- | ---
+Name | The name of the sensitivity analysis experiment. Displayed in e.g. model browser.
+Number of runs | The total amount of individual simulation runs
+Method | The method of how the parameter values are selected from the distribution(s). Selecting "Random" yields [pseudo-random](http://en.wikipedia.org/wiki/Random_number_generation#.22True.22_random_numbers_vs._pseudo-random_numbers) values, i.e., randomly selected from the distribution(s). Selecting "Halton" yields a [quasi-random](http://en.wikipedia.org/wiki/Quasi-random) [Halton sequence](http://en.wikipedia.org/wiki/Halton_sequence) of values selected deterministically to represent the distribution(s) better than a pseudo-random series.
+Seed | The seed number for pseudo-random generator
+Add parameter | Adds a new parameter to be varied
+Remove | Removes a parameter
+**Parameter properties** | -
+Variable | The full path of the variable of which value is varied. This field has content assistant, which shows the possible variables as you type.
+Range | Used with multidimensional values to select which dimensions are varied.
+Distribution | Probability distribution for the varied parameter. "Normal" is for [truncated normal distribution](http://en.wikipedia.org/wiki/Truncated_normal_distribution) and "Uniform" for [uniform distribution](http://en.wikipedia.org/wiki/Uniform_distribution_(continuous)). With "Interval" the values have equal intervals between each other and are selected in increasing order. In multivariate sensitivity analyses, it is recommended to select either "Normal" or "Uniform".
+**Distribution properties** | -
+Min value | Minimum value of the distribution
+Max value | Maximum value of the distribution
+Mean | Mean of the normal distribution
+Standard deviation | Standard deviation of the normal distribution
+
+## Solvers
+
+Simantics System Dynamics allows using the multiple solvers provided by OpenModelica, like Euler, Runge-Kutta, DASSL, etc. OpenModelica is currently the main simulation environment behind the tool and all functionalities are supported with OpenModelica.
+
+Alternatively to OpenModelica, an internal custom Modelica solver is included in Simantics System Dynamics. The custom solver is currently at an experimental state, and thus all functionalities of the tool are not yet supported, e.g., only the basic experiment can be run with it. The advantage of the custom solver is, however, that simulation is usually a lot faster than with OpenModelica. Try out yourself which solver suits best for your needs.
+
+The solver can be changed in Windows -> Preferences -> Solver.
+
+# Simulation Result and Model Structure Analysis
+<div outputclass="hr"/>
+
+Simulation results can be viewed as trends in the trend view or as plain numbers in the values view. The views display results of variables that are selected in the workbench. Users can also create [custom charts](#custom-charts).
+
+Model structure can be examined in the Structure view. There are three options: dependency structures of individual variables, the complete hierarchy structure of the model, or the feedback loops which individual variables belong to.
+
+**Trend**
+
+Shows you the values of the selected variable(s) graphically over the simulation time. You can modify the trend and zoom it using the context menu (right-click) of the trend.
+
+<div class="image">
+ <img src="Images/Trend.png">
+</div>
+
+**Values**
+
+Shows you the values of the selected variable(s) in a table form. If the value has a star (*) at the end, it means that the value is an approximate. There is no value for that variable for the given time step. Selected values can be copied to other software in csv format.
+
+<div class="image">
+ <img src="Images/Values.png">
+</div>
+
+**Compare results**
+
+You can compare different results of the same model by saving simulation results and displaying the saved results side by side with other results. You can save your results after simulating by clicking the Save Results button:
+
+<div class="image">
+ <img src="Images/Saveresults.png">
+</div>
+
+on your experiment controls. The saved results appear to model browser under the active experiment. To show the results on trends and tables, right-click on the result and select Show on charts.
+
+<div class="image">
+ <img src="Images/CompareTrend.png">
+</div>
+
+**Dependencies**
+
+Dependencies display which variables affect and which are affected by the selected variable. The direction and number of steps that are traveled from the selected variable can be configured at the bottom of the view.
+
+<div class="image">
+ <img src="Images/Dependencies.png">
+</div>
+
+**Model Hierarchy**
+
+Model Hierarchy displays the hierarchical structure of the model. The module type where a selected variable is located is highlighted.
+
+<div class="image">
+ <img src="Images/ModelHierarchy.png">
+</div>
+
+**Loops**
+
+Loops display all feedback loops which the selected variable belongs to.
+
+<div class="image">
+ <img src="Images/Loops.png">
+</div>
+
+# Custom Charts
+<div outputclass="hr"/>
+
+Custom charts are user-defined displays of simulation result data. They can be used and re-used in various places. The four types of custom charts (line, sensitivity, bar, and pie charts) provide model developers means for examining and developing their models and communicating the simulation results to others.
+
+Custom charts are created to the Charts folder in model browser.
+
+<div class="image">
+ <img src="Images/NewChart.png">
+</div>
+
+Charts are configured the same way as variables: first select the chart from model browser and then configure it in the property view. Charts can be viewed in the same active trend view as any variable by selecting the chart from model browser. In addition to trend view, charts can be populated directly to the model diagram by dragging them from the model browser. Charts can also be added to a separate chart panel which can contain multiple charts.
+
+## Line Chart
+
+Line chart shows the time series of a variable. It is capable of displaying multiple multi-dimensional variables at the same time. Simulation playback mode adds a marker to the chart to display the current time in playback simulation. Below is an example chart and its settings.
+
+<div class="image">
+ <img src="Images/LineChart.png">
+</div>
+
+<div class="image">
+ <img src="Images/LineChartGeneral.png">
+</div>
+
+
+**General** | -
+--- | ---
+Name | The name of the chart. Displayed in e.g. model browser
+Title | The title of the chart. Displayed in the chart
+Type | Line chart (default) or area chart
+Hide | Options to hide chart grid, title or legend
+**X-axis** | -
+Variable | A variable that is used as the x-axis variable. The default variable is time and it needs not to be typed in the field.
+Label | Optional other label for the variable than its name
+Min | Minimum value of the x-axis
+Max | Maximum value of the x-axis
+Hide | Options to hide x-axis label, line, tick marks and tick labels
+
+<div class="image">
+ <img src="Images/LineChartAxisAndVariables.png">
+</div>
+
+**Variable** | -
+--- | ---
+Variable | The full path of the variable. This field has content assistant, which shows the possible variables as you type.
+Range | If the variable has multiple dimensions, this field allows to select, which dimensions are displayed. It is also possible to sum the variables in the dimensions.
+Label | Optional label for the variable. If label is empty, the variable name is displayed.
+Color | Color for the lines of this variable
+Line width | The width of the lines drawn for this variable
+
+There are also configuration options for y-axis. They are displayed when an axis is selected in the Axis and variables tab.
+
+**Y-axis** | -
+--- | ---
+Label | Label of the axis
+Min | Minimum value in the axis
+Max | Maximum value in the axis
+Color | The color of the axis lines, ticks and labels
+Hide | Options to hide parts of the axis: label, axis line, tick marks, tick labels
+
+## Sensitivity Chart
+
+Sensitivity chart shows the time series of a variable with confidence bounds. Below is an example chart and its settings. The general settings are defined similarly to those of a line chart explained above.
+
+<div class="image">
+ <img src="Images/SensitivityChart.png">
+</div>
+
+<div class="image">
+ <img src="Images/SensitivityChartAxisAndVariables.png">
+</div>
+
+**Axis and Variables** | -
+--- | ---
+Variable | The full path of the variable. This field has content assistant, which shows the possible variables as you type.
+Range | If the variable has multiple dimensions, this field allows to select, which dimensions are displayed. It is also possible to sum the variables in the dimensions.
+Display median | Display the median value of the variable at each time step.
+Confidence bounds and colors | The confidence bounds in percents and colors for them.
+
+There are also configuration options for y-axis. They are displayed when an axis is selected in the Axis and variables tab.
+
+**Y-axis** | -
+--- | ---
+Label | Label of the axis
+Min | Minimum value in the axis
+Max | Maximum value in the axis
+Color | The color of the axis lines, ticks and labels
+Hide | Options to hide parts of the axis: label, axis line, tick marks, tick labels
+
+## Bar Chart
+
+Bar charts display variables in a certain point in time. The point can be defined for the complete chart in chart's general settings and individually for each variable in variable's settings. If no time is defined, the last simulation step is shown in game or normal simulation mode. Playback mode displays the current playback time.
+
+<div class="image">
+ <img src="Images/BarChartGeneral.png">
+</div>
+
+**General** | -
+--- | ---
+Name | The name of the chart. Name is displayed in model browser.
+Title | The title of the chart. Title is displayed in the chart, if not hidden
+Type | Normal or stacked. Normal type displays all variables in separate bars. Stacked mode is able to display one-dimensional array variables in stacks.
+Time | A general time setting for the entire chart. The values at this time are displayed in the chart
+Hide | Option for hiding grid, title and Legend. Legend is hidden by default since it only contains the information that the current simulation is displayed.
+
+<div class="image">
+ <img src="Images/BarChartInDiagram.png">
+</div>
+
+Charts can be added to model diagrams simply by dragging the chart from model browser to diagram.
+
+<div class="image">
+ <img src="Images/BarChartVariable.png">
+</div>
+
+**Variable** | -
+--- | ---
+Add / Remove | Add or remove variables
+Variable | The full path of the variable. This field has content assistant, which shows the possible variables as you type.
+Range | If the variable has multiple dimensions, this field allows to select, which dimensions are displayed. It is also possible to sum the variables in the dimensions.
+Label | Optional label for the variable. If label is empty, the variable name is displayed
+Time | The time for which the value of this variable is displayed. If this is empty, a general (or default) value of the time is used.
+
+<div class="image">
+ <img src="Images/BarChartAxis.png">
+</div>
+
+**Domain axis** | -
+--- | ---
+Label | An optional label for x axis
+Label angle | Axis labels can be displayed in an angle. This value determines the angle in degrees.
+Color | The color of the axis line, tick lines and labels
+Hide | Options for hiding axis label, line, tick marks and tick labels
+**Range axis** | -
+Label | An optional label for y axis
+Min | Minimum value of y axis
+Max | Maximum value of y axis
+Color | The color of the axis line, tick lines and labels
+Hide | Options for hiding axis label, line, tick marks and tick labels
+
+## Pie Chart
+
+Pie charts display proportions of variables at a certain time. The time, similar to bar charts, can be configured for the whole chart and individually for each variable. If no time is configured, the value at the latest time step (or the time of simulation playback) is displayed.
+
+<div class="image">
+ <img src="Images/PieChartGeneral.png">
+</div>
+
+**General** | -
+---- | ---
+Name | The name of the chart. Displayed in e.g. model browser
+Title | Title The title of the chart. Displayed in the chart
+Time | A general time setting for the entire chart. The values at this time are displayed in the chart
+Hide | Options for hiding title, section labels and legend
+
+<div class="image">
+ <img src="Images/PieChartVariable.png">
+</div>
+
+**Variables** | -
+--- | ---
+Add / Remove | Add or remove variables
+Variable | The full path of the variable. This field has content assistant, which shows the possible variables as you type.
+Range | If the variable has multiple dimensions, this field allows to select, which dimensions are displayed. It is also possible to sum the variables in the dimensions.
+Label | Optional label for the variable. If label is empty, the variable name is displayed
+Color | Color for the sector of this variable
+Time | The time for which the value of this variable is displayed. If this is empty, a general (or default) value of the time is used.
+Exploded | If set, the sector(s) of the variable(s) are "exploded" away from the center of the pie chart
+
+<div class="image">
+ <img src="Images/PieChartChartPanel.png">
+</div>
+
+## Chart Panel
+
+Chart panel is able to house multiple charts at the same time. Chart panel is a normal view in the workbench, which means it can be resized and located anywhere in the workbench. Eclipse also allows detaching the tab completely from the workbench, which means that the chart panel can be dragged to another screen.
+
+<div class="image">
+ <img src="Images/ChartPanel.png">
+</div>
+
+Chart panel can be either horizontally or vertically oriented. Different orientations help in configuring the workbench perspective.
+
+<div class="image">
+ <img src="Images/ChartPanelOrientation.png">
+</div>
+
+Charts are added to the panel by dragging from model browser. The order of the charts is easily changed by dragging charts from their header. Charts can be minimized or completely removed from the buttons in their headers.
+
+By default, chart panel is hidden in the upper-right corner of the system dynamics perspective.
+
+# Multidimensional Variables
+<div outputclass="hr"/>
+
+## Modeling
+
+Models with multidimensional variables look just like any other models. The structure of the models is replicated givin multiple indexes to variables. For users with programming background, notation Variable[] may be familiar. In system dynamic modeling we need to give names to the indexes. Instead of using numbers to define the indexes, like in normal programming, we use enumerations. The steps to create a model with multidimensional variables are as follows (with examples):
+
+1 **Create the model structure**
+
+Model with multidimensional variables looks just like any other model.
+
+<div class="image">
+ <img src="Images/ModelWithMultidimensionalVariables.png">
+</div>
+
+2 **Create Enumerations and define the indexes**
+
+Enumerations are created by right-clicking configuration and selecting New->Enumeration.
+
+<div class="image">
+ <img src="Images/NewEnumeration.png">
+</div>
+
+Define enumeration indexes by adding as many indexes as you want. Rename the indexes by selecting them and then clicking on them again.
+
+<div class="image">
+ <img src="Images/DefineIndexes.png">
+</div>
+
+3 **Add Enumerations for variables**
+
+Select the variable that you want to be multidimensional. From the Indexes -tab in the property view, move the wanted enumerations to the right. The order of the enumerations does matter.
+
+<div class="image">
+ <img src="Images/SelectEnumerations.png">
+</div>
+
+4 **Define equations for all possible indexes**
+
+Multidimensional variable can be thought as a multidimensional table. Each cell of the table needs to have an expression or a value. A cell cannot have multiple definitions. All cells can be defined in one expression like in the following example. E1 and E2 have both three indexes, so the resulting definition can be {{1,2,3},{4,5,6},{7,8,9}}.
+
+<div class="image">
+ <img src="Images/DefineEquations.png">
+</div>
+
+## Expressions
+
+Values for all cells in the variable matrix can be defined in a single expression.
+
+<div class="image">
+ <img src="Images/DefineEquations.png">
+</div>
+
+<div class="image">
+ <img src="Images/DefineEquations2.png">
+</div>
+
+In many situations, it is however more clear to define separate expressions for each cell or blocks.
+
+1 **Define range for the expression**
+
+<div class="image">
+ <img src="Images/DefineRange.png">
+</div>
+
+2 **Define the expression** (dimensions of the defined range and the result of the expression must match!)
+
+<div class="image">
+ <img src="Images/DefineEquations3.png">
+</div>
+
+3 **Create a new expression**
+
+<div class="image">
+ <img src="Images/CreateNewExpression.png">
+</div>
+
+4 **Select the new expression**
+
+<div class="image">
+ <img src="Images/SelectNewExpression.png">
+</div>
+
+Repeat until there is value for each cell. There must be exactly one value for each cell.
+
+## Array Slices
+
+Many times it is useful to access a slice of a multidimensional variable. In this chapter, we will use the following example variable:
+
+<pre>
+ enumeration E1 = one, two, three
+ enumeration E2 = eins, zwei, drei
+ Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}
+</pre>
+
+The whole variable can be accessed in three different ways:
+1. `Auxiliary`
+2. `Auxiliary[E1, E2]`
+3. `Auxiliary[:, :]`
+
+The following explains different methods for accessing parts of the variable
+
+<pre>
+ // Single cell
+ Auxiliary[one, eins] = 1
+</pre>
+<pre>
+ // Slices
+ Auxiliary[one, E2] = {1,2,3}
+ Auxiliary[E1, zwei] = {{2},{5},{8}}
+
+ // In addition to single cells and the whole enumeration range, a subrange of the enumeration can be used
+ Auxiliary[two : three, E2] = {{4,5,6},{7,8,9}}
+ Auxiliary[one : two, zwei : drei] = {{2,3},{5,6}}
+</pre>
+
+The syntax for accessing parts of variables can be used in both expression range definitions and in expressions.
+
+## Arithmetic Operators
+
+Arithmetic operations are defined in Modelica. Below are examples of different operations.
+
+**Addition and substraction**
+
+Addition and substraction are calculated elementwise
+
+<pre>
+ {1,2,3} - {0,2,3} = {1,0,0}
+ {{2,2},{4,4}} + {{8,8},{1,1}} = {{10,10},{5,5}}
+ {1,2,3} - {1,2} = ERROR! Different array sizes
+</pre>
+
+**Division**
+
+Division with a scalar
+
+<pre>
+ {5,10,15} / 5 = {1,2,3}
+ 5 / {5,10,15} = ERROR! not allowed
+</pre>
+
+Division with an array
+
+<pre>
+ {1,2,3} / {1,2,3} = ERROR! not allowed
+
+ // Elementwise
+ {1,2,3} ./ {1,2,3} = {1,1,1}
+</pre>
+
+**Multiplication**
+
+Multiplication with a scalar
+
+<pre>
+ {1,2,3} * 2 = {2,4,6}
+ 5 * {1,2,3} = {5,10,15}
+</pre>
+
+Matrix multiplication with an array
+
+<pre>
+ {{3,4},{5,6}} * {1,2} = {11,17}
+ {{3,4},{5,6}} * {1,2,3} = ERROR! incompatible array sizes
+
+ //Elementwise
+ {1,2} .* {1,2} = {1,4}
+
+ Real[3,2] c = {{1,2},{3,4},{5,6}};
+ Real[2,2] d = {{3,4},{5,6}};
+ Real[2,2] cd;
+ cd = c[2:3, :] .* d; // Result: {{9,16},{25,36}}
+</pre>
+
+**Power**
+
+Elementwise power of array variable
+<pre>
+ {1,2} .^ 2 = {1,4}
+</pre>
+
+## Builtin Modelica Functions
+
+Modelica has some builtin functions that help using multidimensional variables. This chapter introduces some of the builtin functions.
+
+**Dimension and size functions**
+
+We will use the same example variable as previously.
+<pre>
+ enumeration E1 = one, two, three
+ enumeration E2 = eins, zwei, drei
+
+ Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}
+</pre>
+
+**ndims(A)**
+
+The number of dimensions in array A
+<pre>
+ ndims(Auxiliary) = 2
+</pre>
+
+**size(A, i)**
+
+The size of dimension i in array A
+<pre>
+ size(Auxiliary, 2) = 3
+</pre>
+
+**size(A)**
+
+A vector of length ndims(A) containing the dimension sizes of A
+<pre>
+ size(Auxiliary) = {3,3}
+</pre>
+
+**Construction functions**
+
+In addition to normal array constructing, a special construction functions can be used.
+
+**zeros(n1,n2,n3,...)**
+
+An array full of zeros with dimensions n1 x n2 x n2 x ...
+<pre>
+ zeros(2, 2) = {{0,0}, {0,0}}
+</pre>
+
+**ones(n1,n2,n3,...)**
+
+An array full of ones with dimensions n1 x n2 x n2 x ...
+<pre>
+ ones(2, 2) = {{1,1}, {1,1}}
+</pre>
+
+**fill(s,n1,n2,n3)**
+
+Like zeros() and ones(), but with user defined value (s) for array elements.
+<pre>
+ fill(3,2,2) = {{3,3}, {3,3}}
+</pre>
+
+**identity(n)**
+
+Creates an n x n integer identity matrix with ones on the diagonal and all other elements zero.
+<pre>
+ identity(3) =
+ 1 0 0
+ 0 1 0
+ 0 0 1
+</pre>
+
+**diagonal(v)**
+
+Constructs a square matrix with elements of vector v on the diagonal and all other elements zero.
+<pre>
+ diagonal({1,2,3}) =
+ 1 0 0
+ 0 2 0
+ 0 0 3
+</pre>
+
+**linspace(x1,x2,n)**
+
+Constracts a Real vector from x1 to x2 with n equally spaced elements.
+<pre>
+ linspace(2,5,4) = {2,3,4,5}
+</pre>
+
+**Reduction functions**
+
+Reduction functions reduce arrays to scalars.
+
+**min(A)**
+
+Returns the minimum value in array A.
+<pre>
+ Real A = {{1,2},{3,4}}
+ min(A) = 1
+</pre>
+
+**max(A)**
+
+Returns the maximum value in array A.
+<pre>
+ Real A = {{1,2},{3,4}}
+ max(A) = 4
+</pre>
+
+**sum(A)**
+
+Returns the sum of values in array A.
+<pre>
+ Real A = {{1,2},{3,4}}
+ sum(A) = 10 // 1 + 2 + 3 + 4
+</pre>
+
+**product(A)**
+
+Returns the product of values in array A.
+<pre>
+ Real A = {{1,2},{3,4}}
+ product(A) = 24 // 1 * 2 * 3 * 4
+</pre>
+
+**Using functions with iterators**
+
+Functions min(A), max(A), sum(A) and product(A) reduce arrays to scalars. When you use multidimensional variables, you will most probably like to reduce less dimensions. This can be achieved using iterators with reduction functions. The result is constructed as an array, if curly brackets {} are used to enclose the expression.
+<pre>
+ enumeration E1 = one, two, three
+ enumeration E2 = eins, zwei, drei
+ Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}
+
+ AuxiliarySum[E1] = {sum( Auxiliary[ i , E2 ] ) for i in E1} // Result: {6, 15, 24}
+
+ /* Same as:
+ {sum(Auxiliary[one, E2]), sum(Auxiliary[two, E2]), sum(Auxiliary[three, E2])}
+ {sum({1,2,3}), sum({4,5,6}), sum({7,8,9})}
+ */
+</pre>
+
+One expression can have multiple iterators. The Modelica specification defines the following format, but it is NOT yet supported in OpenModelica:
+<pre>
+ {sum(Array[ i, j, E3]) for i in E1, j in E2} // Dimensions reduced from 3 to 2
+</pre>
+
+To use multiple iterators, use the following format (NOTE the reversed order of iterators!):
+<pre>
+ {{sum(Array[ i, j, E3]) for j in E2} for i in E1} // Dimensions reduced from 3 to 2
+</pre>
+
+The range doesn't have to be the whole enumeration. Subranges can also be used.
+<pre>
+ {sum( Auxiliary[ i , eins : zwei ] ) for i in E1.one : E1.two} // Result: {3, 9}
+
+ /* Same as
+ {sum(Auxiliary[one, eins : zwei]), sum(Auxiliary[two, eins : zwei])}
+ {sum({1,2}), sum({4,5})}
+ */
+</pre>
+
+## Simulation Results
+
+Multidimensional variables provide multiple results for the same variable. One result for each index. The trend view clutters very quickly when you add dimensions to the variables.
+
+<div class="image">
+ <img src="Images/3x3trend.png">
+</div>
+
+The clutter can be reduced by selecting which enumeration indexes are shown in charts. Select an enumeration and tick the indexes that you want to show. The same settings apply to each variable that uses the enumeration. This way you can follow an interesting index throughout the model.
+
+<div class="image">
+ <img src="Images/ShowInCharts.png">
+</div>
+
+## Array Variables in Modules
+
+<div class="imageBorder">
+ <img src="Images/Replaceable.png">
+ <p class="imageText">Replaceable enumeration inside a module</p>
+</div>
+
+You can also use array variables inside modules. Enumeration need to be defined separately for each module type and added to all necessary variables, also inputs and outputs (see [Modeling](#modeling)).
+
+When defining a module, modeler may not want to restrict the size of the array variable. In many cases the same module structure could be used for both large and small arrays. For example if the module is a project, a project may have three or even twenty phases. In this case the enumerations inside modules need to be set as replaceable.
+
+In this example, the original enumeration that the modeler used had two indexes. We are using an instance of this module, but we need to use array variables that have three indexes instead of two. We are using two variables and an instance of the module.
+
+<div class="imageBorder">
+ <img src="Images/ReplacingEnumerationConfiguration.png">
+ <p class="imageText">Module configuration for replacing enumerations inside the module</p>
+</div>
+
+In the parent configuration, we have used an enumeration with three indexes in the two variables.
+
+<div class="imageBorder">
+ <img src="Images/Replacing.png">
+ <p class="imageText">Enumeration in the parent configuration that will replace the enumeration in the module</p>
+</div>
+
+The replacement can be defined in the properties of the module instance. When the module instance is selected, a table with all the replaceable enumerations is shown. By clickin on the cell next to the enumeration, a drop-down box is shown with all the enumerations in the parent module. If an enumeration is selected, it will replace the enumeration inside the module during simulation. The replacement will not, however, show elsewhere in the model.
+
+<div class="imageBorder">
+ <img src="Images/ReplacingEnumeration.png">
+ <p class="imageText">Enumeration in the parent configuration that will replace the enumeration in the module</p>
+</div>
+
+When creating replaceable enumerations in modules, modelers need to be very careful. Direct references to single enumeration elements are not allowed, since the enumeration elements will change, if the enumeration is replaced for simulation!
+
+# Functions
+<div outputclass="hr"/>
+
+Modelica provides a convenient way to use functions in your models. You can create your own functions, export and import complete function libraries and share function libraries to be used in all of your models.
+
+## Creating Functions
+
+<div class="image">
+ <img src="Images/NewFunction.png">
+</div>
+
+You can create new functions to the Functions -folder in your model or to function library folders. Right-click on the folder and select New->Function.
+
+Functions that can be found from Functions -folder can be used in your variable definitions.
+
+Functions are defined using Modelica language. The variables used in the function are defined in the declaration section. Function needs an output and an arbitrary number of inputs. Modelica specification enables use of multiple outputs, but this feature is not supported. The inputs are given in the same order as they are used in calling the function.
+
+Algorithm section defines the actual functionality of the function. In algorithm sections you must use assignments ":=" instead of just plain "=". All the assignments are calculated in the order they are written.
+
+Below is an example of a simple function. For more examples, see the built-in functions provided with the tool and [Modelica specifications](https://www.modelica.org/documents/).
+
+<div class="image">
+ <img src="Images/ExampleFunction.png">
+</div>
+
+## Function Libraries
+
+Functions can be collected into libraries. This is a good way of organizing your functions. If function is located in a library, you need to append the library name to the function call (e.g. ExampleFunctionLibrary.ExampleFunction(arg1, arg2)). With libraries, you can also have functions with same names (e.g. library1.func(arg) and library2.func(arg)).
+
+<div class="image">
+ <img src="Images/NewFunctionLibrary.png">
+</div>
+
+There are three types of function libraries: normal function library, built-in function library and shared function library. Normal function libraries can be created to a model and are available only in that model. Built-in libraries are available in all models and calls to built-in functions should not include the library name. Shared functions are available to all models in your workspace, but you need to enable them to each model individually.
+
+Create a new function library by right-clicking on Functions folder, Shared functions folder or other module library.
+
+A function library can be exported by right clicking the function library and selecting Export -> Function library. A function library can be imported by right clicking the Functions folder and selecting Import -> Function library. Functions themselves cannot be exported or imported. To export a function, add it into a function library and export that function library.
+
+If you create a shared function library, the library can be added to other models or removed from current model by selecting the Shared Functions -folder and using the properties view.
+
+<div class="image">
+ <img src="Images/SharedFunctions.png">
+</div>
+
+## External Functions
+
+Modelica allows you to use external functions that are programmed using C language. To use this feature, you need to have the Sysdyn version with OpenModelica included and OpenModelica set as the solver in the Preferences (Window -> Preferences -> Solver). The installation package with OpenModelica has also MinGW C compiler included that allows to build object files from C source code.
+
+Below is a simple example of using a function that returns the sum of two arguments.
+
+<pre>
+ double exampleCFunction(double x, double y)
+ {
+ double res;
+ res = x + y;
+ return res;
+ }
+</pre>
+
+<div class="image">
+ <img src="Images/ImportCFunctionLibrary.png">
+</div>
+
+You need to create an Object file (.o) of your code, import it to a function and define the function to use the library and function that you created. If you don’t have a C-compiler, you can use the one provided by the Simantics installation (e.g. simantics_home/plugins/org.simantics.openmodelica.win32_x/MinGW/bin/mingw32_gcc.exe -g -O -c ExampleCFunctionCode.c).
+
+<div class="image">
+ <img src="Images/ExampleExternalFunction.png">
+</div>
+
+You can use the external function like any other function in your variables. Using equation ExampleExternalFunction(Stock1, 10) in an auxiliary variable (Auxiliary2) gives the following result.
+
+<div class="image">
+ <img src="Images/ExternalFunctionResult.png">
+</div>
+
+In addition to .o -files, you can import .c and .h files. By including these to the function, the source code can be reviewed and later by you or others that use the function.
+
+Small external C function can also be written directly to the function code in Simantics Sysdyn:
+<pre>
+ function ExampleExternalFunction
+ input Real x;
+ input Real y;
+ output Real z;
+ external "C" z=exampleCFunction(x,y) annotation(Include="
+ double exampleCFunction(double x, double y)
+ {
+ double res;
+ res = x + y;
+ return res;
+ }");
+ end ExampleExternalFunction;
+</pre>
+
+## Modelica Functions
+
+Modelica has built-in functions that can be used anywhere and are not visible in function libraries. This section covers a large number of those functions. For functions related to array variables, see see [builtin functions for arrays](#builtin-modelica-functions).
+
+**Function** | **Description**
+--- | ---
+abs(x) | Returns the absolute value of x. Expanded into "(if x >= 0 then x else -x)".
+acos(x) | Inverse cosine.
+asin(x) | Inverse sine.
+atan(x) | Inverse tangent.
+atan2(x1,x2) | four quadrant inverse tangent.
+cat(n,A,B,...) | General concatenation function that concatenates arrays A,B,... along the nth dimension.
+ceil(x) | Returns the smallest integer not less than x, the closest integer above x.
+cos(x) | Cosine.
+cosh(x) | Hyperbolic cosine.
+cross(x,y) | Returns the 3-vector cross product of the 3-vectors x and y.
+delay(expr, delayTime) | Returns the value of expr at the time time-delayTime. The value of expr is returned when time <= time.start + delayTime.
+der(x) | Time derivative of x. X must be have continuous-time variability.
+div(x, y) | Returns the algebraic quotient x/y with any fractional part discarted. E.g. div(10,3) = 3.
+edge(b) | Returns true when the value of the boolean expression b changes. Expanded into (b and not pre(b)).
+exp(x) | Exponential, base e.
+floor(x) | Returns the largest integer not greater than x, the closest integer below x.
+initial() | Returns true at the beginning of the simulation.
+integer(x) | Returns the largest integer not greater than x as an integer.
+log(x) | Natural logarithm. (base e, x > 0)
+log10(x) | Base 10 logarithm. (x > 0)
+mod(x, y) | Returns the integer modulus of x/y: mod(x,y) = x - floor(x/y) * y.
+noEvent(expr) | noEvent around an expression causes the expression to NOT generate event. **Important:** If you want a condition to be checked only on time steps, use noEvent. (e.g. if noEvent(value >= 1) then ... else ...)
+pre(x) | Returns the preceding value of y from time event that has occured before current time.
+rem(x, y) | Returns the integer remainder of x/y: rem(x,y) = x - div(x,y) * y.
+sample(start, interval) | Returns true and triggers time events at times start + i * interval (i=0,1,...).
+sign(x) | Returns -1 if x is negative, 1 if x is positive. Expanded into "(if x > 0 then 1 else if x < 0 then -1 else 0)".
+sin(x) | Sine.
+sinh(x) | Hyperbolic sine.
+sqrt(x) | Square root of x. The value of x must be greater or equal to 0 or an assertion error occurs.
+tan(x) | Tangent.
+tanh(x) | Hyperbolic tangent.
+terminal() | Returns true at the end of a successful simulation.
+
+# Spreadsheets
+<div outputclass="hr"/>
+
+Spreadsheets allow storing and maintaining values in a familiar format. The current spreadsheet implementation is experimental and does not provide much functionality.
+
+## Variable Values
+
+Spreadsheets are an easy way to import and manage parameter values. Sheet shells can be referenced to in models with the syntax SheetName(CellReference). Below is an example of getting a value for Auxiliary. The text "Auxiliary" is not necessary in the spreadsheet, but it helps maintaining the sheet.
+
+<div class="image">
+ <img src="Images/AuxiliarySheetReference.png">
+ <img src="Images/AuxiliarySheet.png">
+</div>
+
+You can also refer to sheets with array variables. Reference is simple with one and two dimensional array variables. Below is an example of a sheet with values for two different variables. The names of the indexes are not mandatory, but help reading and maintaining the sheet.
+
+<div class="image">
+ <img src="Images/SheetForMultidim.png">
+</div>
+
+Reference to a sheet range creates an array variable.
+
+<div class="image">
+ <img src="Images/SheetMultidim1.png">
+</div>
+
+ArrayTest2 has two dimensions. Reference to a larger range creates a two-dimensional variable. By default, the indexes are ordered as in this example. However, if you wish to present the indexes in a different order in the spreadsheet, you can transpose the sheet reference (e.g. transpose(ArrayTestSheet(E2:G3)))
+
+<div class="image">
+ <img src="Images/SheetMultidim2.png">
+</div>
+
+## History Data
+Spreadsheets can be used to store and display external history data e.g. from some statistics. The history data should be arranged as columns or rows and include a time variable. Reference variables need to be given the exactly same name as their counterparts in model.
+
+<div class="image">
+ <img src="Images/Sheet.png">
+</div>
+
+History data is used by creating a History dataset to an experiment. The dataset is activated and deactivated in charts by double-clicking the dataset. History data reference is set in the properties of the history dataset.
+
+<div class="image">
+ <img src="Images/HistoryDataSettings.png">
+</div>
+
+
+**History data properties** | -
+--- | ---
+Name | Name of the history dataset
+Sheet | Combo box for selecting a sheet where the history data is located
+Orientation | Columns or rows. How the data is arranged in the sheet.
+Range start | The upper-left corner cell of the history data range
+Range end | The lower-right corner cell of the history data range
+Time variable | The name of the time variable in the history data, if it is different than "time"
+Variables in range | This text field displays the found variables in the given sheet and range
+
+If the history dataset is activated, history data is displayed whenever it is available for a variable that is displayed in a chart.
+
+<div class="image">
+ <img src="Images/HistoryData.png">
+</div>
+
+# Vensim Model Import
+<div outputclass="hr"/>
+
+The tool also has a limited support for importing system dynamics models created with the simulation and modelling tool [Vensim](http://vensim.com/). This functionality is used similarly to the regular model import, so by right-clicking the browser and selecting "Import" -> "Vensim Model (.mdl)".
+
+The import process has several known limitations:
+
+* The Vensim model must be in the .mdl file format, the other Vensim file formats are proprietary and thus not supported.
+* Only variables and connections are imported.
+* Many advanced Vensim features, such as input and output objects (e.g. graphs and parameter value editors) and other diagram customizations, are not supported.
+* Variable value range data is not always imported correctly.
+* Subscripts are automatically converted to enumerations which may sometimes lead into problems as the constructions are not exactly equivalent.
+* Dimensionless units are currently not converted correctly (in Simantics System Dynamics, dimensionless should be indicated with a constant).
+* Non-shadow duplicate variables are sometimes very problematic and may be imported incorrectly, shadow variables should work fine.
+* Only a limited subset of Vensim functions is currently implemented in Simantics System Dynamics, so some equations might require additional work before they can be evaluated correctly.
+
+# Sample Models and Molecules
+<div outputclass="hr"/>
+
+There are some sample models located in the sampleModels folder found in the installation folder. The sample models can be imported by right-clicking on the model browser and select Import->Model.
+
+[Simantics](https://www.simantics.org/end_user_wiki/index.php/Introduction_to_Simantics) | *System Dynamics Modelling*
+
+<div outputclass="hr"/>
+
+
+[**Tutorial: Basic System Dynamics Modelling**](BasicTutorial.md)
+
+System dynamics modelling in Simantics is a free modelling tool that is included into the basic installation. This tutorial introduces the basic features of the system dynamics modelling tool.
+
+
+[**Tutorial: Advanced System Dynamics Modelling**](AdvancedTutorial.md)
+
+This tutorial introduces the more advanced features of the system dynamics modelling tool: Modules and Operating interfaces
--- /dev/null
+
+/*!
+ * Custom CSS declarations, to be appended to the end of existing declarations
+ */
+
+.imageText {
+ padding: 1px;
+ border: 1px solid;
+ text-align: center;
+ border-color: #c8ccd1;
+}
+
+.imageBorder {
+ padding: 4px;
+ border: 1px solid;
+ border-color: #c8ccd1;
+ display: table;
+ background-color: #f8f9fa;
+}
+
+ .box {
+ display: flex;
+ align-items:left;
+}
+
+center {
+ margin: auto;
+ width: 50%;
+}
+
+.hr{
+ border-top: 1px solid black;
+}
+
+ pre {
+ color: #000000;
+ display: block;
+ white-space: pre-wrap;
+ margin: 1em 0;
+ background-color: #f8f9fa;
+ border: 1px solid #eaecf0;
+ padding: 0;
+}
--- /dev/null
+call del "..\bundles\org.simantics.sysdyn.wiki\commonrtl.css"
+call del "..\bundles\org.simantics.sysdyn.help\commonrtl.css"
+call del "..\bundles\org.simantics.sysdyn.wiki\commonltr.css"
+call del "..\bundles\org.simantics.sysdyn.help\commonltr.css"
+call cmd /c dita %1 --input=SYSDYN.ditamap --output=../bundles/org.simantics.sysdyn.wiki --format=html5
+call cmd /c dita %1 --input=SYSDYN.ditamap --output=../bundles/org.simantics.sysdyn.help --format=eclipsehelp
+call type ".\custom.css" >> "..\bundles\org.simantics.sysdyn.wiki\commonrtl.css"
+call type ".\custom.css" >> "..\bundles\org.simantics.sysdyn.help\commonrtl.css"
+call type ".\custom.css" >> "..\bundles\org.simantics.sysdyn.wiki\commonltr.css"
+call type ".\custom.css" >> "..\bundles\org.simantics.sysdyn.help\commonltr.css"
+REM We also need to replace all .html files in the eclipse help with the files generated by the html5 generator
+REM This is because there appears to be a bug that creates malformed HTML with incorrect topic/title IDs in the eclipsehelp format:
+for /R "..\bundles\org.simantics.sysdyn.wiki\Site" %%f in (*.html) do copy /Y "%%f" "..\bundles\org.simantics.sysdyn.help\Site\"
+EXIT /B
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+# This has not been tested yet, but should work (concept is the same as with the .bat file)
+rm -f "../bundles/org.simantics.sysdyn.wiki/commonrtl.css"
+rm -f "../bundles/org.simantics.sysdyn.help/commonrtl.css"
+rm -f "../bundles/org.simantics.sysdyn.wiki/commonltr.css"
+rm -f "../bundles/org.simantics.sysdyn.help/commonltr.css"
+dita $1 --input=SYSDYN.ditamap --output=../bundles/org.simantics.sysdyn.wiki --format=html5
+dita $1 --input=SYSDYN.ditamap --output=../bundles/org.simantics.sysdyn.help --format=eclipsehelp
+cat "./custom.css" >> "../bundles/org.simantics.sysdyn.wiki/commonrtl.css"
+cat "./custom.css" >> "../bundles/org.simantics.sysdyn.help/commonrtl.css"
+cat "./custom.css" >> "../bundles/org.simantics.sysdyn.wiki/commonltr.css"
+cat "./custom.css" >> "../bundles/org.simantics.sysdyn.help/commonltr.css"
+#TODO:
+#Add copy .html files logic here
+#For now, do it manually! (all HTML files under \Site from wiki to help)
\ No newline at end of file
-<?xml version="1.0" encoding="UTF-8"?>\r
-<feature\r
- id="org.simantics.sysdyn.internal"\r
- label="Simantics System Dynamics Internal Solver Feature"\r
- version="1.28.0.qualifier"\r
- provider-name="VTT Technical Research Centre of Finland">\r
-\r
- <description>\r
- Simantics System Dynamics product with custom internal solver only.\r
- </description>\r
-\r
- <copyright>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.simantics.sysdyn.internal"
+ label="Simantics System Dynamics Internal Solver Feature"
+ version="1.28.0.qualifier"
+ provider-name="VTT Technical Research Centre of Finland">
+
+ <description>
+ Simantics System Dynamics product with custom internal solver only.
+ </description>
+
+ <copyright>
Copyright (c) 2007, 2016 Association for Decentralized Information
Management in Industry THTH ry.<br/>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License
v1.0 which accompanies this distribution, and is available at
-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>\r
- </copyright>\r
-\r
- <license url="http://www.eclipse.org/legal/epl-v10.html">\r
- Licensed under Eclipse Public License (EPL) 1.0.\r
- </license>\r
-\r
- <includes\r
- id="org.eclipse.equinox.executable"\r
- version="0.0.0"/>\r
-\r
- <includes\r
- id="org.simantics.help"\r
- version="0.0.0"/>\r
-\r
- <includes\r
- id="org.simantics.issues.feature"\r
- version="0.0.0"/>\r
-\r
- <includes\r
- id="org.simantics.modeling"\r
- version="0.0.0"/>\r
-\r
- <includes\r
- id="org.simantics.issues.ui.feature"\r
- version="0.0.0"/>\r
-\r
- <includes\r
- id="org.simantics.workbench"\r
- version="0.0.0"/>\r
-\r
- <includes\r
- id="org.simantics.eclipsec.launcher"\r
- version="0.0.0"/>\r
-\r
- <includes\r
- id="org.simantics.sysdyn.internal.p2"\r
- version="0.0.0"/>\r
-\r
- <plugin\r
- id="org.simantics.sysdyn.product"\r
- download-size="0"\r
- install-size="0"\r
- version="0.0.0"/>\r
-\r
-</feature>\r
+<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ </copyright>
+
+ <license url="http://www.eclipse.org/legal/epl-v10.html">
+ Licensed under Eclipse Public License (EPL) 1.0.
+ </license>
+
+ <includes
+ id="org.eclipse.equinox.executable"
+ version="0.0.0"/>
+
+ <includes
+ id="org.simantics.help"
+ version="0.0.0"/>
+
+ <includes
+ id="org.simantics.issues.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.simantics.modeling"
+ version="0.0.0"/>
+
+ <includes
+ id="org.simantics.issues.ui.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.simantics.workbench"
+ version="0.0.0"/>
+
+ <includes
+ id="org.simantics.eclipsec.launcher"
+ version="0.0.0"/>
+
+ <includes
+ id="org.simantics.sysdyn.internal.p2"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.simantics.sysdyn.product"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+
+ <plugin
+ id="org.simantics.sysdyn.ditamap"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
- <modelVersion>4.0.0</modelVersion>\r
- <groupId>org.simantics</groupId>\r
- <artifactId>org.simantics.sysdyn.tycho.configuration</artifactId>\r
- <version>1.0.0-SNAPSHOT</version>\r
- <packaging>pom</packaging>\r
-\r
- <properties>\r
- <tycho.version>1.0.0</tycho.version>\r
- <tycho.extras.version>1.0.0</tycho.extras.version>\r
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r
- <branch-spec>master</branch-spec>\r
- <simantics-download-site>http://www.simantics.org/download</simantics-download-site>\r
- </properties>\r
-\r
- <repositories>\r
- <repository>\r
- <id>simantics-sdk</id>\r
- <layout>p2</layout>\r
- <url>${simantics-download-site}/${branch-spec}/sdk</url>\r
- </repository>\r
- </repositories>\r
-\r
- <pluginRepositories>\r
- <pluginRepository>\r
- <id>graph-builder-snapshot</id>\r
- <name>Graph Builder Repository</name>\r
- <url>https://repo.simupedia.com/repository/graph-builder-release</url>\r
- <layout>default</layout>\r
- <releases>\r
- <updatePolicy>never</updatePolicy>\r
- </releases>\r
- <snapshots>\r
- <updatePolicy>always</updatePolicy>\r
- </snapshots>\r
- </pluginRepository>\r
- </pluginRepositories>\r
-\r
- <build>\r
- <plugins>\r
- <plugin>\r
- <groupId>org.simantics</groupId>\r
- <artifactId>graph-builder-maven-plugin</artifactId>\r
- <version>0.0.9</version>\r
- <executions>\r
- <execution>\r
- <goals>\r
- <goal>compile-graphs</goal>\r
- </goals>\r
- </execution>\r
- </executions>\r
- </plugin>\r
- <plugin>\r
- <groupId>org.eclipse.tycho</groupId>\r
- <artifactId>tycho-maven-plugin</artifactId>\r
- <version>${tycho.version}</version>\r
- <extensions>true</extensions>\r
- </plugin>\r
- <plugin>\r
- <groupId>org.eclipse.tycho</groupId>\r
- <artifactId>tycho-packaging-plugin</artifactId>\r
- <version>${tycho.version}</version>\r
- <configuration>\r
- <format>'v'yyyyMMdd-HHmmss</format>\r
- </configuration>\r
- </plugin>\r
- <plugin>\r
- <groupId>org.eclipse.tycho</groupId>\r
- <artifactId>target-platform-configuration</artifactId>\r
- <version>${tycho.version}</version>\r
- <configuration>\r
- <includePackedArtifacts>true</includePackedArtifacts>\r
- <ignoreTychoRepositories>true</ignoreTychoRepositories>\r
- <resolver>p2</resolver>\r
- <environments>\r
-<!--\r
- <environment>\r
- <os>linux</os>\r
- <ws>gtk</ws>\r
- <arch>x86</arch>\r
- </environment>\r
- <environment>\r
- <os>linux</os>\r
- <ws>gtk</ws>\r
- <arch>x86_64</arch>\r
- </environment>\r
--->\r
- <environment>\r
- <os>win32</os>\r
- <ws>win32</ws>\r
- <arch>x86</arch>\r
- </environment>\r
- <environment>\r
- <os>win32</os>\r
- <ws>win32</ws>\r
- <arch>x86_64</arch>\r
- </environment>\r
-<!--\r
- <environment>\r
- <os>macosx</os>\r
- <ws>cocoa</ws>\r
- <arch>x86_64</arch>\r
- </environment>\r
--->\r
- </environments>\r
- </configuration>\r
- </plugin>\r
- <plugin>\r
- <groupId>org.eclipse.tycho.extras</groupId>\r
- <artifactId>tycho-pack200b-plugin</artifactId>\r
- <version>${tycho.extras.version}</version>\r
- <executions>\r
- <execution>\r
- <id>pack200-pack</id>\r
- <goals>\r
- <goal>pack</goal>\r
- </goals>\r
- </execution>\r
- </executions>\r
- </plugin>\r
- <plugin>\r
- <groupId>org.eclipse.tycho</groupId>\r
- <artifactId>tycho-p2-plugin</artifactId>\r
- <version>${tycho.version}</version>\r
- <executions>\r
- <execution>\r
- <id>attach-p2-metadata</id>\r
- <phase>package</phase>\r
- <goals>\r
- <goal>p2-metadata</goal>\r
- </goals>\r
- </execution>\r
- </executions>\r
- <configuration>\r
- <defaultP2Metadata>false</defaultP2Metadata>\r
- </configuration>\r
- </plugin>\r
- </plugins>\r
- </build>\r
-</project>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.simantics</groupId>
+ <artifactId>org.simantics.sysdyn.tycho.configuration</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <properties>
+ <tycho.version>1.0.0</tycho.version>
+ <tycho.extras.version>1.0.0</tycho.extras.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <branch-spec>release/1.35.0</branch-spec>
+ <simantics-download-site>http://www.simantics.org/download</simantics-download-site>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>simantics-sdk</id>
+ <layout>p2</layout>
+ <url>${simantics-download-site}/${branch-spec}/sdk</url>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>graph-builder-snapshot</id>
+ <name>Graph Builder Repository</name>
+ <url>https://repo.simupedia.com/repository/graph-builder-release</url>
+ <layout>default</layout>
+ <releases>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <updatePolicy>always</updatePolicy>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.simantics</groupId>
+ <artifactId>graph-builder-maven-plugin</artifactId>
+ <version>0.0.9</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile-graphs</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-packaging-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <format>'v'yyyyMMdd-HHmmss</format>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <includePackedArtifacts>true</includePackedArtifacts>
+ <ignoreTychoRepositories>true</ignoreTychoRepositories>
+ <resolver>p2</resolver>
+ <environments>
+<!--
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86_64</arch>
+ </environment>
+-->
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86</arch>
+ </environment>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86_64</arch>
+ </environment>
+<!--
+ <environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86_64</arch>
+ </environment>
+-->
+ </environments>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho.extras</groupId>
+ <artifactId>tycho-pack200b-plugin</artifactId>
+ <version>${tycho.extras.version}</version>
+ <executions>
+ <execution>
+ <id>pack200-pack</id>
+ <goals>
+ <goal>pack</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <executions>
+ <execution>
+ <id>attach-p2-metadata</id>
+ <phase>package</phase>
+ <goals>
+ <goal>p2-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <defaultP2Metadata>false</defaultP2Metadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>