Re: non integer exponents in ContourPlot[]?

• To: mathgroup at smc.vnet.net
• Subject: [mg35218] Re: non integer exponents in ContourPlot[]?
• From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
• Date: Wed, 3 Jul 2002 05:13:14 -0400 (EDT)
• Organization: Universitaet Leipzig
• References: <afrgq3\$lt1\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

Hi,

just try

In[]:=a = -5.75; b = 2; d = 1.1;
ContourPlot[a*((x^2.1 + y^2.0)^0.5 + b*y^2.0), {x, -d, d}, {y, -d, d},
ContourShading -> False, Contours -> {-6, -3, -1}, PlotPoints ->
30];

*and*

In[]:=%[[1]]

and you will see that the array for contour plot is filled with
complex numbers

{{-22.7982 - 0.702496 \[ImaginaryI], -22.4857 -
0.626646 \[ImaginaryI], -22.1876 - 0.552341 \[ImaginaryI],
-21.9052 -
0.480004 \[ImaginaryI], -21.64 - 0.410144 \[ImaginaryI], -21.3936
-
0.343352 \[ImaginaryI], -21.1674 - 0.280309 \[ImaginaryI],
-20.9631 -
0.221766 \[ImaginaryI], -20.7822 - 0.168531 \[ImaginaryI],
-20.6259 -
0.121428 \[ImaginaryI], -20.4955 - 0.0812504 \[ImaginaryI],
-20.3918 -
0.0486989 \[ImaginaryI], -20.3153 - 0.0243116 \[ImaginaryI],
-20.2659 -
0.00838107 \[ImaginaryI], -20.2426 -
0.000837412 \[ImaginaryI], -20.2427, -20.2672, -20.3191, -20.3994,
\
-20.5079, -20.644, -20.8067, -20.9947, -21.2063, -21.4399, -21.6939, \
-21.9666, -22.2564, -22.5618, -22.8813}, ....

Because x^(2.1) of a negative number (x in [-d,d]) *must* be complex.

Regards
Jens

"1.156" wrote:
>
> Mathematica wizards all:
>
> The following code runs fine, note the (apparent) floating point form of the exponents.
>
> a=-5.75;b=2;d=1.1;
>
> ContourPlot[a*((x^2.0 + y^2.0)^0.5 + b*y^2.0), {x, -d, d}, {y, -d, d}, ContourShading -> False,
>    Contours -> {-6, -3, -1}, PlotPoints -> 30];
>
> But, if I make any of the 2.0 exponents say, 2.1, I get big error messages like
>
> ContourGraphics::ctpnt:
>    The contour is attempting to traverse a cell in which some of the points have not evaluated to numbers,
>     and it will be dropped.
>
> However, it works fine if I change the 0.5 exponent to say, 0.55.
>
> Can anyone give me a hint of what's going on here? I'd sure like to be able to play with these exponents to fit some data.
>
> Thanks, Rob

• Prev by Date: Re: I NEED HELP WITH THIS
• Next by Date: Re: Simplifying the *Individual Coefficients* in Series Expansions?
• Previous by thread: RE: non integer exponents in ContourPlot[]?
• Next by thread: Re: Re: non integer exponents in ContourPlot[]?