Electricity, Complex Systems, Numerical Analysis, Algorithms, Network.
x[i]=(1/diag(A)[i])*(b[i]-sum) } error=sum(abs((A%*%x-b)*Conj(b)))/sum((abs(b))^2) } return(x) } #Solve for U U<-function(N,Y,I_0,U_0){ Y_eq=t(N)%*%Y%*%N I_eq=-t(N)%*%Y%*%U_0-I_0 U=GS(Y_eq,I_eq) return(U) } The below is the set parameters: ##Parameters