Question

(12 points) Use polynomial interpolation and central difference techniques to compute f and f at x 0.5 using the following unequally spaced data. 1.0 0.0 2.0 f(x) 15.0 2.0 11.0 Hint: fit a parabola through the three data points.

Please solve using matlab and show your work so I can see where I am going wrong. Your help is appreciated

0 0
Add a comment Improve this question Transcribed image text
Answer #1

clear
clc
x=[-2 0 1];
f=[15 11 2];
fit=polyfit(x,f,2);
X=-5:.1:5;%we will now evaluate fitted parabola at these points, with a gap of .1
Y=polyval(fit,X);%evaluated
[~,index]=find(X==.5);%finding index where x=.5;
fdash=(Y(index+1)-Y(index-1))/(2*.1)
fDoubledash=(Y(index-1)-2*Y(index)+Y(index+1))/(.1*.1)

Command Window fdash- -9.0000 EDoubledash - -4.6667

Add a comment
Know the answer?
Add Answer to:
Please solve using matlab and show your work so I can see where I am going...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • **********************matlab code please******************* 1. Interpolation error of polynomial fit Using 11 equi-dist...

    **********************matlab code please******************* 1. Interpolation error of polynomial fit Using 11 equi-distributed points (10 equal segments) in the interval [-1 1], Using Newton's form find and plot the interpolating polynomial p(x) for the function f(x) -1/(125x2). Comment on the large discrepancies between p(x) and the function f(x) that the data came from Write down an expression for the error in the interpolating polynomial above? Which part of the expression is responsible for the large errors observed? 1. Interpolation error of...

  • please write down detailed solution (do not copy 3. [Polynomial interpolation versus least squares fitting, 10pts]...

    please write down detailed solution (do not copy 3. [Polynomial interpolation versus least squares fitting, 10pts] Recall how Q7 in HW3 required you to find the cubic best fit to six given data points. This led to a least squares optimization problem. We are given the same points as in HW3: i 01 | 2 | 3 | 4 | 5 X 0.0 0.5 1.0 1.5 2.0 2.5 Y 0.0 0.20 0.27 0.30 0.32 0.33 (a) Write down the least...

  • Please show all work and explain steps So that I can see where I am going...

    Please show all work and explain steps So that I can see where I am going wrong. After having been in position 1 for a long time, the switch in the circuit as shown below was moved to position 2 at t-os, were Vo-14 V, R1-2 Ω, R2 = 148 Ω, R3-40 Ω, and L-1 H OL (a) Determine () and VL(O) iL(:0.000 (A); VL(o):0.000 (V) You are correct ies ur receipt no. is 146-1674 (b) Determine iL(O) and Vi(O):...

  • I want -C parts- using matlab 2. The population of the world for selected years from...

    I want -C parts- using matlab 2. The population of the world for selected years from 1750 to 2009 is given in the following table: Year Population (millions) 1750 791 1800 980 1850 1,260 1900 1.650 1950 2,520 1990 5,270 2000 6,060 2009 6,800 (a) Determine the exponential function that best fits the data. Use the function to estimate the population in 1980. Make a plot of the points and the function. (b) Curve-fit the data with a third-order polynomial....

  • matlab The error function is a mathematical function that frequently arises in probability and statistics. It also c...

    matlab The error function is a mathematical function that frequently arises in probability and statistics. It also can show up in the solution to some partial differential equations, particularly those arising in heat and mass transfer applications. The error function is defined as 2 e-t dt picture attached This function is actually built-in to MATLAB as the command erf, and here we'll use that function to compute a "true value" with which we can compare results of two interpolation approaches....

  • I am using Java to try and solve this problem. Suggestions on where I am going...

    I am using Java to try and solve this problem. Suggestions on where I am going wrong? PREVNEXT Workbench ? a Exercise 20662- WORK AREA RESULTS Write the definition of a method named sumArray that has one parameter, an array of ints. The method returns the sum of the elements of the array as an int. x9 of 9: 2018-07-10 12:58:15 -W SUBMIT 1 public int sumArray(int[] a) 2 int i; int sum = 0; for (í 0; í?a.length; ?++)...

  • could you please draw out the mechanism so i may see where i am going wrong....

    could you please draw out the mechanism so i may see where i am going wrong. thank you! Part A Which of the following is not an intermediate in the acid-catalyzed formation of an acetal from acetone and methanol View Available Hint(s) НО ОСН3 ОСН3 Шарлото НО ОН, Но осна

  • I need help with parts A B D E and F. Please show hand work for...

    I need help with parts A B D E and F. Please show hand work for solving A and B while D and E should be matlab codes. How do i pick the right graph for part F? 5 2 4 6 Linear spline: s fi+ (x-x) 2) Given the points 40 78 125 256 348 425 X1-x a) Write the correct linear spline equation to interpolate for x 4.72, simplifying where appropriate to get to the slope-intercept form. (4...

  • Linear Algebra. please complete or show me how to to complete it. idk what to do....

    Linear Algebra. please complete or show me how to to complete it. idk what to do. thank you Curve Fitting It is desired to fit a polynomial curve through evenly spaced (x-direction) points. The general form of a polynomial is: f(x) = 4x + 4-1x* +ajx + ao If one wishes to fit a curve through, say 4 points, one would need a 3rd degree polynomial (n = 3) such that 4 unknown constants could be evaluated. In the absence...

  • Hi it's my code for python I almost finished my project but only one thing left which is most con...

    Hi it's my code for python I almost finished my project but only one thing left which is most confusing part please help me I have to find most occurring ending character from a to z For instance, output should be like this I have to find a to z. Words starting with ‘a’ end mostly with ‘O’ Words starting with ‘b’ end mostly with ‘O’ ...... No words start with ‘O’(If there's no word in the character from a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT