Electricity, Complex Systems, Numerical Analysis, Algorithms, Network.
J[i+(ncol(J)/2),1:(ncol(J)/2)]=U_old[i]*U_old*(-Re(Y_eq[i,])*cos(phi_old[i]-phi_old)-Im(Y_eq[i,])*sin(phi_old[i]-phi_old)) #partial derivatives with respect to U #P J[i,(ncol(J)/2+1):ncol(J)]=U_old[i]*(Re(Y_eq[i,])*cos(phi_old[i]-phi_old)+Im(Y_eq[i,])*sin(phi_old[i]-phi_old))