Optimal resource allocation in perennial plants: a continuous-time model