Find y values along decaying exponential curve that has defined points

109 Views Asked by At

This is a programming issue I have where I need to be able to retrieve the y value at the specific x point of a decaying exponential curve. The limits of the curve are set as 0,2.44 and 50000,1.31 and I would potentially like to be able to change the decay.

Simple example of the decaying exponential curve

I believe the equation for this y=a(1-b)^x described as:- "y" is the final amount remaining after the decay over a period of time "a" is the original amount "x" represents time The decay factor is (1–b). The variable, b, is the percent change in decimal form.

I think the b value needs to be a gradually reducing percentage (which is what the exponential is anyway, but the drop needs to be fairly sharp to start off with and then tail off).

I think that if I can work out the formula for this, then I can put into programming language and may I offer my sincere apologies if I am not making myself clear - it has been a long time since I worked on my A level maths !

1

There are 1 best solutions below

2
On BEST ANSWER

In your decay equation $$ y = a(1-b)^x $$ the variables are $x$ abd $y$. The value of $b$ is fixed. It represents the constant delay as a percentage as $x$ changes. For example, if $x$ is measured in days then $b = 0.1$ describes a $10\%$ daily decrease (compounded continuously). At the end of each day you have $1 - b = 0.9 = 90\%$ of what you started.

Since you know two points $(x,y)$ on the curve you can plug them into the equation and get two simultaneous equations to solve for the constants $a$ and $b$.

You might find that easier if you take logarithms first: $$ \log(y) = \log(a) + x \log(1-b). $$