Professional Documents
Culture Documents
Numerical Solution of Ordinary Differential Equations: Spring Semester 2016
Numerical Solution of Ordinary Differential Equations: Spring Semester 2016
Numerical Solution of Ordinary Differential Equations: Spring Semester 2016
Department of Mathematics
Prof. Dr. Shamsul Qamar
Exercise Sheet 1
Due date 29.02.2016 in the lecture.
Exercise 1 [8 marks]
(a) Calculate with Euler polygon method the approximate solution of
dy
1
= x + 2y,
y(1) =
dx
2
at the interval x [1, 2] with step size h = 0.1. Compare your numerical results with exact
solution. Plot both exact and numerical solutions.
(b) The result of Euler method can become better if apart from first order derivative of y one
also use the second order derivative. Hence for calculating y(x + h) one has to use the first
three terms of Taylor-expansion
h2
y (x) + . . . .
2!
Program this modified Euler-method for the differential equation given in part (a) and compare your results.
y(x + h) = y(x) + hy (x) +
y(0) = 1.
Calculate the value y(1/2) numerically with Euler-method. Use the step sizes h = 2k , k =
1, 2, . . . , 12. Calculate the corresponding error at x = 1/2.
(b) Consider the initial value problem
y (x) = f (y)
y(0) = y0 .