Optimal Control and Estimation Strategies for Nonlinear and Switched Systems