放射性核素衰变-radioactivedecay

radioactivedecay 用于放射性核素衰变的简单分析计算的开源包,支持放射性核素、亚稳态和分支衰变的衰变链。

https://github.com/radioactivedecay/radioactivedecay

安装:pip install radioactivedecay

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
#%%
import radioactivedecay as rd
import matplotlib.pyplot as plt

# 创建一个放射性核素: Nuclide
ncld = rd.Nuclide('U-235')
half = ncld.half_life('readable') # 半衰期
prog = ncld.progeny() # 衰变产物
frac = ncld.branching_fractions() # 占比
mode = ncld.decay_modes() # 衰变射线类型

print(ncld, mode, prog, frac, half, sep='\n')

# 绘制衰变链
ncld.plot()

#%%
# 列出多个核算衰变类型
NUCs = ['U-235',
'Pu-239']

for name in NUCs:
ncld = rd.Nuclide(name)
half = ncld.half_life('readable')
prog = ncld.progeny()
frac = ncld.branching_fractions()
mode = ncld.decay_modes()
print(ncld, mode, prog, frac, half, sep='\n')

fig, ax = ncld.plot()
fig.savefig(f'decay_chains_{name}.png', dpi=300)