Electricity, Complex Systems, Numerical Analysis, Algorithms, Network.
following code executes the algorithm: ##Functions #Gaussian Seidel Iteration GS<-function(A,b){ error=1 x_0=c() for(i in 1:length(b)){ x_0[i]=0 } x=x_0 while(error>10^(-6)){ sum=c() for(i in 1:(length(b)-1)){ sum=0 for(j in 1:(length(b)-1)){ if(i!=j){ sum=sum+A[i,j]*x[j] } }