Most disciplines within physics require computational methods in some way. It is our intention to train students to apply computational methods to physics problems using Fortran or C code. We will provide a three-way balance between understanding the theory behind the methods, actually implementing the method to a specific problem (programming from scratch, using existing libraries), and becoming accustomed to doing so within a Unix-like environment (which might entail, for example, using scripts to manage data sets and program execution).

We will select a few methods that may include, but are not limited to, the following: numerical differentiation and integration; linear algebra, including solving systems of equations and finding the eigenvalues of a matrix (vibrational normal modes of a set of oscillators); ordinary differential equations (charged particles in an electromagnetic); partial differential equations (shallow water wave dynamics); Monte Carlo and molecular dynamics simulations (properties of condensed matter systems).

Classes Tuesdays and Thursdays 9am to 10:15am C3067

Lab: Fridays 2pm to 3:50pm (+ extra time after), C3057

Help Session (Office Hours): TBD

- L1 - Jan. 4, 2024
- General introduction
- Course Outline
- Computer Basics
- convert decimal fraction to binary
- gap notes
- notes from class
- Online textbook

- L2 - Jan. 9, 2024 -- Q1 from Assignment 1 is due
- Machine epsilon and error from substraction. Numerical derivatives.
- The IEEE 754 standard for floating point arithmetic
- machineEpsilon.c
- machineEpsilon-Single.c
- subtract.c
- machineEpsilon.f90
- gap notes
- notes from class

- L3 - Jan. 11, 2024
- cont. Num. Derivatives. Derivatives for non-uniform spacing, Richardson extrapolation, start Numerical integration (Trapezoid rule)
- gap notes
- notes from class

- L4 - Jan. 16, 2024
- Trapezoid and Simposon's rule
- gap notes
- notes from class

- L5 - Jan. 18, 2024
- Gaussian integration
- handout from Klein and Godunov here
- L05-GaussLegendre.ipynb
- L05-GaussLegendre.pdf
- gap notes
- notes from class

- Jan. 23, 2024
- Time given to work on Project 1 in C3057

- L6 - Jan. 25, 2024
- L7 - Jan. 30, 2024
- Runge-Kutta, Adaptive time step Euler, Adaptive RK4
- NR handout
- gap notes
- notes from class

- L8 - Feb. 1, 2024
- Fehlberg Method and going over Project 2
- gap notes
- notes from class

- L9 - Feb 6, 2024
- Stability, start Random Numbers
- gap notes
- notes from class

- L10 - Feb 8, 2024
- Random numbers cont'd, Start MC integration
- gap notes
- notes from class
- random_LCG.cpp
- illustration of correlation in LCG sequence
- Using gcc's built-in rand function use_rand.c
- Using NR's RNG RandomNR.cpp
- Using another NR RNG use_ranNR.c
- NR for F90 useNRrandomF90.f90
- Bitwise exclusive or xor.cpp
- Makefile
- filebundle.tgz

- L11 - Feb 13, 2024
- continue Monte Carlo integration, Metropolis Algorithm
- notes from class
- gap notes

- L12 - Feb 27, 2023. (return from break)
- Ising Model
- web demo of Ising model
- notes from class
- gap notes

- L13 Feb 29, 2024
- Discussion of Project 3: Ising model
- Project 3 description with added musings

- Remember, you can download files from the web with., e.g.,

wget "http://www.physics.mun.ca/courses/p3800/PROJECTS/P1/Project1.tgz" - Setting up at home
- Lab 1 - Introduction to the command line - January 5 -- Snow day -- rescheduled to January 12.
- Lab exercises - we will go over these
- Time is devoted to help on the lab exercises.
- T01notes.txt sparse recollection of things covered in lab exercises
- For further study, you can check out this online tutorial on working with the shell.

- Lab 2 - xmgrace, make, LaTex, shell scripts - January 19.
- The quiz on D2L has the material built-in to the questions. Go to the quiz on D2L
- Text of material
- For further study, you can continue with this online tutorial on writing shell scripts.

- January 26, time on Project 1
- Lab 3 (Informal) - More linux stuff and time given to work on Project 1 - Feb. 2.
- T04notes.txt discussed a bit of Linux stuff
- Learn regular expressions at regexone.com

- Lab 4 - Makefiles, header files, modules - Feb. 9
- The quiz on D2L has the material built-in to the questions. Go to the quiz on D2L
- Text of material

- Feb. 16, time on projects and assignments
- March 1, Working on Assignment 3, projects
- Some programming links

tar -zcf project1sol-YOUR-NAME.tgz Project1sol cp project1sol-YOUR-NAME.tgz /home/SubmissionsNow, if you've been working on your own machine, you need to copy your files over to

scp dirname username@alfven.physics.mun.ca:To log on to alfven:

ssh -X username@alfven.physics.mun.ca(the -X is for forwarding X windows graphics)

*I gratefully acknowledge the author of "Computational Physics -- 3rd/4th Year Option",
Emeritus Professor Angus MacKinnon of Imperial College London,
for kindly permitting me to use and post his notes. -ISV

Getting NR routines in C working for Project 2

If you are really only interested in the Fortran version, I still recommend watching the first five minutes or so of the C video before going on to the one for Fortran. Password for both is 3CpCZYZCU94.

Getting NR routines in Fortran 90 working for Project 2

No. | Due | |
---|---|---|

1 | due January 23, 9am | Assignment 1 |

2 | due Thursday Feb 8 | Assignment 2 |

3 | TBD | Assignment 3 starter code A3Q1.f90 Jupyter notebook A3.ipynb |