Question

In: Computer Science

Use a python code to solve Use Newton interpolation to find the unique polynomial p2(x) of...

Use a python code to solve

Use Newton interpolation to find the unique polynomial p2(x) of degree 2 or less, that agrees with the following data: p2(0) = 1, p2(2) = 5, p2(4) = 17.

Solutions

Expert Solution

Explanation of the given question and evaluation:

(Python code attached below)

P2(0)=1

P2(2)=5

P2(4)=17

X Y Y 2Y
0 1

4

2 5

8
4 17

12

Using Newtons Intepretation formula

r= x-x0/h

here x0=0

h=degree=2

therefore r=x/2;

F(x)=Y0 + rY0+ r(r-1)/22Y

F(x)=1+ x/2*4 +(x/2*(x/2-1)/2 )*8

F(x)=1+x+x2

print("Enter X and Y coordinate respectively")
X0=int(input())
Y0=int(input())
X1=int(input())
Y1=int(input())
X2=int(input())
Y2=int(input())
degree=2
deltaY0= Y1-Y0
deltaY1= Y2-Y1

deltasqY=deltaY1-deltaY0
r="x"
rfrac=2

numpt2eq=int(deltaY0/rfrac)

numpt3eq=int(deltasqY/(degree*rfrac*rfrac))

numpt1eq=str(Y0)


result= numpt1eq+"+"+str(numpt2eq-numpt3eq)+r+"+"+str(numpt3eq)+r+"^2"

print("the equation is :",result)


Related Solutions

Use Lagrange interpolation to find the polynomial p3(x) of degree 3 or less, that agree with...
Use Lagrange interpolation to find the polynomial p3(x) of degree 3 or less, that agree with the following data: p3(−1) = 3, p3(0) = −4, p3(1) = 5, and p3(2) = −6. Using python to solve
Find the lagrange polynomials that approximate f(x) = x3 a ) Find the linear interpolation polynomial...
Find the lagrange polynomials that approximate f(x) = x3 a ) Find the linear interpolation polynomial P1(x) using the nodes x0= -1 and x1 = 0 b) Find the quadratic interpolation polynomial P2(x) using the nodes x0= -1 and x1 = 0 and x2 = 1 c) Find the cubic interpolation polynomial P3(x) using the nodes x0= -1 and x1 = 0 and x2 = 1 and x3=2 d) Find the linear interpolation polynomial P1(x) using the nodes x0= 1...
Use python to solve For f (x) = x ln(x), (1) use appropriate Lagrange interpolating polynomial...
Use python to solve For f (x) = x ln(x), (1) use appropriate Lagrange interpolating polynomial of degree three to approximate f(8.4). Use the following data: f(8.1) = 16.94410, f(8.3) = 17.56492, f(8.6) = 18.50515, f(8.7) = 18.82091. (2) use appropriate Newton interpolation polynomial again to redo the work.
PLEASE USE PYTHON CODE 7. Use Newton's method to find the polynomial that fits the following...
PLEASE USE PYTHON CODE 7. Use Newton's method to find the polynomial that fits the following points: x = -3, 2, -1, 3, 1 y = 0, 5, -4, 12, 0
In Sciland code, use the Newton Method to find the root of f(x)=10-x^2 and tol =10^-5
In Sciland code, use the Newton Method to find the root of f(x)=10-x^2 and tol =10^-5
Find the Chebyshev interpolation nodes on the interval [4,12] for an interpolating polynomial of degree 5
Find the Chebyshev interpolation nodes on the interval [4,12] for an interpolating polynomial of degree 5
***Please code in Python Write another code Newton (in double precision) implementing the Newton-Raphson Method   (copy...
***Please code in Python Write another code Newton (in double precision) implementing the Newton-Raphson Method   (copy your Bisect code and modify).   Evaluation of F(x) and F'(x) should be done in a subprogram FCN(x).   The code should ask for input of: x0, TOL, maxIT (and should print output similar to Bisect code).   Debug on a simple problem, like x2−3 = 0.   Then use it to find root of F(x) in [1,2] with TOL=1.e-12. Now consider the problem of finding zeros of      ...
build an excel sheet to calculate the coefficients of the third order Newton interpolating polynomial,and solve...
build an excel sheet to calculate the coefficients of the third order Newton interpolating polynomial,and solve it for any point x, please solve it by excel and i need the file thanks in advance
Consider polynomial interpolation of the function f(x)=1/(1+25x^2) on the interval [-1,1] by (1) an interpolating polynomial...
Consider polynomial interpolation of the function f(x)=1/(1+25x^2) on the interval [-1,1] by (1) an interpolating polynomial determined by m equidistant interpolation points, (2) an interpolating polynomial determined by interpolation at the m zeros of the Chebyshev polynomial T_m(x), and (3) by interpolating by cubic splines instead of by a polynomial. Estimate the approximation error by evaluation max_i |f(z_i)-p(z_i)| for many points z_i on [-1,1]. For instance, you could use 10m points z_i. The cubic spline interpolant can be determined in...
Use Bisection and Newton Raphson methods to find roof for the following equation manually. F(x)=x^2 –...
Use Bisection and Newton Raphson methods to find roof for the following equation manually. F(x)=x^2 – 5 = 0 ε = 0.01
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT