Increase Accuracy of Padé Approximant
You can increase the accuracy of the Padé
approximant by increasing the order. If the expansion point is a pole
or a zero, the accuracy can also be increased by setting OrderMode to relative.
The OrderMode option has no effect if the expansion
point is not a pole or zero.
Find the Padé approximant of tan(x) using pade with
an expansion point of 0 and Order of [1
1]. Find the value of tan(1/5) by substituting
into the Padé approximant using subs, and
use vpa to convert 1/5 into
a numeric value.
syms x
p11 = pade(tan(x),x,0,'Order',[1 1])
p11 = subs(p11,x,vpa(1/5))
p11 =
x
p11 =
0.2
Find the approximation error by subtracting p11 from
the actual value of tan(1/5).
y = tan(vpa(1/5));
error = y - p11
error =
0.0027100355086724833213582716475345
Increase the accuracy of the Padé approximant by increasing
the order using Order. Set Order to [2
2], and find the error.
p22 = pade(tan(x),x,0,'Order',[2 2])
p22 = subs(p22,x,vpa(1/5));
error = y - p22
p22 =
-(3*x)/(x^2 - 3)
error =
0.0000073328059697806186555689448317799
The accuracy increases with increasing order.
If the expansion point is a pole or zero, the accuracy of the
Padé approximant decreases. Setting the OrderMode option
to relative compensates for the decreased accuracy.
For details, see Padé Approximant.
Because the tan function has a zero at 0,
setting OrderMode to relative increases
accuracy. This option has no effect if the expansion point is not
a pole or zero.
p22Rel = pade(tan(x),x,0,'Order',[2 2],'OrderMode','relative')
p22Rel = subs(p22Rel,x,vpa(1/5));
error = y - p22Rel
p22Rel =
(x*(x^2 - 15))/(3*(2*x^2 - 5))
error =
0.0000000084084014806113311713765317725998
The accuracy increases if the expansion point is a pole or zero
and OrderMode is set to relative.