Prospectus

nl en

Programming methods NA

Course
2023-2024

Admission requirements

Mathematics and physics at the level of VWO wiskunde B en VWO natuurkunde.

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. The emphasis will therefore be on practice during the lectures and tutorials, in which concepts are explained but students mainly actively work on the assignments themselves.

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, SciPy, and Astropy) 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, and write basic Python syntax

  • Using Jupyter Notebooks to write and run code

  • 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

  • Using 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 to e.g. calculate an integral

  • Set up a simulation of a physics system

  • Use simulations to solve a physical problem

  • Read data from and write to CSV and FITS files

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

  • Use and explain functions of NumPy, SciPy, Matplotlib, and Astropy

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 sucessfully 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 the 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. 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 themes consists of a set of assignments that count for 25% of the final mark. Assignments must be submitted individually to Brightspace.

There is the possibility to resubmit assignments by improving them based on the received feedback. A maximum of 6.0 can be achieved for a retake assignment.

Reading list

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

Registration

From the academic year 2022-2023 on every student has to register for courses with the new enrollment tool MyStudyMap. There are two registration periods per year: registration for the fall semester opens in July and registration for the spring semester opens in December. Please see this page for more information. An exemption is the fall semester for 1st year bachelor students, the student administration will enroll this group.

Please note that it is compulsory to both preregister and confirm your participation for every exam and retake. Not being registered for a course means that you are not allowed to participate in the final exam of the course. Confirming your exam participation is possible until ten days before the exam. Extensive FAQ's on MyStudymap can be found here.

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 in which the exercises are central. 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.