App Lecture 4
App Lecture 4
2. ∑xy=a∑x+b∑x2+c∑x3
3. ∑x2y=a∑x2+b∑x3+c∑x4
Examples
Calculate Fitting second degree parabola - Curve fitting using Least square
method
X Y
1 -5
2 -2
3 5
4 16
5 31
6 50
7 73
Solution:
The equation is y=a+bx+cx2 and the normal equations are
∑y=an+b∑x+c∑x2
∑xy=a∑x+b∑x2+c∑x3
∑x2y=a∑x2+b∑x3+c∑x4
28a+140b+784c=1036
140a+784b+4676c=6440
7a+28b+140c=168→(1)
28a+140b+784c=1036→(2)
140a+784b+4676c=6440→(3)
Select the equations (1) and (2), and eliminate the variable a.
Select the equations (1) and (3), and eliminate the variable a.
Select the equations (4) and (5), and eliminate the variable b.
⇒c=16884=2
From (4)
-28b-224c=-364
⇒-28b-224(2)=-364
⇒-28b-448=-364
⇒-28b=-364+448=84
⇒b=84-28=-3
From (1)
7a+28b+140c=168
⇒7a+28(-3)+140(2)=168
⇒7a+196=168
⇒7a=168-196=-28
⇒a=-287=-4
y=-4-3x+2x2
log10y=log10(aebx)
log10y=log10a+log10ebx
log10y=log10a+bxlog10e
∑Y=nA+B∑x
∑xY=A∑x+B∑x2
Examples
X Y
0 0.10
0.5 0.45
1 2.15
1.5 9.15
2 40.35
2.5 180.75
Solution:
which linear in Y, x
So the corresponding normal equations are
∑Y=nA+B∑x
∑xY=A∑x+B∑x2
7.5A+13.75B=10.4556
∴a=antilog10(A)=antilog10(-0.9916)=0.102
and b=Blog10(e)=1.3013(0.4343)=2.9963
y=0.102e2.9963x
log10y=log10(abx)
log10y=log10a+log10(bx)
log10y=log10a+xlog10b
∑Y=nA+B∑x
∑xY=A∑x+B∑x2
Examples
Solution:
The curve to be fitted is y=abx
∑xY=A∑x+B∑x2
The values are calculated using the following table
x y Y=log10(y) x2 x⋅Y
0 10 1 0 0
1 21 1.3222 1 1.3222
2 35 1.5441 4 3.0881
3 59 1.7709 9 5.3126
4 92 1.9638 16 7.8552
5 200 2.301 25 11.5051
6 400 2.6021 36 15.6124
7 610 2.7853 49 19.4973
--- --- --- --- ---
∑x=28 ∑y=1427 ∑Y=15.2893 ∑x2=140 ∑x⋅Y=64.1929
28A+140B=64.1929
∴a=antilog10(A)=antilog10(1.0211)=10.4986
and b=antilog10(B)=antilog10(0.2543)=1.7959
y=10.4986⋅(1.7959)x
log10y=log10a+log10(xb)
log10y=log10a+blog10x
which linear in Y, X
∑Y=nA+b∑X
∑XY=A∑X+b∑X 2
Example
Calculate Fitting exponential equation (y=axb) - Curve fitting using Least
square method
X Y
2 27.8
3 62.1
4 110
5 161
Solution:
The curve to be fitted is y=axb
∑XY=A∑X+b∑X2
2.0792A+1.1693b=4.0618
∴a=antilog10(A)=antilog10(0.868)=7.3791
y=7.3791⋅x1.9303