Interpolation help fitting curve to three points

In summary: Yes, you are correct. The correct equation should be:20(x−2)(x−5)/(1−2)(1−5)+4(x−1)(x−5)/(2−1)(2−5)+3(x−1)(x−2)/(5−1)(5−2)In summary, the conversation is about fitting three given points (1,20), (2,4), and (5,3) with a curve. The person is wondering about using the Lagrange polynomial to do this, and if it is possible to fit the points with a cubic function. Another person suggests using example 3 in the provided link or writing out three quadratic equations to solve for the coefficients of a parabola
  • #1
KV-1
16
1
Hello,

I have the following points that need to be fitted with a curve:
(1,20);(2,4);(5,3)

I'm wondering how to use the http://en.wikipedia.org/wiki/Lagrange_polynomial to do this.

If possible, can these points be fitted with a cubic function?

I tried to fit a cubic to this, but for me it's a game of guess and check which won't give me anything efficiently.
 
Physics news on Phys.org
  • #2
There are infinitely many cubic polynomial equations that will go through three points, but only one quadratic (i.e. parabola). You can use example 3 as a guide in the link you provided, or write out three quadratic equations by substituting the values you have for x and y. In the end you'll have 3 equations with 3 unknowns (i.e. the coefficients of the parabola) that can be solved using substitution.
 
Last edited:
  • #3
And the Lagrange polynomial formula gives that quadratic, not a cubic.

The given points are (1,20), (2,4), and (5,3).
[tex]20\frac{(x- 2)(x- 5)}{(1- 2)(1- 3)}+ 4\frac{(x- 1)(x- 5)}{(2- 1)(2- 5)}+ 3\frac{(x- 1)(x- 2)}{(5- 1)(5- 2)}[/tex]
[tex]= 20\frac{(x- 2)(x- 5)}{2}+ 4\frac{(x-1)(x-5)}{-3}+ 3\frac{(x-1)(x-2)}{12}[/tex]
 
  • #4
HallsofIvy said:
And the Lagrange polynomial formula gives that quadratic, not a cubic.

The given points are (1,20), (2,4), and (5,3).
[tex]20\frac{(x- 2)(x- 5)}{(1- 2)(1- 3)}+ 4\frac{(x- 1)(x- 5)}{(2- 1)(2- 5)}+ 3\frac{(x- 1)(x- 2)}{(5- 1)(5- 2)}[/tex]
[tex]= 20\frac{(x- 2)(x- 5)}{2}+ 4\frac{(x-1)(x-5)}{-3}+ 3\frac{(x-1)(x-2)}{12}[/tex]
Hallsofivy, i think there's a mistake.. the bold one..20(x−2)(x−5)/(1−2)(1−5)+4(x−1)(x−5)/(2−1)(2−5)+3(x−1)(x−2)/(5−1)(5−2)

it is 5, not 3 right?
 

What is interpolation?

Interpolation is a mathematical technique used to estimate values between known data points. It involves creating a curve or function that passes through the known data points and can be used to predict values at other points within the data range.

How is interpolation helpful in fitting a curve to three points?

Interpolation is useful in fitting a curve to three points because it allows us to estimate the values of the curve at points between the known data points. This can help us better understand the overall trend of the data and make more accurate predictions.

What are the different methods of interpolation?

The two main methods of interpolation are linear interpolation and polynomial interpolation. Linear interpolation involves fitting a straight line between two points, while polynomial interpolation involves fitting a curve of a higher degree (such as a parabola or cubic) between multiple points.

How do you choose the best interpolation method for your data?

The best interpolation method depends on the nature of your data and the level of accuracy required. Linear interpolation may be suitable for simple and linear data, while polynomial interpolation may be better for more complex and non-linear data. It is important to consider the limitations and assumptions of each method before choosing the best one for your data.

What are the potential limitations of interpolation?

While interpolation can be a useful tool, it is important to be aware of its limitations. Interpolation assumes that the data follows a smooth and continuous curve, and may not accurately represent data with sudden changes or outliers. Additionally, extrapolation (predicting values beyond the known data range) can be unreliable and should be used with caution.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
896
  • Topology and Analysis
Replies
2
Views
1K
  • Linear and Abstract Algebra
Replies
10
Views
3K
Replies
16
Views
2K
Replies
4
Views
999
Replies
2
Views
8K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
Replies
3
Views
732
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Back
Top