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

Curve and Data Fitting

The document discusses curve fitting, which is the process of finding the best-fit curve for a given set of data using algebraic equations. It covers the least squares method for fitting linear, quadratic, exponential, and logarithmic curves, providing examples and equations for calculating the best-fit parameters. The document emphasizes the importance of minimizing the sum of squares of residuals to achieve the best approximation of the data.
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)
19 views27 pages

Curve and Data Fitting

The document discusses curve fitting, which is the process of finding the best-fit curve for a given set of data using algebraic equations. It covers the least squares method for fitting linear, quadratic, exponential, and logarithmic curves, providing examples and equations for calculating the best-fit parameters. The document emphasizes the importance of minimizing the sum of squares of residuals to achieve the best approximation of the data.
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

lOMoARcPSD|36554936

Curve Fitting

Chapter Outline

5.1 Introduction
5.2 Least Square Method
5.3 Fitting of Linear Curves
5.4 Fitting of Quadratic Curves
5.5 Fitting of Exponential and Logarithmic Curves

5.1 introduction

Curve 昀椀tting is the process of 昀椀nding the ‘best-昀椀t’ curve for a given set of data. It is
the representation of the relationship between two variables by means of an algebraic
equation. On the basis of this mathematical equation, predictions can be made in many
statistical problems.
Suppose a set of n points of values (x1, y1), (x2, y2), …, (xn, yn) of the two variables
x and y are given. These values are plotted on a rectangular coordinate system, i.e.,
the xy-plane. The resulting set of points is known as a scatter diagram (Fig. 5.1).
The scatter diagram exhibits the trend and it is possible to visualize a smooth curve
approximating the data. Such a curve is known as an approximating curve.

y y

o x o x

Fig. 5.1
Dg mi y
Sg S d b
th
. e
gr il
En mp
Co

Page 1 of 27
lOMoARcPSD|36554936

5.2 Curved Fitting

5.2 LEAST SQUARE METHOD

From a scatter diagram, generally, more than one curve y


may be seen to be appropriate to the given set of data. The
P(xi ,yi )
method of least squares is used to 昀椀nd a curve which passes
through the maximum number of points.
Q(xi ,y)
Let P (xi, yi) be a point on the scatter diagram (Fig. 5.2).
Let the ordinate at P meet the curve y = f (x) at Q and the o x
M
x-axis at M.
Fig. 5.2
Distance QP = MP - MQ
= yi - y
= yi - f ( xi )

The distance QP is known as deviation, error, or residual and is denoted by di. It may
be positive, negative, or zero depending upon whether P lies above, below, or on the
curve. Similar residuals or errors corresponding to the remaining (n – 1) points may be
obtained. The sum of squares of residuals, denoted by E, is given as
n n
E = Â di 2 = Â [ yi - f ( xi )]2
i =1 i =1

If E = 0 then all the n points will lie on y = f (x). If E π 0, f (x) is chosen such that E is
minimum, i.e., the best 昀椀tting curve to the set of points is that for which E is minimum.
This method is known as the least square method. This method does not attempt to
determine the form of the curve y = f (x) but it determines the values of the parameters
of the equation of the curve.

5.3 FiTTing OF LinEAR CURvES

Let (xi, yi), i = 1, 2, …, n be the set of n values and let the relation between x and y be
y = a + bx. The constants a and b are selected such that the straight line is the best 昀椀t to
the data.
The residual at x = xi is
di = yi - f ( xi )
= yi - (a + bxi ) i = 1, 2, ..., n
n
E = Â di 2
i =1
n
= Â ÈÎ yi - (a + bxi )˘˚
2

i =1
n
= Â ( yi - a - bxi )2
Dg mi y
Sg S d b
th

i =1
. e
gr il
En mp
Co

Page 2 of 27
lOMoARcPSD|36554936

5.3 Fitting of Linear Curves 5.3

For E to be minimum,
(i) ∂E = 0
∂a
n
 2( yi - a - bxi )(-1) = 0
i =1
n
 ( yi - a - bxi ) = 0
i =1
n n n
 yi = aÂ1 + b xi
i =1 i =1 i =1

 y = na + b x
∂E
(ii) =0
∂b
n
 2( yi - a - bxi )(- xi ) = 0
i =1
n
 ( xi yi - axi - bxi 2 ) = 0
i =1
n n n
 xi yi = a xi + b xi 2
i =1 i =1 i =1

 xy = a x + b x 2
These two equations are known as normal equations. These equations can be solved
simultaneously to give the best values of a and b. The best 昀椀tting straight line is
obtained by substituting the values of a and b in the equation y = a + bx .

Example 1

Fit a straight line to the following data:


x 1 2 3 4 6 8
y 2.4 3 3.6 4 5 6

Solution

Let the straight line to be 昀椀tted to the data be


y = a + bx

The normal equations are


 y = na + b x …(1)
 xy = a x + b x 2
Dg mi y
Sg S d b
th

…(2)
. e
gr il
En mp
Co

Page 3 of 27
lOMoARcPSD|36554936

5.4 Chapter 5 Curved Fitting

Here, n = 6

x y x2 xy

1 2.4 1 2.4

2 3 4 6

3 3.6 9 10.8

4 4 16 16

6 5 36 30

8 6 64 48

Âx = 24 Ây = 24 Âx2 = 130 Âxy = 113.2

Substituting these values in Eqs (1) and (2),


24 = 6 a + 24b …(3)
113.2 = 24 a + 130b …(4)
Solving Eqs (3) and (4),
a = 1.9764
b = 0.5059
Hence, the required equation of the straight line is
y = 1.9764 + 0.5059x

Example 2

Fit a straight line to the following data. Also, estimate the value of y at
x = 2.5.
x 0 1 2 3 4
y 1 1.8 3.3 4.5 6.3

Solution

Let the straight line to be 昀椀tted to the data be


y = a + bx
The normal equations are

 y = na + b x …(1)
 xy = a x + b x 2 …(2)
Here, n = 5
Dg mi y
Sg S d b
th
. e
gr il
En mp
Co

Page 4 of 27
lOMoARcPSD|36554936

5.3 Fitting of Linear Curves 5.5

x y x2 xy

0 1 0 0

1 1.8 1 1.8

2 3.3 4 6.6

3 4.5 9 13.5

4 6.3 16 25.2

Âx = 10 Ây = 16.9 Âx2 = 30 Âxy = 47.1

Substituting these values in Eqs (1) and (2),


16.9 = 5a + 10b …(3)
47.1 = 10 a + 30b …(4)
Solving Eqs (3) and (4),
a = 0.72
b = 1.33
Hence, the required equation of the straight line is
y = 0.72 + 1.33x

At x = 2.5,
y (2.5) = 0.72 + 1.33 (2.5) = 4.045

Example 3

A simply supported beam carries a concentrated load P(lb) at its


midpoint. Corresponding to various values of P, the maximum de昀氀ection
Y(in) is measured. The data is given below:
P 100 120 140 160 180 200
Y 0.45 0.55 0.60 0.70 0.80 0.85

Find a law of the form Y = a + bP using the least square method.

Solution

Let the straight line to be 昀椀tted to the data be


Y = a + bP
The normal equations are

 Y = na + b P
Dg mi y

...(1)
Sg S d b
th
. e
gr il
En mp
Co

Page 5 of 27
lOMoARcPSD|36554936

5.6 Chapter 5 Curved Fitting

 PY = a P + b P 2 ...(2)
Here, n = 6
P Y P2 PY
100 0.45 10000 45
120 0.55 14400 66
140 0.60 19600 84
160 0.70 25600 112
180 0.80 32400 144
200 0.85 40000 170
ÂP = 900 ÂY = 3.95 ÂP = 142000
2
ÂPY = 621

Substituting these values in Eqs (1) and (2),


3.95 = 6a + 900 b ...(3)
621 = 900 a + 142000 b ...(4)
Solving Eqs (3) and (4),
a = 0.0476
b = 0.0041
Hence, the required equation of the straight line is
Y = 0.0476 + 0.0041 P

Example 4

Fit a straight line to the following data. Also, estimate the value of y at
x = 70.
x 71 68 73 69 67 65 66 67
y 69 72 70 70 68 67 68 64

Solution

Since the values of x and y are larger, we choose the origin for x and y at 69 and 67
respectively,
Let X = x - 69 and Y = y - 67
Let the straight line to be 昀椀tted to the data be
Y = a + bX
The normal equations are

 Y = na + b X …(1)
 XY = a X + b X 2 …(2)
Dg mi y
Sg S d b
th
. e
gr il
En mp
Co

Page 6 of 27
lOMoARcPSD|36554936

5.3 Fitting of Linear Curves 5.7

Here, n = 8
x y X Y X2 XY
71 69 2 2 4 4
68 72 − 1 5 1 − 5
73 70 4 3 16 12
69 70 0 3 0 0
67 68 − 2 1 4 − 2
65 67 − 4 0 16 0
66 68 − 3 1 9 − 3
67 64 − 2 3
− 4 6
ÂX = –6 ÂY = 12 ÂX = 54
2
ÂXY = 12

Substituting these values in Eqs (1) and (2),


12 = 8a - 6b …(3)
12 = -6 a + 54b …(4)
Solving Eqs (3) and (4),
a = 1.8182
b = 0.4242
Hence, the required equation of the straight line is
Y = 1.8182 + 0.4242 X
y - 67 = 1.8182 + 0.4242( x - 69)
y = 0.4242 x + 39.5484
y( x = 70) = 0.4242(70) + 39.5484 = 69.2424

Example 5

Fit a straight line to the following data taking x as the dependent vari-
able.
x 1 3 4 6 8 9 11 14
y 1 2 4 4 5 7 8 9

Solution

If x is considered the dependent variable and y the independent variable, the equation
of the straight line to be 昀椀tted to the data is
x = a + by
Dg mi y
Sg S d b
th
. e
gr il
En mp
Co

Page 7 of 27
lOMoARcPSD|36554936

5.8 Curved Fitting

The normal equations are

 x = na + b y …(1)
 xy = a y + b y2 …(2)
Here, n = 8
x y y2 xy
1 1 1 1
3 2 4 6
4 4 16 16
6 4 16 24
8 5 25 40
9 7 49 63
11 8 64 88
14 9 81 126
Âx = 56 Ây = 40 Ây = 256
2
Âxy = 364
Substituting these values in Eqs (1) and (2),
56 = 8a + 40b …(3)
364 = 40 a + 256b …(4)
Solving Eqs (3) and (4),
a = − 0.5
b = 1.5
Hence, the required equation of the straight line is
x = - 0.5 + 1.5 y

Example 6

If P is the pull required to lift a load W by means of a pulley block, 昀椀nd


a linear law of the form P = mW + c connecting P and W using the
following data:
P 12 15 21 25

W 50 70 100 120

where P and W are taken in kg-wt. Compute P when W = 150 kg.


Solution

Let the linear curve (straight line) 昀椀tted to the data be


Dg mi y
Sg S d b
th

P = mW + c = c + mW
. e
gr il
En mp
Co

Page 8 of 27
lOMoARcPSD|36554936

5.3 Fitting of Linear Curves 5.9

The normal equations are


ÂP = nc + mW ...(1)
ÂPW = cÂW + mÂW2 ...(2)
Here, n = 4

P W W2 PW
12 50 2500 600
15 70 4900 1050
21 100 10000 2100
25 120 14400 3000
ÂP = 73 ÂW = 340 ÂW = 31800 2
ÂPW = 6750

Substituting these values in Eqs (1) and (2),


73 = 4c + 340 m ...(3)
6750 = 340 c + 31800 m ...(4)
Solving Eqs (3) and (4),
c = 2.2759
m = 0.1879
Hence, the required equation of the straight line is
P = 0.1879 W + 2.2759
When W = 150 kg,
P = 0.1879(150) + 2.2759 = 30.4609

ExERCiSE 5.1

1. Fit the line of best 昀椀t to the following data:

x 0 5 10 15 20 25

y 12 15 17 22 24 30

ÈÎAns. : y = 0.7 x + 11.28˘˚


2. The results of a measurement of electric resistance R of a copper bar at

various temperatures t°C are listed below:

t°C 19 25 30 36 40 45 50

R 76 77 79 80 82 83 85

Find a relation R = a + bt where a and b are constants to be determined.

ÈÎAns. : R = 70.0534 + 0.2924 t ˘˚


Dg mi y
Sg S d b
th
. e
gr il
En mp
Co

Page 9 of 27
lOMoARcPSD|36554936

5.10 Chapter 5 Curved Fitting

3. Fit a straight line to the following data:

x 1.53 1.78 2.60 2.95 3.42

y 33.50 36.30 40.00 45.85 53.40

ÈÎAns. : y = 19 + 9.7 x ˘˚

4. Fit a straight line to the following data:

x 100 120 140 160 180 200

y 0.45 0.55 0.60 0.70 0.80 0.85

ÈÎAns. : y = 0.0475 + 0.00407 x ˘˚

5. Find the relation of the type R = aV + b, when some values of R and V

obtained from an experiment are

V 60 65 70 75 80 85 90

R 109 114 118 123 127 130 133

ÈÎAns. : R = 0.8071V + 61.4675˘˚

5.4 FiTTing OF QUADRATiC CURvES

Let (xi, yi), i = 1, 2, …, n be the set of n values and let the relation between x and y be
y = a + bx + cx 2 . The constants a, b, and c are selected such that the parabola is the
best 昀椀t to the data. The residual at x = xi is
di = yi - f ( xi )
= yi - a + bxi + cxi2 ( )
n
E = Â di2
i =1
2

( )
n
= Â È yi - a + bxi + cxi 2 ˘
i =1
Î ˚
2

( )
n
= Â yi - a - bx i - cxi 2

i =1

For E to be minimum,
∂E
(i) =0
∂a
Dg mi y

n
Sg S d b
th

 2 ( y i - a - bxi - cxi ) (-1) = 0


. e
gr il

i =1
En mp
Co

Page 10 of 27
lOMoARcPSD|36554936

5.4 Fitting of Quadratic Curves 5.11

n
 ( yi - a - bxi - cxi ) = 0
i =1
n n n n
 yi = aÂ1 + b xi + c xi 2
i =1 i =1 i =1 i =1

 yi = na + b x + c x 2
(ii) ∂E = 0
∂b
n
 2( yi - a - bxi - cxi )(- xi ) = 0
i =1

 ( xi yi - axi - bxi2 - cxi3 ) = 0


n

i =1
n n n n
 xi yi = a xi + b xi2 + c xi3
i =1 i =1 i =1 i =1

 xy = na + b x 2 + c x3
∂E
(iii) =0
∂c
n
 2( yi - a - bxi - cxi2 )( xi2 ) = 0
i =1
n
 xi2 yi - axi2 - bxi3 - cxi4 = 0
i =1
n n n n
 xi2 yi = a xi2 + b xi3 + c xi4
i =1 i =1 i =1 i =1

 x 2 y = a  x 2 + b x 3 + c  x 4
These equations are known as normal equations. These equations can be solved simul-
taneously to give the best values of a, b, and c. The best 昀椀tting parabola is obtained by
substituting the values of a, b, and c in the equation y = a + bx + cx 2 .

Example 1

Fit a least squares quadratic curve to the following data:


x 1 2 3 4
y 1.7 1.8 2.3 3.2
Dg mi y

Estimate y(2.4).
Sg S d b
th
. e
gr il
En mp
Co

Page 11 of 27
lOMoARcPSD|36554936

5.12 Chapter 5 Curved Fitting

Solution

Let the equation of the least squares quadratic curve (parabola) be y = a + bx + cx 2 .


The normal equations are

 y = na + b x + c x 2 …(1)

 xy = a x + b x 2 + c x3 …(2)

 x 2 y = a  x 2 + b x 3 + c  x 4 …(3)
Here, n = 4

x y x2 x3 x4 xy x2y
1 1.7 1 1 1 1.7 1.7
2 1.8 4 8 16 3.6 7.2
3 2.3 9 27 81 6.9 20.7
4 3.2 16 64 256 12.8 51.2
Sx = 10 Sy = 9 2
Sx = 30 3
Sx = 100
4
Sx = 354 Sxy = 25 2
Sx y = 80.8

Substituting these values in Eqs (1), (2), and (3),


9 = 4 a + 10b + 30c …(4)
25 = 10 a + 30b + 100c …(5)
80.8 = 30 a + 100b + 354c …(6)
Solving Eqs (4), (5), and (6),
a=2
b = − 0.5
c = 0.2
Hence, the required equation of least squares quadratic curve is
y = 2 - 0 ◊ 5x + 0 ◊ 2 x2

y(2 ◊ 4) = 2 - 0 ◊ 5(2 ◊ 4) + 0 ◊ 2(2.4)2 = 1 ◊ 952

Example 2

Fit a second-degree polynomial using least square method to the


following data:
x 0 1 2 3 4

y 1 1.8 1.3 2.5 6.3


Dg mi y
Sg S d b
th
. e
gr il
En mp
Co

Page 12 of 27
lOMoARcPSD|36554936

5.4 Fitting of Quadratic Curves 5.13

Solution

Let the equation of the least squares quadratic curve be y = a + bx + cx2. The normal
equations are
Ây = na + bÂx + cÂx2 ...(1)

Âxy = aÂx + bÂx2 + cÂx3 ...(2)

Âx2y = aÂx2 + bÂx3 + cÂx4 ...(3)


Here, n = 5

x y x2 x3 x4 xy x 2y
0 1 0 0 0 0 0
1 1.8 1 1 1 1.8 1.8
2 1.3 4 8 16 2.6 5.2
3 2.5 9 27 81 7.5 22.5
4 6.3 16 64 256 25.2 100.8
Âx = 10 Ây = 12.9 Âx = 30
2
Âx = 100 Âx = 354 Âxy = 37.1 Âx y = 130.3
3 4 2

Substituting these values in Eqs (1), (2), and (3),


12.9 = 5a + 10b + 30 c ...(4)
37.1 = 10a + 30b + 100c ...(5)
130.3 = 30a + 100b + 354c ...(6)
Solving Eqs (4), (5), and (6),
a = 1.42
b = –1.07
c = 0.55
Hence, the required equation of the least squares quadratic curve is
y = 1.42 – 1.07 x + 0.55 x2

Example 3

By the method of least squares, 昀椀t a parabola to the following data:


x 1 2 3 4 5

y 5 12 26 60 97

Also, estimate y at x = 6.
Solution

Let the equation of the parabola be y = a + bx + cx2. The normal equations are
Dg mi y
Sg S d b
th

Ây = na + bÂx + cÂx2 ...(1)


. e
gr il
En mp
Co

Page 13 of 27
lOMoARcPSD|36554936

5.14 Curved Fitting

Âxy = aÂx + bÂx2 + cÂx3 ...(2)

Âx2y = aÂx2 + bÂx3 + cÂx4 ...(3)


Here, n = 5

x y x2 x3 x4 xy x 2y
1 5 1 1 1 5 5
2 12 4 8 16 24 48
3 26 9 27 81 78 234
4 60 16 64 256 240 960
5 97 25 125 625 485 2425
Âx = 15 Ây = 200 Âx = 55
2
Âx = 225 Âx = 979 Âxy = 832
3 4
Âx y = 3672
2

Substituting these values in Eqs (1), (2), and (3),


200 = 5a + 15b + 55 c ...(4)
832 = 15a + 55b + 225c ...(5)
3672 = 55a + 225b + 979c ...(6)
Solving Eqs (4), (5), and (6),
a = 10.4
b = –11.0857
c = 5.7143
Hence, the required equation of the parabola is
y = 10.4 – 11.0857 x + 5.7143 x2
y(6) = 10.4 – 11.0857(6) + 5.7143(6)2 = 149.6006

Example 4

Fit a second-degree parabolic curve to the following data.


x 1 2 3 4 5 6 7 8 9
y 2 6 7 8 10 11 11 10 9

Solution

Let X = x-5
Y = y -10
Let the equation of the parabola be Y = a + bX + cX 2 .
The normal equations are

 Y = na + b X + c X 2
Dg mi y
Sg S d b
th

…(1)
. e
gr il
En mp
Co

Page 14 of 27
lOMoARcPSD|36554936

5.4 Fitting of Quadratic Curves 5.15

ÂX Y = a  X + b X 2 + c  X 3 …(2)

 X 2Y = a  X 2 + b  X 3 + c  X 4 …(3)
Here, n = 9
x y X Y X2 X3 X4 XY X 2Y
1 2 − 4 − 8 16 − 64 256 32 − 128
2 6 − 3 − 4 9 − 27 81 12 − 36
3 7 − 2 − 3 4 − 8 16 6 − 12
4 8 − 1 − 2 1 − 1 1 2 − 2
5 10 0 0 0 0 0 0 0
6 11 1 1 1 1 1 1 1
7 11 2 1 4 8 16 2 4
8 10 3 0 9 27 81 0 0
9 9 4 − 1 16 64 256 −4 − 16

SX = 0 SY = -16 SX 2 = 60 SX 3 = 0 SX 4 = 708 SXY = 51 SX 2Y = -189

Substituting these values in Eqs (1), (2), and (3),


-16 = 9a + 60c …(4)
51 = 60b …(5)
-189 = 60 a + 708c …(6)
Solving Eqs (4), (5), and (6),
a = 0.0043
b = 0.85
c = − 0.2673
Hence, the required equation of the parabola is
Y = 0.0043 + 0.85 X - 0.2673 X 2

y - 10 = 0.0043 + 0.85( x - 5) - 0.2673( x - 5)2


y = 10 + 0.0043 + 0.85( x - 5) - 0.2673( x 2 - 10 x + 25)
= 10 + 0.0043 + 0.85 x - 4.25 - 0.2673 x 2 + 2.673 x - 6.6825
= - 0.9282 + 3.523 x - 0.2673 x 2

Example 5

Fit a second-degree parabola y = a + bx2 to the following data:


x 1 2 3 4 5
Dg mi y
Sg S d b

1.8 5.1 8.9 14.1 19.8


th

y
. e
gr il
En mp
Co

Page 15 of 27
lOMoARcPSD|36554936

5.16 Curved Fitting

Solution

Let the curve to be 昀椀tted to the data be


y = a + bx2
The normal equations are

 y = na + b  x 2 ...(1)

 x 2 y = a  x 2 + b x 4 ...(2)
Here, n = 5
x y x2 x4 x2y
1 1.8 1 1 1.8
2 5.1 4 16 20.4
3 8.9 9 81 80.1
4 14.1 16 256 225.6
5 19.8 25 625 495
Ây = 49.7 Âx = 55
2
Âx = 979
4
Âx y = 822.9
2

Substituting these values in Eqs (1) and (2),


49.7 = 5a + 55b ...(3)
822.9 = 55a + 979 b ...(4)
Solving Eqs (3) and (4),
a = 1.8165
b = 0.7385
Hence, the required equation of the curve is
y = 1.8165 + 0.7385 x2

Example 6

Fit a curve y = ax + bx 2 for the following data:


x 1 2 3 4 5 6
y 2.51 5.82 9.93 14.84 20.55 27.06

Solution

Let the curve to be 昀椀tted to the data be


y = ax + bx 2
The normal equations are
Dg mi y
Sg S d b
th

 xy = a x 2 + b x3
. e

…(1)
gr il
En mp
Co

Page 16 of 27
lOMoARcPSD|36554936

5.4 Fitting of Quadratic Curves 5.17

 x 2 y = a  x 3 + b x 4 …(2)

x y x2 x3 x4 xy x 2y
1 2.51 1 1 1 2.51 2.51
2 5.82 4 8 16 11.64 23.28
3 9.93 9 27 81 29.79 89.37
4 14.84 16 64 256 59.36 237.44
5 20.55 25 125 625 102.75 513.75
6 27.06 36 216 1296 162.36 974.16

Sx 2 = 91 Sx 3 = 441 Sx 4 = 2275 Sxy = 368.41 Sx 2 y = 1840.51

Substituting these values in Eqs (1) and (2),


368 ◊ 41 = 91a + 441b …(3)
1840 ◊ 51 = 441 a + 2275 b …(4)
Solving Eqs (3) and (4),
a = 2.11
b = 0.4
Hence, the required equation of the curve is
y = 2 ◊ 11x + 0 ◊ 4 x 2

ExERCiSE 5.2

1. Fit a parabola to the following data:

x −2 −1 0 1 2

y 1.0 1.8 1.3 2.5 6.3

[ Ans. : y = 1.48 + 1.13x + 0.55x 2


]

2
2. Fit a curve y = ax + bx to the following data:

x −2 −1 0 1 2

y −72 −46 −12 35 93

[ Ans. : y = 41.1x + 2.147 x 2


]
Dg mi y
Sg S d b
th
. e
gr il
En mp
Co

Page 17 of 27
lOMoARcPSD|36554936

5.18 Curved Fitting

2
3. Fit a parabola y = a + bx + cx to the following data:

x 0 2 5 10

y 4 7 6.4 −6

[ Ans. : y = 4.1 + 1.979x - 0.299x 2


]

2
4. Fit a curve y = a
0
+ax+a
1 2
x for the given data:

x 3 5 7 9 11 13

y 2 3 4 6 5 8

[ Ans. : y = 0.7897 + 0.4004 x + 0.0089x 2


]

5.5 FiTTing OF ExpOnEnTiAL AnD LOgARiTHMiC CURvES

Let (xi , yi), i = 1, 2, …, n be the set of n values and let the relation between x and y be
y = abx.
Taking logarithm on both the sides of the equation y = abx,
loge y = loge a + x loge b

Putting loge y = Y , loge a = A, x = X, and logeb = B,

Y = A + BX
This is a linear equation in X and Y. The normal equations are
 = nA + B X
Y

 XY = A X + B X 2
Solving these equations, A and B, and, hence, a and b can be found. The best 昀椀tting
exponential curve is obtained by substituting the values of a and b in the equation
y = abx.
Similarly, the best 昀椀tting exponential curves for the relation y = axb and y = aebx can be
obtained.

Example 1

Find the law of the form y = abx to the following data:


x 1 2 3 4 5 6 7 8
y 1 1.2 1.8 2.5 3.6 4.7 6.6 9.1
Dg mi y
Sg S d b
th
. e
gr il
En mp
Co

Page 18 of 27
lOMoARcPSD|36554936

5.5 Fitting of Exponential and Logarithmic Curves 5.19

Solution

y = ab x
Taking logarithm on both the sides,
loge y = loge a + x loge b

Putting loge y = Y , loge a = A, x = X and loge b = B ,


Y = A + BX
The normal equations are
 Y = nA + B X …(1)

 XY = A X + B X 2 …(2)
Here, n = 8
x y X Y X2 XY
1 1 1 0.0000 1 0.0000
2 1.2 2 0.1823 4 0.3646
3 1.8 3 0.5878 9 1.7634
4 2.5 4 0.9163 16 3.6652
5 3.6 5 1.2809 25 6.4045
6 4.7 6 1.5476 36 9.2856
7 6.6 7 1.8871 49 13.2097
8 9.1 8 2.2083 64 17.6664

 X = 36  Y =8.6103  X 2 = 204  XY = 52.3594


Substituting these values in Eqs (1) and (2),
8.6103 = 8 A + 36 B …(3)
52.3594 = 36 A + 204 B …(4)
Solving Eqs (3) and (4),
A = − 0.3823
B = 0.3241
loge a = A
loge a = - 0.3823
a = 0.6823
loge b = B
loge b = 0.3241
Dg mi y
Sg S d b

b = 1.3828
th
. e
gr il
En mp
Co

Page 19 of 27
lOMoARcPSD|36554936

5.20 Curved Fitting

Hence, the required law is


y = 0.6823 (1.3828)x

Example 2

Fit a curve of the form y = abx to the following data by the method of
least squares:
x 1 2 3 4 5 6 7

y 87 97 113 129 202 195 193

Solution

y = abx
Taking logarithm on both the sides,
logey = logea + x logeb
Putting logey = Y, logea = A, x = X and logeb = B,
Y = A + BX
The normal equations are
ÂY = nA + BÂX ...(1)

ÂXY = AÂX + BÂX2 ...(2)


Here, n = 7

x y X Y X2 XY
1 87 1 4.4659 1 4.4659
2 97 2 4.5747 4 9.1494
3 113 3 4.7274 9 14.1822
4 129 4 4.8598 16 19.4392
5 202 5 5.3083 25 26.5415
6 195 6 5.2730 36 31.6380
7 193 7 5.2627 49 36.8389
ÂX = 28 ÂY = 34.4718 ÂX = 140 2
ÂXY = 142.2551
Substituting these values in Eqs (1) and (2),
34.4718 = 7A + 28 B ...(3)
142.2551 = 28 A + 140 B ...(4)
Solving Eqs (3) and (4),
A = 4.3006
Dg mi y
Sg S d b
th

B = 0.156
. e
gr il
En mp
Co

Page 20 of 27
lOMoARcPSD|36554936

5.5 Fitting of Exponential and Logarithmic Curves 5.21

logea = A
logea = 4.3006
a = 73.744
logeb = B
logeb = 0.156
b = 1.1688
Hence, the required curve is
y = 73.744 (1.1688)x

Example 3

Fit a curve of the form y = axb to the following data:


x 20 16 10 11 14
y 22 41 120 89 56

Solution

y = axb
Taking logarithm on both the sides,
loge y = loge a + b loge x

Putting loge y = Y , loge a = A, b = B and loge x = X ,


Y = A + BX
The normal equations are

 Y = nA + B X …(1)
 XY = A X + B X 2 …(2)
Here, n = 5

x y X Y X2 XY
20 22 2.9957 3.0910 8.9742 9.2597
16 41 2.7726 3.7136 7.6873 10.2963
10 120 2.3026 4.7875 5.3019 11.0237
11 89 2.3979 4.4886 5.7499 10.7632
14 56 2.6391 4.0254 6.9648 10.6234

 X = 13.1079  Y = 20.1061 ÂX 2
=34.6781 Â XY =51.9663
Substituting these values in Eqs (1) and (2),
20.1061 = 5A + 13.1079 B
Dg mi y

…(3)
Sg S d b
th

51.9663 = 13.1079 A + 34.6781 B …(4)


. e
gr il
En mp
Co

Page 21 of 27
lOMoARcPSD|36554936

5.22 Curved Fitting

Solving Eqs (3) and (4),


A = 10.2146
B = -2.3624
loge a = A
loge a = 10.2146
a = 27298 ◊ 8539
and b = B = -2.3624
Hence, the required equation of the curve is
y = 27298.8539 x -2.3624

Example 4

Fit a curve of the form y = aebx to the following data:


x 1 3 5 7 9
y 115 105 95 85 80

Solution

y = aebx
Taking logarithm on both the sides,
loge y = loge a + bx loge e
= loge a + bx

Putting loge y = Y , loge a = A, b = B and x = X ,


Y = A + BX
The normal equations are

 Y = nA + B X
…(1)
ÂX Y = AÂ X + B Â X 2
…(2)
Here, n = 5
x y X Y X2 XY
1 115 1 4.7449 1 4.7449
3 105 3 4.6539 9 13.9617
5 95 5 4.5539 25 22.7695
7 85 7 4.4427 49 31.0989
9 80 9 4.3820 81 39.438

 X = 25  Y = 22.7774  X 2 = 165  XY =112.013


Dg mi y
Sg S d b
th
. e
gr il
En mp
Co

Page 22 of 27
lOMoARcPSD|36554936

5.5 Fitting of Exponential and Logarithmic Curves 5.23

Substituting these values in Eqs (1) and (2),


22.7774 = 5 A + 25 B …(3)
112.013 = 25A + 165B …(4)
Solving Eqs (3) and (4),
A = 4.7897
B = − 0.0469
loge a = A
loge a = 4.7897

a = 120.2653
b = B = - 0.0469
and
Hence, the required equation of the curve is

y = 120.2653 e -0.0469 x

Example 5
bx
Fit the exponential curve y = ae to the following data:
x 0 2 4 6 8
y 150 63 28 12 5.6

Solution
y = aebx
Taking logarithm on both the sides,
loge y = loge a + bx loge e
= loge a + bx
Putting logey = Y, logea = A, b = B and x = X,
Y = A + BX
The normal equations are
 Y = nA + b X ...(1)

 XY = A X + B X 2 ...(2)
Dg mi y
Sg S d b
th
. e
gr il
En mp
Co

Page 23 of 27
lOMoARcPSD|36554936

5.24 Curved Fitting

Here, n = 5
x y X Y X2 XY
0 150 0 5.0106 0 0
2 63 2 4.1431 4 8.2862
4 28 4 3.3322 16 13.3288
6 12 6 2.4849 36 14.9094
8 5.6 8 1.7228 64 13.7824

 X = 20  Y = 16.6936  X 2 = 120  XY = 50.3068

Substituting these values in Eqs (1) and (2),


16.6936 = 5 A + 20 B ...(3)
50.3068 = 20 A + 120 B ...(4)
Solving Eqs (3) and (4),
A = 4.9855
B = –0.4117
logea = A
logea = 4.9855
a = 146.28
and b = B = –0.4117
Hence, the required equation of the curve is
y = 146.28 e–0.4117 x

Example 6

The pressure and volume of a gas are related by the equation PVg = c.
Fit this curve to the following data:
P 0.5 1.0 1.5 2.0 2.5 3.0

V 1.62 1.00 0.75 0.62 0.52 0.46

Solution

PVg = c

Taking logarithm on both the sides,


loge P + g loge V = loge c
1 1
loge V = loge c - loge P
g g

1 1
Putting loge V = y, loge c = a, loge P = x, - = b,
Dg mi y

g g
Sg S d b
th
. e

y = a + bx
gr il
En mp
Co

Page 24 of 27
lOMoARcPSD|36554936

5.5 Fitting of Exponential and Logarithmic Curves 5.25

The normal equations are


Ây = na + bÂx
Âxy = aÂx + bÂx2
Here, n = 6

P V x y x2 xy
0.5 1.62 –0.6931 0.4824 0.4804 –0.3343
1.0 1.00 0 0 0 0
1.5 0.75 0.4055 –0.2877 0.1644 –0.1166
2.0 0.62 0.6931 –0.4780 0.4804 –0.3313
2.5 0.52 0.9163 –0.6539 0.8396 –0.5992
3.0 0.46 1.0986 –0.7765 1.2069 –0.8531
Âx = 2.4204 Ây = –1.7137 Âx = 3.1717
2
Âxy = –2.2345

Substituting these values in Eqs (1) and (2),


–1.7137 = 6a + 2.4204 b ...(3)
–2.2345 = 2.4204a + 3.1717 b ...(4)
Solving Eqs (3) and (4),
a = –0.002
b = –0.7029
1
- =b
g
g = 1.4227
1
loge c = a
g
1
loge c = -0.002
1.4227
c = 0.9972
Hence, the required equation of the curve is
PV (1.4227) = 0.9972

ExERCiSE 5.3

1. Fit the curve y = ab x


to the following data:

x 2 3 4 5 6

y 144 172.3 207.4 248.8 298.5


Dg mi y
Sg S d b
th

x
[Ans.: y = 100 (1.2) ]
. e
gr il
En mp
Co

Page 25 of 27
lOMoARcPSD|36554936

5.26 Curved Fitting

2. Fit the curve y = ae bx


to the following data:

x 0 2 4

y 5.012 10 31.62

0.46x
[Ans.: y = 4.642e ]

3. Fit the curve y = ax b


to the following data:

x 1 2 3 4

y 2.50 8.00 19.00 50.00

2.09
[Ans.: y = 2.227x ]

g
4. Estimate g by 昀椀tting the ideal gas law PV = c to the following data:

P 16.6 39.7 78.5 115.5 195.3 546.1

V 50 30 20 15 10 5

[Ans.: g = 1.504]

points to Remember

Fitting of Linear Curves


(i) The normal equations for the straight line y = a + bx are
 y = na + b x
 xy = a x + b x 2
(ii) The normal equations for the straight line x = a + by are
 x = na + b y
 xy = a y + b y2
Fitting of Quadratic Curves
(i) The normal equations for the least squares quadratic curve (parabola)
y = a + bx + cx2 are

 y = na + b x + c x 2
 xy = a x + b x 2 + c x3
 x 2 y = a  x 2 + b x 3 + c  x 4
(ii) The normal equations for the curve y = a + bx2 are

 y = na + b  x 2
Dg mi y

 x 2 y = a  x 2 + b x 4
Sg S d b
th
. e
gr il
En mp
Co

Page 26 of 27
lOMoARcPSD|36554936

Points to Remember 5.27

(iii) The normal equations for the curve y = ax + bx2 are

 xy = a x 2 + b x3
 x 2 y = a  x 3 + b x 4
Fitting of Exponential and Logarithmic Curves
For the curve y = abx,
Taking logarithm on both the sides of the equation y = abx,
loge y = loge a + x loge b

Putting loge y = Y , loge a = A, x = X, and logeb = B,


Y = A + BX
This is a linear equation in X and Y. The normal equations are

 Y = nA + B X

 XY = A X + B X 2
Similarly, the best 昀椀tting exponential curves for the relation y = axb and y = aebx can be
obtained.

Dg mi y
Sg S d b
th
. e
gr il
En mp
Co

Page 27 of 27

You might also like