d02bj
is the AD Library version of the primal routine
d02bjf.
Based (in the C++ interface) on overload resolution,
d02bj can be used for primal, tangent and adjoint
evaluation. It supports tangents and adjoints of first and second order.
Corresponding to the overloaded C++ function, the Fortran interface provides five routines with names reflecting the type used for active real arguments. The actual subroutine and type names are formed by replacing AD and ADTYPE in the above as follows:
The function is overloaded on ADTYPE which represents the type of active arguments. ADTYPE may be any of the following types: double, dco::ga1s<double>::type, dco::gt1s<double>::type, dco::gt1s<dco::gt1s<double>::type>::type, dco::ga1s<dco::gt1s<double>::type>::type,
Note: this function can be used with AD tools other than dco/c++. For details, please contact NAG.
3Description
d02bj
is the AD Library version of the primal routine
d02bjf.
d02bjf integrates a system of first-order ordinary differential equations over an interval with suitable initial conditions, using a fixed order Runge–Kutta method, until a user-specified function, if supplied, of the solution is zero, and returns the solution at points specified by you, if desired.
For further information see Section 3 in the documentation for d02bjf.
4References
Shampine L F (1994) Numerical solution of ordinary differential equations Chapman and Hall
5Arguments
In addition to the arguments present in the interface of the primal routine,
d02bj includes some arguments specific to AD.
A brief summary of the AD specific arguments is given below. For the remainder, links are provided to the corresponding argument from the primal routine.
A tooltip popup for all arguments can be found by hovering over the argument name in Section 2 and in this section.
On entry: a configuration object that holds information on the differentiation strategy. Details on setting the AD strategy are described in AD handle object in the NAG AD Library Introduction.
fcn
needs to be callable with the specification listed below. This can be a C++ lambda, a functor or a (static member) function pointer.
If using a lambda, parameters can be captured safely by reference. No copies of the callable are made internally.
output
needs to be callable with the specification listed below. This can be a C++ lambda, a functor or a (static member) function pointer.
If using a lambda, parameters can be captured safely by reference. No copies of the callable are made internally.
If a null pointer is used as the argument, then a NAG supplied routine will be used as the argument for this parameter (C++ only).
For the Fortran interface, the NAG supplied routine d02bj_AD_x may be used as the actual argument for this parameter.
g
needs to be callable with the specification listed below. This can be a C++ lambda, a functor or a (static member) function pointer.
If using a lambda, parameters can be captured safely by reference. No copies of the callable are made internally.
If a null pointer is used as the argument, then a NAG supplied routine will be used as the argument for this parameter (C++ only).
For the Fortran interface, the NAG supplied routine d02bj_AD_w may be used as the actual argument for this parameter.
Note that g is a subroutine in this interface, returning the function value via the additional output parameter retval.