EL2310 Scientific Programming (7.5 ECTS)

Scientific Programming is a programming course tailored for the Systems, Control and Robotics program. The aim is to ensure that everyone can use MATLAB which will be used in many of the coming courses as well as to be able to program in C/C++. The examination of this course is through projects that should be solved individually. There is one project for MATLAB, one for C and one for C++. Each project is preceded by an optional lab that provides an additional opportunity to train before the project.

The themes for the projects are mainly from robotics. Over the past years, algorithms and methods such as path planning with potential fields and probabilistic road maps, scan matching and the control of robot manipulator arms have been investigated. Solving the projects requires not only the ability to program, but to analyse a problem and to go from a mathematical formulation to an algorithm and then to an implementation. Finally, and just as importantly, an evaluation should also be carried out to make sure that the implementation works as expected.

A full description for this course can be found in the KTH Course Catalogue.

Feedback

The course has been developed and improved over several years by several people, including Patric Jensfelt, Carl Henrik Ek, Kai Huebner, Andrzej Pronobis. Please provide feedback and let me know how we can further improve this course!

Links

Virtual Machine

In order to provide an identical environment for all students working on the C and C++ projects, an Ubuntu virtual machine was prepared in VirtualBox. The VM has all the required tools preinstalled (gcc/g++/emacs/SDL etc.) and will be used to run the submitted project code for grading. You can download a RAR compressed VirtualBox VM here.

To use the virtual machine, download and install VirtualBox. Then, download and unpack the virtual machine and add it to VirtualBox using Machine->Add. To exchange files between the virtual machine (guest operating system) and your OS (host OS), use shared folders. More information about VirtualBox can be found here.

Projects and Labs

Please note that the lab dates differ from those shown in the KTH calendar and they have been updated on 18. Sept.

  • Matlab project available. Download from Yasemin's homepage: download project file

  • Matlab lab and help session

  • Matlab project deadline, submit via bilda before 20:00
    C project available. Instructions are here: C project details.

  • C lab and help session

  • C project deadline, submit via bilda before 20:00
    C++ project available. Instructions are here: C++ project details.

  • C++ lab/help session

  • C++ project deadline, submit via bilda before 20:00.

Lectures

Details about labs, downloadable slides etc will be posted here as we proceed. Please check this website for updates to the schedule. Note that this course largely relies on your self-study and that the slides are mainly there to provide you with a frame of reference.

  • Lecture 1, Course overview and introduction to Matlab.

    We covered the basics about the course structure, had a quick look at the programming languages we'll use. I also presented a Matlab session to get things started.

    Homework: Download
    Slides: Download


  • Lecture 2

    Slides, homework, presentation topics: Download


  • Lecture 3

    Slides, homework, presentation topics: Download


  • Lecture 4

    Slides, homework, presentation topics: Download


  • Lecture 5

    Slides, homework, presentation topics: Download

  • Lecture 6 (start of C)

    Slides, homework, presentation topics: Download


  • Lecture 7

    Slides, homework, presentation topics: Download

    Presentation 05, Matlab Image Processing: Download

  • Lecture 8

    Slides, homework, presentation topics: Download

    Matlab project available (see above)
    Presentation 06, Floating Point Numbers: Download

  • Lecture 9

    Slides, homework, presentation topics: Download

    Presentation 07, Sorting: Download
    Download matlab file

  • Lecture 10

    Slides, homework, presentation topics: Download

    Presentation 08, Hashing: Download

  • Lecture 11

    Slides, homework, presentation topics: Download


  • Lecture 12

    Slides, homework, presentation topics: Download

    Presentation 10, Graphs: Download

  • Lecture 13 (start of C++)

    Slides, homework, presentation topics: Download

    Source code from the lecture: Download

    Presentation 11, Trees: Download

  • Lecture 14

    Slides, homework, presentation topics: Download

    Code: Download

    Presentation 12, Numerical Integration: Download

  • Lecture 15

    See slides from lecture 14

    Presentation 13, ODE: Download


  • Lecture 16

    Slides: Download

    Example Code: Download

  • Lecture 17 (final lecture)

    Presentation 16, Unit testing: Download

    Presentation 17, Huffman coding: Download

    Presentation 18, Montecarlo method: Download