Fit Function: JBORN1

Fit Function \[\sigma(pe) = \text{pcf}(3) \left( \frac{\text{pcf}(1)}{pe} \right)^{\text{pcf}(4)} \cdot \log \left( \frac{pe}{\text{pcf}(1)} \right)\]
Comments Python code requires NumPy imported as `np`.

Fortran

Arguments
namedescriptionunitstype(s)
pe requested energy eV real, dimension(:)
pcf coefficient data array real, dimension(11)
kncf number of coefficients in the data array integer
pfit cross section cm2 real, dimension(:)
kermsg error message character
Return values
namedescriptionunitstype(s)
pfit cross section cm2 real, dimension(:)
Code
c###################################################################
c
      subroutine jborn1(pe, pcf, kncf, pfit, kermsg)
c
c     this is a subroutine to calculate cross sections (cm[2])
c     versus energy (ev) using a formula based on a semiempirical
c     modification of the bethe-born formula.
c
c     pcf is the coefficient data array, where
c
c     pcf(1) =   the threshold energy for the reaction (ev)
c
c     pcf(2) =    the minimum energy for the application of the
c                 semiempirical formulae.
c
c     pcf(3)  =   coefficient a
c
c     pcf(4)  =   coefficient n
c
c     pe = collision energy in ev
c
c     kermsg = blank if no errors
c
c     pfit = cross section in cm[2]
c
c     written by j. j. smith , iaea atomic and molecular data unit
c
c------------------------------------------------------------------------
c
      double precision pe, pcf, pfit
      dimension pcf(11)
      character*(*) kermsg

      eth=pcf(1)
      emin = pcf(2)
      a=pcf(3)
      n=pcf(4)
      an=n
      if(pe .ge. eth) then
        kermsg = ' '
      else
        kermsg = 'energy is below threshold for reaction in jborn1'
        return
      endif
c
      pfit = a*((eth/pe)**an) *dlog(pe/eth)
  100 return
c
      end

Python

Arguments
namedescriptionunitstype(s)
pe requested energy eV float, np.ndarray
pcf coefficient data array float, np.ndarray
Return values
namedescriptionunitstype(s)
pfit cross section cm2 float, np.ndarray
Code
def jborn1(pe, pcf):
    """
    This function calculates cross-sections in cm[2] using a formula
    based on a semiempirical modification of the Bethe-Born formula.

    pe: collision energy (ev)
    pcf: coefficient data array
        pcf[0]: threshold energy for the reaction (ev)
        pcf[1]: minimum energy for the application of the semiempirical formula
        pcf[2], pcf[3]: fitting coefficints
    """
    eth = pcf[0]
    emin = pcf[1]

    if pe < eth:
        raise ValueError("Energy is below threshold for reaction in jborn1")
   
    if pe < emin:
        raise ValueError("Energy is below minimum energy for the application of the semiempirical formula")

    pfit = pcf[2] * ((eth/pe)**pcf[3]) * np.log(pe/eth)

    return pfit