0% found this document useful (0 votes)
21 views27 pages

6-Module - 3 Lecture PPT - Interpolation and Regression Analysis-05!02!2024

Uploaded by

Omkar Dake
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views27 pages

6-Module - 3 Lecture PPT - Interpolation and Regression Analysis-05!02!2024

Uploaded by

Omkar Dake
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

BCHE201L Computational Methods in

Chemical Engineering

Course Faculty : Dr. Monash P.


School of Chemical Engineering (SCHEME)
Vellore Institute of Technology, Vellore Campus
Tamilnadu, India - 632014
Date: 01 February 2024
Interpolation and Regression Analysis
Newton’s divided-difference interpolating
polynomial
• Linear rule
• Polynomial rule
• Quadratic rule

Lagrange interpolating polynomial

Linear and polynomial Regression

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 2


Linear and polynomial Regression

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 3


Curve fitting
• There are two general approaches for curve fitting that are
distinguished from each other on the basis of the amount of
error associated with these data.
 derive a single curve that represents the general trend of these data.
• curve is designed to follow the pattern of the points taken as a group.
One approach of this nature is called least-squares regression.

 fit a curve or a series of curves that pass directly through each of the
points.
• these data are known to be very precise - The estimation of values
between well-known discrete points is called interpolation

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 4


Attempts to fit a “best” curve

Least-squares regression Linear interpolation

Curvilinear interpolation
Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 5
Statistic concepts
• The arithmetic mean of a sample is defined as the sum of
the individual data points (yi) divided by the number of points
(n).

• The most common measure of spread for a sample is the


standard deviation (sy) about the mean

where, St is the total sum of the squares of the residuals


between the data points and the mean.

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 6


Statistic concepts
• It should be noted that an alternative, more convenient
formula is available to compute the standard deviation.

• Statistic that has utility in quantifying the spread of data is


the coefficient of variation (c.v.). This statistic is the ratio of
the standard deviation to the mean.

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 7


Least-Squares Regression
• The simplest example of a least-squares approximation is
fitting a straight line to a set of paired observations: (x1, y1),
(x2, y2), . . . , (xn, yn).
• The mathematical expression for the straight line is
where a0 and a1 are coefficients
representing the intercept and the slope

Data exhibiting Polynomial fit More satisfactory


significant error oscillating beyond the result using the least-
range of the data squares fit
Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 8
Least-Squares Regression
• The error, or residual, between the model and the
observations, which can be represented by

• Thus, the error, or residual, is the discrepancy between the


true value of y and the approximate value, a0 + a1x,
predicted by the linear equation.
• Objectives is to minimize the sum of the squares of the
residuals between the measured y and the y calculated with
the linear model.

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 9


Least-Squares Regression
• To determine values for a0 and a1 is differentiated with
respect to each coefficient

• Setting these derivatives equal to zero will result in a


minimum Sr. If this is done, the equations can be expressed
as

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 10


• Now, realizing that , we can express the
equations as a set of two simultaneous linear equations
with two unknowns (a0 and a1):

• These are called the normal equations.

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 11


Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 12
Example 1:
An object is suspended in a wind tunnel and the force
measured for various levels of wind velocity. The results are
tabulated below.

Velocity, m/s 10 20 30 40 50 60 70 80
Force, N 25 70 380 550 610 1220 830 1450

Use least-squares regression to fit these data with


(a) a straight line
(b) a power equation based on log transformations.

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 13


Solution:

V, m/s F, N
10 25
20 70
30 380
40 550
50 610
60 1220
70 830
80 1450

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 14


Using Excel Plot option

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 15


Solution for linear fit (y = a0+a1*x)
x y xi yi xi^2 st = (yi-yavg)^2 sr = (yi - a0 - a1xi)^2
V, m/s F, N
10 25 250 100 380534.7656 4171.006944
20 70 1400 400 327041.0156 7245.252268
30 380 11400 900 68578.51563 910.7461735
40 550 22000 1600 8441.015625 29.98866213
50 610 30500 2500 1016.015625 16699.4083
60 1220 73200 3600 334228.5156 81836.86224
70 830 58100 4900 35391.01563 89180.44572
80 1450 116000 6400 653066.0156 16044.44444

360 5135 312850 20400 1808296.875 216118.1548

45 641.875

a1 =19.4702 a0 = -234.2857 r2=0.880485

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 16


Step -1

n=8
n∑ xi yi − ∑ xi ∑ yi
∑ xi = 360 a1 = 2 a0 =y − a1 × x
n∑ xi2 − ( ∑ xi )
∑ x y = 5135
i i
8 × 312850 − 360 × 5135 a0 = 641.875 − 19.4702 × 45
∑ x = 20400
2
i
a1 =
8 × 20400 − (360)2 a0 = −234.2857
x = 45 a1 = 19.4702
y = 641.875

Step - 2 st − sr
r2 =
st
=sr ∑ (yactual − ymod el )2
st ∑ (yi − y)2 1808296.875 − 216118.1548
st = 1808296.875
=sr ∑[yactual − (a0 + a1 × x)]2 r2 =
1808296.875
sr = 216118.1548
r 2 = 0.880485

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 17


Solution for power law fit (y=axb)
logx (x) logy (y) xi yi xi^2 st = (yi-yavg)^2 sr = (yi - a0 - a1xi)^2
1 1.3979 1.3979 1 1.3606 0.0005
1.3010 1.8450 2.4005 1.6926 0.5174 0.0303
1.4771 2.5797 3.8106 2.1818 0.0002 0.0444
1.6020 2.7403 4.3902 2.5666 0.0309 0.0152
1.6989 2.7853 4.7321 2.8865 0.0488 0.0005
1.7781 3.0863 5.4880 3.1618 0.2724 0.0144
1.8450 2.9190 5.3859 3.4044 0.1257 0.0323
1.9030 3.1613 6.0163 3.6217 0.3563 0.00277
12.6055 20.5153 33.6219 20.5156 2.7126 0.1409

1.57569 2.564415
a1=1.9841 a0 = 0.2741 r2 = 0.9481

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 18


Step -1
n=8
n∑ xi yi − ∑ xi ∑ yi
∑ x = 12.6055
i a1 = 2
n∑ xi2 − ( ∑ xi ) a0 =y − a1 × x
∑ x y = 33.6219
i i
8 × 33.6219 − 12.6055 × 20.5133 a0 = 2.5644 − 1.9841 × 1.5757
∑ x = 20.5156
2
i
a1 =
8 × 20.5156 − (12.6055)2 a0 = −0.56203
x = 1.5757 a1 = 1.9841
y = 2.564415

st − sr
Step - 2 r2 =
st
=sr ∑ (yactual − ymod el )2
st ∑ (yi − y)2 2.7126 − 0.1409
st = 2.7126
=sr ∑[yactual − (a0 + a1 × x)]2 r2 =
2.7126
sr = 0.1409
r 2 = 0.9481
Step - 3: To write the equation in y =axb form
a0 log a = − 0.56203 a1 = b so we can write the equation
a 10
= −0.56203
0.27413 b = 1.9841 in y = ax b form as y = 0.2741x 1.9841
Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 19
Suppose you want to calculate the Force for a velocity of 65
m/s, you can choose the model with more r2 value.

i.e. the power law model fit well with the given data and the
sum of the squares of the residual is minimum.

we know that
y 0.2741
= x 1.9841 i.e. F 0.2741v 1.9841
F=0.2741 × (65)1.9841 =1084.1559 N

Suppose you are using linear fit, you will get the following
result
we know that
y = a0 + a1 x i.e. F =
− 234.2857 + 19.4702 × v
F= −234.2857 + 19.4702 × 65
= 1031.273 N
Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 20
Case study: Research paper 1

Adsorbent = carbon aerogel Adsorbate = Metformin

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 21


Case Study: Adsorption
Kirushantini etal synthesized carbon aerosol and studied the
adsorption performance of metformin at 30oC. The equilibrium
concentration, Ce and the amount adsorbed at equilibrium
(qe) is given in the following Table.

Ce, (g/L) 32.5 73 162 256 353 450


qe, (mg/g) 80.10 107.85 162.5 178.5 182.8 191.35

Use least-squares regression to obtain the Langmuir and


Freundlich parameters and constants.
qm K LCe
Langmuir isotherm adsorption model: qe =
1 + K LCe

Freundlich isotherm adsorption model: qe = K F Ce1/ n


Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 22
Case study 1: solution
Freundlich Isotherm equation follows power Law

KF = 15.97006
1/n = 0.4315
n = 2.3175

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 23


st = (yi- sr = (yi - a0 -
x y logx (x) logy (y) xi yi xi^2
yavg)^2 a1xi)^2

30 68 1.477121 1.832509 2.706838 2.181887 0.097526077 6.65015E-05


68 96 1.832509 1.982271 3.63253 3.358089 0.026415784 0.000137766
157 150 2.1959 2.176091 4.778478 4.821975 0.000979107 0.000639312
250 186 2.39794 2.269513 5.442156 5.750116 0.015553177 0.000994058
346 198 2.539076 2.296665 5.831408 6.446907 0.023062864 4.91652E-06
446 205 2.649335 2.311754 6.12461 7.018975 0.027873402 0.001204352
13.09188 12.8688 28.51602 29.57795 0.191410412 0.003046906
2.18198 2.144801

a1= 0.4315 a0= 1.203306 r2 = 0.984081819


a= 15.97006

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 24


Step -1
n=7
n∑ xi yi − ∑ xi ∑ yi
∑ x = 12.6055
i a1 = 2
n∑ xi2 − ( ∑ xi ) a0 =y − a1 × x
∑ x y = 33.6219
i i
a0 = 2.5644 − 1.9841 × 1.5757
8 × 33.6219 − 12.6055 × 20.5133
∑ x = 20.5156
2
i
a1 =
8 × 20.5156 − (12.6055)2 a0 = −0.56203
x = 1.5757 a1 = 1.9841
y = 2.564415

st − sr
Step - 2 r2 =
st
=sr ∑ (yactual − ymod el )2
st ∑ (yi − y)2 r2 =
2.7126 − 0.1409
st = 2.7126
=sr ∑[yactual − (a0 + a1 × x)]2 2.7126
sr = 0.1409
r 2 = 0.9481
Step - 3: To write the equation in y =axb form
a0 log a = − 0.56203 a1 = b so we can write the equation
a 10
= −0.56203
0.27413 b = 1.9841 in y = ax b form as y = 0.2741x 1.9841
Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 25
Ce qe ymodel sr
30 68 74.06841 36.82557
68 96 102.596 43.50755 kf = 19.1213
157 150 143.1576 46.81809 1/n= 0.39815
250 186 172.2887 187.9995 n= 2.511617
346 198 196.0876 3.65729
446 205 216.945 142.6828
461.4908

Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 26


Dr. Monash Purushothaman BCHE201L Computational Methods in Chemical Engineering 27

You might also like