MathGroup Archive 2012

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

Search the Archive

Re: How to draw several contours for one function, while


Without knowing the functions it is difficult to guess the best way to
show what you might want to see. Manipulate may be a better way than
Animate to examine what is going on.

Manipulate[
 pts = {x, y} /.
   Solve[{
     f[x, y, a] == intersect,
     g[x, y, a] == 0},
    {x, y}, Reals];
 Show[
  ContourPlot[f[x, y, a],
   {x, -8, 8}, {y, -8, 8},
   Contours -> Range[0, 75, 15],
   ContourStyle -> Hue /@ (.7 Range[0, 1, 15/75] + .15),
   ContourShading -> None,
   ContourLabels -> All],
  ContourPlot[g[x, y, a] == 0,
   {x, -8, 8}, {y, -8, 8},
   ContourShading -> None,
   ContourLabels -> All],
  Graphics[{Red, AbsolutePointSize[4],
    Tooltip[Point[#], #] & /@ pts}],
  PlotRange -> {{-8, 8}, {-7, 8}}],
 {{a, 0}, -5, 5, .5, Appearance -> "Labeled"},
 {{intersect, 0}, 0, 75, 5, Appearance -> "Labeled"},
 Initialization :> {
   f[x_, y_, a_] = (x - a/2)^2 + (y - a/4)^2 - 2,
   g[x_, y_, a_] = x + y - a}]


Bob Hanlon


On Tue, Aug 14, 2012 at 4:24 AM,  <loveinla at gmail.com> wrote:
> Dear all,
>
> Suppose I have two implicit functions, say, F(x, y) and G(x, y); both involve a parameter a.
>
> In one Animate, I need:
>  (1) several contours for function F(x, y) with its Max and Min values;
>  (2) only one contour for function G(x, y)==0.
>  (3) because I need to see how they change as parameter a changes, I want to use Animate to generate animation.
>
> Can anybody help? Thanks.
>



  • Prev by Date: Re: Simplify
  • Next by Date: Re: Find Position of many elements in a large list.
  • Previous by thread: How to draw several contours for one function, while only one contour
  • Next by thread: Re: How to draw several contours for one function, while