# Continuous superposition of bump functions

I am trying to "model" Fig 2 with a superposition of a bump function. I understand that bump functions are bounded and can be often differentiated. The bump function I have used is shown in Fig 1.

My bump function:

$$f(x)=exp\left(\frac{x^2}{x^2-L^2}\right)$$

$L$ varies from $-\pi$ to $\pi$ and produces the plot below (FIG 1):

FIG 2What I am trying to model through a superposition of such bump functions ALSO AVAILABLE HERE:

What kind of superposition of bump functions will I need? I have tried fractional additive superpositions such as:

$$f(x)=exp\left(\frac{x^2}{x^2-L^2}\right) +0.01 exp\left(\frac{(x+2)^2}{x^2-L^2}\right)$$

$\ldots$ but that didn't work!

EDIT 1: Per fgp's comment below:

$L$ is a constant. In my plot $x$ ranges between $-L$ to $L$. I used Mathematica to do this plot and the code, in case anyone is interested is:

L=\[Pi];
f= Exp[x^2/(x^2-L^2)]
Plot[
f,
{x,-L,L}
]


EDIT 2: In an attempt to "scale and translate" as per Henning Malkholm, I produced this monstrosity which is not quite correct

$$a \exp \left(\frac{(2 x+3 \pi )^2}{(2 x+3 \pi )^2-(3 \pi )^2}\right)+a \exp \left(\frac{(2 x-3 \pi )^2}{(2 x-3 \pi )^2-(3 \pi )^2}\right)+\exp \left(\frac{x^2}{x^2-L^2}\right)$$

The scale factor a did not make too much of a difference as a number. I suppose I would need a function a=a(x) to do this.

Any ideas at this stage would be appreciated.

• You seem to be confused about what you independent variable is supposed to be. You define the bump function as $f(x) = \ldots$, but then say "L varies... " when describing the plot. Which is it? – fgp Apr 7 '14 at 18:28
• @fgp apologies. On a semi regular basis, the engineer in me murderizes the mathematician. The x varies from 0 to L. I hope that provides clarity? – dearN Apr 7 '14 at 19:00
• That murderous engineer has killed again, I fear... I think you mean $x$ varies from $-L$ to $L$... – fgp Apr 7 '14 at 19:02
• @fgp yes. Thank you for catching that. Working on translation as suggested by Henning Makholm below. – dearN Apr 7 '14 at 19:08

How about just scaling and translating?

$$g(x) = f(x) + af(2x-3\pi) + af(2x+3\pi)$$ where $f$ is your original bump function, for some appropriate coefficient $a$.

If that "doesn't work", you'll need to define "works" more clearly and tell us how it doesn't work.

Edit after question was updated: I see what's happening. Your bump function should actually be

$$f(x) = \begin{cases} \exp\left(\frac{x^2}{x^2-L^2} \right) & \text{when } |x|<L \\ 0 & \text{when } |x|\ge L\end{cases}$$

Outside the interval $(-L,L)$ the first expression will give you large numbers that are not part of the bump, so you need a piecewise definition to get rid of them.

• @HenningMalkholm That was a good idea and I tried it. It would seem that the coefficient a would need to be a "curvature" type term? Right now I have discontinuities in my plot. See updated question. Thank you for your input! – dearN Apr 7 '14 at 19:20
• @drN: No, $a$ is just a constant -- but you need to explicitly suppress the part of the bump function that is outside the support. – Henning Makholm Apr 7 '14 at 19:48
• @HenningMakhold Yes I thought about a piecewise function but decided against it in case in is not "discretized" correctly with finite difference schemes and such. The pcw/s function, however, needs to be three part and I tried that (will include code soon) with no success! – dearN Apr 7 '14 at 21:52
• @drN: Bump functions do need to be piecewise defined -- there's no getting around it. – Henning Makholm Apr 7 '14 at 22:19
• I forgot to add that with the pcw/s function you have recommended, I will have only one "bump". I am looking at getting a central bump and "satellite" bumps of smaller amplitude around it. I believe these are called compactons. – dearN Apr 7 '14 at 23:07