Epsilon Algorithm for Computing Padé Approximant
조회 수: 7 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
Ze-Zheng 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개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!