I have a data set with y and x. I have an equation that I want to fit this data to y=a/b(1-e^bx).
Can someone tell me how do I plot the data to this equation to get the constants a and b.
For a better explanation:
Generally when we are given x and y, we can plot this data and use either excel or mathematica etc to get either a linear, polynomial or exponential fit. From those fitted equations we can extrapolate data.
In this case, I have a small data set, and I know the function that I want the data to be fit in. From the fit data I want to get the constants in the equation so that I can extrapolate the data.
When I take the ratio of 2 x and 2 y’s, I get the following equation to solve
-36 - 23.1 e^(-39.36 b) + 59.1 e^(-19.38 b) == 0, b
but
Solve was unable to solve the system with inexact coefficients or the
system obtained by direct rationalization of inexact numbers present
in the system. Since many of the methods used by Solve require exact
input, providing Solve with an exact version of the system may help.
In Mathematica, the base of the natural log is E, not e.
In[1]:= eq = -36 - 23.1 E^(-39.36 b) + 59.1 E^(-19.38 b) == 0;
In[2]:= sol = Solve[eq, b, Reals]
During evaluation of In[2]:= Solve::ratnz: Solve was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result. >>
Out[2]= {{b -> -0.0209738}, {b -> 0.}}
In[3]:= eq /. sol
Out[3]= {True, True}
However, it would help you get a good response if you would post your code and data. Attaching a notebook and a spreadsheet or CSV file would be good.