Least Squares Technique

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Least Squares Technique:

Consider the general reaction:

aA + bB ¾
¾®
k
products
The rate equation for the above reaction can be expressed as:

- rA = kC aA C Bb
The aim of data analysis is to determine k, α, and β.
Once again we can use a constant volume batch reactor:
dN A
- rAV = -
dt

NA
d
- rA = - V
dt

NA
d
\ - V = - dC A = kC a C b !! (1)
A B
dt dt

If we consider time t = 0, ie initial conditions, then we have CA = CA0 and CB = CB0.


Then we have (1) becoming:

æ dC ö
lnç - A0 ÷ = ln(- rA0 ) = ln kC aA0C Bb 0
dt ø
( )
è
Linearizing, as before, by taking ln on both sides:

æ dC ö
lnç - A0 ÷ = ln(- rA0 ) = ln k + a ln C A0 + b ln C Bb 0
è dt ø
This equation has the general form of:

Y = a0 + a1X1 + a2 X2

Where a0 = lnk, a1 = α, X1 = lnCA0, a2 =β, and X2 = CB0


If we carry out N experimental runs, then the above equation becomes:

Y j = a 0 + a1 X ij + a 2 X 2 j
The aim of least squares is to find a0, a1, and a2. These are three unknowns and we
therefore need 3 equations to solve for these unknowns:

Least Squares Analysis:

Yj = a0 + a1X1j + a 2 X 2j

N N N

å Yj = Na0 + a1å X1j + a2 å X2j


j=1 j=1 j=1 ……..(1)
N N N N

åX
j=1
1j Yj = a0 å X 1 j + a1 å X + a2 å X1j X2j
j =1 j=1
2
1j
j=1
………(2)

N N N N

å X2j Yj = a0 å X 2 j + a1å X1j X 2 j + a2 å X22j


j=1 j =1 j=1 j=1
………(3)

Note: You do not need to know the above equations, but you do need to know how to use
them!

Examples to illustrate how the above equations work:

Example 1:
The reaction for the above system is:
HBr + MnO2 → products
aA + bB → products
In the above system, there is only one reactant of interest: HBr because it is dissolved in
an excess of MnO2. The concentration of MnO2 therefore remains essentially constant,
and we have:
-rA = kCAα
and the aim is to determine k and α. At initial conditions:
ln(-rA0) = ln k + α ln CA0
there are two unknowns – we therefore require only two equations to solve for these
unknowns:
ln(-rA0) = ln k + α ln CA0
Yj = a0 + a1 X1j + a 2 X 2j

ie X2j = 0
and
N N

å Yj = Na0 + a1å X1j


j=1 j=1 ……..(1)
N N N

åX
j=1
1j Yj = a0 å X 1 j + a1å X1j2
j =1 j=1
………(2)

We draw up the following table to determine a0 (lnk) and a1 (α):


From the two equations, we see that we need values for X1j (lnCA0), X1j2,…
Run CA0 -rA0 ln(-rA0) ln CA0 ln(-rA0). lnCA0 (lnCA0)2
Yj X1j X1j Xj X1j2
1 0.1 0.00073 -7.22 -2.302 16.61 5.29
2 0.5 0.0070 -4.96 -0.693 3.42 0.48
3 1.0 0.0184 -4.0 0.0 0.0 0.0
4 2.0 0.0486 -3.02 0.693 -2.09 0.48
5 4.0 0.1284 -2.06 1.38 -2.84 1.90
S -21.26 -0.92 15.1 8.15
From the above table values, equations (1) and (2) become:
-21.26 = 5 a0 – 0.92 a1
15.1 = -0.92 a0 +8.15 a1
We see in the above equations that N = number of runs = 5.
We have 2 equations and 2 unknowns which can be solved simultaneously
for a0 and a1, and hence k and α.

Two important points to bear in mind:


1) It is easier to work in EXCEL than using your calculator. For your tests and FISA
you will be required to work on a computer.
2) You will need to know how to solve simultaneous equations using EXCEL. It is
easy – look at Youtube!
3) It is easier to solve simultaneous equations using POLYMATH. You can download
POLYMATH onto your computer from the Internet: https://polymath-
educational.software.informer.com/download/

Once you download this software, I will show you how to use it to: find non-linear
regression curves (curve fitting, using polynomial), solve simultaneous equations, and
solve simultaneous differential equations.
Example 2:
The ethane hydrogenolysis over a commercial nickel catalyst was studied in a stirred
contained solids reactor:

H 2 + C2 H 6 ¾
¾®
k
2CH 4
Determine the rate law parameters from the data presented in the table below. Only
hydrogen and ethane are fed to the reactor at 300 oC.
-rA PH2 (atm) PC2H6 (atm)
1.0625 0.475 0.475
1.05 0.465 0.465
1.2 0.42 0.42
0.6 0.32 0.52
0.9375 0.54 0.54
2.0625 0.57 0.37

Solution:
The reaction: H 2 + C 2 H 6 ¾
¾®
k
2CH 4 could be written as:
A + B → products
The rate law for the above system can be written as:

- rA = kPAa PBb
Linearising this equation to determine k, α, and β gives:

ln(- rA ) = ln k + a ln PA + b ln PB
Y j = a 0 + a1 X ij + a 2 X 2 j
There are 3 unknowns, so we need 3 equations. We use the same set of equations above
to determine ao (ln k), a1 (α) and a1 (β):

N N N

å Y = Na
j=1
j 0 + a1 å X1j + a2 å X2j
j=1 j=1

N N N N

å X1j Yj = a0 å X1 j + a1å X1j2 + a2 å X1j X2j


j=1 j =1 j=1 j=1
N N N N

å X2j Yj = a0 å X 2 j + a1å X1j X 2 j + a2 å X22j


j=1 j =1 j=1 j=1
I set up the following table in EXCEL:

-rA PA PB Yj X1j X1j2 X2j X2j2 X1jX2j X1jYj X2jYj


2 2
ln(-rA) ln PA (lnPA) ln PB (lnPB) lnPAlnPB
1.0625 0.475 0.475 0.061 -0.744 0.554 -0.744 0.554 0.554 -0.045 -0.045
1.05 0.465 0.465 0.049 -0.766 0.586 -0.766 0.586 0.586 -0.037 -0.037
1.2 0.42 0.42 0.182 -0.868 0.753 -0.868 0.753 0.753 -0.158 -0.158
0.6 0.32 0.52 -0.511 -1.139 1.298 -0.654 0.428 0.745 0.582 0.334
0.9375 0.54 0.54 -0.065 -0.616 0.380 -0.616 0.380 0.380 0.040 0.040
2.0625 0.57 0.37 0.724 -0.562 0.316 -0.994 0.989 0.559 -0.407 -0.720

Sum 0.440 -4.695 3.887 -4.642 3.689 3.577 -0.026 -0.587

It took me about 10 minutes to set up this table, fill in the values and determine the various values. Remember that in EXCEL
you need to write the formulae just once and then copy to the rest of the cells!

Substituting into the above 3 equations gives:

0.440 = 6 a0 – 4.695 a1 – 4.692 a2

-0.026 = -4.695 a0 + 3.887 a1 + 3.577 a2

-0.587 = -4.642 a0 + 3.577 a1 + 3.689 a2

Solving these 3 equations simultaneously using POLYMATH gives:

a0 = -4.128, a1 = -0.615, a2 = -4.758

\ lnk = -4.128, \ k =?
Using POLYMATH, it took me less than 3 minutes to find the unknowns!
Example 3:

In catalytic reaction systems there are a series of steps involved in the reactions. The
slowest step is called the rate determining step and in many cases this is the adsorption
step where the reactants adsorb onto the catalyst. There are different models defining the
rate equation for this step and the coefficients for these models are determined from
experimental data. The equations generally have the form:

and it is the aim of data analysis to determine the coefficients k, Ks and KI. The procedure
is identical to above: linearize and use least squares analysis.
A few examples of the types of equations you may encounter and how to linearise them
are given below. It is VERY IMPORTANT that you know this section of the work!

Consider the general rate expression:

k s K AAC t æç PA PB - c ö
P
K ÷
rs = è P ø

1 + K A PA + K AC PC

k æç PA PB - c ö
P
K ÷
= è P ø

1 + K A PA + K AC PC
In the above equation, KP is the equilibrium constant. The aim of analysis of data is to
determine the coefficients: k, KA and KAC. The data that are provided is rS as a function of
PA, PB and Pc.
rs k
=
æ P P - Pc ö 1 + K A PA + K AC PC
ç A B K ÷
è P ø

æ P P - Pc ö
ç A B K ÷ 1 + K A PA + K AC PC
è P ø
\ =
rs k

æ P P - Pc ö
ç A B K ÷ KA K AC
è P ø 1
= + PA + PC
rs k k k

Y j = a 0 + a1 X ij + a 2 X 2 j

Another general expression:

k ( PA PB )
rs =
(1 + K A PA + K AC PC ) 2

rs k
=
PA PB (
1 + K A PA + K AC PC )2

PA PB
=
(
1 + K A PA + K AC PC )2

rs k

(1 + K )
1
æ PA PB ö 2
PA + K AC PC
çç ÷÷ = A
1
è rs ø k 2

1
æ PA PB ö 2
1 KA K AC
çç ÷÷ = + 1 PA + 1 PC
è rs ø k k 2 k 2

Y j = a 0 + a1 X ij + a 2 X 2 j

You might also like