![Page 1: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/1.jpg)
Numerical Solution of Differential Equations
Dr. Alvaro Islas
Applications of Calculus ISpring 2008
Dr. A. Islas Numerical ODEs
![Page 2: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/2.jpg)
We live in a world in constant change
Dr. A. Islas Numerical ODEs
![Page 3: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/3.jpg)
We live in a world in constant change
Dr. A. Islas Numerical ODEs
![Page 4: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/4.jpg)
We live in a world in constant change
Dr. A. Islas Numerical ODEs
![Page 5: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/5.jpg)
We live in a world in constant change
Dr. A. Islas Numerical ODEs
![Page 6: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/6.jpg)
We live in a world in constant change
Dr. A. Islas Numerical ODEs
![Page 7: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/7.jpg)
Blue Question:
Rate of Change is measured byA Pythagoras theorem.B The zeros of a function.C Derivatives.D Similar triangles.D None of the above.
Dr. A. Islas Numerical ODEs
![Page 8: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/8.jpg)
And change is measured by
[C] Derivatives!
Dr. A. Islas Numerical ODEs
![Page 9: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/9.jpg)
Blue Question:
Derivatives give theA zeros of a function.B steepness of a function.C asymptotes.D All of the above.E None of the above.
Dr. A. Islas Numerical ODEs
![Page 10: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/10.jpg)
Derivatives give the
[B] steepness of a function!
Dr. A. Islas Numerical ODEs
![Page 11: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/11.jpg)
Blue Question:
If we KNOW the function that fits the datathen we can determine
A The derivative.B The zeros of the function.C The maximum and minimum values.D All of the above.E None of the above.
Dr. A. Islas Numerical ODEs
![Page 12: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/12.jpg)
If we KNOW the function then we know
[D] All of the above!
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
-15 -10 -5 0 5 10 15
sin(x)/(x-pi)0
Dr. A. Islas Numerical ODEs
![Page 13: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/13.jpg)
If we DON’T KNOW the function
Then we couldmake a guess.try to fit it to known equations.try to find an equation containing derivatives.
Equations containing derivatives are called
Differential equations.
Dr. A. Islas Numerical ODEs
![Page 14: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/14.jpg)
Blue Question:
Which equations are differential equations?
1) x2 + y2 = r2
2) x2 + 4xy + y2 = 13) x2y ′′ + xy ′ + y = 0
4)(
x2 + y2)4
= 25(x2 − y2)
5) y ′′ + y = 0
A) 1 & 3 B) 2 & 4 C) 3 & 5 D) none E) all
Dr. A. Islas Numerical ODEs
![Page 15: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/15.jpg)
Which equations are differential equations?
1) x2 + y2 = r2
2) x2 + 4xy + y2 = 13) x2y ′′ + xy ′ + y = 0
4)(
x2 + y2)4
= 25(x2 − y2)
5) y ′′ + y = 0
[C] 3 & 5!
Dr. A. Islas Numerical ODEs
![Page 16: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/16.jpg)
Blue Question:
How do we derive a differential equation?A Using basic principles.B Doing experiments.C By trial and error.D All of the above.E None of the above.
Dr. A. Islas Numerical ODEs
![Page 17: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/17.jpg)
How do we derive a differential equation?
A Using basic principles.B Doing experiments.C By trial and error.D All of the above.E None of the above.
[D] All of the above!
Dr. A. Islas Numerical ODEs
![Page 18: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/18.jpg)
Example: Falling Body
Newton’s second law: Net Force = mass× acceleration.
F = m a = m v ′
where v(t) is the velocity of the falling body, and v ′ is itsderivative with respect to time.Assume that the only forces acting on the body are gravityand air resistance.Gravity is constant on the surface of the earth.Air resistance is proportional to the velocity.Putting it all together we have our first differential equation:
mv ′ = 9.8− γv
Dr. A. Islas Numerical ODEs
![Page 19: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/19.jpg)
Examples: Spring Motion
Consider a spring immersed ina fluid.By Newton’s second law andmany lab experiments wehave found that
mY ′′ = −CY ′ − KY
where m is the mass, K is thespring constant, and C is thedamping constant.
Dr. A. Islas Numerical ODEs
![Page 20: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/20.jpg)
Examples: Population Models
One species (i) Unlimeted resources and growth rate k .
dPdt
= kP, P(t) is the population at time t .
One species (ii) Limeted resources and competion.
dPdt
= kP(
1− PC
), C is the carrying capacity.
Dr. A. Islas Numerical ODEs
![Page 21: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/21.jpg)
Examples: Population Models
Two species
dXdt
= aX − αXY , X (t) is the prey
dYdt
= −bX + βXY , Y (t) is the predator
Dr. A. Islas Numerical ODEs
![Page 22: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/22.jpg)
Initial-value Problems
Every problem starts somewhere.Derivatives give only rates of change.A problem’s complete description is given by a differentialequation plus some initial condition(s).
dPdt
= kP, P(t0) = P0
d2ydt2 = −k2y , y(t0) = y0,
ydt
(t0) = v0
Dr. A. Islas Numerical ODEs
![Page 23: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/23.jpg)
How do we solve a differential equation?
Many differential equations have analytical solutions.These can be given by explicit or implicit formulas.For example an analytical solution to the DE y ′ = 2x isgiven by y = x2 + C, since the derivative of a constant iszero.Another simple example is the DE given by
y ′′ = −32.
Dr. A. Islas Numerical ODEs
![Page 24: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/24.jpg)
Approximate solutions
Most differential equations don’t have an analyticalsolution!The solution has to be approximated.The linear approximation gives a first order approximation.
To get a better idea on how the linear approximation works, let’sfirst take a geometric view of differential equations.We want to use the fact that the derivative gives the slope ofthe tangent lines to the curve. Since we know the derivative(from the differential equation), we could draw a bunch of (smalltangent lines) and get an idea of the curve.
Dr. A. Islas Numerical ODEs
![Page 25: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/25.jpg)
Direction fields. Example: v ′ = 9.8− 0.196v .
To obtain a geometric view we use the fact that the derivativegives the slope of the tangent line and take the following steps:
Find the points where the slopes have given values.For example, start with the points with zero slopes. (In thiscase, v ′ = 0 means they are of the form (t , v) = (t ,50)).Plot horizontal arrows at these points to indicate the arrowsare horizontal there.
Dr. A. Islas Numerical ODEs
![Page 26: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/26.jpg)
Direction fields. Example: v ′ = 9.8− 0.196v .
Direction field where the slopes are zero.
Dr. A. Islas Numerical ODEs
![Page 27: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/27.jpg)
Direction fields. Example: v ′ = 9.8− 0.196v .
Add arrows where the slopes are positive.
Dr. A. Islas Numerical ODEs
![Page 28: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/28.jpg)
Direction fields. Example: v ′ = 9.8− 0.196v .
Add arrows where the slopes are negative.
Dr. A. Islas Numerical ODEs
![Page 29: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/29.jpg)
Direction fields. Example: v ′ = 9.8− 0.196v .
Now we can visualize the solution that starts at 30.
Dr. A. Islas Numerical ODEs
![Page 30: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/30.jpg)
Direction fields. Example: v ′ = 9.8− 0.196v .
Or we can visualize several other solutions.
Dr. A. Islas Numerical ODEs
![Page 31: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/31.jpg)
Red Question
Draw the direction field and a few curves for the populationequation
P ′ = P(1− P)
by taking the following steps:Find the points where the slopes are zero.Draw some arrows with zero slope.Then draw a few arrows with positive slope.And a few with negative slope.Last draw a few curves that follow the arrows.
Dr. A. Islas Numerical ODEs
![Page 32: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/32.jpg)
The direction field and a few curves are given by
A
0 1 2 3 4 5 6 7 8 9 10
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
t
P
C
0 1 2 3 4 5 6 7 8 9 10
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
t
PB
0 1 2 3 4 5 6 7 8 9 10
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
t
P
D
0 1 2 3 4 5 6 7 8 9 10
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
t
x
Dr. A. Islas Numerical ODEs
![Page 33: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/33.jpg)
The direction field and a few curves are given by
[C] !
0 1 2 3 4 5 6 7 8 9 10
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
t
P
Dr. A. Islas Numerical ODEs
![Page 34: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/34.jpg)
How do we get the approximate values of f (x)?
Usingthe
linearapproximation!
Dr. A. Islas Numerical ODEs
![Page 35: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/35.jpg)
Given f (x) the linear approximation is given by
[B] f (x) ≈ L(x) = f (a) + f ′(a)(x − a)!
Dr. A. Islas Numerical ODEs
![Page 36: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/36.jpg)
Tangent Below the Curve
0 0.5 1 1.5 2 2.5 3 3.5 4−5
0
5
10
x
f
Figure: The tangent line is completely below the curve and the linearapproximation gives an underestimate.
Dr. A. Islas Numerical ODEs
![Page 37: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/37.jpg)
Tangent Above the Curve
−4 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0−5
0
5
10
x
f
Figure: The tangent line is completely above the curve and the linearapproximation gives an overestimate.
Dr. A. Islas Numerical ODEs
![Page 38: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/38.jpg)
Tangent Above and Below the Curve
−10 −8 −6 −4 −2 0 2 4 6 8 10−20
0
20
40
60
80
100
120
x
f
Figure: The tangent line is above the curve (overestimate) on oneside of the tangent point and below (underestimate) on the other side.
Dr. A. Islas Numerical ODEs
![Page 39: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/39.jpg)
Population Models
Now we are ready to start working on a real application.Suppose we want to describe a given species populationgrowth.The simplest model assumes that the population rate ofchange is proportional to the population size. That is
dPdt
= kP, P0 = P(0)
where k is the constant rate of growth and P0 is the initialpopulation.
Dr. A. Islas Numerical ODEs
![Page 40: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/40.jpg)
Direction field and the solution for P ′ = 0.02P, P0 = 1
0 10 20 30 40 50 60 70 80 90 100
0
1
2
3
4
5
6
7
8
9
10
t
P
P ’ = 0.02 P
Dr. A. Islas Numerical ODEs
![Page 41: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/41.jpg)
How do we use L(t) to approximate the solution
The linear approximation starts at t = 0 and is given by
L0(t) = P(0) + P ′(0) · (t − 0)
= P(0) + k · P(0) · (t − 0)
= 1 + 0.02 · 1 · t= 1 + 0.02t
−10 0 10 20 30 40 50 60 70 80 90 100−2
0
2
4
6
8
10
t
P
Dr. A. Islas Numerical ODEs
![Page 42: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/42.jpg)
How do we use L(t) to approximate the solutionContinued
This linear approximation is good only near t = 0, say for0 ≤ t ≤ 10.To continue we need to use a new linear approximation att = 10.It uses the initial value given by the previous approximation.
L1(t) = L0(10) + P ′(10) · (t − 10)
L1(t) = 1.2 + 0.02 · 1.2 · (t − 10)
L1(t) = 1.2 + 0.24 · (t − 10)
Dr. A. Islas Numerical ODEs
![Page 43: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/43.jpg)
How do we use L(t) to approximate the solution
Which again is good only for t near t = 10, say for 10 ≤ t ≤ 20.
0 2 4 6 8 10 12 14 16 18 201
1.05
1.1
1.15
1.2
1.25
1.3
1.35
1.4
1.45
1.5
exactL
0(t)
L1(t)
Dr. A. Islas Numerical ODEs
![Page 44: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/44.jpg)
Euler’s Method
By repeating this step, with timesteps of length h = 10, we canadvance the solution to t3, t4, . . . , tN
t1 = t0 + h = 10 P1 = P0 + h · (0.02 · P0) = 1.2t2 = t1 + h = 20 P2 = P1 + h · (0.02 · P1) = 1.44
...tN+1 = tN + h PN+1 = PN + h · (0.02 · PN)
This procedure is known as Euler’s Method.
Dr. A. Islas Numerical ODEs
![Page 45: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/45.jpg)
Euler’s Method with two different timesteps.
0 10 20 30 40 50 60 70 80 90 1001
2
3
4
5
6
7
8
Time
Pop
ulat
ion
Figure: Numerical (h = 10 (dotted line), h = 5 (dashed line)) andexact (solid line) solutions.
Dr. A. Islas Numerical ODEs
![Page 46: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/46.jpg)
Population Model for two species
Consider the population of rabits (R) and wolves (W) asdescribed by the Lotka-Volterra equations
dRdt
= 0.08R − 0.001RW
dWdt
= −0.02W + 0.00002RW
Dr. A. Islas Numerical ODEs
![Page 47: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/47.jpg)
Equilibrium occurs when
[C] Both derivatives are equal to zero!That is neither population grows.
Dr. A. Islas Numerical ODEs
![Page 48: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/48.jpg)
There exists an equilibrium point when
[B] R = 1000 and W = 80!
Dr. A. Islas Numerical ODEs
![Page 49: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/49.jpg)
Euler’s Method for a system of equations
The linear approximations at t = t0 for both the rabit and wolfpopulations are given just as before
Lr (t) = R(t0) +dRdt
(t0)(t − t0)
Lw (t) = W (t0) +dWdt
(t0)(t − t0)
The difference is that both derivatives are functions of both Rand W .
Dr. A. Islas Numerical ODEs
![Page 50: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/50.jpg)
Euler’s Method in vector form
The linear approximations, as before, are good near t = t0, sayup to t1 = t0 + h. Then we need a new approximation at t = t1which again is only good near t2. And so on . . .(
R1W1
)=
(R0W0
)+
(R′(t0)W ′(t0)
)· h(
R2W2
)=
(R1W1
)+
(R′(t1)W ′(t1)
)· h
...(RN+1WN+1
)=
(RNWN
)+
(R′(tN)W ′(tN)
)· h
Dr. A. Islas Numerical ODEs
![Page 51: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/51.jpg)
Euler’s Method in vector form
Or replacing the derivatives with their correspondingexpressions(
R1W1
)=
(R0W0
)+
(0.08R0 − 0.001R0W0
−0.02W0 + 0.00002R0W0
)· h(
R2W2
)=
(R1W1
)+
(0.08R1 − 0.001R1W1
−0.02W1 + 0.00002R1W1
)· h
...(RN+1WN+1
)=
(RNWN
)+
(0.08RN − 0.001RNWN
−0.02WN + 0.00002RNWN
)· h
Dr. A. Islas Numerical ODEs
![Page 52: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/52.jpg)
A plot of W vs R looks like
[C] !
0
50
100
150
200
250
0 1000 2000 3000 4000 5000 6000 7000
’tsdat.3’
Dr. A. Islas Numerical ODEs
![Page 53: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/53.jpg)
Euler’s method with h = 1 gives
0
50
100
150
200
250
0 1000 2000 3000 4000 5000 6000 7000
’tsdat.1’
Dr. A. Islas Numerical ODEs
![Page 54: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/54.jpg)
Euler’s method with h = 0.5 gives
0
50
100
150
200
250
0 1000 2000 3000 4000 5000 6000 7000
’tsdat.2’
Dr. A. Islas Numerical ODEs
![Page 55: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/55.jpg)
A Modified Euler’s method with h = 1
(R1W1
)=
(R0W0
)+
(0.08R0 − 0.001R0W0
−0.02W0 + 0.00002R1W0
)· h
0
50
100
150
200
250
0 1000 2000 3000 4000 5000 6000 7000
’tsdat.3’
Dr. A. Islas Numerical ODEs
![Page 56: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/56.jpg)
The Last Question: We have learned
A About differential equations.B How to derive simple differential equations.C How to use the linear approximation to solve them.D How we apply these ideas to systems of
equations.E All of the above.
Dr. A. Islas Numerical ODEs
![Page 57: Numerical Solution of Differential Equations · Numerical Solution of Differential Equations Dr. Alvaro Islas Applications of Calculus I Spring 2008 Dr. A. Islas Numerical ODEs](https://reader031.vdocument.in/reader031/viewer/2022022008/5ae3e94d7f8b9a90138e3a1e/html5/thumbnails/57.jpg)
The Last Question: We have learned
[E] All of the above!
Have a nice Spring Break!
Dr. A. Islas Numerical ODEs