Electricity, Complex Systems, Numerical Analysis, Algorithms, Network.
1:length(b)){ sum=0 for(j in 1:length(b)){ if(i!=j){ sum=sum+A[i,j]*x[j] } } x[i]=(1/diag(A)[i])*(b[i]-sum) } error=sum(abs((A%*%x-b)*Conj(b)))/sum((abs(b))²) } return(x) } The iterative functions for the first condition is the following. #Jacobian, condition 1