  We study the formation of a large-scale coherent structure (a condensate) in
classical wave equations by considering the defocusing nonlinear Schr\"odinger
equation as a representative model. We formulate a thermodynamic description of
the condensation process by using a wave turbulence theory with ultraviolet
cut-off. In 3 dimensions the equilibrium state undergoes a phase transition for
sufficiently low energy density, while no transition occurs in 2 dimensions, in
analogy with standard Bose-Einstein condensation in quantum systems. Numerical
simulations show that the thermodynamic limit is reached for systems with
$16^3$ computational modes and greater. On the basis of a modified wave
turbulence theory, we show that the nonlinear interaction makes the transition
to condensation subcritical. The theory is in quantitative agreement with the
simulations.
