Date: 11 November 2012

w

$ \frac{dw}{dt}= r w \left(1 - \frac{w}{a}\right) - \frac{w²}{1 + w²}$

Budworm outbreak!

Forest growing

Forest dying

a

outbreak = false
xmin = -4
xmax = 31
r = 0.52 (slider from 0 to 1, step 0.01)
tfinal = 200
ttop: (0.6 * tfinal)
tbottom: (0.95 * tfinal)
T = 0 (slider from t0 to tfinal, step (tfinal - t0) / 1000)
atop = 26.7
abottom = 3
a(t) = If[t  <  ttop, abottom + (t / ttop * (atop - abottom)),If[t  <  tbottom, abottom + ((1 - (t - ttop) / (tbottom - ttop)) * (atop - abottom)),abottom]]
f(w) = ((r * w) * (1 - w / a(T))) - w^(2) / (1 + w^(2))
zerolist: {Roots[f, xmin, xmax]}
b = Ray((0, 0), (1, 0))
t0 = 0
tmax: tfinal + ((tfinal - t0) * 0.1)
ymax = 0.5
ymin = -0.2
c = Ray((t0, 0), (t0, 1))
branch = 1
W = Element(zerolist, If[outbreak, Length[zerolist], 2])
Wt: (T, x(W))
at: a(T)
text2: "r=" + (LaTeX[r]) + "\\
a=" + (LaTeX[at]) + ""
A: (T, at)
outbreakthreshold = 3
tmin: t0 - ((tfinal - t0) * 0.15)