(182f) Simulation-Optimization Framework for Grey-Box Optimization Using Pharmapy | AIChE

(182f) Simulation-Optimization Framework for Grey-Box Optimization Using Pharmapy

Authors 

Laky, D. - Presenter, Purdue University
Casas Orozco, D., Purdue University
Reklaitis, G., Purdue University
Laird, C., NA
Nagy, Z., Purdue
Process simulation and optimization are emerging, albeit challenging, technologies being applied to the optimal design and operation of pharmaceutical manufacturing facilities. On top of operational challenges, pharmaceutical products must abide by typically rigorous regulatory guidelines to ensure medicines are safe and efficacious. Given the high threshold for consumer safety, frameworks such as Quality-by-Design (QbD) or Quality-by-Control (QbC) have been developed and employed over the past 20 years to strengthen operational feasibility and adherence to product quality standards over a given design space. Frameworks such as QbD or QbC require models that accurately capture process dynamics while retaining reasonable computational efficiency over a desired operating region. Fortunately, digital tools for the modeling and simulation of such pharmaceutical systems are under constant development and improvement. Utilizing these digital modeling frameworks allows for, and encourages the development of, digital twins to aid in analysis and optimization of pharmaceutical process design and process performance in the presence of disturbances. However, the existence of a process digital twin with favorable simulation characteristics often does not directly correlate to favorable process optimization properties. In this work, we embed our open-source pharmaceutical process simulator PharmaPy into a simulation-optimization framework utilizing a state-of-the-art optimization package IPOPT1 embedded in the Python wrapper CyIpopt2, aiming to explore grey-box optimization of pharmaceutical digital twins.

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

  1. 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.
  2. cyipopt Developers. “Cyipopt: Cython Interface for the Interior Point Optimzer IPOPT.” 2017. https://github.com/mechmotum/cyipopt
  3. 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.
  4. Rodriguez, J.S., Nicholson, B., Laird, C.D., Siirola, J.D. “PyNumero: Python Numerical Optimization”, 2018 AIChE Annual Meeting, AIChE, 2018.