Numerical Methods I

January 2011

The course has a programming component using MATLAB. Maple may also be used in a few places.

**Textbook:** Numerical Mathematics and Computing,
**6th Edition**

**Authors:** Ward Cheney and David Kincaid

**Publisher:** Thomson (Brooks/Cole)

**Prerequisite:**
MATH 1037, MATH 1057, MATH 2066, COSC 1046 or ENGR 1077

**Instructor:** Dr. B.G. Adams

**Office:** FA-378

**Phone:** 675-1151 x 2323

**Email:** badams 'at' cs.laurentian.ca

**Note:** Only send messages using your university email address

**Lecture Times:** Tue, Thur: 8:30 am - 9:45 am

**Room:** C-112

Best 4 of 5 assignments 20% Jan 21, Feb 4, Mar 4, Mar 18, Apr 1 2 Term tests (15% each) 30% Feb 15, Mar 24 Final exam (3 hours) 50% Scheduled by registrar

- Machine representation of floating point numbers.
- Absolute and relative roundoff error
- loss of significance theorem and Matlab examples
- Taylor series approximations to functions. Convergence of Taylor series.
- Numerical examples of series summation and convergence using MATLAB.
- The derivative problem using limit definition
- Recurrence relations. Stable and unstable recurrence relations. Backward iteration. MATLAB examples.
- Convergence rates for iterative methods. Examples of slow and fast convergence. MATLAB examples.

- Bisection method and fixed point iteration and onvergence analysis.
- Newton and secant methods and convergence analysis.
- Writing MATLAB functions for root finding methods
- The MATLAB fzero function.
- Applied examples using MATLAB

- Efficient evaluation of polynomials. Lagrange form of interpolating polynomials.
- Newton form of the interpolating polynomials.
- Algorithms for calculating the Newton form based on a divided difference table.
- Writing MATLAB functions for interpolation
- Errors in polynomial interpolation.
- The Runge phenomenon
- Using Chebyshev polynomials for better approximations.
- Estimating derivatives numerically using Richardson extrapolation.
- Obtaining derivative formulas from interpolating polynomials.
- Built-in MATLAB functions for interpolation.

- Riemann integral definition using upper and lower sums.
- Trapezoidal and Simpson rules, composite rule, algorithm, Matlab functions, error analysis.
- Recursive trapezoidal formula, the Romberg extrapolation method, algorithm, MATLAB function.
- Gaussian integration (quadrature)
- Applied examples using MATLAB

- Brief review of linear algebra, matrix and vector operations, determinants, and the solution of linear systems of equations using row reduction methods. Matrix inverse using row reduction methods.
- Solving
`Ax = b`

when`A`

is an upper triangular or lower triangular matrix, algorithms. - The general case
`Ax = b`

using gaussian elimination to upper triangular form and back substitution. - Naive Gaussian elimination, algorithms, complexity. Eliminating zero pivot elements.
- Roundoff error examples in solution of
`Ax = b`

. - Reducing roundoff error using maximal column pivoting and scaled column pivoting, algorithms, MATLAB fnuctions. Using pivot vectors (permutation vectors) to avoid explicit row exchanges.
- Separating the Gaussian elimination part from the back substitution part, algorithms and MATLAB functions.
- LU factorization (
`A = LU`

) using naive Gaussian elimination. Solving`Ax = b`

using LU factorization, forward substitution and backward substitution, algorithms and MATLAB functions. - LU factorization (
`PA = LU`

) using maximal column pivoting and the permutation matrix`P`

(defined by pivot vector) to obtain the LU decomposition of`PA`

, algorithms and Matlab functions. - Efficient calculation of the matrix inverse and determinant using the LU factorization.
- Ill-conditioned matrices and the condition number. Examples using Hilbert and Vandermonde matrices.

- Brief review of first order DE's
`x'(t) = f(t,x)`

and systems of DE's. Geometric interpretation of a first order DE. - Using DFIELD and PPLAT to solve and graph DE's
- Euler's method for the initial value problem
`x'(t) = f(t,x)`

,`x(t`

. Local and global truncation errors, algorithms and Maple procedures._{0}) = x_{0} - Higher order Taylor series methods, algorithms and MATLAB functions.
- Runge-Kutta methods. Derivation of 2nd order and the classical 4th order methods, algorithms, MATLAB functions.
- The 4th order Runge-Kutta method for a system of first order
differential equations, algorithm and Maple procedure for the
case of a system of two equations
`x'(t) = f(t,x,y)`

and`y'(t) = g(t,x,y)`

. - Case study: The "rabbits and foxes" problem as a dynamical system of two first order DE's, closed solution curves and population curves as functions of time, obtained using the 4-th order Runge-Kutta method for systems.
- Built-in MATLAB functions for solving systems of first order DE's.

Sample Title Page (doc file)

assign1.pdf
(solutions1.html)

assign2.pdf
(solutions2.html)

assign3.pdf
(solutions3.html)

assign4.pdf
(solutions4.html)

assign5.pdf
(solutions5.html)

Test 1 study guide

Term test 1 solutions

Test 2 study guide

Term test 2 solutions

Final exam study guide

Practice Exam

Scripts from tutorial: fact.m falling_object.m quad_script.m sq_root1.m sq_root2.m sq_root3.m

roundoff1.m Roundoff error accumulation

machine_eps.m Calculating the machine epsilon

roundoff2.m Loss of significance in subraction

roundoff3.m Elimination of loss of significance

sin1.m sin2.m sinf.m x - sin x

logsum1.m Slow series for log(2)

logsum2.m Fast series for log(2)

deriv.m Approximating the derivative of a function using the limit definition from calculus.

recurrence1.m stable recurrence relation

recurrence2.m unstable recurrence relation

recurrence3.m backward recurrence relation

slowroot.m slow recurrence relation

fastroot.m fast recurrence relation

newton.m Newtons method

secant.m Secant method

fpoint0.m, fpoint.m Fixed point iteration method

annuity.m Annuity example

fzero_test.m Using the Matlab fzero function

cable.m Suspended cable example

beam_example.m Beam example

floating_sphere.m Finding the depth of a floating sphere

interp_poly.m Using the Matlab polyfit and polyval functions

lip.m Evalaute lagrange interpolating polynomial

newton_table.m Newton divided difference table

newton_table_test.m Example of Newton divided difference table

newton_poly.m Coefficients of the newton polynomial

newton_eval.m Evaluating Newton polynomial at a point

linear_table.m linear interpolating table for exp(x)

quad_table.m quadratic interpolating table for exp(x)

runge.m Runge phnomenon

richardson.m Richardson extrapolation table for derivative

richtest.m Richardson extrapolation example

trap.m Trapezoidal rule

traptest.m Trapezoidal rule example

simp.m Simpson's rule

simptest.m Simpson's rule example

romberg.m Romberg table

rombergtest.m Romberg examplee

gauss2.m 2nd degree gaussian integration

gauss3.m 3rd degree gaussian integration

gauss_test.m gaussian example

quad_test.m Test of Matlabs' quaud function

ngausstest.m Example of Naive gaussian elimination

zgauss.m Eliminating zero pivots

zgausstest.m Example of zgauss

mgauss.m Maximal column pivoting

mgausstest.m Example of mgauss

sgauss.m Scaled partial pivoting

sgausstest.m Example of sgauss

gauss.m Gaussian elimination only

gaussSolve.m Solving systems using gauss

gausstest.m Example of gauss and gaussSolve

truss.m Example of gauss and gaussSolve for a truss

nluFactor.m Naive lu factorization

nluSolve.m Solving system using nluFactor

nlutest.m Example of nluFactor and nluSolve

luFactor.m lu factorization using scaled partial pivoting

luSolve.m Solving system using luFactor

lutest.m Example of luFactor and luSolve

inverse.m Computing inverse using gauss and gaussSolve

euler_test1.m Example of Euler's method

taylor4.m 4th order taylor method

taylor4_test1.m Example of 4th order Taylor method

rk2.m 2nd order Runge-Kutta method

rk2_test1.m Example of 2nd order Runge-Kutta method

rk4.m 4th order Runge-Kutta method

rk4_test1.m Example of 4th order Runge-Kutta method

vibration.m ode45 function for mx'' + cx' + kx = F(t)

vibration_test.m Example of vibrations using ode45

pendulum.m Non-linear pendulum system

pendulum_test.m Example of pendulums using ode45

rabfox.m Predator-prey function

rabfox_test.m Example of predator-prey using ode45