Solution to force a polynomial curve to end at a specific location I require a solution (Python if possible) to force a polynomial to end at a specific point. I have read the solutions offered here to a similar question but have been unable to get any of these methods working on my data set as they are not defining end points but locations for a polynomial to pass through.
I therefore require a solution to force a polynomial curve to end at a specific location.
To put this in context the example that I need this for is shown in the image below, I require a line of best fit for the data below, the green points represent the raw data and the pink points are the mean of the green points for every x value. The best fit should be a 3rd order polynomial until the data becomes a horizontal linear line. The black line is my current attempt at a line of best fit using np.ployfit(), I have defined the polynomial to only plot until the location where I would then start the linear best fit line but as you can see the tail of the polynomial is far too low and hence I want to force it to end/go through a specific point.

Additional Information Added The rated power of the turbine is 280kW so this is the max power which you can get out of it regardless
  of how high the wind speed is. There is also a cut in windspeed of
  3m/s before this the turbine isn't generating any electricity and a
  cut out of 25m/s to prevent oil temperatures overheating in the
  gear box and mechanical failure occurring the turbine shuts down. The data seen plotted below is for a single turbine and the mean wind speed is the average in all directions. SCADA data - Supervisory control and data acquisition is just data that is automatically recorded in this case every ten minutes from the turbines internal sensors and logged in a database. EGen Mean as can be seen plotted on the graph is simply the mean of the electricity generated for each distinct windspeed. It is from these means that I attempted to plot the line of best fit.

I am open to all options to get a nice mathematically sensible best fit as have been banging my head against this problem for too long now.
 A: Estimating the power curve of a wind turbine is much more complicated than it looks at first sight, and I don't envy you for having to deal with that :P I'll try to help, but keep in mind that, as confirmed by reading the literature, the correct answer depends a lot on context, and you're the one who knows your turbines better.
So, first of all, as noted in the comments:


*

*the V-P (wind speed-power) curve is nonlinear, with a sigmoidal shape: it flattens out below the cut-in speed, at the rated power and it doesn't extend beyond the cut-out speed.  

*wind speed actually explains just a moderate part of power variability: if you don't add other predictors, the residual variance is bound to be large.

*the relationship is heteroskedastic, for various reasons: for example, you average the wind speed on all possible freestream wind directions. However, depending on the freestream wind direction, your turbine may or may not be in the wake of other turbines (if it's located on the boundary of the farm: if it's inside, it's always in some wake, but the freestream wind direction influences the extent and direction of the wake). Depending on the wake, the power generated by the turbine for the same wind speed changes drastically, and the change is larger for higher wind speed $\rightarrow$ heteroskedasticity.

*Last, but definitely not least, anyone who had to deal with SCADA data for wind turbines (which are 10-mins averages of the sensor data) knows how noisy they are.


So, where do we go from here? My suggestion is to forget about a power curve, add more predictors and concentrate on a power response surface. In this case useful additional predictors are wind direction $D$, temperature $T$, pressure $p$, humidity $H$, turbulence intensity $I$ and wind shear $S$. $T$ and $p$ are usually summarized as just density $\rho$, because  it's actually density which goes into the physical law of power generation:
$$P=\frac{1}{2}\pi C_P\rho R^2V^3$$
where $C_P$ is the power coefficient and $R$ is the turbine rotor radius. A well-performing approach to estimating the conditional expectation $E[P|V,D,\rho,H,I,S]$ is the kernel method described here:
Power Curve Estimation With Multivariate Environmental Factors for Inland and Offshore Wind Farms
A kernel plus method for quantifying wind turbine performance upgrades
Basically, let $\{(\mathbf{x_i},y_i)\}_{i=1}^N$ be your database of predictors-power couples. The idea is to use a slightly modified version of the Nadaraya-Watson kernel estimator
$$\hat{y}(\mathbf{x})=\sum_{i=1}^Nw_i(\mathbf{x})y_i$$
where 
$$w_i(\mathbf{x})=\frac{K_\lambda(\mathbf{x},\mathbf{x_i})}{\sum_{i=1}^NK_\lambda(\mathbf{x},\mathbf{x_i})}$$
Now, in the usual NW estimator, you would obtain the multivariate kernel by simply multiplying univariate Gaussian kernels for each predictor: 
$$K_\lambda(\mathbf{x},\mathbf{x_i})=\prod_{j=1}^6K_{\lambda_j}(x_j,x_{j,i})$$
with 
$$K_{\lambda_j}(x_j,x_{j,i})=\frac{1}{\sqrt{2\pi\lambda_j^2}}\exp\left(-\frac{(x_j-x_{j,i})^2}{2\lambda_j^2}\right)$$
However, this model suffers from the curse of dimensionality. The clever solution of the authors is, instead of using the product of 6 univariate kernels, to sum together 4 kernels, each one obtained by multplying together the univariate kernels corresponding to 3 variables, where the first two are always $V$ and $D$, and the third one is one of the remaining four, i.e., $\rho$, $H$, $I$, $S$. They end up with quite a few kernel bandwiths to estimate, which however you can estimate with various metrics, such as for example cross-validation. The only remaining difficulty is that $D$ is a circular variable, thus a Gaussian kernel doesn't make a lot of sense (it doesn't recognize that $D_i=1°$ and $D_i=358°$ are two very close directions). Fix this by using the von Mises kernel:
$$K_\nu(D,D_i)=\frac{\exp(\nu \cos(D-D_i))}{2\pi I_0(\nu)}$$
$\nu$ is the free parameter of the von Mises kernel, to be estimated from data, and $I_0(\nu)$ is the modified Bessel function of order 0.
If you definitely insist on performing univariate regression (which I don't recommend, but as said in the beginning, you're the only one that really knows your data), then you need to at least perform robust regression in order to take into account the heteroskedasticity. A reference:
A Bayesian Nonlinear Regression Model with Application to Wind Turbine Power Curve
Let me know what you end up doing, let's say I have personal reasons to be curious :)
A: Maybe I'm missing something, but there is no such thing as a polynomial with an end point. The x axis goes out to infinity, and the polynomial has a value for every x. As noted, you can force it through any particular (x0,y0), but it will continue to have changing y values at higher x values.
I'm thinking you need at least two functions, one for x < x0,  and a different one for x > x0. They can be forced to have the same slope at the crossover point. 
Alternatively, if you are OK with doing it all numerically, just apply a moving average filter to generate a smoothed y value for every x. Savitsky-Golay filter functions are pretty easy to use.
