Introduction to Python for Physicists and Engineers
Syllabus, Master's level, 1FA661
- Code
- 1FA661
- Education cycle
- Second cycle
- Main field(s) of study and in-depth level
- Physics A1N
- Grading system
- Fail (U), Pass (3), Pass with credit (4), Pass with distinction (5)
- Finalised by
- The Faculty Board of Science and Technology, 21 January 2021
- Responsible department
- Department of Physics and Astronomy
Entry requirements
120 credits in science/engineering with mechanics, thermodynamics and electromagnetism. Proficiency in English equivalent to the Swedish upper secondary course English 6.
Learning outcomes
On completion of the course, the student should be able to:
- account for basic components in a Python programme
- use Python packages for calculations and graphics
- motivate relevant models for advanced problems in physics and engineering
- solve problems using numerical algorithms
Content
The course gives an introduction into programming in Python and programming related solution methods.
Introduction to Python: Installation, NumPy, SciPy, Matplotlib, Spyder.
Python components: Variables (integers, floats, strings, Booleans, complex). Containers (lists, dictionaries, arrays). Operators. Input/output (open, read, write, append, print). Control flow (indentation, if, while, for, else, try). Functions.
Programming: Basic concepts. Numerical integration. Solutions for non-linear equations. Approximation of data. Least squares approximation. Graphical presentation.
Solution methods: Break-up of problems in sub-problems, implementation in Python.
Central examples for applications are taken from physics, for example classical mechanics, electrodynamics, thermodynamics and related areas in engineering.
Instruction
Lectures and computer exercises.
Assessment
Computer exercises and hand-in problems.
If there are special reasons for doing so, an examiner may make an exception from the method of assessment indicated and allow a student to be assessed by another method. An example of special reasons might be a certificate regarding special pedagogical support from the disability coordinator of the university.