Fit Function: JAN3

Fit Function \[\sigma(pet) = \frac{\text{pcf}(2) \cdot \log(\text{pcf}(3) \cdot pet + \text{pcf}(4))}{pet}\]
Comments Python code requires NumPy imported as `np`.

Fortran

Arguments
namedescriptionunitstype(s)
pet energy eV real, dimension(:)
pcf coefficient data array real, dimension(4)
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###################################################################
c
      subroutine aljan3(pet, pcf, kncf, pfit, kermsg)
c
c     this is a general function for a cross section which
c     has a functional form
c
c         pfit = pcf(2) * log (pcf(3)*pet + pcf(4))/ pet
c
c     where pcf(1) = the threshold energy for the particular reaction
c
c     kermsg = blank if no errors
c
c     written by j. j. smith , iaea atomic and molecular data unit
c
c------------------------------------------------------------------------
c
      double precision pet, pcf, pfit
      dimension pcf(4)
      character*(*) kermsg

      if(pet .ge. pcf(1) ) then
        kermsg = ' '
      else
        kermsg = 'energy below threshold for the reaction'
        return
      endif
c
      pfit = pcf(2) * log (pcf(3)*pet + pcf(4))/ pet
      return
c
      end

Python

Arguments
namedescriptionunitstype(s)
pet 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 jan3(pet, pcf):
    """
    pet = collision energy in eV
    pcf: parameter data array
        pcf[0]: threshold energy
        pcf[1:4]: parameters for analytic function
    """
    if pet >= pcf[0]:
        pfit = pcf[1] * np.log(pcf[2]*pet + pcf[3]) / pet
    else:
        raise ValueError('Energy below threshold for the reaction')

    return pfit