  The dynamics of single carrier wavepackets in nonlinear wave problems over
periodic structures can be often formally approximated by the constant
coefficient nonlinear Schr\"odinger equation (NLS) as an effective model for
the wavepacket envelope. We provide a detailed proof of this approximation
result for the Gross-Pitaevskii equation (GP) and a semilinear wave equation,
both with periodic coefficients in $\mathbb{N}\ni d$ spatial dimensions and
with cubic nonlinearities. The proof is carried out in Bloch expansion
variables with estimates in an $L^1$-type norm, which translates to an estimate
of the supremum norm of the error. The regularity required from the periodic
coefficients in order to ensure a small residual and a small error is
discussed. We also present a numerical example in two spatial dimensions
confirming the approximation result and presenting an approximate traveling
solitary wave in the GP with periodic coefficients.
