Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please solve using Matlab and show your work so I can see where I am going wrong

ID: 2078220 • Letter: P

Question

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

various weight. From the data provided below, find the predicted rocket altitude when Ca is 0.50 and weight is 40 br First, use linear interpolation for weight and then use a second order Lagrangian polynomial to interpolate the drag coefficient. Predicted Rocket Altitude in ft Drag Coefficient (Cd) Weight (w) 0.65 0.25 0.45 0.85 lbf 44 6200 5100 4200 3800 39 7100 5500 4300 3900 34 7800 6100 4600 4100

Explanation / Answer

function [P,R,S] = lagrangepoly(X,Y,XX) %LAGRANGEPOLY Lagrange interpolation polynomial fitting a set of points % [P,R,S] = LAGRANGEPOLY(X,Y) where X and Y are row vectors % defining a set of N points uses Lagrange's method to find % the N-1th order polynomial in X that passes through these % points. P returns the N coefficients defining the polynomial, % in the same order as used by POLY and POLYVAL (highest order first). % Then, polyval(P,X) = Y. R returns the x-coordinates of the N-1 % extrema of the resulting polynomial (roots of its derivative), % and S returns the y-values at those extrema. % % YY = LAGRANGEPOLY(X,Y,XX) returns the values of the polynomial % sampled at the points specified in XX -- the same as % YY = POLYVAL(LAGRANGEPOLY(X,Y)).