Boundary terms u′φi at points xi where Dirichlet values apply can always be forgotten.
Assemble entries for i=0,…,N=Nn and then modify the last equation to cN=D