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`. |
| Arguments |
|
||||||||||||||||||||||||
| Return values |
|
||||||||||||||||||||||||
| 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 |
| Arguments |
|
||||||||||||
| Return values |
|
||||||||||||
| 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 |