I am attempting to solve a 2D linear elliptic PDE on a rectangular domain with Dirichlet boundary conditions. I've discretized the equation and built the sparse matrix representing the linear operator. The entries of this matrix (due to the coefficients of the PDE) are the on order of $10^{-5}$.
When I account for the boundary conditions (which I am putting directly into the matrix instead of moving to the right hand side), I simply put a 1 in the diagonal spot for the corresponding boundary point and then the appropriate boundary value in the RHS vector.
My sparse matrix solver isn't succeeding in solving the linear system. I suspect it could be due to the large scale difference between the interior matrix elements and boundary elements ($10^{-5}$ vs 1).
I am thinking of modifying the boundary conditions from $$ u(x_a,y) = f(y) $$ to $$ \mu u(x_a, y) = \mu f(y) $$ so that I would put the value $\mu$ into the diagonal matrix spot instead of $1$, and also make the corresponding modification to the RHS.
The question is whether this approach will work, and what should I choose for the value of $\mu$. Does anyone know of any references which discuss this issue?
Or alternatively, is there a way to transform the matrix somehow to make all entries have similar scales, and then transform back after the solution is found?