Download Interactive Multiple Representation Editing of Physically
Transcript
fewer evaluations of the functions per timestep { an N th-order Runge-Kutta method requires
N times as many evaluations as does the trapezoidal method, with the most common and
best value of N being four [95]. This is important when the equations are fairly complex and
dicult to evaluate. Runge-Kutta has the advantage of not requiring a matrix inversion, but
as we shall see, the decomposition algorithm used by Asgard makes this less of a concern.
To a rst approximation, however, the choice of integration method does not aect the
algorithms described below.
Another distinction that can be made between ODE techniques is that between direct
methods and relaxation-based methods. To understand this dierence, one must consider
the basic structure of an ODE solution algorithm.
A direct method can be written as a set of three nested loops:
integrate time from start to finish
linearize system at the current time
solve the matrix obtained by the linearization
The integration is performed using an implicit or explicit method, as described above. The
linearization is done by an approximation method such as Newton-Raphson iteration { this is
what gives rise to the piecewise-linear nature of the computed trajectory. Methods also exist
that make polynomial approximations to the curve, using mechanisms similar to NewtonRaphson. The matrix solution is required because the linearization produces a system of
simultaneous linear equations: the variables are the values of the functions at the next time
point. If the integration method is explicit, then every variable is a function of known values,
at the previous time point, so no matrix inversion is necessary. In this case only two loops
are required.
A relaxation-based method, on the other hand, performs the operations of integration, linearization, and matrix inversion somewhat dierently. For example, waveform relaxation [72]
can be written as:
repeat until all functions of time converge
integrate each function from start to finish
The eect of this algorithm is to bring the iterative approximation outside of the integration and integrate each function independently, using a separate time scale. This improves
performance for the same reason that the partitioning scheme described below does: each
function is integrated independently and not constrained by the time steps required by the
others.
Asgard uses the direct method approach, and does integration using the trapezoidal
method. The value of the state vector S~ at time step n is related to its value at step n , 1
by the equation
S~ , S~ ,1 = F~ (S ) + F~ (S ,1 ) ;
h
2
where F~ is the state equation and h is the timestep, i.e., t , t ,1 . This is illustrated in
Figure 5.6: the shaded area represents the contribution to the integral of the region of the
function between times t1 and t2.
n
n
n
n
n
61
n