Neumann (top) and Dirichlet (bottom) Boundary Conditions
a1 + c1 b1 0 0 0 0 0 0 0 0 0 u1 f1
c2 a2 b2 0 0 0 0 0 0 0 0 u2 f2
0 c3 a3 b3 0 0 0 0 0 0 0 u3 f3
0 0 c4 a4 b4 0 0 0 0 0 0 u4 f4
0 0 0 c5 a5 b5 0 0 0 0 0 u5 f5
0 0 0 0 c6 a6 b6 0 0 0 0 u6 = f6
0 0 0 0 0 c7 a7 b7 0 0 0 u7 f7
0 0 0 0 0 0 c8 a8 b8 0 0 u8 f8
0 0 0 0 0 0 0 c9 a9 b9 0 u9 f9
0 0 0 0 0 0 0 0 c10 a10 b10 u10 f10
0 0 0 0 0 0 0 0 0 c11 a11 u11 f11 - b11u12

Step 1: Divide row 1 by its diagonal element.

1 b1/(a1 + c1) 0 0 0 0 0 0 0 0 0 u1 f1/(a1 + c1)
c2 a2 b2 0 0 0 0 0 0 0 0 u2 f2
0 c3 a3 b3 0 0 0 0 0 0 0 u3 f3
0 0 c4 a4 b4 0 0 0 0 0 0 u4 f4
0 0 0 c5 a5 b5 0 0 0 0 0 u5 f5
0 0 0 0 c6 a6 b6 0 0 0 0 u6 = f6

Step 2: Multiply row 1 by c2 and subtract the result from row 2.

1 b1/(a1 + c1) 0 0 0 0 0 0 0 0 0 u1 f1/(a1 + c1)
0 a2- c2b1/(a1 + c1) b2 0 0 0 0 0 0 0 0 u2 f2- c2f1/(a1 + c1)
0 c3 a3 b3 0 0 0 0 0 0 0 u3 f3
0 0 c4 a4 b4 0 0 0 0 0 0 u4 f4
0 0 0 c5 a5 b5 0 0 0 0 0 u5 f5
0 0 0 0 c6 a6 b6 0 0 0 0 u6 = f6

Step 3: Divide row 2 by its diagonal element.

1 b1/(a1 + c1) 0 0 0 0 0 0 0 0 0 u1 f1/(a1 + c1)
0 1 b2(a1 + c1)/[a2(a1 + c1) - c2b1] 0 0 0 0 0 0 0 0 u2 [ f2(a1 + c1) - c2f1 ] / [a2(a1 + c1) - c2b1]
0 c3 a3 b3 0 0 0 0 0 0 0 u3 f3
0 0 c4 a4 b4 0 0 0 0 0 0 u4 f4
0 0 0 c5 a5 b5 0 0 0 0 0 u5 f5
0 0 0 0 c6 a6 b6 0 0 0 0 u6 = f6

Step 4: Multiply row 2 by c3 and subtract the result from row 3.

Step 5: Etc., until you end up with a matix of the form ...

1 b1' 0 0 0 0 0 0 0 0 0 u1 f1'
0 1 b2' 0 0 0 0 0 0 0 0 u2 f2'
0 0 1 b3' 0 0 0 0 0 0 0 u3 f3'
0 0 0 1 b4' 0 0 0 0 0 0 u4 f4'
0 0 0 0 1 b5' 0 0 0 0 0 u5 f5'
0 0 0 0 0 1 b6' 0 0 0 0 u6 = f6'
0 0 0 0 0 0 1 b7' 0 0 0 u7 f7'
0 0 0 0 0 0 0 1 b8' 0 0 u8 f8'
0 0 0 0 0 0 0 0 1 b9' 0 u9 f9'
0 0 0 0 0 0 0 0 0 1 b10' u10 f10'
0 0 0 0 0 0 0 0 0 0 1 u11 f11'