Approximation of Faddeeva function with Laplace Continued Fraction

5 views (last 30 days)
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 Comment
Martin Doherty
Martin Doherty on 17 Mar 2022
Edited: Martin Doherty on 17 Mar 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

Sign in to comment.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!