
UNIVERSITY OF CAPE TOWN
UCT Physics PHY321F - Advanced Physics
Computational methods in physics: code examples
Here is a start at
useful Python code fragments
(1) An example of an
Euler-Richardson
(2nd order Runge-Kutta) numerical integration module.
This illustrates both a fixed step and an adaptive integration method.
Note:
- The code illustrates encapsualisation of the algorithm in a class
structure.
- The code illustrates the use of generators.
(2) A set of classes for simple
root-finding.