How to find polynomial fiting on f(x) with known f(x1),f(x2​),f'(x1),f​'(x2)

5 次查看(过去 30 天)
According to theory if two values for f on X1,X2 and the derivatives on X1,X2 you can use them to find a polynomial p(x) with p(x1)=f(x1), p(x2)=f(x2), p'(x1)=f'(x1), p'(x2)=f'(x2). I want to do that for f(x)=cos(2x^2) at 3.4=<x<=3.6 I have found the values for p and p' but i dont know how to combine them to get the polynomial (poly command is only useful for roots)
  2 个评论
John D'Errico
John D'Errico 2018-6-18
So, two points, with two pieces of information at each, will allow you to estimate 4 coefficients. So a cubic polynomial. What have you tried? If nothing, on what is very likely homework, why nothing? Why not try something? Then show what you try, and you might get some help. Otherwise, I would suggest using solve as a possibility. Or, you could do it using many other approaches, including pencil and paper.
John D'Errico
John D'Errico 2018-6-18
Come on. What would you try?
I'll get you started.
x1 = 3.4;
x2 = 3.6;
syms x a b c d
P(x) = a*x^3 + b*x^2 + c*x + d;
F(x) = cos(2*x^2);
dF = diff(f);
dP = diff(P);
Now, you need to make some effort. What equations would you write? How would you solve them?

请先登录,再进行评论。

采纳的回答

KSSV
KSSV 2018-6-18
f = @(x) cos(2*x.^2) ;
N = 100 ;
x = linspace(3.4,3.6,N) ;
y = f(x) ;
plot(x,y) ;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Polynomials 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by