Model 1 remark - define model-specific commands COMMANDS NFUNCTIONS 3 NDERIVATIVES 5 NPARAMETERS 12 PNAMES 'Vc', 'kelA', 'kptA', 'ktpA', 'kint', 'kdeg', 'KDA','Rtot0','kelB','kptB','ktpB','KDB' NCON 1 END remark - define temporary variables TEMPORARY T=X Dose1=CON(1) remark - C0 = 0.00343 C0= 0 RC0=Rtot0*C0/(KDA+C0) Ctot0=RC0+C0 AT0=kptA*Vc*C0/ktpA kepo=kint*RC0+kelA*C0 ksyn=(kint-kdeg)*RC0+kdeg*Rtot0 END remark - define initial conditions for differential equations START Z(1) = Ctot0 Z(2) = AT0 Z(3) = Dose1/Vc Z(4) = 0 Z(5) = Rtot0 END remark - define differential equations DIFFERENTIAL CtotA = Z(1) CtotB = Z(3) Rtot = Z(5) aA=CtotA/Rtot aB=CtotB/Rtot kA=KDA/Rtot kB=KDB/Rtot remark - finding of the root of the polynomial using the bisection method. Nmax=54 acc=10**(-16) zlow=0 zhigh=min(1,aA+aB) if kA = kB then b=-(1+aA+aB+kA) c=aA+aB flow=zlow**2+b*zlow+c fhigh=zhigh**2+b*zhigh+c else b=-(2+kA+kB+aA+aB) c=1+2*aA+2*aB+kA+kB+kB*aA+kA*aB+kA*kB d=-(kB*aA+kA*aB+aA+aB) flow=zlow**3+b*zlow**2+c*zlow+d fhigh=zhigh**3+b*zhigh**2+c*zhigh+d endif DO n=0 to Nmax if zhigh-zlow < acc then GOTO CONTINUE endif zmid=(zlow+zhigh)/2 if kA = kB then fmid=zmid**2+b*zmid+c else fmid=zmid**3+b*zmid**2+c*zmid+d endif if fmid=0 then GOTO CONTINUE else if flow*fmid>0 then zlow=zmid flow=fmid else zhigh=zmid fhigh=zmid endif endif NEXT CONTINUE: zend=zmid CA=CtotA*KDA/(KDA+Rtot*(1-zend)) CB=CtotB*KDB/(KDB+Rtot*(1-zend)) DZ(1) = kepo-kint*Z(1)-(kelA+kptA-kint)*CA+ktpA*Z(2)/Vc DZ(2) = kptA*CA*Vc-ktpA*Z(2) DZ(3) =-kint*Z(3)-(kelB+kptB-kint)*CB+ktpB*Z(4)/Vc DZ(4) = kptB*CB*Vc-ktpB*Z(4) DZ(5) = ksyn-kdeg*Z(5)-(kint-kdeg)*(Z(1)+Z(3)-CA-CB) END remark - define algebraic functions FUNCTION 1 F= CA END FUNCTION 2 F=CB END FUNCTION 3 F=(CA+CB) END remark - define any secondary parameters remark - end of model EOM