CHEMICAL ENGINEERINGTRANSACTIONS VOL. 61, 2017 A publication of The Italian Association of Chemical Engineering Online at www.aidic.it/cet Guest Editors: Petar S Varbanov, Rongxin Su, Hon Loong Lam, Xia Liu, Jiří J Klemeš Copyright © 2017, AIDIC ServiziS.r.l. ISBN 978-88-95608-51-8; ISSN 2283-9216 Dynamic Optimization of Fed-batch Fermentation with Constraint on Wastewater Discharge Chi Zhai, Ran Wang, Zhongqi Ren, Wei Sun* Beijing Key Lab of Membrane Science and Technology, College of Chemical Engineering, Beijing University of Chemical Technology, 100029 Beijing, China sunwei@mail.buct.edu.cn A fed-batch culture is a semi-batch operation in which the feed streams are added intermittently or continuously during the operation course and the products are harvested only at the end of the run. Optimal feed streams input profiles that harvest the maximum production can be obtained by dynamic optimization. However, the optimal profile may be quite different if the constraint on wastewater discharge is considered. In this paper, the penicillin fermentation process is adopted as a case study, and we propose a constraint to evaluate the wastewater discharge. The dynamic simulation results show that the optimal results with the constraint of wastewater discharge may decrease 40~50 % in penicillin production, compared with the one without the constraint, which indicates that constraint on wastewater discharge has a significant influence on the optimal fed-batch process, and needs especial attention for decision making at the beginning stage of the process development. 1. Introduction A fed-batch culture is a semi-batch operation, in which feed streams are added either intermittently or continuously during the operation course and the product is harvested only at the end of the run. For the recent decades, there has been an enormous growth in the application of fed-batch cultures for the fermentation processes. The fed-batch culture is adopted when the purpose is to alleviate substrate inhibition of the process. Two operation strategies are frequently studied and both exhibit some kind of extreme: one is to keep the feed stream at a constant level which is the easiest to manipulate, the other is to follow a predetermined optimal profile which may harvest the optimal performance. For the latter case, a dynamic optimization problem is formulated. Nowadays, with the presence of many sophisticated controllers and the accumulated knowledge on microorganism kinetics, the fed-batch culture is constantly treated as a dynamic optimization problem (Pcolka and Celikovsky, 2012). For the solution of the optimization problem, two methods are adopted in general. One is the indirect method which implements the Maximum Principle (Pontryagin et al., 1962), and the other is the direct method which implements the Bellman Dynamic Programming proposed by Bellman (2003). Their corresponding mathematical foundations are based on the variational and numerical computation theories, respectively. In view of the variational theory, the optimal feeding profile is obtained by formulating the Hamiltonian and the maximum principle states the optimization criterion. However, the feeding steam is restricted to being between a lower and an upper bound in industry, which is a singular control problem and it is difficult to deal with mathematically (Modak et al., 1986). On the other hand, by orthogonal collocation on finite elements (Cuthrell and Biegler, 1989), the dynamic optimization problem can be converted to a nonlinear programming (NLP) problem, which is especially prominent for dealing with singular control problem (San, 1988). With the development of the numerical computation technology, high efficiency NLP solver for large sparse systems is available (Gill and Murray, 2005), and more importantly, many intelligent solvers, such as the hybrid genetic algorithm (Debasis and Jayant, 2005) and the particle swarm algorithm (Mahsa and Gholam, 2015), are applicable directly in the perspective of numerical dynamic optimization. DOI: 10.3303/CET1761081 Please cite this article as: Zhai C., Wang R., Ren Z., Sun W., 2017, Dynamic optimization of fed-batch fermentation with constraint on wastewater discharge, Chemical Engineering Transactions, 61, 499-504 DOI:10.3303/CET1761081 499 In this paper, the numerical dynamic optimization methods and algorithms of the penicillin process are re- studied, particularly, when the process is under the constraint of wastewater discharge. The elevated requirement on wastewater treatment has received attention by many researchers (Hend et al., 2016). The optimal profile (without wastewater constraint) tends to maintain with high broth level at the end run to obtain as much penicillin product as possible. However, since the affiliated wastewater treatment unit has a maximum capacity for one batch period, above which the effluent discharged from the wastewater treatment unit will not satisfy the lawful requirements, a threshold is existed that restrict the generation of wastewater for one batch period. Because of the ever-rigorous penalty on the environment (Irene et al.,2016), the focus of this paper is on the wastewater discharged by the process of fermentation, extraction, decoloration, crystallization and washing for the production of penicillin, which presents as a constraint in the optimization model, and may affect the optimal profile significantly. With the constraint of wastewater generation, the corresponding optimal profile may be quite different from the one without the constraint, and may affect decision making in industry. This paper is organized as follows: the algorithm in Section 2; the model with constraint is discussed in Section 3; the result and discussion is analysed in Section 4; and the conclusion is followed in Section 5. 2. The algorithm For the direct method, the solution is derived based on the optimal theory, which adopts the Hamiltonian to deal with the boundary conditions. However, the inequality constrains on process states or control parameters are difficult to address with this method. On the other hand, we can directly apply a discretization scheme to transform the optimal control problem into a NLP problem (Cordova et al., 2016), which can be solved numerically by any NLP solvers. In this paper, the direct method is used since the constraint of wastewater discharge is focused for the fed-batch fermentation process. To derive the NLP problem, the differential (integral, algebraic) equations are converted into algebraic equations using the collocation on finite elements, and the residual equations are then formed as a set of algebraic equations. For optimal residuals, the roots of the shifted Legendre polynomial are set as the collocation points, and the Lagrange polynomial is used to approximate the differentiation and integration terms. The mathematical development is as follows: Consider the initial-value problem over a finite element i with time t ∈ (ζi, ζi+1), ζi 1 ζi ζi ζi+1 ζi+2 xi 1,0 xi 1,1 xi 1,2 xi,0 xi,1 xi,2 xi+1,0 xi+1,1 xi+1,2 xi+2,0 ui 1,1 ui 1,2 ui,1 ui,2 ui+1,1 ui+1,2 Figure 1: Collocation on finite elements for state profiles, control profiles and element lengths (Kx, Ku = 2) The solution is approximated by Lagrange polynomials over element i (ζi ≤ t ≤ ζi+1) as follows: (1) (2) where i =1, 2…, NE. k = 0 to j meaning that k starts form 0 and k≠j, NE is the number of elements. Also, xKx(t) is a (Kx+1)th order degree piecewise polynomial and uKu(t) is piecewise polynomial of order Ku. The polynomial approximating the state x takes into account the initial conditions of x(t) for each element. Also, the Lagrange polynomial has the desirable property that for xKx(t): (3) which is due to the Lagrange condition ϕk(tik)=δkj, where δkj is the Kronecker delta. This polynomial form allows the direct bounding of the states and controls, e.g., path constraints can be imposed on the problem formulation. Using K=Kx=Ku point orthogonal collocation on finite elements as shown in Figure 1, and by defining the basic functions, so that they are normalised over the each element ∆ζi(τ ∈ [0, 1]),one can write the residual equation as follows: 500 http://www.sciencedirect.com/science/article/pii/S0360319915313379 (4) where I = 1, 2…, NE, j = 1, 2…,ϕj(τk) = dtϕj/dτk, and together with ϕj(τ), θj(τ), terms (basis functions), they are calculated beforehand, since they depend only on the Legendre root locations. Note that tik=ζi+ζiτk. This form is convenient to work with when the element lengths are included as decision variables. The element lengths are also used to find possible points of discontinuity for the control profiles and to ensure that the integration accuracy is within a numerical tolerance. Additionally, the continuity of the states is enforced at element (ζi, i= 2, ... NE), but it is allowed that the control profiles to have discontinuities at these endpoints as follows: (5) (6) These equations extrapolate the polynomial 1 ( ) x i K x t to the endpoints of its element and provide accurate initial conditions for the next element and polynomial ( ) x i K x t . The bounds can be done in similar way. Then a set of nonlinear equations are generated, which can be solved by any NLP solver. 3. The model with constraint 3.1 The penicillin fermentation model The whole process can be divided into two stages: fermentation and purification. The fermentation model (Carlos and Jose, 2004) is described by mass balance of the volume (V), concentrations of biomass(X), product (P) and substrate (S). When the wastewater discharge is not considered, the dynamic optimisation problem can be formulated as shown in Eq.7, where the penicillin production is maximised, and the system subject to constraints on the process model and boundary conditions with respect to the state and manipulate variables. (7) where tf is the time of the fed-batch process, μ(X,S) is the specific biomass growth rate and ρ(S) the specific penicillin production rate.μmax= 0.11 h-1 is maximum specific biomass growth rate;ρmax = 0.0055 h-1 is maximum specific production rate; KX = 0.006 g/L is saturation parameter for biomass growth; KP = 0.0001 g/L is saturation parameter for production; Kin = 0.1 g/L is inhibition parameter for production; Kdeg = 0.01 h-1 is the product degradation rate; Km=0.0001 g/L is saturation parameter for maintenance consumption; mS = 0.029 g/L is maintenance consumption rate; yx/s = 0.47 (g X)/(g S) is yield factor for substrate to biomass; YP/S = 1.2 (g P)/(g S) is the yield factor for substrate to product and SF = 500 g/L is feed concentration. Bounds and initial variable values are shown in Table 1. 3.2 The constraint of wastewater in penicillin production In this paper, a constraint of wastewater discharge is added into the fermentation model as a penalty for the dynamic optimization, which compromises the penicillin production and the energy cost on wastewater treatment. The purification process is composed of the extraction, decolourization, crystallization and washing process, in which extraction agent, crystallization agent and washing agent are added that increases the contamination index of the wastewater. Therefore, these purification processes are the dominating source of wastewater regeneration. The detail of the penicillin purification process is listed in Figure 2. 501 javascript:void(0); javascript:void(0); Table 1: Borders and initial variable values for penicillin fermentation Variable Lower Bound Upper Bound Initial value X (g/L) 0 40 1.5 P (g/L) 0 - 0.0 S (g/L) 0 100 0.0 V (L) 0 10 7.0 U (g/h) 0 50 - 𝑡𝑓 (h) 72 200 - It is obvious in Figure 2 that the broth level at the end a fermentation batch is directly associated with the usage of agents for each purification step, which finally becomes the contaminant in the wastewater. The content of the hazard in the wastewater is evaluated by the value of Chemical Oxygen Demand (COD). The COD content cannot exceed the maximum capacity of the wastewater treatment unit. Both the fermentation and purification procedure have attribute on high COD in the wastewater, but only the purification is concentrated. Specifically, penicillin is extracted to the oil phase by the agent of n-butylacetate (BA) under PH 1.8~2.2, the agent added by volume equivalence with respect to the fermentation broth is the coefficient α∈ (0.2, 0.5). Then, it is re-extracted to the water phase by using NaHCO3, and the PH is adjusted to 6.8~7.4, for the penicillin-Na is solvable in the water. Afterwards, H2SO4 is used to shift penicillin-Na to penicillin, when PH is about 2, and the extraction and re-extraction steps are repeated for once. After that, the activated char coal is used for decolourization. The next step is crystallization by adding KAcC2H5OH and maintaining the temperature to 10~20 °C, and the crystal is washed by butanol for twice, ethyl acetate for once to achieve the final product. Some assumptions are given for the development of the constraint: (1) The COD contribution by the acid and base during PH adjustment procedure are ignored. (2) The crystallization regent usage volume Vc. is about α/5 volume of the liquid entered this step. Fermentation liquor Filtration Filtrate The first extracting solution ½(bulk factor )BA, 10%H2SO4 Acidification,First order extraction The first buffer solution The second discolored extracting solution NaHCO3 alkalization, First reverse extraction ½( bulk factor)BA, 10%H2SO4 Acidification, second order extraction, actived carbon decoloration NaHCO3 Alkalization second Reverse extraction The second buffer solutionCrystal Butanol washing twice (4-6L/billinunit ), ethyl acetate(2L/billin unit) one time,desiccation Crystallization Figure 2: The process of penicillin fermentation flowsheet Then, the constraint on wastewater discharge can be writing as follows: (8) where COD(fer), COD(ext), COD(cry) and COD(w) represent the COD contribution on the fermentation, extraction, crystallization and washing, respectively. COD(con) represents the capacity of the affiliated wastewater treatment unit. The coefficients α and β are the volume ratio and performance of penicillin respectively. Vc and Vw are the regent volume of crystallization and washing, ρc and ρw are their respective density. The coefficients are listed in Table 2 and Table 3. Table 2: The coefficients of constraint (I) COD(fer) COD(ext) COD(cry) COD(w1) COD(con) 11.35 g/g 1.92 g/g 2.41 g/g 2.41 g/g 1.43 g/g Table 3: The coefficients of constraint (II) β(g) ρe(g/L) ρc(g/L) ρw1(g/L) ρw2(g/L) 1.67×1010 880.7 810.9 810.9 902 502 javascript:void(0); javascript:void(0); javascript:void(0); javascript:void(0); javascript:void(0); javascript:void(0); javascript:void(0); 4. Result and discussion Dynopt (Cizniaret.al, 2006) is implemented to solve the optimization of the fed-batch penicillin fermentation process without constraint on wastewater discharge, and the results on penicillin production with different initial feed rate U0 and fermentation time tf are listed in Table 4. The simulation results for columns tf ∈ (100, 130) h can be viewed as invariant, while the rest are fluctuated with different U0. The fluctuation means that the optimal control profiles differ violently for different U0 and the objective is sensitive to U0, which is adversary in industry and need to be avoided. For different rows, high penicillin production is obtained when tf = 100 h. This phenomenon is easy to understand since adequate time is needed for the production and accumulation of penicillin in the fermentation batch, but if the process is does not terminated at the proper time, deteriorated environment may cause the product to be decomposed by the microorganisms. Decision making based on the results in Table 4 is when tf is chosen some value in the middle of the invariant area and U0 starts at low flow rate. Table4: The productivity (P) results for the simulation of penicillin fermentation t(h) U0/(g/h) 80 100 110 120 125 130 150 160 180 5 0.2631 0.8433 0.7856 0.7291 0.7025 0.6769 0.5874 0.2924 0.2873 10 0.4708 0.8087 0.7856 0.7092 0.7022 0.5646 0.5712 0.4932 0.4547 15 0.6599 0.8433 0.7841 0.7268 0.7025 0.6421 0.5802 0.5332 0.4113 20 0.8134 0.8419 0.7467 0.7287 0.7004 0.638 0.5854 0.4675 0.4809 25 0.5997 0.8418 0.7844 0.7293 0.7022 0.6769 0.5783 0.5487 0.4712 30 0.9087 0.8433 0.7395 0.7282 0.6306 0.6759 0.5859 0.4330 0.4871 35 0.907 0.8433 0.7342 0.7293 0.6885 0.677 0.5859 0.5490 0.4880 40 0.9063 0.8418 0.7845 0.6916 0.7021 0.6764 0.5778 0.5492 0.4882 45 0.9084 0.8418 0.7704 0.7289 0.7021 0.6764 0.4681 0.5487 0.4880 50 0.9085 0.8419 0.7849 0.7287 0.7017 0.6764 0.4229 0.5491 0.4100 (a) (b) Figure 3 (a): Results under different value of α and COD(con) when initial feed rate U0=25, fermentation time tf = 100 h; 3(b): The comparison between the two computations with different value of U0 and tf For fed-batch optimization with constraints on wastewater discharge, the threshold COD(con) constraint is decided by the affiliated wastewater treatment unit, and the coefficient α may vary from process to process, we set ranges of these two parameters out of the best of our knowledge on the process and the simulation results are plotted in Figure 3(a). The results show that high production is obtained when COD(con) is large and α is small. While this plot also indicates that the constraint Eq(8) proposed in this paper will affect the optimal control profile. Hence, it is suggested to obtain precise data of COD(con) and α for a given fed-batch process, and the constraint on wastewater discharge is considered for the development of the optimal substrate profile. For intuitional view of the comparison on dynamic optimization with and without constraint on wastewater discharge, Figure 3(b) is given where COD(con) = 1,600 g, α = 0.25 hold constant. For different 503 U0, and tf, the optimal results with constraint on wastewater discharge decreases 40~50 % in penicillin production, compared with the one without the constraints. 5. Conclusion In this paper, the constraint of wastewater discharge is considered for the optimization of the penicillin fed- batch fermentation process. The fed-batch process tends to operate at high capacity to obtain optimal penicillin production. However, with the consideration of the capacity of the affiliated wastewater treatment unit, the optimal input profile may be different. The case study in this paper shows that when COD(con) = 1,600, α = 0.25, the optimal results with constraint on wastewater discharge decreases 40~50 % in penicillin production, compared with the those without the constraints. Therefore, it is suggested to obtain precise data of COD(con)and α for a given fed-batch process, and the constraint on wastewater discharge is considered for the development of the optimal substrate profile. Acknowledgments The authors gratefully acknowledge the following institutions for their support: The National Natural Science Foundation of China (Grant No.21576015); the National Basic Research Program of China, 973 program (Grant No. 2013CB733600); the Fundamental Research Funds for the Central Universities (JD1614). References Bellman R.E., 2003, Dynamic programming, Courier Dover, New York, USA. Cordova M.L.C., Geletu A., Li P., 2016, Optimal scheduling of vaccination campaigns using a direct dynamic optimization method, IFAC-Papers Online, 49(26), 207-212. Cizniar M., Fikar M., Latifi M.A., 2006, MATLAB dynamic optimisation code DYNOPT. User’s Guide. Bratislava, Slovak Republic. Cuthrell J.E., Biegler L.T., 1989, Simultaneous optimization and solution methods for batch reactor control profiles, Comput. Chem. Eng., 13, 49-52. Debasis S., Jayant M., 2005, Pareto-optimal solutions for multi-objective optimization of fed-batch bioreactors using non-dominated sorting genetic algorithm, Chem. Eng. Sci., 60, 481–492. Dai W., Word D. P., Hahn J., 2004, Modelling and dynamic optimization of fuel-grade ethanol fermentation using fed-batch process, Biochemical Engineering Journal, 22, 51–61. Ghovvati M., Khayati G., Attar H., Vaziri A., 2015, Comparison across growth kinetic models of alkaline protease production in batch and fed-batch fermentation using hybrid genetic algorithm and particle swarm optimization, Biotechnology & Biotechnological Equipment, 29(6), 1216-1225. Gill P. E., Murray W., Saunders M. A., 2005, SNOPT: An SQP algorithm for large-scale constrained optimization, SIAM review, 47(1), 99-131. Hend O. Mohamed H.O., Obaid M., Khalil A.K., Nasser A.M.B., 2016, Power generation from unconditioned industrial wastewaters using commercial membranes-based microbial fuel cells, International Journal of Hydrogen Energy, 41(7), 4251-4263. Irene B., Luca D.P., Elisabetta P., 2016, Treatment of Wastewater in H-Type MFC with Protonic Exchange Membrane: Experimental Study of Organic Carbon and Ammonium Reduction with Electrochemical Characterization, Chemical Engineering Transactions, 47, 223-228. DOI:10.3303/CET1647038. Modak J.M., Lim H.C., Tayeb Y.J., 1986, General characteristics of optimal feed rate profiles for various fed- batch fermentation processes, Biotechnology and Bioengineering, 28(9), 1396-1407. Pcolka M., Celikovsky S., 2012, Gradient method optimization of penicillin production: new strategies, 20th Mediterranean Conference on Control & Automation, Barcelona, Spain, 1235-1240. Pontryagin L.S., Blotyanskil V.G., Gamkrelidge R.V., 1962, The mathematical theory of optimal processes, Wiley- Interscience, New York, US. Riascos C.A.M., Pinto J.M., 2004, Optimal control of bioreactors: a simultaneous approach for complex systems, Chemical Engineering Journal, 99, 23-34. San K.Y., Stephanopoulos G., 1989, Optimization of fed-batch penicillin fermentation: A case of singular optimal control with state constraints, Biotechnology and bioengineering, 34(1), 72-78. 504 http://www.sciencedirect.com/science/article/pii/S0360319915313379 http://www.sciencedirect.com/science/article/pii/S0360319915313379 http://www.sciencedirect.com/science/journal/03603199 http://www.sciencedirect.com/science/journal/03603199