Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

RE: non integer exponents in ContourPlot[]?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg35230] RE: [mg35209] non integer exponents in ContourPlot[]?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Wed, 3 Jul 2002 05:13:36 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Rob,

Your function is complex for negative values of x or y when the exponent is
not 2.

a = -5.75; b = 2; d = 1.1;
f[exp1_][x_, y_] := a*((x^exp1 + y^exp1)^0.5 + b*y^exp1)

Table[f[2.001][x, 0], {x, -1, 1, 0.25}] // InputForm
{-5.749992906223295 - 0.009032075164776287*I,
 -4.311874410575174 - 0.006773082056369065*I,
 -2.8740002279114947 - 0.00451447271421603*I,
 -1.4365021739584314 - 0.002256454194145964*I, 0.,
 -1.4365039461737756, -2.874003773570802,
 -4.311879730142475, -5.75}

If you confine yourself to positive values you will obtain a contour plot.

ContourPlot[a*((x^2.001 + y^2.001)^0.5 + b*y^2.0), {x, 0, d}, {y, 0, d},
    ContourShading -> False,
   Contours -> {-6, -3, -1}, PlotPoints -> 30];

I don't know if that is good enough.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/




> From: 1.156 [mailto:rob at piovere.com]
To: mathgroup at smc.vnet.net
>
>
> 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: Simplifying the *Individual Coefficients* in Series Expansions?
  • Next by Date: Re: Question about yet another bug in Sum
  • Previous by thread: Re: non integer exponents in ContourPlot[]?
  • Next by thread: Re: non integer exponents in ContourPlot[]?