Polska wersja

Numerical Differential Equations


winter semester 2016-17

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)
The date of the oral exam: Friday Feb 24th, 2017 - 930am, (please confirm your coming by e-mail by Thursday Feb 23rd; if nobody confirms I will call the exam off on Friday- otherwise if there is nobody at 1015am I will end the exam and leave...so be there before 10am) room 5010 - at another date/time - by appointment - I should be available on Tue,Thu, Fri after around 2pm next week Feb 27th-Mar 3rd.

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)

Link to lab (Oct 4-11-25, 2016; Nov 8-22-29, 2016; Dec 13, 2016; Jan 25, 2017)
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:
    exEuler.m - explicit Euler scheme (in many dimensions)
    testexEul.m - basic tests of explicit Euler scheme (in 1D and 2 D)
  • Lab 2 - Function lsode() in octave and simple ODE schemes cont. 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. midpoint - midpoint unstable for u'=-u u(0)=1 for long time
  • Lab 3 Experimental testing the order of ODE schemes cont. Testing starting for multistep schemes (for Adams-bashforth of 2nd order).
    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)
    testAdamsB2st.m - tests for explicit Adams-Bashforth scheme (of order 2) like for midpoint - i.e. error order etc
    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 22 and 29, 2016)- 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
    linshoot16.m -m-file with a function linshoot15() 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
    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
    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,
    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)
  • Lab 5 and 6 FDM for Poisson equation in 1D cont and in 2D
    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.
    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)

    Octave scripts with solution of some problems from our labs


    nrrbasic.m - a simple octave script with basic operations like matrices multiplications etc
    exEuler.m - explicit Euler scheme (in many dimensions)
    testexEul.m - basic tests of explicit Euler scheme (in 1D and 2 D)
    midpoint.m - implementation of midpoint scheme
    testmidpoint.m - testing midpoint scheme - order of convergence and instability for long time interval (for dx/dt=-x with x(0)=1)
    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)
    testAdamsB2st.m - tests for explicit Adams-Bashforth scheme (of order 2) like for midpoint - i.e. error order etc
    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
    linshoot16.m -m-file with a function linshoot15() 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
    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
    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,
    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) br> 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)
    FEM1Dmats.m - - function creates linear 1D linear FEM matrices for -au''+cu=f i.e. A=(\int_a^b \phi_k'\phi_l') and B=(\int_a^b \phi_k\phi_l)_{k,l} for \phi_k nodal basis - piecewise linear - any grid - to get matrix for zero Dirichlet bnd - take submatrices of A and B
    My home page
    Last update: December 14th, 2016