Dynamics of forced and unsteady-state processes Davide Manca Lesson 3 of Dynamics and Control of Chemical Processes Master Degree in Chemical Engineering Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 1
Forced unsteady-state reactors Forced unsteady state (FUS) reactors allow reaching higher conversions than conventional reactors. Two alternatives: Reverse flow reactors, RFR; Network of reactors: simulated moving bed reactors, SMBR. Within a SMBR network, the simulated moving bed is accomplished by periodically switching the feed inlet from one reactor to the following one. APPLICATION: Methanol synthesis (ICI patent). Operating temperature: 220-300 C; Pressure: 5-8 MPa; CO = 10-20%; CO 2 = 6-10%; H 2 = 70-80%. Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 2
Forced unsteady-state reactors Catalytic exothermic reactions can be carried out with an autothermal regime. FUS reactors are mainly advantageous when either the reactants concentration or the reactions exothermicity are low. There is an increase of both conversion and productivity that allows: Using smaller reactors, Lower amounts of catalyst. Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 3
Methanol synthesis in forced unsteady-state reactors The methanol synthesis reaction is: CO 2H2 CH3OH H R 90.769 kj/mol The reaction takes place with a reduction of the moles number. Therefore, the reaction is carried out at high pressure. In the past, the methanol plants worked at 100 600 bar. Nowadays, methanol plants work at lower pressures (50 80 bar). In the low-pressure plants, the following reactions are important too: CO H CO H O 2 2 2 CO 3H CH OH H O 2 2 3 2 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 4
Reverse Flow Reactors Valves: V 1, V 2, V 3, V 4 allow periodically inverting the feed direction in the reactor. Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 5
RFR: first principles model Equations #Eq. Eq. type Variables Gas phase enthalpic balance 1 Partial derivative T G, T S, yg,i i 1...nComp Solid phase enthalpic balance (catalyst) 1 Partial derivative T G, T S, yg,i, i 1...nComp ys,i i 1...nComp Gas phase material balance ncomp Partial derivative T G, T S, yg,i, i 1...nComp ys,i i 1...nComp Solid phase material balance (catalyst) ncomp Non-linear algebraic T G, T S, yg,i, i 1...nComp ys,i i 1...nComp 2nComp 2 2nComp 2 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 6
RFR: methanol synthesis Reactor diameter Reactor length Void fraction Catalyst mass Apparent catalyst density Catalyst porosity Pellet diameter Inlet temperature Working pressure Surface flowrate Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 7
RFR: methanol synthesis Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 8
Reverse Flow Reactors Temperature profile once the pseudo-stationary condition is reached Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 9
Reverse Flow Reactors Concentration profile once the pseudo-stationary condition is reached Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 10
Simulated Moving Bed Reactors 3 1 2 Step 2: 3: 1: 1g2g3 2g3g1 3g1g2 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 11
Simulated Moving Bed Reactors Kinetic equations corresponding to a dual-site Langmuir- Hinshelwood mechanism, based on three independent reactions: methanol formation from CO, water-gas-shift reaction and methanol formation from CO2: Velardi S., A. Barresi, D. Manca, D. Fissore, Chem. Eng. J., 99 117 123, 2004 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 12
Simulated Moving Bed Reactors Reaction rates for a catalyst based on Cu Zn Al mixed oxides Velardi S., A. Barresi, D. Manca, D. Fissore, Chem. Eng. J., 99 117 123, 2004 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 13
Simulated Moving Bed Reactors Velardi S., A. Barresi, D. Manca, D. Fissore, Chem. Eng. J., 99 117 123, 2004 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 14
Simulated Moving Bed Reactors After a suitable number of switches the temperature profile reaches a pseudostationary condition. High switch times Low switch times Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 15
T GAS [ C] SMBR: the thermal wave 320 300 280 260 240 220 200 180 160 140 150 s 170 s 220 s 240 s 250 s 260 s 120 0 1 2 3 Reactors Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 16
SMBR: open loop response Velardi S., A. Barresi, D. Manca, D. Fissore, Chem. Eng. J., 99 117 123, 2004 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 17
SMBR: open loop response Velardi S., A. Barresi, D. Manca, D. Fissore, Chem. Eng. J., 99 117 123, 2004 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 18
SMBR: open loop response Disturbance stop after 195 switches Disturbance stop after 310 switches There are more periodic stationary conditions Velardi S., A. Barresi, D. Manca, D. Fissore, Chem. Eng. J., 99 117 123, 2004 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 19
The control problem FEATURES The system may suddenly diverge to unstable operating conditions (even chaotic behavior); The network may shut-down; The reactors may work in a suboptimal region. PROBLEM The reactor network should work within an optimal operating range; Such a range is often narrow and its identification may be difficult. SOLUTION A suitable control system must be synthesized and implemented on-line to avoid both shut-down and chaotic behaviors; An advanced control system is highly recommended; Model based control Model Predictive Control, MPC. Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 20
Numerical modeling The model based approach to the control problem calls for the implementation of a numerical model of the network that will be used for: 1. Identification of the optimal operating conditions; 2. Control purposes, i.e. to predict the future behavior of the system. The numerical model is based on a first principles approach: The reactors are continuously evolving (they never reach a steady-state condition) time derivative; Each PFR reactor must be described spatially spatial derivative; The reacting system is catalyzed (therefore it is heterogeneous). Consequently, an algebraic term is required PDAE system. The PDAE system is spatially discretized DAE system. A total of 1067 differential and algebraic equations must be solved to determine the dynamic evolution of the network. Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 21
H 2 molar fraction Mathematical tricks Stoichiometric closure: ncomp 1 icomp 1 y G,nComp 1 y G,iComp 0.936 0.934 0.932 0.930 0.928 0.926 0.924 0.922 0.920 0 1 2 3 Reactors Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 22
Numerical solution of the DAE Boolean matrix that shows the presence indexes of the differential-algebraic system Specifically tailored numerical algorithm for tridiagonal block systems Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 23
Numerical solution of the DAE Boolean matrix that shows the presence indexes of the differential-algebraic system Specifically tailored numerical algorithm for banded systems Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 24
Numerical solution of the DAE BzzDAEFourBlocks Algebraic equations Algebraic variables Algebraic equations Differential variables Differential equations Algebraic variables Differential equations Differential variables Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 25
Numerical solution of the DAE Simulation time: 4000 s Switch time: 40 s Spatial discretization nodes: 97 Number of equations per node: 11 Total number of DAEs: 1067 CPU: Intel Pentium IV 2.4 GHz RAM: 512 MB OS: MS Windows 7 Professional Compiler: COMPAQ Visual Fortran 6.1 + MICROSOFT C++ 6.0 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 26
T GAS [ C] CH 3 OH molar fraction Numerical simulation 0.045 0.040 0.035 0.030 0.025 0.020 0.015 0.010 0.005 0.000 0 1 Reactors 2 3 300 280 260 240 220 200 180 160 140 120 0 1 Reactors 2 3 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 27
T GAS [ C] CH 3 OH molar fraction Numerical simulation 0.045 0.040 0.035 0.030 0.025 0.020 Switch time = 40 s 0.015 0 1000 Time [s] 3000 4000 310 300 290 280 270 260 250 0 1000 Time [s] 3000 4000 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 28
Parametric sensitivity study Variability interval of the analyzed process variables Variable Interval Inlet gas temperature, T in [K] 300 593 Inlet gas velocity, v in [m/s] 0.0189 0.0231 Switch time, t c [s] 1 350 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 29
Parametric sensitivity study Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 30
Parametric sensitivity study Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 31
Parametric sensitivity study Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 32
Need for speed THE POINT: to simulate 100 switches of the inlet flow with a switch time of 40 s (total of 4,000 s) the DAE system, comprising 1067 equations, takes about 95 s of CPU time on a workstation computer. PROBLEM: the detailed first principles model requires a CPU time that is prohibitive for model based control purposes. SOLUTION A high efficiency numerical model in terms of CPU time is therefore required; Such a model should be able to describe the nonlinearities and the articulate profiles of the network of reactors; Artificial Neural Networks, ANN, may be the answer. Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 33
System identification with ANN Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 34
ANN architecture Input variables Range Inlet gas temperature, T in [K] 423 453 Inlet gas velocity, v in [m/s] 0.0189 0.0231 Switch time, t c [s] 10 50 Output variables Mean methanol molar fraction, x CH3OH Outlet gas temperature, T GAS [K] Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 35
ANN architecture Levels # of nodes Activation function 1 Input 40 Sigmoid 2 Intermediate 1 15 Sigmoid 3 Intermediate 2 15 Sigmoid 4 Output 1 Linear # of weights and biases 840 + 31 = 871 Learning factor, a 0.716 Momentum, b 0.366 Linear activation constant, m 0.275 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 36
t c [s] v in [m/s] T in [K] Random input patterns 455 450 Inlet gas temperature 445 440 435 430 425 425 0.023 Inlet gas velocity 0.022 0.021 0.020 0.019 50 45 40 35 30 25 20 15 10 Switch time 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 Input patterns Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 37
Levemberg Marquard learning algorithm Initialization of weights + biases SECOND ORDER ALGORITHM Load of the input patterns n ( n) OR n N? av NO YES MAX Forward i N? o i (n) (n) i Random selection YES ERMS (n) x i (n) y i NO av (n) w i (n) b i (n) LM equation Backward new ( n ) av ERMS new av? av Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 38
ERMS (log) Algorithms comparison 1 0.1 0.92 s First order Batch Mode First order Pattern Mode Second order LM 10-2 0.86 s 16.37 s 22.32 s 110.25 s 10-3 50.86 s 10-4 85.37 s 127.80 s 10-5 230.03 s 10-6 778.42 s 10-7 3172.50 s 4581.86 s 10-8 1 10 100 500 Iterations Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 39
t c [s] CH 3 OH molar fraction The overlearning problem 0.041 0.040 0.039 0.038 0.037 0.036 0.035 0.034 0.033 0.032 Detailed model I order II order 50 40 30 20 10 2000 3000 4000 5000 6000 7000 8000 9000 Time [s] Disturbance on the switch time (from 30 to 10 s) Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 40
ERMS The overlearning problem 1 0.1 13 th iterat. 31 th iteration Learning Cross Validation 10-2 10-3 10-4 10-5 10-6 10-7 10-8 1 10 100 500 Iterations Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 41
Relative error CH 3 OH molar fraction ANN cross-validation 0.041 0.040 0.039 0.038 0.037 Detailed model ANN 0.036 0.035 0.034 0.033 0.032 0.45% 0.40% 0.35% 0.30% 0.25% 0.20% 0.15% 0.10% 0.05% 0.00% 0 100 200 300 400 500 600 Pattern number 700 800 900 1000 Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 42
T in [K] CH 3 OH molar fraction ANN disturbance response 0.041 0.040 0.039 0.038 0.037 0.036 0.035 0.034 0.033 0.032 Detailed model ANN 455 450 445 440 435 430 425 420 415 2000 3000 4000 5000 6000 7000 8000 9000 Time [s] Disturbance on the inlet temperature 438 443 433 [K] Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 43
t c [s] CH 3 OH molar fraction ANN disturbance response 0.041 0.040 0.039 0.038 0.037 0.036 0.035 0.034 0.033 0.032 Detailed model ANN 50 40 30 20 10 2000 3000 4000 5000 6000 7000 8000 9000 Time [s] Disturbance on the switch time 30 45 [s] Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 44
V in [m/s] CH 3 OH molar fraction ANN disturbance response 0.041 0.040 0.039 0.038 0.037 0.036 0.035 0.034 0.033 0.032 Detailed model ANN 0.023 0.022 0.021 0.020 0.019 2000 3000 4000 5000 6000 7000 8000 9000 Time [s] Disturbance on the inlet velocity 0.021 0.0194 [m/s] Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 45
ANN CPU times MISO MIMO ANN output variables CH 3 OH T G CH 3 OH+T GAS # of output nodes 1 1 2 # of weights and biases 840+31=871 840+31=871 855+32=887 Jacobian matrix dimensions 4000 x 871 4000 x 871 8000 x 887 CPU time for evaluating J T J [s] 17.38 17.37 49.13 Learning procedure CPU time 3h 14 min 3h 13 min 8 h 18 min CPU time for a single ANN simulation [s] 8.08E-6 8.23E-6 8.86E-6 ABOUT 6 ORDERS OF MAGNITUDE IMPROVEMENT BETWEEN THE FIRST PRINCIPLES MODEL AND THE ANN ON-LINE FEASIBILITY OF MODEL BASED CONTROL Davide Manca Dynamics and Control of Chemical Processes Master Degree in ChemEng Politecnico di Milano L3 46