I have the following table with 90 elements, and I want to write a loop that gives me the Lagrange operators. I want to construct an interpolation with Lagrange interpolation and show the loop to calculate the Lagrange operators.
{{230.5, 622.}, {231.5, 622.}, {230.5, 613.}, {234., 605.}, {235., 594.}, {236., 584.}, {239.5, 574.}, {238., 564.}, {239.5, 549.}, {239.5, 538.}, {244., 531.}, {242.5, 516.}, {236., 510.}, {235., 501.}, {230.5, 491.}, {235., 490.}, {236., 481.}, {238., 469.}, {242.5, 459.}, {245., 449.}, {241.5, 443.}, {247., 433.}, {254., 424.}, {255., 417.}, {264., 408.}, {266., 399.}, {267., 401.}, {266., 395.}, {268.5, 389.}, {278.5, 383.}, {279.5, 370.}, {288.5, 356.}, {297.5, 340.}, {301.5, 331.}, {305., 327.}, {310.5, 324.}, {319.5, 315.}, {325., 306.}, {337.5, 296.}, {345., 292.}, {349.5, 276.}, {353., 258.}, {358.5, 245.}, {359.5, 235.}, {362., 232.}, {364., 224.}, {372., 208.}, {373., 195.}, {386.5, 185.}, {396.5, 183.}, {408.5, 176.}, {418.5, 171.}, {429., 162.}, {440., 156.}, {447.5, 154.}, {459., 144.}, {461., 144.}, {463.5, 140.}, {471., 142.}, {484.5, 134.}, {491., 129.}, {495.5, 123.}, {501., 125.}, {507., 121.}, {517., 110.}, {528., 108.}, {537., 103.}, {543.5, 99.}, {554.5, 97.}, {558., 91.}, {562.5,88.}, {571.5, 87.}, {578., 82.}, {587., 74.}, {597., 68.}, {605., 68.}, {607., 63.}, {611.5, 67.}, {617., 60.}, {622.5, 59.}, {627., 59.}, {640.5, 58.}, {647., 54.}, {650.5, 49.}, {652.5, 49.}, {657., 52.}, {667., 53.}, {676., 51.}, {681.5, 44.}, {683., 40.}};
Thank you
InterpolatingPolynomialwill do it, if used right. Someone asked this same question (maybe different data) a couple weeks ago or so. You can search the site for interpolation and Lagrange. – Michael E2 May 05 '20 at 12:43Foldloop is given at the end.) – Michael E2 May 05 '20 at 13:04Forloop? It's rarely done in Mathematica as explained here. – Michael E2 May 05 '20 at 13:07Foryou will find some examples which might be helpful. In general the mathemtica help is a great place to learn about mathematica features. – Max1 May 05 '20 at 13:12L[i, xj, x]in the linked Q&A will work for you, withxj = data[[All, 1]]being the x-coordinates of the data in your question. Best of luck! (Oh, let me just say that polynomial interpolation of 90 points usually has numerical problems. Also the x-coordinate230.5is repeated the data above; I assume it's a typo, otherwise you won't be able to do Lagrange interpolation, which requires distinct x-coordinates.) – Michael E2 May 05 '20 at 13:28