1. Optimal control problems with ODEs. 1.1. Formulation of ODE optimal control problems. 1.2. The controlled ODE model. 1.3. Existence of optimal controls. 1.4. Optimality conditions. 1.5. The Pontryagin maximum principle. 1.6. The PMP and path constraints. 1.7. Sufficient conditions for optimality. 1.8. Analytical solutions via PMP. 2. The sequential quadratic hamiltonian method. 2.1. Successive approximations schemes. 2.2. The sequential quadratic hamiltonian method. 2.3. Mixed control and state constraints. 2.4. Time-optimal control problems. 2.5. Analysis of the SQH method. 3. Optimal relaxed controls. 3.1. Young measures and optimal relaxed controls. 3.2. The sequential quadratic hamiltonian method. 3.3. The SQH minimising property. 3.4. An application with two relaxed controls. 4. Differential Nash games. 4.1. Introduction. 4.2. PMP characterization of Nash games. 4.3. The SQH method for solving Nash games. 4.4. Numerical experiments. 5. Deep learning in residual neural networks. 5.1. Introduction. 5.2. Supervised learning and optimal control. 5.3. The discrete maximum principle. 5.4. The sequential quadratic hamiltonian method. 5.5. Wellposedness and convergence results. 5.6. Numerical experiments. 6. Control of stochastic models. 6.1. Introduction. 6.2. Formulation of ensemble optimal control problems. 6.3. The PMP characterisation of optimal controls. 6.4. The Hamilton-Jacobi-Bellman equation. 6.5. Two SQH methods. 6.6. Numerical experiments. 7. PDE optimal control problems 7.1 Introduction. 7.2. Elliptic optimal control problems. 7.3. The sequential quadratic hamiltonian method. 7.4. Linear elliptic optimal control problems. 7.5. A problem with discontinuous control costs. 7.6. Bilinear elliptic optimal control problems. 7.7. Nonlinear elliptic optimal control problems. 7.8. A problem with state constraints. 7.9. A non-smooth problem with L1 tracking term. 7.10. Parabolic optimal control problems. 7.11. Hyperbolic optimal control problems. 8. Identification of a diffusion coefficient. 8.1. Introduction. 8.2. An inverse diffusion coefficient problem. 8.3. The SQH method. 8.4. Finite element approximation. 8.5. Numerical experiments. A. Results of analysis.