Show
Ignore:
Timestamp:
04/12/08 09:30:35 (9 months ago)
Author:
rjrw
Message:

Merged from trunk r1917:1941

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/newmole/source/hydro_bauman.cpp

    r1846 r1942  
    99/* In this version, quantities that would normally cause a 64-bit floating point processor      */ 
    1010/* to either underflow or overflow are evaluated using logs instead of floating point math.     */ 
    11 /* This allows us to use an upper principle quantum number `n' greater than  which the          */ 
     11/* This allows us to use an upper principal quantum number `n' greater than  which the          */ 
    1212/* other version begins to fail. The trade-off is, of course, lower accuracy                    */ 
    1313/* ( or is it precision ). We use LOG_10 for convenience.                                       */ 
     
    4343/*    The recombination coefficient is obtained from the                                        */ 
    4444/*    photoionization cross-section (see Burgess 1965).                                         */ 
    45 /*    We have,                                                                                  */ 
     45/*    We have:                                                                                  */ 
    4646/*                                                                                              */ 
    4747/*                  -                           -               l'=l+1                          */ 
     
    124124/*                                               r^2                                            */ 
    125125/*                                                                                              */ 
    126 /*      Similiarly, the recombination co-efficient satisfies                                    */ 
     126/*      Similiarly, the recombination coefficient satisfies                                    */ 
    127127/************************************************************************************************/ 
    128128 
     
    144144/** \verbatim 
    145145************************* for LOG version of the file  *************************************** 
    146  In this version, quantites that would normal cause a 64-bit floating point processor         
     146 In this version, quantities that would normal cause a 64-bit floating point processor         
    147147 to underflowed or overflow on intermediate values (ones internal to the calculation)          
    148  are evaluated using logs. This allows us to use an upper principle quantum number `n'         
     148 are evaluated using logs. This allows us to use an upper principal quantum number `n'         
    149149 greater than 50 which is where the other version begins to fail. The trade-off is,            
    150150 of course, lower accuracy( or is it precision ) and perhaps speed.                            
     
    352352 
    353353/** \verbatim 
    354      This routine, hri(), calculates the hydrogen radial intergral,   
     354     This routine, hri(), calculates the hydrogen radial integral,   
    355355      for the transition n,l --> n',l'                                 
    356356      It is, of course, dimensionless.                                 
     
    373373 
    374374/**\verbatim 
    375   This routine, hri_log10(), calculates the hydrogen radial intergral,   
     375  This routine, hri_log10(), calculates the hydrogen radial integral,   
    376376  for the transition n,l --> n',l'                                       
    377377  It is, of course, dimensionless.                                       
     
    539539 
    540540/************************************************************************/ 
    541 /* (4.0/3.0) * PI * FINE_STRUCTURE_CONSTANT * BORHRADIUS * BORHRADIUS   */ 
     541/* (4.0/3.0) * PI * FINE_STRUCTURE_CONSTANT * BOHRRADIUS * BOHRRADIUS   */ 
    542542/*                                                                      */ 
    543543/*                                                                      */ 
     
    742742        /* K = k / Z ::: k^2 = ejected-electron-energy (Ryd)    */ 
    743743        double K, 
    744         /* principle quantum number                             */ 
     744        /* principal quantum number                             */ 
    745745        long int n, 
    746746        /* angular  momentum quantum number                     */ 
    747747        long int l, 
    748         /* Temperary storage for intermediate                   */ 
     748        /* Temporary storage for intermediate                   */ 
    749749        /*  results of the recursive routine                    */ 
    750750        double *rcsvV 
     
    754754 
    755755        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 */ 
    757757 
    758758        ASSERT( n > 0 ); 
     
    779779        /* K = k / Z ::: k^2 = ejected-electron-energy (Ryd)    */ 
    780780        double K, 
    781         /* principle quantum number                             */ 
     781        /* principal quantum number                             */ 
    782782        long int n, 
    783783        /* angular  momentum quantum number                     */ 
    784784        long int l, 
    785         /* Temperary storage for intermediate                   */ 
     785        /* Temporary storage for intermediate                   */ 
    786786        mxq *rcsvV_mxq 
    787787        /*   results of the recursive routine                   */ 
     
    791791 
    792792        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 */ 
    794794 
    795795        ASSERT( n > 0 ); 
     
    835835        long int l, 
    836836        long int lp, 
    837         /* Temperary storage for intermediate         */ 
     837        /* Temporary storage for intermediate         */ 
    838838        /*  results of the recursive routine          */ 
    839839        double *rcsvV 
     
    913913        long int l, 
    914914        long int lp, 
    915         /* Temperary storage for intermediate         */ 
     915        /* Temporary storage for intermediate         */ 
    916916        /* results of the recursive routine           */ 
    917917        mxq *rcsvV_mxq 
     
    10101010        long int l, 
    10111011        long int lp, 
    1012         /* Temperary storage for intermediate         */ 
     1012        /* Temporary storage for intermediate         */ 
    10131013        /* results of the recursive routine           */ 
    10141014        double *rcsvV 
     
    11041104        long int l, 
    11051105        long int lp, 
    1106         /* Temperary storage for intermediate        */ 
     1106        /* Temporary storage for intermediate        */ 
    11071107        /* results of the recursive routine          */ 
    11081108        mxq *rcsvV_mxq 
     
    11211121        double Ksqrd = K * K; 
    11221122 
    1123         mx GK_mx = {0.0,0}, null_mx = {0.0,0}; 
     1123        mx GK_mx = {0.0,0}; 
    11241124 
    11251125        /* l=l'-1 or l=l'+1 */ 
     
    13061306/*                                                                                              */ 
    13071307/*    from the reference                                                                        */ 
    1308 /*    M. BrocKlehurst                                                                           */ 
     1308/*    M. Brocklehurst                                                                           */ 
    13091309/*    Mon. Note. R. astr. Soc. (1971) 153, 471-490                                              */ 
    13101310/*                                                                                              */ 
     
    13221322        long int l, 
    13231323        long int lp, 
    1324         /* Temperary storage for intermediate        */ 
     1324        /* Temporary storage for intermediate        */ 
    13251325        /*  results of the recursive routine         */ 
    13261326        double *rcsvV, 
     
    14731473        long int l, 
    14741474        long int lp, 
    1475         /* Temperary storage for intermediate       */ 
     1475        /* Temporary storage for intermediate       */ 
    14761476        /* results of the recursive routine         */ 
    14771477        mxq *rcsvV_mxq, 
     
    16821682/*                                                                                              */ 
    16831683/*    from the reference                                                                        */ 
    1684 /*    M. BrocKlehurst                                                                           */ 
     1684/*    M. Brocklehurst                                                                           */ 
    16851685/*    Mon. Note. R. astr. Soc. (1971) 153, 471-490                                              */ 
    16861686/*                                                                                              */ 
     
    19961996/*                                                                                      */ 
    19971997/*      From reference;                                                                 */ 
    1998 /*      M. BrocKlehurst                                                                 */ 
     1998/*      M. Brocklehurst                                                                 */ 
    19991999/*      Mon. Note. R. astr. Soc. (1971) 153, 471-490                                    */ 
    20002000/*                                                                                      */ 
     
    20242024/*                                                                                      */ 
    20252025/*                                                                                      */ 
    2026 /*    the starting point for the recursion relations are;                               */ 
     2026/*    the starting point for the recursion relations are:                               */ 
    20272027/*                                                                                      */ 
    20282028/*                                                                                      */ 
    2029 /*    equation: (3.18)                                                                  */ 
     2029/*    equation (3.18):                                                                  */ 
    20302030/*                                                                                      */ 
    20312031/*                     | pi |(1/2)   8n                                                 */ 
     
    20332033/*                     | 2  |      (2n-1)!                                              */ 
    20342034/*                                                                                      */ 
    2035 /*     equation: (3.20)                                                                 */ 
     2035/*     equation (3.20):                                                                 */ 
    20362036/*                                                                                      */ 
    20372037/*                          exp(2n-2/K tan^(-1)(n K)                                    */ 
     
    20412041/*                                                                                      */ 
    20422042/*                                                                                      */ 
    2043 /*     equation: (3.20)                                                                 */ 
     2043/*     equation (3.20):                                                                 */ 
    20442044/*     G(n,n-2; K,n-1) = (2n-2)(1+(n K)^2) n G(n,n-1; K,n)                              */ 
    20452045/*                                                                                      */ 
    20462046/*                                                                                      */ 
    2047 /*     equation: (3.21)                                                                 */ 
     2047/*     equation (3.21):                                                                 */ 
    20482048/*                                                                                      */ 
    20492049/*                       (1+(n K)^2)                                                    */ 
     
    20572057        long int l, 
    20582058        long int lp, 
    2059         /* Temperary storage for intermediate      */ 
     2059        /* Temporary storage for intermediate      */ 
    20602060        /*   results of the recursive routine      */ 
    20612061        double *rcsvV 
     
    21172117        long int l, 
    21182118        long int lp, 
    2119         /* Temperary storage for intermediate      */ 
     2119        /* Temporary storage for intermediate      */ 
    21202120        /*   results of the recursive routine      */ 
    21212121        mxq *rcsvV_mxq 
     
    23862386        if( n >= 70 ) 
    23872387        { 
    2388                 fprintf(ioQQQ,"Principle Quantum Number `n' too large.\n"); 
     2388                fprintf(ioQQQ,"Principal Quantum Number `n' too large.\n"); 
    23892389                cdEXIT(EXIT_FAILURE); 
    23902390        } 
     
    24012401        if( n <= np  ) 
    24022402        { 
    2403                 fprintf(ioQQQ," The principle quantum numbers are such that n <= n'.\n"); 
     2403                fprintf(ioQQQ," The principal quantum numbers are such that n <= n'.\n"); 
    24042404                cdEXIT(EXIT_FAILURE); 
    24052405        } 
     
    24422442        if( n <= np  ) 
    24432443        { 
    2444                 fprintf(ioQQQ," The principle quantum numbers are such that n <= n'.\n"); 
     2444                fprintf(ioQQQ," The principal quantum numbers are such that n <= n'.\n"); 
    24452445                cdEXIT(EXIT_FAILURE); 
    24462446        } 
     
    25232523        if( n <= nprime  ) 
    25242524        { 
    2525                 fprintf(ioQQQ," The principle quantum numbers are such that n <= n'.\n"); 
     2525                fprintf(ioQQQ," The principal quantum numbers are such that n <= n'.\n"); 
    25262526                cdEXIT(EXIT_FAILURE); 
    25272527        } 
     
    25322532/************************************************************************/ 
    25332533/*   hri()                                                              */ 
    2534 /*   Calculate the hydrogen radial wavefunction intergral               */ 
     2534/*   Calculate the hydrogen radial wavefunction integral                */ 
    25352535/*   for the dipole transition  l'=l-1  or  l'=l+1                      */ 
    25362536/*   for the higher energy state n,l  to the lower energy state n',l'   */ 
     
    25532553 
    25542554/************************************************************************/ 
    2555 /*      This routine, hri(), calculates the hydrogen radial intergral,  */ 
     2555/*      This routine, hri(), calculates the hydrogen radial integral,   */ 
    25562556/*      for the transition n,l --> n',l'                                */ 
    25572557/*      It is, of course, dimensionless.                                */ 
     
    26302630/************************************************************************/ 
    26312631/*   hri_log10()                                                        */ 
    2632 /*   Calculate the hydrogen radial wavefunction intergral               */ 
     2632/*   Calculate the hydrogen radial wavefunction integral                */ 
    26332633/*   for the dipole transition  l'=l-1  or  l'=l+1                      */ 
    26342634/*   for the higher energy state n,l  to the lower energy state n',l'   */