Presentation is loading. Please wait.

Presentation is loading. Please wait.

Constrained Fitting Calculation the rate constants for a consecutive reaction with known spectrum of the reactant A = (A A + A B + A C ) + R = C E T =

Similar presentations


Presentation on theme: "Constrained Fitting Calculation the rate constants for a consecutive reaction with known spectrum of the reactant A = (A A + A B + A C ) + R = C E T ="— Presentation transcript:

1 Constrained Fitting Calculation the rate constants for a consecutive reaction with known spectrum of the reactant A = (A A + A B + A C ) + R = C E T = (c A e A T + c B e B T + c C e C T ) + R A - c A e A T = ( c B e B T + c C e C T ) + R A cAcA eAeA A -A C’ E ’T R -==+

2 r_cons2.m Calculation the residual based on known spectrum of reactant

3

4

5 ? Compare the errors of parameters with and without known spectrum of reactant.

6 ? How selectivity constraint (zero region) can be applied in calculation the residual vector?

7 Chemical Kinetics Modeling by Numerical Solving of Ordinary Differential Equations

8 Calculation of kinetic concentration profiles The central step in the fitting of a kinetic model to multivariate measured data is being able to calculate the concentration profiles of the species involved in a chemical reaction. A = C E + R According to kinetic theory, the concentration prfiles of the species in a reaction mechanisms are defined by a system of ordinary differential equations (ODEs) A B k1k1 k2k2 d[A] dt = -k 1 [A] + k 2 [B] d[B] dt = k 1 [A] - k 2 [B] A B C k1k1 k2k2 d[A] dt = -k 1 [A] d[B] dt = k 1 [A] - k 2 [B] d[C] dt = k 2 [B]

9 Complex Reactions A B C k1k1 k2k2 k3k3 k4k4 D d[A] dt = -k 1 [A] d[B] dt = k 1 [A] - k 2 [B] –k 3 [B] + k 4 [D] d[C] dt = k 2 [B] d[D] dt = k 3 [B] – k 4 [D]

10 k1k1 k2k2 A D + E k3k3 B D + F k4k4 C D + G k5k5 k6k6 k7k7 d[A] dt = -k 1 [A] – k 3 [A] d[B] dt = k 1 [A] – k 2 [B] – k 4 [B] d[C] dt = k 2 [B] – k 5 [C] d[D] dt = k 3 [A] + k 4 [B] + k 5 [C] d[E] dt = k 3 [A] – k 6 [E] d[F] dt = k 6 [E] + k 4 [B] – k 7 [F] d[G] dt = k 7 [F] + k 5 [C]

11 Numerical Integration of ODEs system There is a limited number of reaction mechanisms for which there are explicit formulae to calculate the concentrations of the reacting species as a function of time. To overcome this, numerical integration is used. Numerical integration allows an approximation to the explicit solution to be calculated for any system of ODEs, within limits of numerical accuracy and computation time. An example B C 2 A B k1k1 k2k2 d(A] dt d(B] dt d(C] dt = -2 k 1 [A] 2 = k 1 [A] 2 - k 2 [B] = k 2 [B] [A] 0 =1 [B] 0 =[C] 0 =0

12 The Euler Method The Euler method is the simplest method for the numerical integration of a system of differential equations. It can be seen as an adaptation of the truncated Taylor series expansion. The Taylor series expansion f (x +  x) = f (x) + ( ) (  x) + ( ) (  x) 2 df (x) d x 2! 1 d n f (x) d n x d 2 f (x) d2xd2x + … + ( ) (  x) n n! 1 f (x +  x) = f (x) + ( ) (  x) df (x) d x C at t 0 is C 0 What is C at t=t 0 +  t ? C(t 0 +  t)= C(t 0 ) + (dC(t 0 )/dt)  t

13 d(A] dt = -2 k 1 [A] 2 The Euler Method [A] 0 =1 [B] 0 =[C] 0 =0 If k 1 =0.2 k 2 =0.4 [A] 1 = [A] 0 + (d[A] 0 / dt)  t (d[A] 0 / dt) = - 2(0.2)(1) 2 = - 0.4 for  t = 0.2 [A] 1 = 1 – (0.4) (0.2) = 0.92 (d[A] 1 / dt) = - 2(0.2)(0.92) 2 = -0.3386 [A] 2 = 0.92 – (0.3386) (0.2) = 0.8523 [A] 2 = [A] 1 + (d[A] 1 / dt)  t

14 euler.m

15

16 Effect of time increment on calculated concentration profiles by Euler method dt 1 =0.1 dt 2 =0.2 dt 3 =0.4 dt 4 =0.6 dt 5 =0.8 dt 6 =1

17 ? A B k1k1 k2k2 Modify the euler.m file for calculating the concentration profiles for the following mechanism:

18 Fourth Order Runge-Kutta Method The main disadvantage of the Euler method is that the calculated approximation for the concentrations are systematically wrong for each step. For a good accuracy, step sizes have to be very small. Fourth order Runge-Kutta method is a modification of Euler method. It is called fourth order because the first derivative is calculated at four points along the increment of integration, allowing much larger increments and thus dramatically reduced computation times compared to the simple Euler method.

19 B C 2 A B k1k1 k2k2 d(A] dt d(B] dt d(C] dt = -2 k 1 [A] 2 = k 1 [A] 2 - k 2 [B] = k 2 [B] [A] 0 =1 [B] 0 =[C] 0 =0 Fourth Order Runge-Kutta Method Step 1 Calculating the derivatives of the concentration at t 0 (d[A] 0 / dt) = - 2(0.4)(1) 2 = - 0.8 (d[B] 0 / dt) = (0.4)(1) 2 – (0.2)(0) = 0.4 If k 1 =0.4 k 2 =0.2 (d[C] 0 / dt) = (0.2)(0) = 0

20 Step 2 Calculating approximate concentration at the intermediate time point,  t/2 based on concentration and derivative at t0 Fourth Order Runge-Kutta Method [A] 1 = [A] 0 + (d[A] 0 / dt)  t/2 [A] 1 = 1 – (0.8) (0.1) = 0.92 [B] 1 = [B] 0 + (d[B] 0 / dt)  t/2 [B] 1 = 0 + (0.4) (0.1) = 0.04 [C] 1 = [C] 0 + (d[C] 0 / dt)  t/2 [C] 1 = 0 + (0) (0.1) = 0

21 Step 3 Calculating the derivatives at the intermediate time point. Fourth Order Runge-Kutta Method (d[A] 1 / dt) = - 2(0.4)(0.92) 2 = - 0.6771 (d[B] 1 / dt) = (0.4)(0.92) 2 – (0.2)(0.04) = 0.3306 (d[C] 1 / dt) = (0.2)(0.04) = 0.008

22 Step 4 Calculating another set of concentrations at the intermediate time point, now based on concentration at time 0 and derivatives at the intermediate time point. Fourth Order Runge-Kutta Method [A] 2 = [A] 0 + (d[A] 1 / dt)  t/2 [A] 2 = 1 – (0.6771) (0.1) = 0.9323 [B] 2 = [B] 0 + (d[B] 1 / dt)  t/2 [B] 2 = 0 + (0.3306) (0.1) = 0.03306 [C] 2 = [C] 0 + (d[C] 1 / dt)  t/2 [C] 2 = 0 + (0.008) (0.1) = 0.0008

23 Step 5 Calculating a new set of derivatives at the intermediate time point, based on the concentration just calculated Fourth Order Runge-Kutta Method (d[A] 2 / dt) = - 2(0.4)(0.9323) 2 = -0.6953 (d[B] 2 / dt) = (0.4)(0.9323) 2 – (0.2)(0.03306) = 0.3411 (d[C] 2 / dt) = (0.2)(0.03306) = 0.00661

24 Step 6 Calculating the concentration at the new time point 1, after the complete time interval, based on the concentration at t o and these new derivatives at the intermediate time point: Fourth Order Runge-Kutta Method [A] 3 = [A] 0 + (d[A] 2 / dt)  t [A] 3 = 1 – (0.6953) (0.2) = 0.8609 [B] 3 = [B] 0 + (d[B] 2 / dt)  t [B] 3 = 0 + (0.3411) (0.2) = 0.0682 [C] 3 = [C] 0 + (d[C] 2 / dt)  t [C] 3 = 0 + (0.00661) (0.2) = 0.0013

25 Step 7 Computation of derivatives at time point 1: Fourth Order Runge-Kutta Method (d[A] 3 / dt) = - 2(0.4)(0.8609) 2 = -0.5929 (d[B] 3 / dt) = (0.4)(0.8609) 2 – (0.2)(0.0682) = 0.2828 (d[C] 3 / dt) = (0.2)(0.0682) = 0.0136

26 Step 8 Computation the new concentration after the ful time interval based on weighted average of derivatives Fourth Order Runge-Kutta Method [A] new = [A] 0 + (d[A] new / dt)  t [A] 3 = 1 – (0.6896) (0.2) = 0.8621 [B] new = [B] 0 + (d[B] new / dt)  t [B] 3 = 0 + (0.3377) (0.2) = 0.0675 [C] new = [C] 0 + (d[C] new / dt)  t [C] 3 = 0 + (0.0071) (0.2) = 0.0014 d[A] new /dt) = d[A] 0 /dt) + 2 (d[A] 1 /dt) + 2(d[A] 2 /dt) +(d[A] 3 /dt) 6

27 Fourth Order Runge-Kutta Method and MATLAB ODE1.m

28

29

30 RungeKutta.m

31

32

33

34 Comparison of results from Euler and Runge-Kutta methods with same time increment  t=0.1 RK  t=0.5 RK  t=0.5 E

35 ? A B k1k1 k2k2 Use Runge-Kutta method for calculating the concentration ptofiles for the following mechanism:

36 Generalized model for different kinetic mechanisms A B k1k1 k2k2 d[A] dt = -k 1 [A] + k 2 [B] d[B] dt = k 1 [A] - k 2 [B] 1 = k 1 [A] = k 1 [A] 1 [B] 0 d[A] dt = (-1) 1 + (1) 2 2 = k 2 [B] = k 2 [A] 0 [B] 1 d[B] dt = (1) 1 + (-1) 2

37 Generalized model for different kinetic mechanisms A B C k1k1 k2k2 d[A] dt = -k 1 [A] d[B] dt = k 1 [A] - k 2 [B] d[C] dt = k 2 [B] 1 = k 1 [A] = k 1 [A] 1 [B] 0 [C] 0 d[A] dt = (-1) 1 + (0) 2 d[B] dt = (1) 1 + (-1) 2 2 = k 2 [B] = k 2 [A] 0 [B] 1 [C] 0 d[C] dt = (0) 1 + (1) 2

38 B C 2 A B k1k1 k2k2 d(A] dt d(B] dt d(C] dt = -2 k 1 [A] 2 = k 1 [A] 2 - k 2 [B] = k 2 [B] Generalized model for different kinetic mechanisms 1 = k 1 [A] 2 = k 1 [A] 2 [B] 0 [C] 0 d[A] dt = (-2) 1 + (0) 2 d[B] dt = (1) 1 + (-1) 2 2 = k 2 [B] = k 2 [A] 0 [B] 1 [C] 0 d[C] dt = (0) 1 + (1) 2

39 1 = k 1 [A] = k 1 [A] 1 [B] 0 d[A] dt = (-1) 1 + (1) 2 2 = k 2 [B] = k 2 [A] 0 [B] 1 d[B] dt = (1) 1 + (-1) 2 1 = k 1 [A] = k 1 [A] 1 [B] 0 [C] 0 d[A] dt = (-1) 1 + (0) 2 d[B] dt = (1) 1 + (-1) 2 2 = k 2 [B] = k 2 [A] 0 [B] 1 [C] 0 d[C] dt = (0) 1 + (1) 2 1 = k 1 [A] 2 = k 1 [A] 2 [B] 0 [C] 0 d[A] dt = (-2) 1 + (0) 2 d[B] dt = (1) 1 + (-1) 2 2 = k 2 [B] = k 2 [A] 0 [B] 1 [C] 0 d[C] dt = (0) 1 + (1) 2 Generalized model for different kinetic mechanisms

40 Reactant stoichiometries matrix, X r B C 2 A B k1k1 k2k2 k1k1 k2k2 ABCABC 200200 010010 Product stoichiometries matrix, X p k1k1 k2k2 ABCABC 010010 001001 Stoichiometric coefficient matrix, X = X p - X r k1k1 k2k2 ABCABC -210 0-11 1 = k 1 [A] 2 = k 1 [A] 2 [B] 0 [C] 0 d[A] dt = (-2) 1 + (0) 2 d[B] dt = (1) 1 + (-1) 2 2 = k 2 [B] = k 2 [A] 0 [B] 1 [C] 0 d[C] dt = (0) 1 + (1) 2

41 d c i dt   j=1 np i=1 ns j = k j cici X r j, i = where j=1 to np X j, i j where i=1 to ns Generalized model for different kinetic mechanisms Once X r and X have been determined, the differential equations can be constructed in a completely generalized way. j is the rate law of the j-th elementary step in the mechanism.

42 A generalised function for creating the ODEs system kinfun.m

43 generalised modeling the reaction kinetics with known mechanism GKIN.m

44 Reactant stoichiometries matrix, X r B C 2 A B k1k1 k2k2 k1k1 k2k2 ABCABC 200200 010010 Product stoichiometries matrix, X p k1k1 k2k2 ABCABC 010010 001001 Using GKIN.m file for modeling

45

46

47

48 Reactant stoichiometries matrix, X r k1k1 k2k2 ABCABC 200200 010010

49 Product stoichiometries matrix, X r k1k1 k2k2 ABCABC 010010 001001

50

51

52 ? Use yhe GKIN.m file for calculating the concentration profiles for the following mechanism: k1k1 k2k2 A D + E k3k3 B D + F k4k4 C D + G k5k5 k6k6 k7k7 A B C k1k1 k2k2 k3k3 k4k4 D


Download ppt "Constrained Fitting Calculation the rate constants for a consecutive reaction with known spectrum of the reactant A = (A A + A B + A C ) + R = C E T ="

Similar presentations


Ads by Google