Introductory Simgua Tutorial
Simgua can model the most complex of systems. In this tutorial we will look at the very simple example of a pond with one stream flowing into it and no stream flowing out. This example is so elementary that it could easily be solved analytically, but it will introduce you to the techniques of model construction with Simgua.
First, we create a Stock that will represent the pond. This can be done with a click of a button. A stock is a type of Simgua primitive that stores something. It could store money, air, people, or virtually any other entity. In our case, the stock will store water. The pond should be given an initial value that was based on the size of the actualy pond. For the purpose of this study let's assume an initial capacity of 10 meters3 of water.
Next the stream flowing into the pond must be simulated. This can be done by adding a flow to the model. Again with a click of a button. Flows model the transport of materials from one stock to another. We set the end of the flow to be the pond. Next we give the flow some quantity, say 0.1 meters cubed per second. We could have just as easily given it a quantity that was time-dependent or stochastically determined.
Now, let us run our model over a period of a week and see what results:
No surprises here. Since there is no outlet, the volume of the pond keeps growing larger and larger as water flow into it. This is not very realistic though, so let's make our simulation slightly more accurate by adding evaporation to our pond.
We create another flow, and this time set its beginning to be the pond. We can approximate evaporation by assuming that as the volume of the pond increases, the evaporation also increases linearly. Therefore we give our flow rate a value of 0.05*[Pond]. Where 0.05 is the evaporation coefficient and [Pond] represents the current volume of the pond. This equation is saying that every time period 5% of the water in the pond will evaporate.
Let's run our model once more:
Much more interesting, isn't it? Again it should not surprise us: the rate of the water flowing into the pond remains constant, but the evaporation rate steadily rises as the pond's volume increases. This goes on until evapration equals inflow. At that point in time the volume of the pond does not change at all. Of course, we could have determined these same results analytically, but they do demonstrate the simplicity of modeling with Simgua.
Suggestions for further improvements to the model include adding variable inflows from the stream, precipitation, and human use of water from the pond. Why don't you download Simgua and see how easy these additional features are to implement on your own. As the complexity of the model increases, the value of using Simgua becomes more and more apparent.