You will need
- paper;
- pencil.
Instruction
1
Determine the degree of the polynomial to use for interpolation. It is: KP*X^n + K(n-1)*X^(n-1) +... + K0*S^0. The number n here is 1 less than the number of known points with different X, through which must pass the resulting function. So just count the points and subtract from the obtained values for the unit.
2
Identify the common view of the desired functions. Since X^0 = 1, it takes the form: f(CP) = KP*X^n + K(n-1)*X^ (n-1) +... + K1*X + K0, where n is found in the first step the value of the degree of the polynomial.
3
Start drafting a system of linear algebraic equations to find the coefficients of the interpolating polynomial. The original set of points specifies the number of matches of values of the coordinates Xn of the unknown function on the x-axis and y-axis f(Xn). Therefore, successive substitution of values of x in the polynomial, the value of which is equal to f(Xn), allows to obtain the desired equation:
KP*CP^n + K(n-1)*Xn^ (n-1) +... + K1*Xn + K0 = f(Xn)
KP*X(n-1)^n + K(n-1)*X(n-1)^ (n-1) +... + K1*X(n-1) + K0 = f(X(n-1))
...
KP*Х1п + K(n-1)*X1^ (n-1) + ... + K1*X1 + K0 = f(X1).
KP*CP^n + K(n-1)*Xn^ (n-1) +... + K1*Xn + K0 = f(Xn)
KP*X(n-1)^n + K(n-1)*X(n-1)^ (n-1) +... + K1*X(n-1) + K0 = f(X(n-1))
...
KP*Х1п + K(n-1)*X1^ (n-1) + ... + K1*X1 + K0 = f(X1).
4
Imagine a system of linear algebraic equations in a convenient form for solution. Calculate the values of CP^n... X1^2 and X1...Xn and then substitute them into the equation. The values (also known) move to the left side of the equations. Get a system of the form:
Spp*KP + SP(n-1)*(n-1) +... + JS1*K1 + K0 - SP = 0
With(n-1)n*KP + (n-q)(n-1)*(n-1) + ... + (n-1)1*K1 + K0 - (n-1) = 0
...
С1п*CP + C1(n-1)*(n-1) +... + C11*K1 + K0 - C1 = 0
Here Spp = CP^n and SP = f(Xn).
Spp*KP + SP(n-1)*(n-1) +... + JS1*K1 + K0 - SP = 0
With(n-1)n*KP + (n-q)(n-1)*(n-1) + ... + (n-1)1*K1 + K0 - (n-1) = 0
...
С1п*CP + C1(n-1)*(n-1) +... + C11*K1 + K0 - C1 = 0
Here Spp = CP^n and SP = f(Xn).
5
Solve the system of linear algebraic equations. Use of any known method. For example, Gaussian elimination or Cramer's rule. The solutions are obtained values of coefficients for the polynomial KP...K0.
6
Find the feature points. Substitute the coefficients KP...K0, found in the previous step, the polynomial KP*X^n + K(n-1)*X^ (n-1) +... + K0*S^0. This expression will be a function equation. I.e., the desired f(X) = KP*X^n + K(n-1)*X^ (n-1) +... + K0*S^0.