Professional Documents
Culture Documents
TOPIC 4 - Curve Fiiting and Interpolation
TOPIC 4 - Curve Fiiting and Interpolation
TOPIC 4 - Curve Fiiting and Interpolation
▪ Since all the values xi and yi are known, E is a nonlinear function of the two variables a1 and a0. Taking
the partial derivatives and setting them equal to zero gives the values of a1 and a0 for minimum E:
LINEAR LEAST SQUARES REGRESSION
▪ Since the equations above contain summations that are the same, it is convenient to calculate the
summations first the substituting them in the equation:
▪ With the parameters above, the new equation for a1 and a0 are:
LINEAR LEAST SQUARES REGRESSION
Example: According to Charles's law for an ideal gas, at constant volume, a
linear relationship exists between the pressure, p, and temperature, T. In the
experiment shown in the figure, a fixed volume of gas in a sealed container is
submerged in ice water (T = 0°C). The temperature of the gas is then increased
in ten increments up to T = 100° C by heating the water, and the pressure of the
gas is measured at each temperature. The data from the experiment is:
T (oC) 0 10 20 30 40 50 60 70 80 90 100
P
0.94 0.96 1.0 1.05 1.07 1.09 1.14 1.17 1.21 1.24 1.28
(atm)
Sx = 0 + 30 + 70 + 100 = 200
Sxx = 02 + 302 + 702 + 1002 = 158000
Sxy = (0*0.94) + (30*1.05) + (70*1.17) + (100*1.28) = 241.4
Sy = 0.94 + 1.05 + 1.17 + 1.28 = 4.44
LINEAR LEAST SQUARES REGRESSION
Use linear least-squares regression to determine a linear function in the form p = a1T + a0 that best fits
the data points. Calculate the coefficients by hand using only the four data points: 0, 30, 70, and 100 °C.
T (oC) 0 10 20 30 40 50 60 70 80 90 100
P
0.94 0.96 1.0 1.05 1.07 1.09 1.14 1.17 1.21 1.24 1.28
(atm)
Step 3: Substitute: Sx = 200 ; Sxx = 158000 ; Sxy = 241.4 ; Sy = 4.44 to the equations
above.
LINEAR LEAST SQUARES REGRESSION
Use linear least-squares regression to determine a linear function in the form p = a1T + a0 that best fits
the data points. Calculate the coefficients by hand using only the four data points: 0, 30, 70, and 100 °C.
T (oC) 0 10 20 30 40 50 60 70 80 90 100
P
0.94 0.96 1.0 1.05 1.07 1.09 1.14 1.17 1.21 1.24 1.28
(atm)
Step 4: Substitute: a1 = 0.003345 and a0 = 0.9428 to the linear equation form p = a1T + a0
The equation that best fits the data is then defined by:
p = 0.003345T + 0.9428
LAGRANGE INTERPOLATING POLYNOMIALS – are a particular form of polynomials that can be
written to fit a given set of data points by using the values at the points. The polynomials can be written
right away and do not require any preliminary calculations for determining coefficients.
For two points, (x1, y1), and (x2, y2), the first-order Lagrange
polynomial that passes through the points has the form:
LAGRANGE INTERPOLATING POLYNOMIALS – are a particular form of polynomials that can be
written to fit a given set of data points by using the values at the points. The polynomials can be written
right away and do not require any preliminary calculations for determining coefficients.
For three points, (x1, y1), (x2, y2), and (x3, y3), the second-order
Lagrange polynomial that passes through the points has the
form:
LAGRANGE INTERPOLATING POLYNOMIALS – are a particular form of polynomials that can be
written to fit a given set of data points by using the values at the points. The polynomials can be written
right away and do not require any preliminary calculations for determining coefficients.
For n number of points, the n-1 order Lagrange polynomial that passes through n points (x1, y1),
(x2, y2), (x3, y3), … , (xn, yn) has the form:
LAGRANGE INTERPOLATING POLYNOMIALS
Example: The set of the following five data points is given:
x 1 2 4 5 7
y 52 5 -5 -40 10
(a) Determine the fourth-order polynomial in the Lagrange form that passes through the points.
(b) Use the polynomial obtained in part (a) to determine the interpolated value for x= 3.
(a) Following the form of Equation from the previous slide, the Lagrange Polynomial is:
LAGRANGE INTERPOLATING POLYNOMIALS
Example: The set of the following five data points is given:
x 1 2 4 5 7
y 52 5 -5 -40 10
(a) Determine the fourth-order polynomial in the Lagrange form that passes through the points.
(b) Use the polynomial obtained in part (a) to determine the interpolated value for x= 3.
(b) The interpolated value for x= 3 is obtained by substituting the x in the polynomial:
NEWTON’S INTERPOLATING POLYNOMIALS – a popular means of exactly fitting a given set of data
points. The general form of an n - 1 order Newton's polynomial that passes through n points is:
The special feature of this form of the polynomial is that the coefficients a1 through an can be determined
using a simple mathematical procedure.
Once the coefficients are known, the polynomial can be used for calculating an interpolated value at any
x.
For First – order Newton’s Polynomial:
NEWTON’S INTERPOLATING POLYNOMIALS – a popular means of exactly fitting a given set of data
points. The general form of an n - 1 order Newton's polynomial that passes through n points is: