where C(x p , y p , θ p , d p ) l is the objective function associated with the lth electrode resulting from p dipoles, N is the number of electrodes, J l is the current density associated with the lth electrode, ψ l represents the weighting function associated with the lth electrode and n^ is the outward-pointing normal direction to the boundary of the problem domain. This formulation allows for the single calculation of the inverse or preconditioner matrix in the case of direct or iterative matrix solvers, respectively, which is a significant reduction in the computational time associated with 3-D finite element solutions.