[ n_ for in range(n_t+ ) [ + [nr*dt* [nimport matplotlib pyplot as plt numerical_sol 'boif n_t else ' -plt plot(tnnumerical_soltn_ *exp( * )' -'plt legend(['numerical''exact']loc='upper left'plt xlabel(' ')plt ylabel(' ( )'filestem 'growth %dstepsn_t plt savefig('% pngfilestem)plt savefig('% pdffilestemthe complete code above resides in the file growth py let us demonstrate simulation where we start with animalsa net growth rate of percent ( per time unitwhich can be one monthand oe months we may first try of half month ( )which implies (or to be absolutely precisethe last time point to be computed according to our set-up above is tn : figure shows the results the solid line is the exact solutionwhile the circles are the computed numerical solution the discrepancy is clearly visible what if we make times smallerthe result is displayed in fig where we now use solid line also for the numerical solution (otherwise circles would look very clutteredso the program has test on how to display the numerical solutioneither as circles or solid linewe can hardly distinguish the exact and the numerical solution the computing time is also fraction of second on laptopso it appears that the forward euler method is sufficiently accurate for practical purposes (this is not always true for largecomplicated simulation models in engineeringso more sophisticated methods may be needed fig evolution of population computed with time step month