Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Trying to fit data to a curve and getting "OptimizeWarning: Covariance of the parameters could not be estimated " scipy

$
0
0

I have some experimental data from a wind tunnel and I'm trying to fit a curve to this data and determine the x-intercept from it but cannot seem to get it to fit properly.

Plot of my experimental data:

Plot of my experimental data

Desired plot:

Desired plot

My Arrays for x and y are as follows below:

x = [0.05068111 0.04818916 0.04882654 0.05214874 0.05944521 0.07145887 0.0815519  0.09417571 0.11834393]y = [0.0963202  0.22971568 0.36601308 0.50110841 0.63746987 0.77172614 0.85511004 0.90326404 0.94890827]x = CD[3:12]y = CL[3:12]print(x)print(y)def fit_func(x, Cdmin, k1, Clmind):    return ((x-Cdmin)/k1)**0.5 + Clmindparams = curve_fit(fit_func, x, y)[Cdmin, k1, Clmind] = params[0]print([Cdmin, k1, Clmind])

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>