Step 9: Running minimization

 

During minimization, the parameter values used in the model are systematically adjusted to find the smallest value of a particular component at a selected point in the model run. However, by choosing the way in which the model component is defined, minimization can also be used to maximize another component value, or make it converge on a desired value.

In our model, let's assume that we want to force the amount of pollutant in Lake2 to be 500 kg on day 20 of the model run. To do this, we shall add a new variable to the model.

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

  • Add a variable, V1
  • Add an influence between Lake2 and V1
  • Double click V1 to open its definition dialog box
  • Enter Minimum in the Symbol edit box and abs(Lake2 - 500) in the Equation edit box (abs is an absolute value)
  • Click OK to close the dialog

Now the model definition is completed, we can set up the minimization options.

  • Activate the Parameters view
  • Select the Minimize check boxes for river_rate and estuary_rate

ModelMaker uses sample points to test the values of selected components at selected moments in time. Sample points are configured for minimization and Monte Carlo analysis in the Sample Points view.

  • Click the Sample Points icon

The Sample Points view is created and activated. This view is divided into five columns - Name, Component, Time Point, Monte Carlo and Minimize.

  • Click the Sample Point icon on the Sample Points toolbar

A new sample point, SP1, is created.

  • Double click SP1 to open the Sample Point Definition dialog box
  • Enter 20 in the Time Point edit box and select Minimum in the Component list box
  • Click OK to close the dialog
  • Select the Minimize option button in the Sample Points view for SP1

The model is now ready to minimize.

  • Click the Integrate icon arrow and select Minimize from the drop-down menu

The Start Minimization dialog box opens. This dialog summarizes the component, time point and parameter selection, and starts the calculation.

  • Click Advanced

The Minimization Configuration dialog box opens.

  • Enter 1 in the Convergence Change edit box and 25 in the Convergence Steps edit box
  • Click OK to close the dialog
  • Click OK to close the Start Minimization dialog and run the minimization

ModelMaker runs the model many times, adjusting the values of river_rate and estuary_rate. When the process finishes, the new parameter values are displayed in the sub-view Parameter Results - river_rate = 0.1048 and estuary_rate = 0.0471. Use the update command to adopt the minimize values in the model. Re-run the model and check a table of Lake2 values to confirm that it contains 500 kg of pollutant on day 20.

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

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