Code for the model "A Dynamic Framework for the Study of Optimal Birth Intervals"