Tutorial 8 - Mar4-7
Tutorial 8 - Mar4-7
1
INTRO DU CTION (1)
❖Let us consider,
𝑑𝑦
= y′ = f (x, y)
𝑑𝑥
❖with the initial condition,
y(x0) = y0
❖The methods we know, in general will yield the solution in one of the two forms:
o A series for y in terms of powers of x, from which value of y can be obtained by direct
substitution
Examples are Taylor and Picard methods
o A set of tabulated values of x and y.
Examples are Euler, Runge-Kutta methods.
3
INTRO DU CTION (3)
❖ Theseare also called step-by-step methods or marching methods, because values of y are
computed by short steps ahead for equal intervals h of the independent variable.
❖ The interval length h should be kept small and hence these methods can be applied for
tabulating y over a limited range only.
❖A differential equation of the nth order will have n arbitrary constants in its general solution.
❖ In order to compute the numerical solution of such an equation, we need n conditions.
❖ Problems in which all the initial conditions are specified at the initial point only are called initial
value problems.
❖ Inproblems involving second and higher order differential equations, we may prescribe the
conditions at two or more points. These are called boundary value problems.
4
EU LER’S METHOD(1)
❖ We so far discussed methods which yield the solutions of a differential equation in the form of
power series. Euler’s method gives solution in the form of a set of tabulated values.
❖ Suppose wee want to solve these equations
𝑑𝑦
= y′ = f (x, y), with the initial condition y(x0) = y0
𝑑𝑥
for values of y at x = xr = x0 + rh (r = 1, 2, …).
𝑥
❖ Integrating the above equation we get, 𝑦1 = 𝑦0 + 𝑥1 𝑓 𝑥, 𝑦 𝑑𝑥
0
❖ Assuming that f (x, y) = f (x0, y0) in x0 ≤ x ≤ x1, this gives Euler’s formula.
y1 ≈ y0 + hf(x0, y0)
𝑥
❖ Similarly for the range x1 ≤ x ≤ x2, we have 𝑦2 = 𝑦1 + 𝑥2 𝑓 𝑥, 𝑦 𝑑𝑥
1
5
EU LER’S METHOD(2)
6
MODIFIED EU LER’S METHOD
𝑥
❖ Instead of approximating f(x, y) by f(x0, y0) in 𝑦1 = 𝑦0 + 𝑥1 𝑓 𝑥, 𝑦 𝑑𝑥, let us approximate the
0
integral in the expression using Trapezoidal rule and obtain,
ℎ
y1 ≈ y0 + [f (x0, y0) + f (x1, y1)]
2
❖ We then obtain the iteration formula
ℎ
y1 (n+1) = y0 + [f (x0, y0) + f (x1, y1(n))], where n = 0, 1, 2, 3, ….
2
where y1(n) is nth approximation to y1.
❖ This iteration formula can be started by choosing y 1(0) from Euler’s formula:
y1(0) = y0 + hf (x0, y0)
7
B U T WA I T …
A GRAP H SHOW IN G
THE C OM PARI SO N
B ETWEEN THE
EX ACT SO LU TIO N
A ND THE SO L UTIO N
O BTAIN ED USIN G
EU LER' S METHO D
FO R DI FFERENT
STEP SIZES
9
EX AMPLE
10