polytrope class with the runge-kutta 4 solver