![]() |
| |
| |
| |
|
A defined value is calculated only at the start of a model run, or in response to the actions of an event. This means that they are very useful for holding values which do not change very often, or which change only in a discontinuous manner. We shall use a defined value to hold the discharge level which is changed by an event. ModelMaker provides two types of event to cater for discontinuous models - independent and component events; events can adjust model component values. Let's assume that the pollutant discharge rate in our model follows a regular pattern: every week it switches between 25 kgd-1 and 10 kgd-1. To model this behavior we will replace the variable Discharge with a defined value (also called Discharge) and an independent event. To follow this example load the model "tutor3.mod"
If the value of Discharge is 25 To define this action, we can use the if…else statement.
![]() Everything to the right of a double slash '//' is a comment and is ignored by ModelMaker.
This completes the definition of the independent event. Re-running the model results in a zigzag pattern of pollutant discharge as the initial dumping fades away. The completed model for this step is "tutor4.mod" |
|
© FamilyGenetix 2001-2003 |
|