Electricity, Complex Systems, Numerical Analysis, Algorithms, Network.
J[i,(ncol(J)/2+1):ncol(J)]=0 J[i,(ncol(J)/2)+i]=-1 #Q J[i+(ncol(J)/2),(ncol(J)/2+1):ncol(J)]=0 J[i+(ncol(J)/2),(ncol(J)/2)+i]=-1 } return(J) } #Solve for U, condition 2 Var<-function(N,Y,P,V,Q_old,phi_old){ U_0=V*complex(real=cos(phi_old),imaginary=sin(phi_old)) Y_eq=t(N)%*%Y%*%N I_eq=Y_eq%*%U_0