FACULTY OF INFORMATION TECHNOLOGY AND APPLIED SCIENCES

LEAD CITY UNIVERSITY, IBADAN

FIRST SEMESTER, 2013/2014 ACADEMIC SESSION

LECTURER-IN-CHARGE: PROF. B. A. OLUWADE

CSC 403: NUMERICAL COMPUTATION II (with MATLAB)

TUTORIAL QUESTIONS

1

(a)

What do you understand by the Euler method ?

(b)

Let y/ = 3y + 1 y(0) = 2

be an initial value problem. Using Euler method, present an approximation of y(5) using a step size of 1.

2

(a)

State Simpson’s rule.

(b)

Write MATLAB code for finding the numerical approximation of a definite integral using (a) above.

3

(a)

Write the meaning of the following MATLAB commands and illustrate with at least one example each:

(i)

(ii)

(iii)

(iv)

(v)

(vi)

(vii)

(viii)

(ix)

(x)

ceil (x) round (x) floor (x) fix (x) eye zeros ones rem (x, y) fprintf xlabel ( )

(b)

With the aid of examples, explain the meaning and order of evaluation of arithmetic operators and expressions in MATLAB.

1

(a)

Write a MATLAB code for evaluating sin(x)2 + cos(x)2

(b)

4

Write a MATLAB code for drawing the following : y(x) = sin(3x)

3x

for -5 ≤ x ≤ 15

5

(a)

Write a MATLAB code for finding the approximate solution of an initial value problem using the Euler method.

(b)

The midpoint rule, otherwise referred to as the rectangle method, is an algorithm for computing an approximation to a definite integral by finding the area of a collection of rectangles whose heights are determined by the values of functions within the integral . This rule is given by

≈ (b – a) f a + b

2

where a and b are the endpoints and f(x) is a function. Write a MATLAB code for approximating a definite integral using the rule.

6

(a)

Present a geometrical interpretation of Simpson’s rule.

(b)

Find the numerical approximation of

using Simpson’s rule.

7

The trapezoidal rule is one of the algorithms for finding the approximate solution of a definite