MathGroup Archive 2002

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

Search the Archive

Re: Vector field with ImplicitPlot ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg37417] Re: [mg37377] Vector field with ImplicitPlot ?
  • From: Selwyn Hollis <selwynh at earthlink.net>
  • Date: Sun, 27 Oct 2002 06:33:18 -0500 (EST)
  • References: <200210250648.CAA18194@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

The vector field you want is {D[e[x,v],v], -D[e[x,v],x]}, (or its 
negative, depending what direction you want). The following adds this 
vector field to your implicit curves.


   <<Graphics`ImplicitPlot`;
   <<Graphics`PlotField`;

(* example input: *)
              V[x_] := x^3 - x;
              rect = {{-2, 2}, {-2, 2}};

   e[x_, v_] := (1/2)*v^2 + V[x];

   t3 = Table[e[x, v] == e1, {e1, 0, 1, 0.2}];

   vecfld = {-D[e[x, v], v], D[e[x, v], x]};

   {x1, x2} = First[rect];
   diag = rect[[2,2]]-rect[[1,1]];
   {{xb1, xb2}, {vb1, vb2}} = rect + .05*diag*{{1, -1}, {1, -1}};

   curves = ImplicitPlot[Evaluate[t3], {x, x1, x2},
      DisplayFunction -> Identity];
   vecs = PlotVectorField[vecfld, {x, xb1, xb2}, {v, vb1, vb2},
      DisplayFunction -> Identity];
   Show[curves, vecs, PlotRange -> rect,
      DisplayFunction -> $DisplayFunction];


---
Selwyn Hollis



Madhusudan Singh wrote:
> I wish to do plot a vector field plot of an implicit solution.
> 
> Equations :
> 
> (*V[x] is a polynomial function defined earlier *)
> e[x_, v_] := 1/2 v^2 + V[x];
> t3 = Table[e[x, v] == e1, {e1, 0, 1, 0.2}];
> ImplicitPlot[Evaluate[t3], {x, \(-2\), 2}];
> 
> This plots a nice implicit plot for various values of e1. What I wish to do is to attach a 
> "sense" to the contours (an arrow that describes the direction of the orbit).
> 
> However, I am at a loss as to how to do it with PlotVectorField.
> 
> Any help would be appreciated.
> 
> PS : Is there a way in which I can "automate" the labelling of the curves with the values 
> of e1 they are plotted for (something better than manually editing the labels to the plot 
> each time I change the range of e1) ?
> 




  • Prev by Date: RE: The N function and precision
  • Next by Date: FW: Re: To plot solutions, FindRoot as a function
  • Previous by thread: Vector field with ImplicitPlot ?
  • Next by thread: Vector field with ImplicitPlot ?