NuclearRMF/test/Pb208_wfs.jl

27 lines
679 B
Julia
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using DelimitedFiles, Interpolations, Plots
include("../mesons.jl")
# test data generated from Hartree.f
# format: x Rhos(n) Rhov(n) Rhot(n) Rhos(p) Rhov(p) Rhot(p)
test_data = readdlm("test/Pb208DensFSUGarnet.csv")
xs = test_data[:, 1]
rho_sn = test_data[:, 2]
rho_vn = test_data[:, 3]
rho_sp = test_data[:, 5]
rho_vp = test_data[:, 6]
ρ_sn = linear_interpolation(xs, rho_sn)
ρ_vn = linear_interpolation(xs, rho_vn)
ρ_sp = linear_interpolation(xs, rho_sp)
ρ_vp = linear_interpolation(xs, rho_vp)
r_max = maximum(xs)
divs = 400
wfs = solveWfs(ρ_sp, ρ_vp, ρ_sn, ρ_vn, r_max, divs)
rs = range(0, r_max, length=divs+1)
plot(rs, transpose(wfs))
xlabel!("r (fm)")