0

I haven't done some math in a long long time... I've been trying to find an exponentially decreasing function (instead of a linear one that's easy) bound by 2 known points (x1,y1), (x2,y2), as below: enter image description here

I've been trying to play with functions like f(x)=a*b^(k*x)+c, unsuccesfully. It's easy to guess that b effects the depth of the curve. But that leaves a, k and c to find.

Syffys
  • 101
  • 2
  • Your figure is not an exponential. – David G. Stork Feb 05 '21 at 21:05
  • If you knew that $c=0$, then you could find a unique exponential – WW1 Feb 05 '21 at 21:14
  • The definition of exponential functions found on Wikipedia does insist that $c=0$

    https://en.wikipedia.org/wiki/Exponential_function

    – WW1 Feb 05 '21 at 21:21
  • Indeed, Sorry about that ? How would you call it then ? – Syffys Feb 05 '21 at 21:43
  • Two points is not enough to define an exponential curve. I would think you need a minimum of 3. However, you could find an exponential curve that fits two. As Mr. Stork noted, your curve does not really look exponential. – KenM Feb 05 '21 at 22:35
  • Thanks for your comment ! I understand your points.To be honest, my question is more driven by a practical usecase rather than mathematical naming accuracy. – Syffys Feb 05 '21 at 23:42
  • I'm happy to include any suggestion though ! – Syffys Feb 06 '21 at 00:02

1 Answers1

1

If we consider $f(x)=ae^{kx}+b$, (where $e$ is Euler's Constant), then we have 3 free parameters and we are solving for two points, so there are actually infinitely many solutions. We can let the function go through the first point by setting

$$b=y_1-ae^{kx_1}$$

for any $a,k$. It remains to find values such that

$$y_2=ae^{kx_2}+b=ae^{kx_2}+(y_1-ae^{kx_1})$$

and so

$$y_2-y_1=a(e^{kx_2}-e^{kx_1})$$

hence, we can choose

$$a=\frac{y_2-y_1}{e^{kx_2}-e^{kx_1}}$$

and $k$ can still be whichever value we like.

GossipM
  • 405
  • Your answer gave me a good hint to push further. It seemed to give roughly the expected result, but I had trouble programming this as it quickly caused memory overflows with great distance between the 2 points. Hence I tweaked it a bit to obtain the same result with smaller numbers. I ended up with this: $$f(x)=(y_2−y_1)\frac{e^{k\frac{x−x_1}{x_2−x_1}}-1}{e^k−1}+y_1$$ – Syffys Feb 06 '21 at 10:58