Weekly update
Dear All, this is the first weekly summary for FYS3150/4150, with brief summary from last week and plans for this week and partly next week.
We will use piazza to send out weekly updates, this way all messages will be store on the piazza site for FYS3150/4150.
This message is somewhat longer than the usual weekly messages, mainly since I wish to repeat some of the practicalities we discussed last week.
Last week, in addition to the general setup of the course, we started to discuss parts of project 1, with an emphasis on the expressions for the first and second derivatives (chapter 3.1-3.2). At the lab we went through our first set up of a user account on GitHub and installed git as version control software.
The course material is available at the GitHub address https://github.com/CompPhysics/ComputationalPhysics and a simple git pull gives you always the latest update. This repository contains all source files for codes, projects, slides etc etc.
For easy (html) visualization of the material there is another link I use frequently during the lectures, namely
http://compphysics.github.io/ComputationalPhysics/doc/web/course
There you will find the various slides, projects and the weekly schedule.
Last week we discussed the setup of the equations for project 1, by discretizing the differential equation we could rewrite a second-order differential equation as a linear algebra problem to be solved by Gaussian elimination. We started also to discuss how to write a c++ program. The latter is covered by chapter 2 and chapter 3. The slides I used are at for example http://compphysics.github.io/ComputationalPhysics/doc/pub/languages/html/languages.html
and you can click on the codes. The codes I discussed are also all at
You can download (via git or just fetch the codes) and play with them. This week we will continue our discussion of c++, and discuss more how to write and read from file, allocate memory dynamically and statically (discuss pointers in c++) and start looking at how to solve project 1. To be more explicit we will do the following using the slides on lntro to languages (see above) and the codes listed above:
1) Discuss in more detail loss of numerical precision and round off errors (chapter 2) and analyze the results for the second derivative we showed last week (see the code at https://github.com/CompPhysics/ComputationalPhysics/blob/master/doc/Programs/LecturePrograms/programs/IntroProgramming/cpp/derivative.cpp)
2) Discuss pointers and memory allocation for arrays in c++ (and also Fortran), again see chapter 2
3) Write to file and read from file, again see chapter 3 and the above slides.
4) Start discussing Gaussian elimination and how to solve the linear equation (chapter 6), see also the slides at for example http://compphysics.github.io/ComputationalPhysics/doc/pub/linalg/html/linalg.html
Here we will focus on a tridiagonal matrix only, which is the matrix that results from discretizing the second derivative. This will lead to an algorithm called the Thomas algorithm (https://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm)
5) Next week we will discuss the more general linear algebra algorithms based on LU decomposition (chapter 6).
At the lab this week, we will use the first hour of each session to present (how to use and install) the IDE Qt Creator (https://www.qt.io/download/). We also show how you can collaborate on a project using git and GitHub (see chapter 3 of the git manual, in particular how to merge branches).
If you wish to use other IDEs, please feel free to stay with those you prefer the most. During the lectures we will also demonstrate how you can compile and link in terminal mode (unix and linux systems).
All for now and best wishes to you all and thanks again for having chosen FYS3150/4150
Morten
p.s. I am planning to set up a website on to teach yourself c++. Hopefully this will be ready by this coming weekend. The lecture notes (from 2015) will also be upgraded and posted on GitHub.