integrate_ode_rk45 Subroutine

public subroutine integrate_ode_rk45(x0, x1, ax_func, bx_func, nbpoints, yinit, yvalues, xvalues)

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).

Arguments

TypeIntentOptionalAttributesName
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


Contents

None