Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

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

Search the Archive

Re: What am I doing wrong with this code?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82553] Re: What am I doing wrong with this code?
  • From: Bill Rowe <readnewsciv at sbcglobal.net>
  • Date: Wed, 24 Oct 2007 04:32:25 -0400 (EDT)

On 10/23/07 at 5:32 AM, sean_incali at yahoo.com (sean_incali) wrote:

>I think I'm having a brain fart. Seriously...

>Plot[{1/(1 + y^2), (1/y - 1)^(1/2)}, {y,  0, 5}]

>What is wrong with that code?

or y > 1, (1/y - 1) is negative and the square root becomes
imaginary. Also, at y = 0, it blows up.

Using version 6 of Mathematica, there is no issue since Plot
will simply ignore the imaginary points and only plot the curve
where it has real values. For earlier versions of Mathematica
you will get the error you saw since

In[2]:= (1/y - 1)^(1/2) /. y -> 1.0000001666666667`

Out[2]= 0.+ 0.000408248 I
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: Re: why no result & no error from this recursion
  • Next by Date: Problem with Differential Eq
  • Previous by thread: Re: What am I doing wrong with this code?
  • Next by thread: Re: What am I doing wrong with this code?