필터 지우기
필터 지우기

Increasing accuracy of Whittaker functions

조회 수: 4 (최근 30일)
Yuriy Yerin
Yuriy Yerin 2020년 7월 18일
댓글: Joshua Brown 2023년 9월 23일
Hello.
I know that there were a lot questions devoted to accuracy of fslove procedure.
I'm trying to solve a transcendental equation with so-called Whittaker functions and the gamma function
where k is the integer number, and are some parameters (see below) and E is the unknown variable.
Below is my code
function z=dispersion
mm=linspace(0,20,21);
for j=1:21
[y,fval]=fzero(@(E) self(E,mm(j)),0.51,optimset('Display','off','TolFun', 1.0e-15, 'TolX',1.0e-15));
Energy(j)=y;
value(j)=fval;
end
Energy
value
end
function z=self(E,m)
r1=0.25;
r2=5;
z=gamma(1/2+floor(abs(m))/2-E-floor(m)/2).*(whittakerM(E+floor(m)/2,floor(abs(m))/2,r2^2/2).*whittakerW(E+floor(m)/2,floor(abs(m))/2,r1^2/2)-...
whittakerM(E+floor(m)/2,floor(abs(m))/2,r1^2/2).*whittakerW(E+floor(m)/2,floor(abs(m))/2,r2^2/2));
end
I have a problem with accuracy of Whittaker functions in the case of large parameter m . When for instance I obtain and value = -3.048609148470981*1.0e+22 that is inappropriate accuracy. Is it possible to resolve such a kind of problem?
P.S. Actually I understand the origin of the problem. Abnormal values of fval is due to behaviour of Whittaker functions for large values of m. Nevertheless I would greatly appreciate for any suggestions.
  댓글 수: 1
Joshua Brown
Joshua Brown 2023년 9월 23일
Hey! I've had the same issue. A quick fix is the folowing:
m = sym(m);
double(whittakerM(E+floor(m)/2,floor(abs(m))/2,r1^2/2));
(I.e. going via symbolic algebra to deal with things like (e^(pi*m))*e^-(pi*m) better) then should be accurate even for large m.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by