A new method for solving the Schrödinger equation is proposed, based on the following details. First, a map u=u(r) from Cartesian coordinates r to a new coordinate system u is chosen. Second, the solution (orbital) psi(r) is written in terms of a function U depending on u so that psi(r)=/J(u)/(-1/2)U(u), where /J(u)/ is the Jacobian determinant of the map. Third, U is expressed as a linear combination of plane waves in the u coordinate, U(u)= sum (k)c(k)e(ik x u). Finally, the coefficients c(k) are variationally optimized to obtain the best energy, using a generalization of an algorithm originally developed for the Coulomb potential [J. M. Perez-Jorda, Phys. Rev. B 58, 1230 (1998)]. The method is tested for the radial Schrödinger equation in the hydrogen atom, resulting in micro-Hartree accuracy or better for the energy of ns and np orbitals (with n up to 5) using expansions of moderate length.