Numerical Methods (M. Phil. ACEP)
From LAGWiki
Contents |
[edit] Lecturer
EMail: jfh36@cam.ac.uk
office location: G3B
Example classes: Dr Bart Hallmark and Dr. Sinéad Matthews
EMail: bh206@cam.ac.uk and smm58@cam.ac.uk
[edit] Lectures
During MT 2008
[edit] Course Overview
In this course, we aim to examine the sorts of problems you might encounter in chemical engineering. Very often, these problems will prove too complex to solve by hand, so we will need to resort to using a computer. From the outset we will be thinking about how to write computer programs to solve them. Some (or even most) of the mathematics you may have seen before in an undergraduate course. However, you will probably not have had the chance to program the solutions yourselves. Running in parallel with the course is a series of exercise classes, in which students are required to solve relatively complex problems.
The course will use the Matlab programming language.
The layout of the course described in the table below:
|
Topics |
Theme | Lectures(Approx.) | Exercises |
|
Linear Equations and Matrices Elimination methods for solving linear equations Large, sparse linear equations Iterative methods for solving linear equations |
Linear Equations | 4 |
1. Programming in Matlab 2. Modelling a distillation column |
| Solving non-linear equations | Non-linear equations | 3 | 3. More advanced modelling of a distillation column
4. Velocity profiles of non-Newtonian fluids. |
| Initial values problems | Ordinary differential equations | 3 | 5. Modelling a reactor |
| Numerical solution to partial differential equations
The transport partial differential equation An example on solving the transport PDE |
Partial differential equations | 3 | 6. Heat conduction and reaction in a sphere
7. The heating up of a fluid in a heat exchanger tube. |
| Fitting models to measurements
Analysis of variance |
Data analysis | 1 | . |
| Examples of Chemical Engineering Applications | CFD & Electrochemistry | 2 | . |
[edit] Useful links
The Mathworks website contains numerous help files for using Matlab. You may find Getting started in Matlab useful. This is also available in the help file when you run Matlab on the departmental computers.
[edit] Useful Books
Numerical Recipes contains information all aspects of numerical methods (But, be warned that all code is in C++ or Fortran). It is available online at http://www.nr.com/
"Numerical Methods for Chemical Engineers with Matlab Applications" by Constantinides and Mostoufi
[edit] Lecture Material
[edit] Linear Equations
[edit] Handout 1
Lecture Handout - Useful linear algebra and linear equations,
Handout 1
[edit] Handout 2
Lecture Handout - Elimination methods for solving linear equations,
Handout 2
- Example on Gaussian elimination used in lectures
- Gaussian Elimination routine,
GaussianEliminate.m
- A routine which will perform LU decomposition of a square Matrix,
LUdecomposition.m
[edit] Handout 3
Lecture Handout - Sparse systems of linear equations,
Handout_3
- Code to find the velocity profile for a Newtonian fluid in a pipe,
ViscousFlow.m
- Same code, but now employing sparse matrices,
ViscousFlow_Sparse.m
- Routine which uses the TDMA (Tri-diagonal matrix) method to solve a Ax = b,
TDMA.m
[edit] Handout 4
Lecture Handout - Iterative methods for solving linear equations,
Handout_4.pdf
- The solution to the steady heat conduction problem in a slab,
Laplace.m
- Solution to the same problem, this time using Jacobi iteration,
Laplace_Jacobi.m
[edit] Non-linear Equations
[edit] Handout 5
Lecture Handout - Non-Linear Equations,
Handout_5.pdf
- A routine which uses Newton's method to solve a one-dimensional non-linear equation,
Newton1D.m
- A routine which uses Newton's method to solve an N-dimensional set of non-linear equations,
Newton.m
- A routine which uses Newton's method (but with the ability to reduce the step length) to solve an N-dimensional set of non-linear equations,
NewtonReduced.m
- Scripts with interactive starting points and plotting of the solution.
Newton2DtestLectureDemo.m
Newton2DtestLectureDemoReduced.m
NewtonTrajectory.m
NewtonReducedTrajectory.m
- The solution to the equilibrium problem (reforming of methane) covered in handout 5. This routine will need to call the NewtonReduced routine,
EquilibriumWeb.m
[edit] Ordinary Differential Equations
[edit] Handout 6
Lecture Handout - Initial value problems,
Handout_6
- A routine which uses the Explicit Euler method to solve a single ODE,
Euler.m
- A routine which uses the Implicit Euler method to solve a single ODE,
EulerImplicit.m
- A routine which uses the Explicit Euler method to solve a system of coupled ODEs,
EulerCoupled.m
- A routine which uses the Implicit Euler method to solve a system of coupled ODEs,
EulerCoupledImplicit.m
- A routine which uses a 4th order Runge-Kutta method to solve a system of coupled ODEs,
RungeKutta_Order4_Coupled.m
[edit] Handout 7
Lecture Handout - Using the Matlab ODE solvers,
Handout_7
- Code for example 1,
ODEexample1_Handout_7.m
- Code for example 2,
ODEexample2_Handout_7.m
- Code for example 3,
ODEexample3_Handout_7.m
[edit] Partial Differential Equations
[edit] Handout 8
Lecture Handout - Partial differential equations,
Handout_8
- Function to solve the transient heat conduction problem (2D slab),
HeatConduction.m
- Main program calling the routine above,
Demo_HeatConduction.m
[edit] Handout 9
Lecture Handout - The generalised transport PDE,
Handout_9.pdf
[edit] Handout 10
Lecture Handout - Solving a transport PDE,
Handout_10.pdf
- Code to solve the transfer of heat to flowing fluid, full PDE version,
Tube_PDE.m
- Code to solve the transfer of heat to flowing fluid, steady state,
Tube_SteadyState.m
- Code to solve the transfer of heat to flowing fluid, steady state, 4 segments,
Tube_SteadyState_4segments.m
- Code to solve the transfer of heat to flowing fluid, steady state upwind scheme,
Tube_upwind.m
[edit] Analysing Data
[edit] Handout 11
Lecture Handout - Data Fitting and Regression,
Handout_11.pdf
- Function performing a least square fit and calculating confidence intervals,
fitcubic.m
- Main program, calling the routine above,
script.m
- Subroutine to generate noisy data set,
testdata.m
