NuclearRMF/test/Pb208_nucleon_wf.jl

37 lines
684 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]
κ = -1
p = true
r_max = maximum(xs)
divs = length(xs) - 1
s = system(r_max, divs)
s.Φ0 = Ss
s.W0 = Vs
s.B0 = Rs
s.A0 = As
E_min = 800
E_max = 939
groundE = findEs(κ, p, s, E_min, E_max) |> minimum
println("ground state E = $groundE")
wf = solveNucleonWf(κ, p, groundE, s)
gs = wf[1, :]
fs = wf[2, :]
plot(rs(s), gs, label="g(r)")
plot!(rs(s), fs, label="f(r)")
xlabel!("r (fm)")