This course deals with solving mathematical problems using numerical techniques or approximation methods as well as provides an introduction to the use of such techniques in a selected series of problems.
The main prerequisite is basic calculus of functions of one variable and some knowledge of the use of the computer.
The main objective of the course lies in achieving an understanding of the methods of solving mathematical problems numerically with the aid of a computing tool called MATLAB, which is a powerful technical computing software.
The following content will be covered:
1 - Basic MATLAB and Programming in MATLAB
2 - Solutions of non-linear equations
3 - Interpolation and Approximation
4 - Numerical integration
5 - Monte Carlo method and Simulations
For a start, interested students may wish to download this useful set of notes I found on the Internet.
Do feel free to visit the discussion forum at: forums.delphiforums.com/weews
Some good programming tips to begin with:
1. Know the format of instructions you are using.
2. Write the instructions one sentence at a time and make sure it compiles correctly.
3. Balance your parentheses.
In a typical programming language, we will come across the following types of programming statement:
1. simple,
2. decision,
3. repetitive,
4. file-processing,
5. function (a package of instructions).
Summary:
1. Quadratic formula: The roots of are
.
2. Solution to a system of linear equations: .
3. Hero's formula: please read this link.
4. Syntax errors are errors associated with wrong instruction formats. These are easy to find because the computer will highlight them. An example of a syntax error is sin^2 x (for ) when it should have been (sin (x)).^2.
5. Logic errors are errors associated with incorrect (or unexpected) output values as a result of faulty reasoning. These are never easy to identify, because the instructions may be entered correctly in terms of format. An example of a logic error is A^(-1) (for ) when it should have been inv(A).
Summary:
1. It is useful to draw a flowchart to help us recall the steps of Newton's method.
2. Before we apply Newton's method, it is important to form the function .
In Ex. 4.2 Q3, several possibilities of f are:
(a) (why is this function unsuitable?),
(b) ,
(c) .
Do check, by running the program in the text, to see if the other two functions would produce the root after several iterations.
3. For a solution to be determined to an accuracy of n significant figures, we may need to define .
Question 1
(b) Value of the limit was not a constant.
(c) Wrong value of i, because limit was not a constant.
Used a for-loop in the program.
Logic error.
Question 2
(b) Did not use output to explain how the fare charges were computed.
(c) Did not give a complete explanation.
Note to TG2 & TG3: If I have penalised you in Q2(a), please bring along your script and see me to add one mark at the next lesson. Sorry for the inconvenience.
Preliminaries
1. This is the flowchart of Secant method:
2. Example 4.4: Suggested working to be shown when performing computations by hand.
Given: ,
.
Applying the Secant method, we have the following iterations.
,
,
.
So there is a root within the interval , by IVT.
,
,
.
,
,
.
,
,
.
,
,
.
.
Hence the root is 1.32 (correct to 2 decimal places).
3. Flowchart showing the Fixed Point Iteration method:
4. Example 4.5: Suggested working to be shown when performing computations by hand.
Given: ,
.
We calculate the first five iterations using six decimal places.
.
.
.
.
.
Hence the root is 1.732051 (correct to 6 decimal places).
5. Corollary 4.3 is an important result that determines whether an iteration method will converge or not. When the derivative of g at alpha is 1, no conclusion can be drawn.
Exercise 4.4
1. In Q4, we saw that iterative method (b) has and iterative method (c) has
. We then concluded that method (c) converges faster than method (b). The reason for this conclusion comes from the proof of Theorem 4.2 (2) on page 67 of text, which has the following result:
, where
. Thus, the smaller the value of
the faster the convergence.
2. In Q5(b), we consider and attempt to show that it will be greater than 1, to explain why the scheme will not converge.
3. In Q6, the choice of can be made based on the consideration of
, from which we solve an inequality involving
.
Comments about order of convergence
1. We look at the error expression when we wish to analyse order of convergence.
2. On page 47 of text, we see the error expression of bisection method:
,
from which we say that the order of convergence is 1.
3. On page 54 of text, we see the expression (4.6) of Newton's method:
,
from which we say that the order of convergence is 2, since the error in varies proportionally to the square of the error in
.
4. In Q4 of Exercise 4.3 on page 60 of text, we see the expression (4.11) of Secant method:
,
from which we say that the order of convergence is 1. In actual fact, the order of convergence is precisely (the value of golden ratio). Read this link for more details.

I wish all muslim students a very happy Hari Raya Adil Fitri!
Preliminaries
1. In Q5 of Exercise 5.1, do plan your MATLAB program first before coding. A suggested outline is given below.
% (1) Initialise all required row matrices.
% (2) Compute coefficients of L0, L1, L2.
% (3) Compute coefficients of P(x).
% (4) Compute P(x) and f(x) for all data points of x.
% (5) Print P(x), f(x) and E(x).
% (6) Plot graph of E(x) against x.
2. For Q1(b), (c) and Q2, you may need to solve a system of equations to find the unknowns.
Here is a set of practice questions for you to work on. Jiayou!