Optimal control of the COVID-19 pandemic: controlled sanitary deconfinement in Portugal