Energy Exchange and Wave Action Conservation for Magnetohydrodynamic (mhd) Waves in a General, Slowly Varying Medium

Magnetohydrodynamic (MHD) waves in the solar wind and magnetosphere are propagated in a medium whose velocity is comparable to or greater than the wave velocity and which varies in both space and time. In the approximation where the scales of the time and space variation are long compared with the period and wavelength, the ray-tracing equations can be generalized and then include an additional first-order differential equation that determines the variation of frequency. In such circumstances the wave can exchange energy with the background: wave energy is not conserved. In such processes the wave action theorem shows that the wave action, defined as the ratio of the wave energy to the frequency in the local rest frame, is conserved. In this paper we discuss ray-tracing techniques and the energy exchange relation for MHD waves. We then provide a unified account of how to deal with energy transport by MHD waves in non-uniform media. The wave action theorem is derived directly from the basic MHD equations for sound waves, transverse Alfvén waves, and the fast and slow magnetosonic waves. The techniques described are applied to a number of illustrative cases. These include a sound wave in a medium undergoing a uniform compression, an isotropic Alfvén wave in a steady-state shear layer, and a transverse Alfvén wave in a simple model of the magnetotail undergoing compression. In each case the nature and magnitude of the energy exchange between wave and background is found. Keywords. Interplanetary physics (MHD waves and turbulence) – magnetospheric physics (MHD waves and instabili-ties)


Introduction
Magnetohydrodynamic (MHD) waves are an important agent for energy transfer in the solar corona, solar wind, and magnetosphere.Unlike most electromagnetic waves, the medium in which they are propagated is generally in motion with a velocity whose magnitude is comparable with or greater than the wave speed, and which varies in space and time.In these circumstances it is possible for energy to be exchanged between the wave and the moving background plasma.Different approaches have been taken to study such processes.For example Goedbloed (2009a) and Andries (2010) have developed methods to construct the eigenfunction spectrum of stationary magnetohydrodynamic flows.Goedbloed (2009b) has applied his method in a plane geometry to study the Kelvin-Helmholtz and Rayleigh-Taylor instabilities in the presence of a gravitational field.At present such methods have only been applied to simple geometries and stationary flow.
Recently Walker (2008) has generalized the ray-tracing method for magnetohydromagnetic waves propagated in a medium that is varying slowly in both space and time.Slow variation implies that the wavelength and period are small compared with the scales of variation of space and time in the medium.This ray-tracing method can be applied in arbitrary three-dimensional geometries so long as the slowly varying condition holds.It also can be used when the flow is not stationary.In such circumstances wave energy is not conserved and it is desirable to have a method of computing the changes in energy density as the wave progresses.The purpose of this paper is to develop a method to do this.Whitham (1965) presented a Lagrangian approach to the problem.He defined a wave action density variable which A. D. M. Walker: MHD waves in slowly varying media for a wide range of problems was U /ω 0 , where U was the wave energy density and ω 0 was the frequency found from the dispersion relation in the local rest frame of the medium.He showed that it behaved as an adiabatic invariant as the wave was propagated through the moving medium.He illustrated the idea by considering Boussinesq surface waves on a fluid.A rigorous investigation of the problem was carried out by Bretherton and Garrett (1968), who showed that the wave action was conserved along the ray path.The mathematical requirements for this to be true are discussed by Bretherton (1968).He also made it clear that the ray-tracing solution together with the conservation of wave action constitutes a Wentzel-Kramers-Brillouin-Jeffreys (WKBJ) solution to the wave equation, being the first approximation in an asymptotic expansion.
While Bretherton and Garrett (1968) mention that the technique is applicable to magnetohydrodynamic waves the motivation of all the authors cited is the better understanding of atmospheric waves such as sound waves and internal gravity waves, and it is in this field that the conservation of wave action for propagation in slowly varying media has found most attention (Lighthill, 1978, Chapter 4).The reason may be that most applications in the magnetosphere have been focused on problems involving boundaries rather than slowly varying media.
While the Lagrangian technique is elegant and general, its application to specific problems is algebraically complicated, and the precise physics involved in the processes is not always apparent.This paper seeks to derive the conservation of action principle for magnetohydrodynamic waves in a slowly varying medium from the reduced equations of MHD, and to integrate its use with the MHD ray-tracing equations of Walker (2008).In so doing, it makes explicit the nature of MHD energy transfer between wave and background medium.
The nature of the problem requires the use of Cartesian tensor notation with summation over a repeated suffix assumed.The symbol for a vector quantity without a subscript denotes the magnitude of that quantity.

Linearized MHD equations in a slowly varying medium
The MHD equations (Walker, 2005, Sect. 2.4.6) for an MHD medium with density D(x j , t), velocity V i (x j , t), pressure P(x j , t), and magnetic field B i (x j , t) can be linearized, assuming that the medium, varying in space and time, suffers a small disturbance.Let the unperturbed density be ρ 0 , the magnetic field B i , the pressure P , and the velocity V i .The medium is then perturbed such that D = ρ 0 +ρ, B i = B i +b i , P = P + p, and The Lagrangian derivative giving the time rate of change as we follow the motion of a fluid element is The operator D/Dt follows the total motion of the plasma, including the perturbation velocity v i so that and includes both time and space derivatives of the zeroorder quantities.The operator d/dt ≡ ∂/∂t +V i ∂/∂x i is then the Lagrangian operator following the zero-order motion of the plasma.The zero-order flow is then described by while, to first order in the perturbation quantities, the perturbations are given by Note that, if we compare Eq. ( 7) with the corresponding expression given by Walker (2005, Eq. 21.54), there is an additional term −ρdV i /dt on the right-hand side.This was erroneously omitted (mea culpa) by Walker (2005).
3 Solutions in a slowly varying medium

Length scales and timescales
So far we have not made any assumption about the magnitudes of the rates of change of the zero-order quantities.The linearized equations only require that the perturbation is small.In principle, they describe the time evolution of a perturbation applied to a self-consistent MHD flow that obeys the zero-order equations.In practice, to obtain solutions, we need to make further approximations.One such approximation is to assume that the medium varies only on time-and length scales long compared with the characteristic period τ and wavelength λ of the perturbation.The medium is now assumed to change slowly in space and time.The slow variation can be characterized by a small quantity such that the parameters of the medium change on a timescale of order τ/ and on a length scale of order λ/ .There are two different approximations to the MHD equations in this problem.One is that the wave perturbation is small, allowing linearization of the equations.The other is the slowly varying approximation which assumes that operators ∂/∂t and ∂/∂x i , operating on zero-order quantities, are of order ω and k respectively, while when operating on first-order quantities they are of order ω and k.

First approximation: the phase integral solution
The first approximation is found by ignoring terms of order .Locally, on length scales and timescales of order λ and τ , the wave is approximately harmonic.The first stage in any WKBJ approximation (Budden, 1961, Chapter 9) is to assume a phase variation, insert it into the wave equation, get a non-linear differential equation for the phase, and obtain a first approximate solution in the form of a phase integral.We short-circuit this by assuming a first approximation of phase integral form in both space and time so that the field components vary approximately as exp i ωdt − k i dx i (11) so that ∂/∂t = iω, ∂/∂x i = −ik i , and where ω 0 is the angular frequency in the plasma rest frame.
It is Doppler-shifted relative to ω, the angular frequency in the moving frame The first-order equations to this level of accuracy become (Walker, 2005, 21.13-21.15) so that and the local dispersion relations are the same as for a uniform stationary medium with the frequency ω replaced by the Doppler-shifted frequency ω 0 .
The dispersion relations for each type of wave are for the transverse Alfvén wave and for the two magnetosonic waves, where We can write any of these formally as where 0 represents the dispersion function in the local rest frame and depends on x i and t through B i , P , and ρ.
In the special case of a sound wave V A is 0, and this becomes 3.3 Ray-tracing equations Walker (2008) has discussed ray tracing of MHD waves in a medium that varies both in space and time.The ray defines the path of a wave packet.The inclusion of time variation introduces a new feature.When the motion of the background plasma is steady state with ∂/∂t = 0, then the frequency is constant.The ray-tracing equations then consist of a set of three first-order differential equations for the rate of change of position dx i /dt of the wave packet, and a set of three for the rate of change dk i /dt of the wave vector.This is no longer true when the properties of the medium depend on time as well as the spatial coordinates.There is an additional Doppler shift associated with the time variation.This leads to the introduction of another first-order equation giving the rate of change of frequency.
The full set of ray-tracing equations is then The subscript r emphasizes that d r /dt represents the rate of change of a quantity with time following the wave packet as it travels along the ray.It may be convenient to express these in terms of the dispersion relation in the local rest frame.Then, A. D. M. Walker: MHD waves in slowly varying media from Eq. ( 16), Equation ( 24) shows how the wave packet progresses in space as time advances, while Eq. ( 25) shows how the wave vector changes in magnitude and direction as the wave packet advances.They are analogous to Hamilton's equations with frequency corresponding to energy and wave vector to momentum.The equations for k i are conjugate to those for x i .The equation for the frequency (Eq.26) also has a trivial conjugate equation, dτ/dt = 1, where τ is the time elapsed since the wave packet left its starting point.Then (x i , ω) and (k i , τ ) are the conjugate variables in a four-dimensional space-time.This does not, however, imply that relativity has been taken into account, although it would, in principle, be possible to do so.

Second approximation: energy flux
The ray-tracing equations do not, of course, provide a solution to the wave equations.This would require expressions for the field components.At this level of approximation the solution is the phase integral, which is to be evaluated along the ray.The rays are the characteristic curves in the problem.A better solution would be one in which the variation of the amplitude of each field component varied along the path.In the WKBJ method for a stationary medium the next stage of the process is to substitute the first approximation (the phase integral) into the non-linear equation for the phase to get a second approximation.This second approximation gives the amplitude of each field component.These all vary in such a manner as to conserve energy as the wave progresses.Another way of getting the same solution is to use energy conservation.In a stationary, slowly varying medium, the wave energy density is an adiabatic invariant.We could find the relationship between each component and the energy flux and use that to determine behaviour of the amplitudes.This is the route that we follow, although wave energy is no longer conserved in this case and it turns out that the appropriate adiabatic invariant is the wave action density.Walker (2005, Sect. 21.5) has carried out this procedure and has derived an expression for the energy balance between a propagated wave and a non-uniform medium.The derivation is for a steady state where the Lagrangian operator following the plasma is The only difference for a time-varying medium is that The derivation does not use the explicit form of d/dt but simply uses Eqs. ( 3), ( 4), ( 5), and ( 6) to eliminate the time derivatives of the zero-order quantities in the frame of the plasma.
The derivation including time variation of these quantities gives the same result: where where U is the energy density in the wave, i the energy flux vector, and T ij a stress tensor.There is a factor (γ − 1)/γ in the second term of the expression for the stress tensor that does not occur in Walker's expression.This corrects the error noted in the discussion of Eq. ( 7).
The energy flux vector can be shown to be the rate per unit area per unit time at which the internal energy is transported by the wave at the group velocity (Walker, 2005, Eq. 21.26).
The first term in the stress tensor is the Reynolds stress.It represents the momentum flux associated with the oscillation of the wave.If we consider an element of area dA j , moving with the unperturbed velocity V i , then ρ 0 v i v j dA j is the rate at which wave momentum ρ 0 v i is transported across dA j at velocity v j .It thus represents the mechanical force exerted by the wave field on dA j .The second term is simply the normal stress exerted by the isotropic second-order pressure of the wave (see Appendix A1).The third and fourth terms represent the Maxwell stress (Walker, 2005, Sect. 1.8) associated with the first-order magnetic perturbation b i .The Maxwell stress, in the same way, can be regarded as the electromagnetic momentum flux tensor.
The last term in the equation for energy balance Eq. ( 29) may be written The force per unit volume exerted by the wave on the unperturbed medium is −∂T ij /∂x j .Since the medium is moving with velocity V j , the wave does work on the medium −V i ∂T ij /∂x j and thus the last term in Eq. ( 34) represents the gain of energy by the wave as a result of this process.
The first term on the right-hand side has the form of the divergence of a flux vector.Explicitly we can write Compare this expression with the expression for the flux vector in a uniform medium (Eq.31).The first term is an additional second-order contribution to the transport of internal energy U : the first-order contribution to the energy density 1 2 ρ 0 (V j +v j )(V j +v j ) is ρ 0 V j v j , and there is a second-order flux term as it is transported by the wave velocity v i .The second term is the acoustic flux associated with the secondorder pressure (Eq.A6) when the zero-order velocity is nonzero.Compare it with the term pv in Eq. ( 31).The remaining terms represent the flux of magnetic energy and are of the same form as the corresponding terms in Eq. ( 31).When V i is constant, the two terms on the right-hand side of Eq. ( 34) cancel and energy is conserved.The term involving the stress tensor in Eq. ( 29) is the difference between the work done per unit volume and the energy transported and represents the net effect of the interaction between wave and unperturbed medium.

Rate of change of ω 0 and U following a wave packet
The rest frame frequency ω 0 is given by the dispersion relation (21) and is a function of x i , k i , and t.Its rate of change following a wave packet is, therefore, We can substitute for d r x i /dt from Eq. ( 24) and for d r k i /dt from Eq. ( 25) to write this as where is an operator representing the rate of change with respect to time of a quantity following the motion of the unperturbed plasma.The subscript k emphasizes that this is done keeping k constant.We can also see how U varies following the wave packet by noting that the equation for transport of energy can be written in terms of the rate of change along a ray.If we use Eq. ( 33), the divergence of the flux vector can be expanded as This can be substituted in (29) to yield In order to establish the principle of conservation of wave action in any particular case, we compare Eqs. ( 38) and ( 42).The right-hand side of Eq. ( 38) is evaluated from the appropriate dispersion relation, while in Eq. ( 42) we express T ij in terms of U .We proceed to do this for a number of special cases.Lighthill (1978, Sect. 4.6) has discussed the conservation of wave action for sound waves where the background motion is a steady-state flow.His book draws attention to the importance of the concept of conservation of wave action, but he nowhere considers the case of non-stationary flow.As we have seen for steady-state flow, the frequency remains constant and this simplifies the analysis.Sound waves are a special case of MHD waves when B → 0, and they provide a good introductory example.

Sound waves
For a sound wave, where the magnetic field is 0, the expressions for energy density (Eq.30), flux vector (Eq.31), and stress tensor (Eq.32) become If we use these expressions for the flux vector and stress tensor in Eq. ( 42 If we multiply Eq. ( 13) by v i and use Eq. ( 33), we see that Also if we use the equipartition relation (A11) in Eq. ( 43), we get 1 2 If we substitute these in Eq. ( 47), we get Now compare this with Eq. ( 38), the rate of change of ω 0 following the ray.On the right-hand side (dω 0 /dt) k represents the rate of change of the rest frame frequency following the zero-order motion of the plasma and keeping k constant.It is to be found from the sound dispersion relation (22).We use Eqs.( 6) and (4) for the derivatives of P and ρ 0 following the plasma.Then so that (noting that kV s /ω 0 = 1) Finally, subtract Eq. ( 38) from Eq. ( 50) to get Then, noting that we obtain, using Eq. ( 33), the result which shows that the wave action, with density U/ω 0 , is conserved.

The transverse Alfvén wave
For the transverse Alfvén wave we follow the same procedure as for a sound wave with the appropriate dispersion relation ( 17) and relations between the field components.It is an incompressible shear wave with p = 0, B i b i = 0, and k i v i = 0.The relations between the field components ( 13) and ( 15) are then Multiply Eq. ( 58) by b i /ω 0 and Eq. ( 59) by b i /ω 0 µ 0 , and we see that From the energy equipartition relation (A11) the energy density is As we have noted above, b i is normal to B i so that the flux vector from Eq. ( 31) is and the stress tensor from Eqs. ( 32), (61), and ( 60) is If these are substituted in Eq. ( 42), we get We now use the dispersion relation (17) to find (dω 0 /dt) k in Eq. ( 38).The derivatives of ρ and B i are found from Eqs. (4) and ( 5) so that Thus or, equivalently, which shows that, once again, the wave action is conserved along the ray.

Magnetosonic waves
The magnetosonic waves are algebraically more complicated, but we can follow the same process.The dispersion relation ( 18) is in the form of a biquadratic as it describes both waves.It would be possible to solve the quadratic equation for ω 2 0 , but the solution contains a square root and we must choose which sign applies to which wave, and this is not as convenient as finding a solution that applies to both magnetosonic waves.
In a uniform medium we can use Eqs.( 14) and ( 15) to eliminate p and b i from Eq. ( 13).The result is a set of three equations relating the three components of v i .We use a set of local magnetic-field-aligned coordinates x , x n , and x ⊥ , where x is parallel to B, x n is normal to the plane containing B and k, and x ⊥ is normal to B in this plane.The three equations then separate into two sets (Walker, 2005, Sect. 7.5.1),one involving v n representing the Alfvén wave, and the other two involving only v and v ⊥ representing the magnetosonic waves.The latter two equations may be written These are two homogeneous linear equations which are only consistent if the determinant of the matrix is 0. This determines the dispersion relation (18) which, in these coordinates, can be written In Eq. ( 42), representing the rate of change of U following a wave packet, we note that If we multiply Eq. ( 13) by v i , Eq. ( 15) by b i , subtract the second from the first, and use Eq. ( 31), we get The next objective is to express the products of the field components on the right-hand side in terms of the wave energy density U .Then we will be able to divide Eq. ( 42) by U to get an expression for (1/U )d r U/dt that only depends on the zero-order quantities and their derivatives.This is best done by using the local field-aligned coordinates and making use of the properties of the magnetosonic waves described above.The details are shown in Appendix A2.From Eqs. (A23) and (A23) we get Also from Eqs. ( 72) and () These two results can be substituted in Eq. ( 42) with the result that The next step is to evaluate (dω 0 /dt) k in Eq. ( 38) by differentiating the dispersion relation.For the magnetosonic waves this is algebraically tedious and is carried out in Ap- If the second of these is subtracted from the first, we get d r dt which expresses the conservation of the wave action for the magnetosonic waves.

Examples of the use of action conservation
In this section we apply the principle of conservation of wave action to some illustrative problems.These are of a tutorial nature rather than applications of immediate relevance.

Sound wave in a medium undergoing compression
We start with the simplest possible example.Consider a plane sound wave propagated in the z direction in a gas that undergoes a slow adiabatic compression.The gas is assumed to be in a long cylinder with axis in the z direction and a diameter very large compared with the wavelength.The compression is assumed to take place by reducing the diameter of the cylinder.The zero-order velocity V i of the gas resulting from the compression is then at right angles to the direction of propagation so that there is no Doppler shift and ω = ω 0 .This velocity is a function of x i and t, but the uniform compression means that its spatial derivatives are independent of position being functions of time only.The sound speed V S (Eq.20) is also a function of t only.The ray-tracing (Eq.23) with the group velocity equal to the sound speed become The first three equations (Eqs. 79,80,81) give the path of a wave packet while the compression takes place.They show that the velocity of a wave packet during the compression has a component along the z axis equal to the sound speed.In addition the wave packet is carried towards the axis of the cylinder with the velocity of the medium.This is illustrated in Fig. 1.Consider portions of rays AB and CD on either side of the axis OP of the container, at time t 0 just before the compression starts.During the compression a wave packet such as that at A moves along a ray path AA and reaches A at time t when the compression ends.Other wave packets such as B move along parallel paths such as BB .The behaviour is analogous to the behaviour of streak lines in time-varying fluid dynamics.The net effect is that the ray pencil AB moves inwards as it progresses until it reaches A B , and CD does the same to reach C D .Clearly, because the ray pencils move with the gas, the cross-sectional area of any ray tube changes proportionally to the cross-sectional area of the container.
The equations for the transverse components of the wave vector (Eqs. 82,83) show that, if k x and k y are initially 0, they will remain 0. Equation ( 84) shows that k z remains constant.The wave thus remains a plane wave propagated in the z direction with a constant wave length.Finally Eq. ( 85) can be integrated directly to show that ω varies with time as We thus see that, as V S changes as a result of the compression, the frequency also changes.This is a kind of Doppler shift that does not result from the motion of the medium, the source, or the observer.The cross section of the ray tubes changes in proportion to the cross-sectional area A of the container.The density is inversely proportional to A through the adiabatic relation During this change the wave action is conserved.If the wave energy density is U , the quantity U A/ω remains constant.
The energy density thus varies as In the sound wave the magnitude of the energy flux is U V S so that The total energy per unit length W of the wave train changes as For example in an ideal gas γ = 5/3 and Since γ > 1 the total wave energy increases when the gas is compressed.This means that the work done in the adiabatic compression is greater than that needed to increase the internal energy of the gas.For a simple solar wind model with large plasma β so that the fast wave approximates a sound wave, if there is a spectrum of waves in existence, we can infer that temporal compression will increase not only the temperature but also the wave energy.Explicit calculation for a more realistic fast wave would show the same behaviour.

Isotropic Alfvén wave propagated through a shear layer
First we consider a steady-state situation in which the unperturbed medium does not change with time.Consider an isotropic Alfvén wave in a shear layer.The simplest possible case is that for which the density is constant, the pressure negligible, and the magnetic field is constant and normal to the z axis.The velocity is in the x direction and is a function of z.The fast wave is then an isotropic Alfvén wave.We consider the case where the wave vector lies in the x-z plane and has the dispersion relation The ray-tracing equations (Eqs. 24,25,26) for this case become dx dt This immediately shows that ω is constant as expected in the steady state, and that k x is constant, which is an expression of Snell's law.The right-hand sides of Eqs. ( 93) and ( 94) are the x and z components of the group velocity.
Figure 2 shows the results of a ray tracing in a shear layer by integrating these equations using a Runge-Kutta process.The dependence of the velocity on z is given by The dependence of V on z is shown in Fig. 2a, and the parameters for the shear layer used are shown in the figure.The maximum shear occurs at z = 0.Each ray is started at the point O below the shear layer where the medium has a very small velocity and is essentially at rest.The initial direction of the wave normal is spaced at equal angles so that a fan of rays spreads out from O. In Fig. 2b the interruptions in the rays occur at equal time intervals for a point on the ray moving at the ray velocity (which for these waves is the same as the group velocity) (Budden, 1961, Sect. 13.19).This is the velocity of the point of intersection of a plane wavefront travelling with the phase velocity and the ray.In a stationary MHD medium it is the same as the phase velocity (Walker, 2005, Sect.9.2.5), but this is no longer true in a moving medium.These interruptions therefore represent successive positions of a wave crest.
There are several noteworthy features in this ray pattern.Were it not for the shear, the medium would be uniform and the rays would travel radially from O, producing spherical wave fronts.This is the situation near O, where V is very small.As the velocity increases, since the group velocity is the sum of the group velocity in the rest frame of the medium and the velocity of the medium itself, the rays are swept to the right.Those rays with negative k x initially make a positive angle with the z axis and are rotated clockwise relative to it.No matter how large the initial angle, when k x is negative, the right-hand side of Eq. ( 93) eventually becomes 0 and the motion in the x direction is reversed.When k x is positive and small, the initial x component of the ray velocity is positive, so there is no reversal of direction.The magnitude of the x component of the ray velocity, however, increases substantially and the ray is still swept to the right.For positive values of k x the value of k z decreases along the ray, as can be seen from Eq. ( 96).It eventually becomes zero and changes sign, and hence from Eq. ( 94) the ray is reflected.Another point of interest is the focusing of the reflected rays seen at the bottom right-hand corner of the ray pattern.
In order to study the conservation of action in this geometry, it is necessary to know how the cross-sectional area of a ray tube changes along its length.This is not a trivial problem and we shall postpone it.Instead we shall consider a plane wave situation.Consider one of the rays with negative k x and suppose that it originates from a very distant source.Then the wave fronts are approximately plane and the separation of adjacent rays in the x direction remains constant.
Consider Fig. 3a.It shows a tube of rays passing through the boundary of a rectangular area A where the group velocity is V G .The tube penetrates the shear layer and reaches a level where the group velocity is V G .The flux of wave action into the tube is equal to the flux out.Thus If the starting level is well below the shear layer, then ω 0 = ω and ω 0 = ω−k x V 0 .The ratio of the energy flowing out of the tube to that flowing in is therefore We see then that for negative k x there is a gain in energy.However those rays that start with positive k x lose energy.
It might be thought that if V 0 were sufficiently large they would acquire negative energy, but the reflection condition ensures that this cannot occur.The situation is illustrated in Fig. 3b.Thus the reflected waves do, in fact, lose energy as they are propagated upwards, but this is regained after they are reflected so that there is no net change.So far this calculation has applied to the total energy in the ray tube and would apply equally well to the diverging ray tubes of Fig. 3a.If we want to calculate the flux vector, and hence the energy density and the amplitudes of the field components, we need to know the cross-sectional area of the ray tube.For diverging ray tubes such as those of Fig. 3a the calculation is not trivial and will not be pursued in this paper.For non-diverging ray tubes such as those of Fig. 3b matters are simpler.The cross-sectional area of the ray tube is simply A 0 = A cos θ , where θ is the angle between the ray tube and the z axis.Equation ( 99) can just as well be written For this example cos θ can be found as a function of z.The only dependence on z is through V (z).Both ω 0 and k z depend on V through which leads to which allows the cross-sectional area and hence the flux vector and energy density along the ray to be found.The direct calculation is only possible because the plane geometry allows it.In general some means of calculating the crosssectional area of the flux tube as the integration progresses must be used.Buckley (1982) has proposed a method of doing this, but, surprisingly, it does not appear to have been applied in practice.Work is in progress in applying it to MHD waves.

Transverse Alfvén wave in medium undergoing compression
Next we consider another problem in which the plasma conditions vary as a function of time.Walker (2008) traced rays using Eqs.( 24), (25), and (26).He considered a uniform region of plasma containing a sheet of current flowing in the y direction, and situated on the plane z = 0.A uniform magnetic field was associated with the current sheet.For z > 0 it flowed in the x direction and for z < 0 in the −x direction.This can be regarded as a crude model of the magnetotail near its axis.A transverse Alfvén wave was assumed to be propagated along the x axis while the system changed slowly in time.The surface current density in the current sheet was increased slowly and quasistatically, by which was meant that any acceleration was so small that the plasma remained in quasi-equilibrium as conditions changed.The magnetic field increased uniformly, and the electromotive force arising from the changing magnetic flux provided an electric field associated with a plasma drift inwards to the current sheet, at a velocity consistent with the frozen-in field line theorem.The surface current density of the sheet changes with time in such a manner that, over a period of time T , the magnetic field magnitude changes smoothly from an initial value B 0 to a final value B F according to where f is the fractional change in B. As this change takes place, the frozen-in field lines move towards the current sheet and the plasma is compressed.
Figure 4a shows the result of a ray tracing as the background parameters are changed.Initially, at t = 0 there is a pencil of transverse Alfvén waves propagated to the left along the line ABCD.As the current increases, the points on the ray pencil ABCD move successively to and A 4 B 4 C 4 D 4 respectively along the separate ray paths shown.The net effect is that the pencil of rays remains on the same field line as it is convected towards the current sheet.At all times the wave normal remains aligned with the magnetic field, but the ray follows a path that keeps the wave packet on the same convecting field line.The wavelength in the x direction remains unchanged so that k x is constant.In the time-varying case, just as in the simple case of a sound wave in a medium undergoing compression, successive points along a pencil of rays do not follow the same ray path.Figure 4b shows a ray tube of rectangular cross-sectional area of width A = wh.As the wave packet follows the ray path, the plasma is compressed in the z direction so that the cross-sectional area becomes A 1 = wh 1 .At t = 0 the degree of compression is imperceptible and the ray is directed parallel to the field; at t = t 4 the compression is essentially complete and the same is true.The medium is at rest in each case, and the group velocity for the transverse Alfvén wave is V A = B/ √ µ 0 ρ 0 parallel to the magnetic field.The magnetic flux through A is constant so that The compression is in the z direction, so the density is inversely proportional to h.Thus The action flux vector in Eq. ( 68) is where we have used the dispersion relation ( 17).The conservation of wave action implies that the flux of wave action into the ray tube through A is equal to the flux out through A : or since A ∝ h.The energy density thus increases by a factor h/h during the compression.The net gain of energy can be found from Eq. ( 110).The power delivered to the wave in the ray tube at A is U V G A and that extracted at We see, therefore, that the energy of the wave is increased in the compression.External work has been done on the unperturbed plasma by the compression, and some of this energy has been used to do work on the wave through the stress term in Eq. ( 29).
This situation is more complicated than the steady-state problem of the previous section.We have taken care to look at the energy flux into the volume represented by the ray tube in Fig. 4b at an initial time before the compression has started and a final time when it is complete.At each of these times the motion is steady state and we can calculate the flux of energy into or out of the volume from the steady-state flow.While the compression is in progress, the energy flux at an intermediate time through a cross section of the ray tube will not be constant.Before the compression takes place, it will be 0. As the pencil sweeps through the cross section, it will rise to a maximum and then fall again, as will the action density.We need to calculate the flux as we follow a wave packet in time.

Interaction of the waves with the background
The results of our computations show that, when the velocity of the medium is a function of both space and time, the wave exchanges energy with the background.This means that the zero-order flow that has been assumed is modified by the wave.This happens on temporal and spatial timescales that are large compared with the period and wavelength and does not invalidate our assumptions.As outlined by Walker (2005, Sect. 21.5.1)there are other second-order terms in the total MHD energy conservation equation that represent the energy change in the background.The neglect of these second-order terms is equivalent to a quasi-linear approximation analogous to that used in the study of unstable plasma distribution functions close to quasi-equilibrium.
We expect, therefore, that a spectrum of MHD waves propagated in a moving non-uniform plasma such as the solar wind will be modified as they flow, consequently modifying the flow of the wind.As described by Lighthill (1978, Chapter 4) for internal atmospheric waves, the energy exchange is most efficient at a critical layer where For the MHD waves that we are considering, such critical layers are inaccessible in a slowly varying medium; they only occur where the wave is evanescent.For the atmospheric sound waves described by Lighthill (1978) they only occur when the Earth's gravitational field is significant when the waves are described as internal waves.Similarly MHD waves would only show accessible critical layers sufficiently near the surface of the Sun, where the gravitational field is large.The theory of this paper would have to be extended to include this.

Discussion and conclusions
In this paper we have explicitly derived the principle of conservation of wave action in slowly varying magnetohydrodynamic media directly from the basic equations of magnetohydrodynamics and applied it to some idealized examples.While the principle is well known from the work of Whitham (1965) and Bretherton and Garrett (1968), it has not been applied to such problems before; the Lagrangian approach of these authors is powerful and very general but does not provide as much physical insight into specific problems as this more direct approach.The paper, therefore, is partly didactic in nature.
The ray-tracing method, together with the equation describing energy flow and exchange along the rays, are equivalent to a WKBJ solution of the problem.This is the first term in an asymptotic series.At this level of approximation the three modes -fast, slow, and transverse Alfvén wave -remain distinct, with no coupling or mode conversion studied, for example, by Cally (2006) or Cally and Andries (2010).Coupling processes take place near caustic surfaces when rays approach each other and need a higher order of approximation for proper treatment.
The most important result of the theory in this paper is that it enables us to compute the energy exchange between an MHD wave and its surroundings when the medium in which it is propagated is changing slowly both in space and time.In such cases we can study the propagation of the wave using ray-tracing techniques.
We have only considered plane-stratified systems as examples in this paper.The technique allows for waves from arbitrary sources with diverging or converging rays, provided that we have a means of calculating the cross-sectional area of the ray tube as conditions change.This can be done in principle by the method developed by Buckley (1982).We have found no applications of this method in the literature, and it appears to have been largely overlooked.It deserves attention, and work is in progress to apply it to the waves described in this paper.
), we get the rate of change of U following www.ann-geophys.net/32/1495

Figure 1 .
Figure 1.Sound wave in a medium undergoing compression (see text).

Figure 2 .
Figure 2. Isotropic Alfvén waves originationg from a point source O in a shear layer.(a) The layer profile.(b) The results of ray tracing.The ray pattern is interrupted at equal time intervals for a feature on the wave packet travelling at the ray velocity.The interruptions therefore trace out the pattern of the wave fronts.

Figure 3 .
Figure 3. Ray tubes for plane waves in a shear layer.(a) Wave transmitted through layer.(b) Wave reflected from layer.

Figure 4 .
Figure 4. Ray tracing of transverse Alfvén wave in the magnetic field above a current sheet as the sheet current density is increased (see text).