NuclearRMF/test/Pb208_nucleon_basic.jl

39 lines
993 B
Julia

using DelimitedFiles, Interpolations, Plots
include("../system.jl")
# test data generated from Hartree.f
# format: x S(x) V(x) R(x) A(x)
test_data = readdlm("test/Pb208FldsFSUGarnet.csv")
xs = test_data[:, 1]
Ss = test_data[:, 2]
Vs = test_data[:, 3]
Rs = test_data[:, 4]
As = test_data[:, 5]
S_interp = linear_interpolation(xs, Ss)
V_interp = linear_interpolation(xs, Vs)
R_interp = linear_interpolation(xs, Rs)
A_interp = linear_interpolation(xs, As)
κ = -1
p = false
r_max = maximum(xs)
divs = length(xs) - 1
s = system(0, 0, r_max, divs)
E_min = 850
E_max = 939
boundEs = findEs(κ, p, S_interp, V_interp, R_interp, A_interp, s, E_min, E_max)
binding_Es = (p ? M_p : M_n) .- boundEs
println("binding energies = $binding_Es")
func = boundaryValueFunc(κ, p, S_interp, V_interp, R_interp, A_interp, s)
Es = collect(E_min:0.5:E_max)
boundaryVals = [func(E)^2 for E in Es]
plot(Es, boundaryVals, yscale=:log10, label="g(r_max)^2")
vline!(boundEs, label="bound E")
xlabel!("E (MeV)")