Algorithms - POSOCO/wind-forecast GitHub Wiki
Using Wind Forecast and installed capacity
- Let a generating plant have an installed capacity of
I1
MW. - Let the speed of wind at a particular instant of time be
v1
Km/hr - Then the power generation
g1
per unit installed capacity would be a function of v1 and I1 as follows
g1 = (a1*v1^3 + b1*v1^2 + c1*v1 + d1) = f1(v1)
and so the total plant generation would be
G1 = g1*I1 = f1(v1)*I1
- Now using historical data of wind speeds, plant generation for say 1 month, we can use polynomial regression to derive the values of
a1, b2, c2, d2
- Hence we have fit a polynomial regression model to convert a plant wind speed to MW
- Using weather forecast APIs we can get the wind speed at the generating plant for tomorrow
- We will feed this wind speed to the regression model and derive the MW generation for tomorrow
- For a complete state, we can add all the generator equations to get the state wind energy
- Therefore State wind energy is
G = G1 + G2 + ... + Gn = f1(v1)*I1 + f2(v2)*I2 + f3(v3)*I3 + ... + fn(vn)*In
Using Historical Data
- Let us take last k days for forecasting
- Calculate n-1 to n-k days avg_mw and do weighted average to forecast nth day avg_mw
- Calculate 'block mw factor' as 'block mw/day avg mw' for n-1 to n-k th days
- Calculate 'block mw factor' of nth day as weighted avg of block mw factors of n-1 to n-k days
- Calculate the 'forecasted block mw of nth day' as block mw factor of nth day * forecasted nth day avg mw
- If forecast error in the recent 3rd block is greater than 150 MW, then add the error50% to the forecasted value. But if error50% is greater than 20% of forecasted value, limit the correction to forecast*20%
- Special thanks to Shri Janardhan Reddy Asudi of SRLDC for sharing this algorithm with us
Pseudo Code for historical day ahead forecast (Runs every day once at 00 hrs)
- Initialize k, n, n_blocks, same_day_forecast_error_threshold_mw, error_influence_perc, same_day_forecast_modify_threshold_perc
- Initialize day_avg_mw_weights_array[n-k], block_mw_weights_array[n-k]
- Fetch MW[n-k][n_blocks] values for k days for all n_blocks
- For 1 to k;
AVG_MW[n-k] = Sigma(MW[n-k][n_blocks])/n_blocks
- Calculate
AVG_MW_N = Sigma(AVG_MW[n-k] * day_avg_mw_weights_array[n-k])/Sigma(day_avg_mw_weights_array[n-k])
- For 1 to k; For 1 to n_blocks;
BLOCK_MW_FACTOR[n-k][n_blocks] = MW[n-k][n_blocks]/AVG_MW[n-k]
- For 1 to k; For 1 to n_blocks;
BLOCK_MW_FACTOR_N[n_blocks] = Sigma(BLOCK_MW_FACTOR[n-k][n_blocks] * block_mw_weights_array[n-k])/Sigma(block_mw_weights_array[n-k])
- For 1 to n_blocks;
MW_N[n_blocks] = BLOCK_MW_FACTOR_N[n_blocks] * AVG_MW_N
Pseudo Code for historical same day forecast correction (runs at each block)
- For 1 to current_block - 1; Fetch ACTUAL_MW_N[current_block - 2]
- Calculate
forecast_error = Absolute(MW_N[current_block - 2] - ACTUAL_MW_N[current_block - 2]))
- If forecast_error > same_day_forecast_error_threshold_mw continue else return
- Calculate
correction[n_block] = Math.Min(forecast_error*error_influence_perc*0.01, MW_N[n_block]*same_day_forecast_modify_threshold_perc*0.01)
- Calculate
forecasted_MW_N[n_block] = MW_N[n_block] - correction[n_block]