Number of evaluations of differential equations

6 messages 3 people Latest: Aug 31, 2000

Number of evaluations of differential equations

From: Phil Lowe Date: August 07, 2000 technical
From: phil.lowe@pharma.Novartis.com Subject: Number of evaluations of differential equations Date: Mon, 7 Aug 2000 11:00:07 +0000 Dear NM-users, I am using NM for running simulations of PKPD models written with differential equations. It is often quicker to use NM rather than the other PK software I have, especially when running many scenarios to do a sensitivity analysis. It is also useful to have the model written in NM as a precursor to adding error functions later on. However, I often encounter the error message NUMERICAL DIFFICULTIES WITH INTEGRATION ROUTINE. MAXIMUM NO. OF EVALUATIONS OF DIFFERENTIAL EQUATIONS, 100000, EXCEEDED as it hits the 100000 limit for integrating the differential between timepoints. I have to use ADVAN8 or 9 as the differential equations I use are stiff, there being some very sharp changes in slope in the PD function. I have included the verbatim code (from http://huxley.phor.com/nonmem/nm/98oct071998.html): "FIRST " COMMON /PRCOMG/ IDUM1,IDUM2,IMAX,IDUM4,IDUM5 " INTEGER IDUM1,IDUM2,IMAX,IDUM4,IDUM5 " IMAX=1000000 in the $PK block, which partially solves the problem, but then the routine fails at the $TABLE step. I assume the procedure at that point calls a subroutine which has the original 100000 limit. My question is, can I alter the limit for the number of evaluations of the differential equations? If so, which Fortran subroutines need to be edited? Best regards, Phil Lowe ________________________________________________ Dr Philip Lowe Novartis Horsham Research Centre Horsham RH12 5AB UK tel. +44 1403 323696 from 1st September 2000 Novartis Pharmaceuticals AG Drug Metabolism and Pharmacokinetics CH-4002 Basel Switzerland tel. +41 61 696 7335
From: "Gastonguay, Marc" <gastonguaym@globomax.com> Subject: RE: Number of evaluations of differential equations Date: Fri, 11 Aug 2000 14:46:40 -0400 Dear Phil, Similar questions have arisen a few times on both the nmusers discussion and as direct inquiries to nmconsult. It seems that the verbatim code that you sight below changes the limitation on the maximum number of evaluations of differential equation during estimation only. At other times, such as during the POSTHOC step, this variable refers to a hard-coded data statement(which your code does not affect). I would not recommend changing the source code. Instead, think of this warning message as a diagnostic that something is wrong with your model or data. Maybe there are some features of the data that your model does not account for or perhaps your model is too complex, given the data. Is there an alternative model that would be just as useful? Errors/outliers in your data set could also cause this problem. Good luck. Marc Gastonguay nmconsult@globomax.com
Date: Sat, 12 Aug 2000 08:00:42 +0200 From: Mats Karlsson <Mats.Karlsson@biof.uu.se> Subject: Re: Number of evaluations of differential equations Dear Marc, You write > think of this warning message as a diagnostic that something is > wrong with your model or data So, you say that this will not occur even using the most complex (but valid) model as long as it is supported by data? My experience tells me otherwise. For example, as I think has been discussed here on nmusers, adding dummy data points may help although it has nothing to do with data or model, but is just helping a short-coming the program. Best regards, Mats
From: "Gastonguay, Marc" <gastonguaym@globomax.com> Subject: RE: Number of evaluations of differential equations Date: Tue, 15 Aug 2000 12:22:58 -0400 Dear Mats, Yes, of course, I agree that it is possible that a complex, but valid model could run into the limitation on the maximum number of differential equation evaluations. Thanks for pointing-out this omission in my response. I was unable to find a thread in the nmusers archives that described the use of dummy data points in this situation, as you suggested. How would you decide on a time interval for inclusion of these dummy records? In your experience, is this a dependable solution to the numerical integrator's "short-comings"? Does anyone else have an example where this approach helped? Thanks, Marc
From: "Gastonguay, Marc" <gastonguaym@globomax.com> Subject: Caution with verbatim code/RE: Number of evaluations of differential equations Date: Thu, 24 Aug 2000 15:41:11 -0400 Dear Phil, Not too long ago, you indicated that you ran into the following error message with a differential equation model: NUMERICAL DIFFICULTIES WITH INTEGRATION ROUTINE. MAXIMUM NO. OF EVALUATIONS OF DIFFERENTIAL EQUATIONS,100000, EXCEEDED You also said that your attempt to increase the maximum number of evaluations with some verbatim code did not work (from your message): "FIRST " COMMON /PRCOMG/ IDUM1,IDUM2,IMAX,IDUM4,IDUM5 " INTEGER IDUM1,IDUM2,IMAX,IDUM4,IDUM5 " IMAX=1000000 I responded, in part, by incorrectly suggesting that there might be a hard-coded limit that was not affected by your verbatim code. In fact, Alison Boeckmann says that several users have implemented this code without a problem. One possibility, though, is that the code has not been entered correctly in your control stream. The problem that other users have encountered when trying to implement this (and possibly other) verbatim code involves a single missed space. If the line in A.(below) is mistakenly entered without a space between the quote and the C in COMMON (as in B. below), NMTRAN recognizes this line of verbatim code as a FORTRAN comment and the COMMON statement is ignored. A. " COMMON /PRCOMG/ IDUM1,IDUM2,IMAX,IDUM4,IDUM5 B. "COMMON /PRCOMG/ IDUM1,IDUM2,IMAX,IDUM4,IDUM5 FYI: The original code cited in http://huxley.phor.com/nonmem/nm/98oct071998.html http://huxley.phor.com/nonmem/nm/98oct071998.html is correct, but subsequent reiterations of this verbatim code to nmusers may have omitted this important space. Hope this helps. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Marc R. Gastonguay, Ph.D Manager, Pharmacometric R&D GloboMax LLC 7250 Parkway Drive, Suite 430 Hanover, MD 21076 Tel: 410.782.2224 Fax: 410.712.0737 email: gastonguaym@globomax.com
From: phil.lowe@pharma.Novartis.com Subject: Re: Caution with verbatim code/RE: Number of evaluations of differential equations Date: Thu, 31 Aug 2000 16:21:08 +0000 Dear Marc, many thanks for pointing out the issue with the single missed space. NONMEM now responds to changes in the specified number IMAX, such that I can now run my simulations without adding extra dummy samples "to fill in the gaps". I did not need to add too many more evaluations to get the system to run OK, just enough to get the PD function to turn a rather sharp corner just after the start of the drug administration (the response starts very quickly, reducing from a baseline value, leveling out close to zero, then recovering). Best regards, Phil.