Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: why 312/100 and 3.12 different
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
H.J. Wang

Posts: 12
Registered: 12/7/04
why 312/100 and 3.12 different
Posted: Jul 30, 1997 3:27 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

I observed a very strange behavior of Mma 2.2.3 when trying to
evaluate the following program in Win95.

(******** begin of the program ***********)
<<Statistics`ContinuousDistributions`;
ldist =LogNormalDistribution[m,s];
logpdf[W_] = PDF[ldist, W];
pa =CDF[ldist, e];
pc = 1-CDF[ldist, wtilde];
pb = CDF[ldist, wtilde] - CDF[ldist, e];
wtilde = (e+b (1+r))/(1+c);
U[X_,L_] = Log[X] +0.0003*L^11;
Y2=312/100 n2;
Y1=312/100 n1;
Ux[X_,L_] = D[U[X,L],X];


funEU = U[w+Y1+b,n1] +
rho Integrate[ U[ W (1-c)+ei Y2,n2]*logpdf[W], {W,0,e}]+ rho
Integrate[ U[ e-c W+ei Y2,n2] logpdf[W], {W,e,wtilde}] + rho
Integrate[ U[ W+Y2-b (1+r),n2] logpdf[W], {W,wtilde,Infinity}];

(****** end of the program ****************)

The strange thing is observed when I change the 9th and the
10th lines from
Y2 = 312/100 n2;
Y1 = 312/100 n1;
to
Y2 = 3.12 n2;
Y1 = 3.12 n1;

. With the "312/100" coefficients, the execution time is short and the
memory usage is (relatively) minimal. However, with the "3.12"
coefficients, Mma used up all the RAM (about 25 MB available for it)
and has to resort to virtual memory. I don't know whether it will
eventually produce results since I interrupted the process.

Any idea of why this might happen and how could we avoid it?
Thank you in advance!


H.J. Wang





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.