solving ordinary differential equations get : : and : such calculations show that the program is seemingly correct (laterwe can use such values to construct unit test and corresponding test function the next step is to reduce the discretization parameter and see if the results become more accurate figure shows the numerical and exact solution for the cases = = = the results clearly become betterand the finest resolution gives graphs that cannot be visually distinguished neverthelessthe finest resolution involves computational intervals in totalwhich is considered quite much this is no problem on modern laptophoweveras the computations take just fraction of second although intervals per oscillation period seem sufficient for an accurate numerical solutionthe lower right graph in fig shows that if we increase the simulation timehere to periodsthere is little growth of the amplitudewhich becomes significant over time the conclusion is that the forward euler method has fundamental problem with its growing amplitudesand that very small is required to achieve satisfactory results the longer the simulation isthe smaller has to be it is certainly time to look for more effective numerical methodsfig simulation of an oscillating system with different time steps upper left steps per oscillation period upper right steps per period lower left steps per period lower right steps per periodbut longer simulation