Get exponential function from two points

102 Views Asked by At

I am trying to use a math model to solve an electrical problem.

I have "something" described by a function of this type: f(x) = A [1 - e^B*x] where A and B are constants that I dont know.

What I know, is the value of x and f(x) in two points. But I need to find a generic solution, so I will call them: (X1,Y1) and (X2,Y2)

Is there any way to get equations (that can be solved by a computer) for A and B?

This is what I have tried:

f(X1) = A [1 - e^BX1]
f(X2) = A [1 - e^B
X2]
B = ln (1 - (Y1/A))/X1
B = ln (1 - (Y2/A))/X2
ln (1 - (Y1/A))/X1 = ln (1 - (Y2/A))/X2

But after some work I got here:

(1 - (Y1/A))^X2 = (1 - (Y2/A))^X1

And cant find no way to get an equation to A. Am I doing something wrong?

Many thanks!

1

There are 1 best solutions below

0
On

If I transform $(1 - (Y_1/A))^{X_2} = (1 - (Y_2/A))^{X_1}$ to $$(1 - (Y_1/x))^{X_2} - (1 - (Y_2/x))^{X_1}$$ and then plot in desmos.com for suitable values of $X_1,Y_1,X_2,Y_2$ the $x$ axis will be crossed, which gives the value of $A$.

Desmos will ask you to make "sliders" for $X_1,Y_1,X_2,Y_2$. This allows you to adjust the values of these constants with a GUI slider. Desmos will come up with high and low limits for the sliders, but you can click in the slider to change those limits, as well as the step size.

Here is a desmos graph with your (transformed) equation. I set the values of the sliders at a whim, and you can see if produces three values of $A$ for those settings. I suspect my values for the sliders is unrealistic, but if not it means that multiple equations can accommodate two "realistic" points.