Epsilon Algorithm for Computing Padé Approximant

조회 수: 5 (최근 30일)
Jason Nicholson
Jason Nicholson 2021년 5월 6일
댓글: Jason Nicholson 2023년 7월 7일
I am looking for a MATLAB implementation of the Epsilon Algorithm (theorem 1 from here). When I look at the Wikipedia page for Padé approximant, I find this quote: "For given x, Padé approximants can be computed by Wynn's epsilon algorithm[1]...". The Wikipedia article links to the epsilon algorithm paper. I am wondering if anyone has ran across this in MATLAB somewhere?

채택된 답변

Zezheng Wu
Zezheng Wu 2023년 7월 4일
Not sure whether you still need this but also for whoever wants to use Wynn's epsilon in MATLAB, here is the code:
function res = wynn(s)
% Step 1: Check length of s and adjust if it's even
n = length(s);
if mod(n, 2) == 0
s = s(1:end-1);
n = n - 1;
end
% Step 2: Initialize the epsilon matrix A with s on the first column
A = zeros(n, n);
A(:, 1) = s;
% Step 3: Compute the remaining columns using Wynn's method
for j = 2:n
for i = 1:(n - j + 1)
if j == 2
A(i, j) = 1 / (A(i + 1, j - 1) - A(i, j - 1));
else
A(i, j) = A(i + 1, j - 2) + 1 / (A(i + 1, j - 1) - A(i, j - 1));
end
end
end
% Step 4: Return the last element in the last column as the estimate of the limit
res = A(1, n);
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by