Archive for stiff equations

Project Work

Posted in Biographical, Education, mathematics with tags , , , , , on April 23, 2018 by telescoper

I’m progressively clearing out stuff from my office prior to the big move to Ireland. This lunchtime I opened one old box file and found my undergraduate project. This was quite an unusual thing at the time as I did Theoretical Physics in Part II (my final year) of Natural Sciences at Cambridge, which normally meant no project but an extra examination paper called Paper 5. As a member of a small minority of Theoretical Physics students who wanted to do theory projects, I was allowed to submit this in place of half of Paper 5…

The problem was to write a computer program that could solve the equations describing the action of a laser, starting with the case of a single-mode laser as shown in the diagram below that I constructed using a sophisticated computer graphics package:

The above system is described by a set of six simultaneous first-order ordinary differential equations, which are of relatively simple form to look at but not so easy to solve numerically because the equations are stiff (i.e. they involve exponential decays or growths with very different time constants). I got around this by using a technique called Gear’s method. There wasn’t an internet in those days so I had to find out about the numerical approach by trawling through books in the library.

The code I wrote – in Fortran 77 – was run on a mainframe, and the terminal had no graphics capability so I had to check the results as a list of numbers before sending the results to a printer and wait for the output to be delivered some time later. Anyway, I got the code to work and ended up with a good mark that helped me get a place to do a PhD.

The sobering thought, though, is that I reckon a decent undergraduate physics student nowadays could probably do all the work I did for my project in a few hours using Python….

Advertisements