MathGroup Archive 2005

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

Search the Archive

Re: Question about Plotting with boundary constriants


HUAFANG CUI wrote:
> Hi,
> 
> I have a question about plotting a 3d graph with some boundary constraints.
> 
> for example,
> 
> feasible area of function f(x, y) is 0 <= x <= 1 and 0 <= y <= 1-x.
> 
> Thanks alot.
> 
> HC
> 
Hi,

Have a look at the functions *Boole* (if you have Mathematica 5.1) or 
*UnitStep*. For example

First we define a function of two variables, say

In[1]:=
f[x_, y_] := Sin[x]^2 + Cos[y]

Then we plot it with your boundary conditions

In[2]:=
Plot3D[f[x, y]*Boole[0 <= y <= 1 - x], {x, 0, 1}, {y, -1, 1}];

Best regards,
/J.M.


  • Prev by Date: Re: lists of variables
  • Next by Date: Re: Question about Plotting with boundary constriants
  • Previous by thread: Re: free packages
  • Next by thread: Re: Question about Plotting with boundary constriants