Interaction between economic and ecological dynamics in an optimal economic growth model