资源描述:
《解广润-电力系统过电压-集中参数等值计算例题编程》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、本程序是使用matlab编制的一个函数,用于计算解广润—《电力系统过电压》P66页电路例题,计算方法是集中参数电容等值计算电路法,在matlab环境下运行该函数,输入观察时间的步长(步长选0.2及以下的数值最为合理)和观察的持续时间,即可得到各节点电压随时间的变化的图像和数据。经过与解广润—《电力系统过电压》P80-82页的计算结果比对,计算结果完全一致。(等效电路和计算公式本文已给出)节点电压方程i12(t)=U1(t)/300+I12(t-2)i21(t)=U2(t)/300+I21(t-2)i24(t)=U2(t)/300+I24(t-2)i42(t)=U4(
2、t)/300+I42(t-2)i14(t)=U1(t)/300+I14(t-2)i41(t)=U4(t)/300+I41(t-2)i23(t)=U2(t)/300+I23(t-4)i32(t)=U3(t)/300+I32(t-4)I12(t-2)=-U2(t-2)/300-i21(t-2)I21(t-2)=-U1(t-2)/300-i12(t-2)I24(t-2)=-U4(t-2)/300-i42(t-2)I42(t-2)=-U2(t-2)/300-i24(t-2)I14(t-2)=-U4(t-2)/300-i41(t-2)I41(t-2)=-U1(t-2)/300
3、-i14(t-2)I23(t-2)=-U3(t-4)/300-i32(t-4)I32(t-2)=-U2(t-4)/300-i23(t-4)functionU=gdys=input('请输入步长(μs),按回车键确认');T=input('请输入持续时间的上限(μs),按回车键确认');t=0;%t为时间k=0;%k为迭代次数fori=1:1:8I(i,1)=0;end%I(1,1)至I(8,1)值依次为等效电路中的I12,I21,I24,I42,I14,I41,I23,I32fori=1:1:4forj=1:1:4y(i,j)=0;endendy(1,1)=1/15
4、0;y(2,2)=1/100;y(3,3)=10000+1/300;y(4,4)=1/150;%y为导纳矩阵fort=0:s:Tk=k+1;ift>Tbreakenda(1)=t-2;a(2)=t-2;a(3)=t-2;a(4)=t-2;a(5)=t-2;a(6)=t-2;a(7)=t-4;a(8)=t-4;t=t+s;fori=1:1:6ifa(i)<0I(i,1)=0;elseb=k-ceil(2/s);I(i,1)=II(i,b);endendfori=7:1:8ifa(i)<0I(i,1)=0;elseb=k-ceil(4/s);I(i,1)=II(i,b)
5、;endendIe(1,1)=-I(5,1)-I(1,1);Ie(2,1)=-I(7,1)-I(3,1)-I(2,1);Ie(3,1)=10000-I(8,1);Ie(4,1)=-I(4,1)-I(6,1);u=pinv(y)*Ie;u(3,1)=1;i12=u(1,1)/300+I(1,1);i21=u(2,1)/300+I(2,1);i24=u(2,1)/300+I(3,1);i42=u(4,1)/300+I(4,1);i14=u(1,1)/300+I(5,1);i41=u(4,1)/300+I(6,1);i23=u(2,1)/300+I(7,1);i32=u(
6、3,1)/300+I(8,1);II(1,k)=(-1/300)*u(2,1)-i21;II(2,k)=(-1/300)*u(1,1)-i12;II(3,k)=(-1/300)*u(4,1)-i42;II(4,k)=(-1/300)*u(2,1)-i24;II(5,k)=(-1/300)*u(4,1)-i41;II(6,k)=(-1/300)*u(1,1)-i14;II(7,k)=(-1/300)*u(3,1)-i32;II(8,k)=(-1/300)*u(2,1)-i23;%II的时间变量为t,而I的时间变量为t-τU(2,k)=u(1,1);U(3,k)=u(2
7、,1);U(4,k)=u(3,1);U(5,k)=u(4,1);endfori=1:1:kU(1,i)=(i-1)*s;endfori=1:1:kti(i)=U(1,i);U1(i)=U(2,i);U2(i)=U(3,i);U3(i)=U(4,i);U4(i)=U(5,i);endsubplot(2,2,1),plot(ti,U1);title('节点1','FontSize',15,'Fontname','宋体');xlabel('时间(μs)','FontSize',15,'Fontname','宋体');ylabel('电压','FontSize',15,