# Can you determine this function?

1. Feb 7, 2014

### Fjolvar

Help please - I can't determine this function.

Okay I will try to make this as straightforward and clear as possible. My calculus background is rusty because it's been awhile, so this may seem trivial.

I am trying to find a function that can best fit the shape of the red curve shown in the attached figure. I need to be able to choose the y-intercept and increase/decrease the maximum point value marked as "1" on both the y and x-axis location. I also need to be able to increase/decrease the length/x-value of the end portion of the curve marked as "2."

I have so far tried playing with quadratic functions, a sine wave (from 0 to π), and a double exponential. No luck so far. I would greatly appreciate any advice on this seemingly simple problem.

#### Attached Files:

• ###### Function.png
File size:
1.7 KB
Views:
62
Last edited: Feb 7, 2014
2. Feb 7, 2014

### Staff: Mentor

Maybe this 4 parameter fit will work:

$$y_0+a\frac{x}{L}\left(1-\frac{x}{L}\right)\left(1+c\frac{x}{L}\right)$$

3. Feb 7, 2014

### Fjolvar

Hmm I've been playing with this equation, but not having too much luck. Could you explain it? :)

4. Feb 7, 2014

### Staff: Mentor

The first term is the value at x = 0. The parameter x=L is what you call point 2. Note that the function values at the x = 0 and x = L are both the same, as shown on your figure. The parameter a adjusts the height of the peak (along with the parameter c), and the parameter c moves the location of the peak around between x = 0 and x = L.

5. Feb 7, 2014

### a_potato

Maybe an even polynomial fit? Quartic or order 6? Course you may need a few more points to constrain it...

6. Feb 7, 2014

### Staff: Mentor

OK. I figured out an even better functional form than this previous one to try that I think you'll like much better:

$$y_0+a\frac{x}{L}\left(1-\frac{x}{L}\right)e^{c(\frac{x}{L})}$$

If c = 0, the maximum will be at x = L/2. If c < 0, the maximum will be at x < L/2, and if c > 0, the maximum will be at x > L/2. This functional form will guarantee one maximum and no minima (or negative values) between x = 0 and x = L.

Chet