We apply the concepts of nonlinear guided-wave optics to a Bose-Einstein co
ndensate (BEC) trapped in an external potential. As an example, we consider
a parabolic double-well potential and derive coupled-mode equations for th
e complex amplitudes of the BEC macroscopic collective modes. Our equations
describe different regimes of the condensate dynamics, including the nonli
near Josephson effect for any separation between the wells. We demonstrate
macroscopic self-trapping for both repulsive and attractive interactions, a
nd confirm our results by direct numerical solution of the Gross-Pitaevskii
-equation.