-1,2*j)=G(i,j)*e(i)+B(i,j)*f(i);J(2*i,2*j-1)=-G(i,j)*e(i)-B(i,j)*f(i);J(2*i,2*j)=-B(i,j)*e(i)+G(i,j)*f(i);endelseifV(i,2)==3ifi==jforr=1:nifr==icontinueendh=h+(G(i,r)*f(r)+B(i,r)*e(r));h1=h1+(G(i,r)*e(r)-B(i,r)*f(r));endJ(2*i-1,2*j-1)=2*G(i,i)*f(i)+h;J(2*i-1,2*j)=2*G(i,i)*e(i)+h1;J(2*i,2*j-1)=2*f(i);J(2*i,2*j)=2*e(i);elseJ(2*i-1,2*j-1)=-B(i,j)*e(i)+G(i,j)*f(i);J(2*i-1,2*j)=G(i,j)*e(i)+B(i,j)*f(i);J(2*i,2*j-1)=0;J(2*i,2*j)=0;endendendendend%disp(J)%disp(w)fori=3:2*n%高斯消去法求电压修正量forj=3:2*nJ1(i-2,j-2)=J(i,j);endendfori=3:2*nw1(i-2)=w(i);endu=zeros(2*n-2,1);N=2*n-2;fork=1:Nm=0;fori=k+1:Nm=J1(i,k)./J1(k,k);w1(i)=w1(i)-m*w1(k);forj=k+1:NJ1(i,j)=J1(i,j)-m*J1(k,j);endendendu(N)=w1(N)./J1(N,N);fori=N-1:-1:1c=0;fork=i+1:Nc=c+J1(i,k)*u(k);u(i)=(w1(i)-c)./J1(i,i);endend%disp(u)fori=1:2*n-2Jd=abs(u(i));