1. Calculate Fitting second degree parabola - Curve fitting using Least square method
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∑x4The values are calculated using the following table
x | y | x2 | x3 | x4 | x⋅y | x2⋅y |
1 | -5 | 1 | 1 | 1 | -5 | -5 |
2 | -2 | 4 | 8 | 16 | -4 | -8 |
3 | 5 | 9 | 27 | 81 | 15 | 45 |
4 | 16 | 16 | 64 | 256 | 64 | 256 |
5 | 31 | 25 | 125 | 625 | 155 | 775 |
6 | 50 | 36 | 216 | 1296 | 300 | 1800 |
7 | 73 | 49 | 343 | 2401 | 511 | 3577 |
--- | --- | --- | --- | --- | --- | --- |
∑x=28 | ∑y=168 | ∑x2=140 | ∑x3=784 | ∑x4=4676 | ∑x⋅y=1036 | ∑x2⋅y=6440 |
Substituting these values in the normal equations
7a+28b+140c=16828a+140b+784c=1036140a+784b+4676c=6440Solving these 3 equations,
Total Equations are
37a+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.
7a+28b+140c=168 | ×4→ | | | 28a | + | 112b | + | 560c | = | 672 | |
| | − | |
28a+140b+784c=1036 | ×1→ | | | 28a | + | 140b | + | 784c | = | 1036 | |
| | |
|
| | | | | - | 28b | - | 224c | = | -364 | →(4) |
Select the equations
(1) and
(3), and eliminate the variable
a.
7a+28b+140c=168 | ×20→ | | | 140a | + | 560b | + | 2800c | = | 3360 | |
| | − | |
140a+784b+4676c=6440 | ×1→ | | | 140a | + | 784b | + | 4676c | = | 6440 | |
| | |
|
| | | | | - | 224b | - | 1876c | = | -3080 | →(5) |
Select the equations
(4) and
(5), and eliminate the variable
b.
-28b-224c=-364 | ×8→ | | | | - | 224b | - | 1792c | = | -2912 | |
| | − | |
-224b-1876c=-3080 | ×1→ | | | | - | 224b | - | 1876c | = | -3080 | |
| | |
|
| | | | | | | | 84c | = | 168 | →(6) |
Now use back substitution method
From (6)
84c=168⇒c=16884=2From (4)
-28b-224c=-364⇒-28b-224(2)=-364⇒-28b-448=-364⇒-28b=-364+448=84⇒b=84-28=-3From (1)
7a+28b+140c=168⇒7a+28(-3)+140(2)=168⇒7a+196=168⇒7a=168-196=-28⇒a=-287=-4Solution using Elimination method.
a=-4,b=-3,c=2Now substituting this values in the equation is
y=a+bx+cx2, we get
y=-4-3x+2x2