where is the vector of solution components and is the independent variable.
d02prf is used to reset the final value of the independent variable, , when the integration is already underway. It can be used to extend or reduce the range of integration. The new value must be beyond the current value of the independent variable (as returned in tnow by d02pfford02pgf) in the current direction of integration. It is much more efficient to use d02prf for this purpose than to use d02pqf which involves the overhead of a complete restart of the integration.
If you want to change the direction of integration then you must restart by a call to d02pqf.
Brankin R W, Gladwell I and Shampine L F (1991) RKSUITE: A suite of Runge–Kutta codes for the initial value problems for ODEs SoftReport 91-S1 Southern Methodist University
1: – Real (Kind=nag_wp)Input
On entry: the new value for .
, where tstart and tend are as supplied in the previous call to d02pqf and tnow is returned by the preceding call to d02pfford02pgf (i.e., integration must proceed in the same direction as before). tendnu must be distinguishable from tnow for the method and the machine precision being used.
2: – Integer arrayCommunication Array
3: – Real (Kind=nag_wp) arrayCommunication Array
Note: the communication array rwsav used by the other routines in the suite must be used here however, only the first elements will be referenced.
On entry: these must be the same arrays supplied in a previous call to d02pfford02pgf. They must remain unchanged between calls.
On exit: information about the integration for use on subsequent calls to d02pfford02pgf or other associated routines.
4: – IntegerInput/Output
On entry: ifail must be set to , . If you are unfamiliar with this argument you should refer to Section 4 in the Introduction to the NAG Library FL Interface for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value is recommended. If the output of error messages is undesirable, then the value is recommended. Otherwise, if you are not familiar with this argument, the recommended value is . When the value is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
On entry, a previous call to the setup routine has not been made or the communication arrays have become corrupted, or a catastrophic error has already been detected elsewhere. You cannot continue integrating the problem.
On entry, tendnu is not beyond tnow (step integrator) in the direction of integration. The direction is negative, and .
On entry, tendnu is not beyond tnow (step integrator) in the direction of integration. The direction is positive, and .
On entry, tendnu is too close to tnow (step integrator). Their difference is , but this quantity must be at least .
You cannot call this routine after the integrator has returned an error.
You cannot call this routine before you have called the setup routine.
You cannot call this routine before you have called the step integrator.
You cannot call this routine when the range integrator has been used.
An unexpected error has been triggered by this routine. Please
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
8Parallelism and Performance
d02prf is not threaded in any implementation.
This example integrates a two body problem. The equations for the coordinates of one body as functions of time in a suitable frame of reference are
The initial conditions
lead to elliptic motion with . is selected and the system of ODEs is reposed as
over the range . Relative error control is used with threshold values of for each solution component and compute the solution at intervals of length across the range using d02prf to reset the end of the integration range. A high-order Runge–Kutta method () is also used with tolerances and in turn so that the solutions may be compared.