MathGroup Archive 2003

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

Search the Archive

SetPrecision & Plot bug?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39909] SetPrecision & Plot bug?
  • From: Enrique Zeleny <ezeleny at fismat1.fcfm.buap.mx>
  • Date: Tue, 11 Mar 2003 02:37:05 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com


Consider this expression

In[1]:= HW =
 (1/7245)*(2*(Sqrt[(-ro^2)*(ro^2 + 4830*(Sqrt[5832225 - ro^2] - 2415))] -
     Sqrt[(1/(rom^2*(17496675 - 4*rom^2)^2))*
       ((rom^2*(112678587000*Sqrt[5832225 - rom^2] - (17496675 - 4*rom^2)^
             2) - 164291718016518750*(Sqrt[5832225 - rom^2] - 2415))*ro^4
+
        2415*(56339293500*Sqrt[5832225 - ro^2]*Sqrt[5832225 - rom^2]*
           (4*rom^2 - 5832225) - 34993350*Sqrt[5832225 - rom^2]*
           (4*rom^4 - 1944075*rom^2 + 11338282816875) +
          2415*(4*rom^2 + 5832225)*(8*rom^4 - 64154475*rom^2 +
            68029696901250) - 2*Sqrt[5832225 - ro^2]*
           (rom^2*(17496675 - 4*rom^2)^2 - 396764499009892781250))*ro^2 +
        14084823375*(4*(4*Sqrt[5832225 - ro^2] - 12075)*rom^6 -
          7245*(8*Sqrt[5832225 - rom^2]*Sqrt[5832225 - ro^2] +
            9660*Sqrt[5832225 - ro^2] - 9660*Sqrt[5832225 - rom^2] -
            64154475)*rom^4 + 140848233750*(Sqrt[5832225 - ro^2] + 2415)*
           (Sqrt[5832225 - rom^2] - 2898)*rom^2 - 328583436033037500*
           (Sqrt[5832225 - ro^2] + 2415)*(Sqrt[5832225 - rom^2] -
2415)))]));


This should work

In[2]:= Plot[Evaluate[SetPrecision[HW /. rom -> 1, 50]], {ro, 0, 1},
PlotPoints -> 5, Compiled -> False]


but is awful, how Plot chooses the points? see this

In[3]:= %[[1]]

(Output is not shown because it's big)

this is the problem

In[4]:= FullForm[SetPrecision[HW /. rom -> 1, 50]]

(Output is not shown)

SetPrecision converts Power[expr,1/2] to Power[expr,0.5'50], but power is
an algebraic operation!, documentation say :

SetPrecision[expr, n] yields a version of expr in which all numbers have
been set to have a precision of n digits.

SetPrecision[expr, n] does not modify expr itself.

(???)

this works well

In[5]:= ListPlot[Table[Evaluate[SetPrecision[HW /. rom -> 1, 24],
{ro, 0, 1, 0.01`24}]], PlotJoined -> True];

This should work?

In[6]:= Plot[Evaluate[N[HW /. rom -> 1, 50]], {ro, 0, 1}, Compiled ->
False]


Enrique Zeleny
UAP, Mexico




  • Prev by Date: Compile + Module => Memory Leak
  • Next by Date: Re: Symbols and Lists
  • Previous by thread: Re: Compile + Module => Memory Leak
  • Next by thread: RE: SetPrecision & Plot bug?