This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Er:Re: Er:Re: Er:Re: [Bug-gsl] discontinuity in dilog function


Hi Gerard,

I've realised that I made a mistake and I don't know enough about
Riemann surfaces. There are in fact two branch point at z=0 and z=1.

The reason for this is as you go around the origin
you pick up a factor of 
\int^z 2\pi i/(1-z)dz = 2\pi i log(1-z) 
 
the second branch point then comes from resolving log(1-z)
the corrected version of spense taking the principal (-pi..pi) part of
this log should be

Thus to have a continuous function as we loop around the origin with |z|<1
we need

const double ntp  = floor((omega+M_PI)/(2.0*M_PI));
imag_sp->val -= M_PI*ntp*log(oms_x*oms_x+s_y*s_y);
real_sp->val += 2*M_PI*ntp*atan2(oms_y,oms_x);
imag_sp->err *= fabs(ntp) + 1.0;

Thus to have a continuous function as we loop around the origin with |z|>1
we need
const double ntp  = floor((omega+M_PI)/(2.0*M_PI));
const double kk   = floor(omega/(2.0*M_PI));
imag_sp->val -= M_PI*ntp*log(oms_x*oms_x+s_y*s_y);
real_sp->val += 2*M_PI*(ntp*atan2(oms_y,oms_x) +M_PI*kk*(kk+1));
imag_sp->err *= fabs(ntp) + 1.0;

I've checked that these do in fact give the correct results.

Jim


 




 
 Jungman writes:
 > On Tue, 2004-09-21 at 02:07, Jim McElwaine wrote:
 > 
 > > I've attached two figures.
 > > Each contains dilog evaluated over |Re(z)|<2 |Im(z)|<2
 > > Each figure has four sub figures showing contours of 
 > > abs(Li2), arg(Li2), Real(Li2), Imag(Li2)
 > > The first figure (1.png) has -\pi<arg(z)<\pi
 > > the second figure (2.png) calls dilog with pi<arg(z)<3*pi
 > > You can clearly see the discontinuities
 > 
 > Ok. I guess my tests missed again.
 > 
 > 
 > > My only point about the branch point was that since the argument is
 > > passed as re^{i\theta}, if the definition used is
 > > \int log(z)/(1-z) so the branch point is at the origin
 > > Then  the function can be defined over the full Riemann surface using
 > > \theta and no branch cut is necessary.
 > 
 > Yes. Is this desirable?
 > My only concern is to avoid confusing people;
 > is this the way it is typically used? Anyway, it is
 > certainly more appealing to do it for the whole
 > Riemann surface, so I have an urge to just do it.
 > 
 > -- 
 > Gerard Jungman <jungman@lanl.gov>
 > Los Alamos National Laboratory
 > 
 > 

-- 
Dr. Jim McElwaine   
H0.15, Department of Applied Maths and Theoretical Physics
Centre for Mathematical Sciences, Cambridge University  
Wilberforce Road, Cambridge, CB3 0WA  
email: jnm11@amtp.cam.ac.uk 
http://www.damtp.cam.ac.uk/user/jnm11/
office  +44 1223 337858
college +44 1223 339787
home    +44 1223 710497


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]