Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exponential growth curve-fitting

Status
Not open for further replies.

dww123

Computer
May 22, 2007
2
Hi, i have got a bunch of data points, which i want a curve fitted to. The function for the curve is y= b*a^x . Now, i have tried genfit and expfit, but they find coeffs for y=a*e^(b*x) and y=b*x^b. How do get the coeffs for y= b*a^x?
 
Replies continue below

Recommended for you

I think genfit works. Can you list the elements of your function vector?
 
well i didnt really know what elements to put in, can u help?
 
The first element of the function vector is the form of your solution: u1*u2^x, where u1 and u2 are two elemnts of an array

The second element is the first derivative of the first element with respect to the first variable: u2^x

The third element is the first derivative of the first element with respect to the second variable: u1*x*u2^x-1

Here's how the function vector looks. I included the "[" below as that's what you type to get the subscript. The "T" at the end denotes a transposed array.

F(x,u)=(u[1*(u[2)^x (u[2)^x u[1*x*(u[2)^x-1))T
p=genfit(vx,vy,g2,F)
vx and vy are your data point vectors
g2 is a two element guess
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor