# A wave that steepens A sine wave under Burgers' equation at five times: it leans forward into a steep front. ```python import sympy as sp import pdemagic as pm x, t = sp.symbols("x t", real=True) v = sp.Function("v")(x, t) ring = pm.Space(x, periodic={x: (0, 2 * sp.pi)}) burgers = pm.Problem( sp.Eq(v.diff(t) + v * v.diff(x), v.diff(x, 2) / 10), domain=ring, time=(t, 0.0, 2.0), initial={v: sp.sin(x)}, ) plan = pm.plan(burgers) plan.grid.shape = [256] pm.solve(burgers, plan).plot() ``` ## What it shows Burgers' equation, $v_t + v\,v_x = \tfrac{1}{10} v_{xx}$, on a periodic interval. The term $v\,v_x$ is nonlinear: every part of the wave moves with its own height as its speed. The crest moves to the right, the trough to the left, and the slope between them steepens into a front, which the viscosity on the right-hand side keeps from breaking. The front is finer than anything in the sine that the wave starts from. ## What pdemagic decided The planner chose exponential time stepping of fourth order (`exponential_runge_kutta`): the diffusion is exact, and the nonlinear term is stepped, with steps chosen so that each errs by less than $10^{-10}$ of the solution. The planner knows the initial state only, for which 32 points are enough, and its plan says that the solution may develop finer structures. So this plan asks for 256 points. The diagnostic `solution_tail` is then $5\cdot10^{-10}$: the front is resolved. ## More - [Nonlinear equations in time](../topics/nonlinear-time.md) - [Choose the grid yourself](../howto/choose-the-grid-yourself.md) - [Nonlinear equations in time: the method](../methods/exponential.md) - [What is solved in free space and on periodic boxes](../ref/equations-free-space.md)