  One of the most important early results from the Parker Solar Probe (PSP) is
the ubiquitous presence of magnetic switchbacks, whose origin is under debate.
Using a three-dimensional direct numerical simulation of the equations of
compressible magnetohydrodynamics from the corona to 40 solar radii, we
investigate whether magnetic switchbacks emerge from granulation-driven
Alfv\'en waves and turbulence in the solar wind. The simulated solar wind is an
Alfv\'enic slow-solar-wind stream with a radial profile consistent with various
observations, including observations from PSP. As a natural consequence of
Alfv\'en-wave turbulence, the simulation reproduced magnetic switchbacks with
many of the same properties as observed switchbacks, including Alfv\'enic v-b
correlation, spherical polarization (low magnetic compressibility), and a
volume filling fraction that increases with radial distance. The analysis of
propagation speed and scale length shows that the magnetic switchbacks are
large-amplitude (nonlinear) Alfv\'en waves with discontinuities in the magnetic
field direction. We directly compare our simulation with observations using a
virtual flyby of PSP in our simulation domain. We conclude that at least some
of the switchbacks observed by PSP are a natural consequence of the growth in
amplitude of spherically polarized Alfv\'en waves as they propagate away from
the Sun.
