Example #1
0
def test_branching_ratio():
	branches = am241.capture()
	daughter0, ratio0 = branches[0]
	test_result0 = '{}(n, y){}{}'.format(am241.name, ratio0, daughter0)
	true_result0 = "Am241(n, y)0.89Am242"
	_assert("Am241 branch (main)", test_result0, true_result0)
	branchm = branches[-1]
	daughterm, ratiom = branchm
	test_resultm = '{}(n, y){}{}'.format(am241.name, ratiom, daughterm)
	true_resultm = "Am241(n, y)0.11Am242m"
	_assert("Am241 branch (metastable)", test_resultm, true_resultm)
def test_matrix_half_life():
    dt = depletr.nuclides.half_lives.ALPHA[pu242.name]
    ds = depletr.DataSet()
    ds.add_nuclide(u238, 0)
    ds.add_nuclide(pu242, 1)
    ds.build()
    q0 = ds.get_initial_quantities()
    q1 = q0.dot(expm(-ds.l * dt))
    test_result = (q1[0], q1[1])
    true_result = (0.5, 0.5)
    _assert("Pu242 matrix half-life", test_result, true_result)
Example #3
0
def test_neutron_capture():
	branches = pu238.capture()
	daughter, ratio = branches[0]
	test_result = '{}(n, y){}'.format(pu238.name, daughter)
	true_result = "Pu238(n, y)Pu239"
	_assert("Neutron capture", test_result, true_result)
Example #4
0
def test_gamma_decay():
	test_result = '{}(*, y){}'.format(am242m.name, am242m.decay_gamma())
	true_result = "Am242m(*, y)Am242"
	_assert("Internal conversion", test_result, true_result)
Example #5
0
def test_betam_decay():
	test_result = '{}(n, e-){}'.format(np238.name, np238.decay_betam())
	true_result = "Np238(n, e-)Pu238"
	_assert("Beta- decay", test_result, true_result)
Example #6
0
def test_betap_decay():
	test_result = '{}(n, e+){}'.format(am242.name, am242.decay_betap())
	true_result = "Am242(n, e+)Pu242"
	_assert("Beta+ decay", test_result, true_result)
Example #7
0
def test_alpha_decay():
	test_result = '{}(n, a){}'.format(pu242.name, pu242.decay_alpha())
	true_result = "Pu242(n, a)U238"
	_assert("Alpha decay", test_result, true_result)
def test_u239_capture():
    a = _get_m_matrix()
    test_result = a[0, 1]
    true_result = -u238.sigma_y
    _assert("Uranium 238 -> Uranium 239", test_result, true_result)
def test_am242m_lambda_gamma():
    l = _get_l_matrix()
    test_result = l[0, 1]
    true_result = -am242m.lambda_gamma
    _assert("Americium 242 metastable lambda gamma", test_result, true_result)
def test_am242m_lambda_total():
    l = _get_l_matrix()
    test_result = l[0, 0]
    true_result = am242m.lambda_total
    _assert("Americium 242 metastable lambda total", test_result, true_result)
def test_l_matrix_dimensions():
    l = _get_l_matrix()
    test_result = l.shape
    true_result = (4, 4)
    _assert("L matrix shape", test_result, true_result)
def test_lumped_fission_product():
    a = _get_m_matrix()
    test_result = a[0, -1]
    true_result = -u238.sigma_f
    _assert("Uranium 238 fission", test_result, true_result)
def test_lumped_actinide():
    a = _get_m_matrix()
    test_result = a[-1, -2]
    true_result = -u239.sigma_y
    _assert("Uranium 239 capture", test_result, true_result)
def test_u238_absorption():
    a = _get_m_matrix()
    test_result = a[0, 0]
    true_result = u238.sigma_f + u238.sigma_y
    _assert("Uranium 238 absorption", test_result, true_result)
Example #15
0
def test_half_life():
    dt = depletr.nuclides.half_lives.BETAM[u239.name]
    test_result = np.exp(-u239.lambda_total * dt)
    true_result = 0.5
    _assert("U239 half-life", test_result, true_result)
def test_lumped_actinide():
    l = _get_l_matrix()
    test_result = l[1, -2]
    true_result = -(am242.lambda_betap + am242.lambda_betam)
    _assert("Americium 242 lumped actinide product", test_result, true_result)
def test_a_matrix_dimensions():
    a = _get_m_matrix()
    test_result = a.shape
    true_result = (4, 4)
    _assert("A matrix shape", test_result, true_result)