Step 5: Adding component events

 

Component events and independent events differ only in the way they are triggered. Component events are triggered when a defined condition becomes true. ModelMaker uses a tolerance value to ensure that component events are triggered correctly.

We shall now assume that when the pollutant level in our model reaches 400 kg, a chemical treatment is applied to the lake which removes 150 kg of pollutant from the water. This event will be triggered within one hour of the pollutant level becoming too high. The tolerance will therefore be set to 1/24 = 0.042.

To follow this example load the model "tutor4.mod"

The next stage in developing the model is to insert a new component event. The model also requires two new influences between Lake2 and the event because the event both tests and adjusts the value of Lake2.
  • Add a component event, E1
  • Add two influences between Lake2 and E1, and E1 and Lake2
  • Double click E1 to open its definition dialog box
  • In the Definition tab, enter Treatment in the Symbol edit box
  • Select the Trigger tab
  • Enter Lake2>400 in the Condition edit box and 0.042 in the Tolerance edit box
  • Select the Actions tab
  • Enter Lake2 = Lake2 - 150; in the edit box

Re-run the model. The graph of Lake2 shows the zigzag trace of the pollutant treatments.

The completed model for this step is "tutor5.mod"

Return to the main tutorial page
  
ModelKinetix is a trade name of FamilyGenetix, managed by AP Benson.
© FamilyGenetix 2001-2003