MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Hypergeometric 1F1 and numerical evaluation

  • To: mathgroup at
  • Subject: [mg18167] Re: Hypergeometric 1F1 and numerical evaluation
  • From: "Atul Sharma" <mdsa at>
  • Date: Sat, 19 Jun 1999 23:54:29 -0400
  • References: <7jubur$> <7k9pme$ov3$>
  • Sender: owner-wri-mathgroup at

Many thanks, as your answer was helpful. My three arguments are simple
functions of measurable quantities (dialysis and kidney clearance,
generation rates etc)  with the first two being constant and the third a
linear function of time. Typical  values are on the order of
{-15.34,-48.77,14.39}. The solution is a simple ratio of 2 hypergeometric
functions, which require evaluation of the arguments at two time points,
which changes the third input slightly. Now, these typical values return a
solution in about 0.5-1.2 seconds on a 300 MHz Pentium. This I had verified
earlier. It was when I designate one of the quantities as an unknown and use
NonLinearFit or FindMinimum to 'fit' the missing parameter that I get into
trouble. Your answer prompted me to run the NonLinearFit with the
ShowProgress option on, which demonstrated the problem, namely that I was
wandering into areas where the returned solution (ratio) was sensible, but
the numerator and denominator blew up. These iterations take ~ 15 seconds to
return a solution.

Without a way to constrain the trial solutions, I'm not sure how to address
this problem, though knowing what was happening was helpful.

Thanks again.

A. Sharma

Alan Lewis wrote in message <7k9pme$ov3$3 at>...
>I think you need to give more detail as to why the 1F1 functions
>evaluations are too slow for your purposes. Perhaps you should list
>typical values of the 3 arguments, and then report the timing to
>evaluate the function. Perhaps the evaluation is slow because it takes
>a long time to evaluate your arguments. Given the arguments, you
>may get some suggestions on speeding up the function evaluation, since
>its possible you're in an asymptotic regime that Mathematica is
>having trouble with.
>Atul Sharma wrote:
>> I  am working with a multicompartmental pharmacokinetic model, which must
>> solved for unknown parameters by comparison with blood compartment
>> measurements. My initial approach was to solve the differential equations
>> numerically, using NDSolve and FindMinimum to fit the unknown parameters,
>> approach which works well and in a reasonable time frame, since we
>> to use this model at the 'bedside' as it were, to guide patient
>> However,  through simplifying assumptions and straightforward variable
>> transformations,  I am able to reduce the system of governing
>> equations to the Kummer equation, soluble in terms of confluent
>> hypergeometric functions.
>> I confess to knowing little about this function, though I did find an
>> informative thread in the archives dating back to 1994-95 (thanks to Bob
>> Hanlon etc etc). I understand now that numerical evaluation of this
>> is quite time consuming. In fact, knowing the 'exact' closed form
>> doesn't help me, insofar as NDSolve returns a result considerably more
>> quickly (even though I have to integrate through an entire week of
>> doses and multiple body water compartments). A recent discussion in this
>> group of a bug in MathDLL.dll was also helpful, since the downloaded
>> performs more reliably.
>> My questions is
>> Is there a faster way to evaluate the 1F1 function to take advantage of
>> solution? Path integrals don't sound much faster to me, though I was
>> that someone with some experience in this area could advise me as to
>> this merited further consideration. Even an approximate solution might be
>> preferable, since the time needed to perform the curve fitting will be,
>> my mind, the major obstacle to using this model for its intended purpose.
>> Thanks in advance.
>> A. Sharma MD

  • Prev by Date: Re: Pipes within Mathematica?
  • Next by Date: Re: How to plot more curves on one graph
  • Previous by thread: Re: Hypergeometric 1F1 and numerical evaluation
  • Next by thread: Inserting Adobe pdf files in ver. 4 notebooks