Dynamical evolution of a collinear planetary system