# Averaged Lagrangian

In continuum mechanics, Whitham's averaged Lagrangian method – or in short Whitham's method – is used to study the Lagrangian dynamics of slowly-varying wave trains in an inhomogeneous (moving) medium. The method is applicable to both linear and non-linear systems. As a direct consequence of the averaging used in the method, wave action is a conserved property of the wave motion. In contrast, the wave energy is not necessarily conserved, due to the exchange of energy with the mean motion. However the total energy, the sum of the energies in the wave motion and the mean motion, will be conserved for a time-invariant Lagrangian. Further, the averaged Lagrangian has a strong relation to the dispersion relation of the system.
The method is due to Gerald Whitham, who developed it in the 1960s. It is for instance used in the modelling of surface gravity waves on fluid interfaces, and in plasma physics.

## Resulting equations for pure wave motion

In case a Lagrangian formulation of a continuum mechanics system is available, the averaged Lagrangian methodology can be used to find approximations for the average dynamics of wave motion – and (eventually) for the interaction between the wave motion and the mean motion – assuming the envelope dynamics of the carrier waves is slowly varying. Phase averaging of the Lagrangian results in an averaged Lagrangian, which is always independent of the wave phase itself (but depends on slowly varying wave quantities like wave amplitude, frequency and wavenumber). By Noether's theorem, variation of the averaged Lagrangian ${\mathcal {L}}$ with respect to the invariant wave phase $\theta ({\boldsymbol {x}},t)$ then gives rise to a conservation law:
$\partial _{t}{\mathcal {A}}+{\boldsymbol {\nabla }}\cdot {\boldsymbol {\mathcal {B}}}=0.$ (1)
This equation states the conservation of wave action – a generalization of the concept of an adiabatic invariant to continuum mechanics – with
${\mathcal {A}}\equiv -{\frac {\partial {\mathcal {L}}}{\partial (\partial _{t}\theta )}}=+{\frac {\partial {\mathcal {L}}}{\partial \omega }}$ ${\boldsymbol {\mathcal {B}}}\equiv -{\frac {\partial {\mathcal {L}}}{\partial ({\boldsymbol {\nabla }}\theta )}}=-{\frac {\partial {\mathcal {L}}}{\partial {\boldsymbol {k}}}}$
being the wave action ${\mathcal {A}}$ and wave action flux ${\boldsymbol {\mathcal {B}}}$ respectively. Further ${\boldsymbol {x}}$ and $t$ denote space and time respectively, while ${\boldsymbol {\nabla }}$ is the gradient operator. The angular frequency $\omega ({\boldsymbol {x}},t)$ and wavenumber ${\boldsymbol {k}}({\boldsymbol {x}},t)$ are defined as
$\omega \equiv -\partial _{t}\theta$ and ${\boldsymbol {k}}\equiv +{\boldsymbol {\nabla }}\theta$ (2)
and both are assumed to be slowly varying. Due to this definition, $\omega ({\boldsymbol {x}},t)$ and ${\boldsymbol {k}}({\boldsymbol {x}},t)$ have to satisfy the consistency relations:
$\partial _{t}{\boldsymbol {k}}+{\boldsymbol {\nabla }}\omega ={\boldsymbol {0}}$ and ${\boldsymbol {\nabla }}\times {\boldsymbol {k}}={\boldsymbol {0}}.$ (3)
The first consistency equation is known as the conservation of wave crests, and the second states that the wavenumber field ${\boldsymbol {k}}({\boldsymbol {x}},t)$ is irrotational (i.e. has zero curl).

## Method

The averaged Lagrangian approach applies to wave motion – possibly superposed on a mean motion – that can be described in a Lagrangian formulation. Using an ansatz on the form of the wave part of the motion, the Lagrangian is phase averaged. Since the Lagrangian is associated with the kinetic energy and potential energy of the motion, the oscillations contribute to the Lagrangian, although the mean value of the wave's oscillatory excursion is zero (or very small).
The resulting averaged Lagrangian contains wave characteristics like the wavenumber, angular frequency and amplitude (or equivalently the wave's energy density or wave action). But the wave phase itself is absent due to the phase averaging. Consequently, through Noether's theorem, there is a conservation law called the conservation of wave action.
Originally the averaged Lagrangian method was developed by Whitham for slowly-varying dispersive wave trains. Several extensions have been made, e.g. to interacting wave components, Hamiltonian mechanics, higher-order modulational effects, dissipation effects.

### Variational formulation

The averaged Lagrangian method requires the existence of a Lagrangian describing the wave motion. For instance for a field $\varphi ({\boldsymbol {x}},t)$, described by a Lagrangian density $L\left(\partial _{t}\varphi ,{\boldsymbol {\nabla }}\varphi ,\varphi \right),$ the principle of stationary action is:
$\delta \left(\iiiint \,L\left(\partial _{t}\varphi ({\boldsymbol {x}},t),{\boldsymbol {\nabla }}\varphi ({\boldsymbol {x}},t),\varphi ({\boldsymbol {x}},t)\right)\,{\text{d}}{\boldsymbol {x}}\,{\text{d}}t\right)=0,$
with ${\boldsymbol {\nabla }}$ the gradient operator and $\partial _{t}$ the time derivative operator. This action principle results in the Euler–Lagrange equation:
$\partial _{t}\left({\frac {\partial L}{\partial \left(\partial _{t}\varphi \right)}}\right)+{\boldsymbol {\nabla }}\cdot \left({\frac {\partial L}{\partial \left({\boldsymbol {\nabla }}\varphi \right)}}\right)-{\frac {\partial L}{\partial \varphi }}=0,$
which is the second-order partial differential equation describing the dynamics of $\varphi .$ Higher-order partial differential equations require the inclusion of higher than first-order derivatives in the Lagrangian.

#### Example

For example, consider a non-dimensional and non-linear Klein–Gordon equation in one space dimension $x$:
This Euler–Lagrange equation emerges from the Lagrangian density:
The small-amplitude approximation for the Sine–Gordon equation corresponds with the value σ=−1/24.{\textstyle \sigma =-{\tfrac {1}{24}}.} For $\sigma =0$ the system is linear and the classical one-dimensional Klein–Gordon equation is obtained.

### Slowly-varying waves
#### Slowly-varying linear waves

Whitham developed several approaches to obtain an averaged Lagrangian method. The simplest one is for slowly-varying linear wavetrains, which method will be applied here.
The slowly-varying wavetrain –without mean motion– in a linear dispersive system is described as:
$\varphi \sim \Re \left\{A({\boldsymbol {x}},t)\,e^{i\theta ({\boldsymbol {x}},t)}\right\}=a({\boldsymbol {x}},t)\,\cos \left(\theta ({\boldsymbol {x}},t)+\alpha \right),$ with $a=\left|A\right|$ and $\alpha =\arg \left\{A\right\},$
where $\theta ({\boldsymbol {x}},t)$ is the real-valued wave phase, $|A|$ denotes the absolute value of the complex-valued amplitude $A({\boldsymbol {x}},t),$ while $\arg\{A\}$ is its argument and $\Re \{A\}$ denotes its real part. The real-valued amplitude and phase shift are denoted by $a$ and $\alpha$ respectively.
Now, by definition, the angular frequency $\omega$ and wavenumber vector ${\boldsymbol {k}}$ are expressed as the time derivative and gradient of the wave phase $\theta ({\boldsymbol {x}},t)$ as:
$\omega \equiv -\partial _{t}\theta$ and ${\boldsymbol {k}}\equiv +{\boldsymbol {\nabla }}\theta .$
As a consequence, $\omega ({\boldsymbol {x}},t)$ and ${\boldsymbol {k}}({\boldsymbol {x}},t)$ have to satisfy the consistency relations:
$\partial _{t}{\boldsymbol {k}}+{\boldsymbol {\nabla }}\omega ={\boldsymbol {0}}$ and ${\boldsymbol {\nabla }}\times {\boldsymbol {k}}={\boldsymbol {0}}.$
These two consistency relations denote the "conservation of wave crests", and the irrotationality of the wavenumber field.
Because of the assumption of slow variations in the wave train – as well as in a possible inhomogeneous medium and mean motion – the quantities $A,$ $a,$ $\omega ,$ ${\boldsymbol {k}}$ and $\alpha$ all vary slowly in space ${\boldsymbol {x}}$ and time $t$ – but the wave phase $\theta$ itself does not vary slowly. Consequently, derivatives of $a,$ $\omega ,$ ${\boldsymbol {k}}$ and $\alpha$ are neglected in the determination of the derivatives of $\varphi ({\boldsymbol {x}},t)$ for use in the averaged Lagrangian:
$\partial _{t}\varphi \approx +\omega \,a\,\sin(\theta +\alpha )$ and ${\boldsymbol {\nabla }}\varphi \approx -{\boldsymbol {k}}\,a\,\sin(\theta +\alpha ).$
Next these assumptions on $\varphi ({\boldsymbol {x}},t)$ and its derivatives are applied to the Lagrangian density $L\left(\partial _{t}\varphi ,{\boldsymbol {\nabla }}\varphi ,\varphi \right).$

#### Slowly-varying non-linear waves

Several approaches to slowly-varying non-linear wavetrains are possible. One is by the use of Stokes expansions, used by Whitham to analyse slowly-varying Stokes waves. A Stokes expansion of the field $\varphi ({\boldsymbol {x}},t)$ can be written as:
$\varphi =a\,\cos \left(\theta +\alpha \right)+a_{2}\,\cos \left(2\theta +\alpha _{2}\right)+a_{3}\,\cos \left(3\theta +\alpha _{3}\right)+\cdots ,$
where the amplitudes $a,$ $a_{2},$ etc. are slowly varying, as are the phases $\alpha ,$ $\alpha _{2},$ etc. As for the linear wave case, in lowest order (as far as modulational effects are concerned) derivatives of amplitudes and phases are neglected, except for derivatives $\omega$ and ${\boldsymbol {k}}$ of the fast phase $\theta$:
$\partial _{t}\varphi \approx +\omega a\,\sin \left(\theta +\alpha \right)+2\omega a_{2}\,\sin \left(2\theta +\alpha _{2}\right)+3\omega a_{3}\,\sin \left(3\theta +\alpha _{3}\right)+\cdots ,$ and ${\boldsymbol {\nabla }}\varphi \approx -{\boldsymbol {k}}a\,\sin \left(\theta +\alpha \right)-2{\boldsymbol {k}}a_{2}\,\sin \left(2\theta +\alpha _{2}\right)-3{\boldsymbol {k}}a_{3}\,\sin \left(3\theta +\alpha _{3}\right)+\cdots .$
These approximations are to be applied in the Lagrangian density $L$, and its phase average ${\bar {L}}.$

### Averaged Lagrangian for slowly-varying waves

For pure wave motion the Lagrangian $L\left(\partial _{t}\varphi ,{\boldsymbol {\nabla }}\varphi ,\varphi \right)$ is expressed in terms of the field $\varphi ({\boldsymbol {x}},t)$ and its derivatives. In the averaged Lagrangian method, the above-given assumptions on the field $\varphi ({\boldsymbol {x}},t)$ –and its derivatives– are applied to calculate the Lagrangian. The Lagrangian is thereafter averaged over the wave phase $\theta$:
${\bar {L}}={\frac {1}{2\pi }}\int _{0}^{2\pi }L\left(\partial _{t}\varphi ,{\boldsymbol {\nabla }}\varphi ,\varphi \right){\text{d}}\theta .$
As a last step, this averaging result ${\bar {L}}$ can be expressed as the averaged Lagrangian density ${\mathcal {L}}(\omega ,{\boldsymbol {k}},a)$ – which is a function of the slowly varying parameters $\omega ,$ ${\boldsymbol {k}}$ and $a$ and independent of the wave phase $\theta$ itself.
The averaged Lagrangian density ${\mathcal {L}}$ is now proposed by Whitham to follow the average variational principle:
$\delta \iint {\mathcal {L}}(\omega ,{\boldsymbol {k}},a)\,{\text{d}}{\boldsymbol {x}}\,{\text{d}}t=0.$
From the variations of ${\mathcal {L}}$ follow the dynamical equations for the slowly-varying wave properties.

#### Example

Continuing on the example of the nonlinear Klein–Gordon equation, see equations 4 and 5, and applying the above approximations for $\varphi ,$ $\partial _{t}\varphi$ and $\partial _{x}\varphi$ (for this 1D example) in the Lagrangian density, the result after averaging over $\theta$ is:
${\bar {L}}={\tfrac {1}{4}}\left(\omega ^{2}-k^{2}-1\right)a^{2}-{\tfrac {3}{32}}\sigma a^{4}+\left(\omega ^{2}-k^{2}-{\tfrac {1}{4}}\right)a_{2}^{2}+{\mathcal {O}}{\left(a^{6}\right)},$ where it has been assumed that, in big-O notation, $a_{2}={\mathcal {O}}(a^{2})$ and $a_{3}={\mathcal {O}}(a^{3})$. Variation of ${\bar {L}}$ with respect to $a_{2}$ leads to $a_{2}=0.$ So the averaged Lagrangian is:
For linear wave motion the averaged Lagrangian is obtained by setting $\sigma$ equal to zero.

### Set of equations emerging from the averaged Lagrangian

Applying the averaged Lagrangian principle, variation with respect to the wave phase $\theta$ leads to the conservation of wave action:
$\partial _{t}\left(+{\frac {\partial {\mathcal {L}}}{\partial \omega }}\right)+{\boldsymbol {\nabla }}\cdot \left(-{\frac {\partial {\mathcal {L}}}{\partial {\boldsymbol {k}}}}\right)=0,$
since $\omega =-\partial _{t}\theta$ and ${\boldsymbol {k}}={\boldsymbol {\nabla }}\theta$ while the wave phase $\theta$ does not appear in the averaged Lagrangian density ${\mathcal {L}}$ due to the phase averaging. Defining the wave action as ${\mathcal {A}}\equiv +\partial {\mathcal {L}}/\partial \omega$ and the wave action flux as ${\boldsymbol {\mathcal {B}}}\equiv -\partial {\mathcal {L}}/\partial {\boldsymbol {k}}$ the result is:
$\partial _{t}{\mathcal {A}}+{\boldsymbol {\nabla }}\cdot {\boldsymbol {\mathcal {B}}}=0.$
The wave action equation is accompanied with the consistency equations for $\omega$ and ${\boldsymbol {k}}$ which are:
$\partial _{t}{\boldsymbol {k}}+{\boldsymbol {\nabla }}\omega ={\boldsymbol {0}}$ and ${\boldsymbol {\nabla }}\times {\boldsymbol {k}}={\boldsymbol {0}}.$
Variation with respect to the amplitude $a$ leads to the dispersion relation $\partial {\mathcal {L}}/\partial a=0.$

#### Example

Continuing with the nonlinear Klein–Gordon equation, using the average variational principle on equation 6, the wave action equation becomes by variation with respect to the wave phase $\theta :$ $\partial _{t}\left({\tfrac {1}{2}}\omega a^{2}\right)+\partial _{x}\left({\tfrac {1}{2}}ka^{2}\right)=0,$ and the nonlinear dispersion relation follows from variation with respect to the amplitude $a:$ $\omega ^{2}=k^{2}+1+{\tfrac {3}{4}}\sigma a^{2}.$
So the wave action is A=1/2 ωa$^2${\textstyle {\mathcal {A}}={\tfrac {1}{2}}\omega a^{2}} and the wave action flux B=1/2 ka$^2$.{\textstyle {\mathcal {B}}={\tfrac {1}{2}}ka^{2}.} The group velocity $v_{g}$ is $v_{g}\equiv {\mathcal {B}}/{\mathcal {A}}=k/\omega .$

### Mean motion and pseudo-phase
## Conservation of wave action

The averaged Lagrangian is obtained by integration of the Lagrangian over the wave phase. As a result, the averaged Lagrangian only contains the derivatives of the wave phase $\theta$ (these derivatives being, by definition, the angular frequency and wavenumber) and does not depend on the wave phase itself. So the solutions will be independent of the choice of the zero level for the wave phase. Consequently – by Noether's theorem – variation of the averaged Lagrangian ${\bar {\mathcal {L}}}$ with respect to the wave phase results in a conservation law:
$\partial _{t}{\mathcal {A}}+{\boldsymbol {\nabla }}\cdot {\boldsymbol {\mathcal {B}}}=0,$
where
* ${\mathcal {A}}\equiv {\frac {\delta {\bar {\mathcal {L}}}}{\delta \omega }}=-{\frac {\delta {\bar {\mathcal {L}}}}{\delta \left(\partial _{t}\theta \right)}},$
* ${\boldsymbol {\mathcal {B}}}\equiv -{\frac {\delta {\bar {\mathcal {L}}}}{\delta {\boldsymbol {k}}}}=-{\frac {\delta {\bar {\mathcal {L}}}}{\delta \left({\boldsymbol {\nabla }}\theta \right)}},$
with ${\mathcal {A}}$ the wave action and ${\boldsymbol {\mathcal {B}}}$ the wave action flux. Further $\partial _{t}$ denotes the partial derivative with respect to time, and ${\boldsymbol {\nabla }}$ is the gradient operator. By definition, the group velocity ${\boldsymbol {v}}_{g}$ is given by:
${\boldsymbol {\mathcal {B}}}\equiv {\boldsymbol {v}}_{g}{\mathcal {A}}.$
Note that in general the energy of the wave motion does not need to be conserved, since there can be an energy exchange with a mean flow. The total energy – the sum of the energies of the wave motion and the mean flow – is conserved (when there is no work by external forces and no energy dissipation).
Conservation of wave action is also found by applying the generalized Lagrangian mean (GLM) method to the equations of the combined flow of waves and mean motion, using Newtonian mechanics instead of a variational approach.

## Connection to the dispersion relation

Pure wave motion by linear models always leads to an averaged Lagrangian density of the form: ${\mathcal {L}}=G(\omega ,{\boldsymbol {k}})a^{2}.$
Consequently, the variation with respect to amplitude: $\partial {\mathcal {L}}/\partial a=0$ gives $G(\omega ,{\boldsymbol {k}})=0.$
So this turns out to be the dispersion relation for the linear waves, and the averaged Lagrangian for linear waves is always the dispersion function $G(\omega ,{\boldsymbol {k}})$ times the amplitude squared.
More generally, for weakly nonlinear and slowly modulated waves propagating in one space dimension and including higher-order dispersion effects – not neglecting the time and space derivatives $\partial _{t}a$ and $\partial _{x}a$ of the amplitude $a(\mu x,\mu t)$ when taking derivatives, where $\mu \ll 1$ is a small modulation parameter – the averaged Lagrangian density is of the form: ${\mathcal {L}}=G(\omega ,k)a^{2}+G_{2}(\omega ,k)a^{4}+{\tfrac {1}{2}}\mu ^{2}\left(G_{\omega \omega }(\partial _{T}a)^{2}+2G_{\omega k}(\partial _{T}a)(\partial _{X}a)+G_{kk}(\partial _{X}a)^{2}\right),$ with the slow variables $X=\mu x$ and $T=\mu t.$