ODE solving with PHREEQC's Runge-Kutta integrator

PHREEQC`s Runge-Kutta integrator is for kinetics, and uses time as integration variable. But it can handle any set of ordinary differential equations (ODE`s), setting x = total_time, dx = time, and the first and last time step as integration boundaries.

PHREEQC input file RK_intergrator.phr shows how this can be done.
The function y = x * exp(-x) (see figure) is integrated from x = 0.8 to 5.
The result, printed in the output file:

Analytical = 7.6836e-1. PHREEQC Integral = 7.6836e-1, difference = 1.1679e-8

«—