Advances in Technology Innovation, vol. 3, no. 2, 2018, pp. 70 - 77 Energy-effective Predictive Temperature Control for Soy Mash Fermentation Based on Compartmental Pharmacokinetic Modelling Sophia Ferng1, Ching-Hua Ting2,*, Chien-Ping Wu2, Yung-Tsong Lu3, Cheng-Kuang Hsu1, Robin Yih-Yuan Chiou1 1 Department of Food Science, National Chiayi University, Chiayi, Taiwan, ROC. 2 Department of Mechanical and Energy Engineering, National Chiayi University, Chiayi, Taiwan, ROC. 3 Department of Biomechatronic Engineering, National Chiayi University, Chiayi, Taiwan, ROC. Received 07 June 2017; received in revised form 05 September 2017; accepted 02 October 2017 Abstract Compartment modelling has been successfully used in pharmacokinetics to describe the kinetics of drug distribution in body tissues. In this study, the technique is adopted to describe the dynamics of temperature response and energy exchange in a soy mash fermentation system. The object ive is to provide a precise temperature-controlled atmosphere for effect ive fermentation with the premise of energy saving. In analogy to pharmacokinetics, water and mash tanks are treated as compartments, energy flow as drug delivery, and the temperature as the drug concentration in a specific compartment. The model allows us to estimate the time of injecting a certain amount of energy to a specific tank (compartment) in a cost-effective way. Thus, model-based temperature control and energy management can be possible. Keywords: soy mash fermentation, temperature, predictive control, energy-effective, compartment model 1. Introduction Soy sauce was invented by the Chinese about 3500 years ago, and the modern producing technology was developed by the Japanese about 500 years ago. The production consists of solid -state fermentation, mash fermentation, and flavouring. The quality and cost of a soy sauce product are mainly determined by the mash fermentation stage. In tradit ion, soy mash is placed in a pottery tank which is exposed to sunshine for 4~12 months. The duration of exposure under the sun is season-dependent as the enzyme and the microbes in the mash are sensible to temperature variations [1-4]. Despite the cost raised by a longer fermentation time and more manpower, tradit ional soy sauces still deserve of popularity as their special flavours are superior to cheap, chemical ones. Because the mash fermentation is manipulated outdoors, the processes of fermentation are easily affected by the climate, and the mash is vulnerable to alien contamination [5]. This may lead to a produce with unstable quality and alien contamination. To overcome this problem, we moved the fermentation from outdoors to indoors and controlled the fermentation climate [5], as shown in Fig. 1. In the system, the pottery containing soy mash is bathed in a water tank and the temperature of the batching water is regulated to meet the requirements of various fermentation stages [5-6]. It has been demonstrated that a controlled fermentation climate can create a well environment fo r the enzymes and microbes participating in mash fermentation [7-8]. Thus, the produce can arrive at a better quality in a shorter time in comparison with the traditional approach [9]. * Corresponding author. E-mail address: cting@mail.ncyu.edu.tw Tel.: +886-5-2717642; Fax: +886-5-2717561 Advances in Technology Innovation, vol. 3, no. 2, 2018, pp. 70 - 77 Copyright ยฉ TAETI 71 Fig. 1 Setup of the energy-saving soy sauce fermentation system [5]. As Fig. 1 illustrates, the system consists of a heat pump which supplies hot water circulation fo r regulat ing the fermenter with desired temperature settings. The system is controlled with a programmable logic controller (PLC) and supervised with an industrial personal computer (IPC). The current principle of operation is to let the heat pump work at noontime for the benefit of a better operational efficiency and the hot water produce is stored in a storage tank for later use, usually in night time . The PLC manipulates the solenoid valves and the circulation pump once the temperature of the mash is below a certain level. These two solenoid valves assure correct water flow directions. Hot water will circulate for 3 min for adequate heat injection into the soy mash. The duration was determined through experimental studies via trial-and-error. Fig. 2 demonstrates the temperature profiles of the soy mash, the atmosphere, and the circu lation water. Clearly, the mash can ferment at an environment with a more stable temperature regardless of a vary ing atmospheric climate. Though, the temperature variation in the fermenter has been improved to be with in 1ยฐC, much improved regardless of vary ing climate, it still fluctuates as a result of simple ON/OFF control using solenoid valves. (a) Temperature responses of the traditional procedure (b) Temperature responses of ON/OFF control Fig. 2 The temperature profiles of the soy mash, the atmosphere, and the water in the bathing tank The price of electricity is different between peak and off-peak times. The heat pump has a maximum efficiency at noontime. However, the demand of hot water circulation is usually in night time, several hours after the hot water preparation. The stored hot water will inevitably lose some heat to the space before being consumed. There should be an optimum time of operat ing the heat pump in term of electricity cost [10-12]. It would be possible to operate the heat pump at a most cost-effective way if we can determine when hot water circulation is demanded. The objective of this study is to develop a temperature and energy prediction model using the compartment modelling technique which has been successfully used in pharmacology for drug administration [13]. As the system described in Fig. 1, we can partition the system into several unique compartments and describe mathematically the energy exchanges among the Advances in Technology Innovation, vol. 3, no. 2, 2018, pp. 70 - 77 Copyright ยฉ TAETI 72 compartments. In analogy to pharmacokinetics, the water storage tanks and the fermentation tanks are treated as compartments, energy exchange among tanks and the atmosphere as drug delivery, the temperature as drug concentration, electrical energy injected into the heat pump can be treated as a dose input. We can estimate energy flows, temperatures responses, and hence, electricity consumption. Based on this, we can determine the best time of heat pump operation and control the time and duration of hot water circulat ion using simple and cheap solenoid valves. Hence, the profit can be promoted as a result of better and efficient fermentation without too much of energy consumption and therefore , secured environmental affect. Accordingly, a compromise can be arrived at among economy, ecology, and energy (3E). 2. Materials and Methods 2.1. Compartment modelling Fig. 3 illustrates the proposed compartment model. The heat pump is identified as an energy supply to the hot water circulat ion system. The soy mash pot (Compartment 2) is bathed in hot water (Compartment 1). There is heat exchange in between. Compartment 1 will inevitably loss heat to the atmosphere. Compartment 3 stores hot water produce from the heat pump. Heat energy is supplied from Compartment 3 to Compartment 1 via water circulation. Cooled water is to be circulated back to Compartment 3 from Compartment 1. Compartment 1 is equipped with a well-designed stirrer that mixes incoming hot water and the existing cool water efficiently. In other word, energy is in jected into Compartment 1 as a dose bolus rather than via heat transfer. Thus, there is no ๐‘˜31 and ๐‘˜13 correlation in between. To simplify the problem, the storage tank (Compartment 3) is treated as an infinite tank comparing to Compartment 1. Since the hot water storage tank is well insulated, no-heat-loss is assumed, ie. ๐‘˜30 = 0 . Eq. (1) describes the dynamics of energy transfer based on the compartmental model; where ๐‘‡1 is the temperature o f Compartment 1, ๐‘‡2 is the temperature of Compartment 2, and r(t) is the injected energy dose: ๏€จ ๏€ฉ ๏€จ ๏€ฉ1 10 12 1 21 2 2 12 1 21 2 dT r t k k T k T dx dT k T k T dx ๏ƒฌ ๏€ฝ ๏€ญ ๏€ซ ๏ƒ— ๏€ซ ๏ƒ—๏ƒฏ๏ƒฏ ๏ƒญ ๏ƒฏ ๏€ฝ ๏ƒ— ๏€ญ ๏ƒ— ๏ƒฏ๏ƒฎ (1) ๐‘˜12๏ผšThe transfer constant of heat in circulation water transfer to soy mash (๐‘ โˆ’1) ๐‘˜21๏ผšThe transfer constant of heat in soy mash transfer to circulation water (๐‘ โˆ’1) ๐‘˜10๏ผšThe transfer constant of heat in circulation water dissipate into the air (๐‘ โˆ’1) ๐‘˜30๏ผšThe transfer constant of heat in storage water dissipate into the air (๐‘ โˆ’1) Fig. 3 The proposed compartment model 2.2. Determination of system parameters Fig. 4 shows the experimental setup for determin ing the k coefficients. Tanks were filled with water of different temperatures and hence, energy flowed from high temperature to low temperature sites. Temperature responses were recorded every 10 min till thermodynamic equilibrium. Acquired data were fitted to first-order equations using the MATLAB curve fitting toolbox. Advances in Technology Innovation, vol. 3, no. 2, 2018, pp. 70 - 77 Copyright ยฉ TAETI 73 (a) for ๐‘˜12 (b) for ๐‘˜21 (c) for ๐‘˜10 Fig. 4 Experimental setups for determining the k coefficients Other parameters to be determined are the volume of the circulat ion water, the volume of the soy mash and the hot water circulation time. 2.3. Energy consumption cost function The heat pump extracts energy from the air to heat up water. The ambient temperature is the key factor that influences the efficiency of heat pump operation [11]. The higher the ambient temperature is, the higher the heat pump efficiency. Hence to operate the heat pump at noontime will have the maximum operational efficiency. However, the noontime is categorized as a peak t ime in electricity pricing, ie. the p rice of electricity is h igher than other times. The mash fermentation tank will have a lower temperature at n ight time and therefore, the hot water prepared at noontime is not used for several hours. In other word, the hot water produced by the heat pump at noontime will loss a big amount of energy to the atmosphere. Thus, it may be more profitable by operating the heat pump away from noontime as a compromise among electricity price, heat pump efficiency, and energy loss. Accordingly, an energy consumption cost function is to be developed to account for the efficiency of the heat pump, the electricity pricing policy, and the heat loss of the hot water storage tank. 3. Results and Discussion 3.1. System parameters Temperature responses were acquired with a sampling period of 10 min for 6 h which is long enough for the system to reach thermodynamic equilibrium. The acquired data are fitted to a first-order equation using the MATLAB curve fitting toolbox. Fig. 5 shows the temperature responses. (a) for ๐‘˜12 (b) for ๐‘˜21 (c) for ๐‘˜10 Fig. 5 Temperature responses for determining the compartment-model coefficients Fig. 5(a) is the temperature profile for ๐‘˜12 and can be described as: ๐‘‡ = 5.727๐‘’ โˆ’๐‘ก 7.143โ„ + 39.37 ยฐC (2) with a t ime resolution of 10 min (600 s). The t ime constant is 7.143 ร— 600 = 4285.8 s and its reciprocal gives ๐‘˜12 = 2.33 ร— 10โˆ’4 ๐‘ โˆ’1. Advances in Technology Innovation, vol. 3, no. 2, 2018, pp. 70 - 77 Copyright ยฉ TAETI 74 Fig. 5(b) is the temperature profile for ๐‘˜21 and can be described as: ๐‘‡ = 9.86๐‘’โˆ’๐‘ก 5.821โ„ + 36.52 ยฐC (3) The time constant is 5.821 ร— 600 = 3492.6 s and its reciprocal gives ๐‘˜12 = 2.86 ร— 10โˆ’4 ๐‘ โˆ’1. Fig. 5(c) is the temperature profile for k 10. The bathing tank is cladded with a good insulation material. Hence as the profile shows, this is a very slow heat transfer system. It took 11 days to reach thermodynamic equilibrium and resulted in 1716 record ings. These data are down-sampled with a factor of 50. The profile can be described with first -order dynamics, as: ๐‘‡ = 18.85๐‘’ โˆ’๐‘ก 8.523โ„ + 28.81 ยฐC (4) The new sampling period is 60 ร— 10 ร— 50 = 3 ร— 104 s , the time constant is 8.523 ร— 30000 = 255690 s , and the coefficient is ๐‘˜10 = 3.91 ร— 10โˆ’6 ๐‘ โˆ’1. 3.1.1. Other constants Compartment 1 has a space of 220 litres for circulat ion water and Compartment 2 accommodates 160 litres of soy mash. 3.1.2. Thermodynamics of the circulation water The purpose of water circulat ion control is to regulate the temperature of the soy mash in Compartment 2 through controlling the heat in jected into Compartment 1. Fig. 6 illustrates the conceptual thermodynamics of the two compartments. Compartment 1 has a water d istributor designed to mix the incoming water with the existing one in an effective way. Hence the two media are assumed to mix instantaneously. The first law of thermodynamics describes the heat balance of the thermodynamic system, as: ๐‘„๐‘–๐‘› + ๐‘„๐‘œ๐‘Ÿ๐‘–๐‘”๐‘–๐‘› โˆ’ ๐‘„๐‘œ๐‘ข๐‘ก = ๐‘„๐‘“๐‘–๐‘›๐‘Ž๐‘™ (5) Fig. 6 Heat balance in the batching tank Substituting ๐‘„ = ๐‘š ร— โ„Ž๐‘“ to Eq. (4) and discretizing give, ๏ฟฝฬ‡๏ฟฝโ„Ž ร— โˆ†๐‘ก ร— โ„Ž๐‘“ (๐‘‡โ„Ž ) + ๐‘š๐‘ ร— โ„Ž๐‘“ (๐‘‡๐‘,๐‘˜โˆ’1) โˆ’ ๏ฟฝฬ‡๏ฟฝโ„Ž ร— โˆ†๐‘ก ร— โ„Ž๐‘“ (๐‘‡๐‘,๐‘˜โˆ’1) = ๐‘š๐‘ ร— โ„Ž๐‘“ (๐‘‡๐‘,๐‘˜ ) (6) with ๏ฟฝฬ‡๏ฟฝโ„Ž the circulating water flow rate, โ„Ž๐‘“ the enthalpy of water at a specific temperature, ๐‘š๐‘ the mass of the bathing water, ๐‘‡โ„Ž the temperature of the incoming hot water, ๐‘‡๐‘ the temperature of the bathing water, โˆ†๐‘ก the heating duration, and k the time stamp. The enthalpy can be approximated with the specific heat, ie. โ„Ž๐‘“ โ‰… ๐ถ๐‘ ร— ๐‘‡ , hence Eq. (6) can be rewritten as: ๏ฟฝฬ‡๏ฟฝโ„Ž ร— โˆ†๐‘ก ร— ๐ถ๐‘ ร— ๐‘‡โ„Ž + ๐‘š๐‘ ร— ๐ถ๐‘ ร— ๐‘‡๐‘,๐‘˜โˆ’1 โˆ’ ๏ฟฝฬ‡๏ฟฝโ„Ž ร— โˆ†๐‘ก ร— ๐ถ๐‘ ร— ๐‘‡๐‘,๐‘˜โˆ’1 = ๐‘š๐‘ ร— ๐ถ๐‘ ร— ๐‘‡๐‘,๐‘˜ (7) Rearranging the above gives the temperature response: ๐‘‡๐‘ ,๐‘˜ โˆ’ ๐‘‡๐‘,๐‘˜โˆ’1 = โˆ†๐‘‡๐‘ = ๏ฟฝฬ‡๏ฟฝโ„Žร—โˆ†๐‘ก ๐‘š๐‘ (๐‘‡โ„Ž โˆ’ ๐‘‡๐‘,๐‘˜โˆ’1) (8) The following values are used for simulation validation: ๏ฟฝฬ‡๏ฟฝโ„Ž = 10kg/min, โˆ†๐‘ก = 3 min, ๐‘š๐‘ = 220 kg, ๐‘‡โ„Ž = 47โ„ƒ . The water storage tank (Compartment 3) has a capacity of 1500 lit res and only 30 litres are demanded for the circulat ion. Advances in Technology Innovation, vol. 3, no. 2, 2018, pp. 70 - 77 Copyright ยฉ TAETI 75 Hence it is reasonable to assume a constant ๐‘‡โ„Ž . The initial temperature of the bathing water ๐‘‡๐‘,kโˆ’1 is assumed as 36.8ยฐC. Substituting the above values into Eq. (8) results in โˆ†๐‘‡๐‘ = 1.39ยฐC , ie. a 3-min heat in jection heats up the bathing water by 1.39ยฐC . This information will be used in compartment modelling. 3.1.3. Validation The compartment model of Fig. 3 was validated using the MATLAB SimBiology toolbox using the parameters identified in Section 3. Fig. 7 shows simulation and actual responses . There is a strong degree of coherence in between. This promising result indicates that the proposed compartment model can effectively describes the energy flows of the fermentation system. Fig. 7 Simulation and actual responses It is clear that the t iming of operating the heat pump is the key issue of saving energy cost for the fermentation system. The timing should account for the operational efficiency, electricity pricing, and heat losses from tanks. Thus, the above three factors are transcribed as an energy cost function: minimising the function for the least energy bill. In this study, the heat pump was set to produce hot water at 47โ„ƒ. The energy for 1 litre of hot water produce is: ๐‘„ = ๐‘š ร— ๐ถ๐‘ ร— โˆ†๐‘‡ = 1 ร— 4.2 ร— (47 โˆ’ ๐‘‡๐‘ก ) = 197.4 โˆ’ 4.2 ๐‘‡๐‘ก (9) with ๐‘‡๐‘ก the temperature of the water in the storage tank, which can be estimated using the compartment model . The performance of a heat pump is described with the so-called Coefficient of Performance (COP). It is a ratio of the heat generated, Q, by the heat pump to the energy consumed, W, by the heat pump [14], as: ๐ถ๐‘‚๐‘ƒ = ๐‘„ ๐‘Š (10) The work done by the heat-pump compressor is: ๐‘Š = ๐‘„ ๐ถ๐‘‚๐‘ƒ = 197.4โˆ’4.2 ๐‘‡๐‘ก ๐ถ๐‘‚๐‘ƒ ๐‘˜๐ฝ (11) The COP coefficient is sensitive to the ambient temperature ๐‘‡๐‘Ž . Table 1 lists the COPs of the heat pump (CHP-80Y, SUN TECH, Taiwan). The hotter the ambient is, the larger the COP. Table 1 COPs of the heat pump at different ambient temperatures Ambient (ยฐm) -20 -15 -10 -5 0 2 7 10 16 20 25 30 35 43 COP 2.2 2.4 2.6 2.5 2.6 2.8 3.7 4.0 4.2 4.3 4.4 4.5 4.4 4.3 Advances in Technology Innovation, vol. 3, no. 2, 2018, pp. 70 - 77 Copyright ยฉ TAETI 76 The compressor of the heat pump is assumed to have an efficiency ฮท=0.9. The work demanded by the heat pump to produce 1 litre of hot water is: ๐‘Š๐‘– = ๐‘Š ๐œ‚ = 197.4 โˆ’ 4.2 ๐‘‡๐‘ก ๐ถ๐‘‚๐‘ƒ รท 0.9 = 219.33 โˆ’ 4.67 ๐‘‡๐‘ก ๐ถ๐‘‚๐‘ƒ kJ (12) or in KWH, as: ๐‘Š๐‘– = 219.33 โˆ’ 4.67 ๐‘‡๐‘ก ๐ถ๐‘‚๐‘ƒ รท (3.6 ร— 103 ) = 0.060925 โˆ’ 0.001297 ๐‘‡๐‘ก ๐ถ๐‘‚๐‘ƒ ๐พ๐‘Š๐ป (13) The cost C, in NTD, that the heat pump take to produce 1 litre of hot water is: ๐ถ = ๐ธ ๐ถ๐‘‚๐‘ƒ (0.060925 โˆ’ 0.001297 ๐‘‡๐‘ก ) (14) where E is the price of unit KWH in NTD/KW H, a value varies at peak and off-peak times. Table 2 shows the pricing policy of Taiwan Power Company (TPC). The above cost function is a function of the time of heat pump operation (transcribed as COP and E) and heat losses from the storage tanks (transcribed as ๐‘‡๐‘ก). Table 2 Pricing policy of Taiwan Power Company 4. Conclusions We have built a compartment model for describing temperature response, heat exchange, and energy demand of a soy mash fermentation system. There is a strong coherence between simulat ion and actual results. Simulation results show that the model can accurately predict the trend of temperature response. Thus, our next work is to implement model -based predictive temperature control based on the developed compartment model. This will g ive a more precise temperature control. The model also describes the heat exchange, or energy flow, between tanks (compartments). This feature allows us to estimate the optimum t ime of running the heat pump. Hence we can arrive at a p romising temperature control with an economic electricity bill. Acknowledgements This work was sponsored by the Ministry of Science and Technology of the ROC (Taiwan) Government under the grant MOST 105-2221-E-415-030, and by the Research Center for Energy Technology and Strategy of National Chengkung University, Taiwan, ROC. References [1] N. W. Su, M. L. Wang, K. F. Kwok, and M. H. Lee, โ€œEffects of temperature and sodium chloride concentration on the activities of proteases and amylases in soy sauce koji,โ€ Journal of Agricultural and Food Chemistry, vol. 53, no. 5, pp. 1521-1525, March 2005. [2] Y. Zhu and J. Tramper, โ€œKoji: Where east meets west in fermentation,โ€ Biotechnology Advances, vol. 31, no. 8, pp. 1448-1457, December 2013. summertime non-summertime peak time 07:30~22:30 3.24 3.18 00:00~07:30 22:30~24:00 00:00~07:30 22:30~24:00 Sun and off-peak day Mon~Fri Sat 2.06 1.39 1.33 all day 1.39 1.33 off-peak time off-peak time half-peak time 07:30~22:30 1.39 1.33 2.14 off-peak time Advances in Technology Innovation, vol. 3, no. 2, 2018, pp. 70 - 77 Copyright ยฉ TAETI 77 [3] J. S. Lee, S. J. Rho, Y. W. Kim, K. W. Lee, and H. G. Lee, โ€œEvaluation of biological activities of the short -term fermented soybean extract,โ€ Food Science and Biotechnology, vol. 22, no. 4, pp. 973-978, August 2013. [4] C. Cui, M. Zhao, D. Li, H. Zhao, and W. Sun, โ€œBiochemical changes of traditional Chinese -type soy sauce produced in four seasons during processing,โ€ CyTA - Journal of Food, vol. 12, no. 2, pp. 166-175, October 2014. [5] S. H. Ferng, C. P. Wu, Y. T. Lu, W. H. Huang, T. C. Lin, C. K. Hsu, J. S. Ju, and C. H. Ting, โ€œAutomatic control of soy mash fermentation for performance promotion using green energy with energy conservation,โ€ The 8th International Symp. Machinery and Mechatronics for Agriculture and Biosystems Engineering (ISMAB), Niigata, Japan, May 2016. [6] T. R. Chen, and R. Y. Y. Chiou, โ€œMicrobial and compositional changes of Inyu (Black soybean sauce) broth during fermentation under various temperature conditions ,โ€ Journal of the Chinese Agricultural Chemical Society, vol. 34, no. 2, pp. 157-164, 1995. [7] X. Gao, C. Cui, H. Zhao, M. Zhao, L. Yang, and J. Ren, โ€œChanges in volatile aroma compounds of traditional Chinese-type soy sauce during moromi fermentation and heat treatment,โ€ Food Science and Biotechnology, vol. 19, no. 4, pp. 889-898, 2010. [8] N. W. Su, M. L. Wang, K. F. Kwok, and M. H. Lee, โ€œEffects of temperature and sodium chloride concentration on the activities of proteases and amylases in soy sauce koji,โ€ Journal of Agricultural and Food Chemistry, vol. 53, pp. 1521-1525, August 2005. [9] N. X. Hoang, S. Ferng, C. H. Ting, W. H. Huang, R. Y. Y. Chiou, and C. K. Hsu, โ€œOptimizing the initial moromi fermentation conditions to improve the quality of soy sauce,โ€ LWT - Food Science and Technology, vol. 74, pp. 242-250, December 2016. [10] T. Olsson, โ€œEvaluating machine learning for predicting next-day hot water production of a heat pump,โ€ 2013 Fourth International Conf. Power Engineering, Energy and Electrical Drives (POWERENG), May 2013. [11] J. Cummings and C. Withers, โ€œEnergy savings and peak demand reduction of a SEER 21 heat pump vs. a SEER 13 heat pump with attic and indoor duct systems,โ€ US Department of Energy, March 2014. [12] M. Kassai, โ€œA developed method for energy saving prediction of heat -and energy recovery units ,โ€ Energy Procedia, vol. 85, pp. 311-319, January 2016. [13] W. B. Runciman and R. N. Upton, Anaesthetic pharmacology review: pharmacokinetics , Castle House Publications, 1994. [14] C. M. Faye, D. P. Jerald, D. S. Jeffrey, Heating, ventilating, and air conditioning: analysis and design, 6th ed. John Wiley & Sons, 2004.