Introduction to Computational Physics¶
About the course¶
These are the class notes for the course Computational Physics, lectured to the students of Bacharelado em Física, Física Médica, and Licenciatura em Física from the Instituto de Física, Universidade Federal de Uberlândia (UFU). Since this is an optional class intended for students with diverse knowledge and interest in Computational Physics and computer languages, I choose to discuss selected topics superficially with practical examples that may interest the students. Advanced topics are proposed as home projects to the students accordingly to their interest.
Note
Initially, I had written a book draft with examples in Julia, but since then this language has changed a lot (improved, actually!). The idea of this new webpage is to move the content of the book here and write examples in many languages (Julia, Python, and C). This will be a long process and I’ll start with Python because its documentation is more accessible to new students. Later I’ll add examples in Julia and C, these will show up as in this Hello, world! example:
print("Hello, world!")
println("Hello world!")
#include <stdio.h>
int main() {
printf("Hello, world!\n");
return(0);
}
Warning
TO DO! I have skipped, but we need to discuss:
- Read/save files and string manipulation
- Plot images / matrices with: plt.imshow(…) or plt.pcolormesh(…)
- 3D plot with matplotlib
- Basic calculus: contents sent by PDF, I’ll update this page as soon as possible
Important links and info¶
To access the class on MS Teams, use the code igor2v3. All classes are recorded and available at the MS Stream Channel Intro Fis Comp 2020
Topics¶
Since this is an introductory course, we’ll focus on simple topics that are useful to solve physics problems. Namely:
- Introduction to the computer language
- Plotting beautiful figures
- Numerical calculus: integrals, derivatives, root finding, …
- Linear algebra: system of eqs., eigenvalues, …
- Differential equations: initial value problems and boundary value problems
- Fourier transforms
- Random numbers and statistics
- Machine / Deep learning (soon)
All these topics will be applied to solve physics problems in exercies along the course.
A very quick introduction¶
Let’s start with a very short introduction. In computational physics a lot of things work by dropping the limits:
That’s it. Everything else is variations of these approximations. Now, let’s go into the details.
Main references¶
Let’s split the main references into online tutorials, links to examples and books. I’ll add more general references here as I write about each topic, while each topic will have specific references in the text.
Online tutorials, documentation and useful links
- Python at Tutorial’s point: [python], [numpy], [matplotlib]
- Official documentation for [numpy - scipy - matplotlib]
- Python’s Anaconda distribution
Books
About computational physics and related:
- Nicholas J. Giordano & Hisao Nakanishi - Computational Physics
- Tao Pang – An Introduction to Computational Physics
- Jos Thijssen – Computational Physics
- Philipp O. J. Scherer – Computational Physics: Simulation of Classical and Quantum Systems
- Cláudio Scherer – Métodos Computacionais da Física
- Páez & Bordeianu – Computational Physics – Problem Solving with Python
- Saul Teukolsky, William H. Press, and William T. Vetterling - Numerical Recipes
Numerical calculus:
- Neide B. Franco - Cálculo numérico
- Selma Arenales, Artur Darezzo - Cálculo numérico: aprendizagem com apoio de software
- John C. Butcher - Numerical methods for ordinary differential equations