solving ordinary differential equations the values at tn and tnc unc tnc un tn unc tnc / this results in unc un un tn unc tnc // which in general is nonlinear algebraic equation for unc if utis not linear function of to deal with the unknown term unc tnc /without solving nonlinear equationswe can approximate or predict unc using forward euler stepunc un tf un tn this reasoning gives rise to the method un tf un tn / un tn tnc /unc un ( ( the scheme applies to both scalar and vector odes for an oscillating system with uthe file osc_heun py implements this method the demo function in that file runs the simulation for periods with time steps per period the corresponding numerical and exact solutions are shown in fig we see that the amplitude growsbut not as much as for the forward euler method howeverthe euler-cromer method is much betterwe should add that in problems where the forward euler method gives satisfactory approximationssuch as growth/decay problems or the sir modelthe nd-order runge-kutta method or heun' methodusually works considerably better and produces greater accuracy for the same computational cost it is therefore very valuable method to be aware ofalthough it cannot compete with the eulercromer scheme for oscillation problems the derivation of the rk /heun scheme is also good general training in "numerical thinkingsoftware for solving odes there is jungle of methods for solving odesand it would be nice to have easy access to implementations of wide range of methodsespecially the sophisticated and complicated adaptive methods that adjust automatically to obtain prescribed accuracy the python package odespy gives easy access to lot of numerical methods for odes the simplest possible example on using odespy is to solve uu for time steps until