Electricity, Complex Systems, Numerical Analysis, Algorithms, Network.
J[i,(ncol(J)/2)+i]=2*U_old[i]*Re(Y_eq[i,i]) #Q J[i+(ncol(J)/2),(ncol(J)/2+1):ncol(J)]=U_old[i]*(Re(Y_eq[i,])*sin(phi_old[i]-phi_old)-Im(Y_eq[i,])*cos(phi_old[i]-phi_old)) J[i+(ncol(J)/2),(ncol(J)/2)+i]=-2*U_old[i]*Im(Y_eq[i,i]) } return(J) } #Solve for U, condition 1