Inverse Interpolation. Suppose that we want to solve the equation (x)0, for some
ID: 3184057 • Letter: I
Question
Inverse Interpolation. Suppose that we want to solve the equation (x)0, for some function f which has an inverse s. If we have two approximations o and of a zero z of f then we can use interpolation to find a better approximation,1(0 as follows. Let yo- /(o) and y- /(xi). yo To and P1 (0) 20 + f-1130, yil (0-yo)zo-Yof-1130, yil. We could now define x2 pi(0), evaluate at this point to get y - f(x2), and then add one more row to our table (3) to get f yo, Once this is computed we can evaluate p2(0) to get an improved approximation x, etc. Let f(z) -e-z using the values f(0.5) -0.106530659712633 and f(0.6) 0.051188363905973 find an approximate value for the zero T of f by evaluating p1(0)Explanation / Answer
matlab code
close all
clear
clc
x0 = 0.5; y0 = -0.106530659712633;
x1 = 0.6; y1 = 0.051188363905973;
x2 = x0 - y0*x1;
y2 = f(x2);
fprintf('x2 = p1(0) = f^-1[y0,y1,y2] = %.15f ', x2);
fprintf('f(x2) = %.15f ', y2);
function out = f(x)
out = x - exp(-x);
end
output
x2 = p1(0) = f^-1[y0,y1,y2] = 0.563918395827580
f(x2) = -0.005056824209081
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.