DN2221, Applied Numerical Methods, part 1, 6 hp

Welcome to the course, autumn 2013!


Observe that the information on this course home page is

also valid for the courses SF2520 (7.5hp) and SF1536 (9hp)


!! IMPORTANT MESSAGE CONCERNING WRITTEN EXAM in DN2221 (and SF2520) !!
ONE LAST EXAM in DN2221 will be given August 20 (Wednesday), 14-19 in Q15.
Those students in SF2520 who have this exam left can also take part. From
autumn-2014 the exam will be changed to cover both Diff.Eqn's and Num.Algebra.
Sign up for the exam for open July 1st - August 10

SF2520, 7.5hp, will be changed autumn 2014 to ONE course containing
Numerical methods for Differential Equations AND Numerical Algebra.
The labs will be modified accordingly. For more info, see SF2520.

SF1536 consists of DN2221 plus extra material designed exclusevely for students
in the KTH-program Simulation technique and Visualization.

DN2221 can be combined with DN2222 (3hp) giving in total 9hp.

Latest news

27/4 Omtentan för SF1536 hemtenta finns tillgänglig från den 2/5 kl 10 och ska vara inlämnad till Matte-expeditionen
senast 5/5 kl 10. Se även följande instruktioner.
ladda ner hemtentan SF1536

De som vill göra den extra omtenten för SF1536 (vanliga tentan 5 timmar i sal) den 21/5 måste anmäla sig till den
via mina sidor SENAST den 4/5 kl 24.

13/3 The results of the written exam March 10 are now available in the rapp system.
There you can also see the outcome of the labs (from DN2221 + 3 labs from DN2222 in SF2520) and the project.
Observe that the last three labs must be marked with a P, to pass that part of SF2520.
The following table of credits has been used for the final mark in SF2520:
35:E, 43:D, 51:C, 59:B, 67:A, (max is 75)

6/2: The results of the written exam on Jan 15th 2014 are now available at the rapp-system.
The following table of credits for the marks has been used for the written exam:
13:E, 17:D, 20:C, 23:B, 26:A (max 29). A credit of type X.5, where X is
an integer is rounded to the integer X+1.
The final mark will be available when the remaining labs have been reported.

3/2: The reexam will take place on Monday March 10 at 8-13.

16/1: The exam from Jan 15th 2014 and the solutions are found at the end of this homepage.

16/1: Specialinformation foer TENTAN i SF1536, laes haer, fraan den 22/1, 9 am download exam SF1536

13/1: Lab 1-5 are corrected and are available at the student office of Mathematics.
State the course number SF2520 when you want to collect it.
The credits are also available from the rapp-system.

9/1: Remember the written exam on Wed Jan 15, 14-19. No means of help allowed.
Important things to bring with you in your head:
(*) rewrite a higher order ODE to a 1st order system of ODEs.
(*) exp(A*t) and how to obtain it from A=SDinv(S)
(*) definition of a stable/unstable solution of an ODE-system
(*) stability criteria for an LCC-system
(*) formulas for the explicit and implicit Euler method.
(*) definition of local and global error
(*) stability for explicit and implicit Euler
(*) FDM and Galerkin's method for boundary value problems
(*) parabolic PDEs with MoL, stability criteria, Galerkin's method
(*) five point stencil for Poisson's equation and its linear system of equations
(*) advection equation and its characteristics, FTBS, FTFS
(*) scaling of differential equations to dimensionless form
(*) basics about linear difference equations (A.2 in the book)
(*) derivation of difference approximations
(*) overview of direct and iterative methods for linear systems if equations.

11/12: The deadline for the last lab, Lab 6, has been postponed until Jan 13 2014.

4/12: Please note that in the week 12, March 17 - March 21 2014, there
will be a course on Lattice Boltzmann's method. This method can be used to solve
computational fluid dynamics problem as an alternative to solving Navier- Stokes
equations. If you are interested, please contact Michael Hanke, hanke@kth.se

4/12: TIME TO SIGN UP for oral presentation of the projects.
Push the button to reserv a time for the presentation.
Push here to get booking lists:
19/11: Time to choose a project. There are 11 different to choose from.
Read more about the project here.
The formulation of the projects will be given out at the lecture on
Wednesday Nov 20, 15-17 in E1, where each group sign up for a project.
After that the project formulations will be available at the student office of Mathematics.
6/11: For those who take the course SF2520 or (DN2221 + DN2222):
SF2520 consists of DN2221 + part of DN2222, which starts on Thursday Nov 7th, 13-15 in D1.

6/11: Since we have altered the chapters in the book (Ch 7 before Ch 6) the corresponding labs are also altered.
Deadline for these labs are therefore changed to: Lab 5, Nov 18th, Lab 4, Dec 5th.

4/11: On the lecture Tuesday Nov 5th, 15-17 in E1, Prof Jesper Oppelstrup will give the FEM-theory behind
and a demonstration of Comsol Multiphysics to be used in Lab 5.
The demo is found here. Please print out your own copy and bring it with you to ther lecture!
After the lecture there will be possibility to do hands on exercises in Brown computer room 17-19.

4/11: Lab 2 is corrected and is given back at the lecture on Nov 5th.

1/10: Lab 1 is corrected and is given back at the lecture on Oct 1st.
After that it will be found at the student office of mathematics, Mon-Thur open 12-15, closed Fridays.
24/9: Mentor session for SF1536 Wed 25/9 10-12 in D42.
24/9: Homework for SF1536 to be submitted individually Nov 4th are taken from copied distributed material:
compulsory: pg 89 EX 4, pg 90 EX 19, pg 91 EX 35, pg 99 EX 4, pg 100 EX 11
non-compulsory: pg 101, EX 18

19/9: The deadline for Lab2 is postponed from Oct 3 to Oct 4.

12/9: The lecture for all (DN2221,SF2520,SF1536) on Thursday Sept 26 15-17 is CANCELLED. Will be scheduled later in period 2.

12/9: The lecture for SF1536 on Friday Sept 27 10-12 is MOVED to Tuesday Sept 24 10-12 in room L44.


Teacher of the course is Ass Prof Lennart Edsberg, Numerical Analysis group,
e-mail edsberg@csc.kth.se
Assistant helping with labs and correcting reports is PhD-student Ashraful Kadir, NA-group,
e-mail smakadir@kth.se

The address to the NA-group is Lindstedtsvaegen 13.
Observe that the NA-group ia a part of the Department of Mathematics, KTH.

Material for the course:
1) Textbook, L.Edsberg "Introduction to computation and modeling for Differential equations", Wiley's 2008.
Available at KTH's bookstore, about 600 SEK, see also this link
2) Some description of Matlab e.g. MATLAB 7 i korthet eller the "Dundee Matlab report"
The Matlab-description can be bought at Mathematics student office Lindstedtsvägen 25 , price SEK 40.
You can also google at Matlab, Dundee and download it yourself.

Unless you already have an account number for access to Nada's unix system, contact the service center at
the CSC-school, floor 4, Osquars Backe 2. You can also use your laptop with MATLAB installed.
At the service center you can also get a keycard for access to Nada's computer rooms.
A keycard will be given to those who have an account number.

Matlab and Comsol Multiphysics can be downloaded to your own computer if you are KTH student, see ProgDist


Labs are to be done in groups of 2 students. Each lab is examined by a written report.

The labs are found in the textbook, appendix C, but see also this home page
further down for modifications and printing errors.

Read about the requirements for the lab reports here
Observe that MATLAB-program must always be attached to the lab report!!!
IMPORTANT! The lab reports must have a cover page.
This cover page you find here.
The report with the cover page on front shall be submitted to the student office of Mathematics,
Lindstedtsvagen 25, Mon-Fri 12-15.

Laboration 1, deadline Sept 19th, also found here
FAQ lab1:
1) Can we use ode23 or ode45 in lab 1? Answer: no, use expm(A*t)
2) Shall we compute the eigenvalues in 2a) analytically?
Answer: if you want, easier is to use the eig-function in MATLAB.
3) Newton's method converges to only one (or two) of the critical points, why?
Answer: you have probably given the jacobian incorrectly.

Laboration 2, deadline Oct 6th
Laboration 3, deadline Oct 15th
Observe the misprint in the book: sin(pi*(z-a)/(z-b)) should be sin(pi*(z-a)/(b-a))

Laboration 4, deadline Dec 5th (OBS! changed date!)
Laboration 5, deadline Nov 18th (OBS! changed date!)
Laboration 6, deadline Jan 13th (OBS! changed date!

The final project will be given out in the beginning of November.
The project is done in groups of 2-5 students. The results of the project are presented orally at one of the seminars in december.
The presentation is done with OH's or with computer, e.g. Power point. At least one day before the presentation, copies of the pictures of the presentation must be given to the teacher who will arrange copies for the audience. Every student in the group must make some contribution to the oral presentation.

The mark of the course DN2221 (A, B, C, D or E) is based on the results of both labs, project and written exam.
Each lab is given a maximum number of credit points: Lab 1:3.0, Lab 2:4.0, Lab 3:3.0, Lab 4:5.0, Lab 5:4.0, Lab 6:4.0
If a lab is late (see date for submission above) the score will be reduced by 1 credit. The definitely final date for submitting a lab is Jan 13th.
The project is given maximum 5 credit points.
The written exam is given maximum of 29 credit points.
To pass the course minimum 14 credits are needed from the labs (max is 23), minimum 3 credits from the project (max is 5) and 13 from the written exam (max is 29).
The following scale will be used for the final grading (labs+project+exam):
Fx:>=27, E:>=32, D:>=37, C:>=42, B:>=47, A:>=52, max 57

The final mark on SF2520 will be a weighted mark based on the result from DN2221
AND the result from part of DN2222.
The final mark on SF1536 will be the mark based on the written exam from DN2221
AND the result from take home exercises.
Tentative schedule:
4/9: Chapter 1 and 2. 2.1-2.3 are important. EX 2.1.4, EX 2.1.6, EX 2.2.3,
EX 2.2.6, EX 2.2.7, EX 2.3.4, EX 2.3.6 are recommended
5/9: Chapter 2
10/9: Chapter 3. 3.3-3.4 are important. EX 3.3.3, EX 3.3.5, EX 3.4.2 are recommended.
12/9: Assisted lab
17/9: Chapter 3
19/9: Chapter 3, Lab 1 submitted
26/9: Postponed until period 2
1/10: Chapter 4. 4.2-4.3 are important. EX 4.2.4, EX 4.2.8a, EX 4.3.1 are recommended. Lab 1 back.
3/10: Assisted lab, Lab 2 submitted
10/10: Chapter 5,6. Repetition from math course. EX 5.2.2, EX 5.2.3, EX 5.2.7 are recommnded
15/10: Assisted lab, lab 3 submitted

Week 43 and 44 no teaching

5/11: Chapter 6. 6.2-6.3 and 6.5 are important, EX 6.3.1, EX 6.3.2 are recommended. Lab 2 back
8/11: Assisted lab
11/11: Chapter 6,7. 7.2 and 7.4 are important. EX 7.2.1, EX 7.2.2, EX 7.3.1, EX 7.3.2 are recommended. Lab 3 back
13/11: Lab 4 submitted
20/11: Comsol Multiphysics, background and demo
Demo exemple for Comsol is found here
21/11: Assisted lab Comsol Multiphysics
27/11: Chapter 8. Introduction, 8.2, 8.3 important. EX 8.1.1, EX 8.2.1, EX 8.2.4, EX 8.2.5 are recommended. Lab 4 back.
2/12: Chapter 8,9. EX 9.4.1, EX 9.4.2 are recommended. Lab 5 submitted.
9/12: Last lecture of DN2221, project presentations. Lab 5 back
16/12,17/12,18/12: Project presentations
18/12: Lab 6 submitted
13/1: Lab 6 back
15/1: Written exam 14-19 in E31,E33,E34,E35,E51,E52

Suggested dates for reexam: to be agreed upon

Here are some earlier exams
jan-14 with solution solution jan-14
dec-12 with solution solution dec-12
dec-09 with solution solution dec-09
dec-08 with solution solution dec-08

Questions to be studied as preparation for the exam are found here.