MathGroup Archive 2001

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

Search the Archive

Re: Bump Function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31976] Re: Bump Function
  • From: Adam Smith<adam.smith at hillsdale.edu>
  • Date: Fri, 14 Dec 2001 16:53:05 -0500 (EST)
  • References: <9vchll$3mm$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I suspect that you actually want:
f(x,y)	= x^2+y^2 for  x^2+y^2<1 
= 2  for x^2+y^2 >1
because as written the function is not defined for 1 <= x <=2

This is straightforward using the Which command to define and the Plot3D command
to display:

f[x_, y_] := 
Which[x^2 + y^2 <= 1 , x^2 + y^2 , x^2 + y^2 > 1, 2] 
Plot3D[f[x, y], {x, -3, 3}, {y, -3, 3}]

I wonder if you want to let f(x,y) = 1 for x^2+y^2>1.  Otherwise your "bump"
jumps suddenly from 1 to 2 at x^2+y^2 = 1.  Also, as written the "bump" goes
downward and the default view settings make it difficult to see.  Below are some
other examples that you might find helpful in figuring out the options in
Plot3D.  Note:  I let f(x,y) = 1 for x^2+y^2>1.

f[x_,y_] := 
Which[x^2+y^2<=1 ,x^2+y^2 , x^2+y^2 >1,1] 


Plot3D[f[x,y],{x,-3,3},{y,-3,3},ViewPoint->{1.323, -2.540, -1.932}]
Plot3D[-f[x,y],{x,-3,3},{y,-3,3}]
Plot3D[-f[x,y],{x,-3,3},{y,-3,3},PlotPoints\[Rule]50,Mesh\[Rule]False]

In article <9vchll$3mm$1 at smc.vnet.net>, Ajitkumar says...
>
>Hi,
>
>Could  somebody tell me how to plot the graph of bump functions. For
>example, if I want to draw the graph of the function say,
>
>f(x,y)	= x^2+y^2 for  x^2+y^2<1 
>	= 2  for x^2+y^2 >2
>
>
>Thanks 
>Ajit Kumar      
>Dept of Maths             
>University of Mumbai
>Vidyanagari, Kalina 
>Mumbai 400 098 	
>India 	
>Phone No. +91 652 6683
>Email- ajitkumar at math.mu.ac.in
>       ajit_kumara at hotmail.com
> http://math.mu.ac.in/faculty/scholars/ajit.html   
>
>

Adam Smith
Dept. of Physics
Hillsdale College
adam.smith at hillsdale.edu


  • Prev by Date: Re: Bump Function
  • Next by Date: ShowProgress in NonlinearFit
  • Previous by thread: Re: Bump Function
  • Next by thread: Re: Bump Function