test(){
TV = (4/3 * 3.14 * Rtumor^3) / 1000
TD = (2 * P * Rcap/Rkrogh^2 + 6*D/Rtumor^2) * (C1 - C3/eps)
Tot41BBp = (Tcellsp *BB/NA) * 10^9
TotPDL1t = (Tumorcellst * mPDL1/NA) * 10^9
Tot41BBt = (Tcellst * BB/NA) * 10^9
ksyn = kdeg * sPDL1_0
dosepoint(A1, idosevar = A1Dose, infdosevar = A1InfDose, infratevar = A1InfRate)
deriv(A1 = (-CL*C1 -CLd* C1 + CLd * C2 - (kon_41BB * C1 * (Tot41BBp - D41BBp) + koff_41BB * D41BBp - kon_PDL1 *C1 * sPDL1 + koff_PDL1 * DPDL1p -TD* TV/V1)*V1))
deriv(A2= (CLd * C1 - CLd * C2))
deriv(A3= (TD-(kon_PDL1* C3 * (TotPDL1t - DPDL1t-Trimer)/eps) + (koff_PDL1 * DPDL1t) - (kon_41BB * C3 * (Tot41BBt-D41BBt-Trimer)/eps) + (koff_41BB * D41BBt)))
deriv(A4 = (ksyn-kdeg*sPDL1-kon_PDL1 * C1 * sPDL1 + koff_PDL1*DPDL1p))
deriv(A5 = (kon_PDL1 * C1 * sPDL1 - koff_PDL1 * DPDL1p- kdegcx * DPDL1p))
deriv(A6 = (kon_41BB * C1 * (Tot41BBp - D41BBp) - koff_41BB * D41BBp))
deriv(A7 = (kon_41BB * C3 * (Tot41BBt - D41BBt - Trimer)/eps - koff_41BB * D41BBt - kon_PDL1 * D41BBt * (TotPDL1t-DPDL1t- Trimer)/eps + koff_PDL1 * Trimer))
deriv(A8 = ((kon_PDL1 * C3 * (TotPDL1t - DPDL1t - Trimer)/eps - koff_PDL1 * DPDL1t - kon_41BB * DPDL1t * (Tot41BBt - D41BBt - Trimer)/eps + koff_41BB * Trimer - kint * DPDL1t)))
deriv(A9 = ((kon_41BB * DPDL1t * (Tot41BBt - D41BBt - Trimer)/eps - (koff_41BB + koff_PDL1) * Trimer + kon_PDL1 * D41BBt * (TotPDL1t - DPDL1t - Trimer)/eps)))
#M1
deriv(A10 = kg0 * (1 - w/Mmax) * M1 / ((1 + (kg0/kg * w)^psi)^(1/psi)) - kkill * mPDL1)
deriv(A11 = kkill * M1 - M2/tao)
deriv(A12 = (M2 - M3) / tao)
deriv(A13 = (M3 - M4) / tao)
kkill = kmax * Trimer / (kc50 + Trimer)
w = M1 + M2 + M3 + M4
TSC = kg0 * kc50 / (kmax - kg0)
#Plasma_conc = C1*MW/1000 ; convert from nM to ng/mL
#Tumor_conc = C3*MW/1000 ; convert from nM to ng/mL
#Trimer_conc = trimer/50
C1 = A1/V1
C2 = A2/V2
C3 = A3
sPDL1= A4
DPDL1p= A5
D41BBp= A6
D41BBt= A7
DPDL1t= A8
Trimer= A9
M1=A10
M2=A11
M3=A12
M4=A13
#CL = kel*V1
#kel=CL/V1
#CLd= k12 *V1
#k21 = CLd/V2
#k12 = CLd/V1
sequence{C1 = A1Dose/V1;C2 = 0;C3 = 0;D41BBp = 0;D41BBt = 0;DPDL1t = 0;Trimer = 0;sPDL1 = sPDL1_0;DPDL1p =0;M1 = TV*1000000; M2 = 0;M3 = 0;M4 = 0;}
error(CEps = 0.1)
observe(CObs = C1 + C1*CEps)
fixef(V1 = c(, 40.2, ))
fixef(V2 = c(,211, ) )
fixef(CL= c(, 4.61, ))
fixef(CLd= c(, 25.2, ))
fixef(kon_41BB = c(, 1.72, ))
fixef(koff_41BB = c(, 193.66, ))
fixef(kon_PDL1 = c(, 1.57, ))
fixef(koff_PDL1 = c(, 0.74, ))
fixef(kdeg = c(, 0.15, ))
fixef(kdegcx = c(, 0.115, ))
fixef( kint =c(0,0.1728,))
fixef(Rtumor(freeze) = c(,1,))
fixef(Rkrogh(freeze) = c(,75,))
fixef(P(freeze) = c(,13.9,))
fixef(D(freeze) = c(,0.000916,))
fixef(eps(freeze) = c(,0.24,))
fixef(Rcap(freeze) = c(,8,))
fixef(mPDL1(freeze) = c(,28706,))
fixef(NA(freeze) = c(,6.02*10^23,))
fixef(ETRatio(freeze) = c(,5000000000,))
fixef(Tumorcellst(freeze) = c(,100000000000,))
fixef(Tcellsp(freeze) = c(,1,))
fixef(Tcellst(freeze) = c(,6.02*10^23,))
fixef(BB(freeze) = c(,64900000000,))
fixef(sPDL1_0(freeze) = c(,1.1,))
fixef(kg0(freeze) = c(,0.0125,))
fixef(kg(freeze) = c(,4.37,))
fixef(Mmax(freeze) = c(,3800,))
fixef(psi(freeze) = c(,20,))
fixef(kmax(freeze) = c(,0.03,))
fixef(kc50(freeze) = c(,0.0004,))
fixef(tao(freeze) = c(,0.199,))
}