calculate the L-2 norm of the residual vector
rms = 0.0
for j = 2:ny for i = 2:nx
rms = rms + r[i,j]^2
end end
rms = sqrt(rms/((nx-1)*(ny-1)))