The influence of electrons trapped between the magnetic mirror and the Debye sheath on the potential profile in the expander of an open trap is considered. A numerical model is developed to calculate the electron distribution function in the self-consistent electrostatic potential. Passing electrons are assumed to be collisionless, while the distribution function of trapped electrons is calculated by solving the bounce-averaged kinetic equation with the Landau collision integral. The self-consistent profile of the potential is obtained. The solution is shown to agree well with Ryutov’s semi-analytical model.