<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.simantics.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tuukka+Lehtonen</id>
	<title>End-User Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.simantics.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tuukka+Lehtonen"/>
	<link rel="alternate" type="text/html" href="https://wiki.simantics.org/index.php/Special:Contributions/Tuukka_Lehtonen"/>
	<updated>2026-04-07T18:21:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.simantics.org/index.php?title=Simantics_End_User_Documentation&amp;diff=635</id>
		<title>Simantics End User Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.simantics.org/index.php?title=Simantics_End_User_Documentation&amp;diff=635"/>
		<updated>2023-10-27T09:31:47Z</updated>

		<summary type="html">&lt;p&gt;Tuukka Lehtonen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ [[image:Simantics_puzzle_piece.png|right|360px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Simantics&#039;&#039;&#039; is a software platform for modelling and simulation. The system has client-server architecture with a semantic ontology-based modelling database and Eclipse framework -based client software with plug-in interface. The Simantics platform and many of its components are open source under [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License (EPL)].&lt;br /&gt;
&lt;br /&gt;
Simantics platform is used in open source and commercial modelling and simulation products. Simantics comes with [[Simantics System Dynamics | System dynamics modelling and simulation tool]], which is an open source tool for modelling business processes. The next versions of [http://www.apros.fi/ Apros] and [http://balas.vtt.fi/ Balas] will be based on the Simantics platform. For more information on Simantics and related projects, visit [http://www.simantics.org/ Simantics website].&lt;br /&gt;
&lt;br /&gt;
The philosophy of the Simantics platform is to offer an open, high level application platform on which different computational tools can be easily integrated to form a common environment for modelling and simulation. One of the biggest innovations in the Simantics platform is the semantic modelling approach. The data triple engine on the server side enables high performance data management and arbitrary mapping of data. This enables e.g. efficient mapping of simulation and measurement data to the model configuration and its visualisation.&lt;br /&gt;
&lt;br /&gt;
This &#039;&#039;Simantics End User Documentation&#039;&#039; provides information on the open source products that have been developed using Simantics platform. The basic principles of Simantics platform and some components common to all Simantics-based products are also explained. If you wish to dig deeper to the foundations of the Simantics platform or create your own modelling and simulation tool based on Simantics, see [http://dev.simantics.org/ Simantics Developer Documentation] or contact us through [http://www.simantics.org Simantics website].&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot;&lt;br /&gt;
! !! Simantics Platform Products !!&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width=&amp;quot;270&amp;quot; align=&amp;quot;center&amp;quot; valign=&amp;quot;bottom&amp;quot;| [[File:AprosShot.png|300x160px|link=https://www.simantics.org/demonstration/apros]]&amp;lt;hr&amp;gt;Apros&lt;br /&gt;
| style=&amp;quot;width=&amp;quot;270&amp;quot; align=&amp;quot;center&amp;quot; valign=&amp;quot;bottom&amp;quot;| [[File:BalasShot.png|300x160px|link=https://www.simantics.org/demonstration/balas]]&amp;lt;hr&amp;gt;Balas&lt;br /&gt;
| style=&amp;quot;width=&amp;quot;270&amp;quot; align=&amp;quot;center&amp;quot; valign=&amp;quot;bottom&amp;quot;| [[File:SysdynOverviewPicture.png|link=Simantics System Dynamics]]&amp;lt;hr&amp;gt;System Dynamics&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== [[Introduction to Simantics]] ===&lt;br /&gt;
* [[Simantics#About Simantics Platform|About Simantics Platform]]&lt;br /&gt;
* [[Simantics#Simantics Development and Open Source|Simantics Development and Open Source]]&lt;br /&gt;
* [[Simantics#Simantics Concepts and Conventions|Simantics Concepts and Conventions]]&lt;br /&gt;
&lt;br /&gt;
=== [[Simantics System Dynamics]] ===&lt;br /&gt;
&lt;br /&gt;
* [[Simantics System Dynamics#Introduction to System Dynamics Simulation|Introduction to System Dynamics Simulation]]&lt;br /&gt;
* [[Simantics System Dynamics#Installation Instructions|Installation Instructions]]&lt;br /&gt;
* [[Simantics System Dynamics#Workbench|Workbench]]&lt;br /&gt;
* [[Simantics System Dynamics#Modelling|Modelling]]&lt;br /&gt;
* [[Simantics System Dynamics#Simulation|Simulation]]&lt;br /&gt;
* [[Simantics System Dynamics#Multidimensional variables|Multidimensional variables]]&lt;br /&gt;
* [[Simantics System Dynamics#Functions|Functions]]&lt;br /&gt;
&lt;br /&gt;
[[Tutorial: Basic System Dynamics Modelling]]&lt;br /&gt;
&lt;br /&gt;
[[Tutorial: Advanced System Dynamics Modelling]]&lt;br /&gt;
&lt;br /&gt;
-----&lt;/div&gt;</summary>
		<author><name>Tuukka Lehtonen</name></author>
	</entry>
	<entry>
		<id>https://wiki.simantics.org/index.php?title=Simantics_System_Dynamics&amp;diff=634</id>
		<title>Simantics System Dynamics</title>
		<link rel="alternate" type="text/html" href="https://wiki.simantics.org/index.php?title=Simantics_System_Dynamics&amp;diff=634"/>
		<updated>2018-02-20T10:41:03Z</updated>

		<summary type="html">&lt;p&gt;Tuukka Lehtonen: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simantics System Dynamics ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Simantics System Dynamics&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
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, [[#Installation Instructions|install]] the software and try our [[Tutorial: Basic System Dynamics Modelling|basic]] and [[Tutorial: Advanced System Dynamics Modelling|advanced]] tutorials!&lt;br /&gt;
&lt;br /&gt;
== Introduction to System Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
=== System Dynamics ===&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
=== Model ===&lt;br /&gt;
&lt;br /&gt;
[[File:ModelStructure.png|right|thumb|Model structure]]&lt;br /&gt;
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&#039;t have to always configure the model for different scenarios. [[#Basic Modelling|Module types]] 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Components ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:ComponentTypes.png|right|frame|Component types]]&lt;br /&gt;
;Auxiliary&lt;br /&gt;
: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: &#039;&#039;Auxiliary&#039;&#039;, &#039;&#039;Parameter&#039;&#039;, &#039;&#039;Constant&#039;&#039;, [[#Delay|&#039;&#039;Delay&#039;&#039;]] and [[#WithLookup|&#039;&#039;WithLookup&#039;&#039;]]. 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.&lt;br /&gt;
;Dependency&lt;br /&gt;
: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.&lt;br /&gt;
;Flow&lt;br /&gt;
: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.&lt;br /&gt;
;Valve&lt;br /&gt;
: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.&lt;br /&gt;
;Stock&lt;br /&gt;
: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.&lt;br /&gt;
;Cloud&lt;br /&gt;
: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.&lt;br /&gt;
;Module&lt;br /&gt;
: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.&lt;br /&gt;
;Input&lt;br /&gt;
: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&#039;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.&lt;br /&gt;
;Shadow&lt;br /&gt;
: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. &lt;br /&gt;
;Loop&lt;br /&gt;
:A loop element is a graphical component for highlighting selected feedback loops in a model.&lt;br /&gt;
;Comment&lt;br /&gt;
:A comment element is a string of text on diagram.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Modeling Principles ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
;Variable names&lt;br /&gt;
: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 &#039;&#039;Carbon in Atmosphere&#039;&#039; cannot be used (&#039;&#039;in&#039;&#039; is a reserved word). Capitalizing the reserved (&#039;&#039;in&#039;&#039; --&amp;gt; &#039;&#039;In&#039;&#039;) word can be used to sidestep the problem.&lt;br /&gt;
&lt;br /&gt;
;Connections&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
;Graphical annotations&lt;br /&gt;
:System dynamics contains usually annotations for loops, polarities, delays and so on. Annotations are important, for communicating the behavior of the model.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
System dynamics tool is provided with the Simantics platform.&lt;br /&gt;
&lt;br /&gt;
# [http://sysdyn.simantics.org/ Download installer from the tool&#039;s download page]&lt;br /&gt;
# Install the program to a directory without spaces (limitation inherited from OpenModelica).&lt;br /&gt;
# Run the application through the launcher generated by the installer&amp;lt;br/&amp;gt;&lt;br /&gt;
: (default: Simantics\Simantics-1.8.0-Sysdyn-32\Simantics-1.8.0-Sysdyn-32)&lt;br /&gt;
&lt;br /&gt;
[http://www.openmodelica.org/ OpenModelica] 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 [http://www.openmodelica.org/index.php/download OpenModelica]. In addition to OpenModelica, a development version of a [[#Solvers|purpose-built Modelica solver]] is embedded in the tool.&lt;br /&gt;
&lt;br /&gt;
== Workbench ==&lt;br /&gt;
&lt;br /&gt;
[[File:BasicWorkbench.png|center|729px]]&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Diagram&#039;&#039;&#039; &amp;lt;br /&amp;gt; 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. &lt;br /&gt;
# &#039;&#039;&#039;Model Browser&#039;&#039;&#039; &amp;lt;br /&amp;gt; Model browser shows the structure of your model and all items related to it. &amp;lt;br /&amp;gt;&#039;&#039;&#039;Symbols&#039;&#039;&#039; &amp;lt;br/&amp;gt; Symbols view (stacked with the model browser) is used for dragging elements to diagrams. &amp;lt;br /&amp;gt;&#039;&#039;&#039;Search&#039;&#039;&#039; &amp;lt;br/&amp;gt; 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.&lt;br /&gt;
# &#039;&#039;&#039;Properties&#039;&#039;&#039; &amp;lt;br /&amp;gt; Property view shows the selected variable&#039;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.&amp;lt;br /&amp;gt;&#039;&#039;&#039;Console&#039;&#039;&#039; &amp;lt;br /&amp;gt; Console view (stacked with the property view) shows console messages from the simulator. Console can be used for debugging models simulated using OpenModelica. &amp;lt;br /&amp;gt;&#039;&#039;&#039;Issues&#039;&#039;&#039; &amp;lt;br /&amp;gt; Issue view (stacked with the property view) shows the errors and warnings in all models. &amp;lt;br /&amp;gt;&#039;&#039;&#039;Profiles&#039;&#039;&#039; &amp;lt;br /&amp;gt; [[#Diagram Profiles|Profiles]] view (stacked with the property view) allows enabling/disabling some visual diagram effects.&lt;br /&gt;
# &#039;&#039;&#039;Trend&#039;&#039;&#039; &amp;lt;br /&amp;gt; [[#Simulation Result and Model Structure Analysis|Trend]] 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. &amp;lt;br /&amp;gt;&#039;&#039;&#039;Structure&#039;&#039;&#039; &amp;lt;br /&amp;gt; The [[#Simulation Result and Model Structure Analysis|structure]] view (stacked with the trend view) can be used for analyzing the varaible dependencies, loops, and the structure of the model. &amp;lt;br/&amp;gt;&#039;&#039;&#039;Values&#039;&#039;&#039; &amp;lt;br/&amp;gt; The [[#Simulation Result and Model Structure Analysis|values]] 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.&lt;br /&gt;
# &#039;&#039;&#039;Save and save as...&#039;&#039;&#039; &amp;lt;br/&amp;gt; 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.&lt;br /&gt;
# &#039;&#039;&#039;Diagram tool mode&#039;&#039;&#039; &amp;lt;br /&amp;gt; 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.&lt;br /&gt;
# &#039;&#039;&#039;Experiment controls&#039;&#039;&#039; &amp;lt;br /&amp;gt; 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.&lt;br /&gt;
# &#039;&#039;&#039;Perspectives&#039;&#039;&#039; &amp;lt;br/&amp;gt; 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 [[File:OpenPerspective.png]] button.&lt;br /&gt;
# &#039;&#039;&#039;Chart Panel&#039;&#039;&#039; &amp;lt;br/&amp;gt; [[#Chart Panel|Chart panel]] is able to house multiple [[#Charts|charts]] at the same time. Charts are added to the panel by dragging from model browser.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;TIP!&#039;&#039;&#039; If you accidentally close a view, you can reopen them from Window-&amp;gt;Show View-&amp;gt;Other...&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;TIP!&#039;&#039;&#039; Try dragging the views to different positions (e.g. the property view to the right pane).&lt;br /&gt;
&lt;br /&gt;
=== Global Preferences ===&lt;br /&gt;
&lt;br /&gt;
Global preferences of Simantics System Dynamics are located under Window -&amp;gt; Preferences. Feel free to browse the contents yourself. A few notable items on the list are described below.&lt;br /&gt;
&lt;br /&gt;
[[File:Preferences.png]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|General -&amp;gt; Keys&lt;br /&gt;
|All [[#Shortcut and Control Keys|keyboard shortcuts]] available.&lt;br /&gt;
|-&lt;br /&gt;
|Modelica&lt;br /&gt;
|The location of OpenModelica solver on file system.&lt;br /&gt;
|-&lt;br /&gt;
|Solver&lt;br /&gt;
|[[#Solvers|Solver]] to be used for simulation. OpenModelica or internal custom solver (experimental) can be selected.&lt;br /&gt;
|-&lt;br /&gt;
|Sysdyn Diagrams&lt;br /&gt;
|Sysdyn Diagrams allows customize default colors and fonts of diagram elements.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Modelling ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Modelling ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Basic_1.png|right]]&lt;br /&gt;
;Creating a new model&lt;br /&gt;
:Start a new model by right-clicking the model browser and selecting New -&amp;gt; Model or from the main menu File -&amp;gt; New -&amp;gt; SD Model.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Basic_2.png|right]]&lt;br /&gt;
;Creating a new module type&lt;br /&gt;
:Create a new module type by right-clicking on the Modules-folder and selecting New -&amp;gt; Module type. This creates a new module type that you can populate to your other modules and the model configuration. &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Configuring a model&lt;br /&gt;
:Model configuration can be opened by double clicking Configuration in the model browser. &lt;br /&gt;
&lt;br /&gt;
;Configuring modules&lt;br /&gt;
: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!&lt;br /&gt;
&lt;br /&gt;
;Populate variables&lt;br /&gt;
:You can drag variables to a diagram from symbol view. You can also populate variables using [[#Shortcut and control keys|shortcut keys]]. Variables can be divided into multiple lines by resizing the variable on diagram.&lt;br /&gt;
&lt;br /&gt;
;Populate modules&lt;br /&gt;
:Modules are populated from the model browser. Just drag the module you want to populate from the Modules folder to a diagram.&lt;br /&gt;
&lt;br /&gt;
;Create connections&lt;br /&gt;
: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.&lt;br /&gt;
: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.&lt;br /&gt;
:There are some restrictions on what connections can be made, but don&#039;t worry, the user interface won&#039;t let you do connections that are not allowed.&lt;br /&gt;
&lt;br /&gt;
;Connections between modules&lt;br /&gt;
:&#039;&#039;&#039;Outside the module&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:You can connect variables to variables in modules like this:&lt;br /&gt;
 MODULE -----&amp;gt; INPUT&lt;br /&gt;
 or&lt;br /&gt;
 ANY VARIABLE -----&amp;gt; MODULE &lt;br /&gt;
:This is just the visual configuration, but you need those connections to really connect variables in the module&#039;s properties.&lt;br /&gt;
:In the &#039;&#039;Inputs&#039;&#039; tab stacked under &#039;&#039;Module Properties&#039;&#039; you can select which variables you connect to inputs inside the module. In the &#039;&#039;Outputs&#039;&#039; tab you can select which variables you lift from the module to inputs outside it.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Inside the module&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:Input variables get values from outside the module&lt;br /&gt;
&lt;br /&gt;
:Output variables can send their values outside the module. From the variable properties, select Additional Information and press Is Output&lt;br /&gt;
&lt;br /&gt;
;Configure variables&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
;Export model&lt;br /&gt;
:To export your model to a file, select your model from the model browser, right-click and from the context menu choose Export-&amp;gt;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.&lt;br /&gt;
&lt;br /&gt;
;Import model&lt;br /&gt;
:Right-click on the model browser and select Import-&amp;gt;Model. Browse to your .sysdyn file and select open. The model is added to your model browser.&lt;br /&gt;
&lt;br /&gt;
;Export module&lt;br /&gt;
:To export a module to a file, select the module from the model browser, right-click and from the context menu choose Export-&amp;gt;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.&lt;br /&gt;
&lt;br /&gt;
;Import module&lt;br /&gt;
:Right-click the Modules folder of a model and select Import-&amp;gt;Module. Browse to your .sysdynModule file and select open. The module is added to your model.&lt;br /&gt;
&lt;br /&gt;
=== Model Properties ===&lt;br /&gt;
&lt;br /&gt;
Model properties can be viewed by selecting either the model or its configuration on the model browser.&lt;br /&gt;
&lt;br /&gt;
[[File:ModelProperties.png]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Name&lt;br /&gt;
|The name of the model.&lt;br /&gt;
|-&lt;br /&gt;
|Start time&lt;br /&gt;
|The start time of the simulation.&lt;br /&gt;
|-&lt;br /&gt;
|Stop time&lt;br /&gt;
|The stop time of the simulation.&lt;br /&gt;
|-&lt;br /&gt;
|Step length&lt;br /&gt;
|The length of the simulation step.&lt;br /&gt;
|-&lt;br /&gt;
|Output interval&lt;br /&gt;
|Interval of witch the simulation result is presented. If the field is left empty, all steps of the output are presented.&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|The simulation solver (only OpenModelica).&lt;br /&gt;
|-&lt;br /&gt;
|Validate units&lt;br /&gt;
|[[#Unit Validation|Unit validation]] on/off. If unit validation is enabled, the unit of the simulation time is selected from the pull-down menu.&lt;br /&gt;
|-&lt;br /&gt;
|Unit equivalents&lt;br /&gt;
|Define if different forms of predefined units are considered equal (e.g. dollars = dollar = $) in unit validation.&lt;br /&gt;
|-&lt;br /&gt;
|Tolerance&lt;br /&gt;
|Integrator error tolerance (only OpenModelica)&lt;br /&gt;
|-&lt;br /&gt;
|Variable filter&lt;br /&gt;
|Define which variables are presented (only OpenModelica)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Special Variables ===&lt;br /&gt;
&lt;br /&gt;
Auxiliary and valve variables have two special types: WithLookup and Delay. These types are selected from Type drop down menu in the variable&#039;s properties. The variable types offer more specific functionalities than normal variables, but the same functionality could be achieved using normal variables.&lt;br /&gt;
&lt;br /&gt;
==== WithLookup ====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:WithLookup1.png]]&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:WithLookup2.png]]&lt;br /&gt;
&lt;br /&gt;
==== Delay ====&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:Delay1.png]]&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:Delay2.png]]&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
Definitions:&lt;br /&gt;
 Real Delay3;&lt;br /&gt;
 Delay3_delayClass Delay3_delayClass_instance(initialValue = 0, delayTime = 1);&lt;br /&gt;
 class Delay3_delayClass&lt;br /&gt;
 	parameter Real DL = delayTime/3;&lt;br /&gt;
 	parameter Real delayTime;&lt;br /&gt;
 	parameter Real initialValue;&lt;br /&gt;
 	Real delay0;&lt;br /&gt;
 	Real LV1(fixed=true, start=initialValue * DL);&lt;br /&gt;
 	Real delay1;&lt;br /&gt;
 	Real LV2(fixed=true, start=initialValue * DL);&lt;br /&gt;
 	Real delay2;&lt;br /&gt;
 	Real LV3(fixed=true, start=initialValue * DL);&lt;br /&gt;
 	Real delay3;&lt;br /&gt;
 equation&lt;br /&gt;
 	der(LV1) = - delay1 + delay0;&lt;br /&gt;
 	delay1 = LV1 /DL;&lt;br /&gt;
 	der(LV2) = - delay2 + delay1;&lt;br /&gt;
 	delay2 = LV2 /DL;&lt;br /&gt;
 	der(LV3) = - delay3 + delay2;&lt;br /&gt;
 	delay3 = LV3 /DL;&lt;br /&gt;
 end Delay3_delayClass;&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
Equations:&lt;br /&gt;
    Delay3_delayClass_instance.delay0 = Step1;&lt;br /&gt;
    Delay3 = Delay3_delayClass_instance.delay3;&lt;br /&gt;
&lt;br /&gt;
=== Shortcut and Control Keys ===&lt;br /&gt;
&lt;br /&gt;
Shortcut keys for configuring a model on diagram.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Esc	&lt;br /&gt;
|Cancel operations (e.g. connection and rename).&lt;br /&gt;
|-&lt;br /&gt;
|Shift + A	&lt;br /&gt;
|Hover Auxiliary at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + S&lt;br /&gt;
|Hover Stock at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + C&lt;br /&gt;
|Hover Cloud at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + V&lt;br /&gt;
|Hover Valve at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + I&lt;br /&gt;
|Hover Input at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + G&lt;br /&gt;
|Hover Shadow (Ghost) variable at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Alt + left mouse button&lt;br /&gt;
|Start an arrow from a variable. End to another variable by clicking left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Alt + right mouse button&lt;br /&gt;
|Start flow from a variable. End by clicking left mouse button. &amp;lt;br /&amp;gt;If a flow is not started or ended on to a variable, a cloud will be created to that end. &amp;lt;br /&amp;gt;If a new flow does not have a valve at either end, a valve will be created in the middle &amp;lt;br/&amp;gt;of the flow.&lt;br /&gt;
|-&lt;br /&gt;
|Delete&lt;br /&gt;
|Remove selected variables&lt;br /&gt;
|-&lt;br /&gt;
|F2&lt;br /&gt;
|Rename selected variable&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + left mouse button&lt;br /&gt;
|Select multiple variables&lt;br /&gt;
|-&lt;br /&gt;
|Mouse wheel or&amp;lt;br/&amp;gt;+ and -&lt;br /&gt;
|Diagram zoom&lt;br /&gt;
|-&lt;br /&gt;
|drag(mouse3) or&amp;lt;br/&amp;gt;drag(shift + any mouse button) or&amp;lt;br/&amp;gt;&amp;amp;#8592;, &amp;amp;#8593;, &amp;amp;#8595;, &amp;amp;#8594; (arrow keys)&lt;br /&gt;
|Diagram pan&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + C&lt;br /&gt;
|Copy selected elements&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + X&lt;br /&gt;
|Cut selected elements&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + V&lt;br /&gt;
|Paste copied or cut elements&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + F&lt;br /&gt;
|Find element in current diagram or all models&lt;br /&gt;
|-&lt;br /&gt;
|G&lt;br /&gt;
|Show / hide grid&lt;br /&gt;
|-&lt;br /&gt;
|R&lt;br /&gt;
|Show / hide ruler&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Fit diagram contents to screen&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + Space&lt;br /&gt;
|Content assist in equation editor&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other shortcut keys can be found selecting Window -&amp;gt; Preferences from the main menu. Keys are located in General -&amp;gt; Keys.&lt;br /&gt;
&lt;br /&gt;
=== Unit Validation ===&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;a wild card&amp;quot;, e.g., adding a dimensionless variable with a dimensioned one is OK.&lt;br /&gt;
&lt;br /&gt;
Common error sources of unit validation include the following. The respective issues are shown in the picture below. &amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:UnitValidation.png]]&lt;br /&gt;
* The equation of a variable yields a different unit than that defined for the variable.&lt;br /&gt;
* Two variables which have different units are added (+), subtracted (-), or compared (&amp;gt;, &amp;lt;, =, ...).&lt;br /&gt;
* 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.)&lt;br /&gt;
* A function is called with an argument of a prohibited unit.&lt;br /&gt;
* A variable has an empty unit.&lt;br /&gt;
* A variable has a misspelled unit.&lt;br /&gt;
&lt;br /&gt;
Unit validation is enabled for a model by selecting the model or its configuration on the model browser and enabling &amp;quot;Validate units&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
For models that have stocks (i.e., integration), the simulation time unit must be selected from the pull-down menu next to the &amp;quot;Validate units&amp;quot; checkbox in Model Properties tab.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Unit equivalents&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
    Aux1 + time&lt;br /&gt;
yields a warning, it can be fixed be changing the expression to&lt;br /&gt;
    unitCast(Aux1) + time&lt;br /&gt;
, in which case the unit of the expression is that of time, or to&lt;br /&gt;
    Aux1 + unitCast(time)&lt;br /&gt;
, in which case the unit of the expression is that of Aux1.&lt;br /&gt;
&lt;br /&gt;
=== Diagram Profiles ===&lt;br /&gt;
&lt;br /&gt;
Diagram profiles allow selecting which visual effects are enabled. Currently the following profiles can be used:&lt;br /&gt;
&lt;br /&gt;
;Default&lt;br /&gt;
:&#039;&#039;&#039;Issue warnings&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:When enabled, an error or a warning symbol is attached to diagram elements in which there are errors or warnings (usually in the equations).&lt;br /&gt;
:&#039;&#039;&#039;Shadow variable visualizations&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:When enabled, the original and all the shadow variables are highlighted when one is selected.&lt;br /&gt;
&lt;br /&gt;
;Simulation Playback&lt;br /&gt;
:&#039;&#039;&#039;Playback Colors&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:When enabled, colors of the elements on diagram change during a playback experiment.&lt;br /&gt;
&lt;br /&gt;
== Visual model elements ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== Fonts and colors ===&lt;br /&gt;
&lt;br /&gt;
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 -&amp;gt; Preferences -&amp;gt; Sysdyn Diagrams.&lt;br /&gt;
&lt;br /&gt;
=== Dependency properties ===&lt;br /&gt;
&lt;br /&gt;
Dependency arrow properties can be changed on the property view:&lt;br /&gt;
;Polarity&lt;br /&gt;
: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.&lt;br /&gt;
;Location&lt;br /&gt;
:Location of the polarity mark&lt;br /&gt;
;Arrowhead&lt;br /&gt;
:Toggle for showing arrowhead&lt;br /&gt;
;Delay mark&lt;br /&gt;
: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.&lt;br /&gt;
;Line thickness&lt;br /&gt;
:Thickness of the arrow&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
;Loop Items&lt;br /&gt;
:The loop of variables which the loop symbol refers can be selected for visualization purposes.&lt;br /&gt;
;Comment&lt;br /&gt;
:Comment inside the loop. Usually characters &#039;B&#039; and &#039;R&#039; 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 &#039;Auto&#039; determines automatically the type of the loop.&lt;br /&gt;
;Direction of Rotation&lt;br /&gt;
:Direction to which the loop rotates on diagram.&lt;br /&gt;
&lt;br /&gt;
=== Comments ===&lt;br /&gt;
&lt;br /&gt;
Comments are just strings of text.&lt;br /&gt;
&lt;br /&gt;
== Simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Experiments ===&lt;br /&gt;
&lt;br /&gt;
There are three different ways for simulating a model. Different simulations are represented as different types of experiments in Simantics System Dynamics. &lt;br /&gt;
&lt;br /&gt;
Experiments are created from the context menu of experiments folder in a model. &lt;br /&gt;
&lt;br /&gt;
[[File:NewExperiment.png]]&lt;br /&gt;
&lt;br /&gt;
Double-click on an experiment activates it and displays experiment type specific controls in the main tool bar.&lt;br /&gt;
&lt;br /&gt;
;Normal simulation&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
;Game simulation&lt;br /&gt;
:Game simulations allow simulating an arbitrary number of steps, changing parameter values and continuing simulation with the new values from where it previously ended.&lt;br /&gt;
&lt;br /&gt;
;Simulation playback&lt;br /&gt;
:Simulation playback works essentially as the basic experiment, but it offers some additional visualization options.&lt;br /&gt;
&lt;br /&gt;
;Sensitivity analysis simulation&lt;br /&gt;
:Sensitivity analysis allows running [http://en.wikipedia.org/wiki/Multivariate_analysis multivariate] [http://en.wikipedia.org/wiki/Monte_Carlo_method Monte Carlo simulations] with different parameter value sets and to visualize how much the simulation result depends on changes in the selected parameters.&lt;br /&gt;
[[File:SensitivityExperiment.png]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;General&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|The name of the sensitivity analysis experiment. Displayed in e.g. model browser.&lt;br /&gt;
|-&lt;br /&gt;
|Number of runs&lt;br /&gt;
|The total amount of individual simulation runs&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|The method of how the parameter values are selected from the distribution(s). Selecting &amp;quot;Random&amp;quot; yields [http://en.wikipedia.org/wiki/Random_number_generation#.22True.22_random_numbers_vs._pseudo-random_numbers pseudo-random] values, i.e., randomly selected from the distribution(s). Selecting &amp;quot;Halton&amp;quot; yields a [http://en.wikipedia.org/wiki/Quasi-random quasi-random] [http://en.wikipedia.org/wiki/Halton_sequence Halton sequence] of values selected deterministically to represent the distribution(s) better than a pseudo-random series.&lt;br /&gt;
|-&lt;br /&gt;
|Seed&lt;br /&gt;
|The seed number for pseudo-random generator&lt;br /&gt;
|-&lt;br /&gt;
|Add parameter&lt;br /&gt;
|Adds a new parameter to be varied&lt;br /&gt;
|-&lt;br /&gt;
|Remove&lt;br /&gt;
|Removes a parameter&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Parameter properties&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|The full path of the variable of which value is varied. This field has content assistant, which shows the possible variables as you type.&lt;br /&gt;
|-&lt;br /&gt;
|Range&lt;br /&gt;
|Used with multidimensional values to select which dimensions are varied.&lt;br /&gt;
|-&lt;br /&gt;
|Distribution&lt;br /&gt;
|Probability distribution for the varied parameter. &amp;quot;Normal&amp;quot; is for [http://en.wikipedia.org/wiki/Truncated_normal_distribution truncated normal distribution] and &amp;quot;Uniform&amp;quot; for [http://en.wikipedia.org/wiki/Uniform_distribution_(continuous) uniform distribution]. With &amp;quot;Interval&amp;quot; the values have equal intervals between each other and are selected in increasing order. In multivariate sensitivity analyses, it is recommended to select either &amp;quot;Normal&amp;quot; or &amp;quot;Uniform&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Distribution properties&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Min value&lt;br /&gt;
|Minimum value of the distribution&lt;br /&gt;
|-&lt;br /&gt;
|Max value&lt;br /&gt;
|Maximum value of the distribution&lt;br /&gt;
|-&lt;br /&gt;
|Mean&lt;br /&gt;
|Mean of the normal distribution&lt;br /&gt;
|-&lt;br /&gt;
|Standard deviation&lt;br /&gt;
|Standard deviation of the normal distribution&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Solvers ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The solver can be changed in Windows -&amp;gt; Preferences -&amp;gt; Solver.&lt;br /&gt;
&lt;br /&gt;
== Simulation Result and Model Structure Analysis ==&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
;Trend&lt;br /&gt;
: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. &amp;lt;br /&amp;gt; [[File:Trend.png]]&lt;br /&gt;
&lt;br /&gt;
;Values&lt;br /&gt;
: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.&amp;lt;br /&amp;gt; [[File:Values.png]]&lt;br /&gt;
&lt;br /&gt;
;Compare results&lt;br /&gt;
: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 [[File:Saveresults.png]] 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. &amp;lt;br /&amp;gt; [[File:CompareTrend.png]]&lt;br /&gt;
&lt;br /&gt;
;Dependencies&lt;br /&gt;
: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. &amp;lt;br /&amp;gt; [[File:Dependencies.png]]&lt;br /&gt;
&lt;br /&gt;
;Model Hierarchy&lt;br /&gt;
:Model Hierarchy displays the hierarchical structure of the model. The module type where a selected variable is located is highlighted.&amp;lt;br /&amp;gt; [[File:ModelHierarchy.png]]&lt;br /&gt;
&lt;br /&gt;
;Loops&lt;br /&gt;
:Loops display all feedback loops which the selected variable belongs to. &amp;lt;br /&amp;gt; [[File:Loops.png]]&lt;br /&gt;
&lt;br /&gt;
== Custom Charts ==&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
Custom charts are created to the Charts folder in model browser.&lt;br /&gt;
&lt;br /&gt;
[[File:NewChart.png | Creating a new chart]]&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
=== Line Chart ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:LineChart.png|Line chart with an array variable]]&lt;br /&gt;
&lt;br /&gt;
[[File:LineChartGeneral.png|General settings of line chart]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;General&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|The name of the chart. Displayed in e.g. model browser&lt;br /&gt;
|-&lt;br /&gt;
|Title&lt;br /&gt;
|The title of the chart. Displayed in the chart&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Line chart (default) or area chart&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options to hide chart grid, title or legend&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;X-axis&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Optional other label for the variable than its name&lt;br /&gt;
|-&lt;br /&gt;
|Min&lt;br /&gt;
|Minimum value of the x-axis&lt;br /&gt;
|-&lt;br /&gt;
|Max&lt;br /&gt;
|Maximum value of the x-axis&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options to hide x-axis label, line, tick marks and tick labels&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:LineChartAxisAndVariables.png|Axis and variables settings of line chart]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Variable&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|The full path of the variable. This field has content assistant, which shows the possible variables as you type.&lt;br /&gt;
|-&lt;br /&gt;
|Range&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Optional label for the variable. If label is empty, the variable name is displayed.&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|Color for the lines of this variable&lt;br /&gt;
|-&lt;br /&gt;
|Line width&lt;br /&gt;
|The width of the lines drawn for this variable&lt;br /&gt;
|}&lt;br /&gt;
There are also configuration options for y-axis. They are displayed when an axis is selected in the Axis and variables tab.&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Y-axis&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Label of the axis&lt;br /&gt;
|-&lt;br /&gt;
|Min&lt;br /&gt;
|Minimum value in the axis&lt;br /&gt;
|-&lt;br /&gt;
|Max&lt;br /&gt;
|Maximum value in the axis&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|The color of the axis lines, ticks and labels&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options to hide parts of the axis: label, axis line, tick marks, tick labels&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sensitivity Chart ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:SensitivityChart.png|Sensitivity chart with an array variable]]&lt;br /&gt;
&lt;br /&gt;
[[File:SensitivityChartAxisAndVariables.png|Axis and variables settings of sensitivity chart]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Axis and Variables&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|The full path of the variable. This field has content assistant, which shows the possible variables as you type.&lt;br /&gt;
|-&lt;br /&gt;
|Range&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Display median&lt;br /&gt;
|Display the median value of the variable at each time step.&lt;br /&gt;
|-&lt;br /&gt;
|Confidence bounds and colors&lt;br /&gt;
|The confidence bounds in percents and colors for them.&lt;br /&gt;
|}&lt;br /&gt;
There are also configuration options for y-axis. They are displayed when an axis is selected in the Axis and variables tab.&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Y-axis&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Label of the axis&lt;br /&gt;
|-&lt;br /&gt;
|Min&lt;br /&gt;
|Minimum value in the axis&lt;br /&gt;
|-&lt;br /&gt;
|Max&lt;br /&gt;
|Maximum value in the axis&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|The color of the axis lines, ticks and labels&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options to hide parts of the axis: label, axis line, tick marks, tick labels&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Bar Chart ===&lt;br /&gt;
&lt;br /&gt;
Bar charts display variables in a certain point in time. The point can be defined for the complete chart in chart&#039;s general settings and individually for each variable in variable&#039;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. &lt;br /&gt;
&lt;br /&gt;
[[File:BarChartGeneral.png|General bar chart settings]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;General&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|The name of the chart. Name is displayed in model browser.&lt;br /&gt;
|-&lt;br /&gt;
|Title&lt;br /&gt;
|The title of the chart. Title is displayed in the chart, if not hidden&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Normal or stacked. Normal type displays all variables in separate bars. Stacked mode is able to display one-dimensional array variables in stacks.&lt;br /&gt;
|-&lt;br /&gt;
|Time&lt;br /&gt;
|A general time setting for the entire chart. The values at this time are displayed in the chart&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Option for hiding grid, title and Legend. Legend is hidden by default since it only contains the information that the current simulation is displayed.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:BarChartInDiagram.png|Bar chart in a model diagram]]&lt;br /&gt;
&lt;br /&gt;
Charts can be added to model diagrams simply by dragging the chart from model browser to diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:BarChartVariable.png|Settings for a variable in bar chart]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Variable&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Add / Remove&lt;br /&gt;
|Add or remove variables&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|The full path of the variable. This field has content assistant, which shows the possible variables as you type.&lt;br /&gt;
|-&lt;br /&gt;
|Range&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Optional label for the variable. If label is empty, the variable name is displayed&lt;br /&gt;
|-&lt;br /&gt;
|Time&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
[[File:BarChartAxis.png|Settings for axis in bar chart]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Domain axis&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|An optional label for x axis&lt;br /&gt;
|-&lt;br /&gt;
|Label angle&lt;br /&gt;
|Axis labels can be displayed in an angle. This value determines the angle in degrees.&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|The color of the axis line, tick lines and labels&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options for hiding axis label, line, tick marks and tick labels&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Range axis&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|An optional label for y axis&lt;br /&gt;
|-&lt;br /&gt;
|Min&lt;br /&gt;
|Minimum value of y axis&lt;br /&gt;
|-&lt;br /&gt;
|Max&lt;br /&gt;
|Maximum value of y axis&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|The color of the axis line, tick lines and labels&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options for hiding axis label, line, tick marks and tick labels&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pie Chart ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:PieChartGeneral.png|General pie chart settings]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;General&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|The name of the chart. Displayed in e.g. model browser&lt;br /&gt;
|-&lt;br /&gt;
|Title&lt;br /&gt;
|Title	The title of the chart. Displayed in the chart&lt;br /&gt;
|-&lt;br /&gt;
|Time&lt;br /&gt;
|A general time setting for the entire chart. The values at this time are displayed in the chart&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options for hiding title, section labels and legend&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:PieChartVariable.png|Variable settings in pie chart]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Variables&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Add / Remove&lt;br /&gt;
|Add or remove variables&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|The full path of the variable. This field has content assistant, which shows the possible variables as you type.&lt;br /&gt;
|-&lt;br /&gt;
|Range&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Optional label for the variable. If label is empty, the variable name is displayed&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|Color for the sector of this variable&lt;br /&gt;
|-&lt;br /&gt;
|Time&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Exploded&lt;br /&gt;
|If set, the sector(s) of the variable(s) are &amp;quot;exploded&amp;quot; away from the center of the pie chart&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:PieChartChartPanel.png|Pie chart in chart panel]]&lt;br /&gt;
&lt;br /&gt;
=== Chart Panel ===&lt;br /&gt;
&lt;br /&gt;
[[File:ChartPanel.png|right]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Chart panel can be either horizontally or vertically oriented. Different orientations help in configuring the workbench perspective. &lt;br /&gt;
&lt;br /&gt;
[[File:ChartPanelOrientation.png|Chart panel orientation]]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
By default, chart panel is hidden in the upper-right corner of the system dynamics perspective.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multidimensional Variables ==&lt;br /&gt;
&lt;br /&gt;
=== Modeling ===&lt;br /&gt;
&lt;br /&gt;
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):&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Create the model structure&#039;&#039;&#039; &amp;lt;BR /&amp;gt;Model with multidimensional variables looks just like any other model.&amp;lt;BR /&amp;gt; [[File:ModelWithMultidimensionalVariables.png|300px|Model with multidimensional variables]]&lt;br /&gt;
# &#039;&#039;&#039;Create Enumerations and define the indexes&#039;&#039;&#039; &amp;lt;BR /&amp;gt;Enumerations are created by right-clicking configuration and selecting New-&amp;gt;Enumeration.&amp;lt;BR /&amp;gt; [[File:NewEnumeration.png|250px|New enumeration]]&amp;lt;BR /&amp;gt;Define enumeration indexes by adding as many indexes as you want. Rename the indexes by selecting them and then clicking on them again.&amp;lt;BR /&amp;gt;[[File:DefineIndexes.png|200px|Index definitions]]&lt;br /&gt;
# &#039;&#039;&#039;Add Enumerations for variables&#039;&#039;&#039; &amp;lt;BR /&amp;gt;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.[[File:SelectEnumerations.png|500px|Select enumerations for variables]]&lt;br /&gt;
# &#039;&#039;&#039;Define equations for all possible indexes&#039;&#039;&#039; &amp;lt;BR /&amp;gt;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}}.&amp;lt;BR /&amp;gt;[[File:DefineEquations.png|500px|Define equations for all indexes]]&lt;br /&gt;
&lt;br /&gt;
=== Expressions ===&lt;br /&gt;
&lt;br /&gt;
Values for all cells in the variable matrix can be defined in a single expression. &lt;br /&gt;
&lt;br /&gt;
[[File: DefineEquations.png|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:DefineEquations2.png|600px]]&lt;br /&gt;
&lt;br /&gt;
In many situations, it is however more clear to define separate expressions for each cell or blocks. &lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Define range for the expression&#039;&#039;&#039;&amp;lt;BR /&amp;gt; [[File:DefineRange.png]]&lt;br /&gt;
# &#039;&#039;&#039;Define the expression&#039;&#039;&#039; (dimensions of the defined range and the result of the expression must match!) &amp;lt;BR /&amp;gt; [[File:DefineEquations3.png]]&lt;br /&gt;
# &#039;&#039;&#039;Create a new expression&#039;&#039;&#039; &amp;lt;BR /&amp;gt; [[File:CreateNewExpression.png]]&lt;br /&gt;
#&#039;&#039;&#039; Select the new expression&#039;&#039;&#039; &amp;lt;BR /&amp;gt; [[File:SelectNewExpression.png]]&lt;br /&gt;
&lt;br /&gt;
Repeat until there is value for each cell. There must be exactly one value for each cell.&lt;br /&gt;
&lt;br /&gt;
=== Array Slices ===&lt;br /&gt;
&lt;br /&gt;
Many times it is useful to access a slice of a  multidimensional variable. In this chapter, we will use the following example variable:&lt;br /&gt;
 enumeration E1 = one, two, three&lt;br /&gt;
 enumeration E2 = eins, zwei, drei&lt;br /&gt;
 &lt;br /&gt;
 Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}&lt;br /&gt;
&lt;br /&gt;
The whole variable can be accessed in three different ways:&lt;br /&gt;
# Auxiliary&lt;br /&gt;
# Auxiliary[E1, E2]&lt;br /&gt;
# Auxiliary[:, :]&lt;br /&gt;
&lt;br /&gt;
The following explains different methods for accessing parts of the variable&lt;br /&gt;
&lt;br /&gt;
 // Single cell&lt;br /&gt;
 Auxiliary[one, eins] = 1&lt;br /&gt;
&lt;br /&gt;
 // Slices&lt;br /&gt;
 Auxiliary[one, E2] = {1,2,3}&lt;br /&gt;
 Auxiliary[E1, zwei] = {{2},{5},{8}}&lt;br /&gt;
 &lt;br /&gt;
 // In addition to single cells and the whole enumeration range, a subrange of the enumeration can be used&lt;br /&gt;
 Auxiliary[two : three, E2] = {{4,5,6},{7,8,9}}&lt;br /&gt;
 Auxiliary[one : two, zwei : drei]  = {{2,3},{5,6}}&lt;br /&gt;
&lt;br /&gt;
The syntax for accessing parts of variables can be used in both expression range definitions and in expressions.&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
Arithmetic operations are defined in Modelica. Below are examples of different operations.&lt;br /&gt;
&lt;br /&gt;
;Addition and substraction&lt;br /&gt;
Addition and substraction are calculated elementwise&lt;br /&gt;
&lt;br /&gt;
 {1,2,3} - {0,2,3} = {1,0,0}&lt;br /&gt;
 {{2,2},{4,4}} + {{8,8},{1,1}} = {{10,10},{5,5}}&lt;br /&gt;
 {1,2,3} - {1,2} = ERROR! Different array sizes&lt;br /&gt;
&lt;br /&gt;
;Division&lt;br /&gt;
Division with a scalar&lt;br /&gt;
 {5,10,15} / 5 = {1,2,3}&lt;br /&gt;
 5 / {5,10,15} = ERROR! not allowed&lt;br /&gt;
&lt;br /&gt;
Division with an array&lt;br /&gt;
 {1,2,3} / {1,2,3} = ERROR! not allowed&lt;br /&gt;
 &lt;br /&gt;
 // Elementwise&lt;br /&gt;
 {1,2,3} ./ {1,2,3} = {1,1,1}&lt;br /&gt;
&lt;br /&gt;
;Multiplication&lt;br /&gt;
&lt;br /&gt;
Multiplication with a scalar&lt;br /&gt;
 {1,2,3} * 2 = {2,4,6}&lt;br /&gt;
 5 * {1,2,3} = {5,10,15}&lt;br /&gt;
&lt;br /&gt;
Matrix multiplication with an array&lt;br /&gt;
 {{3,4},{5,6}} * {1,2} = {11,17}&lt;br /&gt;
 {{3,4},{5,6}}  * {1,2,3} = ERROR! incompatible array sizes&lt;br /&gt;
 &lt;br /&gt;
 //Elementwise&lt;br /&gt;
 {1,2} .* {1,2} = {1,4}&lt;br /&gt;
 &lt;br /&gt;
 Real[3,2] c = {{1,2},{3,4},{5,6}};  &lt;br /&gt;
 Real[2,2] d = {{3,4},{5,6}};&lt;br /&gt;
 Real[2,2] cd;&lt;br /&gt;
 cd = c[2:3, :] .* d; // Result: {{9,16},{25,36}}&lt;br /&gt;
&lt;br /&gt;
;Power&lt;br /&gt;
Elementwise power of array variable&lt;br /&gt;
 {1,2} .^ 2 = {1,4}&lt;br /&gt;
&lt;br /&gt;
=== Builtin Modelica Functions ===&lt;br /&gt;
&lt;br /&gt;
Modelica has some builtin functions that help using multidimensional variables. This chapter introduces some of the builtin functions. &lt;br /&gt;
&lt;br /&gt;
;Dimension and size functions&lt;br /&gt;
&lt;br /&gt;
We will use the same example variable as previously.&lt;br /&gt;
&lt;br /&gt;
 enumeration E1 = one, two, three&lt;br /&gt;
 enumeration E2 = eins, zwei, drei&lt;br /&gt;
 &lt;br /&gt;
 Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}&lt;br /&gt;
&lt;br /&gt;
;ndims(A)&lt;br /&gt;
The number of dimensions in array A&lt;br /&gt;
 ndims(Auxiliary) = 2&lt;br /&gt;
&lt;br /&gt;
;size(A, i)&lt;br /&gt;
The size of dimension i in array A&lt;br /&gt;
 size(Auxiliary, 2) = 3&lt;br /&gt;
&lt;br /&gt;
;size(A)&lt;br /&gt;
A vector of length ndims(A) containing the dimension sizes of A&lt;br /&gt;
 size(Auxiliary) = {3,3}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Construction functions&lt;br /&gt;
In addition to normal array constructing, a special construction functions can be used.&lt;br /&gt;
&lt;br /&gt;
;zeros(n1,n2,n3,...)&lt;br /&gt;
An array full of zeros with dimensions n1 x n2 x n2 x ... &lt;br /&gt;
 zeros(2, 2) = {{0,0}, {0,0}}&lt;br /&gt;
&lt;br /&gt;
;ones(n1,n2,n3,...)&lt;br /&gt;
An array full of ones with dimensions n1 x n2 x n2 x ... &lt;br /&gt;
 ones(2, 2) = {{1,1}, {1,1}}&lt;br /&gt;
&lt;br /&gt;
;fill(s,n1,n2,n3)&lt;br /&gt;
Like zeros() and ones(), but with user defined value (s) for array elements.&lt;br /&gt;
 fill(3,2,2) = {{3,3}, {3,3}}&lt;br /&gt;
&lt;br /&gt;
;identity(n)&lt;br /&gt;
Creates an n x n integer identity matrix with ones on the diagonal and all other elements zero.&lt;br /&gt;
 identity(3) =&lt;br /&gt;
   1 0 0&lt;br /&gt;
   0 1 0&lt;br /&gt;
   0 0 1&lt;br /&gt;
&lt;br /&gt;
;diagonal(v)&lt;br /&gt;
Constructs a square matrix with elements of vector v on the diagonal and all other elements zero.&lt;br /&gt;
 diagonal({1,2,3}) =&lt;br /&gt;
   1 0 0&lt;br /&gt;
   0 2 0&lt;br /&gt;
   0 0 3&lt;br /&gt;
&lt;br /&gt;
;linspace(x1,x2,n)&lt;br /&gt;
Constracts a Real vector from x1 to x2 with n equally spaced elements.&lt;br /&gt;
 linspace(2,5,4) = {2,3,4,5}&lt;br /&gt;
&lt;br /&gt;
;Reduction functions&lt;br /&gt;
&lt;br /&gt;
Reduction functions reduce arrays to scalars.&lt;br /&gt;
&lt;br /&gt;
;min(A)&lt;br /&gt;
Returns the minimum value in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 min(A) = 1&lt;br /&gt;
&lt;br /&gt;
;max(A)&lt;br /&gt;
Returns the maximum value in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 max(A) = 4&lt;br /&gt;
&lt;br /&gt;
;sum(A)&lt;br /&gt;
Returns the sum of values in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 sum(A) = 10    // 1 + 2 + 3 + 4&lt;br /&gt;
&lt;br /&gt;
;product(A)&lt;br /&gt;
Returns the product of values in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 product(A) = 24   // 1 * 2 * 3 * 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Using functions with iterators&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
 enumeration E1 = one, two, three&lt;br /&gt;
 enumeration E2 = eins, zwei, drei&lt;br /&gt;
 Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}&lt;br /&gt;
 &lt;br /&gt;
 AuxiliarySum[E1] = {sum( Auxiliary[ i , E2 ] ) for i in E1} // Result: {6, 15, 24}&lt;br /&gt;
 &lt;br /&gt;
 /* Same as:&lt;br /&gt;
 {sum(Auxiliary[one, E2]), sum(Auxiliary[two, E2]), sum(Auxiliary[three, E2])}&lt;br /&gt;
 {sum({1,2,3}), sum({4,5,6}), sum({7,8,9})}&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
One expression can have multiple iterators. The Modelica specification defines the following format, but it is NOT yet supported in OpenModelica:&lt;br /&gt;
 {sum(Array[ i, j, E3]) for i in E1, j in E2}  // Dimensions reduced from 3 to 2&lt;br /&gt;
&lt;br /&gt;
To use multiple iterators, use the following format (NOTE the reversed order of iterators!):&lt;br /&gt;
 {{sum(Array[ i, j, E3]) for j in E2} for i in E1}  // Dimensions reduced from 3 to 2&lt;br /&gt;
&lt;br /&gt;
The range doesn&#039;t have to be the whole enumeration. Subranges can also be used.&lt;br /&gt;
 {sum( Auxiliary[ i , eins : zwei ] ) for i in E1.one : E1.two} // Result: {3, 9}&lt;br /&gt;
 &lt;br /&gt;
 /* Same as&lt;br /&gt;
 {sum(Auxiliary[one, eins : zwei]), sum(Auxiliary[two, eins : zwei])}&lt;br /&gt;
 {sum({1,2}), sum({4,5})}&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
=== Simulation Results ===&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:3x3trend.png|300px|Trend view for a 3x3 variable]]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:ShowInCharts.png|500px|Select indexes to show in charts]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Array Variables in Modules ===&lt;br /&gt;
&lt;br /&gt;
[[File:Replaceable.png|frame|Replaceable enumeration inside a module]]&lt;br /&gt;
&lt;br /&gt;
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 [[Simantics_System_Dynamics#Modeling|Modeling]]). &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:ReplacingEnumerationConfiguration.png|frame|left|500px|Module configuration for replacing enumerations inside the module]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the parent configuration, we have used an enumeration with three indexes in the two variables.&lt;br /&gt;
&lt;br /&gt;
[[File:Replacing.png|frame|left|Enumeration in the parent configuration that will replace the enumeration in the module]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ReplacingEnumeration.png|frame|left|Enumeration in the parent configuration that will replace the enumeration in the module]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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!&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
=== Creating Functions ===&lt;br /&gt;
&lt;br /&gt;
[[File:NewFunction.png|right]]&lt;br /&gt;
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-&amp;gt;Function.&lt;br /&gt;
&lt;br /&gt;
Functions that can be found from Functions -folder can be used in your variable definitions.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
Algorithm section defines the actual functionality of the function. In algorithm sections you must use assignments &amp;quot;:=&amp;quot; instead of just plain &amp;quot;=&amp;quot;. All the assignments are calculated in the order they are written.&lt;br /&gt;
&lt;br /&gt;
Below is an example of a simple function. For more examples, see the built-in functions provided with the tool and [https://www.modelica.org/documents/ Modelica specifications].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:ExampleFunction.png]]&lt;br /&gt;
&lt;br /&gt;
=== Function Libraries ===&lt;br /&gt;
&lt;br /&gt;
[[File:NewFunctionLibrary.png|right]]&lt;br /&gt;
&lt;br /&gt;
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)).&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
Create a new function library by right-clicking on Functions folder, Shared functions folder or other module library.&lt;br /&gt;
&lt;br /&gt;
A function library can be exported by right clicking the function library and selecting Export -&amp;gt; Function library. A function library can be imported by right clicking the Functions folder and selecting Import -&amp;gt; Function library. Functions themselves cannot be exported or imported. To export a function, add it into a function library and export that function library.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:SharedFunctions.png]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External Functions ===&lt;br /&gt;
&lt;br /&gt;
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 -&amp;gt; Preferences -&amp;gt; Solver). The installation package with OpenModelica has also MinGW C compiler included that allows to build object files from C source code.&lt;br /&gt;
&lt;br /&gt;
Below is a simple example of using a function that returns the sum of two arguments. &lt;br /&gt;
&lt;br /&gt;
 double exampleCFunction(double x, double y)&lt;br /&gt;
 {&lt;br /&gt;
   double res;&lt;br /&gt;
   res = x + y;&lt;br /&gt;
   return res;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ImportCFunctionLibrary.png|right]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
(e.g. simantics_home/plugins/org.simantics.openmodelica.win32_x/MinGW/bin/mingw32_gcc.exe -g -O -c ExampleCFunctionCode.c). &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:ExampleExternalFunction.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:ExternalFunctionResult.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Small external C function can also be written directly to the function code in Simantics Sysdyn:&lt;br /&gt;
 function ExampleExternalFunction&lt;br /&gt;
 input Real x;&lt;br /&gt;
 input Real y;&lt;br /&gt;
 output Real z;&lt;br /&gt;
 external &amp;quot;C&amp;quot; z=exampleCFunction(x,y) annotation(Include=&amp;quot;&lt;br /&gt;
 double exampleCFunction(double x, double y)&lt;br /&gt;
 {&lt;br /&gt;
   double res;&lt;br /&gt;
   res = x + y;&lt;br /&gt;
   return res;&lt;br /&gt;
 }&amp;quot;);&lt;br /&gt;
 end ExampleExternalFunction;&lt;br /&gt;
&lt;br /&gt;
=== Modelica Functions ===&lt;br /&gt;
&lt;br /&gt;
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 [[Simantics_System_Dynamics#Builtin_Modelica_functions|builtin functions for arrays]].&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|abs(x)&lt;br /&gt;
|Returns the absolute value of x. Expanded into &amp;quot;(if x &amp;gt;= 0 then x else -x)&amp;quot;.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|acos(x)&lt;br /&gt;
|Inverse cosine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|asin(x)&lt;br /&gt;
|Inverse sine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|atan(x)&lt;br /&gt;
|Inverse tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|atan2(x1,x2)&lt;br /&gt;
|four quadrant inverse tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cat(n,A,B,...)&lt;br /&gt;
|General concatenation function that concatenates arrays A,B,... along the nth dimension.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|ceil(x)&lt;br /&gt;
|Returns the smallest integer not less than x, the closest integer above x.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cos(x)&lt;br /&gt;
|Cosine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cosh(x)&lt;br /&gt;
|Hyperbolic cosine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cross(x,y)&lt;br /&gt;
|Returns the 3-vector cross product of the 3-vectors x and y.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|delay(expr, delayTime)&lt;br /&gt;
|Returns the value of expr at the time time-delayTime. The value of expr is returned when time &amp;lt;= time.start + delayTime.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|der(x)&lt;br /&gt;
|Time derivative of x. X must be have continuous-time variability.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|div(x, y)&lt;br /&gt;
|Returns the algebraic quotient x/y with any fractional part discarted. E.g. div(10,3) = 3.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|edge(b)&lt;br /&gt;
|Returns true when the value of the boolean expression b changes. Expanded into (b and not pre(b)).&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|exp(x)&lt;br /&gt;
|Exponential, base e.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|floor(x)&lt;br /&gt;
|Returns the largest integer not greater than x, the closest integer below x.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|initial()&lt;br /&gt;
|Returns true at the beginning of the simulation. &lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|integer(x)&lt;br /&gt;
|Returns the largest integer not greater than x as an integer.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|log(x)&lt;br /&gt;
|Natural logarithm. (base e, x &amp;gt; 0)&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|log10(x)&lt;br /&gt;
|Base 10 logarithm. (x &amp;gt; 0)&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|mod(x, y)&lt;br /&gt;
|Returns the integer modulus of x/y: mod(x,y) = x - floor(x/y) * y.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|noEvent(expr)&lt;br /&gt;
|noEvent around an expression causes the expression to NOT generate event.&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; &lt;br /&gt;
:If you want a condition to be checked only on time steps, use noEvent.&lt;br /&gt;
:(e.g. if noEvent(value &amp;gt;= 1) then ... else ...)&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|pre(x)&lt;br /&gt;
|Returns the preceding value of y from time event that has occured before current time.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|rem(x, y)&lt;br /&gt;
|Returns the integer remainder of x/y: rem(x,y) = x - div(x,y) * y.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sample(start, interval)&lt;br /&gt;
|Returns true and triggers time events at times start + i * interval (i=0,1,...).&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sign(x)&lt;br /&gt;
|Returns -1 if x is negative, 1 if x is positive. Expanded into &amp;quot;(if x &amp;gt; 0 then 1 else if x &amp;lt; 0 then -1 else 0)&amp;quot;.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sin(x)&lt;br /&gt;
|Sine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sinh(x)&lt;br /&gt;
|Hyperbolic sine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sqrt(x)&lt;br /&gt;
|Square root of x. The value of x must be greater or equal to 0 or an assertion error occurs.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|tan(x)&lt;br /&gt;
|Tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|tanh(x)&lt;br /&gt;
|Hyperbolic tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|terminal()&lt;br /&gt;
|Returns true at the end of a successful  simulation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Spreadsheets ==&lt;br /&gt;
&lt;br /&gt;
Spreadsheets allow storing and maintaining values in a familiar format. The current spreadsheet implementation is experimental and does not provide much functionality.&lt;br /&gt;
&lt;br /&gt;
=== Variable Values ===&lt;br /&gt;
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 &amp;quot;Auxiliary&amp;quot; is not necessary in the spreadsheet, but it helps maintaining the sheet.&lt;br /&gt;
&lt;br /&gt;
[[File:AuxiliarySheetReference.png|Sheet reference in an expression]][[File:AuxiliarySheet.png|Value of a variable in sheet]]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:SheetForMultidim.png|Spreadsheet for multidimensional variables]]&lt;br /&gt;
&lt;br /&gt;
Reference to a sheet range creates an array variable.&lt;br /&gt;
&lt;br /&gt;
[[File:SheetMultidim1.png|Array variable ArrayTest1[2] with sheet reference]]&lt;br /&gt;
&lt;br /&gt;
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)))&lt;br /&gt;
&lt;br /&gt;
[[File:SheetMultidim2.png|Array variable ArrayTest2[2,3] with sheet reference]]&lt;br /&gt;
&lt;br /&gt;
=== History Data ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Sheet.png|Spreadsheet with history data]]&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:HistoryDataSettings.png|History data settings]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;History data properties&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Name of the history dataset&lt;br /&gt;
|-&lt;br /&gt;
|Sheet&lt;br /&gt;
|Combo box for selecting a sheet where the history data is located&lt;br /&gt;
|-&lt;br /&gt;
|Orientation&lt;br /&gt;
|Columns or rows. How the data is arranged in the sheet.&lt;br /&gt;
|-&lt;br /&gt;
|Range start&lt;br /&gt;
|The upper-left corner cell of the history data range&lt;br /&gt;
|-&lt;br /&gt;
|Range end&lt;br /&gt;
|The lower-right corner cell of the history data range&lt;br /&gt;
|-&lt;br /&gt;
|Time variable&lt;br /&gt;
|The name of the time variable in the history data, if it is different than &amp;quot;time&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|Variables in range&lt;br /&gt;
|This text field displays the found variables in the given sheet and range&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the history dataset is activated, history data is displayed whenever it is available for a variable that is displayed in a chart.&lt;br /&gt;
&lt;br /&gt;
[[File:HistoryData.png|History data in two charts]]&lt;br /&gt;
&lt;br /&gt;
== Vensim Model Import ==&lt;br /&gt;
&lt;br /&gt;
The tool also has a limited support for importing system dynamics models created with the simulation and modelling tool [http://vensim.com/ Vensim]. This functionality is used similarly to the regular model import, so by right-clicking the browser and selecting &amp;quot;Import&amp;quot; -&amp;gt; &amp;quot;Vensim Model (.mdl)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The import process has several known limitations:&lt;br /&gt;
&lt;br /&gt;
* The Vensim model must be in the .mdl file format, the other Vensim file formats are proprietary and thus not supported.&lt;br /&gt;
* Only variables and connections are imported.&lt;br /&gt;
* Many advanced Vensim features, such as input and output objects (e.g. graphs and parameter value editors) and other diagram customizations, are not supported.&lt;br /&gt;
* Variable value range data is not always imported correctly.&lt;br /&gt;
* Subscripts are automatically converted to enumerations which may sometimes lead into problems as the constructions are not exactly equivalent.&lt;br /&gt;
* Dimensionless units are currently not converted correctly (in Simantics System Dynamics, dimensionless should be indicated with a constant).&lt;br /&gt;
* Non-shadow duplicate variables are sometimes very problematic and may be imported incorrectly, shadow variables should work fine.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
== Sample Models and Molecules ==&lt;br /&gt;
&lt;br /&gt;
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-&amp;gt;Model.&lt;br /&gt;
&lt;br /&gt;
The installation also includes molecular structures in the molecules folder. The molecules are standard structures which can be used to build more complex models. Molecules can be used as such or they can be modified. The easiest way to use a molecule in a model is to import a molecule module to the model. Alternatively, the molecule can be used by copy-pasting the structure of the molecule to the model. The detailed descriptions of the molecules can be found in [http://www.systemswiki.org/images/a/a8/Molecule.pdf http://www.systemswiki.org/images/a/a8/Molecule.pdf] .&lt;br /&gt;
&lt;br /&gt;
NOTE: Some molecules require custom functions to work. Sample implementations of those functions can be used by importing the MoleculeFunctions.sysdynFunctions library to that model which uses the molecule (like it is done in the molecule models, i.e., those in .sysdyn files). Alternatively, the custom functions can be defined by the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[Simantics]] | &#039;&#039;System Dynamics Modelling&#039;&#039;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[image:Preferences-system.svg‎|60px|left]]&lt;br /&gt;
&#039;&#039;&#039;[[Tutorial: Basic System Dynamics Modelling]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[image:Preferences-system.svg‎|60px|left]]&lt;br /&gt;
&#039;&#039;&#039;[[Tutorial: Advanced System Dynamics Modelling]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This tutorial introduces the more advanced features of the system dynamics modelling tool: Modules and Operating interfaces&lt;br /&gt;
&lt;br /&gt;
[[Category: Simantics System Dynamics]]&lt;/div&gt;</summary>
		<author><name>Tuukka Lehtonen</name></author>
	</entry>
	<entry>
		<id>https://wiki.simantics.org/index.php?title=Simantics_System_Dynamics&amp;diff=572</id>
		<title>Simantics System Dynamics</title>
		<link rel="alternate" type="text/html" href="https://wiki.simantics.org/index.php?title=Simantics_System_Dynamics&amp;diff=572"/>
		<updated>2012-06-27T21:57:01Z</updated>

		<summary type="html">&lt;p&gt;Tuukka Lehtonen: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simantics System Dynamics ==&lt;br /&gt;
&lt;br /&gt;
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. New features include module libraries and different analysis tools.&lt;br /&gt;
&lt;br /&gt;
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, [[#Installation Instructions|install]] the software and try our [[Tutorial: Basic System Dynamics Modelling|basic]] and [[Tutorial: Advanced System Dynamics Modelling|advanced]] tutorials!&lt;br /&gt;
&lt;br /&gt;
== Introduction to System Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
===System Dynamics===&lt;br /&gt;
System dynamics is an approach to understanding different organizations, markets and other complex systems and their dynamic behavior. System dynamics modelling in Simantics is a free modelling tool. See [[#Installation Instructions|installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Model===&lt;br /&gt;
[[File:ModelStructure.png|right|thumb|Model structure]]&lt;br /&gt;
System dynamics model is generally understood as the model configuration. In this tool, the model contains also other components. Model can have Operating interfaces that enable the use of the model with simple controls. Operating interfaces are configured separately and when using them, the complex model is hidden from the user. Experiments are the way to simulate the model. In the future, you can have experiments with different configurations, for example different initial values for some parameters. In that way, you don&#039;t have to always configure the model for different scenarios. Modules folder contains all the different module types in your model and you can create new module types there. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Components===&lt;br /&gt;
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.&lt;br /&gt;
[[File:ComponentTypes.png|right|frame|Component types]]&lt;br /&gt;
;Auxiliary&lt;br /&gt;
: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 and WithLookup. Auxiliary is the default type. Parameters are single 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 is a special variable that has an expression and a lookup table. The expresssion defines what value is taken from the defined table.&lt;br /&gt;
;Dependency&lt;br /&gt;
: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.&lt;br /&gt;
;Flow&lt;br /&gt;
: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.&lt;br /&gt;
;Valve&lt;br /&gt;
: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.&lt;br /&gt;
;Stock&lt;br /&gt;
: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. You must give an initial value to the stock. Initial value can be a single value or an equation. You can use values of other variables to calculate the initial value.&lt;br /&gt;
;Cloud&lt;br /&gt;
: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.&lt;br /&gt;
;Module&lt;br /&gt;
: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.&lt;br /&gt;
;Input&lt;br /&gt;
: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&#039;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.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Modeling principles===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
;Variable names&lt;br /&gt;
: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. &lt;br /&gt;
&lt;br /&gt;
:Variable names can and should have multiple words, if they are needed. Unfortunately current version of the tool does not support spaces in variable names. A good practice is to use CamelCase if name contains multiple words. This means that you start every word woth a capital letter (example: ExampleVariable).&lt;br /&gt;
&lt;br /&gt;
;Connections&lt;br /&gt;
:You should try to avoid overlapping dependency arrows. In some situations, however, it is not possible. Dependencies should also form distinctive loops, if there is a loop. It makes it easier to read and understand the model and its behavior.&lt;br /&gt;
&lt;br /&gt;
;Graphical annotations&lt;br /&gt;
:System dynamics contains usually annotations for loops, polarities, delays and so on. Currently those annotations are not supported, but the support will be added later. Annotations are important, again, for communicating the behavior of the model.&lt;br /&gt;
&lt;br /&gt;
==Installation Instructions==&lt;br /&gt;
&lt;br /&gt;
System dynamics tool is a provided with the Simantics platform.&lt;br /&gt;
&lt;br /&gt;
# [https://www.simantics.org/simantics/download Download installer from Simantics download page]&lt;br /&gt;
# Install the program to a directory without spaces (limitation inherited from OpenModelica).&lt;br /&gt;
# Run the application through the launcher generated by the installer&amp;lt;br/&amp;gt;&lt;br /&gt;
: (default: Simantics\Simantics-1.6.0-Sysdyn-32\Simantics-1.6.0-Sysdyn-32)&lt;br /&gt;
&lt;br /&gt;
[http://www.openmodelica.org/ OpenModelica] is used to build and simulate the models. Simantics platform has integrated OpenModelica 1.8.1 for Windows environments. For other versions and other environments you need to install [http://www.openmodelica.org/index.php/download OpenModelica].&lt;br /&gt;
&lt;br /&gt;
== Workbench ==&lt;br /&gt;
&lt;br /&gt;
[[File:BasicWorkbench.png|center|729px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Diagram&#039;&#039;&#039; &amp;lt;br /&amp;gt; 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. &lt;br /&gt;
# &#039;&#039;&#039;Model Browser&#039;&#039;&#039; &amp;lt;br /&amp;gt; Model browser shows the structure of your model and all items related to it. &amp;lt;br /&amp;gt; Symbols view is stacked with the model browser and used for dragging elements to diagrams.&lt;br /&gt;
# &#039;&#039;&#039;Properties&#039;&#039;&#039; &amp;lt;br /&amp;gt; Property view shows the selected variable&#039;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 are with variables are Equation and Additional information.&lt;br /&gt;
# &#039;&#039;&#039;Trend&#039;&#039;&#039; &amp;lt;br /&amp;gt; Trend 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. Values view and Dependencies are stacked with Trend view and can also be used for analyzing the model.&lt;br /&gt;
# &#039;&#039;&#039;Experiment controls&#039;&#039;&#039; &amp;lt;br /&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If you accidentally close a view, you can reopen them from Window-&amp;gt;Show View-&amp;gt;Other...&lt;br /&gt;
&lt;br /&gt;
== Modelling ==&lt;br /&gt;
&lt;br /&gt;
===Basic modelling===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Basic_1.png|right]]&lt;br /&gt;
;Creating a new model&lt;br /&gt;
:Start a new model by right-clicking the model browser and selecting New-&amp;gt;Model or from the main menu File-&amp;gt;New Model.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Basic_2.png|right]]&lt;br /&gt;
;Creating a new module type&lt;br /&gt;
:Create a new module type by right-clicking on the Modules-folder and selecting New-&amp;gt;Module. This creates a new module type that you can populate to your other modules and the model configuration. &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Configuring a model&lt;br /&gt;
:Model configuration can be opened by double clicking Configuration in the model browser. &lt;br /&gt;
&lt;br /&gt;
;Configuring modules&lt;br /&gt;
: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 module!&lt;br /&gt;
&lt;br /&gt;
;Populate variables&lt;br /&gt;
:You can drag variables to a diagram from symbol view. You can also populate variables using [[#Shortcut and control keys|shortcut keys]]&lt;br /&gt;
&lt;br /&gt;
;Populate modules&lt;br /&gt;
:Modules are populated from the model browser. Just drag the module you want to populate from the Modules folder to a diagram.&lt;br /&gt;
&lt;br /&gt;
;Create connections&lt;br /&gt;
: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.&lt;br /&gt;
: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.&lt;br /&gt;
:There are some restrictions on what connections can be made, but don&#039;t worry, the user interface won&#039;t let you do connections that are not allowed.&lt;br /&gt;
&lt;br /&gt;
;Connections between modules&lt;br /&gt;
:&#039;&#039;&#039;Outside the module&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:You can connect variables to variables in modules like this:&lt;br /&gt;
 MODULE -----&amp;gt; INPUT&lt;br /&gt;
 or&lt;br /&gt;
 ANY VARIABLE -----&amp;gt; MODULE &lt;br /&gt;
:This is just the visual configuration, but you need those connections to really connect variables in the module&#039;s properties.&lt;br /&gt;
:In Inputs -tab you select which variables you connect to inputs inside the module. In Outputs -tab you select which variables you lift from the module to inputs outside it.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Inside the module&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:Input variables get values from outside the module&lt;br /&gt;
&lt;br /&gt;
:Output variables can send their values outside the module. From the variable properties, select Additional Information and press Is Output&lt;br /&gt;
&lt;br /&gt;
;Configure variables&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
;Export model&lt;br /&gt;
:To export your model to a file, select your model from the model browser, right-click and from the context menu choose Export-&amp;gt;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 to for example create different versions of the model, create backups or to transport it to another database.&lt;br /&gt;
&lt;br /&gt;
;Import model&lt;br /&gt;
:Right-click on the model browser and select Import-&amp;gt;Model. Browse to your .tg file and select open. The model is added to your model browser.&lt;br /&gt;
&lt;br /&gt;
===Shortcut and control keys===&lt;br /&gt;
&lt;br /&gt;
Shortcut keys for configuring a model on diagram.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Esc	&lt;br /&gt;
|Cancel operations (e.g. connection and rename).&lt;br /&gt;
|-&lt;br /&gt;
|Shift + A	&lt;br /&gt;
|Hover Auxiliary at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + S&lt;br /&gt;
|Hover Stock at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + C&lt;br /&gt;
|Hover Cloud at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + V&lt;br /&gt;
|Hover Valve at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + I&lt;br /&gt;
|Hover Input at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Alt + left mouse button&lt;br /&gt;
|Start an arrow from a variable. End to another variable by clicking left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Alt + right mouse button&lt;br /&gt;
|Start flow from a variable. End by clicking left mouse button.&lt;br /&gt;
&lt;br /&gt;
If a flow is not started or ended on to a variable, a cloud will be created to that end. &amp;lt;br /&amp;gt;&lt;br /&gt;
If a new flow does not have a valve at either end, a valve will be created in the middle of the flow.&lt;br /&gt;
|-&lt;br /&gt;
|Delete&lt;br /&gt;
|Remove selected variables&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + left mouse button&lt;br /&gt;
|Select multiple variables&lt;br /&gt;
|-&lt;br /&gt;
|Mouse wheel or&amp;lt;br/&amp;gt;+ and -&lt;br /&gt;
|Diagram zoom&lt;br /&gt;
|-&lt;br /&gt;
|drag(mouse3) or&amp;lt;br/&amp;gt;drag(shift + any mouse button)&lt;br /&gt;
|Diagram pan&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + C&lt;br /&gt;
|Copy selected elements&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + X&lt;br /&gt;
|Cut selected elements&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + V&lt;br /&gt;
|Paste copied or cut elements&lt;br /&gt;
|-&lt;br /&gt;
|G&lt;br /&gt;
|Show / hide grid&lt;br /&gt;
|-&lt;br /&gt;
|R&lt;br /&gt;
|Show / hide ruler&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other shortcut keys can be found selecting Window -&amp;gt; Preferences from the main menu. Keys are located in General -&amp;gt; Keys.&lt;br /&gt;
&lt;br /&gt;
== Simulation ==&lt;br /&gt;
There are three different ways for simulating a model. Different simulations are represented as different types of experiments in Simantics System Dynamics. &lt;br /&gt;
&lt;br /&gt;
Experiments are created from the context menu of experiments folder in a model. &lt;br /&gt;
&lt;br /&gt;
[[File:NewExperiment.png]]&lt;br /&gt;
&lt;br /&gt;
Double-click on an experiment activates it and displays experiment type specific controls in the main tool bar.&lt;br /&gt;
&lt;br /&gt;
;Normal simulation&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
;Game simulation&lt;br /&gt;
:Game simulations allow simulating an arbitrary number of steps, changing parameter values and continuing simulation with the new values from where it previously ended.&lt;br /&gt;
&lt;br /&gt;
;Simulation playback&lt;br /&gt;
:Simulation playback works essentially as the basic experiment, but it offers some additional visualization options.&lt;br /&gt;
&lt;br /&gt;
== Simulation result and model structure analysis ==&lt;br /&gt;
Simulation results can be viewed as trends in trend view or as plain numbers in values view. The views display results of variables that are selected in the workbench. Users can also create [[#Custom charts |custom charts]].&lt;br /&gt;
&lt;br /&gt;
Model structure can be examined in the Structure view. There are two options: Dependency structures of individual variables or the complete hierarchy structure of the model.&lt;br /&gt;
&lt;br /&gt;
;Trend&lt;br /&gt;
: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. &amp;lt;br /&amp;gt; [[File:Trend.png]]&lt;br /&gt;
&lt;br /&gt;
;Values&lt;br /&gt;
: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.&amp;lt;br /&amp;gt; [[File:Values.png]]&lt;br /&gt;
&lt;br /&gt;
;Compare results&lt;br /&gt;
: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 button [[File:Saveresults.png]] 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. &amp;lt;br /&amp;gt; [[File:CompareTrend.png]]&lt;br /&gt;
&lt;br /&gt;
;Dependencies&lt;br /&gt;
: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. &amp;lt;br /&amp;gt; [[File:Dependencies.png]]&lt;br /&gt;
&lt;br /&gt;
;Model Hierarchy&lt;br /&gt;
:Model Hierarchy displays the hierarchical structure of the model. The module type where a selected variable is located is highlighted.&amp;lt;br /&amp;gt; [[File:ModelHierarchy.png]]&lt;br /&gt;
&lt;br /&gt;
== Custom charts ==&lt;br /&gt;
Custom charts are user-defined displays of simulation result data. They can be used and re-used in various places. The three types of custom charts (line, bar and pie charts) provide model developers means for examining and developing their models and communicating the simulation results to others. &lt;br /&gt;
&lt;br /&gt;
Custom charts are created to the Charts folder in model browser.&lt;br /&gt;
&lt;br /&gt;
[[File:NewChart.png | Creating a new chart]]&lt;br /&gt;
&lt;br /&gt;
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 or to a separate chart panel that can contain multiple charts. &lt;br /&gt;
&lt;br /&gt;
=== Line chart ===&lt;br /&gt;
&lt;br /&gt;
Line char 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.&lt;br /&gt;
&lt;br /&gt;
[[File:LineChart.png|Line chart with an array variable]]&lt;br /&gt;
&lt;br /&gt;
[[File:LineChartGeneral.png|General settings of line chart]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;General&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|The name of the chart. Displayed in e.g. model browser&lt;br /&gt;
|-&lt;br /&gt;
|Title&lt;br /&gt;
|The title of the chart. Displayed in the chart&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Line chart (default) or area chart&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options to hide chart grid, title or legend&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;X-axis&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Optional other label for the variable than its name&lt;br /&gt;
|-&lt;br /&gt;
|Min&lt;br /&gt;
|Minimum value of the x-axis&lt;br /&gt;
|-&lt;br /&gt;
|Max&lt;br /&gt;
|Maximum value of the x-axis&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options to hide x-axis lable, line, tick marks and tick labels&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:LineChartAxisAndVariables.png|Axis and variables settings of line chart]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Variable&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|The full path of the variable. This field has content assistant, which shows the possible variables as you type.&lt;br /&gt;
|-&lt;br /&gt;
|Range&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Optional label for the variable. If label is empty, the variable name is displayed.&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|Color for the lines of this variable&lt;br /&gt;
|-&lt;br /&gt;
|Line width&lt;br /&gt;
|The width of the lines drawn for this variable&lt;br /&gt;
|}&lt;br /&gt;
There are also configuration options for y-axis. They are displayed when an axis is selected in the Axis and variables tab.&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Y-axis&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Label of the axis&lt;br /&gt;
|-&lt;br /&gt;
|Min&lt;br /&gt;
|Minimum value in the axis&lt;br /&gt;
|-&lt;br /&gt;
|Max&lt;br /&gt;
|Maximum value in the axis&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|The color of the axis lines, ticks and labels&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options to hide parts of the axis: label, axis line, tick marks, tick labels&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Bar chart ===&lt;br /&gt;
Bar charts display variables in a certain point in time. The point can be defined for the complete chart in cart&#039;s general settings and individually for each variable in variable&#039;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. &lt;br /&gt;
&lt;br /&gt;
[[File:BarChartGeneral.png|General bar chart settings]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;General&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|The name of the chart. Name is displayed in model browser.&lt;br /&gt;
|-&lt;br /&gt;
|Title&lt;br /&gt;
|The title of the chart. Title is displayed in the chart, if not hidden&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Normal or stacked. Normal type displays all variables in separate bars. Stacked mode is able to display one-dimensional array variables in stacks.&lt;br /&gt;
|-&lt;br /&gt;
|Time&lt;br /&gt;
|A general time setting for the entire chart. The values at this time are displayed in the chart&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Option for hiding grid, title and Legend. Legend is hidden by default since it only contains the information that the current simulation is displayed.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:BarChartInDiagram.png|Bar chart in a model diagram]]&lt;br /&gt;
&lt;br /&gt;
Charts can be added to model diagrams simply by dragging the chart from model browser to diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:BarChartVariable.png|Settings for a variable in bar chart]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Variable&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Add / Remove&lt;br /&gt;
|Add or remove variables&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|The full path of the variable. This field has content assistant, which shows the possible variables as you type.&lt;br /&gt;
|-&lt;br /&gt;
|Range&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Optional label for the variable. If label is empty, the variable name is displayed&lt;br /&gt;
|-&lt;br /&gt;
|Time&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
[[File:BarChartAxis.png|Settings for axis in bar chart]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Domain axis&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|An optional label for x axis&lt;br /&gt;
|-&lt;br /&gt;
|Label angle&lt;br /&gt;
|Axis labels can be displayed in an angle. This value determines the angle in degrees.&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|The color of the axis line, tick lines and labels&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options for hiding axis label, line, tick marks and tick labels&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Range axis&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|An optional label for y axis&lt;br /&gt;
|-&lt;br /&gt;
|Min&lt;br /&gt;
|Minimum value of y axis&lt;br /&gt;
|-&lt;br /&gt;
|Max&lt;br /&gt;
|Maximum value of y axis&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|The color of the axis line, tick lines and labels&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options for hiding axis label, line, tick marks and tick labels&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pie chart ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:PieChartGeneral.png|General pie chart settings]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;General&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|The name of the chart. Displayed in e.g. model browser&lt;br /&gt;
|-&lt;br /&gt;
|Title&lt;br /&gt;
|Title	The title of the chart. Displayed in the chart&lt;br /&gt;
|-&lt;br /&gt;
|Time&lt;br /&gt;
|A general time setting for the entire chart. The values at this time are displayed in the chart&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options for hiding title, section labels and legend&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:PieChartVariable.png|Variable settings in pie chart]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Variables&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Add / Remove&lt;br /&gt;
|Add or remove variables&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|The full path of the variable. This field has content assistant, which shows the possible variables as you type.&lt;br /&gt;
|-&lt;br /&gt;
|Range&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Optional label for the variable. If label is empty, the variable name is displayed&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|Color for the sector of this variable&lt;br /&gt;
|-&lt;br /&gt;
|Time&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Exploded&lt;br /&gt;
|If set, the sector(s) of the variable(s) are &amp;quot;exploded&amp;quot; away from the center of the pie chart&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:PieChartChartPanel.png|Pie chart in chart panel]]&lt;br /&gt;
&lt;br /&gt;
=== Chart panel ===&lt;br /&gt;
[[File:ChartPanel.png|right]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Chart panel can be either horizontally or vertically oriented. Different orientations help in configuring the workbench perspective. &lt;br /&gt;
&lt;br /&gt;
[[File:ChartPanelOrientation.png|Chart panel orientation]]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
By default, chart panel is hidden in the upper-left corner of the system dynamics perspective.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multidimensional variables ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modeling ===&lt;br /&gt;
&lt;br /&gt;
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):&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Create the model structure&#039;&#039;&#039; &amp;lt;BR /&amp;gt;Model with multidimensional variables looks just like any other model.&amp;lt;BR /&amp;gt; [[File:ModelWithMultidimensionalVariables.png|300px|Model with multidimensional variables]]&lt;br /&gt;
# &#039;&#039;&#039;Create Enumerations and define the indexes&#039;&#039;&#039; &amp;lt;BR /&amp;gt;Enumerations are created by right-clicking configuration and selecting New-&amp;gt;Enumeration.&amp;lt;BR /&amp;gt; [[File:NewEnumeration.png|250px|New enumeration]]&amp;lt;BR /&amp;gt;Define enumeration indexes by adding as many indexes as you want. Rename the indexes by selecting them and then clicking on them again.&amp;lt;BR /&amp;gt;[[File:DefineIndexes.png|200px|Index definitions]]&lt;br /&gt;
# &#039;&#039;&#039;Add Enumerations for variables&#039;&#039;&#039; &amp;lt;BR /&amp;gt;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.[[File:SelectEnumerations.png|500px|Select enumerations for variables]]&lt;br /&gt;
# &#039;&#039;&#039;Define equations for all possible indexes&#039;&#039;&#039; &amp;lt;BR /&amp;gt;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}}.&amp;lt;BR /&amp;gt;[[File:DefineEquations.png|500px|Define equations for all indexes]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Expressions ===&lt;br /&gt;
&lt;br /&gt;
Values for all cells in the variable matrix can be defined in a single expression. &lt;br /&gt;
&lt;br /&gt;
[[File: DefineEquations.png|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:DefineEquations2.png|600px]]&lt;br /&gt;
&lt;br /&gt;
In many situations, it is however more clear to define separate expressions for each cell or blocks. &lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Define range for the expression&#039;&#039;&#039;&amp;lt;BR /&amp;gt; [[File:DefineRange.png]]&lt;br /&gt;
# &#039;&#039;&#039;Define the expression&#039;&#039;&#039; (dimensions of the defined range and the result of the expression must match!) &amp;lt;BR /&amp;gt; [[File:DefineEquations3.png]]&lt;br /&gt;
# &#039;&#039;&#039;Create a new expression&#039;&#039;&#039; &amp;lt;BR /&amp;gt; [[File:CreateNewExpression.png]]&lt;br /&gt;
#&#039;&#039;&#039; Select the new expression&#039;&#039;&#039; &amp;lt;BR /&amp;gt; [[File:SelectNewExpression.png]]&lt;br /&gt;
&lt;br /&gt;
Repeat until there is value for each cell. There must be exactly one value for each cell.&lt;br /&gt;
&lt;br /&gt;
=== Array slices ===&lt;br /&gt;
&lt;br /&gt;
Many times it is useful to access a slice of a  multidimensional variable. In this chapter, we will use the following example variable:&lt;br /&gt;
 enumeration E1 = one, two, three&lt;br /&gt;
 enumeration E2 = eins, zwei, drei&lt;br /&gt;
 &lt;br /&gt;
 Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}&lt;br /&gt;
&lt;br /&gt;
The whole variable can be accessed in three different ways:&lt;br /&gt;
# Auxiliary&lt;br /&gt;
# Auxiliary[E1, E2]&lt;br /&gt;
# Auxiliary[:, :]&lt;br /&gt;
&lt;br /&gt;
The following explains different methods for accessing parts of the variable&lt;br /&gt;
&lt;br /&gt;
 // Single cell&lt;br /&gt;
 Auxiliary[one, eins] = 1&lt;br /&gt;
&lt;br /&gt;
 // Slices&lt;br /&gt;
 Auxiliary[one, E2] = {1,2,3}&lt;br /&gt;
 Auxiliary[E1, zwei] = {{2},{5},{8}}&lt;br /&gt;
 &lt;br /&gt;
 // In addition to single cells and the whole enumeration range, a subrange of the enumeration can be used&lt;br /&gt;
 Auxiliary[two : three, E2] = {{4,5,6},{7,8,9}}&lt;br /&gt;
 Auxiliary[one : two, zwei : drei]  = {{2,3},{5,6}}&lt;br /&gt;
&lt;br /&gt;
The syntax for accessing parts of variables can be used in both expression range definitions and in expressions.&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
Arithmetic operations are defined in Modelica. Below are examples of different operations.&lt;br /&gt;
&lt;br /&gt;
;Addition and substraction&lt;br /&gt;
Addition and substraction are calculated elementwise&lt;br /&gt;
&lt;br /&gt;
 {1,2,3} - {0,2,3} = {1,0,0}&lt;br /&gt;
 {{2,2},{4,4}} + {{8,8},{1,1}} = {{10,10},{5,5}}&lt;br /&gt;
 {1,2,3} - {1,2} = ERROR! Different array sizes&lt;br /&gt;
&lt;br /&gt;
;Division&lt;br /&gt;
Division with a scalar&lt;br /&gt;
 {5,10,15} / 5 = {1,2,3}&lt;br /&gt;
 5 / {5,10,15} = ERROR! not allowed&lt;br /&gt;
&lt;br /&gt;
Division with an array&lt;br /&gt;
 {1,2,3} / {1,2,3} = ERROR! not allowed&lt;br /&gt;
 &lt;br /&gt;
 // Elementwise&lt;br /&gt;
 {1,2,3} ./ {1,2,3} = {1,1,1}&lt;br /&gt;
&lt;br /&gt;
;Multiplication&lt;br /&gt;
&lt;br /&gt;
Multiplication with a scalar&lt;br /&gt;
 {1,2,3} * 2 = {2,4,6}&lt;br /&gt;
 5 * {1,2,3} = {5,10,15}&lt;br /&gt;
&lt;br /&gt;
Matrix multiplication with an array&lt;br /&gt;
 {{3,4},{5,6}} * {1,2} = {11,17}&lt;br /&gt;
 {{3,4},{5,6}}  * {1,2,3} = ERROR! incompatible array sizes&lt;br /&gt;
 &lt;br /&gt;
 //Elementwise&lt;br /&gt;
 {1,2} .* {1,2} = {1,4}&lt;br /&gt;
 &lt;br /&gt;
 Real[3,2] c = {{1,2},{3,4},{5,6}};  &lt;br /&gt;
 Real[2,2] d = {{3,4},{5,6}};&lt;br /&gt;
 Real[2,2] cd;&lt;br /&gt;
 cd = c[2:3, :] .* d; // Result: {{9,16},{25,36}}&lt;br /&gt;
&lt;br /&gt;
=== Builtin Modelica functions ===&lt;br /&gt;
&lt;br /&gt;
Modelica has some builtin functions that help using multidimensional variables. This chapter introduces some of the builtin functions. &lt;br /&gt;
&lt;br /&gt;
;Dimension and size functions&lt;br /&gt;
&lt;br /&gt;
We will use the same example variable as previously.&lt;br /&gt;
&lt;br /&gt;
 enumeration E1 = one, two, three&lt;br /&gt;
 enumeration E2 = eins, zwei, drei&lt;br /&gt;
 &lt;br /&gt;
 Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}&lt;br /&gt;
&lt;br /&gt;
;ndims(A)&lt;br /&gt;
The number of dimensions in array A&lt;br /&gt;
 ndims(Auxiliary) = 2&lt;br /&gt;
&lt;br /&gt;
;size(A, i)&lt;br /&gt;
The size of dimension i in array A&lt;br /&gt;
 size(Auxiliary, 2) = 3&lt;br /&gt;
&lt;br /&gt;
;size(A)&lt;br /&gt;
A vector of length ndims(A) containing the dimension sizes of A&lt;br /&gt;
 size(Auxiliary) = {3,3}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Construction functions&lt;br /&gt;
In addition to normal array constructing, a special construction functions can be used.&lt;br /&gt;
&lt;br /&gt;
;zeros(n1,n2,n3,...)&lt;br /&gt;
An array full of zeros with dimensions n1 x n2 x n2 x ... &lt;br /&gt;
 zeros(2, 2) = {{0,0}, {0,0}}&lt;br /&gt;
&lt;br /&gt;
;ones(n1,n2,n3,...)&lt;br /&gt;
An array full of ones with dimensions n1 x n2 x n2 x ... &lt;br /&gt;
 ones(2, 2) = {{1,1}, {1,1}}&lt;br /&gt;
&lt;br /&gt;
;fill(s,n1,n2,n3)&lt;br /&gt;
Like zeros() and ones(), but with user defined value (s) for array elements.&lt;br /&gt;
 fill(3,2,2) = {{3,3}, {3,3}}&lt;br /&gt;
&lt;br /&gt;
;identity(n)&lt;br /&gt;
Creates an n x n integer identity matrix with ones on the diagonal and all other elements zero.&lt;br /&gt;
 identity(3) =&lt;br /&gt;
   1 0 0&lt;br /&gt;
   0 1 0&lt;br /&gt;
   0 0 1&lt;br /&gt;
&lt;br /&gt;
;diagonal(v)&lt;br /&gt;
Constructs a square matrix with elements of vector v on the diagonal and all other elements zero.&lt;br /&gt;
 diagonal({1,2,3}) =&lt;br /&gt;
   1 0 0&lt;br /&gt;
   0 2 0&lt;br /&gt;
   0 0 3&lt;br /&gt;
&lt;br /&gt;
;linspace(x1,x2,n)&lt;br /&gt;
Constracts a Real vector from x1 to x2 with n equally spaced elements.&lt;br /&gt;
 linspace(2,5,4) = {2,3,4,5}&lt;br /&gt;
&lt;br /&gt;
;Reduction functions&lt;br /&gt;
&lt;br /&gt;
Reduction functions reduce arrays to scalars.&lt;br /&gt;
&lt;br /&gt;
;min(A)&lt;br /&gt;
Returns the minimum value in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 min(A) = 1&lt;br /&gt;
&lt;br /&gt;
;max(A)&lt;br /&gt;
Returns the maximum value in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 max(A) = 4&lt;br /&gt;
&lt;br /&gt;
;sum(A)&lt;br /&gt;
Returns the sum of values in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 sum(A) = 10    // 1 + 2 + 3 + 4&lt;br /&gt;
&lt;br /&gt;
;product(A)&lt;br /&gt;
Returns the product of values in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 product(A) = 24   // 1 * 2 * 3 * 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Using functions with iterators&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
 enumeration E1 = one, two, three&lt;br /&gt;
 enumeration E2 = eins, zwei, drei&lt;br /&gt;
 Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}&lt;br /&gt;
 &lt;br /&gt;
 AuxiliarySum[E1] = {sum( Auxiliary[ i , E2 ] ) for i in E1} // Result: {6, 15, 24}&lt;br /&gt;
 &lt;br /&gt;
 /* Same as:&lt;br /&gt;
 {sum(Auxiliary[one, E2]), sum(Auxiliary[two, E2]), sum(Auxiliary[three, E2])}&lt;br /&gt;
 {sum({1,2,3}), sum({4,5,6}), sum({7,8,9})}&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
One expression can have multiple iterators. The Modelica specification defines the following format, but it is NOT yet supported in OpenModelica:&lt;br /&gt;
 {sum(Array[ i, j, E3]) for i in E1, j in E2}  // Dimensions reduced from 3 to 2&lt;br /&gt;
&lt;br /&gt;
To use multiple iterators, use the following format (NOTE the reversed order of iterators!):&lt;br /&gt;
 {{sum(Array[ i, j, E3]) for j in E2} for i in E1}  // Dimensions reduced from 3 to 2&lt;br /&gt;
&lt;br /&gt;
The range doesn&#039;t have to be the whole enumeration. Subranges can also be used.&lt;br /&gt;
 {sum( Auxiliary[ i , eins : zwei ] ) for i in E1.one : E1.two} // Result: {3, 9}&lt;br /&gt;
 &lt;br /&gt;
 /* Same as&lt;br /&gt;
 {sum(Auxiliary[one, eins : zwei]), sum(Auxiliary[two, eins : zwei])}&lt;br /&gt;
 {sum({1,2}), sum({4,5})}&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
=== Simulation results ===&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:3x3trend.png|300px|Trend view for a 3x3 variable]]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:ShowInCharts.png|500px|Select indexes to show in charts]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Array Variables in Modules ===&lt;br /&gt;
&lt;br /&gt;
[[File:Replaceable.png|frame|Replaceable enumeration inside a module]]&lt;br /&gt;
&lt;br /&gt;
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 [[Simantics_System_Dynamics#Modeling|Modeling]]). &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:ReplacingEnumerationConfiguration.png|frame|left|500px|Module configuration for replacing enumerations inside the module]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the parent configuration, we have used an enumeration with three indexes in the two variables.&lt;br /&gt;
&lt;br /&gt;
[[File:Replacing.png|frame|left|Enumeration in the parent configuration that will replace the enumeration in the module]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ReplacingEnumeration.png|frame|left|Enumeration in the parent configuration that will replace the enumeration in the module]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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!&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
&lt;br /&gt;
Modelica provides a convenient way to use functions in your models. You can create your own functions, import complete function libraries and share function libraries to be used in all of your models. &lt;br /&gt;
&lt;br /&gt;
=== Creating functions ===&lt;br /&gt;
&lt;br /&gt;
[[File:NewFunction.png|right]]&lt;br /&gt;
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-&amp;gt;Function.&lt;br /&gt;
&lt;br /&gt;
Functions that can be found from Functions -folder can be used in your variable definitions.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
Algorithm section defines the actual functionality of the function. In algorithm sections you must use assignments &amp;quot;:=&amp;quot; instead of just plain &amp;quot;=&amp;quot;. All the assignments are calculated in the order they are written.&lt;br /&gt;
&lt;br /&gt;
Below is an example of a simple function. For more examples, see the built-in functions provided with the tool and [https://www.modelica.org/documents/ Modelica specifications].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:ExampleFunction.png]]&lt;br /&gt;
&lt;br /&gt;
=== Function libraries ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NewFunctionLibrary.png|right]]&lt;br /&gt;
&lt;br /&gt;
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)).&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
Create a new function library by right-clicking on Functions folder, Shared functions folder or other module library.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:SharedFunctions.png]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External functions ===&lt;br /&gt;
&lt;br /&gt;
Modelica allows you to use external functions that are programmed using C language. Below is a simple example of using a function that returns the sum of two arguments. &lt;br /&gt;
&lt;br /&gt;
 double exampleCFunction(double x, double y)&lt;br /&gt;
 {&lt;br /&gt;
   double res;&lt;br /&gt;
   res = x + y;&lt;br /&gt;
   return res;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ImportCFunctionLibrary.png|right]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
(e.g. simantics_home/plugins/org.simantics.openmodelica.win32_x/MinGW/bin/mingw32_gcc.exe -g -O -c ExampleCFunctionCode.c). &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:ExampleExternalFunction.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:ExternalFunctionResult.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Small external C function can also be written directly to the function code in Simantics Sysdyn:&lt;br /&gt;
 function ExampleExternalFunction&lt;br /&gt;
 input Real x;&lt;br /&gt;
 input Real y;&lt;br /&gt;
 output Real z;&lt;br /&gt;
 external &amp;quot;C&amp;quot; z=exampleCFunction(x,y) annotation(Include=&amp;quot;&lt;br /&gt;
 double exampleCFunction(double x, double y)&lt;br /&gt;
 {&lt;br /&gt;
   double res;&lt;br /&gt;
   res = x + y;&lt;br /&gt;
   return res;&lt;br /&gt;
 }&amp;quot;);&lt;br /&gt;
 end ExampleExternalFunction;&lt;br /&gt;
&lt;br /&gt;
=== Modelica functions ===&lt;br /&gt;
&lt;br /&gt;
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 [[Simantics_System_Dynamics#Builtin_functions|builtin functions for arrays]].&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|abs(x)&lt;br /&gt;
|Returns the absolute value of x. Expanded into &amp;quot;(if x &amp;gt;= 0 then x else -x)&amp;quot;.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|acos(x)&lt;br /&gt;
|Inverse cosine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|asin(x)&lt;br /&gt;
|Inverse sine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|atan(x)&lt;br /&gt;
|Inverse tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|atan2(x1,x2)&lt;br /&gt;
|four quadrant inverse tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cat(n,A,B,...)&lt;br /&gt;
|General concatenation function that concatenates arrays A,B,... along the nth dimension.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|ceil(x)&lt;br /&gt;
|Returns the smallest integer not less than x, the closest integer above x.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cos(x)&lt;br /&gt;
|Cosine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cosh(x)&lt;br /&gt;
|Hyperbolic cosine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cross(x,y)&lt;br /&gt;
|Returns the 3-vector cross product of the 3-vectors x and y.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|delay(expr, delayTime)&lt;br /&gt;
|Returns the value of expr at the time time-delayTime. The value of expr is returned when time &amp;lt;= time.start + delayTime.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|der(x)&lt;br /&gt;
|Time derivative of x. X must be have continuous-time variability.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|div(x, y)&lt;br /&gt;
|Returns the algebraic quotient x/y with any fractional part discarted. E.g. div(10,3) = 3.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|edge(b)&lt;br /&gt;
|Returns true when the value of the boolean expression b changes. Expanded into (b and not pre(b)).&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|exp(x)&lt;br /&gt;
|Exponential, base e.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|floor(x)&lt;br /&gt;
|Returns the largest integer not greater than x, the closest integer below x.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|initial()&lt;br /&gt;
|Returns true at the beginning of the simulation. &lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|integer(x)&lt;br /&gt;
|Returns the largest integer not greater than x as an integer.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|log(x)&lt;br /&gt;
|Natural logarithm. (base e, x &amp;gt; 0)&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|log10(x)&lt;br /&gt;
|Base 10 logarithm. (x &amp;gt; 0)&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|mod(x, y)&lt;br /&gt;
|Returns the integer modulus of x/y: mod(x,y) = x - floor(x/y) * y.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|noEvent(expr)&lt;br /&gt;
|noEvent around an expression causes the expression to NOT generate event.&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; &lt;br /&gt;
:If you want a condition to be checked only on time steps, use noEvent.&lt;br /&gt;
:(e.g. if noEvent(value &amp;gt;= 1) then ... else ...)&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|pre(x)&lt;br /&gt;
|Returns the preceding value of y from time event that has occured before current time.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|rem(x, y)&lt;br /&gt;
|Returns the integer remainder of x/y: rem(x,y) = x - div(x,y) * y.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sample(start, interval)&lt;br /&gt;
|Returns true and triggers time events at times start + i * interval (i=0,1,...).&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sign(x)&lt;br /&gt;
|Returns -1 if x is negative, 1 if x is positive. Expanded into &amp;quot;(if x &amp;gt; 0 then 1 else if x &amp;lt; 0 then -1 else 0)&amp;quot;.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sin(x)&lt;br /&gt;
|Sine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sinh(x)&lt;br /&gt;
|Hyperbolic sine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sqrt(x)&lt;br /&gt;
|Square root of x. The value of x must be greater or equal to 0 or an assertion error occurs.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|tan(x)&lt;br /&gt;
|Tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|tanh(x)&lt;br /&gt;
|Hyperbolic tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|terminal()&lt;br /&gt;
|Returns true at the end of a successful  simulation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Spreadsheets ==&lt;br /&gt;
&lt;br /&gt;
Spreadsheets allow storing and maintaining values in a familiar format. The current spreadsheet implementation is experimental and does not provide much functionality. Some basic tasks can, however, be performed. You cannot type directly to a cell, you need to first copy some value or text into it. Then it can be modified.&lt;br /&gt;
&lt;br /&gt;
=== Variable values ===&lt;br /&gt;
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 &amp;quot;Auxiliary&amp;quot; is not necessary in the spreadsheet, but it helps maintaining the sheet.&lt;br /&gt;
&lt;br /&gt;
[[File:AuxiliarySheetReference.png|Sheet reference in an expression]][[File:AuxiliarySheet.png|Value of a variable in sheet]]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:SheetForMultidim.png|Spreadsheet for multidimensional variables]]&lt;br /&gt;
&lt;br /&gt;
Reference to a sheet range creates an array variable.&lt;br /&gt;
&lt;br /&gt;
[[File:SheetMultidim1.png|Array variable ArrayTest1[2] with sheet reference]]&lt;br /&gt;
&lt;br /&gt;
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)))&lt;br /&gt;
&lt;br /&gt;
[[File:SheetMultidim2.png|Array variable ArrayTest2[2,3] with sheet reference]]&lt;br /&gt;
&lt;br /&gt;
=== History data ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Sheet.png|Spreadsheet with history data]]&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:HistoryDataSettings.png|History data settings]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;History data properties&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Name of the history dataset&lt;br /&gt;
|-&lt;br /&gt;
|Sheet&lt;br /&gt;
|Combo box for selecting a sheet where the history data is located&lt;br /&gt;
|-&lt;br /&gt;
|Orientation&lt;br /&gt;
|Columns or rows. How the data is arranged in the sheet.&lt;br /&gt;
|-&lt;br /&gt;
|Range start&lt;br /&gt;
|The upper-left corner cell of the history data range&lt;br /&gt;
|-&lt;br /&gt;
|Range end&lt;br /&gt;
|The lower-right corner cell of the history data range&lt;br /&gt;
|-&lt;br /&gt;
|Time variable&lt;br /&gt;
|The name of the time variable in the history data, if it is different than &amp;quot;time&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|Variables in range&lt;br /&gt;
|This text field displays the found variables in the given sheet and range&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the history dataset is activated, history data is displayed whenever it is available for a variable that is displayed in a chart.&lt;br /&gt;
&lt;br /&gt;
[[File:HistoryData.png|History data in two charts]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[Simantics]] | &#039;&#039;System Dynamics Modelling&#039;&#039;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[image:Preferences-system.svg‎|60px|left]]&lt;br /&gt;
&#039;&#039;&#039;[[Tutorial: Basic System Dynamics Modelling]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[image:Preferences-system.svg‎|60px|left]]&lt;br /&gt;
&#039;&#039;&#039;[[Tutorial: Advanced System Dynamics Modelling]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This tutorial introduces the more advanced features of the system dynamics modelling tool: Modules and Operating interfaces&lt;br /&gt;
&lt;br /&gt;
[[Category: Simantics System Dynamics]]&lt;/div&gt;</summary>
		<author><name>Tuukka Lehtonen</name></author>
	</entry>
	<entry>
		<id>https://wiki.simantics.org/index.php?title=Simantics_System_Dynamics&amp;diff=571</id>
		<title>Simantics System Dynamics</title>
		<link rel="alternate" type="text/html" href="https://wiki.simantics.org/index.php?title=Simantics_System_Dynamics&amp;diff=571"/>
		<updated>2012-06-27T21:51:24Z</updated>

		<summary type="html">&lt;p&gt;Tuukka Lehtonen: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simantics System Dynamics ==&lt;br /&gt;
&lt;br /&gt;
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. New features include module libraries and different analysis tools.&lt;br /&gt;
&lt;br /&gt;
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, [[#Installation Instructions|install]] the software and try our [[Tutorial: Basic System Dynamics Modelling|basic]] and [[Tutorial: Advanced System Dynamics Modelling|advanced]] tutorials!&lt;br /&gt;
&lt;br /&gt;
== Introduction to System Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
===System Dynamics===&lt;br /&gt;
System dynamics is an approach to understanding different organizations, markets and other complex systems and their dynamic behavior. System dynamics modelling in Simantics is a free modelling tool. See [[#Installation Instructions|installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Model===&lt;br /&gt;
[[File:ModelStructure.png|right|thumb|Model structure]]&lt;br /&gt;
System dynamics model is generally understood as the model configuration. In this tool, the model contains also other components. Model can have Operating interfaces that enable the use of the model with simple controls. Operating interfaces are configured separately and when using them, the complex model is hidden from the user. Experiments are the way to simulate the model. In the future, you can have experiments with different configurations, for example different initial values for some parameters. In that way, you don&#039;t have to always configure the model for different scenarios. Modules folder contains all the different module types in your model and you can create new module types there. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Components===&lt;br /&gt;
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.&lt;br /&gt;
[[File:ComponentTypes.png|right|frame|Component types]]&lt;br /&gt;
;Auxiliary&lt;br /&gt;
: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 and WithLookup. Auxiliary is the default type. Parameters are single 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 is a special variable that has an expression and a lookup table. The expresssion defines what value is taken from the defined table.&lt;br /&gt;
;Dependency&lt;br /&gt;
: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.&lt;br /&gt;
;Flow&lt;br /&gt;
: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.&lt;br /&gt;
;Valve&lt;br /&gt;
: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.&lt;br /&gt;
;Stock&lt;br /&gt;
: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. You must give an initial value to the stock. Initial value can be a single value or an equation. You can use values of other variables to calculate the initial value.&lt;br /&gt;
;Cloud&lt;br /&gt;
: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.&lt;br /&gt;
;Module&lt;br /&gt;
: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.&lt;br /&gt;
;Input&lt;br /&gt;
: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&#039;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.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Modeling principles===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
;Variable names&lt;br /&gt;
: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. &lt;br /&gt;
&lt;br /&gt;
:Variable names can and should have multiple words, if they are needed. Unfortunately current version of the tool does not support spaces in variable names. A good practice is to use CamelCase if name contains multiple words. This means that you start every word woth a capital letter (example: ExampleVariable).&lt;br /&gt;
&lt;br /&gt;
;Connections&lt;br /&gt;
:You should try to avoid overlapping dependency arrows. In some situations, however, it is not possible. Dependencies should also form distinctive loops, if there is a loop. It makes it easier to read and understand the model and its behavior.&lt;br /&gt;
&lt;br /&gt;
;Graphical annotations&lt;br /&gt;
:System dynamics contains usually annotations for loops, polarities, delays and so on. Currently those annotations are not supported, but the support will be added later. Annotations are important, again, for communicating the behavior of the model.&lt;br /&gt;
&lt;br /&gt;
==Installation Instructions==&lt;br /&gt;
&lt;br /&gt;
System dynamics tool is a provided with the Simantics platform.&lt;br /&gt;
&lt;br /&gt;
# [https://www.simantics.org/simantics/download Download installer from Simantics download page]&lt;br /&gt;
# Install the program to a directory without spaces (limitation inherited from OpenModelica).&lt;br /&gt;
# Run Simantics-Sysdyn.exe &amp;lt;br /&amp;gt;&lt;br /&gt;
: (Default path in windows: C:\Simantics\Simantics-1.6.0-Sysdyn-32\bin\Simantics-Sysdyn.exe)&lt;br /&gt;
&lt;br /&gt;
[http://www.openmodelica.org/ OpenModelica] is used to build and simulate the models. Simantics platform has integrated OpenModelica 1.8.1 for Windows environments. For other versions and other environments you need to install [http://www.openmodelica.org/index.php/download OpenModelica].&lt;br /&gt;
&lt;br /&gt;
== Workbench ==&lt;br /&gt;
&lt;br /&gt;
[[File:BasicWorkbench.png|center|729px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Diagram&#039;&#039;&#039; &amp;lt;br /&amp;gt; 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. &lt;br /&gt;
# &#039;&#039;&#039;Model Browser&#039;&#039;&#039; &amp;lt;br /&amp;gt; Model browser shows the structure of your model and all items related to it. &amp;lt;br /&amp;gt; Symbols view is stacked with the model browser and used for dragging elements to diagrams.&lt;br /&gt;
# &#039;&#039;&#039;Properties&#039;&#039;&#039; &amp;lt;br /&amp;gt; Property view shows the selected variable&#039;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 are with variables are Equation and Additional information.&lt;br /&gt;
# &#039;&#039;&#039;Trend&#039;&#039;&#039; &amp;lt;br /&amp;gt; Trend 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. Values view and Dependencies are stacked with Trend view and can also be used for analyzing the model.&lt;br /&gt;
# &#039;&#039;&#039;Experiment controls&#039;&#039;&#039; &amp;lt;br /&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If you accidentally close a view, you can reopen them from Window-&amp;gt;Show View-&amp;gt;Other...&lt;br /&gt;
&lt;br /&gt;
== Modelling ==&lt;br /&gt;
&lt;br /&gt;
===Basic modelling===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Basic_1.png|right]]&lt;br /&gt;
;Creating a new model&lt;br /&gt;
:Start a new model by right-clicking the model browser and selecting New-&amp;gt;Model or from the main menu File-&amp;gt;New Model.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Basic_2.png|right]]&lt;br /&gt;
;Creating a new module type&lt;br /&gt;
:Create a new module type by right-clicking on the Modules-folder and selecting New-&amp;gt;Module. This creates a new module type that you can populate to your other modules and the model configuration. &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Configuring a model&lt;br /&gt;
:Model configuration can be opened by double clicking Configuration in the model browser. &lt;br /&gt;
&lt;br /&gt;
;Configuring modules&lt;br /&gt;
: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 module!&lt;br /&gt;
&lt;br /&gt;
;Populate variables&lt;br /&gt;
:You can drag variables to a diagram from symbol view. You can also populate variables using [[#Shortcut and control keys|shortcut keys]]&lt;br /&gt;
&lt;br /&gt;
;Populate modules&lt;br /&gt;
:Modules are populated from the model browser. Just drag the module you want to populate from the Modules folder to a diagram.&lt;br /&gt;
&lt;br /&gt;
;Create connections&lt;br /&gt;
: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.&lt;br /&gt;
: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.&lt;br /&gt;
:There are some restrictions on what connections can be made, but don&#039;t worry, the user interface won&#039;t let you do connections that are not allowed.&lt;br /&gt;
&lt;br /&gt;
;Connections between modules&lt;br /&gt;
:&#039;&#039;&#039;Outside the module&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:You can connect variables to variables in modules like this:&lt;br /&gt;
 MODULE -----&amp;gt; INPUT&lt;br /&gt;
 or&lt;br /&gt;
 ANY VARIABLE -----&amp;gt; MODULE &lt;br /&gt;
:This is just the visual configuration, but you need those connections to really connect variables in the module&#039;s properties.&lt;br /&gt;
:In Inputs -tab you select which variables you connect to inputs inside the module. In Outputs -tab you select which variables you lift from the module to inputs outside it.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Inside the module&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:Input variables get values from outside the module&lt;br /&gt;
&lt;br /&gt;
:Output variables can send their values outside the module. From the variable properties, select Additional Information and press Is Output&lt;br /&gt;
&lt;br /&gt;
;Configure variables&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
;Export model&lt;br /&gt;
:To export your model to a file, select your model from the model browser, right-click and from the context menu choose Export-&amp;gt;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 to for example create different versions of the model, create backups or to transport it to another database.&lt;br /&gt;
&lt;br /&gt;
;Import model&lt;br /&gt;
:Right-click on the model browser and select Import-&amp;gt;Model. Browse to your .tg file and select open. The model is added to your model browser.&lt;br /&gt;
&lt;br /&gt;
===Shortcut and control keys===&lt;br /&gt;
&lt;br /&gt;
Shortcut keys for configuring a model on diagram.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Esc	&lt;br /&gt;
|Cancel operations (e.g. connection and rename).&lt;br /&gt;
|-&lt;br /&gt;
|Shift + A	&lt;br /&gt;
|Hover Auxiliary at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + S&lt;br /&gt;
|Hover Stock at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + C&lt;br /&gt;
|Hover Cloud at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + V&lt;br /&gt;
|Hover Valve at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + I&lt;br /&gt;
|Hover Input at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Alt + left mouse button&lt;br /&gt;
|Start an arrow from a variable. End to another variable by clicking left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Alt + right mouse button&lt;br /&gt;
|Start flow from a variable. End by clicking left mouse button.&lt;br /&gt;
&lt;br /&gt;
If a flow is not started or ended on to a variable, a cloud will be created to that end. &amp;lt;br /&amp;gt;&lt;br /&gt;
If a new flow does not have a valve at either end, a valve will be created in the middle of the flow.&lt;br /&gt;
|-&lt;br /&gt;
|Delete&lt;br /&gt;
|Remove selected variables&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + left mouse button&lt;br /&gt;
|Select multiple variables&lt;br /&gt;
|-&lt;br /&gt;
|Mouse wheel or&amp;lt;br/&amp;gt;+ and -&lt;br /&gt;
|Diagram zoom&lt;br /&gt;
|-&lt;br /&gt;
|drag(mouse3) or&amp;lt;br/&amp;gt;drag(shift + any mouse button)&lt;br /&gt;
|Diagram pan&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + C&lt;br /&gt;
|Copy selected elements&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + X&lt;br /&gt;
|Cut selected elements&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + V&lt;br /&gt;
|Paste copied or cut elements&lt;br /&gt;
|-&lt;br /&gt;
|G&lt;br /&gt;
|Show / hide grid&lt;br /&gt;
|-&lt;br /&gt;
|R&lt;br /&gt;
|Show / hide ruler&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other shortcut keys can be found selecting Window -&amp;gt; Preferences from the main menu. Keys are located in General -&amp;gt; Keys.&lt;br /&gt;
&lt;br /&gt;
== Simulation ==&lt;br /&gt;
There are three different ways for simulating a model. Different simulations are represented as different types of experiments in Simantics System Dynamics. &lt;br /&gt;
&lt;br /&gt;
Experiments are created from the context menu of experiments folder in a model. &lt;br /&gt;
&lt;br /&gt;
[[File:NewExperiment.png]]&lt;br /&gt;
&lt;br /&gt;
Double-click on an experiment activates it and displays experiment type specific controls in the main tool bar.&lt;br /&gt;
&lt;br /&gt;
;Normal simulation&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
;Game simulation&lt;br /&gt;
:Game simulations allow simulating an arbitrary number of steps, changing parameter values and continuing simulation with the new values from where it previously ended.&lt;br /&gt;
&lt;br /&gt;
;Simulation playback&lt;br /&gt;
:Simulation playback works essentially as the basic experiment, but it offers some additional visualization options.&lt;br /&gt;
&lt;br /&gt;
== Simulation result and model structure analysis ==&lt;br /&gt;
Simulation results can be viewed as trends in trend view or as plain numbers in values view. The views display results of variables that are selected in the workbench. Users can also create [[#Custom charts |custom charts]].&lt;br /&gt;
&lt;br /&gt;
Model structure can be examined in the Structure view. There are two options: Dependency structures of individual variables or the complete hierarchy structure of the model.&lt;br /&gt;
&lt;br /&gt;
;Trend&lt;br /&gt;
: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. &amp;lt;br /&amp;gt; [[File:Trend.png]]&lt;br /&gt;
&lt;br /&gt;
;Values&lt;br /&gt;
: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.&amp;lt;br /&amp;gt; [[File:Values.png]]&lt;br /&gt;
&lt;br /&gt;
;Compare results&lt;br /&gt;
: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 button [[File:Saveresults.png]] 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. &amp;lt;br /&amp;gt; [[File:CompareTrend.png]]&lt;br /&gt;
&lt;br /&gt;
;Dependencies&lt;br /&gt;
: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. &amp;lt;br /&amp;gt; [[File:Dependencies.png]]&lt;br /&gt;
&lt;br /&gt;
;Model Hierarchy&lt;br /&gt;
:Model Hierarchy displays the hierarchical structure of the model. The module type where a selected variable is located is highlighted.&amp;lt;br /&amp;gt; [[File:ModelHierarchy.png]]&lt;br /&gt;
&lt;br /&gt;
== Custom charts ==&lt;br /&gt;
Custom charts are user-defined displays of simulation result data. They can be used and re-used in various places. The three types of custom charts (line, bar and pie charts) provide model developers means for examining and developing their models and communicating the simulation results to others. &lt;br /&gt;
&lt;br /&gt;
Custom charts are created to the Charts folder in model browser.&lt;br /&gt;
&lt;br /&gt;
[[File:NewChart.png | Creating a new chart]]&lt;br /&gt;
&lt;br /&gt;
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 or to a separate chart panel that can contain multiple charts. &lt;br /&gt;
&lt;br /&gt;
=== Line chart ===&lt;br /&gt;
&lt;br /&gt;
Line char 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.&lt;br /&gt;
&lt;br /&gt;
[[File:LineChart.png|Line chart with an array variable]]&lt;br /&gt;
&lt;br /&gt;
[[File:LineChartGeneral.png|General settings of line chart]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;General&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|The name of the chart. Displayed in e.g. model browser&lt;br /&gt;
|-&lt;br /&gt;
|Title&lt;br /&gt;
|The title of the chart. Displayed in the chart&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Line chart (default) or area chart&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options to hide chart grid, title or legend&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;X-axis&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Optional other label for the variable than its name&lt;br /&gt;
|-&lt;br /&gt;
|Min&lt;br /&gt;
|Minimum value of the x-axis&lt;br /&gt;
|-&lt;br /&gt;
|Max&lt;br /&gt;
|Maximum value of the x-axis&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options to hide x-axis lable, line, tick marks and tick labels&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:LineChartAxisAndVariables.png|Axis and variables settings of line chart]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Variable&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|The full path of the variable. This field has content assistant, which shows the possible variables as you type.&lt;br /&gt;
|-&lt;br /&gt;
|Range&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Optional label for the variable. If label is empty, the variable name is displayed.&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|Color for the lines of this variable&lt;br /&gt;
|-&lt;br /&gt;
|Line width&lt;br /&gt;
|The width of the lines drawn for this variable&lt;br /&gt;
|}&lt;br /&gt;
There are also configuration options for y-axis. They are displayed when an axis is selected in the Axis and variables tab.&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Y-axis&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Label of the axis&lt;br /&gt;
|-&lt;br /&gt;
|Min&lt;br /&gt;
|Minimum value in the axis&lt;br /&gt;
|-&lt;br /&gt;
|Max&lt;br /&gt;
|Maximum value in the axis&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|The color of the axis lines, ticks and labels&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options to hide parts of the axis: label, axis line, tick marks, tick labels&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Bar chart ===&lt;br /&gt;
Bar charts display variables in a certain point in time. The point can be defined for the complete chart in cart&#039;s general settings and individually for each variable in variable&#039;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. &lt;br /&gt;
&lt;br /&gt;
[[File:BarChartGeneral.png|General bar chart settings]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;General&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|The name of the chart. Name is displayed in model browser.&lt;br /&gt;
|-&lt;br /&gt;
|Title&lt;br /&gt;
|The title of the chart. Title is displayed in the chart, if not hidden&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|Normal or stacked. Normal type displays all variables in separate bars. Stacked mode is able to display one-dimensional array variables in stacks.&lt;br /&gt;
|-&lt;br /&gt;
|Time&lt;br /&gt;
|A general time setting for the entire chart. The values at this time are displayed in the chart&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Option for hiding grid, title and Legend. Legend is hidden by default since it only contains the information that the current simulation is displayed.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:BarChartInDiagram.png|Bar chart in a model diagram]]&lt;br /&gt;
&lt;br /&gt;
Charts can be added to model diagrams simply by dragging the chart from model browser to diagram.&lt;br /&gt;
&lt;br /&gt;
[[File:BarChartVariable.png|Settings for a variable in bar chart]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Variable&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Add / Remove&lt;br /&gt;
|Add or remove variables&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|The full path of the variable. This field has content assistant, which shows the possible variables as you type.&lt;br /&gt;
|-&lt;br /&gt;
|Range&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Optional label for the variable. If label is empty, the variable name is displayed&lt;br /&gt;
|-&lt;br /&gt;
|Time&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
[[File:BarChartAxis.png|Settings for axis in bar chart]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Domain axis&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|An optional label for x axis&lt;br /&gt;
|-&lt;br /&gt;
|Label angle&lt;br /&gt;
|Axis labels can be displayed in an angle. This value determines the angle in degrees.&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|The color of the axis line, tick lines and labels&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options for hiding axis label, line, tick marks and tick labels&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Range axis&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|An optional label for y axis&lt;br /&gt;
|-&lt;br /&gt;
|Min&lt;br /&gt;
|Minimum value of y axis&lt;br /&gt;
|-&lt;br /&gt;
|Max&lt;br /&gt;
|Maximum value of y axis&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|The color of the axis line, tick lines and labels&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options for hiding axis label, line, tick marks and tick labels&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pie chart ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:PieChartGeneral.png|General pie chart settings]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;General&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|The name of the chart. Displayed in e.g. model browser&lt;br /&gt;
|-&lt;br /&gt;
|Title&lt;br /&gt;
|Title	The title of the chart. Displayed in the chart&lt;br /&gt;
|-&lt;br /&gt;
|Time&lt;br /&gt;
|A general time setting for the entire chart. The values at this time are displayed in the chart&lt;br /&gt;
|-&lt;br /&gt;
|Hide&lt;br /&gt;
|Options for hiding title, section labels and legend&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:PieChartVariable.png|Variable settings in pie chart]]&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Variables&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Add / Remove&lt;br /&gt;
|Add or remove variables&lt;br /&gt;
|-&lt;br /&gt;
|Variable&lt;br /&gt;
|The full path of the variable. This field has content assistant, which shows the possible variables as you type.&lt;br /&gt;
|-&lt;br /&gt;
|Range&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Label&lt;br /&gt;
|Optional label for the variable. If label is empty, the variable name is displayed&lt;br /&gt;
|-&lt;br /&gt;
|Color&lt;br /&gt;
|Color for the sector of this variable&lt;br /&gt;
|-&lt;br /&gt;
|Time&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|Exploded&lt;br /&gt;
|If set, the sector(s) of the variable(s) are &amp;quot;exploded&amp;quot; away from the center of the pie chart&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:PieChartChartPanel.png|Pie chart in chart panel]]&lt;br /&gt;
&lt;br /&gt;
=== Chart panel ===&lt;br /&gt;
[[File:ChartPanel.png|right]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Chart panel can be either horizontally or vertically oriented. Different orientations help in configuring the workbench perspective. &lt;br /&gt;
&lt;br /&gt;
[[File:ChartPanelOrientation.png|Chart panel orientation]]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
By default, chart panel is hidden in the upper-left corner of the system dynamics perspective.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multidimensional variables ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modeling ===&lt;br /&gt;
&lt;br /&gt;
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):&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Create the model structure&#039;&#039;&#039; &amp;lt;BR /&amp;gt;Model with multidimensional variables looks just like any other model.&amp;lt;BR /&amp;gt; [[File:ModelWithMultidimensionalVariables.png|300px|Model with multidimensional variables]]&lt;br /&gt;
# &#039;&#039;&#039;Create Enumerations and define the indexes&#039;&#039;&#039; &amp;lt;BR /&amp;gt;Enumerations are created by right-clicking configuration and selecting New-&amp;gt;Enumeration.&amp;lt;BR /&amp;gt; [[File:NewEnumeration.png|250px|New enumeration]]&amp;lt;BR /&amp;gt;Define enumeration indexes by adding as many indexes as you want. Rename the indexes by selecting them and then clicking on them again.&amp;lt;BR /&amp;gt;[[File:DefineIndexes.png|200px|Index definitions]]&lt;br /&gt;
# &#039;&#039;&#039;Add Enumerations for variables&#039;&#039;&#039; &amp;lt;BR /&amp;gt;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.[[File:SelectEnumerations.png|500px|Select enumerations for variables]]&lt;br /&gt;
# &#039;&#039;&#039;Define equations for all possible indexes&#039;&#039;&#039; &amp;lt;BR /&amp;gt;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}}.&amp;lt;BR /&amp;gt;[[File:DefineEquations.png|500px|Define equations for all indexes]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Expressions ===&lt;br /&gt;
&lt;br /&gt;
Values for all cells in the variable matrix can be defined in a single expression. &lt;br /&gt;
&lt;br /&gt;
[[File: DefineEquations.png|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:DefineEquations2.png|600px]]&lt;br /&gt;
&lt;br /&gt;
In many situations, it is however more clear to define separate expressions for each cell or blocks. &lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Define range for the expression&#039;&#039;&#039;&amp;lt;BR /&amp;gt; [[File:DefineRange.png]]&lt;br /&gt;
# &#039;&#039;&#039;Define the expression&#039;&#039;&#039; (dimensions of the defined range and the result of the expression must match!) &amp;lt;BR /&amp;gt; [[File:DefineEquations3.png]]&lt;br /&gt;
# &#039;&#039;&#039;Create a new expression&#039;&#039;&#039; &amp;lt;BR /&amp;gt; [[File:CreateNewExpression.png]]&lt;br /&gt;
#&#039;&#039;&#039; Select the new expression&#039;&#039;&#039; &amp;lt;BR /&amp;gt; [[File:SelectNewExpression.png]]&lt;br /&gt;
&lt;br /&gt;
Repeat until there is value for each cell. There must be exactly one value for each cell.&lt;br /&gt;
&lt;br /&gt;
=== Array slices ===&lt;br /&gt;
&lt;br /&gt;
Many times it is useful to access a slice of a  multidimensional variable. In this chapter, we will use the following example variable:&lt;br /&gt;
 enumeration E1 = one, two, three&lt;br /&gt;
 enumeration E2 = eins, zwei, drei&lt;br /&gt;
 &lt;br /&gt;
 Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}&lt;br /&gt;
&lt;br /&gt;
The whole variable can be accessed in three different ways:&lt;br /&gt;
# Auxiliary&lt;br /&gt;
# Auxiliary[E1, E2]&lt;br /&gt;
# Auxiliary[:, :]&lt;br /&gt;
&lt;br /&gt;
The following explains different methods for accessing parts of the variable&lt;br /&gt;
&lt;br /&gt;
 // Single cell&lt;br /&gt;
 Auxiliary[one, eins] = 1&lt;br /&gt;
&lt;br /&gt;
 // Slices&lt;br /&gt;
 Auxiliary[one, E2] = {1,2,3}&lt;br /&gt;
 Auxiliary[E1, zwei] = {{2},{5},{8}}&lt;br /&gt;
 &lt;br /&gt;
 // In addition to single cells and the whole enumeration range, a subrange of the enumeration can be used&lt;br /&gt;
 Auxiliary[two : three, E2] = {{4,5,6},{7,8,9}}&lt;br /&gt;
 Auxiliary[one : two, zwei : drei]  = {{2,3},{5,6}}&lt;br /&gt;
&lt;br /&gt;
The syntax for accessing parts of variables can be used in both expression range definitions and in expressions.&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
Arithmetic operations are defined in Modelica. Below are examples of different operations.&lt;br /&gt;
&lt;br /&gt;
;Addition and substraction&lt;br /&gt;
Addition and substraction are calculated elementwise&lt;br /&gt;
&lt;br /&gt;
 {1,2,3} - {0,2,3} = {1,0,0}&lt;br /&gt;
 {{2,2},{4,4}} + {{8,8},{1,1}} = {{10,10},{5,5}}&lt;br /&gt;
 {1,2,3} - {1,2} = ERROR! Different array sizes&lt;br /&gt;
&lt;br /&gt;
;Division&lt;br /&gt;
Division with a scalar&lt;br /&gt;
 {5,10,15} / 5 = {1,2,3}&lt;br /&gt;
 5 / {5,10,15} = ERROR! not allowed&lt;br /&gt;
&lt;br /&gt;
Division with an array&lt;br /&gt;
 {1,2,3} / {1,2,3} = ERROR! not allowed&lt;br /&gt;
 &lt;br /&gt;
 // Elementwise&lt;br /&gt;
 {1,2,3} ./ {1,2,3} = {1,1,1}&lt;br /&gt;
&lt;br /&gt;
;Multiplication&lt;br /&gt;
&lt;br /&gt;
Multiplication with a scalar&lt;br /&gt;
 {1,2,3} * 2 = {2,4,6}&lt;br /&gt;
 5 * {1,2,3} = {5,10,15}&lt;br /&gt;
&lt;br /&gt;
Matrix multiplication with an array&lt;br /&gt;
 {{3,4},{5,6}} * {1,2} = {11,17}&lt;br /&gt;
 {{3,4},{5,6}}  * {1,2,3} = ERROR! incompatible array sizes&lt;br /&gt;
 &lt;br /&gt;
 //Elementwise&lt;br /&gt;
 {1,2} .* {1,2} = {1,4}&lt;br /&gt;
 &lt;br /&gt;
 Real[3,2] c = {{1,2},{3,4},{5,6}};  &lt;br /&gt;
 Real[2,2] d = {{3,4},{5,6}};&lt;br /&gt;
 Real[2,2] cd;&lt;br /&gt;
 cd = c[2:3, :] .* d; // Result: {{9,16},{25,36}}&lt;br /&gt;
&lt;br /&gt;
=== Builtin Modelica functions ===&lt;br /&gt;
&lt;br /&gt;
Modelica has some builtin functions that help using multidimensional variables. This chapter introduces some of the builtin functions. &lt;br /&gt;
&lt;br /&gt;
;Dimension and size functions&lt;br /&gt;
&lt;br /&gt;
We will use the same example variable as previously.&lt;br /&gt;
&lt;br /&gt;
 enumeration E1 = one, two, three&lt;br /&gt;
 enumeration E2 = eins, zwei, drei&lt;br /&gt;
 &lt;br /&gt;
 Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}&lt;br /&gt;
&lt;br /&gt;
;ndims(A)&lt;br /&gt;
The number of dimensions in array A&lt;br /&gt;
 ndims(Auxiliary) = 2&lt;br /&gt;
&lt;br /&gt;
;size(A, i)&lt;br /&gt;
The size of dimension i in array A&lt;br /&gt;
 size(Auxiliary, 2) = 3&lt;br /&gt;
&lt;br /&gt;
;size(A)&lt;br /&gt;
A vector of length ndims(A) containing the dimension sizes of A&lt;br /&gt;
 size(Auxiliary) = {3,3}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Construction functions&lt;br /&gt;
In addition to normal array constructing, a special construction functions can be used.&lt;br /&gt;
&lt;br /&gt;
;zeros(n1,n2,n3,...)&lt;br /&gt;
An array full of zeros with dimensions n1 x n2 x n2 x ... &lt;br /&gt;
 zeros(2, 2) = {{0,0}, {0,0}}&lt;br /&gt;
&lt;br /&gt;
;ones(n1,n2,n3,...)&lt;br /&gt;
An array full of ones with dimensions n1 x n2 x n2 x ... &lt;br /&gt;
 ones(2, 2) = {{1,1}, {1,1}}&lt;br /&gt;
&lt;br /&gt;
;fill(s,n1,n2,n3)&lt;br /&gt;
Like zeros() and ones(), but with user defined value (s) for array elements.&lt;br /&gt;
 fill(3,2,2) = {{3,3}, {3,3}}&lt;br /&gt;
&lt;br /&gt;
;identity(n)&lt;br /&gt;
Creates an n x n integer identity matrix with ones on the diagonal and all other elements zero.&lt;br /&gt;
 identity(3) =&lt;br /&gt;
   1 0 0&lt;br /&gt;
   0 1 0&lt;br /&gt;
   0 0 1&lt;br /&gt;
&lt;br /&gt;
;diagonal(v)&lt;br /&gt;
Constructs a square matrix with elements of vector v on the diagonal and all other elements zero.&lt;br /&gt;
 diagonal({1,2,3}) =&lt;br /&gt;
   1 0 0&lt;br /&gt;
   0 2 0&lt;br /&gt;
   0 0 3&lt;br /&gt;
&lt;br /&gt;
;linspace(x1,x2,n)&lt;br /&gt;
Constracts a Real vector from x1 to x2 with n equally spaced elements.&lt;br /&gt;
 linspace(2,5,4) = {2,3,4,5}&lt;br /&gt;
&lt;br /&gt;
;Reduction functions&lt;br /&gt;
&lt;br /&gt;
Reduction functions reduce arrays to scalars.&lt;br /&gt;
&lt;br /&gt;
;min(A)&lt;br /&gt;
Returns the minimum value in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 min(A) = 1&lt;br /&gt;
&lt;br /&gt;
;max(A)&lt;br /&gt;
Returns the maximum value in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 max(A) = 4&lt;br /&gt;
&lt;br /&gt;
;sum(A)&lt;br /&gt;
Returns the sum of values in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 sum(A) = 10    // 1 + 2 + 3 + 4&lt;br /&gt;
&lt;br /&gt;
;product(A)&lt;br /&gt;
Returns the product of values in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 product(A) = 24   // 1 * 2 * 3 * 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Using functions with iterators&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
 enumeration E1 = one, two, three&lt;br /&gt;
 enumeration E2 = eins, zwei, drei&lt;br /&gt;
 Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}&lt;br /&gt;
 &lt;br /&gt;
 AuxiliarySum[E1] = {sum( Auxiliary[ i , E2 ] ) for i in E1} // Result: {6, 15, 24}&lt;br /&gt;
 &lt;br /&gt;
 /* Same as:&lt;br /&gt;
 {sum(Auxiliary[one, E2]), sum(Auxiliary[two, E2]), sum(Auxiliary[three, E2])}&lt;br /&gt;
 {sum({1,2,3}), sum({4,5,6}), sum({7,8,9})}&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
One expression can have multiple iterators. The Modelica specification defines the following format, but it is NOT yet supported in OpenModelica:&lt;br /&gt;
 {sum(Array[ i, j, E3]) for i in E1, j in E2}  // Dimensions reduced from 3 to 2&lt;br /&gt;
&lt;br /&gt;
To use multiple iterators, use the following format (NOTE the reversed order of iterators!):&lt;br /&gt;
 {{sum(Array[ i, j, E3]) for j in E2} for i in E1}  // Dimensions reduced from 3 to 2&lt;br /&gt;
&lt;br /&gt;
The range doesn&#039;t have to be the whole enumeration. Subranges can also be used.&lt;br /&gt;
 {sum( Auxiliary[ i , eins : zwei ] ) for i in E1.one : E1.two} // Result: {3, 9}&lt;br /&gt;
 &lt;br /&gt;
 /* Same as&lt;br /&gt;
 {sum(Auxiliary[one, eins : zwei]), sum(Auxiliary[two, eins : zwei])}&lt;br /&gt;
 {sum({1,2}), sum({4,5})}&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
=== Simulation results ===&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:3x3trend.png|300px|Trend view for a 3x3 variable]]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:ShowInCharts.png|500px|Select indexes to show in charts]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Array Variables in Modules ===&lt;br /&gt;
&lt;br /&gt;
[[File:Replaceable.png|frame|Replaceable enumeration inside a module]]&lt;br /&gt;
&lt;br /&gt;
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 [[Simantics_System_Dynamics#Modeling|Modeling]]). &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:ReplacingEnumerationConfiguration.png|frame|left|500px|Module configuration for replacing enumerations inside the module]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the parent configuration, we have used an enumeration with three indexes in the two variables.&lt;br /&gt;
&lt;br /&gt;
[[File:Replacing.png|frame|left|Enumeration in the parent configuration that will replace the enumeration in the module]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ReplacingEnumeration.png|frame|left|Enumeration in the parent configuration that will replace the enumeration in the module]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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!&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
&lt;br /&gt;
Modelica provides a convenient way to use functions in your models. You can create your own functions, import complete function libraries and share function libraries to be used in all of your models. &lt;br /&gt;
&lt;br /&gt;
=== Creating functions ===&lt;br /&gt;
&lt;br /&gt;
[[File:NewFunction.png|right]]&lt;br /&gt;
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-&amp;gt;Function.&lt;br /&gt;
&lt;br /&gt;
Functions that can be found from Functions -folder can be used in your variable definitions.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
Algorithm section defines the actual functionality of the function. In algorithm sections you must use assignments &amp;quot;:=&amp;quot; instead of just plain &amp;quot;=&amp;quot;. All the assignments are calculated in the order they are written.&lt;br /&gt;
&lt;br /&gt;
Below is an example of a simple function. For more examples, see the built-in functions provided with the tool and [https://www.modelica.org/documents/ Modelica specifications].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:ExampleFunction.png]]&lt;br /&gt;
&lt;br /&gt;
=== Function libraries ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NewFunctionLibrary.png|right]]&lt;br /&gt;
&lt;br /&gt;
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)).&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
Create a new function library by right-clicking on Functions folder, Shared functions folder or other module library.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:SharedFunctions.png]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External functions ===&lt;br /&gt;
&lt;br /&gt;
Modelica allows you to use external functions that are programmed using C language. Below is a simple example of using a function that returns the sum of two arguments. &lt;br /&gt;
&lt;br /&gt;
 double exampleCFunction(double x, double y)&lt;br /&gt;
 {&lt;br /&gt;
   double res;&lt;br /&gt;
   res = x + y;&lt;br /&gt;
   return res;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ImportCFunctionLibrary.png|right]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
(e.g. simantics_home/plugins/org.simantics.openmodelica.win32_x/MinGW/bin/mingw32_gcc.exe -g -O -c ExampleCFunctionCode.c). &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:ExampleExternalFunction.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:ExternalFunctionResult.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Small external C function can also be written directly to the function code in Simantics Sysdyn:&lt;br /&gt;
 function ExampleExternalFunction&lt;br /&gt;
 input Real x;&lt;br /&gt;
 input Real y;&lt;br /&gt;
 output Real z;&lt;br /&gt;
 external &amp;quot;C&amp;quot; z=exampleCFunction(x,y) annotation(Include=&amp;quot;&lt;br /&gt;
 double exampleCFunction(double x, double y)&lt;br /&gt;
 {&lt;br /&gt;
   double res;&lt;br /&gt;
   res = x + y;&lt;br /&gt;
   return res;&lt;br /&gt;
 }&amp;quot;);&lt;br /&gt;
 end ExampleExternalFunction;&lt;br /&gt;
&lt;br /&gt;
=== Modelica functions ===&lt;br /&gt;
&lt;br /&gt;
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 [[Simantics_System_Dynamics#Builtin_functions|builtin functions for arrays]].&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|abs(x)&lt;br /&gt;
|Returns the absolute value of x. Expanded into &amp;quot;(if x &amp;gt;= 0 then x else -x)&amp;quot;.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|acos(x)&lt;br /&gt;
|Inverse cosine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|asin(x)&lt;br /&gt;
|Inverse sine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|atan(x)&lt;br /&gt;
|Inverse tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|atan2(x1,x2)&lt;br /&gt;
|four quadrant inverse tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cat(n,A,B,...)&lt;br /&gt;
|General concatenation function that concatenates arrays A,B,... along the nth dimension.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|ceil(x)&lt;br /&gt;
|Returns the smallest integer not less than x, the closest integer above x.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cos(x)&lt;br /&gt;
|Cosine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cosh(x)&lt;br /&gt;
|Hyperbolic cosine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cross(x,y)&lt;br /&gt;
|Returns the 3-vector cross product of the 3-vectors x and y.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|delay(expr, delayTime)&lt;br /&gt;
|Returns the value of expr at the time time-delayTime. The value of expr is returned when time &amp;lt;= time.start + delayTime.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|der(x)&lt;br /&gt;
|Time derivative of x. X must be have continuous-time variability.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|div(x, y)&lt;br /&gt;
|Returns the algebraic quotient x/y with any fractional part discarted. E.g. div(10,3) = 3.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|edge(b)&lt;br /&gt;
|Returns true when the value of the boolean expression b changes. Expanded into (b and not pre(b)).&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|exp(x)&lt;br /&gt;
|Exponential, base e.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|floor(x)&lt;br /&gt;
|Returns the largest integer not greater than x, the closest integer below x.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|initial()&lt;br /&gt;
|Returns true at the beginning of the simulation. &lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|integer(x)&lt;br /&gt;
|Returns the largest integer not greater than x as an integer.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|log(x)&lt;br /&gt;
|Natural logarithm. (base e, x &amp;gt; 0)&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|log10(x)&lt;br /&gt;
|Base 10 logarithm. (x &amp;gt; 0)&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|mod(x, y)&lt;br /&gt;
|Returns the integer modulus of x/y: mod(x,y) = x - floor(x/y) * y.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|noEvent(expr)&lt;br /&gt;
|noEvent around an expression causes the expression to NOT generate event.&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; &lt;br /&gt;
:If you want a condition to be checked only on time steps, use noEvent.&lt;br /&gt;
:(e.g. if noEvent(value &amp;gt;= 1) then ... else ...)&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|pre(x)&lt;br /&gt;
|Returns the preceding value of y from time event that has occured before current time.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|rem(x, y)&lt;br /&gt;
|Returns the integer remainder of x/y: rem(x,y) = x - div(x,y) * y.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sample(start, interval)&lt;br /&gt;
|Returns true and triggers time events at times start + i * interval (i=0,1,...).&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sign(x)&lt;br /&gt;
|Returns -1 if x is negative, 1 if x is positive. Expanded into &amp;quot;(if x &amp;gt; 0 then 1 else if x &amp;lt; 0 then -1 else 0)&amp;quot;.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sin(x)&lt;br /&gt;
|Sine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sinh(x)&lt;br /&gt;
|Hyperbolic sine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sqrt(x)&lt;br /&gt;
|Square root of x. The value of x must be greater or equal to 0 or an assertion error occurs.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|tan(x)&lt;br /&gt;
|Tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|tanh(x)&lt;br /&gt;
|Hyperbolic tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|terminal()&lt;br /&gt;
|Returns true at the end of a successful  simulation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Spreadsheets ==&lt;br /&gt;
&lt;br /&gt;
Spreadsheets allow storing and maintaining values in a familiar format. The current spreadsheet implementation is experimental and does not provide much functionality. Some basic tasks can, however, be performed. You cannot type directly to a cell, you need to first copy some value or text into it. Then it can be modified.&lt;br /&gt;
&lt;br /&gt;
=== Variable values ===&lt;br /&gt;
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 &amp;quot;Auxiliary&amp;quot; is not necessary in the spreadsheet, but it helps maintaining the sheet.&lt;br /&gt;
&lt;br /&gt;
[[File:AuxiliarySheetReference.png|Sheet reference in an expression]][[File:AuxiliarySheet.png|Value of a variable in sheet]]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:SheetForMultidim.png|Spreadsheet for multidimensional variables]]&lt;br /&gt;
&lt;br /&gt;
Reference to a sheet range creates an array variable.&lt;br /&gt;
&lt;br /&gt;
[[File:SheetMultidim1.png|Array variable ArrayTest1[2] with sheet reference]]&lt;br /&gt;
&lt;br /&gt;
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)))&lt;br /&gt;
&lt;br /&gt;
[[File:SheetMultidim2.png|Array variable ArrayTest2[2,3] with sheet reference]]&lt;br /&gt;
&lt;br /&gt;
=== History data ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Sheet.png|Spreadsheet with history data]]&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:HistoryDataSettings.png|History data settings]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;History data properties&#039;&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Name of the history dataset&lt;br /&gt;
|-&lt;br /&gt;
|Sheet&lt;br /&gt;
|Combo box for selecting a sheet where the history data is located&lt;br /&gt;
|-&lt;br /&gt;
|Orientation&lt;br /&gt;
|Columns or rows. How the data is arranged in the sheet.&lt;br /&gt;
|-&lt;br /&gt;
|Range start&lt;br /&gt;
|The upper-left corner cell of the history data range&lt;br /&gt;
|-&lt;br /&gt;
|Range end&lt;br /&gt;
|The lower-right corner cell of the history data range&lt;br /&gt;
|-&lt;br /&gt;
|Time variable&lt;br /&gt;
|The name of the time variable in the history data, if it is different than &amp;quot;time&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|Variables in range&lt;br /&gt;
|This text field displays the found variables in the given sheet and range&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the history dataset is activated, history data is displayed whenever it is available for a variable that is displayed in a chart.&lt;br /&gt;
&lt;br /&gt;
[[File:HistoryData.png|History data in two charts]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[Simantics]] | &#039;&#039;System Dynamics Modelling&#039;&#039;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[image:Preferences-system.svg‎|60px|left]]&lt;br /&gt;
&#039;&#039;&#039;[[Tutorial: Basic System Dynamics Modelling]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[image:Preferences-system.svg‎|60px|left]]&lt;br /&gt;
&#039;&#039;&#039;[[Tutorial: Advanced System Dynamics Modelling]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This tutorial introduces the more advanced features of the system dynamics modelling tool: Modules and Operating interfaces&lt;br /&gt;
&lt;br /&gt;
[[Category: Simantics System Dynamics]]&lt;/div&gt;</summary>
		<author><name>Tuukka Lehtonen</name></author>
	</entry>
	<entry>
		<id>https://wiki.simantics.org/index.php?title=Simantics_System_Dynamics&amp;diff=514</id>
		<title>Simantics System Dynamics</title>
		<link rel="alternate" type="text/html" href="https://wiki.simantics.org/index.php?title=Simantics_System_Dynamics&amp;diff=514"/>
		<updated>2011-06-27T09:22:28Z</updated>

		<summary type="html">&lt;p&gt;Tuukka Lehtonen: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simantics System Dynamics ==&lt;br /&gt;
&lt;br /&gt;
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. New features include module libraries and different analysis tools.&lt;br /&gt;
&lt;br /&gt;
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, [[#Installation Instructions|install]] the software and try our [[Tutorial: Basic System Dynamics Modelling|basic]] and [[Tutorial: Advanced System Dynamics Modelling|advanced]] tutorials!&lt;br /&gt;
&lt;br /&gt;
== Introduction to System Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
===System Dynamics===&lt;br /&gt;
System dynamics is an approach to understanding different organizations, markets and other complex systems and their dynamic behavior. System dynamics modelling in Simantics is a free modelling tool. See [[#Installation Instructions|installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Model===&lt;br /&gt;
[[File:ModelStructure.png|right|thumb|Model structure]]&lt;br /&gt;
System dynamics model is generally understood as the model configuration. In this tool, the model contains also other components. Model can have Operating interfaces that enable the use of the model with simple controls. Operating interfaces are configured separately and when using them, the complex model is hidden from the user. Experiments are the way to simulate the model. In the future, you can have experiments with different configurations, for example different initial values for some parameters. In that way, you don&#039;t have to always configure the model for different scenarios. Modules folder contains all the different module types in your model and you can create new module types there. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Components===&lt;br /&gt;
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.&lt;br /&gt;
[[File:ComponentTypes.png|right|frame|Component types]]&lt;br /&gt;
;Auxiliary&lt;br /&gt;
: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 and WithLookup. Auxiliary is the default type. Parameters are single 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 is a special variable that has an expression and a lookup table. The expresssion defines what value is taken from the defined table.&lt;br /&gt;
;Dependency&lt;br /&gt;
: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.&lt;br /&gt;
;Flow&lt;br /&gt;
: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.&lt;br /&gt;
;Valve&lt;br /&gt;
: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.&lt;br /&gt;
;Stock&lt;br /&gt;
: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. You must give an initial value to the stock. Initial value can be a single value or an equation. You can use values of other variables to calculate the initial value.&lt;br /&gt;
;Cloud&lt;br /&gt;
: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.&lt;br /&gt;
;Module&lt;br /&gt;
: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.&lt;br /&gt;
;Input&lt;br /&gt;
: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&#039;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.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Modeling principles===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
;Variable names&lt;br /&gt;
: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. &lt;br /&gt;
&lt;br /&gt;
:Variable names can and should have multiple words, if they are needed. Unfortunately current version of the tool does not support spaces in variable names. A good practice is to use CamelCase if name contains multiple words. This means that you start every word woth a capital letter (example: ExampleVariable).&lt;br /&gt;
&lt;br /&gt;
;Connections&lt;br /&gt;
:You should try to avoid overlapping dependency arrows. In some situations, however, it is not possible. Dependencies should also form distinctive loops, if there is a loop. It makes it easier to read and understand the model and its behavior.&lt;br /&gt;
&lt;br /&gt;
;Graphical annotations&lt;br /&gt;
:System dynamics contains usually annotations for loops, polarities, delays and so on. Currently those annotations are not supported, but the support will be added later. Annotations are important, again, for communicating the behavior of the model.&lt;br /&gt;
&lt;br /&gt;
==Installation Instructions==&lt;br /&gt;
&lt;br /&gt;
System dynamics tool is a provided with the Simantics platform.&lt;br /&gt;
&lt;br /&gt;
# [https://www.simantics.org/simantics/download Download installer from Simantics download page]&lt;br /&gt;
# Install the program to a directory without spaces. &lt;br /&gt;
# Run Simantics-Sysdyn.exe &amp;lt;br /&amp;gt;&lt;br /&gt;
: (Default path in windows: C:\Simantics\Sysdyn\1.4\simantics-sysdyn\Simantics-Sysdyn.exe)&lt;br /&gt;
&lt;br /&gt;
[http://www.openmodelica.org/ OpenModelica] is used to build and simulate the models. Simantics platform has integrated OpenModelica 1.7 for Windows environments. For other versions and other environments you need to install [http://www.openmodelica.org/index.php/download OpenModelica].&lt;br /&gt;
&lt;br /&gt;
== Workbench ==&lt;br /&gt;
&lt;br /&gt;
[[File:BasicWorkbench.png|center|729px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Diagram&#039;&#039;&#039; &amp;lt;br /&amp;gt; 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. &lt;br /&gt;
# &#039;&#039;&#039;Model Browser&#039;&#039;&#039; &amp;lt;br /&amp;gt; Model browser shows the structure of your model and all items related to it. &amp;lt;br /&amp;gt; Symbols view is stacked with the model browser and used for dragging elements to diagrams.&lt;br /&gt;
# &#039;&#039;&#039;Properties&#039;&#039;&#039; &amp;lt;br /&amp;gt; Property view shows the selected variable&#039;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 are with variables are Equation and Additional information.&lt;br /&gt;
# &#039;&#039;&#039;Trend&#039;&#039;&#039; &amp;lt;br /&amp;gt; Trend 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. Values view and Dependencies are stacked with Trend view and can also be used for analyzing the model.&lt;br /&gt;
# &#039;&#039;&#039;Experiment controls&#039;&#039;&#039; &amp;lt;br /&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If you accidentally close a view, you can reopen them from Window-&amp;gt;Show View-&amp;gt;Other...&lt;br /&gt;
&lt;br /&gt;
== Modelling ==&lt;br /&gt;
&lt;br /&gt;
===Basic modelling===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Basic_1.png|right]]&lt;br /&gt;
;Creating a new model&lt;br /&gt;
:Start a new model by right-clicking the model browser and selecting New-&amp;gt;Model or from the main menu File-&amp;gt;New Model.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Basic_2.png|right]]&lt;br /&gt;
;Creating a new module type&lt;br /&gt;
:Create a new module type by right-clicking on the Modules-folder and selecting New-&amp;gt;Module. This creates a new module type that you can populate to your other modules and the model configuration. &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Configuring a model&lt;br /&gt;
:Model configuration can be opened by double clicking Configuration in the model browser. &lt;br /&gt;
&lt;br /&gt;
;Configuring modules&lt;br /&gt;
: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 module!&lt;br /&gt;
&lt;br /&gt;
;Populate variables&lt;br /&gt;
:You can drag variables to a diagram from symbol view. You can also populate variables using [[#Shortcut and control keys|shortcut keys]]&lt;br /&gt;
&lt;br /&gt;
;Populate modules&lt;br /&gt;
:Modules are populated from the model browser. Just drag the module you want to populate from the Modules folder to a diagram.&lt;br /&gt;
&lt;br /&gt;
;Create connections&lt;br /&gt;
: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.&lt;br /&gt;
: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.&lt;br /&gt;
:There are some restrictions on what connections can be made, but don&#039;t worry, the user interface won&#039;t let you do connections that are not allowed.&lt;br /&gt;
&lt;br /&gt;
;Connections between modules&lt;br /&gt;
:&#039;&#039;&#039;Outside the module&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:You can connect variables to variables in modules like this:&lt;br /&gt;
 MODULE -----&amp;gt; INPUT&lt;br /&gt;
 or&lt;br /&gt;
 ANY VARIABLE -----&amp;gt; MODULE &lt;br /&gt;
:This is just the visual configuration, but you need those connections to really connect variables in the module&#039;s properties.&lt;br /&gt;
:In Inputs -tab you select which variables you connect to inputs inside the module. In Outputs -tab you select which variables you lift from the module to inputs outside it.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Inside the module&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:Input variables get values from outside the module&lt;br /&gt;
&lt;br /&gt;
:Output variables can send their values outside the module. From the variable properties, select Additional Information and press Is Output&lt;br /&gt;
&lt;br /&gt;
;Configure variables&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
;Export model&lt;br /&gt;
:To export your model to a file, select your model from the model browser, right-click and from the context menu choose Export-&amp;gt;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 to for example create different versions of the model, create backups or to transport it to another database.&lt;br /&gt;
&lt;br /&gt;
;Import model&lt;br /&gt;
:Right-click on the model browser and select Import-&amp;gt;Model. Browse to your .tg file and select open. The model is added to your model browser.&lt;br /&gt;
&lt;br /&gt;
===Shortcut and control keys===&lt;br /&gt;
&lt;br /&gt;
Shortcut keys for configuring a model on diagram.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Esc	&lt;br /&gt;
|Cancel operations (e.g. connection and rename).&lt;br /&gt;
|-&lt;br /&gt;
|Shift + A	&lt;br /&gt;
|Hover Auxiliary at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + S&lt;br /&gt;
|Hover Stock at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + C&lt;br /&gt;
|Hover Cloud at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + V&lt;br /&gt;
|Hover Valve at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + I&lt;br /&gt;
|Hover Input at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Alt + left mouse button&lt;br /&gt;
|Start an arrow from a variable. End to another variable by clicking left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Alt + right mouse button&lt;br /&gt;
|Start flow from a variable. End by clicking left mouse button.&lt;br /&gt;
&lt;br /&gt;
If a flow is not started or ended on to a variable, a cloud will be created to that end. &amp;lt;br /&amp;gt;&lt;br /&gt;
If a new flow does not have a valve at either end, a valve will be created in the middle of the flow.&lt;br /&gt;
|-&lt;br /&gt;
|Delete&lt;br /&gt;
|Remove selected variables&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + left mouse button&lt;br /&gt;
|Select multiple variables&lt;br /&gt;
|-&lt;br /&gt;
|Mouse wheel or&amp;lt;br/&amp;gt;+ and -&lt;br /&gt;
|Diagram zoom&lt;br /&gt;
|-&lt;br /&gt;
|drag(mouse3) or&amp;lt;br/&amp;gt;drag(shift + any mouse button)&lt;br /&gt;
|Diagram pan&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + C&lt;br /&gt;
|Copy selected elements&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + X&lt;br /&gt;
|Cut selected elements&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + V&lt;br /&gt;
|Paste copied or cut elements&lt;br /&gt;
|-&lt;br /&gt;
|G&lt;br /&gt;
|Show / hide grid&lt;br /&gt;
|-&lt;br /&gt;
|R&lt;br /&gt;
|Show / hide ruler&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other shortcut keys can be found selecting Window -&amp;gt; Preferences from the main menu. Keys are located in General -&amp;gt; Keys.&lt;br /&gt;
&lt;br /&gt;
== Simulation ==&lt;br /&gt;
&lt;br /&gt;
;Simulate model&lt;br /&gt;
:To simulate a model, you need to activate an experiment. Browse to an experiment in you model browser and double click on the experiment. Experiment controls appear to the main tool bar. Click on the play button to run a simulation.&lt;br /&gt;
&lt;br /&gt;
;Analyze results&lt;br /&gt;
:There are currently three analysis tools in the system dynamics tool.&lt;br /&gt;
:&#039;&#039;&#039;Trend&#039;&#039;&#039;&lt;br /&gt;
::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. &amp;lt;br /&amp;gt; [[File:Trend.png]]&lt;br /&gt;
:&#039;&#039;&#039;Values&#039;&#039;&#039;&lt;br /&gt;
::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. &amp;lt;br /&amp;gt; [[File:Values.png]]&lt;br /&gt;
:&#039;&#039;&#039;Dependencies&#039;&#039;&#039;&lt;br /&gt;
::Dependencies is not actually an analysis tool for simulation results. It can show even without simulation 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 selected at the bottom of the view. &amp;lt;br /&amp;gt; [[File:Dependencies.png]]&lt;br /&gt;
&lt;br /&gt;
;Compare results&lt;br /&gt;
: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 button [[File:Saveresults.png]] 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. &amp;lt;br /&amp;gt; [[File:CompareTrend.png]]&lt;br /&gt;
&lt;br /&gt;
== Operating Interfaces ==&lt;br /&gt;
&lt;br /&gt;
How interfaces can be created, how they can be used, current components&lt;br /&gt;
&lt;br /&gt;
;Create&lt;br /&gt;
:Right-click on Operating interfaces and select New-&amp;gt;Operating UI. Open the Operating User Interface by double clicking it.&lt;br /&gt;
&lt;br /&gt;
;Configure&lt;br /&gt;
:Operating UIs have their own set of widgets. Widget symbols can be seen in the Symbols view and dragged to the diagram. The properties of the widgets can be modified from the properties view (same as equation view). &lt;br /&gt;
:To connect a variable to a widget, just drag it from the model browser to the widget. &lt;br /&gt;
:You can use monitors as labels, but to change the text on the monitor, you have to switch to operating mode by clicking [[File:OperatingModeSwitch.png]].&lt;br /&gt;
&lt;br /&gt;
;Use&lt;br /&gt;
:To use the interface you have created, you have to switch to operating mode by clicking [[File:OperatingModeSwitch.png]]. Activate a simulation, run it and the trends will show the results. You can switch values of parameters with the widgets and simulate again.&lt;br /&gt;
&lt;br /&gt;
== Multidimensional variables ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modeling ===&lt;br /&gt;
&lt;br /&gt;
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):&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Create the model structure&#039;&#039;&#039; &amp;lt;BR /&amp;gt;Model with multidimensional variables looks just like any other model.&amp;lt;BR /&amp;gt; [[File:ModelWithMultidimensionalVariables.png|300px|Model with multidimensional variables]]&lt;br /&gt;
# &#039;&#039;&#039;Create Enumerations and define the indexes&#039;&#039;&#039; &amp;lt;BR /&amp;gt;Enumerations are created by right-clicking configuration and selecting New-&amp;gt;Enumeration.&amp;lt;BR /&amp;gt; [[File:NewEnumeration.png|250px|New enumeration]]&amp;lt;BR /&amp;gt;Define enumeration indexes by adding as many indexes as you want. Rename the indexes by selecting them and then clicking on them again.&amp;lt;BR /&amp;gt;[[File:DefineIndexes.png|200px|Index definitions]]&lt;br /&gt;
# &#039;&#039;&#039;Add Enumerations for variables&#039;&#039;&#039; &amp;lt;BR /&amp;gt;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.[[File:SelectEnumerations.png|500px|Select enumerations for variables]]&lt;br /&gt;
# &#039;&#039;&#039;Define equations for all possible indexes&#039;&#039;&#039; &amp;lt;BR /&amp;gt;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}}.&amp;lt;BR /&amp;gt;[[File:DefineEquations.png|500px|Define equations for all indexes]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Expressions ===&lt;br /&gt;
&lt;br /&gt;
Values for all cells in the variable matrix can be defined in a single expression. &lt;br /&gt;
&lt;br /&gt;
[[File: DefineEquations.png|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:DefineEquations2.png|600px]]&lt;br /&gt;
&lt;br /&gt;
In many situations, it is however more clear to define separate expressions for each cell or blocks. &lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Define range for the expression&#039;&#039;&#039;&amp;lt;BR /&amp;gt; [[File:DefineRange.png]]&lt;br /&gt;
# &#039;&#039;&#039;Define the expression&#039;&#039;&#039; (dimensions of the defined range and the result of the expression must match!) &amp;lt;BR /&amp;gt; [[File:DefineEquations3.png]]&lt;br /&gt;
# &#039;&#039;&#039;Create a new expression&#039;&#039;&#039; &amp;lt;BR /&amp;gt; [[File:CreateNewExpression.png]]&lt;br /&gt;
#&#039;&#039;&#039; Select the new expression&#039;&#039;&#039; &amp;lt;BR /&amp;gt; [[File:SelectNewExpression.png]]&lt;br /&gt;
&lt;br /&gt;
Repeat until there is value for each cell. There must be exactly one value for each cell.&lt;br /&gt;
&lt;br /&gt;
=== Array slices ===&lt;br /&gt;
&lt;br /&gt;
Many times it is useful to access a slice of a  multidimensional variable. In this chapter, we will use the following example variable:&lt;br /&gt;
 enumeration E1 = one, two, three&lt;br /&gt;
 enumeration E2 = eins, zwei, drei&lt;br /&gt;
 &lt;br /&gt;
 Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}&lt;br /&gt;
&lt;br /&gt;
The whole variable can be accessed in three different ways:&lt;br /&gt;
# Auxiliary&lt;br /&gt;
# Auxiliary[E1, E2]&lt;br /&gt;
# Auxiliary[:, :]&lt;br /&gt;
&lt;br /&gt;
The following explains different methods for accessing parts of the variable&lt;br /&gt;
&lt;br /&gt;
 // Single cell&lt;br /&gt;
 Auxiliary[one, eins] = 1&lt;br /&gt;
&lt;br /&gt;
 // Slices&lt;br /&gt;
 Auxiliary[one, E2] = {1,2,3}&lt;br /&gt;
 Auxiliary[E1, zwei] = {{2},{5},{8}}&lt;br /&gt;
 &lt;br /&gt;
 // In addition to single cells and the whole enumeration range, a subrange of the enumeration can be used&lt;br /&gt;
 Auxiliary[two : three, E2] = {{4,5,6},{7,8,9}}&lt;br /&gt;
 Auxiliary[one : two, zwei : drei]  = {{2,3},{5,6}}&lt;br /&gt;
&lt;br /&gt;
The syntax for accessing parts of variables can be used in both expression range definitions and in expressions.&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
Arithmetic operations are defined in Modelica. Below are examples of different operations.&lt;br /&gt;
&lt;br /&gt;
;Addition and substraction&lt;br /&gt;
Addition and substraction are calculated elementwise&lt;br /&gt;
&lt;br /&gt;
 {1,2,3} - {0,2,3} = {1,0,0}&lt;br /&gt;
 {{2,2},{4,4}} + {{8,8},{1,1}} = {{10,10},{5,5}}&lt;br /&gt;
 {1,2,3} - {1,2} = ERROR! Different array sizes&lt;br /&gt;
&lt;br /&gt;
;Division&lt;br /&gt;
Division with a scalar&lt;br /&gt;
 {5,10,15} / 5 = {1,2,3}&lt;br /&gt;
 5 / {5,10,15} = ERROR! not allowed&lt;br /&gt;
&lt;br /&gt;
Division with an array&lt;br /&gt;
 {1,2,3} / {1,2,3} = ERROR! not allowed&lt;br /&gt;
 &lt;br /&gt;
 // Elementwise&lt;br /&gt;
 {1,2,3} ./ {1,2,3} = {1,1,1}&lt;br /&gt;
&lt;br /&gt;
;Multiplication&lt;br /&gt;
&lt;br /&gt;
Multiplication with a scalar&lt;br /&gt;
 {1,2,3} * 2 = {2,4,6}&lt;br /&gt;
 5 * {1,2,3} = {5,10,15}&lt;br /&gt;
&lt;br /&gt;
Matrix multiplication with an array&lt;br /&gt;
 {{3,4},{5,6}} * {1,2} = {11,17}&lt;br /&gt;
 {{3,4},{5,6}}  * {1,2,3} = ERROR! incompatible array sizes&lt;br /&gt;
 &lt;br /&gt;
 //Elementwise&lt;br /&gt;
 {1,2} .* {1,2} = {1,4}&lt;br /&gt;
 &lt;br /&gt;
 Real[3,2] c = {{1,2},{3,4},{5,6}};  &lt;br /&gt;
 Real[2,2] d = {{3,4},{5,6}};&lt;br /&gt;
 Real[2,2] cd;&lt;br /&gt;
 cd = c[2:3, :] .* d; // Result: {{9,16},{25,36}}&lt;br /&gt;
&lt;br /&gt;
=== Builtin functions ===&lt;br /&gt;
&lt;br /&gt;
Modelica has some builtin functions that help using multidimensional variables. This chapter introduces some of the builtin functions. &lt;br /&gt;
&lt;br /&gt;
;Dimension and size functions&lt;br /&gt;
&lt;br /&gt;
We will use the same example variable as previously.&lt;br /&gt;
&lt;br /&gt;
 enumeration E1 = one, two, three&lt;br /&gt;
 enumeration E2 = eins, zwei, drei&lt;br /&gt;
 &lt;br /&gt;
 Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}&lt;br /&gt;
&lt;br /&gt;
;ndims(A)&lt;br /&gt;
The number of dimensions in array A&lt;br /&gt;
 ndims(Auxiliary) = 2&lt;br /&gt;
&lt;br /&gt;
;size(A, i)&lt;br /&gt;
The size of dimension i in array A&lt;br /&gt;
 size(Auxiliary, 2) = 3&lt;br /&gt;
&lt;br /&gt;
;size(A)&lt;br /&gt;
A vector of length ndims(A) containing the dimension sizes of A&lt;br /&gt;
 size(Auxiliary) = {3,3}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Construction functions&lt;br /&gt;
In addition to normal array constructing, a special construction functions can be used.&lt;br /&gt;
&lt;br /&gt;
;zeros(n1,n2,n3,...)&lt;br /&gt;
An array full of zeros with dimensions n1 x n2 x n2 x ... &lt;br /&gt;
 zeros(2, 2) = {{0,0}, {0,0}}&lt;br /&gt;
&lt;br /&gt;
;ones(n1,n2,n3,...)&lt;br /&gt;
An array full of ones with dimensions n1 x n2 x n2 x ... &lt;br /&gt;
 ones(2, 2) = {{1,1}, {1,1}}&lt;br /&gt;
&lt;br /&gt;
;fill(s,n1,n2,n3)&lt;br /&gt;
Like zeros() and ones(), but with user defined value (s) for array elements.&lt;br /&gt;
 fill(3,2,2) = {{3,3}, {3,3}}&lt;br /&gt;
&lt;br /&gt;
;identity(n)&lt;br /&gt;
Creates an n x n integer identity matrix with ones on the diagonal and all other elements zero.&lt;br /&gt;
 identity(3) =&lt;br /&gt;
   1 0 0&lt;br /&gt;
   0 1 0&lt;br /&gt;
   0 0 1&lt;br /&gt;
&lt;br /&gt;
;diagonal(v)&lt;br /&gt;
Constructs a square matrix with elements of vector v on the diagonal and all other elements zero.&lt;br /&gt;
 diagonal({1,2,3}) =&lt;br /&gt;
   1 0 0&lt;br /&gt;
   0 2 0&lt;br /&gt;
   0 0 3&lt;br /&gt;
&lt;br /&gt;
;linspace(x1,x2,n)&lt;br /&gt;
Constracts a Real vector from x1 to x2 with n equally spaced elements.&lt;br /&gt;
 linspace(2,5,4) = {2,3,4,5}&lt;br /&gt;
&lt;br /&gt;
;Reduction functions&lt;br /&gt;
&lt;br /&gt;
Reduction functions reduce arrays to scalars.&lt;br /&gt;
&lt;br /&gt;
;min(A)&lt;br /&gt;
Returns the minimum value in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 min(A) = 1&lt;br /&gt;
&lt;br /&gt;
;max(A)&lt;br /&gt;
Returns the maximum value in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 max(A) = 4&lt;br /&gt;
&lt;br /&gt;
;sum(A)&lt;br /&gt;
Returns the sum of values in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 sum(A) = 10    // 1 + 2 + 3 + 4&lt;br /&gt;
&lt;br /&gt;
;product(A)&lt;br /&gt;
Returns the product of values in array A.&lt;br /&gt;
 Real A = {{1,2},{3,4}}&lt;br /&gt;
 product(A) = 24   // 1 * 2 * 3 * 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Using functions with iterators&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
 enumeration E1 = one, two, three&lt;br /&gt;
 enumeration E2 = eins, zwei, drei&lt;br /&gt;
 Auxiliary[E1, E2] = {{1,2,3},{4,5,6},{7,8,9}}&lt;br /&gt;
 &lt;br /&gt;
 AuxiliarySum[E1] = {sum( Auxiliary[ i , E2 ] ) for i in E1} // Result: {6, 15, 24}&lt;br /&gt;
 &lt;br /&gt;
 /* Same as:&lt;br /&gt;
 {sum(Auxiliary[one, E2]), sum(Auxiliary[two, E2]), sum(Auxiliary[three, E2])}&lt;br /&gt;
 {sum({1,2,3}), sum({4,5,6}), sum({7,8,9})}&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
One expression can have multiple iterators.&lt;br /&gt;
 {sum(Array[ i, j, E3]) for i in E1, j in E2}  // Dimensions reduced from 3 to 2&lt;br /&gt;
&lt;br /&gt;
The range doesn&#039;t have to be the whole enumeration. Subranges can also be used.&lt;br /&gt;
 {sum( Auxiliary[ i , eins : zwei ] ) for i in E1.one : E1.two} // Result: {3, 9}&lt;br /&gt;
 &lt;br /&gt;
 /* Same as&lt;br /&gt;
 {sum(Auxiliary[one, eins : zwei]), sum(Auxiliary[two, eins : zwei])}&lt;br /&gt;
 {sum({1,2}), sum({4,5})}&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
=== Simulation results ===&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:3x3trend.png|300px|Trend view for a 3x3 variable]]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:ShowInCharts.png|500px|Select indexes to show in charts]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Array Variables in Modules ===&lt;br /&gt;
&lt;br /&gt;
[[File:Replaceable.png|frame|Replaceable enumeration inside a module]]&lt;br /&gt;
&lt;br /&gt;
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 [[Simantics_System_Dynamics#Modeling|Modeling]]). &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:ReplacingEnumerationConfiguration.png|frame|left|500px|Module configuration for replacing enumerations inside the module]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the parent configuration, we have used an enumeration with three indexes in the two variables.&lt;br /&gt;
&lt;br /&gt;
[[File:Replacing.png|frame|left|Enumeration in the parent configuration that will replace the enumeration in the module]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ReplacingEnumeration.png|frame|left|Enumeration in the parent configuration that will replace the enumeration in the module]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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!&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
&lt;br /&gt;
Modelica provides a convenient way to use functions in your models. You can create your own functions, import complete function libraries and share function libraries to be used in all of your models. &lt;br /&gt;
&lt;br /&gt;
=== Creating functions ===&lt;br /&gt;
&lt;br /&gt;
[[File:NewFunction.png|right]]&lt;br /&gt;
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-&amp;gt;Function.&lt;br /&gt;
&lt;br /&gt;
Functions that can be found from Functions -folder can be used in your variable definitions.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
Algorithm section defines the actual functionality of the function. In algorithm sections you must use assignments &amp;quot;:=&amp;quot; instead of just plain &amp;quot;=&amp;quot;. All the assignments are calculated in the order they are written.&lt;br /&gt;
&lt;br /&gt;
Below is an example of a simple function. For more examples, see the built-in functions provided with the tool and [https://www.modelica.org/documents/ Modelica specifications].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:ExampleFunction.png]]&lt;br /&gt;
&lt;br /&gt;
=== Function libraries ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NewFunctionLibrary.png|right]]&lt;br /&gt;
&lt;br /&gt;
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)).&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
Create a new function library by right-clicking on Functions folder, Shared functions folder or other module library.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:SharedFunctions.png]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== External functions ===&lt;br /&gt;
&lt;br /&gt;
Modelica allows you to use external functions that are programmed using C language. Below is a simple example of using a function that returns the sum of two arguments. &lt;br /&gt;
&lt;br /&gt;
 double exampleCFunction(double x, double y)&lt;br /&gt;
 {&lt;br /&gt;
   double res;&lt;br /&gt;
   res = x + y;&lt;br /&gt;
   return res;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ImportCFunctionLibrary.png|right]]&lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
(e.g. simantics_home/plugins/org.simantics.openmodelica.win32_x/MinGW/bin/mingw32_gcc.exe -g -O -c ExampleCFunctionCode.c). &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:ExampleExternalFunction.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:ExternalFunctionResult.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modelica functions ===&lt;br /&gt;
&lt;br /&gt;
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 [[Simantics_System_Dynamics#Builtin_functions|builtin functions for arrays]].&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|abs(x)&lt;br /&gt;
|Returns the absolute value of x. Expanded into &amp;quot;(if x &amp;gt;= 0 then x else -x)&amp;quot;.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|acos(x)&lt;br /&gt;
|Inverse cosine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|asin(x)&lt;br /&gt;
|Inverse sine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|atan(x)&lt;br /&gt;
|Inverse tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|atan2(x1,x2)&lt;br /&gt;
|four quadrant inverse tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cat(n,A,B,...)&lt;br /&gt;
|General concatenation function that concatenates arrays A,B,... along the nth dimension.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|ceil(x)&lt;br /&gt;
|Returns the smallest integer not less than x, the closest integer above x.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cos(x)&lt;br /&gt;
|Cosine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cosh(x)&lt;br /&gt;
|Hyperbolic cosine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|cross(x,y)&lt;br /&gt;
|Returns the 3-vector cross product of the 3-vectors x and y.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|delay(expr, delayTime)&lt;br /&gt;
|Returns the value of expr at the time time-delayTime. The value of expr is returned when time &amp;lt;= time.start + delayTime.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|der(x)&lt;br /&gt;
|Time derivative of x. X must be have continuous-time variability.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|div(x, y)&lt;br /&gt;
|Returns the algebraic quotient x/y with any fractional part discarted. E.g. div(10,3) = 3.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|edge(b)&lt;br /&gt;
|Returns true when the value of the boolean expression b changes. Expanded into (b and not pre(b)).&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|exp(x)&lt;br /&gt;
|Exponential, base e.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|floor(x)&lt;br /&gt;
|Returns the largest integer not greater than x, the closest integer below x.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|initial()&lt;br /&gt;
|Returns true at the beginning of the simulation. &lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|integer(x)&lt;br /&gt;
|Returns the largest integer not greater than x as an integer.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|log(x)&lt;br /&gt;
|Natural logarithm. (base e, x &amp;gt; 0)&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|log10(x)&lt;br /&gt;
|Base 10 logarithm. (x &amp;gt; 0)&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|mod(x, y)&lt;br /&gt;
|Returns the integer modulus of x/y: mod(x,y) = x - floor(x/y) * y.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|noEvent(expr)&lt;br /&gt;
|noEvent around an expression causes the expression to NOT generate event.&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; &lt;br /&gt;
:If you want a condition to be checked only on time steps, use noEvent.&lt;br /&gt;
:(e.g. if noEvent(value &amp;gt;= 1) then ... else ...)&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|pre(x)&lt;br /&gt;
|Returns the preceding value of y from time event that has occured before current time.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|rem(x, y)&lt;br /&gt;
|Returns the integer remainder of x/y: rem(x,y) = x - div(x,y) * y.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sample(start, interval)&lt;br /&gt;
|Returns true and triggers time events at times start + i * interval (i=0,1,...).&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sign(x)&lt;br /&gt;
|Returns -1 if x is negative, 1 if x is positive. Expanded into &amp;quot;(if x &amp;gt; 0 then 1 else if x &amp;lt; 0 then -1 else 0)&amp;quot;.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sin(x)&lt;br /&gt;
|Sine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sinh(x)&lt;br /&gt;
|Hyperbolic sine.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|sqrt(x)&lt;br /&gt;
|Square root of x. The value of x must be greater or equal to 0 or an assertion error occurs.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|tan(x)&lt;br /&gt;
|Tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|tanh(x)&lt;br /&gt;
|Hyperbolic tangent.&lt;br /&gt;
|-style=&amp;quot;border-top: 1px solid #CCCCCC;&amp;quot;&lt;br /&gt;
|terminal()&lt;br /&gt;
|Returns true at the end of a successful  simulation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[Simantics]] | &#039;&#039;System Dynamics Modelling&#039;&#039;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[image:Preferences-system.svg‎|60px|left]]&lt;br /&gt;
&#039;&#039;&#039;[[Tutorial: Basic System Dynamics Modelling]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[image:Preferences-system.svg‎|60px|left]]&lt;br /&gt;
&#039;&#039;&#039;[[Tutorial: Advanced System Dynamics Modelling]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This tutorial introduces the more advanced features of the system dynamics modelling tool: Modules and Operating interfaces&lt;br /&gt;
&lt;br /&gt;
[[Category: Simantics System Dynamics]]&lt;/div&gt;</summary>
		<author><name>Tuukka Lehtonen</name></author>
	</entry>
	<entry>
		<id>https://wiki.simantics.org/index.php?title=Simantics_System_Dynamics&amp;diff=374</id>
		<title>Simantics System Dynamics</title>
		<link rel="alternate" type="text/html" href="https://wiki.simantics.org/index.php?title=Simantics_System_Dynamics&amp;diff=374"/>
		<updated>2010-11-22T10:47:04Z</updated>

		<summary type="html">&lt;p&gt;Tuukka Lehtonen: /* Workbench */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simantics System Dynamics ==&lt;br /&gt;
&lt;br /&gt;
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. New features include vector variables, module libraries and different analysis tools.&lt;br /&gt;
&lt;br /&gt;
Some new features, like vector variables, may cause significant changes to the data structure of models in Simantics System Dynamics. Models created with current version may not be directly compatible with the future versions! However, if the future versions have significant changes, we try to create migration tools so that you can migrate our old models to the new versions.&lt;br /&gt;
&lt;br /&gt;
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, [[#Installation Instructions|install]] the software and try our [[Tutorial: Basic System Dynamics Modelling|basic]] and [[Tutorial: Advanced System Dynamics Modelling|advanced]] tutorials!&lt;br /&gt;
&lt;br /&gt;
== Introduction to System Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
===System Dynamics===&lt;br /&gt;
System dynamics is an approach to understanding different organizations, markets and other complex systems and their dynamic behavior. System dynamics modelling in Simantics is a free modelling tool. See [[#Installation Instructions|installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Model===&lt;br /&gt;
[[File:ModelStructure.png|right|thumb|Model structure]]&lt;br /&gt;
System dynamics model is generally understood as the model configuration. In this tool, the model contains also other components. Model can have Operating interfaces that enable the use of the model with simple controls. Operating interfaces are configured separately and when using them, the complex model is hidden from the user. Experiments are the way to simulate the model. In the future, you can have experiments with different configurations, for example different initial values for some parameters. In that way, you don&#039;t have to always configure the model for different scenarios. Modules folder contains all the different module types in your model and you can create new module types there. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Components===&lt;br /&gt;
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.&lt;br /&gt;
[[File:ComponentTypes.png|right|frame|Component types]]&lt;br /&gt;
;Auxiliary&lt;br /&gt;
: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 and WithLookup. Auxiliary is the default type. Parameters are single 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 is a special variable that has an expression and a lookup table. The expresssion defines what value is taken from the defined table.&lt;br /&gt;
;Dependency&lt;br /&gt;
: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.&lt;br /&gt;
;Flow&lt;br /&gt;
: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.&lt;br /&gt;
;Valve&lt;br /&gt;
: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.&lt;br /&gt;
;Stock&lt;br /&gt;
: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. You must give an initial value to the stock. Initial value can be a single value or an equation. You can use values of other variables to calculate the initial value.&lt;br /&gt;
;Cloud&lt;br /&gt;
: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.&lt;br /&gt;
;Module&lt;br /&gt;
: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.&lt;br /&gt;
;Input&lt;br /&gt;
: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&#039;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.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Modeling principles===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
;Variable names&lt;br /&gt;
: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. &lt;br /&gt;
&lt;br /&gt;
:Variable names can and should have multiple words, if they are needed. Unfortunately current version of the tool does not support spaces in variable names. A good practice is to use CamelCase if name contains multiple words. This means that you start every word woth a capital letter (example: ExampleVariable).&lt;br /&gt;
&lt;br /&gt;
;Connections&lt;br /&gt;
:You should try to avoid overlapping dependency arrows. In some situations, however, it is not possible. Dependencies should also form distinctive loops, if there is a loop. It makes it easier to read and understand the model and its behavior.&lt;br /&gt;
&lt;br /&gt;
;Graphical annotations&lt;br /&gt;
:System dynamics contains usually annotations for loops, polarities, delays and so on. Currently those annotations are not supported, but the support will be added later. Annotations are important, again, for communicating the behavior of the model.&lt;br /&gt;
&lt;br /&gt;
==Installation Instructions==&lt;br /&gt;
&lt;br /&gt;
System dynamics tool is a provided with the Simantics platform.&lt;br /&gt;
&lt;br /&gt;
# [https://www.simantics.org/simantics/download Download installer from Simantics download page]&lt;br /&gt;
# Install the program to a directory without spaces. &lt;br /&gt;
# Run Simantics-Sysdyn.exe &amp;lt;br /&amp;gt;&lt;br /&gt;
: (Default path in windows: C:\Simantics\Sysdyn\1.2\simantics-sysdyn\Simantics-Sysdyn.exe)&lt;br /&gt;
&lt;br /&gt;
[http://www.openmodelica.org/ OpenModelica] is used to build and simulate the models. Simantics platform has integrated OpenModelica 1.5 for Windows environments. For other versions and other environments you need to install [http://www.openmodelica.org/index.php/download OpenModelica].&lt;br /&gt;
&lt;br /&gt;
== Workbench ==&lt;br /&gt;
&lt;br /&gt;
[[File:BasicWorkbench.png|center|729px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Diagram&#039;&#039;&#039; &amp;lt;br /&amp;gt; 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. &lt;br /&gt;
# &#039;&#039;&#039;Model Browser&#039;&#039;&#039; &amp;lt;br /&amp;gt; Model browser shows the structure of your model and all items related to it. &amp;lt;br /&amp;gt; Symbols view is stacked with the model browser and used for dragging elements to diagrams.&lt;br /&gt;
# &#039;&#039;&#039;Properties&#039;&#039;&#039; &amp;lt;br /&amp;gt; Property view shows the selected variable&#039;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 are with variables are Equation and Additional information.&lt;br /&gt;
# &#039;&#039;&#039;Trend&#039;&#039;&#039; &amp;lt;br /&amp;gt; Trend 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. Values view and Dependencies are stacked with Trend view and can also be used for analyzing the model.&lt;br /&gt;
# &#039;&#039;&#039;Experiment controls&#039;&#039;&#039; &amp;lt;br /&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== Modelling ==&lt;br /&gt;
&lt;br /&gt;
===Basic modelling===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Basic_1.png|right]]&lt;br /&gt;
;Creating a new model&lt;br /&gt;
:Start a new model by right-clicking the model browser and selecting New-&amp;gt;Model or from the main menu File-&amp;gt;New Model.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Basic_2.png|right]]&lt;br /&gt;
;Creating a new module type&lt;br /&gt;
:Create a new module type by right-clicking on the Modules-folder and selecting New-&amp;gt;Module. This creates a new module type that you can populate to your other modules and the model configuration. &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Configuring a model&lt;br /&gt;
:Model configuration can be opened by double clicking Configuration in the model browser. &lt;br /&gt;
&lt;br /&gt;
;Configuring modules&lt;br /&gt;
: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 module!&lt;br /&gt;
&lt;br /&gt;
;Populate variables&lt;br /&gt;
:You can drag variables to a diagram from symbol view. You can also populate variables using [[#Shortcut and control keys|shortcut keys]]&lt;br /&gt;
&lt;br /&gt;
;Populate modules&lt;br /&gt;
:Modules are populated from the model browser. Just drag the module you want to populate from the Modules folder to a diagram.&lt;br /&gt;
&lt;br /&gt;
;Create connections&lt;br /&gt;
: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.&lt;br /&gt;
: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.&lt;br /&gt;
:There are some restrictions on what connections can be made, but don&#039;t worry, the user interface won&#039;t let you do connections that are not allowed.&lt;br /&gt;
&lt;br /&gt;
;Connections between modules&lt;br /&gt;
:&#039;&#039;&#039;Outside the module&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:You can connect variables to variables in modules like this:&lt;br /&gt;
 MODULE -----&amp;gt; INPUT&lt;br /&gt;
 or&lt;br /&gt;
 ANY VARIABLE -----&amp;gt; MODULE &lt;br /&gt;
:This is just the visual configuration, but you need those connections to really connect variables in the module&#039;s properties.&lt;br /&gt;
:In Inputs -tab you select which variables you connect to inputs inside the module. In Outputs -tab you select which variables you lift from the module to inputs outside it.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Inside the module&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:Input variables get values from outside the module&lt;br /&gt;
&lt;br /&gt;
:Output variables can send their values outside the module. From the variable properties, select Additional Information and press Is Output&lt;br /&gt;
&lt;br /&gt;
;Configure variables&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
;Export model&lt;br /&gt;
:To export your model to a file, select your model from the model browser, right-click and from the context menu choose Export... 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 to for example create different versions of the model, create backups or to transport it to another database.&lt;br /&gt;
&lt;br /&gt;
;Import model&lt;br /&gt;
:Right-click on the model browser and select Import... Browse to your .tg file and select open. The model is added to your model browser.&lt;br /&gt;
&lt;br /&gt;
===Shortcut and control keys===&lt;br /&gt;
&lt;br /&gt;
Shortcut keys for configuring a model on diagram.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Shift + A	&lt;br /&gt;
|Hover Auxiliary at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + S&lt;br /&gt;
|Hover Stock at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + C&lt;br /&gt;
|Hover Cloud at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + V&lt;br /&gt;
|Hover Valve at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + I&lt;br /&gt;
|Hover Input at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Alt + left mouse button&lt;br /&gt;
|Start an arrow from a variable. End to another variable by clicking left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Alt + right mouse button&lt;br /&gt;
|Start flow from a variable. End by clicking left mouse button.&lt;br /&gt;
&lt;br /&gt;
If a flow is not started or ended on to a variable, a cloud will be created to that end. &amp;lt;br /&amp;gt;&lt;br /&gt;
If a new flow does not have a valve at either end, a valve will be created in the middle of the flow.&lt;br /&gt;
|-&lt;br /&gt;
|Delete&lt;br /&gt;
|Remove selected variables&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + left mouse button&lt;br /&gt;
|Select multiple variables&lt;br /&gt;
|-&lt;br /&gt;
|Mouse wheel or&amp;lt;br/&amp;gt;+ and -&lt;br /&gt;
|Diagram zoom&lt;br /&gt;
|-&lt;br /&gt;
|drag(mouse3) or&amp;lt;br/&amp;gt;drag(shift + any mouse button)&lt;br /&gt;
|Diagram pan&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + Z&lt;br /&gt;
|Undo diagram action&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + Y&lt;br /&gt;
|Redo diagram action&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + C&lt;br /&gt;
|Copy selected elements&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + X&lt;br /&gt;
|Cut selected elements&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + V&lt;br /&gt;
|Paste copied or cut elements&lt;br /&gt;
|-&lt;br /&gt;
|G&lt;br /&gt;
|Show / hide grid&lt;br /&gt;
|-&lt;br /&gt;
|R&lt;br /&gt;
|Show / hide ruler&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other shortcut keys can be found selecting Window -&amp;gt; Preferences from the main menu. Keys are located in General -&amp;gt; Keys.&lt;br /&gt;
&lt;br /&gt;
== Simulation ==&lt;br /&gt;
&lt;br /&gt;
;Simulate model&lt;br /&gt;
:To simulate a model, you need to activate an experiment. Browse to an experiment in you model browser and double click on the experiment. Experiment controls appear to the main tool bar. Click on the play button to run a simulation.&lt;br /&gt;
&lt;br /&gt;
;Analyze results&lt;br /&gt;
:There are currently three analysis tools in the system dynamics tool.&lt;br /&gt;
:&#039;&#039;&#039;Trend&#039;&#039;&#039;&lt;br /&gt;
::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. &amp;lt;br /&amp;gt; [[File:Trend.png]]&lt;br /&gt;
:&#039;&#039;&#039;Values&#039;&#039;&#039;&lt;br /&gt;
::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. &amp;lt;br /&amp;gt; [[File:Values.png]]&lt;br /&gt;
:&#039;&#039;&#039;Dependencies&#039;&#039;&#039;&lt;br /&gt;
::Dependencies is not actually an analysis tool for simulation results. It can show even without simulation 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 selected at the bottom of the view. &amp;lt;br /&amp;gt; [[File:Dependencies.png]]&lt;br /&gt;
&lt;br /&gt;
;Compare results&lt;br /&gt;
: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 button [[File:Saveresults.png]] 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. &amp;lt;br /&amp;gt; [[File:CompareTrend.png]]&lt;br /&gt;
&lt;br /&gt;
== Operating Interfaces ==&lt;br /&gt;
&lt;br /&gt;
How interfaces can be created, how they can be used, current components&lt;br /&gt;
&lt;br /&gt;
;Create&lt;br /&gt;
:Right-click on Operating interfaces and select New-&amp;gt;Operating UI. Open the Operating User Interface by double clicking it.&lt;br /&gt;
&lt;br /&gt;
;Configure&lt;br /&gt;
:Operating UIs have their own set of widgets. Widget symbols can be seen in the Symbols view and dragged to the diagram. The properties of the widgets can be modified from the properties view (same as equation view). &lt;br /&gt;
:To connect a variable to a widget, just drag it from the model browser to the widget. &lt;br /&gt;
:You can use monitors as labels, but to change the text on the monitor, you have to switch to operating mode by clicking [[File:OperatingModeSwitch.png]].&lt;br /&gt;
&lt;br /&gt;
;Use&lt;br /&gt;
:To use the interface you have created, you have to switch to operating mode by clicking [[File:OperatingModeSwitch.png]]. Activate a simulation, run it and the trends will show the results. You can switch values of parameters with the widgets and simulate again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[Simantics]] | &#039;&#039;System Dynamics Modelling&#039;&#039;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[image:Preferences-system.svg‎|60px|left]]&lt;br /&gt;
&#039;&#039;&#039;[[Tutorial: Basic System Dynamics Modelling]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[image:Preferences-system.svg‎|60px|left]]&lt;br /&gt;
&#039;&#039;&#039;[[Tutorial: Advanced System Dynamics Modelling]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This tutorial introduces the more advanced features of the system dynamics modelling tool: Modules and Operating interfaces&lt;/div&gt;</summary>
		<author><name>Tuukka Lehtonen</name></author>
	</entry>
	<entry>
		<id>https://wiki.simantics.org/index.php?title=Simantics_System_Dynamics&amp;diff=373</id>
		<title>Simantics System Dynamics</title>
		<link rel="alternate" type="text/html" href="https://wiki.simantics.org/index.php?title=Simantics_System_Dynamics&amp;diff=373"/>
		<updated>2010-11-22T10:45:05Z</updated>

		<summary type="html">&lt;p&gt;Tuukka Lehtonen: /* Workbench */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simantics System Dynamics ==&lt;br /&gt;
&lt;br /&gt;
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. New features include vector variables, module libraries and different analysis tools.&lt;br /&gt;
&lt;br /&gt;
Some new features, like vector variables, may cause significant changes to the data structure of models in Simantics System Dynamics. Models created with current version may not be directly compatible with the future versions! However, if the future versions have significant changes, we try to create migration tools so that you can migrate our old models to the new versions.&lt;br /&gt;
&lt;br /&gt;
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, [[#Installation Instructions|install]] the software and try our [[Tutorial: Basic System Dynamics Modelling|basic]] and [[Tutorial: Advanced System Dynamics Modelling|advanced]] tutorials!&lt;br /&gt;
&lt;br /&gt;
== Introduction to System Dynamics Simulation ==&lt;br /&gt;
&lt;br /&gt;
===System Dynamics===&lt;br /&gt;
System dynamics is an approach to understanding different organizations, markets and other complex systems and their dynamic behavior. System dynamics modelling in Simantics is a free modelling tool. See [[#Installation Instructions|installation instructions]].&lt;br /&gt;
&lt;br /&gt;
===Model===&lt;br /&gt;
[[File:ModelStructure.png|right|thumb|Model structure]]&lt;br /&gt;
System dynamics model is generally understood as the model configuration. In this tool, the model contains also other components. Model can have Operating interfaces that enable the use of the model with simple controls. Operating interfaces are configured separately and when using them, the complex model is hidden from the user. Experiments are the way to simulate the model. In the future, you can have experiments with different configurations, for example different initial values for some parameters. In that way, you don&#039;t have to always configure the model for different scenarios. Modules folder contains all the different module types in your model and you can create new module types there. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Components===&lt;br /&gt;
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.&lt;br /&gt;
[[File:ComponentTypes.png|right|frame|Component types]]&lt;br /&gt;
;Auxiliary&lt;br /&gt;
: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 and WithLookup. Auxiliary is the default type. Parameters are single 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 is a special variable that has an expression and a lookup table. The expresssion defines what value is taken from the defined table.&lt;br /&gt;
;Dependency&lt;br /&gt;
: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.&lt;br /&gt;
;Flow&lt;br /&gt;
: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.&lt;br /&gt;
;Valve&lt;br /&gt;
: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.&lt;br /&gt;
;Stock&lt;br /&gt;
: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. You must give an initial value to the stock. Initial value can be a single value or an equation. You can use values of other variables to calculate the initial value.&lt;br /&gt;
;Cloud&lt;br /&gt;
: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.&lt;br /&gt;
;Module&lt;br /&gt;
: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.&lt;br /&gt;
;Input&lt;br /&gt;
: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&#039;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.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Modeling principles===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
;Variable names&lt;br /&gt;
: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. &lt;br /&gt;
&lt;br /&gt;
:Variable names can and should have multiple words, if they are needed. Unfortunately current version of the tool does not support spaces in variable names. A good practice is to use CamelCase if name contains multiple words. This means that you start every word woth a capital letter (example: ExampleVariable).&lt;br /&gt;
&lt;br /&gt;
;Connections&lt;br /&gt;
:You should try to avoid overlapping dependency arrows. In some situations, however, it is not possible. Dependencies should also form distinctive loops, if there is a loop. It makes it easier to read and understand the model and its behavior.&lt;br /&gt;
&lt;br /&gt;
;Graphical annotations&lt;br /&gt;
:System dynamics contains usually annotations for loops, polarities, delays and so on. Currently those annotations are not supported, but the support will be added later. Annotations are important, again, for communicating the behavior of the model.&lt;br /&gt;
&lt;br /&gt;
==Installation Instructions==&lt;br /&gt;
&lt;br /&gt;
System dynamics tool is a provided with the Simantics platform.&lt;br /&gt;
&lt;br /&gt;
# [https://www.simantics.org/simantics/download Download installer from Simantics download page]&lt;br /&gt;
# Install the program to a directory without spaces. &lt;br /&gt;
# Run Simantics-Sysdyn.exe &amp;lt;br /&amp;gt;&lt;br /&gt;
: (Default path in windows: C:\Simantics\Sysdyn\1.2\simantics-sysdyn\Simantics-Sysdyn.exe)&lt;br /&gt;
&lt;br /&gt;
[http://www.openmodelica.org/ OpenModelica] is used to build and simulate the models. Simantics platform has integrated OpenModelica 1.5 for Windows environments. For other versions and other environments you need to install [http://www.openmodelica.org/index.php/download OpenModelica].&lt;br /&gt;
&lt;br /&gt;
== Workbench ==&lt;br /&gt;
&lt;br /&gt;
[[File:BasicWorkbench.png|center|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Diagram&#039;&#039;&#039; &amp;lt;br /&amp;gt; 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. &lt;br /&gt;
# &#039;&#039;&#039;Model Browser&#039;&#039;&#039; &amp;lt;br /&amp;gt; Model browser shows the structure of your model and all items related to it. &amp;lt;br /&amp;gt; Symbols view is stacked with the model browser and used for dragging elements to diagrams.&lt;br /&gt;
# &#039;&#039;&#039;Properties&#039;&#039;&#039; &amp;lt;br /&amp;gt; Property view shows the selected variable&#039;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 are with variables are Equation and Additional information.&lt;br /&gt;
# &#039;&#039;&#039;Trend&#039;&#039;&#039; &amp;lt;br /&amp;gt; Trend 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. Values view and Dependencies are stacked with Trend view and can also be used for analyzing the model.&lt;br /&gt;
# &#039;&#039;&#039;Experiment controls&#039;&#039;&#039; &amp;lt;br /&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== Modelling ==&lt;br /&gt;
&lt;br /&gt;
===Basic modelling===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Basic_1.png|right]]&lt;br /&gt;
;Creating a new model&lt;br /&gt;
:Start a new model by right-clicking the model browser and selecting New-&amp;gt;Model or from the main menu File-&amp;gt;New Model.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Basic_2.png|right]]&lt;br /&gt;
;Creating a new module type&lt;br /&gt;
:Create a new module type by right-clicking on the Modules-folder and selecting New-&amp;gt;Module. This creates a new module type that you can populate to your other modules and the model configuration. &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Configuring a model&lt;br /&gt;
:Model configuration can be opened by double clicking Configuration in the model browser. &lt;br /&gt;
&lt;br /&gt;
;Configuring modules&lt;br /&gt;
: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 module!&lt;br /&gt;
&lt;br /&gt;
;Populate variables&lt;br /&gt;
:You can drag variables to a diagram from symbol view. You can also populate variables using [[#Shortcut and control keys|shortcut keys]]&lt;br /&gt;
&lt;br /&gt;
;Populate modules&lt;br /&gt;
:Modules are populated from the model browser. Just drag the module you want to populate from the Modules folder to a diagram.&lt;br /&gt;
&lt;br /&gt;
;Create connections&lt;br /&gt;
: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.&lt;br /&gt;
: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.&lt;br /&gt;
:There are some restrictions on what connections can be made, but don&#039;t worry, the user interface won&#039;t let you do connections that are not allowed.&lt;br /&gt;
&lt;br /&gt;
;Connections between modules&lt;br /&gt;
:&#039;&#039;&#039;Outside the module&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:You can connect variables to variables in modules like this:&lt;br /&gt;
 MODULE -----&amp;gt; INPUT&lt;br /&gt;
 or&lt;br /&gt;
 ANY VARIABLE -----&amp;gt; MODULE &lt;br /&gt;
:This is just the visual configuration, but you need those connections to really connect variables in the module&#039;s properties.&lt;br /&gt;
:In Inputs -tab you select which variables you connect to inputs inside the module. In Outputs -tab you select which variables you lift from the module to inputs outside it.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Inside the module&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
:Input variables get values from outside the module&lt;br /&gt;
&lt;br /&gt;
:Output variables can send their values outside the module. From the variable properties, select Additional Information and press Is Output&lt;br /&gt;
&lt;br /&gt;
;Configure variables&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
;Export model&lt;br /&gt;
:To export your model to a file, select your model from the model browser, right-click and from the context menu choose Export... 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 to for example create different versions of the model, create backups or to transport it to another database.&lt;br /&gt;
&lt;br /&gt;
;Import model&lt;br /&gt;
:Right-click on the model browser and select Import... Browse to your .tg file and select open. The model is added to your model browser.&lt;br /&gt;
&lt;br /&gt;
===Shortcut and control keys===&lt;br /&gt;
&lt;br /&gt;
Shortcut keys for configuring a model on diagram.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|Shift + A	&lt;br /&gt;
|Hover Auxiliary at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + S&lt;br /&gt;
|Hover Stock at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + C&lt;br /&gt;
|Hover Cloud at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + V&lt;br /&gt;
|Hover Valve at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Shift + I&lt;br /&gt;
|Hover Input at the cursor position, populate with left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Alt + left mouse button&lt;br /&gt;
|Start an arrow from a variable. End to another variable by clicking left mouse button.&lt;br /&gt;
|-&lt;br /&gt;
|Alt + right mouse button&lt;br /&gt;
|Start flow from a variable. End by clicking left mouse button.&lt;br /&gt;
&lt;br /&gt;
If a flow is not started or ended on to a variable, a cloud will be created to that end. &amp;lt;br /&amp;gt;&lt;br /&gt;
If a new flow does not have a valve at either end, a valve will be created in the middle of the flow.&lt;br /&gt;
|-&lt;br /&gt;
|Delete&lt;br /&gt;
|Remove selected variables&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + left mouse button&lt;br /&gt;
|Select multiple variables&lt;br /&gt;
|-&lt;br /&gt;
|Mouse wheel or&amp;lt;br/&amp;gt;+ and -&lt;br /&gt;
|Diagram zoom&lt;br /&gt;
|-&lt;br /&gt;
|drag(mouse3) or&amp;lt;br/&amp;gt;drag(shift + any mouse button)&lt;br /&gt;
|Diagram pan&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + Z&lt;br /&gt;
|Undo diagram action&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + Y&lt;br /&gt;
|Redo diagram action&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + C&lt;br /&gt;
|Copy selected elements&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + X&lt;br /&gt;
|Cut selected elements&lt;br /&gt;
|-&lt;br /&gt;
|Ctrl + V&lt;br /&gt;
|Paste copied or cut elements&lt;br /&gt;
|-&lt;br /&gt;
|G&lt;br /&gt;
|Show / hide grid&lt;br /&gt;
|-&lt;br /&gt;
|R&lt;br /&gt;
|Show / hide ruler&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other shortcut keys can be found selecting Window -&amp;gt; Preferences from the main menu. Keys are located in General -&amp;gt; Keys.&lt;br /&gt;
&lt;br /&gt;
== Simulation ==&lt;br /&gt;
&lt;br /&gt;
;Simulate model&lt;br /&gt;
:To simulate a model, you need to activate an experiment. Browse to an experiment in you model browser and double click on the experiment. Experiment controls appear to the main tool bar. Click on the play button to run a simulation.&lt;br /&gt;
&lt;br /&gt;
;Analyze results&lt;br /&gt;
:There are currently three analysis tools in the system dynamics tool.&lt;br /&gt;
:&#039;&#039;&#039;Trend&#039;&#039;&#039;&lt;br /&gt;
::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. &amp;lt;br /&amp;gt; [[File:Trend.png]]&lt;br /&gt;
:&#039;&#039;&#039;Values&#039;&#039;&#039;&lt;br /&gt;
::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. &amp;lt;br /&amp;gt; [[File:Values.png]]&lt;br /&gt;
:&#039;&#039;&#039;Dependencies&#039;&#039;&#039;&lt;br /&gt;
::Dependencies is not actually an analysis tool for simulation results. It can show even without simulation 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 selected at the bottom of the view. &amp;lt;br /&amp;gt; [[File:Dependencies.png]]&lt;br /&gt;
&lt;br /&gt;
;Compare results&lt;br /&gt;
: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 button [[File:Saveresults.png]] 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. &amp;lt;br /&amp;gt; [[File:CompareTrend.png]]&lt;br /&gt;
&lt;br /&gt;
== Operating Interfaces ==&lt;br /&gt;
&lt;br /&gt;
How interfaces can be created, how they can be used, current components&lt;br /&gt;
&lt;br /&gt;
;Create&lt;br /&gt;
:Right-click on Operating interfaces and select New-&amp;gt;Operating UI. Open the Operating User Interface by double clicking it.&lt;br /&gt;
&lt;br /&gt;
;Configure&lt;br /&gt;
:Operating UIs have their own set of widgets. Widget symbols can be seen in the Symbols view and dragged to the diagram. The properties of the widgets can be modified from the properties view (same as equation view). &lt;br /&gt;
:To connect a variable to a widget, just drag it from the model browser to the widget. &lt;br /&gt;
:You can use monitors as labels, but to change the text on the monitor, you have to switch to operating mode by clicking [[File:OperatingModeSwitch.png]].&lt;br /&gt;
&lt;br /&gt;
;Use&lt;br /&gt;
:To use the interface you have created, you have to switch to operating mode by clicking [[File:OperatingModeSwitch.png]]. Activate a simulation, run it and the trends will show the results. You can switch values of parameters with the widgets and simulate again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[Simantics]] | &#039;&#039;System Dynamics Modelling&#039;&#039;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[image:Preferences-system.svg‎|60px|left]]&lt;br /&gt;
&#039;&#039;&#039;[[Tutorial: Basic System Dynamics Modelling]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[image:Preferences-system.svg‎|60px|left]]&lt;br /&gt;
&#039;&#039;&#039;[[Tutorial: Advanced System Dynamics Modelling]]&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This tutorial introduces the more advanced features of the system dynamics modelling tool: Modules and Operating interfaces&lt;/div&gt;</summary>
		<author><name>Tuukka Lehtonen</name></author>
	</entry>
	<entry>
		<id>https://wiki.simantics.org/index.php?title=Simantics_End_User_Documentation&amp;diff=364</id>
		<title>Simantics End User Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.simantics.org/index.php?title=Simantics_End_User_Documentation&amp;diff=364"/>
		<updated>2010-10-15T07:46:56Z</updated>

		<summary type="html">&lt;p&gt;Tuukka Lehtonen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ [[image:Simantics_puzzle_piece.png|right|480px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Simantics&#039;&#039;&#039; is a software platform for modelling and simulation. The system has client-server architecture with a semantic ontology-based modelling database and Eclipse framework -based client software with plug-in interface. The Simantics platform and many of its components are open source under Eclipse Public License EPL.&lt;br /&gt;
&lt;br /&gt;
Simantics platform is used in open source and commercial modelling and simulation products. Simantics comes with [[System_Dynamics_Modelling | System dynamics modelling and simulation tool]], which is an open source tool for modelling business processes. The next versions of [http://www.apros.fi/ Apros] and [http://balas.vtt.fi/ Balas] will be based on the Simantics platform. For more information on Simantics and related projects, visit [http://www.simantics.org/ Simantics website].&lt;br /&gt;
&lt;br /&gt;
The philosophy of the Simantics platform is to offer an open, high level application platform on which different computational tools can be easily integrated to form a common environment for modelling and simulation. One of the biggest innovations in the Simantics platform is the semantic modelling approach. The data triple engine on the server side enables high performance data management and arbitrary mapping of data. This enables e.g. efficient mapping of simulation and measurement data to the model configuration and its visualisation.&lt;br /&gt;
&lt;br /&gt;
This &#039;&#039;Simantics End User Documentation&#039;&#039; provides information on the open source products that have been developed using Simantics platform. The basic principles of Simantics platform and some components common to all Simantics-based products are also explained. If you wish to dig deeper to the foundations of the Simantics platform or create your own modelling and simulation tool based on Simantics, see [http://dev.simantics.org/ Simantics Developer Documentation] or contact us through [http://www.simantics.org Simantics website].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=250px heights=165px perrow=3 caption=&amp;quot;Screenshots of products based on Simantics Platform&amp;quot;&amp;gt;&lt;br /&gt;
File:SysdynShot.png|System Dynamics&lt;br /&gt;
File:AprosShot.png|Apros&lt;br /&gt;
File:BalasShot.png|Balas&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [[Simantics]] ===&lt;br /&gt;
* [[Simantics#About Simantics Platform|About Simantics Platform]]&lt;br /&gt;
* [[Simantics#Simantics Development and Open Source|Simantics Development and Open Source]]&lt;br /&gt;
* [[Simantics#Simantics Concepts and Conventions|Simantics Concepts and Conventions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== [[System Dynamics Modelling]] ===&lt;br /&gt;
&lt;br /&gt;
* [[System Dynamics Modelling#Introduction to System Dynamics Simulation|Introduction to System Dynamics Simulation]]&lt;br /&gt;
* [[System Dynamics Modelling#Installation Instructions|Installation Instructions]]&lt;br /&gt;
* [[System Dynamics Modelling#Workbench|Workbench]]&lt;br /&gt;
* [[System Dynamics Modelling#Modelling|Modelling]]&lt;br /&gt;
* [[System Dynamics Modelling#Simulation|Simulation]]&lt;br /&gt;
* [[System Dynamics Modelling#Operating Interfaces|Operating Interfaces]]&lt;br /&gt;
&lt;br /&gt;
[[Tutorial: Basic System Dynamics Modelling]]&lt;br /&gt;
&lt;br /&gt;
[[Tutorial: Advanced System Dynamics Modelling]]&lt;br /&gt;
&lt;br /&gt;
-----&lt;/div&gt;</summary>
		<author><name>Tuukka Lehtonen</name></author>
	</entry>
	<entry>
		<id>https://wiki.simantics.org/index.php?title=Getting_Started_with_Simantics&amp;diff=161</id>
		<title>Getting Started with Simantics</title>
		<link rel="alternate" type="text/html" href="https://wiki.simantics.org/index.php?title=Getting_Started_with_Simantics&amp;diff=161"/>
		<updated>2010-08-02T23:24:38Z</updated>

		<summary type="html">&lt;p&gt;Tuukka Lehtonen: /* What Do You Need to Use Simantics? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simantics Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Text ...&lt;br /&gt;
&lt;br /&gt;
== Getting Started with Simantics ==&lt;br /&gt;
&lt;br /&gt;
=== What is Simantics ===&lt;br /&gt;
&lt;br /&gt;
Put in a nutshell: Simantics is a software platform especially for modelling and numerical simulation. That is, it is a basis, a grounding to build a modelling and simulation software or to integrate different software tools. Simantics package does not include any &amp;quot;Simantics solver&amp;quot;, but all the solvers are third party components. At the time of writing this document, Apros, Balas, and Modelica integrations are under construction.&lt;br /&gt;
&lt;br /&gt;
The platform contains graphical client software built on Eclipse software framework and a database server for holding all the data.  For an end user working on a workstation the server can be seen as a process running when the software is started, so in many cases you don&#039;t have to care about the client-server architecture and all its fine nuances. On the right there are some screen shots to show how Simantics looks like. It is meant to be a fully featured, industrial strength modelling tool. Still, the main idea is something new and more that what modelling and simulation experts have used to. It is definitely worth giving it a chance!&lt;br /&gt;
&lt;br /&gt;
Some examples of what Simantics can be used for:&lt;br /&gt;
* Graphical modelling environment for system simulation: For example plant modelling or electric circuit design using 2D diagram style graphical tools. &lt;br /&gt;
* Solver communication and integration solution: A solution for connecting existing numerical solvers for co-simulation. &lt;br /&gt;
* Solution for complex modelling data management: Data model for complex, large model base management, large model database that is developed by several modellers around the internet. &lt;br /&gt;
* Platform and a set of tools for distributed model development and simulation: Large, worldwide organisations need tools that support their distributed organisation. Simantics architecture is designed from the very beginning to support this. &lt;br /&gt;
&lt;br /&gt;
The innovation under the hood in Simantics is its semantic data model used for practically everything from 2D graphics to modelling data and model domain mappings - this is the already mentioned database server. This technology allows the model database to be intelligent and flexible so that the data in the database is kept up-to-date and user&#039;s unnecessary work is minimised. The really nice feature of the semantic data model is the built-in ability to easily map somehow related data in the data base - as a matter of fact, the data does not have to be related at all. All kind of data can be mapped if the user wants it. Another nice feature is that the user can add rules to the data and so implement e.g. model validation into the data. This is especially useful for managing complex system models and large data sets. Imagine if you have to keep a model of a whole power plant or paper machine consistent and you have thousands of model components that have cross relations in the model.&lt;br /&gt;
&lt;br /&gt;
=== What Do You Need to Use Simantics? ===&lt;br /&gt;
&lt;br /&gt;
Simple and short answer: you need to download Simantics installation package for your preferred system (Windows or later Linux), install it according to instructions in the Simantics Installation Instructions page, read at least the next section Using Simantics, and start using the software. The installation package includes all basic components, i.e. ProCore server, Simantics Project Manager, Simantics Workbench client, and Eclipse. The only extra package you need to install is Java Runtime Environment. Check the Simantics Installation Instructions for more information on this, too.&lt;br /&gt;
&lt;br /&gt;
==== Simantics Principles ====&lt;br /&gt;
&lt;br /&gt;
Simantics is licensed under Eclipse Public License (EPL). This gives quite much freedom for how to use Simantics for different purposes. All development done straight to the platform has to be given out as open source under EPL. But applications build on the platform that only uses the functionality of existing components can be licensed also with other licenses. The author of this kind of components is always responsible that there are no restrictions to other way for using other licence than EPL. E.g. if someone wants to use a so-called strict GPL license that requires all the code that is somehow involved to be GPL, this combination is not possible. Simantics licensing can&#039;t be changed to something else than EPL by no-one else than the copyright owners of Simantics.&lt;br /&gt;
&lt;br /&gt;
Simantics is open source software. Our intention is to do, obviously in smaller scale, the same that Linux has done to computer user&#039;s community. We try to introduce the same openness and sharing attitude to the modelling and simulation community. There are huge number of excellent simulation software available as open source, but often they lack easy-to-use interface and interoperability. Simantics tries to solve this problem by offering an open, vendor independent platform for pre- and post-processing tools and solver integration. In fact, the powerful data model and rich graphical user interface features enable much more to be built on the platform.&lt;br /&gt;
&lt;br /&gt;
==== About Simantics Documentation ====&lt;br /&gt;
&lt;br /&gt;
We work hard to keep also Simantics documentation up-to-date and rich for both end-users and developers, but during the pre-product phase we have to focus our small resources mainly to code development. This means there are large parts missing of the documentation and the existing documentation may contain errors. Please, be patient or contact us to volunteer for helping; the easiest way to contact us is from the Simantics web site contact page.&lt;br /&gt;
&lt;br /&gt;
Simantics documentation is meant to follow Simantics software releases so that we freeze a snapshot of the documentation and start building a new one a short while after the software release date. This means that the documentation here won&#039;t be much updated but the major contributions are done to Simantics 0.6 Documentation wiki. This documentation will, of course, be open for everyone to read.&lt;br /&gt;
&lt;br /&gt;
==== Using Simantics ====&lt;br /&gt;
&lt;br /&gt;
After installing Simantics (see Simantics Installation Instructions) you can start using Simantics by click the Simantics icon on your desktop, launch it from the command line, or select it from the menu - whatever is the way it is available in your preferred environment. After a short while a splash screen appears showing the nice Simantics puzzle piece logo and the loading state of the software. The platform asks for a workspace folder, you can accept the default folder. Next the graphical environment opens [fig 1].&lt;br /&gt;
&lt;br /&gt;
== Introduction to Simantics Concepts and Conventions ==&lt;br /&gt;
&lt;br /&gt;
Simantics user interface is built on top of Eclipse and thus the user interface logic follows closely the one introduced in Eclipse. This page shortly descripes the main concepts of Eclipse. More information can be found from the [http://help.eclipse.org/ganymede/index.jsp?nav=/0_1 Eclipse Workbench User Guide].&lt;br /&gt;
&lt;br /&gt;
=== Simantics Application Model  ===&lt;br /&gt;
&lt;br /&gt;
[[image:Simantics_Application_Model_01.png|right|400px]]&lt;br /&gt;
Simantics application model is illustrated in the Figure on right. The working procedure starts with opening the Simantics Workbench, which first opens the Simantics Project Management application. Here you can manage the projects and their properties, such as database and features included into the project. Opening a project opens Simantics Workspace &amp;amp;mdash; a project specific workspace, which restores the application state from the previous session.&lt;br /&gt;
&lt;br /&gt;
In Simantics Workspace, the user can change the workspace perspective based on the work process. A perspective contains a set of views relative the one working process, such as modelling and simulation with Apros. In addition, user can modify perspectives by adding or removing views (e.g. editors) of the perspective, or changing the size and location of the existing views.&lt;br /&gt;
&lt;br /&gt;
=== Workbench ===&lt;br /&gt;
&lt;br /&gt;
The term Workbench refers to the desktop development environment. The Workbench aims to achieve seamless tool integration and controlled openness by providing a common paradigm for the creation, management, and navigation of workspace resources.&lt;br /&gt;
&lt;br /&gt;
Each Workbench window contains one or more perspectives.  Perspectives contain views and editors and control what appears in certain menus and tool bars.  More than one Workbench window can exist on the desktop at any given time.&lt;br /&gt;
&lt;br /&gt;
Simantics utilizes different workbenches for the management of projects and for the management of larger modelling and simulation paradigmns.&lt;br /&gt;
&lt;br /&gt;
=== Perspectives ===&lt;br /&gt;
&lt;br /&gt;
Each Workbench window contains one or more perspectives. A perspective defines the initial set and layout of views in the Workbench window. Within the window, each perspective shares the same set of editors. Each perspective provides a set of functionality aimed at accomplishing a specific type of task or works with specific types of resources. For example, the [[General Structural Modelling Perspective]] combines views that you would commonly use while modelling and simulating some real world system, while the [[Team Features Perspective]] contains the views and editors with which you can share modelling information with other modellers. As you work in the Workbench, you will probably switch perspectives frequently.&lt;br /&gt;
&lt;br /&gt;
Perspectives control what appears in certain menus and toolbars. They define visible action sets, which you can change to customize a perspective. You can save a perspective that you build in this manner, making your own custom perspective that you can open again later.&lt;br /&gt;
&lt;br /&gt;
=== Views ===&lt;br /&gt;
&lt;br /&gt;
Views support editors and provide alternative presentations as well as ways to navigate the information in your Workbench.  For example, the Model Explorer and other navigation views display model components and other resources that you are working with.&lt;br /&gt;
&lt;br /&gt;
Views also have their own menus. To open the menu for a view, click the icon at the left end of the view&#039;s title bar. Some views also have their own toolbars. The actions represented by buttons on view toolbars only affect the items within that view. &lt;br /&gt;
&lt;br /&gt;
A view might appear by itself, or stacked with other views in a tabbed notebook. You can change the layout of a perspective by opening and closing views and by docking them in different positions in the Workbench window. &lt;br /&gt;
&lt;br /&gt;
Most perspectives in the Workbench are comprised of an editor area and one or more views.   &lt;br /&gt;
&lt;br /&gt;
Any number of editors can be open at once, but only one can be active at a time. The main menu bar and toolbar for the Workbench window contain operations that are applicable to the active editor.  &lt;br /&gt;
&lt;br /&gt;
Tabs in the editor area indicate the names of resources that are currently open for editing.   &lt;br /&gt;
&lt;br /&gt;
By default, editors are stacked in the editor area, but you can choose to tile them in order to view source files simultaneously.&lt;br /&gt;
 &lt;br /&gt;
=== Toolbars ===&lt;br /&gt;
&lt;br /&gt;
There are five kinds of toolbars in the Workbench.&lt;br /&gt;
&lt;br /&gt;
The main toolbar, sometimes called the Workbench toolbar, is displayed at the top of the Workbench window directly beneath the menu bar. The contents of this toolbar change based on the active perspective. Items in the toolbar might be enabled or disabled based on the state of either the active view or editor. Sections of the main toolbar can be rearranged using the mouse. &lt;br /&gt;
&lt;br /&gt;
There are also individual view toolbars, which appear in the title bar of a view. Actions in a view&#039;s toolbar apply only to the view in which they appear. Some view toolbars include a Menu button, shown as an inverted triangle, that contain actions for that view.&lt;br /&gt;
&lt;br /&gt;
A third type of toolbar is the perspective switcher. The perspective switcher allows quick access to perspectives that are currently open. It also has a button that can open new perspectives. The perspective switcher is normally located in the top-right, next to the main toolbar. However, it is also possible to position it below the main toolbar (&amp;quot;top-left&amp;quot;), or to position it vertically on the left-hand side of the workbench (&amp;quot;left&amp;quot;). The name of the perspectives is shown by default, but it is possible to hide the text and show only the icons. &lt;br /&gt;
&lt;br /&gt;
Minimizing a view stack will also produce a toolbar in the trim at the outer edge of the workbench window (a Trim Stack). This bar will contain an icon for each of the views in the stack. Clicking on one of these icons will result in the view being displayed as an overlay onto the existing presentation.&lt;br /&gt;
&lt;br /&gt;
Finally, the fast view bar is a toolbar that contains icons representing the current set of fast views. A fast view is a shortcut to a view that is frequently used; see the section on fast views for more information. The fast view bar appears in the bottom left corner of the workbench by default. However, it is possible to position it on the left or right as well.&lt;br /&gt;
&lt;br /&gt;
In all cases, you can find out what toolbar buttons do by moving your mouse pointer over the button and reading the tooltip that opens. See the list of related reference topics below for a table of all toolbar buttons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
* &#039;&#039;&#039;[[Tutorial: Simantics Platform User Interface]]&#039;&#039;&#039; - This tutorial introduces the user to the user interface of the Simantics platform. The tutorial explains the user interface concepts and shows how to get the most out of the user interface functionality.&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Tuukka Lehtonen</name></author>
	</entry>
	<entry>
		<id>https://wiki.simantics.org/index.php?title=Getting_Started_with_Simantics&amp;diff=160</id>
		<title>Getting Started with Simantics</title>
		<link rel="alternate" type="text/html" href="https://wiki.simantics.org/index.php?title=Getting_Started_with_Simantics&amp;diff=160"/>
		<updated>2010-08-02T23:23:57Z</updated>

		<summary type="html">&lt;p&gt;Tuukka Lehtonen: /* What Do You Need to Use Simantics? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simantics Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Text ...&lt;br /&gt;
&lt;br /&gt;
== Getting Started with Simantics ==&lt;br /&gt;
&lt;br /&gt;
=== What is Simantics ===&lt;br /&gt;
&lt;br /&gt;
Put in a nutshell: Simantics is a software platform especially for modelling and numerical simulation. That is, it is a basis, a grounding to build a modelling and simulation software or to integrate different software tools. Simantics package does not include any &amp;quot;Simantics solver&amp;quot;, but all the solvers are third party components. At the time of writing this document, Apros, Balas, and Modelica integrations are under construction.&lt;br /&gt;
&lt;br /&gt;
The platform contains graphical client software built on Eclipse software framework and a database server for holding all the data.  For an end user working on a workstation the server can be seen as a process running when the software is started, so in many cases you don&#039;t have to care about the client-server architecture and all its fine nuances. On the right there are some screen shots to show how Simantics looks like. It is meant to be a fully featured, industrial strength modelling tool. Still, the main idea is something new and more that what modelling and simulation experts have used to. It is definitely worth giving it a chance!&lt;br /&gt;
&lt;br /&gt;
Some examples of what Simantics can be used for:&lt;br /&gt;
* Graphical modelling environment for system simulation: For example plant modelling or electric circuit design using 2D diagram style graphical tools. &lt;br /&gt;
* Solver communication and integration solution: A solution for connecting existing numerical solvers for co-simulation. &lt;br /&gt;
* Solution for complex modelling data management: Data model for complex, large model base management, large model database that is developed by several modellers around the internet. &lt;br /&gt;
* Platform and a set of tools for distributed model development and simulation: Large, worldwide organisations need tools that support their distributed organisation. Simantics architecture is designed from the very beginning to support this. &lt;br /&gt;
&lt;br /&gt;
The innovation under the hood in Simantics is its semantic data model used for practically everything from 2D graphics to modelling data and model domain mappings - this is the already mentioned database server. This technology allows the model database to be intelligent and flexible so that the data in the database is kept up-to-date and user&#039;s unnecessary work is minimised. The really nice feature of the semantic data model is the built-in ability to easily map somehow related data in the data base - as a matter of fact, the data does not have to be related at all. All kind of data can be mapped if the user wants it. Another nice feature is that the user can add rules to the data and so implement e.g. model validation into the data. This is especially useful for managing complex system models and large data sets. Imagine if you have to keep a model of a whole power plant or paper machine consistent and you have thousands of model components that have cross relations in the model.&lt;br /&gt;
&lt;br /&gt;
=== What Do You Need to Use Simantics? ===&lt;br /&gt;
&lt;br /&gt;
Simple and short answer: you need to download Simantics installation package for your preferred system (Windows or later Linux), install it according to instructions in the Simantics Installation Instructions page, read at least the next section Using Simantics, and start using the software. The installation package includes all basic components, i.e. ProCore server, Simantics Project Manager, Simantics Workbench client, and Eclipse. The only extra package you need to install is Java Runtime Environment. Check the Simantics Installation Instructions for more information on this, too.&lt;br /&gt;
&lt;br /&gt;
 Simantics Principles (TODO)&lt;br /&gt;
&lt;br /&gt;
Simantics is licensed under Eclipse Public License (EPL). This gives quite much freedom for how to use Simantics for different purposes. All development done straight to the platform has to be given out as open source under EPL. But applications build on the platform that only uses the functionality of existing components can be licensed also with other licenses. The author of this kind of components is always responsible that there are no restrictions to other way for using other licence than EPL. E.g. if someone wants to use a so-called strict GPL license that requires all the code that is somehow involved to be GPL, this combination is not possible. Simantics licensing can&#039;t be changed to something else than EPL by no-one else than the copyright owners of Simantics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simantics is open source software. Our intention is to do, obviously in smaller scale, the same that Linux has done to computer user&#039;s community. We try to introduce the same openness and sharing attitude to the modelling and simulation community. There are huge number of excellent simulation software available as open source, but often they lack easy-to-use interface and interoperability. Simantics tries to solve this problem by offering an open, vendor independent platform for pre- and post-processing tools and solver integration. In fact, the powerful data model and rich graphical user interface features enable much more to be built on the platform.&lt;br /&gt;
About Simantics Documentation&lt;br /&gt;
&lt;br /&gt;
We work hard to keep also Simantics documentation up-to-date and rich for both end-users and developers, but during the pre-product phase we have to focus our small resources mainly to code development. This means there are large parts missing of the documentation and the existing documentation may contain errors. Please, be patient or contact us to volunteer for helping; the easiest way to contact us is from the Simantics web site contact page.&lt;br /&gt;
&lt;br /&gt;
Simantics documentation is meant to follow Simantics software releases so that we freeze a snapshot of the documentation and start building a new one a short while after the software release date. This means that the documentation here won&#039;t be much updated but the major contributions are done to Simantics 0.6 Documentation wiki. This documentation will, of course, be open for everyone to read.&lt;br /&gt;
Using Simantics&lt;br /&gt;
&lt;br /&gt;
After installing Simantics (see Simantics Installation Instructions) you can start using Simantics by click the Simantics icon on your desktop, launch it from the command line, or select it from the menu - whatever is the way it is available in your preferred environment. After a short while a splash screen appears showing the nice Simantics puzzle piece logo and the loading state of the software. The platform asks for a workspace folder, you can accept the default folder. Next the graphical environment opens [fig 1].&lt;br /&gt;
&lt;br /&gt;
== Introduction to Simantics Concepts and Conventions ==&lt;br /&gt;
&lt;br /&gt;
Simantics user interface is built on top of Eclipse and thus the user interface logic follows closely the one introduced in Eclipse. This page shortly descripes the main concepts of Eclipse. More information can be found from the [http://help.eclipse.org/ganymede/index.jsp?nav=/0_1 Eclipse Workbench User Guide].&lt;br /&gt;
&lt;br /&gt;
=== Simantics Application Model  ===&lt;br /&gt;
&lt;br /&gt;
[[image:Simantics_Application_Model_01.png|right|400px]]&lt;br /&gt;
Simantics application model is illustrated in the Figure on right. The working procedure starts with opening the Simantics Workbench, which first opens the Simantics Project Management application. Here you can manage the projects and their properties, such as database and features included into the project. Opening a project opens Simantics Workspace &amp;amp;mdash; a project specific workspace, which restores the application state from the previous session.&lt;br /&gt;
&lt;br /&gt;
In Simantics Workspace, the user can change the workspace perspective based on the work process. A perspective contains a set of views relative the one working process, such as modelling and simulation with Apros. In addition, user can modify perspectives by adding or removing views (e.g. editors) of the perspective, or changing the size and location of the existing views.&lt;br /&gt;
&lt;br /&gt;
=== Workbench ===&lt;br /&gt;
&lt;br /&gt;
The term Workbench refers to the desktop development environment. The Workbench aims to achieve seamless tool integration and controlled openness by providing a common paradigm for the creation, management, and navigation of workspace resources.&lt;br /&gt;
&lt;br /&gt;
Each Workbench window contains one or more perspectives.  Perspectives contain views and editors and control what appears in certain menus and tool bars.  More than one Workbench window can exist on the desktop at any given time.&lt;br /&gt;
&lt;br /&gt;
Simantics utilizes different workbenches for the management of projects and for the management of larger modelling and simulation paradigmns.&lt;br /&gt;
&lt;br /&gt;
=== Perspectives ===&lt;br /&gt;
&lt;br /&gt;
Each Workbench window contains one or more perspectives. A perspective defines the initial set and layout of views in the Workbench window. Within the window, each perspective shares the same set of editors. Each perspective provides a set of functionality aimed at accomplishing a specific type of task or works with specific types of resources. For example, the [[General Structural Modelling Perspective]] combines views that you would commonly use while modelling and simulating some real world system, while the [[Team Features Perspective]] contains the views and editors with which you can share modelling information with other modellers. As you work in the Workbench, you will probably switch perspectives frequently.&lt;br /&gt;
&lt;br /&gt;
Perspectives control what appears in certain menus and toolbars. They define visible action sets, which you can change to customize a perspective. You can save a perspective that you build in this manner, making your own custom perspective that you can open again later.&lt;br /&gt;
&lt;br /&gt;
=== Views ===&lt;br /&gt;
&lt;br /&gt;
Views support editors and provide alternative presentations as well as ways to navigate the information in your Workbench.  For example, the Model Explorer and other navigation views display model components and other resources that you are working with.&lt;br /&gt;
&lt;br /&gt;
Views also have their own menus. To open the menu for a view, click the icon at the left end of the view&#039;s title bar. Some views also have their own toolbars. The actions represented by buttons on view toolbars only affect the items within that view. &lt;br /&gt;
&lt;br /&gt;
A view might appear by itself, or stacked with other views in a tabbed notebook. You can change the layout of a perspective by opening and closing views and by docking them in different positions in the Workbench window. &lt;br /&gt;
&lt;br /&gt;
Most perspectives in the Workbench are comprised of an editor area and one or more views.   &lt;br /&gt;
&lt;br /&gt;
Any number of editors can be open at once, but only one can be active at a time. The main menu bar and toolbar for the Workbench window contain operations that are applicable to the active editor.  &lt;br /&gt;
&lt;br /&gt;
Tabs in the editor area indicate the names of resources that are currently open for editing.   &lt;br /&gt;
&lt;br /&gt;
By default, editors are stacked in the editor area, but you can choose to tile them in order to view source files simultaneously.&lt;br /&gt;
 &lt;br /&gt;
=== Toolbars ===&lt;br /&gt;
&lt;br /&gt;
There are five kinds of toolbars in the Workbench.&lt;br /&gt;
&lt;br /&gt;
The main toolbar, sometimes called the Workbench toolbar, is displayed at the top of the Workbench window directly beneath the menu bar. The contents of this toolbar change based on the active perspective. Items in the toolbar might be enabled or disabled based on the state of either the active view or editor. Sections of the main toolbar can be rearranged using the mouse. &lt;br /&gt;
&lt;br /&gt;
There are also individual view toolbars, which appear in the title bar of a view. Actions in a view&#039;s toolbar apply only to the view in which they appear. Some view toolbars include a Menu button, shown as an inverted triangle, that contain actions for that view.&lt;br /&gt;
&lt;br /&gt;
A third type of toolbar is the perspective switcher. The perspective switcher allows quick access to perspectives that are currently open. It also has a button that can open new perspectives. The perspective switcher is normally located in the top-right, next to the main toolbar. However, it is also possible to position it below the main toolbar (&amp;quot;top-left&amp;quot;), or to position it vertically on the left-hand side of the workbench (&amp;quot;left&amp;quot;). The name of the perspectives is shown by default, but it is possible to hide the text and show only the icons. &lt;br /&gt;
&lt;br /&gt;
Minimizing a view stack will also produce a toolbar in the trim at the outer edge of the workbench window (a Trim Stack). This bar will contain an icon for each of the views in the stack. Clicking on one of these icons will result in the view being displayed as an overlay onto the existing presentation.&lt;br /&gt;
&lt;br /&gt;
Finally, the fast view bar is a toolbar that contains icons representing the current set of fast views. A fast view is a shortcut to a view that is frequently used; see the section on fast views for more information. The fast view bar appears in the bottom left corner of the workbench by default. However, it is possible to position it on the left or right as well.&lt;br /&gt;
&lt;br /&gt;
In all cases, you can find out what toolbar buttons do by moving your mouse pointer over the button and reading the tooltip that opens. See the list of related reference topics below for a table of all toolbar buttons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
* &#039;&#039;&#039;[[Tutorial: Simantics Platform User Interface]]&#039;&#039;&#039; - This tutorial introduces the user to the user interface of the Simantics platform. The tutorial explains the user interface concepts and shows how to get the most out of the user interface functionality.&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Tuukka Lehtonen</name></author>
	</entry>
	<entry>
		<id>https://wiki.simantics.org/index.php?title=Getting_Started_with_Simantics&amp;diff=159</id>
		<title>Getting Started with Simantics</title>
		<link rel="alternate" type="text/html" href="https://wiki.simantics.org/index.php?title=Getting_Started_with_Simantics&amp;diff=159"/>
		<updated>2010-08-02T23:21:17Z</updated>

		<summary type="html">&lt;p&gt;Tuukka Lehtonen: /* What is Simantics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simantics Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Text ...&lt;br /&gt;
&lt;br /&gt;
== Getting Started with Simantics ==&lt;br /&gt;
&lt;br /&gt;
=== What is Simantics ===&lt;br /&gt;
&lt;br /&gt;
Put in a nutshell: Simantics is a software platform especially for modelling and numerical simulation. That is, it is a basis, a grounding to build a modelling and simulation software or to integrate different software tools. Simantics package does not include any &amp;quot;Simantics solver&amp;quot;, but all the solvers are third party components. At the time of writing this document, Apros, Balas, and Modelica integrations are under construction.&lt;br /&gt;
&lt;br /&gt;
The platform contains graphical client software built on Eclipse software framework and a database server for holding all the data.  For an end user working on a workstation the server can be seen as a process running when the software is started, so in many cases you don&#039;t have to care about the client-server architecture and all its fine nuances. On the right there are some screen shots to show how Simantics looks like. It is meant to be a fully featured, industrial strength modelling tool. Still, the main idea is something new and more that what modelling and simulation experts have used to. It is definitely worth giving it a chance!&lt;br /&gt;
&lt;br /&gt;
Some examples of what Simantics can be used for:&lt;br /&gt;
* Graphical modelling environment for system simulation: For example plant modelling or electric circuit design using 2D diagram style graphical tools. &lt;br /&gt;
* Solver communication and integration solution: A solution for connecting existing numerical solvers for co-simulation. &lt;br /&gt;
* Solution for complex modelling data management: Data model for complex, large model base management, large model database that is developed by several modellers around the internet. &lt;br /&gt;
* Platform and a set of tools for distributed model development and simulation: Large, worldwide organisations need tools that support their distributed organisation. Simantics architecture is designed from the very beginning to support this. &lt;br /&gt;
&lt;br /&gt;
The innovation under the hood in Simantics is its semantic data model used for practically everything from 2D graphics to modelling data and model domain mappings - this is the already mentioned database server. This technology allows the model database to be intelligent and flexible so that the data in the database is kept up-to-date and user&#039;s unnecessary work is minimised. The really nice feature of the semantic data model is the built-in ability to easily map somehow related data in the data base - as a matter of fact, the data does not have to be related at all. All kind of data can be mapped if the user wants it. Another nice feature is that the user can add rules to the data and so implement e.g. model validation into the data. This is especially useful for managing complex system models and large data sets. Imagine if you have to keep a model of a whole power plant or paper machine consistent and you have thousands of model components that have cross relations in the model.&lt;br /&gt;
&lt;br /&gt;
=== What Do You Need to Use Simantics? ===&lt;br /&gt;
&lt;br /&gt;
Simple and short answer: you need to download Simantics installation package for your preferred system (Windows or later Linux), install it according to instructions in the Simantics Installation Instructions page, read at least the next section Using Simantics, and start using the software. The installation package includes all basic components, i.e. ProCore server, ProConf client, and Eclipse. The only extra package you need to install is Java Runtime Environment. Check the Simantics Installation Instructions for more information on this, too.&lt;br /&gt;
Simantics Principles&lt;br /&gt;
&lt;br /&gt;
Simantics is licensed under Eclipse Public License (EPL). This gives quite much freedom for how to use Simantics for different purposes. All development done straight to the platform has to be given out as open source under EPL. But applications build on the platform that only uses the functionality of existing components can be licensed also with other licenses. The author of this kind of components is always responsible that there are no restrictions to other way for using other licence than EPL. E.g. if someone wants to use a so-called strict GPL license that requires all the code that is somehow involved to be GPL, this combination is not possible. Simantics licensing can&#039;t be changed to something else than EPL by no-one else than the copyright owners of Simantics.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simantics is open source software. Our intention is to do, obviously in smaller scale, the same that Linux has done to computer user&#039;s community. We try to introduce the same openness and sharing attitude to the modelling and simulation community. There are huge number of excellent simulation software available as open source, but often they lack easy-to-use interface and interoperability. Simantics tries to solve this problem by offering an open, vendor independent platform for pre- and post-processing tools and solver integration. In fact, the powerful data model and rich graphical user interface features enable much more to be built on the platform.&lt;br /&gt;
About Simantics Documentation&lt;br /&gt;
&lt;br /&gt;
We work hard to keep also Simantics documentation up-to-date and rich for both end-users and developers, but during the pre-product phase we have to focus our small resources mainly to code development. This means there are large parts missing of the documentation and the existing documentation may contain errors. Please, be patient or contact us to volunteer for helping; the easiest way to contact us is from the Simantics web site contact page.&lt;br /&gt;
&lt;br /&gt;
Simantics documentation is meant to follow Simantics software releases so that we freeze a snapshot of the documentation and start building a new one a short while after the software release date. This means that the documentation here won&#039;t be much updated but the major contributions are done to Simantics 0.6 Documentation wiki. This documentation will, of course, be open for everyone to read.&lt;br /&gt;
Using Simantics&lt;br /&gt;
&lt;br /&gt;
After installing Simantics (see Simantics Installation Instructions) you can start using Simantics by click the Simantics icon on your desktop, launch it from the command line, or select it from the menu - whatever is the way it is available in your preferred environment. After a short while a splash screen appears showing the nice Simantics puzzle piece logo and the loading state of the software. The platform asks for a workspace folder, you can accept the default folder. Next the graphical environment opens [fig 1]. &lt;br /&gt;
&lt;br /&gt;
== Introduction to Simantics Concepts and Conventions ==&lt;br /&gt;
&lt;br /&gt;
Simantics user interface is built on top of Eclipse and thus the user interface logic follows closely the one introduced in Eclipse. This page shortly descripes the main concepts of Eclipse. More information can be found from the [http://help.eclipse.org/ganymede/index.jsp?nav=/0_1 Eclipse Workbench User Guide].&lt;br /&gt;
&lt;br /&gt;
=== Simantics Application Model  ===&lt;br /&gt;
&lt;br /&gt;
[[image:Simantics_Application_Model_01.png|right|400px]]&lt;br /&gt;
Simantics application model is illustrated in the Figure on right. The working procedure starts with opening the Simantics Workbench, which first opens the Simantics Project Management application. Here you can manage the projects and their properties, such as database and features included into the project. Opening a project opens Simantics Workspace &amp;amp;mdash; a project specific workspace, which restores the application state from the previous session.&lt;br /&gt;
&lt;br /&gt;
In Simantics Workspace, the user can change the workspace perspective based on the work process. A perspective contains a set of views relative the one working process, such as modelling and simulation with Apros. In addition, user can modify perspectives by adding or removing views (e.g. editors) of the perspective, or changing the size and location of the existing views.&lt;br /&gt;
&lt;br /&gt;
=== Workbench ===&lt;br /&gt;
&lt;br /&gt;
The term Workbench refers to the desktop development environment. The Workbench aims to achieve seamless tool integration and controlled openness by providing a common paradigm for the creation, management, and navigation of workspace resources.&lt;br /&gt;
&lt;br /&gt;
Each Workbench window contains one or more perspectives.  Perspectives contain views and editors and control what appears in certain menus and tool bars.  More than one Workbench window can exist on the desktop at any given time.&lt;br /&gt;
&lt;br /&gt;
Simantics utilizes different workbenches for the management of projects and for the management of larger modelling and simulation paradigmns.&lt;br /&gt;
&lt;br /&gt;
=== Perspectives ===&lt;br /&gt;
&lt;br /&gt;
Each Workbench window contains one or more perspectives. A perspective defines the initial set and layout of views in the Workbench window. Within the window, each perspective shares the same set of editors. Each perspective provides a set of functionality aimed at accomplishing a specific type of task or works with specific types of resources. For example, the [[General Structural Modelling Perspective]] combines views that you would commonly use while modelling and simulating some real world system, while the [[Team Features Perspective]] contains the views and editors with which you can share modelling information with other modellers. As you work in the Workbench, you will probably switch perspectives frequently.&lt;br /&gt;
&lt;br /&gt;
Perspectives control what appears in certain menus and toolbars. They define visible action sets, which you can change to customize a perspective. You can save a perspective that you build in this manner, making your own custom perspective that you can open again later.&lt;br /&gt;
&lt;br /&gt;
=== Views ===&lt;br /&gt;
&lt;br /&gt;
Views support editors and provide alternative presentations as well as ways to navigate the information in your Workbench.  For example, the Model Explorer and other navigation views display model components and other resources that you are working with.&lt;br /&gt;
&lt;br /&gt;
Views also have their own menus. To open the menu for a view, click the icon at the left end of the view&#039;s title bar. Some views also have their own toolbars. The actions represented by buttons on view toolbars only affect the items within that view. &lt;br /&gt;
&lt;br /&gt;
A view might appear by itself, or stacked with other views in a tabbed notebook. You can change the layout of a perspective by opening and closing views and by docking them in different positions in the Workbench window. &lt;br /&gt;
&lt;br /&gt;
Most perspectives in the Workbench are comprised of an editor area and one or more views.   &lt;br /&gt;
&lt;br /&gt;
Any number of editors can be open at once, but only one can be active at a time. The main menu bar and toolbar for the Workbench window contain operations that are applicable to the active editor.  &lt;br /&gt;
&lt;br /&gt;
Tabs in the editor area indicate the names of resources that are currently open for editing.   &lt;br /&gt;
&lt;br /&gt;
By default, editors are stacked in the editor area, but you can choose to tile them in order to view source files simultaneously.&lt;br /&gt;
 &lt;br /&gt;
=== Toolbars ===&lt;br /&gt;
&lt;br /&gt;
There are five kinds of toolbars in the Workbench.&lt;br /&gt;
&lt;br /&gt;
The main toolbar, sometimes called the Workbench toolbar, is displayed at the top of the Workbench window directly beneath the menu bar. The contents of this toolbar change based on the active perspective. Items in the toolbar might be enabled or disabled based on the state of either the active view or editor. Sections of the main toolbar can be rearranged using the mouse. &lt;br /&gt;
&lt;br /&gt;
There are also individual view toolbars, which appear in the title bar of a view. Actions in a view&#039;s toolbar apply only to the view in which they appear. Some view toolbars include a Menu button, shown as an inverted triangle, that contain actions for that view.&lt;br /&gt;
&lt;br /&gt;
A third type of toolbar is the perspective switcher. The perspective switcher allows quick access to perspectives that are currently open. It also has a button that can open new perspectives. The perspective switcher is normally located in the top-right, next to the main toolbar. However, it is also possible to position it below the main toolbar (&amp;quot;top-left&amp;quot;), or to position it vertically on the left-hand side of the workbench (&amp;quot;left&amp;quot;). The name of the perspectives is shown by default, but it is possible to hide the text and show only the icons. &lt;br /&gt;
&lt;br /&gt;
Minimizing a view stack will also produce a toolbar in the trim at the outer edge of the workbench window (a Trim Stack). This bar will contain an icon for each of the views in the stack. Clicking on one of these icons will result in the view being displayed as an overlay onto the existing presentation.&lt;br /&gt;
&lt;br /&gt;
Finally, the fast view bar is a toolbar that contains icons representing the current set of fast views. A fast view is a shortcut to a view that is frequently used; see the section on fast views for more information. The fast view bar appears in the bottom left corner of the workbench by default. However, it is possible to position it on the left or right as well.&lt;br /&gt;
&lt;br /&gt;
In all cases, you can find out what toolbar buttons do by moving your mouse pointer over the button and reading the tooltip that opens. See the list of related reference topics below for a table of all toolbar buttons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
* &#039;&#039;&#039;[[Tutorial: Simantics Platform User Interface]]&#039;&#039;&#039; - This tutorial introduces the user to the user interface of the Simantics platform. The tutorial explains the user interface concepts and shows how to get the most out of the user interface functionality.&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Tuukka Lehtonen</name></author>
	</entry>
</feed>