Skip to content

Commit

Permalink
minor update in py functions
Browse files Browse the repository at this point in the history
  • Loading branch information
giozu committed Oct 9, 2024
1 parent 6746ddb commit 244ae37
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions regression/regression_hbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ def lassmann_fit(x, threshold=60):
ax1.plot(bu_gwd_tu, lassmann_fit(bu_gwd_tu), color='darkorchid', linestyle='--', label='Lassmann fit (bu$_0$ = 60 GWd/tU)')
ax1.scatter(data_bu, data_xe, color='navy', edgecolors='black', marker='.', label='Walker data (1999)')
ax1.plot(sd["bu"] / 0.8814, sd["xe_ig"] / eq, color='limegreen', linestyle='-.', label='Xe in grains - non HBS')
ax1.plot(sd["bu"] / 0.8814, sd["xe_igs"] / eq, linestyle='-.', label='Xe in dynamic solution')
ax1.plot(sd["bu"] / 0.8814, sd["xe_igb"] / eq, linestyle='-.', label='Xe in intra-granular bubbles')
ax1.plot(sd["bu"] / 0.8814, sd["xe_igs"] / eq, linestyle='-.', label='Xe in dynamic solution - non HBS')
ax1.plot(sd["bu"] / 0.8814, sd["xe_igb"] / eq, linestyle='-.', label='Xe in intra-granular bubbles - non HBS')
ax1.plot(sd["bu"] / 0.8814, sd["xe_igHBS"] / eq, color='orangered', linestyle=':', label='Xe in grains - HBS')
ax1.plot(sd["bu"] / 0.8814, (sd["xe_igHBS"] + sd["xe_ig"]) / eq, color='dimgray', linestyle='-', label='Xe in grains - sum')
ax1.legend(loc='upper right', fontsize='medium')
Expand Down
10 changes: 9 additions & 1 deletion utilities/error_bound.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,24 @@ def select_coefficients(N_delta_tau, N_M, condition='constant', µ=None):
N_delta_tau = 1000
N_M = 40

decay_rate = 9.98e-7 # I131
decay_rate = 4.3e-5 # Kr85m
decay_rate = 1.53e-6 # Xe133

a = 5e-6 # radius
D = 1e-20 # diffusivity

k = 40
diffusion_rate = np.pi**2 * D * a**(-2) * k**2

print(f"diffusion_rate = {diffusion_rate} 1/s")

mu = decay_rate * a**2 / D

print(f"mu = {mu}")

# Option 1: Using constant conditions
µ_constant = 10**5
µ_constant = 10**4
result_constant = select_coefficients(N_delta_tau, N_M, condition='constant', µ=µ_constant)
print(f"Fit result (epsilon_hat) for constant conditions (µ = {µ_constant}): {result_constant}")

Expand Down

0 comments on commit 244ae37

Please sign in to comment.