Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11362

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

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How to draw several contours for one function, while
Date 2012-08-15 07:39 +0000
Message-ID <k0fjnc$qba$1@smc.vnet.net> (permalink)
References <20120814082402.2D8BD6862@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


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@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.
>

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: How to draw several contours for one function, while Bob Hanlon <hanlonr357@gmail.com> - 2012-08-15 07:39 +0000
  Re: How to draw several contours for one function, while analysismath <loveinla@gmail.com> - 2012-08-16 06:06 +0000

csiph-web