solving ordinary differential equations dt ut ode_fe(fexact_solution( )dttdiff abs(exact_solution(tumax(tol - tolerance for float comparison success diff tol assert success recall that test functions should start with the name test_have no argumentsand formulate the test as boolean expression success that is true if the test passes and false if it fails test functions should make the test as assert success (here success can also be boolean expression as in assert diff tolobserve that we cannot compare diff to zerowhich is what we mathematically expectbecause diff is floating-point variable that most likely contains small rounding errors thereforewe must compare diff to zero with tolerancehere you are encouraged to do exercise where the goal is to make test function for verification based on comparison with hand-calculated results for few time steps spreading of diseases our aim with this section is to show in detail how one can apply mathematics and programming to investigate spreading of diseases the mathematical model is now system of three differential equations with three unknown functions to derive such modelwe can use mainly intuitionso no specific background knowledge of diseases is required spreading of flu imagine boarding school out in the country side this school is small and closed society suddenlyone or more of the pupils get flu we expect that the flu may spread quite effectively or die out the question is how many of the pupils and the school' staff will be affected some quite simple mathematics can help us to achieve insight into the dynamics of how the disease spreads let the mathematical function tcount how many individualsat time tthat have the possibility to get infected heret may count hours or daysfor instance these individuals make up category called susceptibleslabeled as another categoryiconsists of the individuals that are infected let tcount how many there are in category at time an individual having recovered from the disease is assumed to gain immunity there is also small possibility that an infected will die in either casethe individual is moved from the category to category we call the removed categorylabeled with we let tcount the number of individuals in the category at time those who enter the categorycannot leave this category