Optimal Control of the SEIR Epidemic Model Based on Dynamical Systems Theory We consider the susceptible-exposed-infected-removed (SEIR) epidemic model and apply optimal control to it successfully. Here three control inputs are considered, so that the infection rate is decreased and exposed or infected individuals are removed. Our approach is to reduce the computation of the optimal control input to that of the stable manifold of an invariant manifold in a Hamiltonian system. Some numerical examples in which the computer software AUTO is used to numerically compute the stable manifold are given to demonstrate the usefulness of our approach for the optimal control in the SEIR model. Our study suggests how we can decrease the number of infected individuals quickly before a critical situation occurs while keeping social and economic burdens small. Our results for the SEIR model are very different from the previous one for the SIR model, which is similar but simpler than the present one.