MathGroup Archive 2010

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

Search the Archive

Re: Re: Numerical Problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107056] Re: [mg107044] Re: Numerical Problem
  • From: "Tony Harker" <a.harker at ucl.ac.uk>
  • Date: Tue, 2 Feb 2010 03:24:01 -0500 (EST)
  • References: <201001291249.HAA29176@smc.vnet.net> <4B6318FC.3020402@wolfram.com> <hk17nr$oja$1@smc.vnet.net> <201002011113.GAA22665@smc.vnet.net> <7414ba0d1002010448i4ce34b3cs1ef8a710763509ec@mail.gmail.com>


            For interest, I've tried the same iterations in Excel and in
Fortran (double precision), on the same Intel cpu as that on which I was
running the Mathematica cases. They both give results which are consistent
with Mathematica version 7. It looks as if Mathematica version 5 might have
had some additional subtlety which took it beyond IEEE standard floating
point arithmetic, but that this has been stripped out of version 7.

  You're right, of course, that the loss of significance in the iterates is
to be expected, and in this sense the version 7 results are more in keeping
with what we expect from limited precision floating point calculations than
are the version 5 results.

  Tony

]-> -----Original Message-----
]-> From: Mark McClure [mailto:mcmcclur at unca.edu]
]-> Sent: 01 February 2010 12:49
]-> To: mathgroup at smc.vnet.net; fateman at cs.berkeley.edu
]-> Cc: Daniel Lichtblau; a.harker at ucl.ac.uk
]-> Subject: Re: [mg107044] Re: Numerical Problem
]->
]-> On Mon, Feb 1, 2010 at 6:13 AM, Richard Fateman
]-> <fateman at cs.berkeley.edu> wrote:
]-> > Thanks, Tony, for providing a nice example of how
]-> arithmetic matters.
]-> > Your  3-line program got pretty plausible results in version 5.0
]-> > ...
]-> > But apparently not in version 7, where DanL suggests that Intel's
]-> > numerical library may have sent it off in the wrong direction.
]->
]-> I cannot reproduce these results on my MacBook Pro, i.e. I
]-> get (on V7
]-> and V5.2) the same erroneous results that Tony gets with V7.  I
]-> suppose this supports Dan's suggestion that this is a
]-> hardware issue.
]->
]-> > Let's try using Mathematica's significance arithmetic,
]-> and do everything
]-> > "exactly" except for one number,  0.5.  Let us use N[1/2,40]. =
 ...
]->
]-> The last few terms in the sequence I get look something like so:
]-> In[1]:= epcms[h_, y_List, f_List] := y +
]->    N[1/2, 40]*h (f.y + f.(y + h f.y));
]-> In[2]:= fepcms[h_, t0_, tmax_, y0_List, f_List] :=
]->   NestList[epcms[h, #, f] &, y0, 10];
]-> In[3]:= app1 = fepcms[1/10, 0, 1, {2, -1},
]->    {{998, 1998}, {-999, -1999}}];
]-> In[4]:= Column[app1[[-4 ;;]]]
]-> Out[4]=
]-> {0.994420457375, -0.497210228688}
]-> {0.89995051, -0.44997526}
]-> {0.814, -0.407}
]-> {0.10^2 , 0.10^2}
]->
]-> I haven't examined the equations closely but, as I
]-> understand it, they
]-> arise via Euler's method applied to a stiff system.  Thus, I would
]-> expect numerical instability.  I would also expect the iterates to
]-> lose significance, which is exactly what we see.  Seems to be a good
]-> example of significance arithmetic doing exactly what we want.
]->
]-> Mark McClure
]->



  • Prev by Date: Re: What does & mean?
  • Next by Date: Re: position of sequence of numbers in list
  • Previous by thread: Re: Re: Re: Numerical Problem
  • Next by thread: Re: Re: Numerical Problem