Programming in Python for Physicists (FSI-TPY)

Academic year 2026/2027
Supervisor: doc. Ing. Miroslav Bartošík, Ph.D.  
Supervising institute: ÚFI all courses guaranted by this institute
Teaching language: Czech
Course type: departmental course
Aims of the course unit:
 
Learning outcomes and competences:
 
Prerequisites:
 
Course contents:

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.

Teaching methods and criteria:
 
Assesment methods and criteria linked to learning outcomes:
 
Controlled participation in lessons:
 
Type of course unit:
    Lecture  13 × 1 hrs. optionally                  
    Computer-assisted exercise  13 × 1 hrs. compulsory                  
Course curriculum:
    Lecture

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
  1. Installing Python - Anaconda and ChatGPT
  2. Version control using GitHub
  3. Lists, tuples, dictionaries
  4. Numpy for vectors and matrices, matrix operations, and index expressions
  5. Control structures
  6. Matplotlib for plotting points, curves, surfaces, and data plots
  7. Input and output of data, including working with text and regular expressions
  8. Functions, including built-in and user-defined functions, parameter types, and recursion
  9. Numerical derivation, integration, and ODR solutions
  10. Application of the object-oriented approach to solving n-body problems
  11. Optimization tasks
  12. Semester project
  13. Submission of semester project
Literature - fundamental:
1. SUMMERFIELD, Mark. Python 3: výukový kurz. Brno: Computer Press, 2021. ISBN 978-80-264-3673-3.
2. PILGRIM, Mark. Ponořme se do Python(u) 3. Praha: CZ.NIC, 2012. ISBN 978-80-904248-7-9.
Literature - recommended:
3.

JOHANSSON, Robert. Numerical Python: Scientific Computing and Data Science Applications with NumPy, SciPy and Matplotlib. 2. vyd. New York: Apress, 2018. ISBN 978-1-4842-3915-6.

The study programmes with the given course:
Programme Study form Branch Spec. Final classification   Course-unit credits     Obligation     Level     Year     Semester  
B-FIN-P full-time study --- no specialisation -- Cr 2 Compulsory-optional 1 2 W
C-AKR-P full-time study CZS -- Cr 2 Elective 1 1 W