Biomedical Engineering Reference
In-Depth Information
The algorithms underlying a model necessarily reflect the scope and nature of the simulation.
Depending on the simulation requirements, the algorithms used may vary from simple and
approximate to very complex, computationally expensive, and as accurate as possible.
Errors
There is a limit to the degree of accuracy available in every simulation, as dictated by the software
and hardware available. For example, all complex digital computations, especially those employing
multiple operations on floating-point numbers, are prone to errors. Because of the way in which the
two components of a floating-point number are handled, computations involving numbers in this
format are not exact. Given enough iterations, the cumulative errors of multiple operations will
become significant.
Floating-point relationships such as 2/3 (0.666666…) are represented in a digital computer system to
only so many decimal places. Errors of this type, sometimes referred to as roundoff errors, can be
minimized at the expense of computational speed by working the highest precision possible. For
example, double-precision variables can be used for operators in computations. Rearranging the
sequence of computational events so that significant figures aren't lost can also minimize round-off
errors. In comparison, computations involving strictly integer numbers are exact as long as the
results are within the range of the data type used. The primary benefit of using an integer over a
floating-point number is speed.
Round-off errors are due to computer hardware limitations. They can be minimized by the judicious
use of appropriate data types and algorithms. The other major type of error, truncation error, is
independent of computer hardware, and is attributable instead to the algorithms used in the
simulation. These errors occur when the algorithms use approximations to arrive at an answer. For
example, instead of computing the sum of an infinite series, a practical algorithm might stop after a
sufficient number of elements have been added. Truncation error can best be thought of as the
difference between the actual answer and the answer obtained by way of a practical calculation.
Unlike round-off errors, which are a function of the computer hardware, operating system, and
programming language, truncation errors are a function of the algorithms used to solve a given
problem.
Differential Equations and Integration
Solving differential equations and performing numerical integration are two common computational
operations performed in continuous simulation. A differential equation defines a relationship between
a continuous variable and its own rate of change. In general, the goal in solving a differential
equation is to be able to predict the value of a function at any point in time. Differential equations
involving one independent variable are said to be ordinary differential equations. Ordinary differential
equations can be further classified as either initial value problems or boundary value problems
depending on whether information about the problem is known at a particular value of the
independent variable, or at two different values of the independent variable, respectively.
It's often the case that a problem to be modeled can't be solved by an ordinary differential equation
such as described previously for drug concentration. Accurately determining the total amount of drug
remaining in the plasma will require numerical integration techniques that are based on one or more
differential equations. In many instances, it isn't possible to obtain an exact or analytical solution to a
differential equation. In these situations, numerical solutions can be used to prove an approximation
of the solution, within some degree of accuracy.
Numerical integration methods differ in accuracy, speed of execution, complexity, and the nature of
the underlying assumptions that must be made for their use. In general, they work by evaluating a
function at a finite number of points and performing a weighted sum of the function values.
Eventually, the weighted sum should converge to the correct value of the integral. Some numerical
integration methods use a constant time slice or step size (see Figure 9-6 ), while others change the
step size as needed to increase computational efficiency.
Search WWH ::




Custom Search