MathGroup Archive 2004

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

Search the Archive

Re: 3D graphs with constraints

  • To: mathgroup at
  • Subject: [mg49785] Re: 3D graphs with constraints
  • From: Daniel Herring <dherring at>
  • Date: Sat, 31 Jul 2004 03:14:04 -0400 (EDT)
  • References: <cdj1p9$nap$>
  • Sender: owner-wri-mathgroup at

Mario Biondini wrote:
> In need to plot a function f[r,l] but only within the following domain 
> for r, and l: a<r<b and l < v/(pi*r^2) where a, b, and v are constants. 
> Any idea of how to do that.

Plot3D doesn't like that variable range on l...
Would something like the following work for you?

a = -1/2;
b = 1/2;
v = 2;
f[r_, l_] := Sin[r] Cos[l];
Plot3D[If[ l<v/(Pi*r^2), f[r, l], -10000],
	{l, 0, 40}, {r, a, b},
	PlotRange -> {{0, 40}, {-1/2, 1/2}, {-1, 1}},
	Mesh -> False, PlotPoints -> 100]

Basically, the added If statement sets the function to an invalid low 
level outside the region of interest.  The PlotRange option keeps this 
extreme low from ruining the scaling of the plot.  The other options 
allow for a visually pleasing edge.

Hope that helps,

  • Prev by Date: envelope of an oscillatory InterpolatingFunction
  • Next by Date: Re: Combining 2D graphs into a 3D graph
  • Previous by thread: 3D graphs with constraints
  • Next by thread: 7 equations and 7 unknowns (non-linear equations)