We are tasked in this form of quantitative approximation with fitting a polynomial of form a x 2 + bx + c to a set of points, (x1 , y1 , x2 , y2 , x3 , y3 , x4 , y4 )say as displayed in a table:
To proceed we use functional form and choose a, b, c to minimize the functional, so that:
F(a,b,c) = å 4 n =1 (axi 2 + bxi + c - yi) 2
This can be done by solving the linear system of equations:
¶f/¶a = 0, ¶f/¶b = 0, ¶f/¶c = 0
Example problem: Fit a second degree polynomial to the ordered pairs in the table below:
Then:
(-2,1): 32a - 16b + 8c - 8 = 0
(-1, 1): 2a - 2b +2c + 2 = 0
(0, 2): 0
(1, 1): 2a + 2b + 2c - 2 = 0
------------------------
Summing: 36a - 16b +12c - 8 = 0
¶f/¶b = 2 (axi 2 + bxi + c -yi)xi = 0
(-2,1 ): - 16a + 8b - 4c + 4 = 0
(-1, -1): -2a - 2b - 2c -2 = 0
(0, 2): 0
(1, 1): 2a + 2b + 2c - 2 = 0
---------------------------------
Sum: 16a + 12b - 4c = 0
¶f/¶c = 2 (axi 2 + bxi + c -yi) = 0
(-2, 1): 8a - 4b + 2c - 2 = 0
(-1, -1): 2a - 2b + 2c + 2 = 0
(0, 2): 2c - 4 = 0
(1, 1): 2a -4b + 8c - 6 = 0
-----------------------------
Sum: 12a - 4b + 8c - 6 = 0
From the 3 sums we arrive at a 3 x 3 system given by:
36a - 16b +12c - 8 = 0
16a + 12b - 4c = 0
12a - 4b + 8c - 6 = 0
Or, written in matrix form:
The values for a, b, c can then either be found using Gaussian elimination with pivotal condensation or matrix inversion. We choose the latter as it is more straightforward and amenable to a good computing program.
Using this method and Mathcad we obtain:
No comments:
Post a Comment