In dynamic optimization, a considerable amount of CPU-time is spent in integrating the system of differential equations as well as computing the sensitivities (gradients). In this paper, we describe sensitivity computations for systems of ordinary differential equations using the adjoint approach and an ESDIRK integration algorithm. Furthermore, we apply the developed algorithm to dynamic optimization of chemical process systems and demonstrate its computational efficiency compared to other methods for sensitivity computation.
Using a CSTR case study, the developed adjoint approach for sensitivity computation is applied to the continuous-discrete nonlinear smoothing problem as well as the nonlinear optimal control problem. These problems constitute the mathematical kernel of moving horizon estimation and control. We demonstrate the remarkable computational efficiency and simplicity obtained when the gradients are computed using our adjoint ESDIRK integration algorithm. Compared to forward methods for sensitivity analysis such as staggered direct, staggered corrector and simultaneous corrector methods, the adjoint approach is most efficient when the number of parameters (decision variables) are large. This is exactly the case in applications of nonlinear model predictive control of chemical processes. We benchmark several sensitivity computation algorithms applied to dynamic optimization problems and conclude that the adjoint sensitivity approach is most efficient for certain large-scale problems in nonlinear model predictive control applications.