Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: Bump Function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31986] Re: Bump Function
  • From: atelesforos at hotmail.com (Orestis Vantzos)
  • Date: Sat, 15 Dec 2001 01:30:03 -0500 (EST)
  • References: <9vchll$3mm$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

> f(x,y)	= x^2+y^2 for  x^2+y^2<1 
> 	= 2  for x^2+y^2 >2
You have a gap between 1 and 2 where the function is not defined.
Hence you can not draw it there!
I will assume this is a typo, and let's say you want to define this
function:
f(x,y) = x^2+y^2 for x^2+y^2<1
and f(x,y) = 1 for x^2+y^2>=1
You can use patterns with conditions to translate literaly into
Mathematica:
f[x_,y_]/;x^2+y^2<1 := x^2+y^2
f[x_,y_]/;x^2+y^2>=1 := 1
Now you can plot f, just like any other function.
Orestis


  • Prev by Date: Re: numerical approximation to the diffusion equation in Mathematica?
  • Next by Date: Re: Can I clear all vaiables ?
  • Previous by thread: RE: Bump Function
  • Next by thread: Re: Bump Function