Question: Fix the code % FIX ME To Make It run correctly. U se the Programming Language ---- > MATLAB Computing wind turbine output power with
Fix the code % FIX ME
To Make It run correctly.
Use the Programming Language ---- > MATLAB
Computing wind turbine output power with linear regression.
A wind turbine manufacturer provides the power produced by the turbine (outputPwrData) given various wind speeds (windSpeedData). A straight line fits the measured output power well for mid-range wind speeds (6-12 m/s). Use linear regression to fit a first-order polynomial (straight line) to estimate output power given a mid-range input windSpeed.
Isolate the measured values used for fitting:
Assign windSpeedFitData with windSpeedData in mid range of wind speeds (6-12 m/s)
Assign outputPwrFitData with outputPwrData in mid range of wind speeds (6-12 m/s)
Calculate the first-order polynomial coefficients that fits the isolated values:
Assign outputPwrCoefs with linear regression coefficients
Make use of coefficients to calculate the value of the polynomial at input windSpeed
Assign outputPwrEst with estimate calculated using linear regression coefficients


CHALLENGE ACTIVITY 6.2.1: Computing wind turbine output power with linear regression Your Function Save CReset MATLAB Documentation || function outputPowerEst = EstimateWindTurbinePowerMid range( windspeed ) 2 % EstimateWindTurbinePowerMid range: Estimate wind turbine output power 3 % using linea r regression in mid range of wind speeds (6-12 m/s). 4% Inputs: windspeed - wind speed for power estimate 6% 0ut puts: outputPowerEst - estimated output power using linear regression 8 9 101 % Measured values for wind speed and turbine output power windSpeedData = [ , 2, 4, 6, 7, 8, 9, 10, 12, 14, 16, 18, 26, 22, 24, 26, 28, 39 ]; % (m/s) outputPwrData= [ , , 14, 312, 546, 840, 1180, 1535, 2037, 2100, 2100, 12 13 14 15 16 17 18 19 20 21 2100, 2100, 2100, 2100, , , ]; % (kW) % Assign windSpeedFitData with windSpeedData in mid range of wind speeds (6-12 m/s) windSpeedFitData = windSpeedData; % FIXME % Assign outputPwrFitData with outputPwrData in mid range of wind speeds (6-12 m/s) outputPwrFitData-outputPwrData: % FIXME % Assign outputPwrCoefs with linear regression coefficients outputPvrCoefs-1; % FIXME 23 24 25 26 27 8 end % Assign outputPwrEst with estimate calculated using linear regression coefficients outputPowerEst=0; %FIXME Code to call your function C Reset 1 EstimateWindTurbinePowerMidrange(7.9)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
