Runge Kutta methods

I spent my three day weekend coding (again) the solutions to ordinary differential equations, using the runge kutta methods, for example the simple and damped harmonic oscillators which are second order ODEs and a first order ODE whose solution is a shifted gaussian. The shifted gaussian is an interesting problem because RK2 or RK4 methods using constant step size will not be able to sample the trailing edge of the gaussian well. Adaptive runge kutta methods, where one varies the step size depending on the different between the estimate one obtains from RK4 and from RK5, are needed to solve this problem. As usual, the codes are available on my github repositories, here.

One interesting thing that I came across as I was writing these solutions was that fortran has a limit on the number of characters in a line. I found this because I was getting an error, upon compilation, that I missing a bracket and no matter how much I checked, I couldn't find a mistake! I don't know why there is a limit on the length of a line, maybe it's compiler dependent.

Otherwise, it was interesting to write the last three posts on estimating the radius and distance to stellar objects, which I would like to continue, maybe with estimating the distances to other planets and so on. I guess we'll just see...

Popular posts from this blog

Animation using GNUPlot

Pandas download statistics, PyPI and Google BigQuery - Daily downloads and downloads by latest version

Adaptive step size Runge-Kutta method