Commit e6f2a86c by Alessandro

### dec_const for vector decay constant added in juobs_obs

parent 17dc600e
 ... @@ -318,6 +318,52 @@ function dec_const(a0pL::Corr, a0pR::Corr, ppL::Corr, ppR::Corr, plat::Vector{In ... @@ -318,6 +318,52 @@ function dec_const(a0pL::Corr, a0pR::Corr, ppL::Corr, ppR::Corr, plat::Vector{In error("y0 or kappa values does not match") error("y0 or kappa values does not match") end end end end ## ADD DOCUMENTATION FOR VECTOR DECAY function dec_const(vv::Vector{uwreal}, plat::Vector{Int64}, m::uwreal, y0::Int64; pl::Bool=true, data::Bool=false, kappa::Union{Vector{Float64}, Nothing}=nothing, wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing) corr_vv = vv[2:end-1] T = length(corr_vv) aux = exp.((collect(1:T) .- y0 ) .* fill(m, T)) R = ((aux .* corr_vv).^2).^0.25 R_av = plat_av(R, plat, wpm) f = sqrt(2 / m) * R_av if pl isnothing(wpm) ? uwerr(R_av) : uwerr(R_av, wpm) isnothing(wpm) ? uwerr(f) : uwerr(f, wpm) x = 1:length(R) y = value.(R) dy = err.(R) v = value(R_av) e = err(R_av) figure() lbl = string(L"$af =$", sprint(show, f)) fill_between(plat[1]:plat[2], v-e, v+e, color="green", alpha=0.75, label=L"$R$") errorbar(x, y, dy, fmt="x", color="black", label=lbl) legend() ylabel(L"$R_\mathrm{av}$") xlabel(L"$x_0$") if !isnothing(kappa) title(string(L"$\kappa_1 =$", kappa[1], L" $\kappa_2 =$", kappa[2])) end display(gcf()) end if !data return f else return (f, R) end end function dec_const(vv::Corr, plat::Vector{Int64}, m::uwreal; pl::Bool=true, data::Bool=false, wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing) return dec_const(vv.obs, plat, m, vv.y0, kappa=vv.kappa, pl=pl, data=data, wpm=wpm) end @doc raw""" @doc raw""" dec_const_pcvc(corr::Vector{uwreal}, plat::Vector{Int64}, m::uwreal, mu::Vector{Float64}, y0::Int64 ; pl::Bool=true, data::Bool=false, wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing) dec_const_pcvc(corr::Vector{uwreal}, plat::Vector{Int64}, m::uwreal, mu::Vector{Float64}, y0::Int64 ; pl::Bool=true, data::Bool=false, wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing) ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!