MathGroup Archive 2007

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

Search the Archive

Re: Re: Contours plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78903] Re: [mg78875] Re: Contours plot
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Thu, 12 Jul 2007 05:22:06 -0400 (EDT)
  • References: <f6vn85$qcr$1@smc.vnet.net> <200707111022.GAA08575@smc.vnet.net>

Jens-Peer Kuska wrote:
> Hi,
> 
> can you be more precise ?
> Contours are typical use an implicit equation f[x,y,z]==c and c is the 
> contour level, by changing the contour value you get multiple contours.
> Parametric curves/ surfaces have an explicit form
> {x,y,z}=={X[u,v],Y[u,v],Z[u,v]} and you have a single surface and no 
> contour level ...
> The first form of equation is drawn with ContourPlot3D[], the second one
> with ParametricPlot3D[].
> 
> But it is an contradiction to plot contours of an parametric surface.
> Yu can try to make an implicit algebraic equation from your parametric 
> curve, but this is in many cases not possible.
> 
> Regards
>    Jens
> 
> Tomas Bayer wrote:
> 
>>I have some problem with Mathematica 6.  How do I plot contours for this parametric equation:
>>
>>x=Sin[la]/Cos[fi]]
>>y=Tan[fi]*Cos[la]
>>z=Sqrt[Sec[fi]^4 - Sec[fi]^2 Sin[la]^2]
>>
>>fi=<-Pi/2,Pi/2>, la=<-Pi,Pi>
>>
>>Thanks


I wanted to expand on the remark "you can try to make an implicit 
algebraic equation from your parametric curve, but this is in many
cases not possible." The problem is one of computational complexity as 
opposed to mathematical impossibility. Note that the latter can arise in 
the reverse direction, attempting to parametrize an algebraic implicit form.

In this example we have a trigonometric parametrization, and it has a 
radical. So implicitization could give rise to parts that are, in 
effect, parasite solutions. That said, here is a way to go about it with 
Groebner bases. We first rename the trigs via Cos->c,Sin->s. Then 
augment with the standard trig relations c^2+s^2-1.

rats = {x-s[la]/c[fi], y-s[fi]/c[fi]*c[la],
   z^2 - (1/c[fi]^4-1/c[fi]^2*s[la]^2),
   c[fi]^2+s[fi]^2-1, c[la]^2+s[la]^2-1};

Now clear denominators.

polys = Numerator[Together[rats]]

We want a relation in {x,y,z}, eliminating everything else.

vars = {x,y,z};
elims = Complement[Variables[polys],vars];

InputForm[implicit = First[GroebnerBasis[polys, vars, elims,
   MonomialOrder->EliminationOrder]]]

Out[5]//InputForm=
x^2 - 2*x^4 + x^6 + 2*x^2*y^2 + 2*x^4*y^2 + x^2*y^4 + z^2 - 2*x^2*z^2 +
  x^4*z^2 + 2*y^2*z^2 + 2*x^2*y^2*z^2 + y^4*z^2 - z^4

The plots below show some reasonable similarity.

ContourPlot3D[implicit, {x,-5,5}, {y,-5,5}, {z,0,40},
  Contours->{0}, ContourShading->False]

ParametricPlot3D[{Sin[la]/Cos[fi], Tan[fi]*Cos[la],
   Sqrt[Sec[fi]^4-Sec[fi]^2*Sin[la]^2]}, {fi,-Pi/2,Pi/2}, {la,-Pi,Pi}]


Daniel Lichtblau
Wolfram Research


  • References:
  • Prev by Date: Re: Opening a foreign file from Mathematica
  • Next by Date: LocatorPane problem
  • Previous by thread: Re: Contours plot
  • Next by thread: Log Error