-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzetacalc2.py
49 lines (39 loc) · 1.41 KB
/
zetacalc2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# calczeta.py PYTHON program to calculate the cosmic ray ionisation rate
# Alice Eleanor Matthews
import numpy as np
import math
# constants all here for ease
pi = math.pi # 3.141... to high precision
br = 0.529*10**-10 # bohr radius in m
sigz = 6.51*10**-18 # sigma_zero const, page 28 Rudd, 1983
#print 'constants used in this program are as follows:'
#print 'pi', pi, 'bohr radius', br
# create an array of 90 energies from 1 - 9.0e+09
print('cosmic ray ionisation rate calculation')
count = 1
#en = []; # define en as a list
for i in range(1,10):
for j in range(1,11):
en = ([j*10**(i-1)])
print(count, '{:.3e}'.format(en)
count = count + 1
xfac = en[k-1]/(1836/13.6)
sigl = 4*pi*br**2*0.51*xfac**1.24
print(sigl)
nen = (count - 1)
print('Number of energies = ', nen)
#print(en)
# CROSS SECTIONS
# Proton contribution
# REF: Rudd et al 1985 Rev Mod Phys, 57, 965
# Equations 31, 32, 33 page 985
#for k in range(1, nen):
# xfac = en[k-1]/(1836/13.6)
# sigl = 4*pi*br**2*0.51*xfac**1.24
# print(sigl)
# Electron capture contribution
# Rudd et al 1983 Phys Rev A 28 3244 page 28
# Equation 19
# for i in range(1, nen):
# xfac[i] = en[i]/(1836*15.42)
# sigec = 1.044*sigz*2*15.42**(-2)*xfac[i]**2/(0.016+xfac[i]**2.88+0.136*xfac**5.86)