Optimal age and size at maturity in annuals and perennials with determinate growth