Iterative Linear System

d={{4.0, 0,0},{0,5,0},{0,0,4}};
r={{0.0,1,0},{2,0,1},{-1,2,0}};
b={1.0,0,3}; (*RHS*)
u={1.0,1,10}; (*initial guess *)
Print["check: ",(d+r).u]

u=Inverse[d].(b-r.u)
Print["check: ",(d+r).u]

(* different matrix,vergence di *)
d={{1.0, 0,0},{0,1,0},{0,0,1}};
r={{0.0,10,0},{20,0,10},{-10,20,0}};
b={1.0,0,3}; (*RHS*)
u={1.0,1,10}; (*initial guess *)
Print["check: ",(d+r).u]

u=Inverse[d].(b-r.u)
Print["check: ",(d+r).u]