calculus - florida institute of technologymy.fit.edu/~rvw/lectures/calculus 2005.pdfcalculus dn/dt =...
TRANSCRIPT
![Page 1: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/1.jpg)
CalculusCalculus
![Page 2: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/2.jpg)
CalculusCalculus
dN/dtdN/dt = (= (bb--dd).N).NRate of change in population size with respect Rate of change in population size with respect to time.to time.Right side of equation is the product of the Right side of equation is the product of the population size N, multiplied by the difference population size N, multiplied by the difference between instantaneous births and deathsbetween instantaneous births and deaths
![Page 3: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/3.jpg)
r = (r = (bb--dd), is the intrinsic rate of increase (or ), is the intrinsic rate of increase (or instantaneous growth rate. instantaneous growth rate.
dN/dtdN/dt = r. N,= r. N,
When r = 0, births and deaths are When r = 0, births and deaths are balanced, individuals merely replace balanced, individuals merely replace themselves.themselves.
![Page 4: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/4.jpg)
LongLong--versionversionIntegrate Integrate dN/dtdN/dt = r. N,= r. N,First First dNdN = = r.Nr.N dtdt,,Then Then dNdN/N = r. /N = r. dtdtThen integrate, summing changes in population size over the inteThen integrate, summing changes in population size over the interval from rval from ttoo to t, to t, ln.N(t) – ln.N(to) = rt – rto
Rearrange againRearrange againexp exp ln.N(tln.N(t) ) –– ln.N(toln.N(to)) = = expexprtrt--rtorto
N(t)/N(toN(t)/N(to) = exp ) = exp rtrt--rtorto
If to = 0, then If to = 0, then N(tN(t) = ) = N(tN(too).).eertrt
or or
lnln N(tN(t) = ) = lnln N(tN(too) + ) + r.tr.t
![Page 5: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/5.jpg)
CalculusCalculus
function ndot=expgrow(t,n);global r;ndot=r*n;
global r;r=0.5;[t,n]=ode23('expgrow',0:10,2);plot(t,n)
![Page 6: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/6.jpg)
function dx= calculus(r,N)function dx= calculus(r,N)dx = r*N;dx = r*N;
![Page 7: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/7.jpg)
fodesol('calculusfodesol('calculus', 0, 2, 0 , 10)', 0, 2, 0 , 10)
![Page 8: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/8.jpg)
help fodesolhelp fodesol
function function fodesol(F,tmin,tmax,xmin,xmaxfodesol(F,tmin,tmax,xmin,xmax))
fodesol obtains an approximate solution to the ODEfodesol obtains an approximate solution to the ODEdx/dx/dtdt = = f(x,tf(x,t) by the ) by the RungeRunge--KuttaKutta--FehlbergFehlbergmethod ODE23 supplied with MATLAB (2nd/3rdmethod ODE23 supplied with MATLAB (2nd/3rdorder version) and compares the solutionsorder version) and compares the solutionswith a "grain" (or field) plot.with a "grain" (or field) plot.
F is a string containing the name of a realF is a string containing the name of a realfunction function f(x,tf(x,t), supplied in an M), supplied in an M--file.file.e.g. e.g. fnxt.mfnxt.m
tmin,tmaxtmin,tmax andandxmin,xmaxxmin,xmax are limits for the plotare limits for the plot
usage e.g.usage e.g.fodesol('fnxt',0, 2.5, fodesol('fnxt',0, 2.5, --3 , 3)3 , 3)
![Page 9: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/9.jpg)
![Page 10: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/10.jpg)
Pick initial tPick initial t--value: 0 value: 0 Pick initial xPick initial x--value: 2value: 2please wait...please wait...
![Page 11: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/11.jpg)
![Page 12: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/12.jpg)
Initial and final points (Initial and final points (t,xt,x) of solution were) of solution wereInitial FinalInitial Final0 20 2
2.0000 14.76392.0000 14.7639
![Page 13: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/13.jpg)
function dx= calculus(r,N)function dx= calculus(r,N)global kglobal kdx = r*N*(kdx = r*N*(k--N/k);N/k);
![Page 14: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/14.jpg)
The solution isThe solution is
X(tX(t) = K/(1) = K/(1--(1(1--K/xK/xoo).exp).exp--r.tr.t))
![Page 15: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/15.jpg)
>> k= 2;>> k= 2;>> fodesol('calculus2',0,2,0,10)>> fodesol('calculus2',0,2,0,10)
![Page 16: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/16.jpg)
The solution isThe solution is
X(tX(t) = K/(1) = K/(1--(1(1--K/xK/xoo).exp).exp--r.tr.t))
![Page 17: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/17.jpg)
![Page 18: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/18.jpg)
Pick initial tPick initial t--value: 0value: 0Pick initial xPick initial x--value: 1value: 1please wait...please wait...
![Page 19: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/19.jpg)
![Page 20: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/20.jpg)
Initial and final points (Initial and final points (t,xt,x) of solution were) of solution wereInitial FinalInitial Final0 20 2
1.0000 15.92181.0000 15.9218
![Page 21: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/21.jpg)
![Page 22: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/22.jpg)
![Page 23: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/23.jpg)
ODE23 Solve nonODE23 Solve non--stiff differential stiff differential equations, low order method.equations, low order method.
[T,Y] = ODE23(ODEFUN,TSPAN,Y0) [T,Y] = ODE23(ODEFUN,TSPAN,Y0) with TSPAN = [T0 TFINAL] integrates thewith TSPAN = [T0 TFINAL] integrates the
system of differential equations y' = system of differential equations y' = f(t,yf(t,y) from time T0 to TFINAL with) from time T0 to TFINAL with
initial conditions Y0.initial conditions Y0.
![Page 24: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/24.jpg)
Example Example [[t,yt,y]=]=ode23ode23(@vdp1,[0 20],[2 0]); (@vdp1,[0 20],[2 0]); plot(t,y(:,1));plot(t,y(:,1));
solves the system y' = vdp1(t,y), using the solves the system y' = vdp1(t,y), using the default relative errordefault relative error
tolerance 1etolerance 1e--3 and the default absolute 3 and the default absolute tolerance of 1etolerance of 1e--6 for each6 for each
component, and plots the first component of component, and plots the first component of the solution. the solution.
![Page 25: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/25.jpg)
global r c D a k1 k2 k3global r c D a k1 k2 k3%copy above into command window%copy above into command windowr=0.4; c=0.05; D=0.05;r=0.4; c=0.05; D=0.05;k1=0.01; k2=0.01; k3 = 0.01;k1=0.01; k2=0.01; k3 = 0.01;a=0.1;a=0.1;%copy above into command window%copy above into command window[t a]=ode45('recruits', 0:0.1:50,[r;c;D]);[t a]=ode45('recruits', 0:0.1:50,[r;c;D]);h=figure; hold onh=figure; hold onplot(t,a(:,1),':')plot(t,a(:,1),':')plot(t,a(:,2),'plot(t,a(:,2),'--')')plot(t,a(:,3),'plot(t,a(:,3),'----')')axis([0 50 0 2])axis([0 50 0 2])xlabel('Timexlabel('Time (years)')(years)')ylabel('Instantaneousylabel('Instantaneous rate of change')rate of change')
![Page 26: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/26.jpg)
![Page 27: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/27.jpg)
function function ndotndot ==recruits(t,nrecruits(t,n))global r c D a k1 k2 k3;global r c D a k1 k2 k3;ndot(1,1) = ndot(1,1) = --k1*r + k2*D; k1*r + k2*D; ndot(2,1) = k1*r ndot(2,1) = k1*r -- k3*c/(1+a*c);k3*c/(1+a*c);ndot(3,1) = k3*c/(1+a*c) ndot(3,1) = k3*c/(1+a*c) -- k2*D;k2*D;
![Page 28: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/28.jpg)
![Page 29: Calculus - Florida Institute of Technologymy.fit.edu/~rvw/Lectures/Calculus 2005.pdfCalculus dN/dt = (b-d).N Rate of change in population size with respect . to time. Right side of](https://reader033.vdocuments.us/reader033/viewer/2022050523/5fa660ce9eb8b84d4048baf5/html5/thumbnails/29.jpg)
pdepepdepe
Partial differential equations…Partial differential equations…
Maybe another day…Maybe another day…