A closed form solution to the transitional dynamics of a modified Ramsey model