# get value at a point on an exponential curve

I'm not super with math but I need to make a function in my web app to get the value of a point on a curve when I know the curve points that are set. Here is what I did, I put a set of point with the x and y set at the know points then did an exponential trend line with limits of 1.15 to 3 for the x value. The y value ranges from 0-1000. I get for the formula output from excel as

y = 5.3785e0.7204x
R² = 0.9898


Here are the points I have

x        y
10      3
25      2.95
50      2.75
100     2.5
200     2
300     1.5
1000    1.15


I short i need to have my web app say, what is the y value when x is 176. I know this is probably simple for you math guys but I'd be thankful the help. Cheers

-

## 2 Answers

Note that your text says y ranges from 0 to 1000 and x from 1.15 to 3, but your data is the reverse. When I plot it, the data doesn't fit an exponential at all. The last point is way off, with the rest fitting a straight line very well. If I had to use this data I would either throw away the point at 1000 or use a pair of linear fits, one from 10 to 300, and another from 300 to 1000.

The way to read your output from excel is $y=5.3785e^{0.7204x}$ and in the computer languages I have used you would write y=5.3785*exp(0.7204*x), but that can't be right because y increases with x while the data goes the other way. When I fit the data as presented to an exponential in excel, I get $y=2.7032e^{-.001x}$ and if I transpose x and y I get $y=10046e^{-2.054x}$

-
Yes your right this really doesn't fit an exponential function does it. Well those are the points.. um.. well i tried to adding 5.3785*exp(0.7204*A2) were A2 is a cell that is value of 10 so it should solve to 3 but it does not. I get 7233.00259.. for 2.7032*-EXP(0.001*A2) i get -2.730367612 .. all 3 you put don't seem to get the right number. The way i got the 5.3785e0.7204x was from the trend line. .. not she here. –  jeremy.bass Aug 28 '12 at 0:04

Using Octave, I used least squares to fit a line of the form $x \mapsto ax+b$ to the data points $(x_i, \ln y_i)$ above, and ended up with $a \approx -0.95815 \times 10^{-3}$, $b \approx 0.99445$. This corresponds to a model $y = K e^{\alpha x}$ where $\alpha = a \approx -0.95815 \times 10^{-3}$ and $K = e^b \approx 2.7032$.

So the model should be $y = 2.7032 e^{-0.95815 \times 10^{-3} x}$.

-
not 100% here but i used =2.7032*-EXP(0.95815*A2*10^-10*A2) in excell to test it were X is 10 expecting 3 but i got -2.7032000026 (A2 is the x) –  jeremy.bass Aug 28 '12 at 0:11
I have really no idea what you are doing. Why would you not use 2.7032*exp(-0.95815e-3*A2) (assuming $x$ is in A2)? I mean, where did the 10^10 and extra A2 come from? Also, you put the minus sign outside the exponential. –  copper.hat Aug 28 '12 at 0:14
well lol. i just put in what i thought you had but left a typo from the other anwser. I put 2.7032*exp(-0.95815e-3*A2) and got 2.677422978 where A2 = 10 .. so doesn't seem right. –  jeremy.bass Aug 28 '12 at 0:29
Well, I doubt you will get an exact match, and a value of 2.677 is not too bad compared to the expected 3? –  copper.hat Aug 28 '12 at 0:38
Well i don't really have a choice here to be close 10 has to come out to 3, 25 has to be 2.95 and 50 need to be 2.75 etc on the rest already noted. –  jeremy.bass Aug 28 '12 at 0:43