Speeding up code with explicit, piecewise ODE solutions
Hi,
I'm trying to solve an indirect response model in Nonmem where the drug
effect depends upon the dose, which can change every day. Currently, I'm
using the ADVAN6 routine, but because I have thousands of time points for
about a thousand patients, Nonmem is quite slow. I thought that in
principle, it should be possible to speed this up. Rather than use the
ADVAN6 routine, it would be nice if I could just somehow enter the
piecewise, analytical solution into the model. Instead of the DADT(1)
equation shown below, it would be nice to be able to use something like the
pseudo-code
SSA = KIN*(1-EFF)/KOUT ; the steady state for A given the effect at a
certain dose). note that EFF can change with time due to dose changes
A(this time step) = (A(last time step) - SSA)*EXP(-KOUT*TSTEP) + SSA ; this
is the explicit solution to the indirect response equation from the model
below, TSTEP=size of time step
Does anyone know if this is possible? If so, if you have sample code for a
similar problem that would be extremely helpful.
Thanks,
Andy
$PROBLEM this is the essential part of the current indirect response code
I'm using
$SUBS ADVAN6 TOL=5
$PK
; PD model
KIN = THETA(1)*EXP(ETA(1));
KOUT = THETA(2)*EXP(ETA(2));
E10 = THETA(3)*EXP(ETA(3)); %effect of 10mg
; Initialize ODE
A_0(1) = Y0; baseline value (as covariate)
$DES
IF (DOSE.EQ.10) EFF=E10
IF (DOSE.EQ.0) EFF=0
DADT(1) = KIN*(1-EFF)-KOUT*A(1)