Course detail
Programming in Python for Physicists
FSI-TPY Acad. year: 2026/2027 Winter semester
The course teaches students to effectively use Python for numerical calculations, simulations, and visualization of physical phenomena. The emphasis is on applications in classical physics and engineering – without statistics, but with an emphasis on algorithmic thinking and practical skills.
Supervisor
Department
Learning outcomes of the course unit
Prerequisites
Planned learning activities and teaching methods
Assesment methods and criteria linked to learning outcomes
Language of instruction
Czech
Aims
Specification of controlled education, way of implementation and compensation for absences
The study programmes with the given course
Programme B-FIN-P: Physical Engineering and Nanotechnology, Bachelor's
branch ---: no specialisation, 2 credits, compulsory-optional
Type of course unit
Lecture
13 hours, optionally
Syllabus
Syllabus (12 weeks, 2 hrs/week)
• Week 1: Introduction and Python scientific ecosystem – NumPy, SciPy, Matplotlib, Pandas; Jupyter Notebook, script management
• Week 2: Data basics – Loading, filtering, editing and visualizing data (CSV, TXT); graphs and tables
• Week 3: Numerical differentiation and integration – numpy.gradient, trapezoidal and Simpson’s rule; applications: work and energy calculations
• Week 4: Solving differential equations – Euler’s method, Runge–Kutta, solve_ivp; models: damped oscillator, free fall
• Week 5: Linear algebra in practice – Matrices, vectors, inversion, solving systems of equations (numpy.linalg.solve)
• Week 6: Interpolation and approximation – interp1d, polynomial and spline interpolation, applications to experimental data
• Week 7: Fourier transform – FFT basics, spectral analysis, frequency filtering of signals
• Week 8: Numerical simulations of physical processes – 1D particle motion, oscillation, heat transfer – creation of simple models
• Week 9: Numerical simulation of 2D particle motion – ballistic curve
• Week 10: Visualization and animation – 3D graphs, animation with FuncAnimation, visualization of trajectories and fields
• Week 11: Project programming and OOP – Structure of a larger program, modules, functions, working with data sets
• Week 12: Mini-projects and summaries – Presentation of simulations or models, discussion, final summary of methods
Learning outcomes
Student:
- effectively uses NumPy, SciPy, Matplotlib libraries
- can solve differential equations and integrals numerically,
- simulates simple physical processes,
- prepares data visualizations and animations,
- manages to structure code and organize a project in Python.
Computer-assisted exercise
13 hours, compulsory
Syllabus
- Installing Python – Anaconda and ChatGPT
- Version control using GitHub
- Lists, tuples, dictionaries
- Numpy for vectors and matrices, matrix operations, and index expressions
- Control structures
- Matplotlib for plotting points, curves, surfaces, and data plots
- Input and output of data, including working with text and regular expressions
- Functions, including built-in and user-defined functions, parameter types, and recursion
- Numerical derivation, integration, and ODR solutions
- Application of the object-oriented approach to solving n-body problems
- Optimization tasks
- Semester project
- Submission of semester project