Tải bản đầy đủ - 0 (trang)
 Phụ lục 6: Chương trình con Matlab tính sai số cho các dạng xung dòng dùng phương trình Heidler dưới dạng file.m

 Phụ lục 6: Chương trình con Matlab tính sai số cho các dạng xung dòng dùng phương trình Heidler dưới dạng file.m

Tải bản đầy đủ - 0trang

% else

%

er1= 0;

% end

%

% if (18>tb)

%

er2= 18 -tb;

% elseif (22 < tb)

%

er2= tb - 22;

% else

%

er2= 0;

% end

%

er= er1+er2;

trmin=tr*0.9; trmax= tr*1.1;

tdmin=td*0.9; tdmax= td*1.1;

if (trmin>ta)

er1= trmin -ta;

elseif (trmax < ta)

er1= ta- trmax ;

else

er1= 0;

end

if (tdmin>tb)

er2= tdmin -tb;

elseif (tdmax < tb)

er2= tb - tdmax;

else

er2= 0;

end

er= er1+er2;

%_________________________________________________

%--------------tinh sai so phan tram-------------per= abs(ta-tr)/tr+abs(tb-td)/td;

end



NCS: Lê Quang Trung



146



 Phụ lục 7: Chương trình truy xuất dữ liệu của mơ hình máy phát xung

dòng điện sét

a1=1.8*tds; a2=1.43*(ts-tds);

a=0.1; b=0.9;

tr=tds; td=ts;

t=tr/1.25;

tt=a*t/(b-a);tc=2*td;

T=[0:0.1:tc];

n=size(T); n=n(2);

Y=[];

for k=1:n

t=T(k);

ks=t/a1;

y=((ks^10)*exp(-t/a2))/((ks^10)+1);

Y=[Y,y];

end

[ymax,m]=max(Y);

tm=m*0.1;

ya=0.1*ymax; yb=0.9*ymax;yc=0.5*ymax;

SY=Y(1:m);

YT=abs(SY-ya);

[y1,m1]=min(YT);t1=m1*0.1;

YT=abs(SY-yb);

[y9,m9]=min(YT);t9=m9*0.1;

SY=Y(m:n);

YT=abs(SY-yc);

[y5,m5]=min(YT); m5=m5+m; t5=m5*0.1;

ta=1.25*(t9-t1); tb=t5-t1+tt;

ph1=ymax;

trmin=tr*0.9; trmax= tr*1.1;

tdmin=td*0.9; tdmax= td*1.1;

if (trmin>ta)

er1= trmin -ta;

elseif (trmax < ta)

er1= ta- trmax ;

else

er1= 0;

end

if (tdmin>tb)

er2= tdmin -tb;

elseif (tdmax < tb)

er2= tb - tdmax;

else

er2= 0;

NCS: Lê Quang Trung



147



end

er1= er1+er2;

per1= abs(ta-tr)/tr+abs(tb-td)/td;

if (er1~=0)

while (er1~=0)

a1=1.1*a1;a2=0.9*a2;

a=0.1; b=0.9;

tr=tds; td=ts;

t=tr/1.25;

tt=a*t/(b-a);tc=2*td;

T=[0:0.1:tc];

n=size(T); n=n(2);

Y=[];

for k=1:n

t=T(k);

ks=t/a1;

y=((ks^10)*exp(-t/a2))/((ks^10)+1);

Y=[Y,y];

end

[ymax,m]=max(Y);

tm=m*0.1;

ya=0.1*ymax; yb=0.9*ymax;yc=0.5*ymax;

SY=Y(1:m);

YT=abs(SY-ya);

[y1,m1]=min(YT);t1=m1*0.1;

YT=abs(SY-yb);

[y9,m9]=min(YT);t9=m9*0.1;

SY=Y(m:n);

YT=abs(SY-yc);

[y5,m5]=min(YT); m5=m5+m; t5=m5*0.1;

ta=1.25*(t9-t1); tb=t5-t1+tt;

ph1=ymax;

trmin=tr*0.9; trmax= tr*1.1;

tdmin=td*0.9; tdmax= td*1.1;

if (trmin>ta)

er1= trmin -ta;

elseif (trmax < ta)

er1= ta- trmax ;

else

er1= 0;

end

if (tdmin>tb)

er2= tdmin -tb;

NCS: Lê Quang Trung



148



elseif (tdmax < tb)

er2= tb - tdmax;

else

er2= 0;

end

er1= er1+er2;

per1= abs(ta-tr)/tr+abs(tb-td)/td;

end

end

A1=a1; A2=a2;

a1=1.05*a1; a2=0.95*a2;

a=0.1; b=0.9;

tr=tds; td=ts;

t=tr/1.25;

tt=a*t/(b-a);tc=2*td;

T=[0:0.1:tc];

n=size(T); n=n(2);

Y=[];

for k=1:n

t=T(k);

ks=t/a1;

y=((ks^10)*exp(-t/a2))/((ks^10)+1);

Y=[Y,y];

end

[ymax,m]=max(Y);

tm=m*0.1;

ya=0.1*ymax; yb=0.9*ymax;yc=0.5*ymax;

SY=Y(1:m);

YT=abs(SY-ya);

[y1,m1]=min(YT);t1=m1*0.1;

YT=abs(SY-yb);

[y9,m9]=min(YT);t9=m9*0.1;

SY=Y(m:n);

YT=abs(SY-yc);

[y5,m5]=min(YT); m5=m5+m; t5=m5*0.1;

ta=1.25*(t9-t1); tb=t5-t1+tt;

%_________________________________________________

ph2=ymax;

trmin=tr*0.9; trmax= tr*1.1;

tdmin=td*0.9; tdmax= td*1.1;

if (trmin>ta)

er1= trmin -ta;

elseif (trmax < ta)

er1= ta- trmax ;

else

NCS: Lê Quang Trung



149



er1= 0;

end

if (tdmin>tb)

er2= tdmin -tb;

elseif (tdmax < tb)

er2= tb - tdmax;

else

er2= 0;

end

er2= er1+er2;

per2= abs(ta-tr)/tr+abs(tb-td)/td;

while (per1>=per2)

A1=a1; A2=a2;

a1=1.05*a1; a2=0.95*a2;

a=0.1; b=0.9;

tr=tds; td=ts;

t=tr/1.25;

tt=a*t/(b-a);tc=2*td;

T=[0:0.1:tc];

n=size(T); n=n(2);

Y=[];

for k=1:n

t=T(k);

ks=t/a1;

y=((ks^10)*exp(-t/a2))/((ks^10)+1);

Y=[Y,y];

end

[ymax,m]=max(Y);

tm=m*0.1;

ya=0.1*ymax; yb=0.9*ymax;yc=0.5*ymax;

SY=Y(1:m);

YT=abs(SY-ya);

[y1,m1]=min(YT);t1=m1*0.1;

YT=abs(SY-yb);

[y9,m9]=min(YT);t9=m9*0.1;

SY=Y(m:n);

YT=abs(SY-yc);

[y5,m5]=min(YT); m5=m5+m; t5=m5*0.1;

ta=1.25*(t9-t1); tb=t5-t1+tt;

%_________________________________________________

ph=ymax;

trmin=tr*0.9; trmax= tr*1.1;

tdmin=td*0.9; tdmax= td*1.1;

if (trmin>ta)

NCS: Lê Quang Trung



150



er1= trmin -ta;

elseif (trmax < ta)

er1= ta- trmax ;

else

er1= 0;

end

if (tdmin>tb)

er2= tdmin -tb;

elseif (tdmax < tb)

er2= tb - tdmax;

else

er2= 0;

end

er= er1+er2;

%_________________________________________________

per= abs(ta-tr)/tr+abs(tb-td)/td;

per1=per2; per2=per;

end

a=0.1; b=0.9;

tc=2*ts;

t=tds/1.25;

tt=a*t/(b-a);

T=[0:0.1:tc];

n=size(T); n=n(2);

Y=[];

for k=1:n

t=T(k);

ks=t/A1;

y=((ks^10)*exp(-t/A2))/((ks^10)+1);

Y=[Y,y];

end

[ymax,m]=max(Y);

ph=ymax;

tm=m*0.1;

ya=0.1*ymax; yb=0.9*ymax;yc=0.5*ymax;

SY=Y(1:m);

YT=abs(SY-ya);

[y1,m1]=min(YT);t1=m1*0.1;

YT=abs(SY-yb);

[y9,m9]=min(YT);t9=m9*0.1;

SY=Y(m:n);

YT=abs(SY-yc);

[y5,m5]=min(YT); m5=m5+m; t5=m5*0.1;

ta=1.25*(t9-t1); tb=t5-t1+tt;

NCS: Lê Quang Trung



151



pr1= 100*abs(ta-tds)/tds;

pr2= 100*abs(tb-ts)/ts;

Im=Im*1000;

A1=A1*10^-6;

A2=A2*10^-6;

A1=1/A1;

A2=1/A2;

clc



NCS: Lê Quang Trung



152



 Phụ lục 8: Chương trình truy xuất dữ liệu trong mơ hình thiết bị chống sét

hạ áp

if T>85

Imax=(-2.5*T+312.5)*Imax/100;

if Imax<2.5

Imax=2.5

elseif (Imax>=2.5)&(Imax<3)

Imax=2.5

elseif (Imax>=3)&(Imax<4)

Imax=3.5

elseif (Imax>=4)&(Imax<5)

Imax=4.5

elseif (Imax>=5)&(Imax<6)

Imax=5.5

elseif (Imax>=6)&(Imax<6.9)

Imax=6.5

elseif (Imax>=6.9)&(Imax<7.7)

Imax=7.3

elseif (Imax>=7.7)&(Imax<12.3)

Imax=8

elseif (Imax>=12.3)&(Imax<21)

Imax=16.5

elseif (Imax>=21)&(Imax<29)

Imax=25

elseif (Imax>=29)&(Imax<36.3)

Imax=32.5

elseif (Imax>=36.3)&(Imax<47.5)

Imax=40

elseif (Imax>=47.5)&(Imax<62.5)

Imax=55

elseif (Imax>=62.5)&(Imax<77.5)

Imax=70

elseif (Imax>=77.5)&(Imax<92.5)

Imax=85

elseif 92.5<=Imax

Imax=100

else

end

end

R1=(100e-9)/N

R2=(100e6)/N

if (Vc==230)

if (Imax==2.5)

b1=2.6637804;b2=0.0323975;b3=0.0005318;b4=0.0060573;

NCS: Lê Quang Trung



153



L=(12e-9)/N;C=(230e-12)*N;

elseif (Imax==3.5)

b1=2.6602746;b2=0.0311468;b3=0.00053215;b4=0.00530105;

L=(12e-9)/N;C=(305e-12)*N;

elseif (Imax==4.5)

b1=2.6567688;b2=0.0298961;b3=0.0005325;b4=0.0045448;

L=(12e-9)/N;C=(380e-12)*N;

elseif (Imax==5.5)

b1=2.6530759;b2=0.02826065;b3=0.000565;b4=0.00432765;

L=(12e-9)/N;C=(560e-12)*N;

elseif (Imax==6.5)

b1=2.6493830;b2=0.0266252;b3=0.0005975;b4=0.0041105;

L=(12e-9)/N;C=(740e-12)*N;

elseif (Imax==7.3)

b1=2.64817695;b2=0.0261376;b3=0.0006024;b4=0.0043374;

L=(12.5e-9)/N;C=(750e-12)*N;

elseif (Imax==8)

b1=2.6469709;b2=0.025650;b3=0.0006073;b4=0.0045643;

L=(13e-9)/N;C=(760e-12)*N;

elseif (Imax==16.5)

b1=2.64331115;b2=0.02533375;b3=0.00049625;b4=0.00407545;

L=(16.5e-9)/N;C=(505e-12)*N;

elseif (Imax==25)

b1=2.6396514;b2=0.0250175;b3=0.0003852;b4=0.0035866;

L=(20e-9)/N;C=(2500e-12)*N;

elseif (Imax==32.5)

b1=2.6374371;b2=0.0242345;b3=0.0003921;b4=0.0034391;

L=(19.5e-9)/N;C=(2850e-12)*N;

elseif (Imax==40)

b1=2.6352228;b2=0.0234515;b3=0.0003293;b4=0.0032916;

L=(19e-9)/N;C=(3200e-12)*N;

elseif (Imax==55)

b1=2.6319963;b2=0.02298045;b3=0.0005325;b4=0.00309615;

L=(23e-9)/N;C=(5550e-12)*N;

elseif (Imax==70)

NCS: Lê Quang Trung



154



b1=2.6287698;b2=0.0225094;b3=0.0002596;b4=0.0029007;

L=(27e-9)/N;C=(7900e-12)*N;

elseif (Imax==85)

b1=2.626511;b2=0.01900405;b3=0.00074435;b4=0.00296045;

L=(28.5e-9)/N;C=(4750e-12)*N;

elseif (Imax==100)

b1=2.6242522;b2=0.0154987;b3=0.0012291;b4=0.0030202;

L=(30e-9)/N;C=(16000e-12)*N;

else

errordlg('Sorry! Your low voltage MOV has not

updated yet or it has not existed. Please input your LVMOV again! If not succeed, your MOV need be updated to

model');

fprintf('Sorry! Your low voltage MOV has not

updated yet or it has not existed. Please input your LVMOV again!If not succeed, your MOV need be updated to

model')

end

elseif (Vc==275)

if (Imax==2.5)

b1=2.7395031;b2=0.0334084;

b3=-0.0004938;b4=0.0060361;

L=(12e-9)/N;C=(195e-12)*N;

elseif (Imax==3.5)

b1=2.73676115;b2=0.03177405;

b3=-0.00050405;b4=0.0053197;

L=(12e-9)/N;C=(250e-12)*N;

elseif (Imax==4.5)

b1=2.7340192;b2=0.0301397;

b3=-0.0005143;b4=0.0046033;

L=(12e-9)/N;C=(320e-12)*N;

elseif (Imax==5.5)

b1=2.72869735;b2=0.0279925;

b3=-0.00054445;b4=0.0046033;

L=(12.5e-9)/N;C=(465e-12)*N;

elseif (Imax==6.5)

b1=2.7233755;b2=0.0258453;

b3=-0.0005746;b4=0.0046033;

L=(13e-9)/N;C=(610e-12)*N;

elseif (Imax==7.3)

b1=2.7233755;b2=0.0258453;

b3=-0.0005746;b4=0.0046033;

L=(13e-9)/N;C=(620e-12)*N;

NCS: Lê Quang Trung



155



elseif (Imax==8)

b1=2.7233755;b2=0.0258453;

b3=-0.0005746;b4=0.0046033;

L=(13e-9)/N;C=(630e-12)*N;

elseif (Imax==16.5)

b1=2.7196074;b2=0.02518825;

b3=-0.0004821;b4=0.0042062;

L=(16.5e-9)/N;C=(1315e-12)*N;

elseif (Imax==25)

b1=2.7158393;b2=0.0245312;

b3=-0.0003902;b4=0.0038091;

L=(20e-9)/N;C=(2000e-12)*N;

elseif (Imax==32.5)

b1=2.71308675;b2=0.02373865;

b3=-0.0003955;b4=0.0037222;

L=(19.5e-9)/N;C=(2350e-12)*N;

elseif (Imax==40)

b1=2.7103342;b2=0.0229461;

b3=-0.0004008;b4=0.0036353;

L=(19e-9)/N;C=(2700e-12)*N;

elseif (Imax==55)

b1=2.71169045;b2=0.0215409;

b3=-0.00068135;b4=0.0032705;

L=(23e-9)/N;C=(4650e-12)*N;

elseif (Imax==70)

b1=2.7130467;b2=0.0201357;

b3=-0.0009619;b4=0.0029057;

L=(27e-9)/N;C=(6600e-12)*N;

elseif (Imax==85)

b1=2.70651515;b2=0.0176668;

b3=-0.0010963;b4=0.00297535;

L=(28.5e-9)/N;C=(9800e-12)*N;

elseif (Imax==100)

b1=2.6999836;b2=0.0151979;

b3=-0.0012307;b4=0.0030450;

L=(30e-9)/N;C=(13000e-12)*N;

else

errordlg('Sorry! Your low voltage MOV has not

updated yet or it has not existed. Please input your LVMOV again! If not succeed, your MOV need be updated to

model');

fprintf('Sorry! Your low voltage MOV has not

updated yet or it has not existed. Please input your LVNCS: Lê Quang Trung



156



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

 Phụ lục 6: Chương trình con Matlab tính sai số cho các dạng xung dòng dùng phương trình Heidler dưới dạng file.m

Tải bản đầy đủ ngay(0 tr)

×