Epsilon Algorithm for Computing Padé Approximant

5 visualizaciones (últimos 30 días)
Jason Nicholson
Jason Nicholson el 6 de Mayo de 2021
Comentada: Jason Nicholson el 7 de Jul. de 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?

Respuesta aceptada

Zezheng Wu
Zezheng Wu el 4 de Jul. de 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

Más respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by