30 lines
1015 B
Julia
30 lines
1015 B
Julia
using DelimitedFiles, Interpolations, Plots
|
||
include("../mesons.jl")
|
||
|
||
# test data generated from Hartree.f
|
||
# format: x S(x) V(x) R(x) A(x)
|
||
bench_data = readdlm("test/Pb208FldsFSUGarnet.csv")
|
||
xs_bench = bench_data[:, 1]
|
||
Φ0_bench = bench_data[:, 2]
|
||
W0_bench = bench_data[:, 3]
|
||
B0_bench = bench_data[:, 4]
|
||
A0_bench = bench_data[:, 5]
|
||
|
||
plot(xs_bench, hcat(Φ0_bench, W0_bench, B0_bench, A0_bench), layout=4, label=["Φ0 benchmark" "W0 benchmark" "B0 benchmark" "A0 benchmark"])
|
||
|
||
# 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]
|
||
ρ_sn = test_data[:, 2]
|
||
ρ_vn = test_data[:, 3]
|
||
ρ_sp = test_data[:, 5]
|
||
ρ_vp = test_data[:, 6]
|
||
|
||
r_max = maximum(xs)
|
||
divs = length(xs) - 1
|
||
|
||
(Φ0, W0, B0, A0) = solveMesonWfs(ρ_sp, ρ_vp, ρ_sn, ρ_vn, r_max, divs, 200) # many iterations needed without an initial solution
|
||
|
||
plot!(xs, hcat(Φ0, W0, B0, A0), layout=4, label=["Φ0" "W0" "B0" "A0"])
|
||
xlabel!("r (fm)") |