simple euler method example failing to converge
Created originally on Bitbucket by zorg24 (Nathan)
This is a very naive attempt at performing at integrating y'=1/3x^2 over [0,1] with y(0)=0 using Euler's method, however for inc between 0.6e-7 and 1.3e-7 (I didn't try to be any more precise) it is failing to converge on my machine. For other values it runs quite fast as would be expected, also noteworthy is that it runs fine if line 6 is commented out.
#!python def main(): inc=1e-7 result=0.0 i=0.0 while (i <= 1.0): result += inc * (1.0/3.0 * i * i) i += inc print(result) main()