Date: 11 November 2012

α=%v

μ=%v

X_0

vector field

t_0=

t_f=

x_0=

equilibria

X_0

function

alpha = 0.5 (slider from 0.1 to 2, step 0.1)
mu = 0.8 (slider from 0.1 to 2, step 0.1)
f(x) = ((alpha * x) * (1 - x)) - (mu * x)
tfinal = 10
t0 = 0
n = 2000
dt: (tfinal - t0) / n
x0 = 0.5
A = Point(xAxis)
xmin = -0.1
xmax = 1.1
nvecs = 20
dvec: (xmax - xmin) / nvecs
t = 0 (slider from t0 to tfinal, step dt)
fiter(x) = If[x + (dt * f(x)) > 10000000000, 10000000000,If[x + (dt * f(x))  <  -10000000000, -10000000000,x + (dt * f(x))]]
fvals = IterationList(fiter, x0, n)
tind: ceil((t - t0) / dt) + 1
xt = Element(fvals, tind)
B: (xt, 0)
b = Segment(A, B)
ftcurvesub = PolyLine(Sequence[(t0 + (i * dt), Element[fvals, i + 1]), i, 0, tind])
C: (t0 + ((tind - 1) * dt), Element[fvals, tind])
showvf = false
inputBox2 = Textfield(t0)
inputBox3 = Textfield(tfinal)
inputBox4 = Textfield(x0)
tmax: tfinal + ((tfinal - t0) * 0.1)
centery = 0
height = 3
showe = false
ymin = -2
ymax = 2
c: x = t0
D = Point(c)
showf = true
c_1 = 0
c_2 = 0
c_3 = 0
c_4 = 0
vecfmags = Sequence(If[abs(f(xx))  <  ymax - ymin, sqrt(abs(f(xx))), abs(f(xx) - ymax + ymin)^(1 / 4) + sqrt(ymax - ymin)], xx, xmin, xmax, dvec)
veclen: (dvec * 0.5)
vecwidths: ((vecfmags * sqrt(ymax - ymin)) * 0.04)
vecdirs = Sequence(If[(f(xx) > 0) ∧ (f(xx - dvec / 2) > 0), -1, If[(f(xx)  <  0) ∧ (f(xx + dvec / 2)  <  0), 1, 0]], xx, xmin, xmax, dvec)
vecxs = Sequence(xx, xx, xmin, xmax, dvec)
vectorfield = Zip(Polygon[(a, 0), (a + ((b * veclen) * (1 + Min[(2 * c), 1])), c), (a + ((b * veclen / 2) * (1 + Min[(2 * c), 1])), 0), (a + ((b * veclen) * (1 + Min[(2 * c), 1])), (-c))], a, vecxs, b, vecdirs, c, vecwidths)
zerolist = If(alpha ≟ mu, {(0, 0)}, {Roots[f, xmin, xmax]})
f' = Derivative(f)
unstablezeros = RemoveUndefined(Zip[If[f'(x(a)) ≥ 0, a], a, zerolist])
unstablezerolines = Zip(y = a, a, x(unstablezeros))
stablezeros = RemoveUndefined(Zip[If[f'(x(a))  <  0, a], a, zerolist])
stablezerolines = Zip(y = a, a, x(stablezeros))
text1: "\frac{dI}{dt}=" + (LaTeX[alpha]) + "I(1-I)-" + (LaTeX[mu]) + "I"
tmin: t0 - ((tfinal - t0) * 0.15)