Changeset 1942 for branches/newmole/source/hydro_bauman.cpp
- Timestamp:
- 04/12/08 09:30:35 (9 months ago)
- Files:
-
- 1 modified
-
branches/newmole/source/hydro_bauman.cpp (modified) (33 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newmole/source/hydro_bauman.cpp
r1846 r1942 9 9 /* In this version, quantities that would normally cause a 64-bit floating point processor */ 10 10 /* to either underflow or overflow are evaluated using logs instead of floating point math. */ 11 /* This allows us to use an upper princip lequantum number `n' greater than which the */11 /* This allows us to use an upper principal quantum number `n' greater than which the */ 12 12 /* other version begins to fail. The trade-off is, of course, lower accuracy */ 13 13 /* ( or is it precision ). We use LOG_10 for convenience. */ … … 43 43 /* The recombination coefficient is obtained from the */ 44 44 /* photoionization cross-section (see Burgess 1965). */ 45 /* We have ,*/45 /* We have: */ 46 46 /* */ 47 47 /* - - l'=l+1 */ … … 124 124 /* r^2 */ 125 125 /* */ 126 /* Similiarly, the recombination co -efficient satisfies */126 /* Similiarly, the recombination coefficient satisfies */ 127 127 /************************************************************************************************/ 128 128 … … 144 144 /** \verbatim 145 145 ************************* for LOG version of the file *************************************** 146 In this version, quantit es that would normal cause a 64-bit floating point processor146 In this version, quantities that would normal cause a 64-bit floating point processor 147 147 to underflowed or overflow on intermediate values (ones internal to the calculation) 148 are evaluated using logs. This allows us to use an upper princip lequantum number `n'148 are evaluated using logs. This allows us to use an upper principal quantum number `n' 149 149 greater than 50 which is where the other version begins to fail. The trade-off is, 150 150 of course, lower accuracy( or is it precision ) and perhaps speed. … … 352 352 353 353 /** \verbatim 354 This routine, hri(), calculates the hydrogen radial inte rgral,354 This routine, hri(), calculates the hydrogen radial integral, 355 355 for the transition n,l --> n',l' 356 356 It is, of course, dimensionless. … … 373 373 374 374 /**\verbatim 375 This routine, hri_log10(), calculates the hydrogen radial inte rgral,375 This routine, hri_log10(), calculates the hydrogen radial integral, 376 376 for the transition n,l --> n',l' 377 377 It is, of course, dimensionless. … … 539 539 540 540 /************************************************************************/ 541 /* (4.0/3.0) * PI * FINE_STRUCTURE_CONSTANT * BO RHRADIUS * BORHRADIUS */541 /* (4.0/3.0) * PI * FINE_STRUCTURE_CONSTANT * BOHRRADIUS * BOHRRADIUS */ 542 542 /* */ 543 543 /* */ … … 742 742 /* K = k / Z ::: k^2 = ejected-electron-energy (Ryd) */ 743 743 double K, 744 /* princip lequantum number */744 /* principal quantum number */ 745 745 long int n, 746 746 /* angular momentum quantum number */ 747 747 long int l, 748 /* Temp erary storage for intermediate */748 /* Temporary storage for intermediate */ 749 749 /* results of the recursive routine */ 750 750 double *rcsvV … … 754 754 755 755 long int lp = 0; /* l' */ 756 double sigma = 0.; /* Sum in brocklehurst eq. 3.13 */756 double sigma = 0.; /* Sum in Brocklehurst eq. 3.13 */ 757 757 758 758 ASSERT( n > 0 ); … … 779 779 /* K = k / Z ::: k^2 = ejected-electron-energy (Ryd) */ 780 780 double K, 781 /* princip lequantum number */781 /* principal quantum number */ 782 782 long int n, 783 783 /* angular momentum quantum number */ 784 784 long int l, 785 /* Temp erary storage for intermediate */785 /* Temporary storage for intermediate */ 786 786 mxq *rcsvV_mxq 787 787 /* results of the recursive routine */ … … 791 791 792 792 long int lp = 0; /* l' */ 793 double sigma = 0.; /* Sum in brocklehurst eq. 3.13 */793 double sigma = 0.; /* Sum in Brocklehurst eq. 3.13 */ 794 794 795 795 ASSERT( n > 0 ); … … 835 835 long int l, 836 836 long int lp, 837 /* Temp erary storage for intermediate */837 /* Temporary storage for intermediate */ 838 838 /* results of the recursive routine */ 839 839 double *rcsvV … … 913 913 long int l, 914 914 long int lp, 915 /* Temp erary storage for intermediate */915 /* Temporary storage for intermediate */ 916 916 /* results of the recursive routine */ 917 917 mxq *rcsvV_mxq … … 1010 1010 long int l, 1011 1011 long int lp, 1012 /* Temp erary storage for intermediate */1012 /* Temporary storage for intermediate */ 1013 1013 /* results of the recursive routine */ 1014 1014 double *rcsvV … … 1104 1104 long int l, 1105 1105 long int lp, 1106 /* Temp erary storage for intermediate */1106 /* Temporary storage for intermediate */ 1107 1107 /* results of the recursive routine */ 1108 1108 mxq *rcsvV_mxq … … 1121 1121 double Ksqrd = K * K; 1122 1122 1123 mx GK_mx = {0.0,0} , null_mx = {0.0,0};1123 mx GK_mx = {0.0,0}; 1124 1124 1125 1125 /* l=l'-1 or l=l'+1 */ … … 1306 1306 /* */ 1307 1307 /* from the reference */ 1308 /* M. Broc Klehurst */1308 /* M. Brocklehurst */ 1309 1309 /* Mon. Note. R. astr. Soc. (1971) 153, 471-490 */ 1310 1310 /* */ … … 1322 1322 long int l, 1323 1323 long int lp, 1324 /* Temp erary storage for intermediate */1324 /* Temporary storage for intermediate */ 1325 1325 /* results of the recursive routine */ 1326 1326 double *rcsvV, … … 1473 1473 long int l, 1474 1474 long int lp, 1475 /* Temp erary storage for intermediate */1475 /* Temporary storage for intermediate */ 1476 1476 /* results of the recursive routine */ 1477 1477 mxq *rcsvV_mxq, … … 1682 1682 /* */ 1683 1683 /* from the reference */ 1684 /* M. Broc Klehurst */1684 /* M. Brocklehurst */ 1685 1685 /* Mon. Note. R. astr. Soc. (1971) 153, 471-490 */ 1686 1686 /* */ … … 1996 1996 /* */ 1997 1997 /* From reference; */ 1998 /* M. Broc Klehurst */1998 /* M. Brocklehurst */ 1999 1999 /* Mon. Note. R. astr. Soc. (1971) 153, 471-490 */ 2000 2000 /* */ … … 2024 2024 /* */ 2025 2025 /* */ 2026 /* the starting point for the recursion relations are ;*/2026 /* the starting point for the recursion relations are: */ 2027 2027 /* */ 2028 2028 /* */ 2029 /* equation : (3.18)*/2029 /* equation (3.18): */ 2030 2030 /* */ 2031 2031 /* | pi |(1/2) 8n */ … … 2033 2033 /* | 2 | (2n-1)! */ 2034 2034 /* */ 2035 /* equation : (3.20)*/2035 /* equation (3.20): */ 2036 2036 /* */ 2037 2037 /* exp(2n-2/K tan^(-1)(n K) */ … … 2041 2041 /* */ 2042 2042 /* */ 2043 /* equation : (3.20)*/2043 /* equation (3.20): */ 2044 2044 /* G(n,n-2; K,n-1) = (2n-2)(1+(n K)^2) n G(n,n-1; K,n) */ 2045 2045 /* */ 2046 2046 /* */ 2047 /* equation : (3.21)*/2047 /* equation (3.21): */ 2048 2048 /* */ 2049 2049 /* (1+(n K)^2) */ … … 2057 2057 long int l, 2058 2058 long int lp, 2059 /* Temp erary storage for intermediate */2059 /* Temporary storage for intermediate */ 2060 2060 /* results of the recursive routine */ 2061 2061 double *rcsvV … … 2117 2117 long int l, 2118 2118 long int lp, 2119 /* Temp erary storage for intermediate */2119 /* Temporary storage for intermediate */ 2120 2120 /* results of the recursive routine */ 2121 2121 mxq *rcsvV_mxq … … 2386 2386 if( n >= 70 ) 2387 2387 { 2388 fprintf(ioQQQ,"Princip leQuantum Number `n' too large.\n");2388 fprintf(ioQQQ,"Principal Quantum Number `n' too large.\n"); 2389 2389 cdEXIT(EXIT_FAILURE); 2390 2390 } … … 2401 2401 if( n <= np ) 2402 2402 { 2403 fprintf(ioQQQ," The princip lequantum numbers are such that n <= n'.\n");2403 fprintf(ioQQQ," The principal quantum numbers are such that n <= n'.\n"); 2404 2404 cdEXIT(EXIT_FAILURE); 2405 2405 } … … 2442 2442 if( n <= np ) 2443 2443 { 2444 fprintf(ioQQQ," The princip lequantum numbers are such that n <= n'.\n");2444 fprintf(ioQQQ," The principal quantum numbers are such that n <= n'.\n"); 2445 2445 cdEXIT(EXIT_FAILURE); 2446 2446 } … … 2523 2523 if( n <= nprime ) 2524 2524 { 2525 fprintf(ioQQQ," The princip lequantum numbers are such that n <= n'.\n");2525 fprintf(ioQQQ," The principal quantum numbers are such that n <= n'.\n"); 2526 2526 cdEXIT(EXIT_FAILURE); 2527 2527 } … … 2532 2532 /************************************************************************/ 2533 2533 /* hri() */ 2534 /* Calculate the hydrogen radial wavefunction inte rgral*/2534 /* Calculate the hydrogen radial wavefunction integral */ 2535 2535 /* for the dipole transition l'=l-1 or l'=l+1 */ 2536 2536 /* for the higher energy state n,l to the lower energy state n',l' */ … … 2553 2553 2554 2554 /************************************************************************/ 2555 /* This routine, hri(), calculates the hydrogen radial inte rgral,*/2555 /* This routine, hri(), calculates the hydrogen radial integral, */ 2556 2556 /* for the transition n,l --> n',l' */ 2557 2557 /* It is, of course, dimensionless. */ … … 2630 2630 /************************************************************************/ 2631 2631 /* hri_log10() */ 2632 /* Calculate the hydrogen radial wavefunction inte rgral*/2632 /* Calculate the hydrogen radial wavefunction integral */ 2633 2633 /* for the dipole transition l'=l-1 or l'=l+1 */ 2634 2634 /* for the higher energy state n,l to the lower energy state n',l' */
