Title | Note-8 - MU, Mo |
---|---|
Course | Numerical Analysis |
Institution | 香港科技大學 |
Pages | 2 |
File Size | 64.2 KB |
File Type | |
Total Downloads | 16 |
Total Views | 163 |
MU, Mo...
MATH 3312 Numerical Analysis Tutorial Note 8 Information TA: Email: Office Hours: Website:
8.1
Aaron Tsang wptsangaa Tue 15:30 - 17:30 and by appointment https://wptsangaa.student.ust.hk/math3312-2018f/
Initial Value Problem (IVP)
Consider the ordinary differential equation (ODE), dy = f (t, y(t)) dt y(t0 ) = y0
(1) (2)
where f = f (t, y) , and y = y(t). (1) is the differential equation and (2) is the initial condition (t0 and y0 are given values). To solve the initial value problem is to find a unknown function y(t) for t > t0 and y(t0 ) = y0 . However, analytic solutions to the differential equation (1) probably does not exist. Again, we need numerical approach to approximate the solutions and to estimate the errors.
8.2
Euler’s (Forward) Method
We replace
dy y(t + h) − y(t) to obtain with the forward difference h dt y(t + h) ≈ y(t) + hf (t, y(t))
(forward Euler)
This approximation gives y(t + h) based on the values of y(t) and f (t, y(t)) at time t with the step size h. The time domain is partitioned using a size step h. The actual solution and the approximation solution at time tk are denoted by y(tk ) and yk respectively.
tk = t0 + kh for k ≥ 0 y0 = y(t0 ) yk = yk−1 + hf(tk−1 , yk−1 ) for k ≥ 1 where t0 is the initial time.
1
MATH 3312 Numerical Analysis (Fall 2018) Tutorial Note 8
2
Example 8.1. Consider the initial value problem y dy =1+ dt t y(1) = 2
for 1 ≤ t ≤ 2
Use Euler’s method with h = 0.25 to find the numerical solution to y(2). y Let f (t, y) = 1 + , t0 = 1, and ti = 1 + 0.25i for i = 1, 2, 3, 4. t
y0 = y(1) = 2 y1 = y0 + hf (t0 , y0 ) = 2 + 0.25 · 1 +
2 1+0
= 2.75 y2 = 2.75 + hf (t1 , y1 ) = 2.75 + 0.25 · 1 +
2.75 1 + 0.25
= 3.55 3.55 y3 = 3.55 + 0.25 · 1 + 1 + 0.5 = 4.3917 4.3917 y4 = 4.3917 + 0.25 · 1 + 1 + 0.75 = 5.2691 y(t4 ) ≈ y4 = 5.2691
Exercise (1) Use Euler’s method to find the numerical solution for the initial value problem dy = y(1 − y) dt y(0) = 0.5
for 0 ≤ t ≤ 1
with h = 0.25. (2) Use Euler’s method to find the numerical solution for the initial value problem y′ + y = ty1/2 y(2) = 2 with h = 0.25.
for 2 ≤ t ≤ 3...