Skip to main content
1-Visitor
February 25, 2021
Solved

Implementation of Lagrange Interpolation

  • February 25, 2021
  • 2 replies
  • 5945 views

Hello, I am trying to implement a program where I can find out the "y" value for a given "x" value using Lagrange Interpolation with data points (x,y) like the ones shown below:

JA_9803374_1-1614219290768.png

JA_9803374_2-1614219299785.pngJA_9803374_3-1614219316454.png

The program should use these expressions:

JA_9803374_5-1614219459897.png

 

 

 

 

Best answer by Fred_Kohlhepp

It doesn't look like you've put too much thought and effort into this.

 

However, as promised!

2 replies

14-Alexandrite
February 25, 2021

While interesting what have you got so far? Couldn't see any attached mcad sheet!

Where are the stumbling blocks?

23-Emerald I
February 25, 2021

Assuming Werner's right, and this IS homework, you need to show an honest effort (AKA, post your worksheet!)

 

That said, these were developed (as LaGrange polynomial interpolation functions) using Prime 4.0 Express.  Worksheet will be posted upon demonstration of honest effort.

Fred_Kohlhepp_0-1614260239477.png

 

25-Diamond I
February 25, 2021

@Fred_Kohlhepp wrote:

Assuming Werner's right, and this IS homework,

 


The poster himself labelled his question with "Math Homework" 🙂

25-Diamond I
February 25, 2021

As this is obviously homework you should show your attempts for a solution. This also would help us to see where you have problems with the handling of Prime so we can help.

If you already derived a solution you may check your function by creating a plot and also check against the built-in "polyfit" function:

Werner_E_1-1614251899670.png