Approximation by the Legendre collocation method of a model problem in electrophysiology