Borrar filtros
Borrar filtros

Approximation of Faddeeva function with Laplace Continued Fraction

2 visualizaciones (últimos 30 días)
Martin Doherty
Martin Doherty el 16 de Mzo. de 2022
Editada: Martin Doherty el 17 de Mzo. de 2022
Dear Community,
I am attempting to approximate the Faddeeva function, , with complex argument (z) using the Laplace Continued Fraction shown below:
I wish to understand the variation in as additional "terms" i.e. continued fractions are used hence want to do a forward calculation starting with 1, 1/2, 2/2, 3/2...... n/2. I can compute the reverse calculation starting from n/2 and working backwards but wrap my head around how to do this the opposite way.
Thanks in advance!
  1 comentario
Martin Doherty
Martin Doherty el 17 de Mzo. de 2022
Editada: Martin Doherty el 17 de Mzo. de 2022
My current solution is to create an outer loop which increments the number of additional continued fractions whilst still solving "backwards" in an inner loop as shown below. It doesn't feel like the most efficient way of doing things mind you.
%% Laplace Continued Fraction
z = 20.0*exp(1i*5*pi/8)
r = 1.0;
nterms = 10;
i = 1;
for j = 1:nterms % Outer loop - iterate # of additional continued fractions
for k = i:-1:1 % Inner loop - backwards last term to first
if k == i % Last term only divided by z;
b = k/2/z;
else
b = k/2;
end
r = 1/(z-b*r);
F4_store(j) = 1i/sqrt(pi)*r; % Store each iteration
end
i = i+1;
r = 1.0; % Reset r for additional continued fraction
end

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by