Numerically integrates the differential equation
using a fifth-order Runge-Kutta method.
The functions A(x) and B(x) are passed as arguments and should be conform to the
given interface, that is, these should be real(dp)
functions which take a single
real(dp), intent(in)
argument.
The integration is performed on the interval [x0, x1] with a stepsize of
dh = (x1 - x0) / (nbpoints - 1)
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | x0 | start of x-interval |
||
real(kind=dp), | intent(in) | :: | x1 | end of x-interval |
||
procedure(func) | :: | ax_func | function to calculate A(x) |
|||
procedure(func) | :: | bx_func | function to calculate B(x) |
|||
integer, | intent(in) | :: | nbpoints | number of points, determines stepsize |
||
real(kind=dp), | intent(in) | :: | yinit | initial value of y |
||
real(kind=dp), | intent(out), | allocatable | :: | yvalues(:) | integrated values of y |
|
real(kind=dp), | intent(out), | optional | allocatable | :: | xvalues(:) | x-values corresponding to integrated y-values |