Assignment Task: Re-write your code using the functions outlined below. Using these cleaned-up functions, re-create the graphs from Part, but with lines instead of individual markers. You can change the actual function/variable names if you want, but you need to use these parameters.
Function Descriptions:
- The first function, DiseaseStep, runs the calculations for one time step.
- The second function, DiseaseSimulate, calls DiseaseStep nSteps times to simulate the epidemic over time. It also creates the time array (see implementation note in previous week).
- DiseaseSimulate should call DiseaseStep. Note that you can calculate the starting N value using SStart and IStart (RStart is zero).
- Splitting up code this way lets you use DiseaseStep elsewhere if need be. Having DiseaseSimulate return arrays is handy for plotting.
Your script should call DiseaseSimulate once with each starting value for S (use a for loop).