Taylor Maximum Error in the point 0.5

3 ビュー (過去 30 日間)
Duncan Weakley
Duncan Weakley 2020 年 12 月 10 日
回答済み: Uday Pradhan 2020 年 12 月 16 日
Hi There
I need to determine the maximum error which can be made with the taylor polynomial of g(x) = sinh(x^2) in the point x = 0.5
This is where c = 0;
For the third degree taylor polynomial.
I do not understand how to do this in matlab
could you please help me

回答 (1 件)

Uday Pradhan
Uday Pradhan 2020 年 12 月 16 日
Hi,
You can use the Symbolic Math toolbox to solve your issue as follows:
syms x;
f = sinh(x^2);
T = taylor(f); %finds the Taylor expansion around 0 till the fifth degree by default, to change order
% you can use 'Order' argument of taylor function
x = 0.5;
val = double(subs(T)); %find value of the Taylor polynomial at 0.5
val1 = sinh(x^2); %real value from the function
error = abs(val - val1); %find error
References: taylor, subs

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by