Matlab Assignment
MATH3MB3
Due November 17, 2012
Instructions
- This assignment may be completed in groups of 2-3 or independently. I will ask you questions
about your code independently so you are still responsible for understanding the entire assignment
Dimensional analysis
Steve Walker July 9, 2014
Dimensional consistency
Non-dimensionalization
Important dimensions: time [T], amount [N], temperature
Can help with interpretation. Three steps: (1) identify
[], length [L]. Rules for dimensional consistenc
Math 3MB3: practice
1
Math 3MB3: practice
1
Fixed points and stability
MS p 38, Exercise 3. For more practice, nd the xed points of the following models. If there are no xed points, say so. For each xed point,
analyse its stability using the derivative te
Question
Many of Canada's lakes contain populations of fish that are predators of smaller-bodied
fish. Under a wide variety of natural conditions these predator-prey systems are stable.
Humans interact with these systems in at least two ways: (1) by fishi
Practice
1
1
R CODE
R code
1. Given a vector of animal activity levels (activity) and a vector of
air temperatures in degrees C (temp), write R code to calculate the
mean of animal activity when air temperatures are above freezing.
mean(activity[temp>0])
Exercise 2, p.38 of MS
Find a closed-form solution for the affine recurrence relation, $ x(n) = Rx(n-1) + a $
My approach is to linearize the equation by a change of variables, use the closed form
solution for linear models, and then back-transform to the
Introduction to R
Exercise 6.6: Recreate Figure 1.5 on pp. 15 of Mooney and Swifts book
# shortcut for setting several values at once
N_best <- N_medium <- N_worst <- numeric(15)
# keep all values in a single named vector
L <- c(best = 0.0194, medium = -0
# Library you have to include
library("deSolve")
SIRfunc <- function(t, x, parms)
cfw_
# Initial conditions
S <- x[1]
I <- x[2]
cfw_
# ODE implementation
with(as.list(parms),
dS <- mu - beta*S*I - mu*S
dI <- beta*S*I - (gamma+mu)*I
)
out <- c(dS, dI)
lis
Matrix models in R (lab 3)
c 2010 Ben Bolker (modied by Steve Walker)
September 4, 2014
Licensed
under
the
Creative
Commons
attribution-noncommercial
license
(http:/
creativecommons.org/licenses/by-nc/3.0/).
Please share & remix noncommercially, mentionin
Using R to analyze continuous models (lab 4)
Steve Walker
October 6, 2014
Licensed
under
the
Creative
Commons
attribution-noncommercial
license
(http:/
creativecommons.org/licenses/by-nc/3.0/).
Please share & remix noncommercially, mentioning its origin.
Univariate linear (and afne) continuous-time deterministic models
Steve Walker: July 9, 2014
Basic model: dx(t) = rx(t), where r is constant. Can
dt
be thought of as the limit of the discrete-time linear model
as the time step gets smaller, dx = limh0 x(
Let the system be described by the ODEs of the first order
xi=fi(x1,x2,xn,t), i=1,2,n
It means that the state of the system at a given moment of time is defined completely by a set of n numbers xi.
Introduce $n$-dimensional space with respect to xi (i=1,n
Stability of dynamical systems
1. Find equilibrium points, give their classification (un)stable focus, (un)stable knot, saddle, center) and plot the
phase trajectories
(A) cfw_x=3x,y=2x+y.
(B) cfw_x=x+3y,y=6x5y.
(C) cfw_x=y,y=2xy.
(D) cfw_x=2x5y,y=2x+2y.
Plant growth schedule
Literature: Iwasa, Yoh and Dan Cohen (1989) "Optimal Growth Schedule of a Perennial Plant" The American
Naturalist, 133(4), pp. 480-505 (link)
Suppose that we have a plant and it consists by the production part F (eg. leaves for phot
Stability analysis
Consider the following dynamical system
xi=fi(x1,xn,t), i=1,n
such that the right hand sides are sufficiently smooth in the domains of definition of functions fi regarding their
arguments. It is done in order to be sure that the solutio
Main equation
We assume that the population size is sufficiently large.
dxidt=j=0nxjfjqjixi, i=0n,
where fi is the fitness of the sequence i, qji is mutation probabilities, referring to the production of xi as an error
copy of template xj. If we denote th
Models of a single population growth
Literature: Murray, J.D. "Mathematical biology. I. Introduction", Sec. 1.1
Exponential growth, Logistic equation
N(t) is a size of the population at moment t. We can write
N=birthmortality+migration
In the simplest cas
Problem 1 (Taylor formula)
Expand the function f(x)=(cosh(x)sin(x) till o(x5)
Some hints
please take a look The Taylor formula notes and be careful with o(xk),
remember how you dealt with a(x)b(x) kind of expressions - you can always use that it is equiva
Literature: Murray, J.D. "Mathematical biology. I. Introduction", Sec. 2.1-2.3
In general, we can define the sequence cfw_xn in the form of a mapping
xn+1=f(xn)
where xn can be some relative quantity that is measured at some given moments of time tn.
For
Consider the following system of ODEs:
dxdt=fi(x1,xn;), i=1n and =(1,m).
Example: x=x2+
If >0: x>0 for x, so that we don't have any equilibria
If <0:
there exists a non-permitted zone in the solution |x|<
there are two equilibria: x=
Thus, the portrait of
Dynamical systems are described by the system of ordinary differential equations in the form
xidxdt=fi(x1,xn,t), i=1n
such that any state of it xi(t) can be fully determined by initial conditions t=t0: xi=xi(t0). If it is not fulfilled and we
cannot deter
In class midterm practice
short answer
Time is continuous in reality. Nevertheless, discrete-time models provide good approximations
to continuous time models. Describe three scenarios where this approximation might indeed be
adequate.
A discrete-time biv