Firstly, this is not homework - it's a project I have started our of sheer curiosity.
I have searched quite at length, but cannot really find anything that suits my problem. I want to model this on a computer and would like to implement it myself as I would like to understand the...