Approximation of Faddeeva function with Laplace Continued Fraction

2 次查看(过去 30 天)
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 个评论
Martin Doherty
Martin Doherty 2022-3-17
编辑:Martin Doherty 2022-3-17
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

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by