《基于某Matlab的PV模型仿真小实验.doc》由会员分享,可在线阅读,更多相关《基于某Matlab的PV模型仿真小实验.doc(13页珍藏版)》请在课桌文档上搜索。
1、wordName: Yang , Vorname: Ying Student ID: 359144PV Assignment 1Exercise 1Code:%Exercise 1close allclear all%define input valuesDOY=172;TZ=2;lambda_g=13.2;fi_g=52.3;LT=6:1:20;%call function sundata to get sun enevation and azimuth Am, Ys, SAz = sundata(lambda_g,fi_g,TZ,DOY,LT);plot(SAz,Ys);xlabel(Az
2、imuth in degrees As);ylabel(Altitude Position in degrees Ys);title(Berlin(13.2,52.3) on 21.06.2013(172/365);grid on;Function sundata:function Am, Ys, SAz = sundata(lambda_g,fi_g,TZ,DOY,LT)%UNTITLED Summary of this function goes here% Detailed explanation goes hereJ=360*DOY/365;TEQ=0.0066+7.3525*cos(
3、J+85.9)*pi/180)+9.9359*cos(2*J+108.9)*pi/180)+0.3387*cos(3*J+105.2)*pi/180);delta=0.3948-23.2559*cos(J+9.1)*pi/180)-0.3915*cos(2*J+5.4)*pi/180)-0.176*cos(3*J+26)*pi/180); % delta units-degreefor k=1:1:15 TLT(k)=LT(k)-TZ+ (4*lambda_g+TEQ)/60; W(k)=(12-TLT(k)*15; Ys(k)=asin( cos(W(k)*pi/180)*cos(fi_g*
4、pi/180)*cos(delta*pi/180) +sin(fi_g*pi/180)*sin(delta*pi/180) )*180/pi; SunA(k)=acos( (sin(Ys(k)*pi/180)*sin(fi_g*pi/180)-sin(delta*pi/180) )/(cos(Ys(k)*pi/180)*cos(fi_g*pi/180) )*180/pi;if LT(k)0 Vstep(i+1)=Vstep(i);else Vstep(i+1)=-Vstep(i);end D(i+1)=Vo/(Vo+V(i+1); Vnew(i+1)=V(i+1)+Vstep(i+1);end
5、endFigure 6(G=1000, T=25) would be given together with the figure 7Exercise 7Code:% Exercise 7close all;clear all;delta_V=0.1;Vo=30;G=input(Please input the value of Irrad:);T=input(Please input the value of Temperature:); %call function to get D and Vnew D,Vnew = MPP( G,T,delta_V,Vo ); subplot(2,1,
6、1);plot(D);xlabel(Time steps);ylabel(Duty cycle);grid on;subplot(2,1,2);plot(Vnew);xlabel(Time steps);ylabel(Module operating voltage(V);grid on;Figure 6(G=1000, T=25): Figure 7(G=1000, T=25):pare with the figures of exercise 6 and 7, get the conclusion:The more the Voltage step is, the speed of tra
7、cking is faster but the accuracy of tracking is lower. Exercise 8Code:% Exercise 8close all;clear all;Vo=30;G=input(Please input the value of Irrad:);T=input(Please input the value of Temperature:);%call function to get D and Vnew D,Vnew,P = AHCA( G,T,Vo );subplot(2,1,1);plot(D);xlabel(Time steps);y
8、label(Duty cycle);grid on;subplot(2,1,2);plot(Vnew);xlabel(Time steps);ylabel(Module operating voltage(V);grid on;Figure 8(G=1000, T=25): Figure 7(G=1000, T=25):pare with the figures of exercise 8 and 7, get the conclusion that: the adaptive hill climbing can much faster track the maximum power poin
9、t and the accuracy is also better.function D, Vnew, P = AHCA( G,T ,Vo)%UNTITLED3 Summary of this function goes here% Detailed explanation goes hereV=zeros(1,400);Vnew=zeros(1,400);Vstep=zeros(1,400);P=zeros(1,400);D=zeros(1,400);dP=zeros(1,400);dV=zeros(1,400);%define the first two stepsV(1)=0;D(1)=
10、Vo/(V(1)+Vo);I=PVmod(V(1),G,T);P(1)=I*V(1);Vstep(1)=0.4;V(2)=V(1)+Vstep(1);I=PVmod(V(2),G,T);P(2)=V(2)*I;Vnew(1)=V(1)+Vstep(1);D(2)=Vo/(V(2)+Vo);%Voltage step is dP/dVfor i=2:1:400 dP(i)=P(i)-P(i-1); dV(i)=V(i)-V(i-1); Vstep(i)=dP(i)/dV(i); Vnew(i)=V(i)+Vstep(i); V(i+1)=V(i)+ Vstep(i); %call function PVmod to get corresponding I and P I=PVmod(V(i+1),G,T); P(i+1)=V(i+1)*I; D(i+1)=Vo/(Vo+V(i+1);endend13 / 13