In the current work, we study two infectious disease models and we use nonlinear optimization and optimal control theory which helps to find strategies towards transmission control and to forecast the international spread of the infectious diseases. The relationship between epidemiology, mathematical modeling and computational tools lets us to build and test theories on the development and fighting with a disease. This study is motivated by the study of epidemiological models applied to infectious diseases in an optimal control perspective. We use the numerical methods to display the solutions of the optimal control problems to find the effect of vaccination on these models. Finally, global sensitivity analysis LHS Monte Carlo method using Partial Rank Correlation Coefficient (PRCC) has been performed to investigate the key parameters in model equations. This present work will advance the understanding about the spread of infectious diseases and lead to novel conceptual understanding for spread of them.