(182f) Simulation-Optimization Framework for Grey-Box Optimization Using Pharmapy
AIChE Annual Meeting
2021
2021 Annual Meeting
Computing and Systems Technology Division
CAST Director's Student Presentation Award Finalists (Invited Talks)
Monday, November 8, 2021 - 4:45pm to 5:00pm
PharmaPy is an open-source Python package for simulation and analysis of pharmaceutical manufacturing systems configured as end-to-end batch, end-to-end continuous, or hybrid batch-continuous processes3. With strong focus on user utility and scriptability, PharmaPy can be seamlessly combined with various other open-source packages or user-made Python codes. PharmaPy is scheduled to offer simultaneous equation-oriented process optimization capabilities with its standard unit model libraries. However, given a simulation model, the development of an equivalent equation-oriented mathematical model that is suitable for simultaneous equation-oriented optimization with reasonable convergence properties is not trivial, especially while retaining the desirable PharmaPy feature of allowing flexibility in user implementation of custom models. Also, the execution of integrated process optimization of an entire flowsheet using high-fidelity models, such as those required to obtain meaningful process simulation results, may not be computationally feasible within a simultaneous equation-oriented framework. With these hurdles in mind, it is desirable to gain critical design and operational insight by circumventing these numerical convergence and process modeling barriers. Fortunately, the PyNumero4 package within Pyomo, along with the availability of the CyIpopt package, and the ability to obtain gradient approximations via callbacks to PharmaPy allow for efficient solution of non-linear programs with no explicit representation of the flowsheet PharmaPy calls at each solver iteration. Exploiting the availability of these packages, we present a comparison of integrated flowsheet optimization against a sequential, unit-to-unit optimization approach. The sequential approach will utilize both the grey-box optimization technique as well as simultaneous equation-oriented optimization when models are available. First, a pharmaceutical manufacturing process is modeled in PharmaPy to be called at each iteration using CyIpopt. Next, an objective function and pertinent operating constraints, critical quality attributes (CQAs), and variable bounds are defined for execution outside of the simulated model equations. When CyIpopt is called to solve the problem, finite-difference-based approaches are employed to calculate derivative information on the outputs of the PharmaPy simulation. When using the âbrute-forceâ method, the number of simulations required to evaluate gradient approximations scales with the number of inputs, since each parameter is perturbed individually. By contrast in the simultaneous perturbation approach, the full vector of inputs is stochastically perturbed and thus only two simulations are required per callback iteration while utilizing a central finite difference scheme. However, the effects of differences in quality of the derivative approximation has an impact on overall optimization algorithm performance. Thus, the two approaches must be compared to clarify the computational benefit when the number of input variables becomes large.
To that purpose, an end-to-end drug substance pharmaceutical process was optimized for various objectives in an integrated fashion, as well as dividing the simulation into unit-by-unit pieces, to compare the benefit of simultaneous versus sequential flowsheet optimization methods. In particular, the reduction in the number of callbacks to the simulator utilizing a simultaneous perturbation approach for gradient approximation amplifies computational savings when process simulation time is longer. Also, the unit-to-unit grey-box optimization performed well compared with a simultaneous equation-oriented approach on models where the latter was available. Overall, when equation-oriented models are unavailable or partially available, utilizing grey-box or black-box optimization in combination with a process simulator is a practical method for pharmaceutical process design.
References
- Wächter and L.T. Biegler. âOn the implementation of a primal-dual interior point filter line search algorithm for large-scale nonlinear programmingâ, Mathematical Programming, 106(1):25â57, 2006.
- cyipopt Developers. âCyipopt: Cython Interface for the Interior Point Optimzer IPOPT.â 2017. https://github.com/mechmotum/cyipopt
- Casas-Orozco, D., Laky, D., Wang, V., Abdi, M., Feng, X., Wood, E., Laird, C., Reklaitis, G.V., Nagy, Z.K., âPharmaPy: an object-oriented tool for the development of hybrid pharmaceutical flowsheetsâ, Computers and Chemical Engineering, submitted, 2021.
- Rodriguez, J.S., Nicholson, B., Laird, C.D., Siirola, J.D. âPyNumero: Python Numerical Optimizationâ, 2018 AIChE Annual Meeting, AIChE, 2018.