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.
Language of instruction
Czech
Number of ECTS credits
2
Supervisor
Department
Entry knowledge
Basic computer literacy at a high school level is assumed.
Rules for evaluation and completion of the course
Attendance at lectures is encouraged, and participation in exercises is mandatory. Classes follow a weekly schedule, and credit is awarded based on completing a script simulating a simple physics task.
Aims
The goal is to develop proficiency in using Python for engineering practice.
The study programmes with the given course
Programme B-FIN-P: Physical Engineering and Nanotechnology, Bachelor's, 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