Modeling nonlinear acoustic waves in media with inhomogeneities in the coefficient of nonlinearity