25.5 Exercises
Exercise 25.4 (Inspired by Logan and Wolesensky (2009)) Consider the logistic differential equation: dxdt=rx(1−xK). Assume there is stochasticity in the inverse carrying capacity 1/K (so this means you will consider 1/K+ Noise ).
- Identify the deterministic and stochastic part of each of the differential equation.
- Assume that x(0)=3, r=0.8, K=100, Δt=0.05, and σ=1. Apply the Euler-Maruyama method to produce a solution, using with 200 timesteps.
- Now do 500 simulations of this stochastic process and compare the ensemble solution.
- Contrast your results to when we added stochasticity to the parameter r in the logistic model.

Figure 25.7: The SIS model
Exercise 25.5 (Inspired by Logan and Wolesensky (2009)) An SIS model is one where susceptibles S become infected I, and then after recovering from an illness, become susceptible again. The schematic representing this is shown in Figure 25.7. While you can write this as a system of differential equations, assuming the population size is constant N, this simplifies to the following differential equation:
dIdt=b(N−I)I−rI
- Determine the equilibrium solutions for this model and analyze the stability of the equilibrium solutions.
- Assuming N=1000, r=0.01, and b=0.005, I(0)=1, apply Euler’s method to simulate this differential equation over two weeks with Δt=0.1. Show the plot of your result.
- Assume the transmission rate b is stochastic. Write down this stochastic differential equation. Do 500 simulations of this stochastic process with σ=1. Contrast this result to the deterministic solution.
- Assume the recovery rate r is stochastic. Write down this stochastic differential equation. Do 500 simulations of this stochastic process with σ=1. Contrast this result to the previous results.
Exercise 25.6 Consider the following Lotka-Volterra (predator prey) model:
dVdt=rV−kVPdPdt=ekVP−dP
- Assume that the parameter k is stochastic. Write down the stochastic differential equation, identifying the deterministic and stochastic parts to this system of equations.
- Apply the Euler-Maruyama method for 100 simulations with σ=0.01 with the following values of parameters and step sizes:
- Initial condition: V(0)=1, P(0)=3
- Parameters: r=2, k=0.5, e=0.1, and d=1.
- Set Δt=0.05 and N=200.
Exercise 25.7 Consider the following model for zombie population dynamics:
dSdt=−βSZ−δSdZdt=βSZ+ξR−αSZdRdt=δS+αSZ−ξR
- Let’s assume the transmission rate β is a stochastic parameter. With this assumption, group each differential equation into two parts: terms not involving noise (the deterministic part) and terms that are multiplied by noise (the stochastic part)
- Deterministic part for dSdt:
- Stochastic part for dSdt:
- Deterministic part for dZdt:
- Stochastic part for dZdt:
- Deterministic part for dRdt:
- Stochastic part for dRdt:
- Apply the Euler-Maruyama method to do 500 simulations of this stochastic differential equation and compute the ensemble average. For the Euler-Maruyama method apply the following values:
- σ=0.004
- Δt=0.5.
- Timesteps: 200.
- β=0.0095, δ=0.0001 ,ξ=0.1, α=0.005.
- Initial condition: S(0)=499, Z(0)=1, R(0)=0.
- How does making β stochastic affect the disease transmission? d. If we assume that the population is fixed at 500 individuals, what is interesting about your stochastic results?