The implementation is based on the RI5 scheme proposed in:
Andreas Rößler (2009), Second Order Runge–Kutta Methods for Itô Stochastic Differential Equations,
SIAM J. Numer. Anal., 47(3), 1713–1738.
DOI:10.1137/060673308
Additionally we added a root finder so that the SBML discrete event handling mechanism can be supported. This root finder can optionally be used to prevent negative values for species and compartmnents.