add negative water check

This commit is contained in:
Gaspard Jankowiak 2024-05-15 15:27:01 +02:00
parent 35090dedcd
commit 32e6a23e65

15
PLUV.jl
View file

@ -285,7 +285,10 @@ function intensity(P::AbstractArray{Float64}, q)
I = vec(sum(Am .^ 2 .* Normal'; dims=2)) * integration_step
alp = Rm / (Z + 1)
return @. (Norm * nv * 1e-6) * I * (16 * pi^2 * mu4(q, Z, alp)) + Con * (0.99 * (1.0 / (1 + exp(-8 * (q - 1.0)))) + 0.01)
neg_H20 = negative_water(P)
return @. ((Norm * nv * 1e-6) * I * (16 * pi^2 * mu4(q, Z, alp)) + Con * (0.99 * (1.0 / (1 + exp(-8 * (q - 1.0)))) + 0.01), neg_H20)
end
##################
@ -310,7 +313,6 @@ function negative_water(P::AbstractArray{Float64})
V_PCN = CONST_V_HL_PC * r_PCN # Volume of PCN group
V_Chol = CONST_V_HL_PC * (1 - r_PCN - r_CG) # Volume of CholCH3 group
check = 0
z_array = range(0.0, 4.0, length=81)
CG = Gauss.(z_array, V_CG, D_C + d_CG / 2.0, s_CG, A_L)
@ -319,13 +321,8 @@ function negative_water(P::AbstractArray{Float64})
TRIS = Gauss.(z_array, n_TR * CONST_V_tris, D_C + d_TR / 2.0, s_TR, A_L)
BW = Slab.(z_array, D_C + (d_CG + d_PCN + d_Chol + CONST_d_shl) / 2.0, d_CG + d_PCN + d_Chol + CONST_d_shl, s_CH2) - CG - PCN - Chol - TRIS
for i in (BW)
if i < -1e-3
check += 1
end
end
return check
# return the number of points where BW < -1e-3
return count(<(-1e-3), BW)
end
function get_free_parameters_idx(metadata::Dict)