       Re: Bump Function

• To: mathgroup at smc.vnet.net
• Subject: [mg31994] Re: [mg31967] Bump Function
• From: Daniel Lichtblau <danl at wolfram.com>
• Date: Sun, 16 Dec 2001 03:44:29 -0500 (EST)
• References: <200112140921.EAA03644@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Ajitkumar wrote:
>
> 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

Below is, I think, a standard sort of "bump" function wherein we take
the value 1 for 0<=r<=1, 0 for r>=2, and smoothly move from the plateau
to 0 when 1<r<2. Here I use 'r' to indicate radial distance. We start
with a helper function that rises smoothly from 0 and falls back
smoothly to zero.

b[r_] := Exp[-1/(r*(1-r))]
normalization = NIntegrate[b[s], {s,0,1}];

By integration we use the helper to fall smoothly from 1 to 0 as r goes
from 1 to 2.

bigB[r_] /; r>=2 := 0
bigB[r_] /; r<=1 := 1
bigB[r_] /; 1<r<2 := NIntegrate[b[s], {s,r-1,1}] / normalization

Now define the bump function in {x,y} using radial distance
Sqrt[x^2+y^2].

bump[x_,y_] := bigB[Sqrt[x^2+y^2]]

You can plot it as below.

Plot3D[bump[x,y], {x,-3,3}, {y,-3,3}, PlotPoints->50]

Daniel Lichtblau
Wolfram Research

```

• References:
• Prev by Date: Re:Sign of determinant
• Next by Date: Re: equations
• Previous by thread: Bump Function
• Next by thread: Re: Bump Function