Polska wersja

Numerical Differential Equations


winter semester 2017-18

Time: Tuesday lecture 1415-1545 room 1780 and classes/lab 1605-1735 room 1780 or computer lab 3044 (MIMUW bdg., Banacha 2 - entrance - Pasteura Street)

Conference

Supercomputing Frontiers 2018, ICM University of Warsaw, Warsaw, March 12-15, 2018. Students conference fee: 100PLN. I am encouraging everybody to participate - specially those interested in real computations (not only of numerical problems).
The dates of the oral exam (II term): Mon 19, 2018 10am-1pm room 5010 (the oficial schedule) and Wednesday Feb 21, 2018; 11am-12pm room 5010 Note the change of the room.

Exam questions

  1. One step schemes. Examples and convergence theory
  2. Multistep schemes . Examples including Adams schemes. Convergence theory.
  3. Stiffness. Definition. Examples of ODEs. Idea of adaptive step control.
  4. Finite difference method for elliptic equation in 1D and 2D. 1D Example: - u''+u=f u(a)=u(b)=0 and detailed convergence analysis of this problem in a discrete maximum norm
  5. Finite difference method for elliptic equations. 2D Example: -Laplacian u=f , u=0 on boundary. Abstract convergence analysis: the order of local truncation error and stability. Discrete convergence - definition and Lax theorem.
  6. Idea of Finite Element Method. Analysis of convergence of linear finite element in 1D for -u''=f, u(a)=u(b)=0.
  7. Elements of abstract FEM theory: Lax Milgram theorem. Cea Lemma. Application to 2d elliptic boundary problem with homogeneous Dirichlet boundary element.
  8. FEM and different boundary conditions for 2nd order elliptic boundary problem: Dirichelt, Neumann, Robin, mixed. (it is not discussed in Lect Notes. I discussed it during a lecture but I will not ask this question unless somebody choose it)
  9. Elements of abstract FEM theory: continuous FEM spaces, affine families of FEM spaces, shape regularity etc
  10. Schemes for parabolic differential equations: FDM and FEM in 1D or 2D - an idea, some properties - no proofs (as in the lecture notes or as was presented in the lecture)
  11. Basic explicit finite difference schemes for hyperbolic PDEs. Stability and consistency.
  12. Pure Neumann boundary conditions for elliptic problems. How to solve it using FEM. How to solve the singular linear problem arising there. (optional)
    optional - means that this question may be asked only with a student consent

Link to current lab
Evaluation: an oral exam.

Syllabus

Numerical methods for
  1. ordinary differential equations (ODEs)
  2. elliptic partial differential equations (PDEs)
  3. evolutionary PDEs (parabolic and hyperbolic of first order)
the following classes of methods are going to be discussed
  1. one-step and linear multi-step schemes for initial ODEs problems
  2. finite difference method
  3. finite element method
There are some computer labs (instead of standard "blackboard" classes)

The course is elementary - it is required to know the basics of liner algebra, mathematical analysis and theory of ODEs.

It is not necessary to have any knowledge from PDEs theory all necessary facts will be given during our course

There are lecture notes for this course in Polish.

Lecture notes

(In Polish) Leszek Marcinkowski, Numeryczne równania różniczkowe, 2010.
Published on-line: WWW page (there is a link to pdf file with the lecture notes).
Pdf file with the newest version of the notes.
Please, send me an e-mail with comments if you find any errors, typos etc,

References

Text books

  1. Deuflhard, Peter, Bornemann, Folkmar, Scientific Computing with Ordinary Differential Equations, Series: Texts in Applied Mathematics, Vol. 42, Springer-Verlag, New York, 2002. (theory of ODEs, ODE schemes, Boundary Value Problems in 1D) One can download a pdf file from MIMUW computers (valid Dec 2014): Springer link
  2. David F. Griffiths, Desmond J. Higham, Numerical Methods for Ordinary Differential Equations, Springer-Verlag, 1st Edition, London, 2010. An elementary textbook on ODE schemes. One can download a pdf file from MIMUW computers (valid Dec 2014): Springer link
  3. Claes Johnson, Numerical solution of partial differential equations by the finite element method, Cambridge University Press, Cambridge, 1987.
  4. Randall J. LeVeque, Finite difference methods for ordinary and partial differential equations, Society for Industrial and Applied Mathematics (SIAM), Philadelphia, PA, 2007, Steady-state and time-dependent problems. (numerical schemes for ODES, finite difference methods for elliptic and parabolic PDEs)
  5. Alfio Quarteroni, Riccardo Sacco, and Fausto Saleri, Numerical mathematics, Texts in Applied Mathematics, vol. 37, Springer-Verlag, New York, 2000. (numerical schemes for ODEs and some PDES - hyperbolic nad parabolic) One can download a pdf file from MIMUW computers (valid Dec 2014): Springer Link
  6. John C. Strikwerda, Finite difference schemes and partial differential equations, second ed., Society for Industrial and Applied Mathematics (SIAM), Philadelphia, PA, 2004. (FD schemes for PDEs - all types)

Monographs or advanced text books

  1. Dietrich Braess, Finite elements, third ed., Cambridge University Press, Cambridge, 2007, Theory, fast solvers, and applications in elasticity theory, Translated from the German by Larry L. Schumaker. (advanced text book)
  2. Susanne C. Brenner and L. Ridgway Scott, The mathematical theory of finite element methods, third ed., Texts in Applied Mathematics, vol. 15, Springer, New York, 2008.
  3. J. C. Butcher, Numerical methods for ordinary differential equations, second ed., John Wiley and Sons Ltd., Chichester, 2008.
  4. P. G. Ciarlet and J.-L. Lions (eds.), Handbook of numerical analysis. Vol. II, Handbook of Numerical Analysis, II, North-Holland, Amsterdam, 1991, Finite element methods. Part 1.
  5. Philippe G. Ciarlet, The finite element method for elliptic problems, Classics in Applied Mathematics, vol. 40, Society for Industrial and Applied Mathematics (SIAM), Philadelphia, PA, 2002, Reprint of the 1978 original [North-Holland, Amsterdam].
  6. E. Hairer, S. P. Norsett, and G. Wanner, Solving ordinary differential equations. I, second ed., Springer Series in Computational Mathematics, vol. 8, Springer-Verlag, Berlin, 1993, Nonstiff problems.
  7. E. Hairer and G. Wanner, Solving ordinary differential equations. II, second ed., Springer Series in Computational Mathematics, vol. 14, Springer-Verlag, Berlin, 1996, Stiff and differential-algebraic problems.
  8. Bosko S. Jovanovich, Endre Suelli, Analysis of Finite Difference Schemes For Linear Partial Differential Equations with Generalized Solutions, Springer Series in Computationam Mathematics, volume 46, Springer , 2014. Springer link (not available on MIMUW servers)
  9. Alfio Quarteroni and Alberto Valli, Numerical approximation of partial differential equations, Springer Series in Computational Mathematics, vol. 23, Springer-Verlag, Berlin, 1994. (FD schemes and FE for PDEs) One can download a pdf file from MIMUW computers (valid Dec 2014):
  10. Springer Link
  11. J. W. Thomas, Numerical Partial Differential Equations, Finite Difference Methods, Texts in Applied Mathmematics, volume 22, Springer, 1995. Springer link (valid Nov 2016)

LAB

link to Octave (one can download linux or windows version of octave)
octave-forge - octave extension

octave manual in html
  • Lab 1 (1st two weeks of classes) Introduction to octave. Euler's schemes
    m-file with explicit Euler scheme and a script with some tests:
    eulero17.m - explicit Euler scheme (as written on the board Oct 2, 2017)
    eulerz17.m - implicit Euler scheme - works at least for the nonlinear 2d pendulum ODE - look at the source - there are examples of a use (commented out)
    exEuler.m - explicit Euler scheme (in many dimensions) - old tested version
    testexEul.m - basic tests of explicit Euler scheme (in 1D and 2 D)
  • Lab 2 - Function lsode() in octave and simple ODE schemes cont. (Tue Oct 23, 2017) In multistep ODE schemes take x_1,x_2 etc as exact solutions if not take x_k k=1,..,p- p-1 computed by using some explicite 1-step method of the same order e.g. Taylor scheme for midpoint one.
  • Lab 3 Experimental testing the order of ODE schemes cont. Testing starting for multistep schemes (for 2-step Adams-Bashforth). (Oct 31, 2017)
    adamsb2s17.m - explicit Adams-Bashforth scheme (of order 2)
    testadamsb2s17.m - tests of explicit Adams-Bashforth scheme (of order 2)
    Taylor.m - explicit onestep Taylor scheme (of order 2)
    modEuler.m - explicit onestep modified Euler - Runge-Kutta scheme of order 2
    testAB2start.m - tests starting value (x^h_1) for explicit Adams-Bashforth scheme (of order 2)
    testmodEul.m - tests for modified Euler scheme (explicit Runge-Kutta scheme of order 2)
    LTEtests.m - tests for order of local truncation error for some schems e.g. explicit/implicit Euler
  • Lab 4 (Nov 14 and 21, 2017)- Finite difference method (FDM) for -u''+bu'+ cu=f with Dirichlet bnd cond : u(a)=alpha u(b)=beta and for mixed bnf conditions: u'(a)=alpha u(b)=beta
    linshoot17.m -m-file with a function linshoot17() solving the linear boundary value ODE problem: -y''+p(x)y+q(x)y=f(x); y(a)=alpha y(b)=beta using shooting method
    linshoot16.m -m-file with a function linshoot16() solving the linear boundary value ODE problem: -y''+p(x)y+q(x)y=f(x); y(a)=alpha y(b)=beta using shooting method (old version)
    testshoot.m -shooting method for linear boundary value ODE problem: -y''+c(x)y=0; y(0)=1 y(b)=1 (b=1 - shooting works fine, b=20 - shooting does not work at all - why?)
    shootexample16.m -script with a function solving the boundary value ODE problem: y''=y^2; y(0)=1 y(1)=-4 using shooting method (fsolve() as a nonlinear solver) - note that there are 2 different solutions!
    shooting.m -m-file with a function shooting() solving the boundary value ODE problem: y''=F(x,y,y'); y(a)=ya y(b)=yb using shooting method
    lap1d17.m -m-file with a function solving the boundary value ODE problem: -y''+c*y=f in (a,b); y(a)=ya y(b)=yb using FDM method (equidistant mesh); c constant
    fdmdir16.m function solving -u''+c*u=f(t) with Dirichlet bnd cond : u(a)=alpha u(b)=beta by FDM method (order two), c - nonnegative constant, (old version 2016/17)
    fdmdirtest16.m function testing the order of discrete convergence in discrete L2 and max norms of FDM schemes for -u''+c*u=f(t) with Dirichlet bnd cond : u(a)=alpha u(b)=beta; c - nonnegative constant, (for known solution only - using fdmdir16.m function - old version 2016/17)
  • Lab 6 FDM for Poisson equation in 1D cont and in 2D
    lap1mix17.m -m-file with a function solving the boundary value ODE problem: -y''+c*y=f in (a,b); with Dirichlet or mixed bnd cond. using FDM method (equidistant mesh); c constant
    testsfdmlap1dmix17d.m - tests of FDM method for -u''=f in (a,b) with mixed bnd (Dirichlet at a and neumann bnd at b) - FDM is of order one (Neumann bnd aprox. by backward difference at b)
    fdmix16.m - function solving -u''+c*u=f in (a,b) u'(a)=al u(b)=be by FDM of order one (Neumann bnd aproox. by forward differnce) or of order two (increased order by using PDE at left end)
    fdmixtest16.m - function testing order of discrete convergence of FDM solver for -u''+c*u=f in (a,b) u'(a)=al u(b)=be - solver uses FDM of order one (Neumann bnd aproox. by forward differnce) or of order two (increased order by using PDE at left end)
    fddirng16.m - function solving -u''+c*u=f in (a,b) u'(a)=al u(b)=be by FDM with mesh such that right endpoint is x_N < b (b=x_N+0.5*h) - Dirichlet bnd is approximated straightforwardly u_N=be or by Collatz approximation i.e. the last FDM equation equals l(b)=be with l(t) linear polynomial st. l(x_k)=u_k for k=N,N-1
    fdmdirngtest16.m - function testing order of discrete convergence of FDM solver for -u''+c*u=f in (a,b) u'(a)=al u'(b)=be - solver as in fdmdirng16.m
    fdmdir2D16.m - function solving -Laplacian u+c*u=f in (a,b)x(a,b) with zero Dirichelt bnd by FDM of order two - equidistant mesh with the same step in the both directions EXAMPLE with u solution = sin(x_1)*sin(x_2), (then f=2*u)
  • Lab 7 - FEM in 1d Finite element method (FDM) for -u'' +cu=f on [a,b] with Dirichlet bnd condition. In all problems we use linear continuous finite element method i.e conforming P_1 FEM on any mesh (x_0,...,x_N) with x_0=a and x_n=b. Weak form: find u\in V_h s.t. \int_a^b u'v' + c*u*v dx =\int_a^b f v dx \forall v \in V_h - in nodal basis we get the system (A+cB)u=F with A, B (or their submatrices...) obtained from the script below, the rhs for linear FEM we can approximate by composite trapezoidal rule i.e. F=(f_i)_i with f_i=\int_a^b f\phi_i dx \approx 0.5*f(x_i)(x_{i-1}-x_{i+1}) i=1,...,N-1 (note that in case of equidistant mesh x_k=a+k*h we get f_i=h*f(x_i) as in FDM method...). The H^1 seminorm and L^2 norm may be computed for u\inV_h as |u|_1^2=u^TAu and ||u||_0^2=u^TMu - u vector of coefficients in nodal basis.
    We computed during classes the stiffness and mass matrices for FEM on the following mesh: a=x_01; (1/3)*(|x_k-x_{k+1}|+|x_k-x_{k-1}|) for k=l ; (1/6)*|x_k-x_l| for |k-l|=1; assuming x_{-1}=x_0,x_{N+1}=x_N. \int_a^b phi_k'phi_l'dx=0 for |k-l|>1; (|x_k-x_{k+1}|^{-1}+|x_k-x_{k-1}|^{-1}) for k=l; -|x_k-x_l|^{-1} for |k-l|=1 taking $|x_0-x_{-1}|^{-1}=|x_N-x_{N+1}|^{-1}=0$.
    FEM1Dmats.m - - function creates linear 1D linear FEM matrices for -au''+cu=f i.e. A=(\int_a^b \phi_k'\phi_l')_{k,l=0}^N and B=(\int_a^b \phi_k\phi_l)_{k,l=0}^N for \phi_k nodal basis - piecewise linear - any grid - to get matrix for zero Dirichlet bnd - take submatrices of A and B The returned matrices are for the nodal basis (\phi_i)_{i=0}^N i.e. includes the basis functions related to bnd poits, in case of Dirichlet bnd we have to take submatrices obtained by removing first and last rows/cols.
    FEM1dDirSol16.m - linear 1D FEM solver for -au''+cu=f with Dirichlet bc - any grid
    test1dfem16.m - some tests of linear 1D FEM solver for -au''+cu=f with Dirichlet bc
  • Lab 8 -- FD method for parabolic equations in 1D i.e. we discretized equation u_t-u_{xx}=f by FDM with respect to x - and apply octave ODE solver (lsode()) to the resulting ODEs system
    FD1dtest.m - octave script with code testing convergence order for FDM discretization of u_t-u_{xx}=0 u(0)=u(pi)=0 u(0,x)=sin(x) - u(t,x)=exp(-t)sin(x) is the solution (the ODE solver is lsode() - octave black box for ODEs)
    FD1dtest16.m - octave script with code testing convergence order for FDM discretization of u_t-u_{xx}=f(t,x) u(a)=al(t) u(b)=be(t) u(0,x)=sin(x) - u(t,x)=exp(-t)sin(x) is the solution (the ODE solver is lsode() - octave black box for ODEs)
    FDM1DParab17.m -solver FDM for u_t-u_{xx}=f u(t,a)=uL(t) u(t,b)=uP(t) u(0,x)=u0(x)
    FEM1dtest.m - octave script with code testing convergence order for linear FEM discretization of u_t-u_{xx}=0 u(0)=u(pi)=0 u(0,x)=sin(x) - u(t,x)=exp(-t)sin(x) is the solution -one can use any 1D traingulation - please test a few different (the ODE solver is lsode() - octave black box for ODEs)
    FDstep.m - octave script with code testing diffusion in u_t-u_{xx}=0 u(0)=u(pi)=0 u(0,x)= indicator function of [1,2.5] and tests with same u0 but with force term f<>0 i.e. u_t-u_{xx}=f
    nrr15-parab1d.tgz - octave scripts and functions with code testing the order of convergence 3 basic schemes (ex/imlicit Euler, Crank-Nicholson) for u_t-u_{xx}=0 u(a)=ae u(b)=be u(0,x)= u0(x) with FDM or FEM space discretizations; please read README file in the archive
  • Lab 9 Finish writing solutions of old problems or just run my scripts and see what happens. Solve elliptic problem with the pure Neumann condition.
    FEM1DPureNeu17.m -tests FEM in 1D for -u''=f in (a,b) u'(a)=g1 u'(b)=g2 (any mesh - please test different e.g. x=0.5*(a+b)-0.5*(b-a)*cos(pi*(linspace(a,b,N+1)-a)/(b-a))

    Octave scripts with solution of some problems from our labs


    nrrbasic.m - a simple octave script with basic operations like matrices multiplications etc
    eulero17.m - explicit Euler scheme (as written on the board Oct 2, 2017)
    eulerz17.m - implicit Euler scheme - works at least for the nonlinear 2d pendulum ODE - look at the source - there are examples of a use (commented out)
    exEuler.m - explicit Euler scheme (in many dimensions) - old tested version
    testexEul.m - basic tests of explicit Euler scheme (in 1D and 2 D)
    midpoint17.m - implementation of midpoint scheme as in the lab this year
    midpoint.m - implementation of midpoint scheme (old one)
    testmidpoint.m - testing midpoint scheme - order of convergence and instability for long time interval (for dx/dt=-x with x(0)=1) - using midpoint.m m-file
    taylor17.m - implementation of Taylor scheme as in the lab this year
    testlte17.m - tests of the order of LTE for Euler and midpoint schemes
    adamsb2s17.m - explicit Adams-Bashforth scheme (of order 2)
    testadamsb2s17.m - tests of explicit Adams-Bashforth scheme (of order 2)
    AdamsB2step.m - explicit Adams-Bashforth scheme (of order 2)
    Taylor.m - explicit onestep Taylor scheme (of order 2)
    modEuler.m - explicit onestep modified Euler - Runge-Kutta scheme of order 2
    testAB2start.m - tests starting value (x^h_1) for explicit Adams-Bashforth scheme (of order 2)
    testmodEul.m - tests for modified Euler scheme (explicit Runge-Kutta scheme of order 2)
    EulerLTEtest.m - tests for order of local truncation error for explicit/implicit Euler
    linshoot17.m -m-file with a function linshoot17() solving the linear boundary value ODE problem: -y''+p(x)y+q(x)y=f(x); y(a)=alpha y(b)=beta using shooting method
    linshoot16.m -m-file with a function linshoot16() solving the linear boundary value ODE problem: -y''+p(x)y+q(x)y=f(x); y(a)=alpha y(b)=beta using shooting method (old version)
    testshoot.m -shooting method for linear boundary value ODE problem: -y''+c(x)y=0; y(0)=1 y(b)=1 (b=1 - shooting works fine, b=20 - shooting doees not work at all - why?)
    shootexample16.m -script with a function solving the boundary value ODE problem: y''=y^2; y(0)=1 y(1)=-4 using shooting method (fsolve() as a nonlinear solver) - note that there are 2 different solutions!
    shooting.m -m-file with a function shooting() solving the boundary value ODE problem: y''=F(x,y,y'); y(a)=ya y(b)=yb using shooting method
    lap1d17.m -m-file with a function solving the boundary value ODE problem: -y''+c*y=f in (a,b); y(a)=ya y(b)=yb using FDM method (equidistant mesh); c constant
    fdmdir16.m function solving -u''+c*u=f(t) with Dirichlet bnd cond : u(a)=alpha u(b)=beta by FDM method (order two), c - nonnegative constant, (old version 2016/17)
    fdmdirtest16.m function testing the order of discrete convergence in discrete L2 and max norms of FDM schemes for -u''+c*u=f(t) with Dirichlet bnd cond : u(a)=alpha u(b)=beta; c - nonnegative constant, (for known solution only - using fdmdir16.m function - old version 2016/17)
    lap1mix17.m -m-file with a function solving the boundary value ODE problem: -y''+c*y=f in (a,b); with Dirichlet or mixed bnd cond. using FDM method (equidistant mesh); c constant
    testsfdmlap1dmix17d.m - tests of FDM method for -u''=f in (a,b) with mixed bnd (Dirichlet at a and neumann bnd at b) - FDM is of order one (Neumann bnd aprox. by backward difference at b)
    My home page
    Last update: Feb 1, 2018