《风力发电机功率曲线统计MATLAB代码实现(共4页).docx》由会员分享,可在线阅读,更多相关《风力发电机功率曲线统计MATLAB代码实现(共4页).docx(4页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、精选优质文档-倾情为你奉上风力发电机功率曲线统计MATLAB代码实现function windspeed_avr active_power_dev windspeed_fin_avr active_power_fin_avr CP= Powercurve_cal_v03(filename1,filename2,filename3,filename4)%读取excel的xlsx文件% B列为功率 C列为风速data1=xlsread(filename1,1,B2:C52000);data2=xlsread(filename2,1,B2:C52000);data3=xlsread(filename
2、3,1,B2:C52000);data4=xlsread(filename4,1,B2:C52000);%将四个Excel表合成一个表格data=data1;data2;data3;data4;% 对数据进行筛选 风速3m/s 功率=3 & data(j,1)=10 data_opt(j,1)=data(j,2); data_opt(j,2)=data(j,1); endend%对风速和功率进行排序并返回索引windspeed,ind=sort(data_opt(:,1);% 求0.5m/s的时间间隔的平均风速和相对应的平均功率,标准差m=length(ind);k=0;u=0;h=0;win
3、dspeed_sum=0;active_power_sum=0;windspeed_avr=0;active_power_avr=0;active_power_error_sum=0;windspeed_fin_sum=0;active_power_fin_sum=0;P=1.062;A=pi*(88/2)2;for windspeed_num=3:0.5:19.5 for i=1:1:m %初步计算平均风速和平均功率 active_power(i)=data_opt(ind(i),2); if windspeed(i)=windspeed_num & windspeed(i)=windspe
4、ed_num & windspeed(i)=windspeed_num & windspeed(i)windspeed_num+0.5 e=abs(active_power(i)-active_power_avr(q)/active_power_dev(q); if e=4 u=u+1; windspeed_fin_sum=windspeed_fin_sum+windspeed(i); active_power_fin_sum=active_power_fin_sum+active_power(i); end end windspeed_fin_avr(q)=windspeed_fin_sum
5、/u; active_power_fin_avr(q)=active_power_fin_sum/u; %计算发电机功率系数 CP(q)=1000*active_power_fin_avr(q)/(0.5*P*A*(windspeed_fin_avr(q)3); end windspeed_sum=0; active_power_sum=0; active_power_error_sum=0; windspeed_fin_sum=0; active_power_fin_sum=0; k=0; h=0; u=0;end%画出初步平均风速和平均功率的曲线figure plot(windspeed_
6、avr, active_power_avr,r .-);set(gca,xtick,0:1:20)set(gca,ytick,0:100:1600)grid onxlabel(windspeed_avr m/s)ylabel(active_power_avr (kW)title(power curve)%画出标准差的曲线figure plot(windspeed_avr,active_power_dev,g .-);%bar(2*windspeed_num+0.5)/2,active_power_dev);set(gca,xtick,0:1:20)set(gca,ytick,0:20:200)
7、grid onxlabel(windspeed_avr m/s)ylabel(active_power_dev)title(power standard deviation)%画出最终的平均风速和平均功率曲线figure plot(windspeed_fin_avr, active_power_fin_avr,k .-);set(gca,xtick,0:1:20)set(gca,ytick,0:100:1600)grid onxlabel(windspeed_fin_avr m/s)ylabel(active_power_fin_avr (kW)title(final power curve)
8、%画出最终的发电机功率系数figure plot(windspeed_fin_avr,CP,m .-);set(gca,xtick,0:1:20)set(gca,ytick,0:0.1:0.6)grid onxlabel(windspeed_fin_avr m/s)ylabel(active_power_dev)title(CP系数)%画出采集的散点图figure plot(data(:,2),data(:,1),.);set(gca,xtick,0:1:22)set(gca,ytick,0:100:1600)grid onxlabel(windspeed m/s)ylabel(active_power)title(power point )专心-专注-专业