Message Boards Message Boards

0
|
2314 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Improve the precision of the Whittaker function?

Posted 5 years ago
mu = -0.1; 
    beta = -0.5; 
    sigma = 2.5; 
    a = 90; 
    b = 120; 
    m = -1/(4*beta); m1 = m - 1/2; 
    a1 = mu/(sigmasigmabeta)a^(-2beta); 
    b1 = mu/(sigmasigmabeta)b^(-2beta); 
    MyF[k_] := Gamma[ m - k](WhittakerW[k, m1, b1]WhittakerM[k, m1, a1] - WhittakerM[k, m1, b1]*WhittakerW[k, m1, a1]); 

this code MyF[1000]=0.

But for this code:

MyF1[k_] := N[ Gamma[Rationalize[ m - k]](WhittakerM[Rationalize[k], 0, Rationalize[a1]] WhittakerW[Rationalize[k], 0, Rationalize[b1]] - WhittakerM[Rationalize[k], 0, Rationalize[b1]] WhittakerW[ Rationalize[k], 0, Rationalize[a1]]), 5]; 

MyF1[1000]=0.044810;
POSTED BY: xin jiang
4 Replies

Do the computation with exact numbers:

mu = -1/10; beta = -1/2; sigma = 2 + 1/2;

and turn to floating points only at the very end:

In[7]:= N[MyF[1000], 5]

Out[7]= 0.044810

Your first computation works with machine numbers, which are not enough.

POSTED BY: Gianluca Gorni
mu=-0.1;
beta=-0.5;
sigma=2.5;

(* Add this line to manipulate precision *) 
{mu,beta,sigma}=SetPrecision[{mu,beta,sigma},20];

a=90;
b=120;
m=-1/(4*beta);m1=m-1/2;
a1=mu/(sigma*sigma*beta)a^(-2beta);
b1=mu/(sigma*sigma*beta)b^(-2beta);
MyF[k_]:=Gamma[m-k](WhittakerW[k,m1,b1]WhittakerM[k,m1,a1]-WhittakerM[k,m1,b1]*WhittakerW[k,m1,a1]);

The result is

MyF[1000]//Chop
==> 0.0448100417591471632

Link to documentation:

POSTED BY: Shenghui Yang
Posted 5 years ago

I want to find all roots of the function MyF[k]. and do you know how to do it?

POSTED BY: xin jiang
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract