Optimal harvesting for periodic age-dependent population dynamics