NONMEM Users Network Archive

Hosted by Cognigen

Re: inexplicit equations in PRED

From: Sam <sliao>
Date: Sat, 26 Sep 2009 18:42:05 -0400

Dear nmusers:
I would like to continued this thread started by Robert. I tried the
$AES method suggested by Katya in my PK model where the first two
compartments are defined in $DES while the third compartment is defined
as an equilibrium algebraic equation in $AES. I got error msg shown
below. Could anyone tell what is missing in my code?

 "LUDATN IS UNABLE TO INVERT JACOBIAN (DA) FOR AES
VARIABLES

 ERROR OCURRED WHILE ATTEMPTING TO OBTAIN INITIAL VALUES FOR DY/DT"
                                                                

Sam Liao
===== sim02.lst =====================================================
$PROB A TMDD MODEL
$INPUT C ID TIME DV AMT RATE DOSE EVID CMT SS
$DATA sim01.csv IGNORE=C
$SUBROUTINES ADVAN9 TOL=3
$MODEL
       COMP=(CENTRAL)
       COMP=(RTOT)
       COMP=(A3 EQUILIBRIUM)
$PK
     CL = THETA(1)* EXP(ETA(1))
     V1 = THETA(2)* EXP(ETA(2))

     K10= CL/V1

     KSYN= THETA(3)* EXP(ETA(3))
     KDEG= THETA(4)* EXP(ETA(4))
     KINT= THETA(5)* EXP(ETA(5))
     KD = THETA(6)* EXP(ETA(6))

     BL= KSYN/KDEG
     A_0(2)=BL ;BOUNDARY CONDITION FOR EQUATION 3
$AESINITIAL
    INIT=1
    A(3)=0.001
$AES
     K1 = A(1)/V1-A(2)-KD
     E(3) = 0.5*(K1+ SQRT(K1*K1+4*KD*A(1)/V1))
$DES
     DADT(1)= -K10*A(3)*V1 - KINT*A(3)*V1*A(2)/(KD+A(3))
     DADT(2)= KSYN - KDEG*A(2) -(KINT - KDEG)*A(3)*A(2)/(KD+A(3))

$ERROR (ONLY OBSERVATIONS)
 IPRED=-5
 IF(F.GT.0) IPRED = LOG(F)
 SIG=
THETA(7)
 Y = IPRED + EPS(1)*SIG
 
 MDV1=0

 IF (Y.LT.LOG(1)) MDV1=1
                                                      
 IRP=IREP

$THETA
 0.085 FIX ;1 CL
 50 FIX ;2 V1

  1.04 FIX ;3 KSYN
  0.255 FIX ;4 KDEG
 0.00452 FIX ;5 KINT
  1.49 FIX ;6 KD
  0.1 FIX ;7 ADD_ERR
 
 
$OMEGA
 0.163 ;BSV_CL
 0.0345 ;BSV_VC
 0.5 ;BSV_KSYN
 0.642 ;BSV_KDEG
 0.328 ;BSV_KINT
 0. FIX ;BSV_KD

$SIGMA 1 FIX
$SIM (5113) ONLYSIMU SUBPROBLEM=1
$TABLE ID IRP TIME AMT DOSE MDV1 EVID IPRED FILE=sim0.fit
 ONEHEADER NOPRINT
 
NM-TRAN MESSAGES
 
 WARNINGS AND ERRORS (IF ANY) FOR PROBLEM 1
            
 (WARNING 2) NM-TRAN INFERS THAT THE DATA ARE POPULATION.
            
 (WARNING 73) COMPARTMENT AMOUNTS ARE INITIALIZED IN $PK ABBREVIATED CODE,
 BUT THE SS DATA ITEM IS DEFINED. THE SS DOSE EVENT RECORDS SHOULD SPECIFY
 SS=2 OR SS=3.

1NONLINEAR MIXED EFFECTS MODEL PROGRAM (NONMEM) DOUBLE PRECISION
NONMEM VERSION VI LEVEL 2.0
 DEVELOPED AND PROGRAMMED BY STUART BEAL AND LEWIS SHEINER
 
 PROBLEM NO.: 1
 A TMDD MODEL
0DATA CHECKOUT RUN: NO
 DATA SET LOCATED ON UNIT NO.: 2
 THIS UNIT TO BE REWOUND: NO
 NO. OF DATA RECS IN DATA SET: 136
 NO. OF DATA ITEMS IN DATA SET: 11
 ID DATA ITEM IS DATA ITEM NO.: 2
 DEP VARIABLE IS DATA ITEM NO.: 4
 MDV DATA ITEM IS DATA ITEM NO.: 11
0INDICES PASSED TO SUBROUTINE PRED:
  8 3 5 6 10 0 9 0 0
  0 0
0LABELS FOR DATA ITEMS:
    C ID TIME DV AMT RATE DOSE EVID CMT
   SS MDV
0(NONBLANK) LABELS FOR PRED-DEFINED ITEMS:
 IPRE MDV1 IRP
0FORMAT FOR DATA:
 (10E5.0,1F2.0)

 
 TOT. NO. OF OBS RECS: 128
 TOT. NO. OF INDIVIDUALS: 4
0LENGTH OF THETA: 7
0DEFAULT THETA BOUNDARY TEST OMITTED: NO
0OMEGA HAS BLOCK FORM:
  1
  0 2
  0 0 3
  0 0 0 4
  0 0 0 0 5
  0 0 0 0 0 6
0DEFAULT OMEGA BOUNDARY TEST OMITTED: NO
0SIGMA HAS SIMPLE DIAGONAL FORM WITH DIMENSION: 1
0DEFAULT SIGMA BOUNDARY TEST OMITTED: NO
0INITIAL ESTIMATE OF THETA:
 LOWER BOUND INITIAL EST UPPER BOUND
  0.8500E-01 0.8500E-01 0.8500E-01
  0.5000E+02 0.5000E+02 0.5000E+02
  0.1040E+01 0.1040E+01 0.1040E+01
  0.2550E+00 0.2550E+00 0.2550E+00
  0.4520E-02 0.4520E-02 0.4520E-02
  0.1490E+01 0.1490E+01 0.1490E+01
  0.1000E+00 0.1000E+00 0.1000E+00
0INITIAL ESTIMATE OF OMEGA:
 BLOCK SET NO.
BLOCK
FIXED
        
1
NO
                  0.1630E+00
        
2
NO
                  0.3450E-01
        
3
NO
                  0.5000E+00
        
4
NO
                  0.6420E+00
        
5
NO
                  0.3280E+00
        
6
YES
                  0.0000E+00
0INITIAL ESTIMATE OF SIGMA:
 0.1000E+01
0SIGMA CONSTRAINED TO BE THIS INITIAL ESTIMATE
0SIMULATION STEP OMITTED: NO
 OBJ FUNC EVALUATED: NO
 SOURCE 1:
    SEED1: 5113 SEED2: 0 PSEUDO-NORMAL
 NUMBER OF SUBPROBLEMS: 1
0TABLES STEP OMITTED: NO
 NO. OF TABLES: 1
0-- TABLE 1 --
 PRINTED: NO
 HEADER: YES
 FILE TO BE FORWARDED: NO
0USER-CHOSEN ITEMS
 IN THE ORDER THEY WILL APPEAR IN THE TABLE:
   ID IRP TIME AMT DOSE MDV1 EVID IPRE
1DOUBLE PRECISION PREDPP VERSION V LEVEL 2.0
 
 GENERAL NONLINEAR KINETICS MODEL WITH EQUILIBRIUM COMPARTMENTS (ADVAN9)
0MODEL SUBROUTINE USER-SUPPLIED - ID NO. 9999
0MAXIMUM NO. OF BASIC PK PARAMETERS: 6
0COMPARTMENT ATTRIBUTES
 COMPT. NO. FUNCTION INITIAL ON/OFF DOSE DEFAULT DEFAULT
                         STATUS ALLOWED ALLOWED FOR DOSE FOR
OBS.
    1 CENTRAL ON YES YES YES YES
    2 RTOT ON YES YES NO NO
    3 A3 ON YES NO NO NO
    4 OUTPUT OFF YES NO NO NO
0COMPT. NO. FUNCTION EQUILIB EXCLUDE
                          RIUM FROM TOTAL
    1 CENTRAL NO NO
    2 RTOT NO NO
    3 A3 YES NO
    4 OUTPUT NO YES
0NRD VALUE(S) FROM SUBROUTINE TOL: 3
1
 ADDITIONAL PK PARAMETERS - ASSIGNMENT OF ROWS IN GG
 COMPT. NO. INDICES
              SCALE BIOAVAIL. ZERO-ORDER ZERO-ORDER ABSORB
                         FRACTION RATE DURATION LAG
    1 * * * * *
    2 * * * * *
    3 * - - - -
    4 * - - - -
             - PARAMETER IS NOT ALLOWED FOR THIS MODEL
             * PARAMETER IS NOT SUPPLIED BY PK SUBROUTINE;
               WILL DEFAULT TO ONE IF APPLICABLE
0DATA ITEM INDICES USED BY PRED ARE:
   EVENT ID DATA ITEM IS DATA ITEM NO.: 8
   TIME DATA ITEM IS DATA ITEM NO.: 3
   DOSE AMOUNT DATA ITEM IS DATA ITEM NO.: 5
   DOSE RATE DATA ITEM IS DATA ITEM NO.: 6
   STEADY STATE DATA ITEM IS DATA ITEM NO.: 10
   COMPT. NO. DATA ITEM IS DATA ITEM NO.: 9
 
0PK SUBROUTINE CALLED WITH EVERY EVENT RECORD.
 PK SUBROUTINE NOT CALLED AT NONEVENT (ADDITIONAL OR LAGGED) DOSE TIMES.
0PK SUBROUTINE INDICATES THAT COMPARTMENT AMOUNTS ARE INITIALIZED.
0DURING SIMULATION, ERROR SUBROUTINE CALLED WITH EVERY EVENT RECORD.
 OTHERWISE, ERROR SUBROUTINE CALLED ONLY WITH OBSERVATION EVENTS.
0DES SUBROUTINE USES FULL STORAGE MODE.
1
 PROBLEM NO.: 1 SUBPROBLEM NO.: 1
 
0PRED EXIT CODE =
1

0INDIVIDUAL NO. 1 ID=0.10000000E+01 (WITHIN-INDIVIDUAL) DATA
REC NO. 3
 THETA=

  8.50E-02 5.00E+01 1.04E+00 2.55E-01 4.52E-03 1.49E+00
1.00E-01
 LUDATN IS UNABLE TO INVERT JACOBIAN (DA) FOR AES
VARIABLES

 ERROR OCURRED WHILE ATTEMPTING TO OBTAIN INITIAL VALUES FOR
DY/DT
 MESSAGE ISSUED FROM SIMULATION STEP
===== sim01.csv==========================================
C,ID,TIME,DV,AMT,RATE,DOSE,EVID,CMT,SS
.,1,0,0,0,0,0.8,1,1,3
.,1,0,0,1335,1335,0.8,1,1,.
.,1,1,0,.,.,0.8,0,3,.
.,1,2,0,.,.,0.8,0,3,.
.,1,6,0,.,.,0.8,0,3,.
.,1,12,0,.,.,0.8,0,3,.
.,1,24,0,.,.,0.8,0,3,.
.,1,48,0,.,.,0.8,0,3,.
.,1,72,0,.,.,0.8,0,3,.
.,1,96,0,.,.,0.8,0,3,.
.,1,120,0,.,.,0.8,0,3,.
.,1,144,0,.,.,0.8,0,3,.
.,1,168,0,.,.,0.8,0,3,.
.,1,192,0,.,.,0.8,0,3,.
.,1,216,0,.,.,0.8,0,3,.
.,1,240,0,.,.,0.8,0,3,.
.,1,264,0,.,.,0.8,0,3,.
.,1,288,0,.,.,0.8,0,3,.
.,1,312,0,.,.,0.8,0,3,.
.,1,336,0,.,.,0.8,0,3,.
.,1,360,0,.,.,0.8,0,3,.
.,1,384,0,.,.,0.8,0,3,.
.,1,408,0,.,.,0.8,0,3,.
.,1,432,0,.,.,0.8,0,3,.
.,1,456,0,.,.,0.8,0,3,.
.,1,480,0,.,.,0.8,0,3,.
.,1,504,0,.,.,0.8,0,3,.
.,1,528,0,.,.,0.8,0,3,.
.,1,552,0,.,.,0.8,0,3,.
.,1,576,0,.,.,0.8,0,3,.
.,1,600,0,.,.,0.8,0,3,.
.,1,624,0,.,.,0.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.,2.4,0,3,.
.,4,432,0,.,.,2.4,0,3,.
.,4,456,0,.,.,2.4,0,3,.
.,4,480,0,.,.,2.4,0,3,.
.,4,504,0,.,.,2.4,0,3,.
.,4,528,0,.,.,2.4,0,3,.
.,4,552,0,.,.,2.4,0,3,.
.,4,576,0,.,.,2.4,0,3,.
.,4,600,0,.,.,2.4,0,3,.
.,4,624,0,.,.,2.4,0,3,.
.,4,648,0,.,.,2.4,0,3,.
.,4,672,0,.,.,2.4,0,3,.


> Robert,
>
> You can do it using ADVAN9 with NEQUILIBRIUM option in $MODEL, and
> $AESINITIAL and $AES blocks. E.g. (where A(13) is what is F in your
> example) :
>
> $SUBROUTINES ADVAN9 TOL=4
> $MODEL NEQUILIBRIUM=1
> COMP(COMP1)
> ....
> COMP(COMP13)
>
> $PK
> ...
>
> $AESINITIAL
> INIT = 0; 0=APPROXIMATE, 1=EXACT
> A(13)=0.001
> $AES
> E(13)=A(9)-A(13)-A(13)*A(10)/(KSS+A(13))-A(13)*A(12)/(KSS2+A(13))
>
> $DES
> ...
>
> $ERROR
> Y = A(13)+EPS(1)
>
> Regards,
> Katya
>
> --------------------------
> Ekaterina Gibiansky, Ph.D.
> CEO&CSO, QuantPharm LLC
> Web: www.quantpharm.com
> Email: EGibiansky
> Tel: (301)-717-7032
>
>
> Robert Kalicki wrote:
>> Dear NMusers,
>>
>> Most of the models are pre-defined (ADVANx), expressed as a system of
>> differential equations or provided in the form of an explicit
>> mathematical equation (PRED).
>>
>> Is it possible to deal with nonlinear inexplicit equations like y =
>> f(x,y) where both differential equations and explicit solution
>> equation are not known or not obvious.
>>
>>
>>
>> Concretely, using PRED, one would find F on the both sides:
>>
>> F = f(X) + g(F)
>>
>> Y = F+EPS(1)
>>
>>
>>
>> Many thanks in advance
>>
>>
>>
>> Best regards,
>>
>> Robert
>>
>>
>>
>>
>>
>> ___________________________________________
>> Robert M. Kalicki, MD
>>
>> Postdoctoral Fellow
>>
>> Department of Nephrology and Hypertension
>>
>> Inselspital
>>
>> University of Bern
>>
>> Switzerland
>>
>>
>>
>> Address:
>>
>> Klinik und Poliklinik für Nephrologie und Hypertonie
>>
>> KiKl G6
>>
>> Freiburgstrasse 15
>>
>> CH-3010 Inselspital Bern
>>
>>
>>
>> Tel +41(0)31 632 96 63
>>
>> Fax +41(0)31 632 14 58
>>
>>
>>
>
>
>

Received on Sat Sep 26 2009 - 18:42:05 EDT

The NONMEM Users Network is maintained by ICON plc. Requests to subscribe to the network should be sent to: nmusers-request@iconplc.com.

Once subscribed, you may contribute to the discussion by emailing: nmusers@globomaxnm.com.