Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Limiting range of variables when defining funxtions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74703] Re: [mg74676] Limiting range of variables when defining funxtions
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Sun, 1 Apr 2007 04:16:40 -0400 (EDT)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200703310627.BAA02986@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

Here's one way:  Multiply your function by Boole[expr], where expr gives 
the restrictions.  For example:

Plot3D[Boole[0<=x && 0<=y<=1-x](x^2-y^2), {x,-1,1},{y,-1,1}];

Michelasso wrote:
> Hello everybody,
> my problem is that I would like to plot a 3d graphic of a function of
> two variables, restricted to domain D={(x,y): x>= 0, y>=0, y <= 1-x}.
> 
> I thought to define the function in this way:
> test[x_,y_/; y <= 1-x]:= x+y
> 
> but this seems not to work, while it works for functions of one
> variable, i.e.:
> test2[x_/; x<= 1]:= 3x
> 
> So, am I doing some syntax error, or is there some other kind of
> problems with my definition?
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Limiting range of variables when defining funxtions of several
  • Next by Date: Re: How to set SVD options?
  • Previous by thread: Re: Limiting range of variables when defining funxtions
  • Next by thread: Simplification with Integers assumption