I am having trouble fitting this curve - Does anyone know what a good equation to fit could be?

74 Views Asked by At

I have the following plot:

enter image description here

It represents the production of electricity of a turbine as a function of flow.

I am trying to fit a curve to it. The best I got was:

Production = -1591.5 * Flow + 38141.6 * Flow/sqrt(Flow)

But the fit is not that good when I plot the fitted and the real values on the same plot, especially not for really small or big values of flows.

Can anyone recommend me a better way to fit my production ?

enter image description here

Here is the data:

https://www.dropbox.com/s/hwf1gk4x3xbidee/table.csv?dl=0

2

There are 2 best solutions below

3
On BEST ANSWER

If the function does indeed level out to a constant, then it looks like you have two decaying functions that are overlapping plus an additive constant. One of the functions decays more quickly, and one decays more slowly. For example:

Unfortunately, I was unable to to download your data into my preferred curve-fitting software, but hopefully you can figure out how to apply these functions on your own. Note that the second of these functions is not a "linear" regression, since the free parameters $\alpha$ and $\beta$ do not enter into the function linearly.

0
On

You can go for broke on questions like this. The fact is, there's no one function that's going to be "the best". There are measures of the goodness of fit, such as the coefficient of determination, $R^2$; it's useful, but not the end-all, be-all. You should always plot your residuals. For example, in Excel, I found that a fourth-order polynomial wasn't too awful bad: $$\operatorname{prod}=-0.0029\operatorname{flow}^4+1.2195\operatorname{flow}^3 -175.89\operatorname{flow}^2+9889.9\operatorname{flow}+7797.1$$ with $R^2=0.4024.$ An $R^2$ closer to $1$ would be better, certainly, but this function captures the basic shape, I think. Now if you plot the residuals, you're looking to make sure there's no definite pattern (thus indicating your model is leaving something out). I've got the basic plot plus the residuals shown here:

Fit and Residuals

You can see that there's definitely a pattern, mostly corresponding to the small cluster of points originally located near $\operatorname{flow}=17,\;\operatorname{prod}=25000.$

So you could certainly do better than this. But this will hopefully get you started. What you're doing is called linear regression, but a proviso: it's called linear even if you're fitting odd shapes like polynomials or exponentials to your data. It's linear because the coefficients show up in a linear fashion.