# numerical computation

Topics: Numerical analysis, Finite difference, Simpson's rule Pages: 7 (605 words) Published: April 17, 2014
DEPARTMENT OF COMPUTER SCIENCE
FACULTY OF INFORMATION TECHNOLOGY AND APPLIED SCIENCES
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 integral. It is given by:
= (b – a)(f(a) + f(b))
2
(a) Write a MATLAB code for evaluating a definite integral using the rule. (b) Use the rule to find the numerical approximation of

2

8

What do you understand by MATLAB ?

(b)

Explain the practical procedure involved in using MATLAB.

(a)

What does the term ‘curve fitting’ mean?

(b)

9

(a)

Sketch and comment on each of the following :
(i)
(ii)
(iii)

(c )

y = ai + b, where a, b are real numbers, and i = √1
y = sin αx, where α is a constant
y = cos αx, where α is a constant

Write a MATLAB code for drawing any one of the functions in (b) above.

10
(a)
What is the basic principle involved in the use of composite Simpson’s rule as against Simpson’s rule ?
(b)
Write a MATLAB code for numerical approximation of definite integrals using composite Simpson’s rule.
11
Using real life applications, discuss explicit and implicit methods of numerical computation.
12

(a)

Explain the role of linear algebra in numerical computation.

(b)
Using example(s), explain any numerical algorithm which is based on the use of matrices.
13
Discuss the importance of a course on numerical computation in the curriculum of the Department of Computer Science, Lead City University.
14
(a)
algorithm:

Evaluate each of the following directly i.e. without using a numerical

(i)
(ii)
(b)

If y = 19x2 - 5x + 3, find dy/dx
If y = 8x3, find ∫ y dx

Evaluate the above using any numerical algorithm, and compare and contrast the results obtained.

3

15

(a)

Explain the finite difference method of numerical solution.

(b)

Let X =

and Y =

be two 3 x 3 matrices.

Write MATLAB codes to evaluate each of the following:
(i)
(ii)
(iii)

X3 + Y2
X-2 – Y-5
5X – 7XY-1 + 2

(iv)

[min (Y4)][max (X7)]

(v)

Mean (X6X-2)

4