SLIDE 1 Building Models
- Project identification
- Assumptions
- Flow diagrams
- Sources of equations
- Graphical Methods
- Solving equations
SLIDE 2 Project identification
Set realistic goals! Model what?
MODEL ENVIRONMENT
SLIDE 3 Exponential Growth Model
Assume rate of growth is proportional to quantity present Continuous time, deterministic
dp dt = ap p(t) = p0eat
Discrete time, deterministic pt+1 = bpt p(t) = p0bt Continuous time, stochastic Prob{p(t + δt) = p(t) + 1} = cp(t)δt Prob{p(t + δt) = p(t) − 1} = dp(t)δt E[p(t)] = p0e(c−d)t
SLIDE 4
Deterministic and stochastic models
General birth-death dp(t) dt = b(p) − d(p) , Event Effect on population, p Probability of Event Birth p(t + δt) = p(t) + 1 b(p)δt Death p(t + δt) = p(t) − 1 d(p)δt No change p(t + δt) = p(t) 1 − b(p)δt − d(p)δt
SLIDE 5 Exponential Growth Model
Spatial model
λp model Movement between patches Spatial, colony or meta−population model
Figure 1: A schematic description of a spatial model
SLIDE 6
Assumptions
Framework State explicitly Relevance of simplifications Limit applications
SLIDE 7
Flow Diagrams
Pictorial representation of model structure Use standard symbols, or set a logical puzzle! ✷ state or level variables source or sink → channel of material flow channel of information flow ✶ control on rate of flow
SLIDE 8 Energy Model for Cattle Growth
Assume the only relevant information about an animal is its liveweight, W Assume the only source of energy is food intake, I Assume energy is lost either as a result of maintenance (M)
- r due to converting food to body tissue
W is a state variable, I is a source, M is a sink
SLIDE 9
Flow Diagram for Energy Model
INTAKE (I) (M) STORED CHEMICAL ENERGY (W) CONVERSION R3 R5 R4 R2 R1 CONSTRAINTS R1 + R2 = M R1 + R3 = I R3 = R4 + R5 LIVEWEIGHT MAINTENANCE
SLIDE 10
Sources of Equations
Literature Analogy with existing models Data analysis
SLIDE 11 Diffusion
Used to describe the random spread of objects in space from areas of high density to areas of low density With large numbers of objects, the partial differential equation
∂c ∂t = D ∂2c ∂x2 describes the change well.
t = 10 DENSITY (c) SPACE (x)
SLIDE 12 Estimating relationships from data
- 100
- 200
- 300
- 400
- 500
- 600
- 10
20 30 40 50
Maintenace=F+0.0043W Liveweight W (Kg)/1.08 F=0.53(W/1.08)
0.67
Fasting metabolism (MJ/d)
SLIDE 13
Meta-analyses
Energy Content of Weight Gain 46 published equations for the linear regression of log Protein on log Liveweight AND log Fat on log Liveweight need to summarize these by “average” equations OR must decide which equation is most appropriate
SLIDE 14 Graphical Methods for Differential Equations
Based on the approximation
dy dt = {y(t+δt)−y(t)} δt
Observations yi at times ti, calculate
(yi+1−yi) (ti+1−ti)
and plot this against y or t
SLIDE 15 Logistic growth a population data
0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.1 0.2 0.3 0.4 0.0 5.0 10.0
✁
20.0
0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 0.0 5.0 10.0
✁
20.0
−3.0 −2.0 −1.0 0.0
y time time (yt+1+yt)/2 (yt+1+yt)/2 log(y) (log(yt+1)−log(yt))/δt (yt+1−yt)/δt
SLIDE 16 For data from some growth curves, find {log(yi+1 − log(yi}/(ti+1 − ti) ≈ A − Byi Why should this be?
d(log y) dt
= 1
y dy dt = A − By dy dt = y(A − By)
This is the logistic growth curve
SLIDE 17 Solving Equations
Mathematival solutions exist for linear, deterministic equations
dy dt = ay; y = y(0)eat dy dt = ay + bz dz dt = cy + dz
Mathematical solution of non-linear equations is much more difficult
SLIDE 18
Numerical Solution of Model Equations
Computer intensive Approximate Case specific Model structure less critical
SLIDE 19 Euler’s Method
Assume dy
dt is constant over short time intervals
y(ti+1) ≈ yi + (ti+1 − ti)dy
dt|ti
Often, ti+1 − ti is held constant, called the step size
t0 y0 y t
SLIDE 20 Fourth Order Runge-Kutta (RK4)
Uses an average of dy
dt over the interval from ti to ti+1
Achieves much greater accuracy than assuming dy
dt is constant
However, if vastly different time scales use stiff ODE solver, e.g., Rosenbrock
SLIDE 21 Numerical Approximation of cos(t)
cos(t) an exact solution to second order ODE
d2y dt2 = −y
Re-write as system of first order ODE’s
dy dt = z dz dt = −y
Solution will be unit circle in y-z phase space
SLIDE 22 Numerical estimation of the cosine function
−3 −1 1 3 5
Euler RK4 Exact
SLIDE 23
Stochastic simulation (approximate)
General birth-death Event Effect on population, p Probability of Event Birth p(t + δt) = p(t) + 1 b(p)δt Death p(t + δt) = p(t) − 1 d(p)δt No change p(t + δt) = p(t) 1 − b(p)δt − d(p)δt Update time: t → t + δt and draw y ∼ U(0, 1) Birth if y < b(p)δt else Death if y < b(p)δt + d(p)δt else No event