Garden with Insight v1.0 Help: Numerical exceptions window
Garden with Insight is a numerical simulation, which means that it makes many calculations involving
numbers to produce the results you see. Computers and software are wonderful tools for creating fast
numerical simulations, but there are important limitations. In particular, most software programs can only
reserve a limited amount of the computer's memory to store each number. This means that numbers can
have only a certain range. For most of the model numbers used by
Garden with Insight, these limits are from 1.5 x 1045 to 3.4 x 10+38 in positive and negative numbers.
For most computer applications these ranges are more than adequate, and even in a numerical simulation
normal conditions should not cause these bounds to be exceeded. However, if there is a problem with the
simulation, the bounds can be exceeded, and this causes what is called a numerical exception. A
numerical exception sometimes causes some values to be calculated incorrectly.
Problems with the simulation come from two sources: extreme input values
(which cause the simulation to operate in an unrealistic boundary
condition) and errors in the simulation itself. We have tried to minimize extreme input values by
setting bounds on each of the hundreds of input parameters used by
Garden with Insight. Simulation errors are minimized by repeated testing. However, it is difficult to
find all errors because there are so many situations that can cause exceptions among the over 350
equations and 17,500 lines of model program code. Small errors that go undetected for a short time can
accumulate and worsen over long periods of simulation. Also, the scientific assumptions underlying the
models do not necessarily hold when several input values are at extreme values.
There are three basic types of numerical exception:
overflow: The number calculated has become too large for the computer to represent. In Garden
with Insight this means that the number is greater than 3.4 x 10+38 or less than 3.4 x 10+38.
underflow: The number calculated is so close to zero that the computer cannot represent the
number of digits after the decimal required to distinguish it from zero. In Garden with Insight this
means that the number is less than 1.5 x 1045 or greater than 1.5 x 1045.
nonsensical value for a mathematical expression: The number input to a mathematical function
is one for which the result is impossible to represent as a real number. For example, the natural log of a
negative number is impossible for the computer to represent, as is the result of dividing any number by
zero.
All numerical simulations have to deal with numerical exceptions. Some hide them from the user, some
halt at the first exception, and some routinely round or limit numbers to avoid exceptions. In Garden with
Insight numerical exceptions are presented in the Numerical exceptions window. When a numerical
exception occurs, its description is added to the exception list in the Numerical exceptions window.
The numerical exceptions window
The numerical exceptions window has a list of exceptions and a few buttons you can use to manage
the list and save information for technical support.
Save as: Save the list of exceptions as a numerical exceptions text file (.nex).
Clear: Empty the exception list.
The three check boxes under the exception list determine what the simulation should do when there is an
exception.
appear: Check this check box to make the numerical exceptions window appear whenever a
numerical exception occurs. Uncheck this check box if you don't want the numerical exceptions window to
pop up when an error occurs. You can access the numerical exceptions window at any time by choosing it
from the Window menu in the garden
window.
log to file: Check this check box to start a log file of numerical exceptions (it will have the
extension .nex), or to append to the file if it already exists. This option is useful if you think
there is a problem and want to write out the errors as they happen instead of afterward. Uncheck this
check box to stop logging errors to the file.
stop simulation: Check this box to have the simulation stop when it has finished simulating the
day on which the exception occurs.
Click Close to close the numerical exceptions window.
