MathGroup Archive 1999

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

Search the Archive

RE: Repeated calls to Mathematica process

A couple of ideas:

* Solve the integral, format the output as FortranForm, and paste this
code into your Gauss routine to be evaluated there. This means Gauss
needs to do the evaluation of the integrated expression.  This should
be ok if the result doesn't involve special functions or special
Mathematica commands that Gauss can't cope with.  There is an article
in Hal Varian's book "Economic and Financial Modelling with
Mathematica" by Stephen J Brown, "Nonlinear Systems Estimation: Asset
Pricing Model Application" that deals with the interaction between
Gauss and Mathematica in detail; or

* Leave Mathematica open.

* At the end of the first Mathematica session, use DumpSave[] to save
the result from the integration in internal Mathematica format to a
file. Then in each subsequent Mathematica session, you can just read in
the result from the file instead of recalculating the integral.  Using
DumpSave instead of Save generates non-human-readable files, but it's
MUCH faster reading it back into Mathematica.

* Of course, life would be easier if Mathematica's large-data-set
handling was as efficient as Gauss's. (this is a hint about the next
version and its suggested capabilities)  Then you wouldn't need Gauss. 
And the world would be a better place  (-:

Hope this helps,
Luci Ellis         
ph:61-2-9551-8881 Acting Senior Economist            fx:61-2-9551-8833
Financial & Monetary Conditions    ellisl at Economic Analysis
Department       GPO Box 3947 Reserve Bank of Australia          Sydney
NSW 2001

-----Original Message-----
From: reveltd at [mailto:reveltd at]
To: mathgroup at
Subject: [mg15710] [mg15705] Repeated calls to Mathematica process

*** This E-Mail has been checked by MAILsweeper *** Greetings,

I have an integral function which I need to maximize.  The maximization
procedure requires many evaluations of this function. The fastest way
for me to evaluate this function is to integrate it symbolically once
and then evaluate it repeatedly as the parameters change in the
maximization routine.  Since I have a large data set, I am using Gauss
to maximize this function, and the Gauss procedure can call the
Mathematica process.

What I don't know how to do is to maintain the memory state of the
Mathematica process as I move back and forth to Gauss.  That is, I want
to symbolically integrate the function once, then do some work in
Gauss, and then come back to Mathematica to evaluate the function. But
once I exit the mathematica process, I will lose the symbolic solution
to my integral.  In short, I want to treat the Mathematica process like
an object (rather than a function) which performs the symbolic
integration upon construction, remains in memory while I do other
things, and then evaluates it whenever I message it.

Short of reading and writing back and forth to files (which is expensive
time-wise) is there any way to hold the memory state of a Mathematica
process while I do the work in Gauss?


  • Prev by Date: Re: speed
  • Next by Date: RE:Help to clarify 'Map', 'Apply', and 'Thread'.
  • Previous by thread: Repeated calls to Mathematica process
  • Next by thread: Problem using init.m to create notebook in front end