Hello, can anyone help me with code this is a multi compartment model and the clearance is concentration dependant and also they have given a proportionality constant (a) for the changes in plasma concentration, which i have given in dynamics but still not getting the results.
PK24= @model begin
@param begin
tvvc ∈ RealDomain(lower=0)
tvclo ∈ RealDomain(lower=0)
tvcl ∈ RealDomain(lower=0)
tvq1 ∈ RealDomain(lower=0)
tvq2 ∈ RealDomain(lower=0)
tvvp1 ∈ RealDomain(lower=0)
tvvp2 ∈ RealDomain(lower=0)
tva ∈ RealDomain(lower=0)
Ω ∈ PDiagDomain(8)
σ_prop ∈ RealDomain(lower=0)
end
@random begin
η ~ MvNormal(Ω)
end
@pre begin
Vc = tvvc*exp(η[1])
CL = tvcl*exp(η[2])
CLo = tvclo*exp(η[3])
Q1 = tvq1*exp(η[4])
Q2 = tvq2*exp(η[5])
Vp1 = tvvp1*exp(η[6])
Vp2 = tvvp2*exp(η[7])
A = tva*exp(η[8])
end
@dynamics begin
Central' = - (CLo -(A*(Central/Vc))) * (Central/Vc) - Q1*(Central/Vc) + Q1*(Shallow/Vp1) - Q2*(Central/Vc) + Q2*(Deep/Vp2)
Shallow' = Q1*(Central/Vc) - Q1*(Shallow/Vp1)
Deep' = Q2*(Central/Vc) - Q2*(Deep/Vp2)
end
@derived begin
cp = @. 1000*Central/Vc
dv ~ @. Normal(cp, sqrt(cp^2*σ_prop))
end
end