[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gsl] Error in Coulomb Wave Function Routines
From: |
scott pratt |
Subject: |
[Bug-gsl] Error in Coulomb Wave Function Routines |
Date: |
Sat, 28 Jan 2006 12:45:36 -0500 |
Dear GSL folks,
I ran into a problem with your routines for calculating F_L and G_L, the
partial-wave solutions for the Coulomb problem. The functions are
discontinuous,
as the functions flip signs for values of x~3.2 and x~5.8 in the
example below.
I'm working with GSL 1.7
Thanks for everything, - Scott Pratt
#include <cstdio>
#include <cmath>
#include <gsl/gsl_sf.h>
int main(){
int L=2,dummy;
double x,eta=0.1;
double expF,expG;
double *fc,*gc;
fc=new double[L+1];
gc=new double[L+1];
printf("eta=%g\n",eta);
printf("x ____ F(L=0) G(L=0) ___ F(L=1) G(L=1) ___ F(L=2) G(L=2)
___\n");
for(x=0.1;x<7;x+=0.05){
dummy=gsl_sf_coulomb_wave_FG_array(0,L,eta,x,fc,gc,&expF,&expG);
expF=exp(expF);
expG=exp(expG);
printf("%4.2f %7.3f %7.3f %7.3f %7.3f %7.3f %7.3f\n",
x,fc[0]*expF,gc[0]*expG,fc[1]*expF,gc[1]*expG,fc[2]*expF,gc[2]
*expG);
}
delete [] fc;
delete [] gc;
return 0;
}
____________________ OUTPUT_______________________
x ____ F(L=0) G(L=0) ___ F(L=1) G(L=1) ___ F(L=2) G(L=2) ___
0.10 0.098 1.007 0.003 10.199 0.000 305.112
0.15 0.147 1.000 0.007 6.838 0.000 135.856
0.20 0.196 0.990 0.013 5.169 0.001 76.625
0.25 0.244 0.979 0.020 4.178 0.001 49.215
0.30 0.292 0.965 0.029 3.524 0.002 34.329
0.35 0.339 0.949 0.040 3.064 0.003 25.356
0.40 0.385 0.931 0.052 2.723 0.004 19.535
0.45 0.430 0.910 0.065 2.463 0.006 15.547
0.50 0.474 0.887 0.080 2.258 0.008 12.696
0.55 0.517 0.863 0.097 2.094 0.011 10.589
0.60 0.559 0.836 0.114 1.959 0.014 8.988
0.65 0.600 0.807 0.133 1.847 0.018 7.745
0.70 0.639 0.776 0.154 1.752 0.022 6.760
0.75 0.676 0.743 0.175 1.671 0.027 5.967
0.80 0.712 0.709 0.198 1.601 0.032 5.320
0.85 0.746 0.673 0.221 1.540 0.038 4.785
0.90 0.778 0.635 0.246 1.485 0.045 4.338
0.95 0.809 0.595 0.272 1.436 0.053 3.962
1.00 0.837 0.554 0.298 1.392 0.061 3.642
1.05 0.863 0.512 0.325 1.351 0.070 3.368
1.10 0.888 0.469 0.353 1.313 0.080 3.132
1.15 0.910 0.424 0.381 1.277 0.091 2.926
1.20 0.930 0.378 0.410 1.243 0.103 2.747
1.25 0.947 0.332 0.440 1.210 0.115 2.590
1.30 0.962 0.284 0.469 1.178 0.128 2.452
1.35 0.975 0.236 0.499 1.146 0.142 2.329
1.40 0.985 0.187 0.529 1.115 0.157 2.219
1.45 0.993 0.138 0.560 1.084 0.173 2.121
1.50 0.999 0.088 0.590 1.053 0.189 2.034
1.55 1.002 0.039 0.620 1.022 0.206 1.954
1.60 1.003 -0.011 0.649 0.990 0.224 1.882
1.65 1.001 -0.061 0.679 0.958 0.243 1.817
1.70 0.997 -0.111 0.707 0.925 0.263 1.757
1.75 0.990 -0.160 0.736 0.891 0.283 1.701
1.80 0.980 -0.209 0.764 0.857 0.304 1.650
1.85 0.969 -0.258 0.791 0.822 0.325 1.603
1.90 0.955 -0.305 0.817 0.786 0.347 1.558
1.95 0.938 -0.352 0.842 0.749 0.370 1.516
2.00 0.920 -0.399 0.867 0.712 0.393 1.477
2.05 0.899 -0.444 0.890 0.673 0.417 1.439
2.10 0.875 -0.488 0.912 0.634 0.442 1.403
2.15 0.850 -0.531 0.933 0.593 0.466 1.368
2.20 0.822 -0.573 0.953 0.552 0.491 1.334
2.25 0.793 -0.613 0.971 0.511 0.517 1.301
2.30 0.761 -0.651 0.988 0.468 0.542 1.269
2.35 0.728 -0.689 1.003 0.425 0.568 1.237
2.40 0.693 -0.724 1.017 0.381 0.594 1.205
2.45 0.656 -0.757 1.029 0.336 0.620 1.174
2.50 0.617 -0.789 1.040 0.291 0.646 1.143
2.55 0.577 -0.819 1.048 0.245 0.672 1.111
2.60 0.536 -0.847 1.055 0.199 0.698 1.079
2.65 0.493 -0.872 1.060 0.153 0.723 1.047
2.70 0.449 -0.896 1.063 0.106 0.749 1.015
2.75 0.404 -0.917 1.065 0.059 0.774 0.982
2.80 0.357 -0.936 1.064 0.012 0.798 0.949
2.85 0.310 -0.952 1.061 -0.035 0.823 0.915
2.90 0.263 -0.967 1.057 -0.082 0.846 0.881
2.95 0.214 -0.978 1.050 -0.129 0.870 0.846
3.00 0.165 -0.988 1.041 -0.175 0.892 0.810
3.05 0.116 -0.995 1.031 -0.221 0.914 0.774
3.10 0.066 -0.999 1.018 -0.267 0.935 0.737
3.15 0.016 -1.001 1.004 -0.312 0.955 0.699
3.20 0.034 1.001 -0.987 0.357 -0.974 -0.661
3.25 0.084 0.998 -0.968 0.401 -0.992 -0.622
3.30 0.133 0.993 -0.948 0.444 -1.009 -0.582
3.35 0.183 0.985 -0.925 0.486 -1.025 -0.542
3.40 0.232 0.974 -0.901 0.528 -1.040 -0.501
3.45 0.280 0.962 -0.875 0.568 -1.054 -0.459
3.50 0.327 0.946 -0.847 0.607 -1.066 -0.417
3.55 0.374 0.929 -0.817 0.644 -1.077 -0.375
3.60 0.420 0.909 -0.786 0.681 -1.086 -0.332
3.65 0.465 0.887 -0.752 0.716 -1.094 -0.288
3.70 0.508 0.863 -0.718 0.749 -1.101 -0.244
3.75 0.551 0.836 -0.682 0.781 -1.106 -0.200
3.80 0.592 0.808 -0.644 0.811 -1.110 -0.155
3.85 0.631 0.777 -0.605 0.839 -1.112 -0.111
3.90 0.669 0.745 -0.564 0.866 -1.112 -0.066
3.95 0.705 0.711 -0.523 0.891 -1.110 -0.021
4.00 0.740 0.674 -0.480 0.914 -1.107 0.025
4.05 0.773 0.637 -0.436 0.935 -1.103 0.070
4.10 0.803 0.597 -0.392 0.953 -1.096 0.114
4.15 0.832 0.557 -0.346 0.970 -1.088 0.159
4.20 0.859 0.514 -0.300 0.985 -1.078 0.204
4.25 0.883 0.471 -0.253 0.997 -1.066 0.248
4.30 0.906 0.426 -0.205 1.007 -1.052 0.292
4.35 0.926 0.381 -0.157 1.015 -1.037 0.335
4.40 0.944 0.334 -0.109 1.021 -1.020 0.378
4.45 0.959 0.286 -0.060 1.024 -1.001 0.420
4.50 0.972 0.238 -0.012 1.026 -0.980 0.461
4.55 0.983 0.189 0.037 1.024 -0.958 0.501
4.60 0.991 0.140 0.086 1.021 -0.934 0.541
4.65 0.997 0.091 0.134 1.015 -0.908 0.580
4.70 1.000 0.041 0.182 1.007 -0.881 0.617
4.75 1.001 -0.009 0.230 0.997 -0.852 0.654
4.80 0.999 -0.059 0.277 0.984 -0.822 0.689
4.85 0.995 -0.109 0.324 0.969 -0.790 0.723
4.90 0.988 -0.158 0.370 0.952 -0.756 0.756
4.95 0.979 -0.208 0.415 0.933 -0.722 0.787
5.00 0.968 -0.256 0.459 0.912 -0.685 0.817
5.05 0.954 -0.304 0.502 0.888 -0.648 0.845
5.10 0.937 -0.351 0.544 0.863 -0.609 0.872
5.15 0.919 -0.398 0.584 0.836 -0.569 0.897
5.20 0.898 -0.443 0.624 0.806 -0.528 0.920
5.25 0.874 -0.487 0.662 0.775 -0.486 0.942
5.30 0.849 -0.530 0.698 0.742 -0.444 0.961
5.35 0.822 -0.572 0.733 0.707 -0.400 0.979
5.40 0.792 -0.612 0.766 0.671 -0.355 0.995
5.45 0.760 -0.651 0.797 0.633 -0.310 1.009
5.50 0.727 -0.688 0.826 0.594 -0.264 1.021
5.55 0.692 -0.723 0.854 0.553 -0.218 1.030
5.60 0.655 -0.757 0.879 0.511 -0.171 1.038
5.65 0.616 -0.789 0.903 0.468 -0.123 1.044
5.70 0.576 -0.818 0.924 0.423 -0.076 1.048
5.75 0.535 -0.846 0.943 0.378 -0.028 1.049
5.80 -0.492 0.872 -0.960 -0.332 -0.019 -1.048
5.85 -0.448 0.895 -0.975 -0.285 -0.067 -1.045
5.90 -0.402 0.916 -0.987 -0.237 -0.114 -1.041
5.95 -0.356 0.935 -0.997 -0.189 -0.162 -1.033
6.00 -0.309 0.952 -1.005 -0.140 -0.209 -1.024
6.05 -0.261 0.966 -1.010 -0.091 -0.255 -1.013
6.10 -0.213 0.978 -1.013 -0.042 -0.301 -0.999
6.15 -0.164 0.987 -1.014 0.007 -0.346 -0.984
6.20 -0.114 0.994 -1.012 0.057 -0.391 -0.966
6.25 -0.064 0.999 -1.008 0.106 -0.435 -0.946
6.30 -0.014 1.001 -1.001 0.155 -0.478 -0.925
6.35 -0.036 -1.000 0.993 -0.203 0.519 0.901
6.40 -0.085 -0.997 0.981 -0.251 0.560 0.876
6.45 -0.135 -0.992 0.968 -0.299 0.600 0.848
6.50 -0.184 -0.984 0.952 -0.345 0.638 0.819
6.55 -0.233 -0.973 0.934 -0.391 0.675 0.788
6.60 -0.282 -0.960 0.913 -0.436 0.710 0.755
6.65 -0.329 -0.945 0.891 -0.480 0.744 0.721
6.70 -0.376 -0.927 0.866 -0.523 0.777 0.685
6.75 -0.422 -0.908 0.839 -0.565 0.807 0.648
6.80 -0.466 -0.885 0.811 -0.605 0.836 0.609
6.85 -0.510 -0.861 0.780 -0.644 0.863 0.569
6.90 -0.552 -0.834 0.748 -0.681 0.889 0.528
6.95 -0.593 -0.806 0.713 -0.717 0.912 0.486
7.00 -0.633 -0.775 0.677 -0.750 0.933 0.442
% ____________________________________________________________________
% Scott Pratt address@hidden
% Dept. of Physics and Astronomy http://www.pa.msu.edu/~pratts
% 4208A BioMedical Physical Sci. Bldg.
% Michigan State University (517) 355-9200, ext. 2016
% East Lansing, MI 48824-2320 fax: (517) 353-4500
% ____________________________________________________________________
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-gsl] Error in Coulomb Wave Function Routines,
scott pratt <=