MathGroup Archive 2001

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

Search the Archive

Re: Bump Function


> 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