The purpose of this tutorial is to give the necessary background information on how to use the StateMint software to those who have some experience with system dynamics but may need a refresher, or are not familiar with the linear graph method. To learn more about this subject consider reading System Dynamics: An Introduction by Rowell and Wormley. Also available are course notes for a class at St. Martin's University taught by Prof. Rico Picone, along with recorded lectures.
This method of finding a differential equation of a dynamic system works with multiple energy domains and any combination of these domains.
In each energy domain, a through-variable, , and an across-variable, , is defined. A through-variable is a variable that generally has the same value at each element terminal. It corresponds to a physical quantity that would be measured flowing through an element. An across-variable is a variable that generally has a different value at each element terminal. It corresponds to a physical quantity that would be measured across an element or relative to some reference. A list of common system types and their through-variables and across-variables can be found below.
Within each energy domain, there are multiple element-types which can be used to model a system in that domain. Across energy domains, these elements can be grouped into three distinct-types.
A-type elements are energy storage elements which relate the rate of change of the across-variable to the through-variable of the element.
T-type elements are energy storage elements which relate the rate of change of the through-variable to the across-variable of the element.
D-type elements are strictly dissipative with a linear relationship between through-variables and across-variables.
In dynamic systems, energy can flow between multiple domains. Transformers are one model for relating the through-variable and across-variable of two energy domains to each other,
Here can be used in many different applications. A few of these are listed below,
Gyrators are another tool used to model energy flow between domains. This model relates the across-variable in one energy domain to the through-variable in the other,
The following elements can be modeled as gyrators,
Element | Parameter | |
---|---|---|
Hydraulic Ram | Piston Area, | |
Displacement Pump | Pump Displacement, |
The final type of element is the ideal source. Ideal sources provide (potentially arbitrary) external power to a system by specifying either its across-variable or through-variable. The former are called across-variable sources and the latter through-variable sources.
A linear graph is a diagram of a system that represents its topology via nodes and edges (lines). Each node represents an independent across-variable value and is drawn as a dot, or a small circle. Edges represent discrete lumped-parameter elements in the system, and through these power flows between the nodes. An edge is drawn as a line between two nodes with an arrow specifying a sign assignment for that element (e.g. a voltage drop is positive in the direction of the arrow). A-type elements always connect to a ground node in non-electrical systems. Arrows on transformers and gyrators always point towards ground. An example of a linear graph appears in the Example section of this tutorial.
A normal tree can be constructed to find the system's primay and secondary variables, defined below. This normal tree should consist of edges from the linear graph where is the number of nodes in the linear graph. If multiple ground nodes are present in the linear graph, they should be counted as a single node. Since the normal tree must be a tree structure, no loops may be created when constructing the normal tree. To construct the normal tree, select edges in the following order.
- Across-variable sources
- A-type elements
- Transformers and Gyrators (minimizing the number of T-type elements in the normal tree)
- D-type elements
- T-type elements
For transformers, one edge must be selected. For gyrators, both or neither edges can be selected. The elements in the normal tree are termed branches, while the elements not in the normal tree are called links.
Once the normal tree has been created it is trivial to determine the primary and secondary variables. Primary variables are defined as,
- Across-variables on normal tree branches and
- Through-variables on normal tree links.
The secondary variable is the non-primary variable in each element. In other words the secondary variables are,
- Across-variables on normal tree links
- Through-variables on normal tree branches
The state variables of the system are,
- A-type elements on normal tree branches and
- T-type elements on normal tree links.
We define as the number of edges in the linear graph and as the number of sources. An elemental equation should be written for each of the non-source edges in the linear graph. The primary variable must be written on the left hand side of each equation.
continuity equations should be found. These equations are found by drawing a contour around any number of nodes which cuts through exactly one passive (non source) normal tree branch. Next, the sum of the through-variable flowing through the contour determined needs to be found. The secondary through-variable should be placed on the left hand side of the resulting equation.
compatibility equations should be written. These equations most have the secondary across-variable on the left side. To create these equations, calculate the sum of the across-variables around the loop created when one normal tree link is added to the normal tree. An equation should be found by substituting each link into the normal tree.
To show how this process works, we will work through the following example.
This system is a voltage source which drives a motor with the given resistance and inductance. This motor in turn drives a pump through a drive shaft with the given stiffness. Finally the pump pushes water through a curved pipe of known resistance.
This system can be distilled into the linear graph below. Here 1 is the electrical input to the motor, and 2 is rotational output. Similarly 3 is the rotational input to the pump, and 4 is the fluid output.
To create the normal tree, first the voltage source is selected.
To avoid selecting T-type elements (the torsional spring and inductor), The right side of the transformer will be added to the normal tree.
Also adding both sides of the gyrator means that adding the torsional spring would cause a loop to be created.
Next, the motor resistance is added.
Finally to complete the normal tree the motor inductance must be added.
The following are primary variables determined using the logic above.
Given the primary variables above, the following are easily determined to be secondary variables.
From the requirements the following can be found to be the only state variable.
Based on the list of elemental equations, the following list of elemental equations can be generated.
To determine the continuity equations, the following contours can be drawn.
Using these contours, the equations below were constructed.
By adding each link into the normal tree the equations below were generated.
Given the equations derived above, the state equation could be found by hand. However, one of the following tools can be used. These tools require the equations as derived above to be provided.
The web interface is by far the easiest method to perform this algebra, statemint.stmartin.edu. This interface allow the equations to be entered and the result found without the need to install software.
The Python implementation of this software can also be used. An example continuing this tutorial is provided.
Finally, the Mathematica package can be used. An example using Mathematica is also provided.