Epsilon Algorithm for Computing Padé Approximant

6 Ansichten (letzte 30 Tage)
Jason Nicholson
Jason Nicholson am 6 Mai 2021
Kommentiert: Jason Nicholson am 7 Jul. 2023
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?

Akzeptierte Antwort

Zezheng Wu
Zezheng Wu am 4 Jul. 2023
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

Weitere Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by