next up previous
Next: Introducing software design Up: From bouncing balls to Previous: Dynamics

Exercises

The source code for SimpleMD.py can be found here. The source code for Minimise.py can be found here.

  1. Note that in each iteration of the simulator, the evalForce and evalPotential functions need both be called. Is there are more efficient way of doing this?
  2. Extend the program to print out the potential energy, kinetic energy and total energy of the system in each iteration.
  3. Add the ability to turn each of the potential, kinetic and total energies off through the use of global static flags.
  4. Add the ability to colour the atoms according to kinetic energy, and the ability to turn colouring on or off. Atoms with high kinetic energy should be red, and atoms with low kinetic energy should be blue. *
  5. Imagine you had to modify your program to run on a box that did not have visual python, rather you had to use a graphics package called 3d python. What affect would this have on your code? Comment on the ease or difficulty of extending and modifying your existing code.


next up previous
Next: Introducing software design Up: From bouncing balls to Previous: Dynamics
James Roper 2004-02-12