Numerical methods and F90 programming

This course will introduce some of the most common and often relatively simple methods of numerical analysis e.g. for solving equations, evaluating integrals, solving differential equations etc. In addition, the Fortran 90/95 programming language is discussed and used in example programs.

This is not an actual programming course, and structures and properties of the language are explained in a very compact form. Therefore, some prior experience in programming in some language is required.

There will be no exam. Instead, to pass the course, you have to do some practical exercises and a somewhat larger final programming task using the F90/95 language.

Final lectures will be on Wednesdays Dec 9 and if needed on Dec 16. No lectures on Mondays any more.

From January 1 till the end of 2016 I'll be on a leave, and then retire. During the spring 2016 I'll still read my email every now and then and can check the final tasks of the course. However, that may take some time. If you want the credits faster, please submit the job before Christmas.


  • Notes about the current course
  • Litterature
  • Final exercise: instructions and possible topics Read this if you you will not attend the lectures!
  • More about Fortran and links to libraries


    Demo programs

    Here are some programs, not necessarily discussed in lectures, which may be useful in some exercises. You can use and modify these programs freely but at your own risk. There is no guarantee that they will work in all cases nor that I have time to update them. However, if you find errors, let me know.


    Other auxiliary material

    Graphics library pgplot is a subroutine package that can be linked to a user program and used to produce all kinds of graphics.

    Pgplot manual (a lot of text in English)


    Exercises

    Exercises will change annually. Here you can find the exercises for the current course, and later also their solutions, and a table of credits earned (coming soon, later this week).

    In some exercises yoy will need data files that are here.


    Contents of lectures

    Topics to be discussed in the lectures are included in the following pdf files. Correspondence between the files and lectures is not, however, one-to-one. The material has been divided into files according to the content (so that this can also be used as a very primitive handbook or selfstudy guide). Lectures will mix numerical analysis and programming as needed.

    Numerical methods

    Basic concepts - Machine representation of numbers
    - Error propagation in arithmetic operations
    - Finite precision

    Equation solving
    - Direct iteration
    - Interval halving
    - Regula falsi
    - Secant method
    - Newton's method
    - Roots of a polynomial equation - Sets of equations
    - Precision of the solution

    Linear sets of equations
    - Gaussian elimination
    - LU decomposition
    - Determinant
    - Inverse matrix
    - Iterative methods

    Eigenvalues
    - Basic concepts
    - QR decomposition
    - Householder transform
    - Givens rotations
    - QR algorithm

    Fitting a function to data 1
    - Taylor series
    - Pad\'e approximation
    - Interpolation polynomials
    - Spline functions
    - Bezier curves

    Fitting a function to data 2
    - Least squares method

    Numerical integration
    - Riemannian sum
    - Trapezoidal rule
    - Simpson's rule
    - Romberg method
    - Newton-Cotes methods
    - Gaussian quadrature
    - Monte Carlo integration

    Numerical differentiation

    Random numbers
    - Uniform distribution
    - Other distributions

    Ordinary differential equations, initial value problems
    - Basic concepts
    - Taylor series method
    - Single step methods
    - Euler's method
    - Explicit and implicit methods
    - Runge-Kutta method
    - Multistep methods
    - Adams method
    - Predictor--corrector methods
    - Boundary value problems
    - Shooting method
    - Difference method
    - Characteristic value problems

    Partial differential equations
    - Basic concepts
    - Difference methods / elliptic equations
    - Difference methods / hyperbolic equations
    - Difference methods / parabolic equations
    - Element methods (FEM)

    Fourier transforms
    - Basic concepts
    - Discrete transform
    - Convolution and deconvolution
    - Sampling theorem and Nyquist frequency
    - FFT
    - Finite or unequally spaced data

    Digital filters

    Time series

    Optimisation
    - Basic concepts
    - Local optimisation
    - Line search
    - Conjugate gradient method
    - Global optimisation
    - Nelder-Meade method

    Inversion problems

    Image processing

    F90

    Background 1
    - Algorithms

    Background 2
    - History of Fortran
    - Basic concepts of programming languages

    Basic components
    - Simple variables
    - Basic control structures
    - Input and output

    Procedures
    - Functions and subroutines
    - Local and global variables of procedures
    - Parameters of procedures
    - Recursive procedures
    - Keyword parameters and optional parameters

    Arrays
    - Declaration of arrays
    - Array operations

    Miscellanea
    - Strings
    - Own data types
    - Dynamic allocation of tables

    Input and output
    - Formats
    - Error control
    - Binary I/O
    - Direct access files
    - Namelist

    Pointers

    Interface block
    - Function as a parameter

    Variable declaration, summary

    Modules
    - Module
    - Generic procedures
    - Operator overloading
    - Operations of own data types

    Overall structure of programs

    Parallel programming
    - Basic concepts
    - Protecting variables
    - Synchronisation
    - Dependences
    - HPF
    - MPI

    Subroutine libraries

    Fortran 77

    Good programming style
    - Top-down method
    - Programming style
    - Instructions for exercises