Prospectus

nl en

Programming methods NA

Course
2024-2025

Admission requirements

Mathematics and physics at the level of VWO math B en VWO physics.

Description

Programming skills are essential in science. For example to solve numerical problems, simulate physical processes, and analyze experimental data. Python will be used throughout the physics and astronomy courses for assignments and research projects.

Programming methods NA offers the opportunity to overcome the first hurdle in becoming familiar with writing programming code for various problems. The most effective way to learn a programming language is to practice it yourself on a regular basis. There will therefore be short exercises during lectures and tutorials.

The lectures and related assignments are divided into four themes:

  1. Numbers, vectors, and matrices
  2. Derivatives and integrals
  3. Simulations
  4. Data analysis

Basic concepts and functionalities of Python will be introduced during the lectures. In addition, a number of modules will be used (NumPy, Matplotlib, and SciPy) that provide a variety of numerical tools often useful in scientific research.

Course objectives

General learning objectives:

After completing this course, students are able to:

  • Motivate why programming is an important skill for research

  • Understand, read, write and execute basic Python

  • Make use of Jupyter Notebooks

  • Define functions and program in an object-oriented way

  • Visualize results by making plots

  • Write structured, commented, and clearly readable code

  • Explain written code in your own words

  • Give feedback to fellow students about each other's code

  • Consult online resources on modules, functionalities, and parameters

The themes consist of specific learning objectives. Students can:

  • Perform mathematical calculations

  • Use lists and arrays

  • Manipulate vectors and matrices and perform operations on them

  • Calculate an integral and derivative of a function numerically

  • Use a random number generator

  • Set up a simulation of a physics system

  • Use simulations to solve a physical problem

  • Read data from and write to CSV files

  • Analyze 1D, 2D, and 3D datasets as arrays

  • Use and explain functions of NumPy, SciPy and Matplotlib

Timetable

Schedule

You will find the timetables for all courses and degree programmes of Leiden University in the tool MyTimetable (login). Any teaching activities that you have successfully registered for in MyStudyMap will automatically be displayed in MyTimeTable. Any timetables that you add manually, will be saved and automatically displayed the next time you sign in. MyTimetable allows you to integrate your timetable with your calendar apps such as Outlook, Google Calendar, Apple Calendar and other calendar apps on your smartphone. Any timetable changes will be automatically synced with your calendar. If you wish, you can also receive an email notification of the change. You can turn notifications on in ‘Settings’ (after login).

For more information, watch the video or go to the 'help-page' in MyTimetable. Please note: Joint Degree students Leiden/Delft have to merge their two different timetables into one. This video explains how to do this.

Mode of instruction

Every week there is a lecture of 2x45 min and a tutorial of 2x45 min. Students are required to bring their own laptop to the tutorials. In addition, self-study of about 5 hours a week is an important component to become familiar with programming.

Assessment method

Each of the four modules consists of a set of assignments that count for 15% of the final grade (60% of the total). Assignments must be submitted individually to Brightspace, and each must be passed with a minimal grade of 5,5.

In addition to the four modules, this course has a final exam that counts for 40% of the total grade. The exam will consist of multiple-choice questions and programming exercises. The exam will be conducted on computers using the ANS application. The exam must be passed with a minimal grade of 5,5.

Each module and the exam can be retaken once, if they were not passed with a sufficient grade. A retake of a module consists of improving and resubmitting the original assignment, for which a maximum grade of 6.0 can be obtained. For the resit of the exam, a maximum grade of 10,0 is achievable.

Reading list

Use should be made of the extensive information and examples that can be found on the websites of Python, NumPy, Matplotlib , SciPy.

Furthermore, this open access book is recommended: Introduction to Scientific Programming with Python, Joakim Sundnes, ISBN 978-3-030-50356-7

Registration

As a student, you are responsible for registering on time, i.e. 14 days before the start of the course. This can be done via Mystudymap. You do this twice a year: once for the courses you want to take in semester 1 and once for the courses you want to take in semester 2. Please note: late registration is not possible.

Registration for courses in the first semester is possible from July; registration for courses in the second semester is possible from December. First-year bachelor students are registered for semester 1 by the faculty student administration; they do not have to do this themselves. For more information, see this page

In addition, it is mandatory for all students, including first-year bachelor students, to register for exams. This can be done up to and including 10 calendar days prior to the exam or up to five calendar days in case of a retake exam. You cannot participate in the exam or retake without a valid registration in My Studymap.

Contact

Evert van Nieuwenburg

Tomas Stolker

Remarks

Students are expected to bring their own laptop to both the lecture and seminar. During both contact moments, active participation is expected when working on exercises during lectures. If you do not have a laptop, a couple can be formed to work on the assignments together.

It is also important to install Python before the first lecture. We recommend installing the free version of Anaconda.