What Controls the Structure and Dynamics of Earth’s Magnetosphere?

Unlike most cosmic plasma structures, planetary magnetospheres can be extensively studied in situ. In particular, studies of the Earth’s magnetosphere over the past few decades have resulted in a relatively good experimental understanding of both its basic structural properties and its response to changes in the impinging solar wind. In this article we provide a broad overview, designed for researchers unfamiliar with magnetospheric physics, of the main processes and parameters that control the structure and dynamics of planetary magnetospheres, especially the Earth’s. In particular, we concentrate on the structure and dynamics of three important regions: the bow shock, the magnetopause and the magnetotail. In the final part of this review we describe the current status of global magnetospheric modelling, which is crucial to placing in situ observations in the proper context and providing a better understanding of magnetospheric structure and dynamics under all possible input conditions. Although the parameter regime experienced in the solar system is limited, the plasma physics that is learned by studying planetary magnetospheres can, in principle, be translated to more general studies of cosmic plasma structures. Conversely, studies of cosmic plasma under a wide range of conditions should be used to understand Earth’s magnetosphere under extreme conditions. We conclude the review by discussing this and summarizing some general properties and principles that may be applied to studies of other cosmic plasma structures.

A cartoon of the Earth's magnetosphere forms on the dayside on the magnetospheric side. Since in general there is a change in the strength and orientation of the magnetic field (in common with the other magnetospheric boundaries), it is also referred to as the magnetopause current sheet. The magnetopause is not a perfect shield and can be 'open' or 'closed' depending on the surrounding plasma conditions. This implies that there can be mass transport across the magnetopause. For example, under southward IMF conditions, as is drawn in Fig. 1, magnetic reconnection occurs along an X-line extending out of the page, and creates plasma jets directed north and south along the magnetopause current sheet. However, although energy transfer is enhanced for southward IMF, the mass transport is enhanced when the IMF is northward. Thus, the structure and dynamics of the magnetopause are also strongly dependent on the solar wind conditions, and are discussed further in Sect. 3.
The dynamic pressure of the solar wind compresses the magnetosphere on the dayside, but on the nightside an extended tail is formed. The plasma mantle forms at the edge of the magnetotail and can, to some extent, be considered the tailward extension of the low latitude boundary layer. The tail lobes consist of magnetic flux that is connected to the planet at one end, and are largely devoid of plasma compared to the other magnetospheric regions. Magnetic reconnection also occurs at a tail X-line, returning plasma on closed field lines towards the planet (Dungey 1961). This is leads to the formation of the plasma sheet (green). Closer to Earth are located the plasmasphere (light blue) and the radiation belts (yellow/dark blue). We do not further discuss the inner magnetosphere, radiation belts or aurora here. The structure and dynamics of the magnetotail fundamentally depend on the manner in which plasma and magnetic flux enters the magnetotail. The magnetotail exhibits dynamic and bursty behaviour, controlled by reconnection, which corresponds to the storage and release of plasma and magnetic energy. This is described further in Sect. 4.
Whilst this cartoon is relatively simple and appears to suggest that the magnetosphere exists in a state of dynamic equilibrium, it should be understood that since the solar wind varies continuously, on time scales of minutes to hours, these boundaries and regions are not stationary and exhibit considerable dynamical behavior. In addition, there are various instabilities that create dynamics even with a steady solar wind. Computer simulations are crucial to placing in situ experimental observations in context, as well as revealing the large scale system dynamics. In the final part of this review we discuss global simulations of the magnetosphere, and describe how models are being developed and coupled in order to better capture the various physical processes at work.

Controlling Parameters
Before proceeding further, we briefly discuss the main parameters that control the structure and dynamics of planetary magnetospheres. In the subsequent sections it will be seen that different parameters are important for different regions.

Solar Wind Magnetic Field Strength and Orientation
The orientation of the solar wind (or interplanetary) magnetic field (IMF) is described in different ways depending on the context. For studies of the bow shock, the angle between the solar wind magnetic field and the local shock normal, θ BN , is used. If θ BN < 45°, the shock is said to be quasi-parallel (i.e., the shock normal is approximately parallel to the magnetic field), whereas if θ BN > 45°, the shock is said to be quasi-perpendicular. For magnetospheric studies, the clock angle (θ = tan −1 (B y /B z )) is used to describe the orientation of the field relative to the dipole field. If the solar wind and magnetospheric magnetic fields are aligned at the nose of the magnetopause (clock angle = 0), the IMF is said to point northward. In contrast, if the clock angle = 180°, then the solar wind and magnetospheric fields are opposite, and the IMF is said to point southward. Finally, the cone angle (ϕ = cos −1 (B x /|B|) is the angle between the IMF and the x direction. If the cone angle is small or close to 180°, the IMF is said to be radial. To illustrate the typical properties of the IMF at Earth, Fig. 2(a) shows Wind satellite measurements of the solar wind magnetic field strength over the 11 year solar cycle (year averages) (Acuña et al. 1995). It can be seen that the strength of the IMF at Earth is of the order of 5 nT (although this masks considerable variability on short timescales), and was at a maximum value in 2003, around solar maximum. Figure 2(b-d) shows Wind yearly averaged measurements of the solar wind velocity, density and temperature. Figure 2(e) shows the solar wind ion plasma beta (β SW ), the ratio of the thermal to magnetic pressure in the solar wind. This typically varies between 0.4 and 0.8, although again this masks considerable variability on short timescales. The solar wind Mach number is the ratio of the solar wind speed to a characteristic plasma wave speed (either Alfvén, or magnetosonic) M A or M MSthe solar wind Alfvén Mach number typically varies between 6 and 12, although again this masks considerable variability.

Solar Wind Plasma Beta and Mach Number
Planetary Rotation Rate and Plasma Sources At Earth, the magnetosphere is largely driven by the solar wind, although ionospheric plasma (oxygen) is often present in the magnetosphere (e.g., Strangeway et al. 2000). Mercury's magnetosphere is even more strongly driven by the solar wind (e.g., Slavin et al. 2012b). At Jupiter and Saturn, Io and Enceladus are sources of plasma that load the magnetosphere internally (Bagenal et al. 2007;Dougherty et al. 2009). Furthermore, both Jupiter and Saturn are rapidly rotating, and so the interaction of Jupiter (in particular) with the solar wind is very different to that at Earth, since it is dominated by rotation and internal plasma, and the solar wind driving is thought to be rather weak (Vasyliunas 1983). As such, comparative magnetospheric studies are becoming increasingly important (e.g., Keiling et al. 2014).

Planetary Bow Shock Structure
The bow shocks of planetary magnetospheres are curved, and so even if the upstream conditions are uniform, the geometry of the shock changes across its surface as shown in Fig. 3. Here we briefly summarise some of the main features; many more specific reviews have been published (e.g., Tsurutani and Stone 1985;Fuselier 1994Fuselier , 1995Le and Russell 1994;Burgess 1995;Burgess et al. 2005;Eastwood et al. 2005b). In Fig. 3, the magnetic field is perpendicular to the shock normal in the lower part of the figure, and it is parallel to the shock normal in the upper part. As the solar wind reaches the shock, the tangent field line represents the first point of contact (here the magnetic field is exactly perpendicular). Just behind the tangent field line, electrons are able to stream back along the field into the upstream region; this is denoted by the electron foreshock boundary. The ions are not able to escape along the tangent field line, but can escape from quasi-perpendicular geometries. The ion beam streaming from the quasi-perpendicular foreshock is typically cold, and is a field aligned beam. The combination of these beams and the solar wind core distribution is subject to the right hand resonant ion beam instability, generating ULF waves with characteristic periods of ∼30 s at Earth (e.g., Eastwood et al. 2005a). However, the waves are immediately convected anti-sunward into the quasi-parallel shock, and so the waves are not necessarily observed in conjunction with the distributions that created them.
Hotter and more energetic beams, known as diffuse distributions, are also observed in the foreshock. It was originally thought that these hot beams arose because of wave-particle interactions and disruption of the field-aligned beams. However, the diffuse distributions contain solar wind quantities of He 2+ , whereas the field-aligned beams consist only of protons, and so they are not directly related (Fuselier 1995). In fact, diffuse distributions arise from the quasi-parallel shock. However, the curvature of the bow shock at Earth means that there is considerable cross talk and the quasi-perpendicular and parallel sections are strongly coupled. More generally, the magnetic geometry means that the quasi-perpendicular shock jump is thin (e.g.,  whereas the quasi-parallel shock is much more complex and extended (e.g., Burgess et al. 2005).
This curvature also means that the shock itself is quite spatially inhomogeneous, even when only the Rankine-Hugoniot jump conditions are considered. To illustrate this, Fig. 4 shows how the shock compression ratio (r) varies over the bow shock surface for different values of the upstream Mach number and plasma beta. These figures are generated with the IMF aligned to the upstream flow to better illustrate the effect of bow shock curvature, and we use the Merka et al. (2005) shock model. The model shape depends on M A . We note that as the solar wind ram pressure increases (P dyn ), the magnetosphere compresses, and so the obstacle and the shock change in size. In this figure, M A is varied only by varying the magnetic field strength, and P dyn is constant. The plasma beta is varied independently by changing the solar wind temperature. High solar wind M A suppresses the effects of curvature since in the high M A limit r → 4, and increasing the plasma beta decreases the compression ratio.

The Bow Shock/Foreshock as a Site for Particle Acceleration
Particle acceleration is intimately related to the foreshock; for example, Fermi acceleration is naturally expected to occur at parallel shocks. Fermi acceleration of a charged particle in space takes place when the particle finds itself in a situation analogous to a ball confined between two converging walls (Fermi 1949). Because the ULF waves described above are moving towards the shock front in the shock-rest-frame, the ions undergoing multiple interactions with upstream ULF waves, the shock itself, and downstream waves are in a situation similar to a ball sandwiched between converging walls. Indeed they are accelerated and higher energies are available for those ions that interact more. Diffusive shock acceleration Fig. 4 The highly curved nature of planetary bow shocks means that there is significant variability in shock parameters over their surface, even when the upstream conditions are uniform is thought to enable the acceleration of ions in the diffuse distribution to high energies and overall this physics is thought to lie at the heart of cosmic ray production in astrophysical shocks (for a recent review see e.g., Burgess et al. 2012).
The ion acceleration process described above has been studied in detail using hybrid code simulation, a technique to study MHD-scale phenomena including ion kinetic effects (e.g., Hellinger et al. 2002). Some modifications to the original idea were made through detailed analysis of the results. For example, while it had not been expected in the original theory, it was found that ions were accelerated upon interaction at a shock front in addition to the acceleration upon scattering by the wave in the upstream region (Sugiyama et al. 2001). The simulation results also nicely reproduced the features reported by observations at the terrestrial bow shock (Burgess et al. 2005).
The problem, however, is that the interaction time available at the terrestrial bow shock is very limited compared to those at huge astronomical objects. Detailed in-situ observations at the terrestrial bow shock, whilst certainly very useful in unveiling complicated plasma physical processes in some aspects, cannot definitely say what will happen when the interaction interval is highly extended. Because of their confidence in the investigation scheme, backedup by an accumulation of successful observation-simulation benchmark results, Sugiyama (2011) has run a simulation for a much longer time in a much larger box than any other studies (and in the terrestrial situation). It is found that the accelerated population forms a power-law shaped energy distribution and the maximum energy of the power-law part in-creases in time with the power-law index being unchanged. The questions that remain to be addressed are: What is the key element that enables the expansion of the energy spectrum in time? Can the physics of the energy spectrum be understood within the test-particle approach, or are self-consistent ion-kinetic effects also playing a critical role? Another limitation of observational studies at the terrestrial bow shock is in the Mach number range that can be surveyed. The Alfven Mach number M A at the terrestrial bow shock rarely exceeds ∼20 while a much higher M A is expected in astronomical scenes. Is there a substantial change in parallel shock physics and the associated ion acceleration process when M A is so high? Once these three questions are answered by large-scale hybrid simulations, with regard to ion acceleration process at parallel shocks, a clear path bridging the gap between heliophysical and astrophysical shocks will be established.
Whilst ion acceleration leads to cosmic rays that are detected directly, in the astrophysical context electron acceleration is detected via radio and X-ray emission. Images of supernova remnant SN1006 show that this emission is inhomogeneous and spatially limited, and so it is of interest to establish whether this emission occurs in the parallel or perpendicular shock regime. At low Mach number shocks at Earth, electron acceleration occurs for perpendicular geometry as seen in the previous section (e.g., Krimigis 1992;Oka et al. 2006). More generally however, supernova remnant (SNR) Mach numbers are much higher. If electrons are accelerated by parallel shocks, then above a certain energy they will interact with ion generated waves and also undergo Fermi acceleration. One may then ask how the seed population arises-the so-called 'injection problem' and ideally one would wish to study this with in situ measurements. Whilst this cannot be investigated at Earth, recent observations have shown the existence of energetic electrons at Saturn's bow shock where M A ∼ 100, providing new insights into electron acceleration (Masters et al. 2013).

Time Variability: Interaction of Solar Wind Structure with the Bow Shock
In this subsection, we consider how discrete structure in the solar wind can control the structure and dynamics of the bow shock, with consequences for the overall dynamics of the magnetosphere itself. Whilst there are many interactions that can be mentioned, here we highlight two in particular: the interaction of a tangential discontinuity in the solar wind magnetic field with the bow shock, which can generate a Hot Flow Anomaly, and the interaction between an interplanetary shock and the bow shock, which leads to strong particle acceleration.
Hot Flow Anomalies (HFAs) are disruptions of the solar wind flow observed in the vicinity of the terrestrial bow shock and are caused by the interaction of a tangential discontinuity (TD) in the IMF with the bow shock (Schwartz et al. 1985;), as illustrated in Fig. 5. Since the solar wind is frozen in, there is a convection electric field, which is perpendicular to the IMF. If the magnetic field connects to the shock on at least one side (Omidi and Sibeck 2007b), and if the solar wind convection electric field points into the TD on at least one side (Thomsen et al. 1993), ions specularly reflected at the shock are channeled back along the current sheet (Burgess 1989;Thomas et al. 1991). The backstreaming ion population is then heated and expands, driving weak shock waves (Fuselier et al. 1987;Lucek et al. 2004) and excavating the solar wind, so reducing the bulk density, and changing the plasma velocity moment. The core of the HFA typically contains hot plasma; T i ∼ 100 eV (∼10 × greater than the ambient solar wind), accompanied by a significant deflection of the plasma flow away from the antisunward direction. In the core, the bulk plasma density is reduced, whereas in the edge Fig. 5 A cartoon illustrating the formation of a Hot Flow Anomaly when a tangential discontinuity with appropriate magnetic field geometry intersects the bow shock. The hot plasma generated in the core of the HFA (blue) expands laterally resulting in regions of compressed plasma (red) at the edges of the HFA which can also develop shock waves on the outer edges (dashed line). The solar wind ram pressure is reduced inside the hot core region causing the magnetopause to dramatically expand. The HFA is attached to the TD that is convected by the solar wind, and so the point of contact tracks across the bow shock surface, whilst the HFA develops regions the plasma density and magnetic field are enhanced. These features are typical of HFAs previously identified in the literature (Paschmann et al. 1988;Schwartz et al. 1988;Thomsen et al. 1988).
HFAs typically last a few minutes, and in dramatically disrupting the solar wind dynamic pressure, they have been observed to cause changes of more than 5 Earth radii (R E ) in the magnetopause location (Sibeck et al. , 1999aJacobsen et al. 2009). The deformation of the magnetopause creates field-aligned currents that connect to the high-latitude ionosphere, and create ionospheric disturbances such as magnetic impulse events  and traveling convection vortices (Jacobsen et al. 2009). HFAs have also been seen to create transient magnetospheric ULF waves ) and enhanced auroral emission (Fillingim et al. 2011). It is important to note that HFAs are generated by apparently ordinary discontinuities in the solar wind. It is therefore the kinetic physics of the bow shock that leads to a highly non-linear and global system response.

Interaction of an Interplanetary Shock with the Bow Shock
The shock-shock interaction is a well-established particle acceleration mechanism in astrophysical and space plasmas, but very difficult to study observationally using in situ measurements. Recently, the collision of an interplanetary (IP) shock with the Earth's bow shock on 10 August 1998 was identified as one of the rare events where detailed in situ observations of the different acceleration phases could be made (Hietala et al. 2011). This study used data from the ACE, Wind and Geotail spacecraft as shown in Fig. 6.
The interaction could be divided into 4 phases. ACE was magnetically connected to the IP shock but not to the bow shock, allowing the seed population to be characterized (phase 1). In phase 2, Wind observed several particle bursts coming from the bow shock direction at times when it was connected to the quasi-perpendicular bow shock. In phase 3, Wind became continuously connected to both shocks, and measured an increasing flux as well as two counter-streaming populations until the IP shock passed over it. Geotail was closer to Earth than Wind and was continuously connected to both shocks. It recorded the highest intensity at the IP shock crossing, but immediately after the crossing, Geotail also observed a burst of very high energy particles propagating sunwards (phase 4). Based on the velocity Fig. 6 Schematic picture of the shock-shock collision observed on August 9-10, 1998. The black lines depict the IMF. The red paraboloid represents the bow shock of the Earth, and the pink region its foreshock. The red line represents the IP shock, and the red dashed line indicates its position when it hit the bow shock. The numbers refer to the different phases of particle acceleration. Adapted from Hietala et al. (2012b) dispersion of the burst and analysis of the geometry of the two shocks, Hietala et al. (2011) deduced that these particles had been released from the magnetic trap between the shocks as they collided. Hietala et al. (2012b) used a global 2.5D test-particle simulation to further study particle acceleration in this event. They concentrated on the last phases (3 and 4) of the shock-shock interaction, when the shocks approached and passed through each other. Comparison of the simulation results with the observations of Wind and Geotail verified that the main features of the measurements can be explained by shock-shock interaction in this magnetic geometry, and are in agreement with the previous interpretation made by Hietala et al. (2011) of particle release.

Structure and Dynamics Downstream of the Bow Shock: High Speed Jets
Here we discuss recent progress in studying the structure and dynamics of the magnetosheath, and in particular the formation of High Speed Jets (HSJs), temporally and spatially localised regions of magnetosheath plasma which exhibit high dynamic pressure, kinetic energy density, and/or particle flux (Nemecek et al. 1998;Savin et al. 2008;Hietala et al. 2009;Amata et al. 2011;. These studies show the dynamic pressure can be enhanced by up to ×15 the surrounding magnetosheath pressure, and in the subsolar region (i.e., the magnetosheath downstream of the nose of the bow shock) HSJs are super-magnetosonic 14.2 % of the time.
Studies show that HSJs have a size of ∼4000 km parallel to the flow and ∼1200-7000 km perpendicular to the flow, meaning that they exist on fluid scales (Hietala et al. 2012a;). Thus, HSJs can locally distort the magnetopause (Hietala et al. 2009;Shue et al. 2009;Amata et al. 2011) generating both magnetopause surface waves and/or inner-magnetospheric compressional waves ). As such the effects of the jets have been seen in the magnetosphere all the way to the ground (Dmitriev and Suvorova 2012;Hietala et al. 2012a;. HSJ occurrence seems to be controlled only by the IMF cone-angle (see Sect. 1); subsolar HSJs occur predominantly during intervals of low cone-angle (Suvorova et al. 2010;. They tend to be found more often downstream of the quasi-parallel shock and closer to the bow shock than the magnetopause ). As such, HSJs are thought to be connected to quasi-parallel shock geometry and ion foreshock processes. HSJs interact with the surrounding flow in the magnetosheath, and can slow down and become indistinguishable closer to the magnetopause, but still a significant number reach the magnetopause and impact the magnetosphere.
The main source of HSJs is not solar wind discontinuities . Instead, it appears to be related to ripples on the bow shock itself. Large scale structure in the foreshock is thought to steepen as it is convected earthward, leading to a dynamic and cyclical shock reformation process that would naturally introduce rippling of the shock surface (Omidi et al. 2005;Blanco-Cano et al. 2009). In this mechanism, the ripples change the angle at which the incoming flow meets the shock. At an appropriately inclined shock the downstream flow is compressed but not significantly decelerated (Hietala et al. 2009).
In a recent study, , combining four years of THEMIS satellite data  with model calculations of bow shock ripples, and concentrating on the magnetosheath close to the shock during intervals when the IMF cone angle was small, found that 97 % of the observed jets could be produced by local ripples of the shock under the observed upstream conditions. The relevant parameters for the ripple-based jet formation mechanism were found to be the upstream M A and β, in addition to the IMF orientation. They also found that the coherent jets formed a significant fraction of the high dynamic pressure tail of the magnetosheath flow distribution. This distribution is consistent with ripples that have a dominant amplitude to wavelength ratio of about 9 % (i.e. a wavelength of ∼1R E and an amplitude of 0.1R E ), present ∼12 % of the time at any given location.

Basic Structure of the Magnetopause
As described in the introduction, the magnetopause marks the edge of the magnetosphere where the ram pressure of the shocked solar wind balances the magnetic pressure of the confined dipole. Here we briefly outline some of the essential results and features of magnetopause structure and dynamics. The magnetopause itself has been the subject of numerous more-detailed reviews and monographs (e.g., Lundin 1988;Song et al. 1995;Paschmann 1997;Sibeck et al. 1999b;Farrugia et al. 2001;De Keyser et al. 2005;Phan et al. 2005a;Lavraud et al. 2011;Hasegawa 2012), and the interested reader is invited to consult these articles and reviews for more information.
The magnetopause is not impermeable, and in reality solar wind plasma can and does cross the magnetopause onto closed magnetospheric field lines. This means that the basic structure of the magnetopause is more extended than might be expected, with the formation of what is known as the low-latitude boundary layer (LLBL), as shown in Fig. 1 in the introduction. The LLBL is a near-permanent feature earthward of the magnetopause containing mainly solar wind plasma and in fact a large fraction of plasma in the magnetosphere is of solar wind origin.
The structure and dynamics of both the magnetopause and the LLBL strongly depend on the solar wind magnetic field and plasma conditions. This is due to the fact that several different physical mechanisms operate at the magnetopause with some being more dominant than others depending on the boundary conditions. As such, the main goals of magnetopause research in the past several decades have been to reveal the key mechanisms operating therein, their consequences for transporting plasmas across the boundary, and what controls their occurrence or dominance. The key processes that drive magnetopause dynamics include magnetic reconnection, the Kelvin-Helmholtz instability and diffusive entry, and are illustrated in Fig. 7. These are general plasma physical processes that may also occur in other cosmic plasma structures, and so the knowledge gained in studying their properties at the magnetopause could be applicable in many other contexts. Finally, the manner in which solar wind plasma enters the magnetosphere directly influences magnetotail dynamics; this is discussed further in Sect. 4.

Magnetic Reconnection
Magnetic reconnection is in itself one of the most important phenomena that can occur in plasmas, and in the context of the magnetosphere is an important topic of study in its own right (for recent reviews see e.g., Paschmann et al. 2013). It enables the formation of open field lines, connected to the Earth in one direction and into the solar wind in the other direction. The simplest configuration usually considered corresponds to southward IMF, which is shown in Fig. 7(a). Reconnection between the IMF (red field line) and the magnetospheric magnetic field (black field line) at the subsolar magnetopause, where the IMF is anti-parallel to the magnetospheric magnetic field, creates an 'open' field line (yellow). Note that reconnection also results in an equivalent mirror-image open field line formed below the ecliptic plane (this is not shown in the figure, but is visible in Fig. 1). Magnetic reconnection results in plasma jets confined to the magnetopause; observations of such jets are a crucial part of the overall experimental evidence confirming that reconnection does indeed occur (Paschmann et al. 1979;Sonnerup et al. 1981;). During southward IMF reconnection, a boundary layer is formed (shown in red), however this boundary is thin and essentially corresponds to the reconnection layer itself. There is not deep penetration of the solar wind across the dayside magnetopause, but rather the importance of the process lies in the fact that it enables transport of energy and magnetic flux through the cusps and into the magnetotail (Palmroth et al. 2003), as previously mentioned in Sect. 1. We now discuss some different aspects of magnetopause reconnection that impact both its structure and dynamics.

General IMF Orientation: Anti-parallel vs. Component Reconnection
The majority of cartoon descriptions of magnetic reconnection show anti-parallel magnetic field configurations. In reality, the IMF can of course assume any orientation. Furthermore, because the magnetopause is not flat, even if the IMF is anti-parallel to the magnetospheric magnetic field at one location, this does not guarantee that this is the case over the whole magnetopause. Historically, there has been debate as to whether purely anti-parallel reconnection (Crooker 1979) or component reconnection (Gonzalez and Mozer 1974;Sonnerup 1974;Cowley 1976) prevails at the magnetopause, since this influences where and when it can occur, and therefore limits the degree to which solar wind plasma can enter the magnetosphere via reconnection (e.g., Cowley and Owen 1989). As such there has been a considerable effort to determine the extent of the X-line over the magnetopause. Two-point in situ measurements first demonstrated the existence of a stable elongated Xline under southward IMF conditions (Phan et al. 2000). However since the magnetopause cannot yet be imaged, 'remote sensing' (in fact ions precipitating into the cusp from the dayside magnetopause) provides an alternative way to probe the magnetopause under a variety of solar wind conditions (e.g., Trattner et al. 2007aTrattner et al. , 2007b. These results show that if there is a substantial B y (i.e., out of the page in Fig. 1) then component reconnection is observed and the X-line is tilted, whereas if there is also a strong B x (i.e., along the Sun-Earth line), then anti-parallel reconnection occurred. This has since been developed into the so-called maximum magnetic shear model (Trattner et al. 2012). A recent serendipitous 10 spacecraft conjunction using Cluster, THEMIS and Double-Star observations indicates from in situ data that a component reconnection X-line can form, extending across the dayside magnetopause (Dunlop et al. 2011a(Dunlop et al. , 2011b. Ultimately, determining the extent of the X-line using in situ satellite data is very difficult but recent developments in X-ray imaging via solar wind charge exchange suggest that this is in fact technically possible, leading to a future mission proposal called AXIOM (Branduardi-Raymont et al. 2012).

Northward IMF
One may naively think that if the IMF points northward, parallel to the Earth's magnetic field at the subsolar magnetopause, then reconnection will not occur. In fact, the IMF is then anti-parallel to the magnetospheric field on the anti-sunward side of the cusp and so-called cusp reconnection can then occur (Dungey 1963). It is also possible that so-called dual-lobe reconnection could occur, i.e., cusp reconnection in both hemispheres simultaneously, leading to substantial plasma entry (Song and Russell 1992;Raeder et al. 1995Raeder et al. , 1997. This is related to an important and perhaps counterintuitive point regarding solar wind magnetosphere coupling which is that mass transport across the magnetopause appears to be enhanced for northward IMF (Palmroth et al. 2006). This results in the formation of a trapped layer of plasma inside the dayside magnetopause, which is observed in satellite data (e.g., Lavraud et al. 2005Øieroset et al. 2005. However, it is still unclear how to precisely distinguish reconnection created boundary layer from a diffusion-created boundary layer during northward IMF; this is discussed further below.

Asymmetric Plasma Conditions and Reconnection Onset
Since reconnection at the magnetopause involves the high plasma density, low field strength magnetosheath and the low plasma density, high field strength magnetosphere, the boundary conditions are asymmetric and this changes both the physics of reconnection, and the structure of the central diffusion region surrounding the X-line (e.g., review by ). In fact, in the central diffusion region the stagnation point and the X-line are not collocated; the stagnation point is displaced to the low mass flux side and the X-line is displaced to the high beta (strong field) side (Cassak and Shay 2007). If there is also a guide field, then the combination of this and asymmetry across the current sheet can in theory suppress reconnection entirely. This is the so-called beta-shear condition (Swisdak et al. 2003(Swisdak et al. , 2010. This was first tested in the solar wind, where it was found that all reconnecting current sheets satisfied this condition (Phan et al. 2010) and led to the conclusion that betashear is indeed a necessary (although not sufficient condition) for reconnection to occur. It was subsequently tested and found to hold at the magnetopause with both reconnecting and non-reconnecting current sheets . In this study, the fact that the condition divided the two groups of observations implies that the magnetopause current sheet is generally sufficiently thin to allow reconnection, and that the beta-shear condition is possibly the main mechanism controlling reconnection onset.
The fact that the solar wind plasma beta systematically varies through the heliosphere, increasing with heliocentric distance, has implications for the effect of reconnection on planetary magnetospheres. At Mercury, close to the Sun, the magnetosheath plasma beta is low and in theory reconnection can occur for a wide variety of IMF orientations; this has been investigated using MESSENGER spacecraft data (DiBraccio et al. 2013). In contrast, at the outer planets, e.g. Saturn, β is larger and reconnection is more likely to be suppressed, which may explain the less frequent detections of local reconnection signatures there (Masters et al. 2012).

Plasma Heating
In releasing magnetic energy, reconnection creates jets of heated plasma. However, heating is not ubiquitous, and is also species dependent. For example, in the solar wind there is essentially no electron heating (Gosling et al. 2007), whereas at the magnetopause both ions and electrons are heated (Gosling et al. 1990). Recent reconnection measurements from the magnetotail show that reconnection preferentially heats ions (Eastwood et al. 2013a). The mechanisms by which reconnection heats the plasma jets are still not well understood, but recent work shows that the degree to which electrons are heated depends on the Alfvén speed of the inflowing plasma, and analysis of THEMIS observations of magnetopause reconnection show that 1.7 % of the inflowing energy is converted to electron heating ). This empirical model predicts that in the solar wind, electron heating of less than 1 eV is expected, which is not in practice detectable. In the magnetotail, electron heating is predicted to be of the order of 1 keV, which is also consistent with typical magnetotail properties.

Non Steady State Reconnection: Flux Transfer Events (FTEs)
Simple cartoons of magnetopause reconnection dynamics imply a smooth and continuous interaction, and evidence shows that on occasion reconnection can persist for long times, both for northward and southward IMF orientations (Frey et al. 2003;. Nevertheless, there is a lot of experimental evidence showing that reconnection can be bursty and time dependent and generate significant structure. An important phenomenon in this regard is the Flux Transfer Event (FTE) (Russell and Elphic 1978;Fear et al. 2008). At the most basic level, an FTE may be thought of as a bulge propagating along the magnetopause, and a number of formation mechanisms have been proposed including patchy reconnection (Russell and Elphic 1978), bursty (i.e., time dependent) reconnection from a single X-line (Scholer 1988;Southwood et al. 1988), and the formation of a flux rope by multiple X-line reconnection (Lee and Fu 1985;Raeder 2006;Omidi and Sibeck 2007a). Whilst all mechanisms are possible, distinguishing between them is difficult . Recent work using multi-spacecraft analysis has demonstrated that FTEs can arise as a result of flux ropes formed by multiple X-line reconnection Øieroset et al. 2011;Zhong et al. 2013), and that these flux ropes can persist far along the tail magnetopause ).

The Kelvin Helmholtz Instability
Across the flank magnetopause, the fast shocked solar wind flow relative to the stagnant magnetospheric plasma creates a large velocity shear which could lead to the Kelvin-Helmholtz Instability (KHI). The KHI in itself does not lead to plasma transport across the boundary. However, when the instability reaches its nonlinear stage it results in rolledup vortices that contain local sharp gradients that are susceptible to microscale instabilities or reconnection that can then lead to plasma transport across the boundary (e.g., Nykyri and Otto 2001).
The KHI is a well-known instability in hydrodynamics. It also occurs in MHD although the magnetic field could have a stabilizing effect (Southwood 1968;Hasegawa 1975). Theory indicates that magnetic fields that have a component aligned with the plasma flow could stabilize the instability. For the equatorial magnetopause this means that the KHI would be favoured if the shocked solar wind magnetic field is either northward or southward oriented. Furthermore, Miura (1995) and  simulated the effect of the IMF orientation on the KHI and found that even a small magnetic field rotation across the magnetopause could reduce the nonlinear growth of the instability. This means that the KHI is expected to occur at the low-latitude flank magnetopause only when the shocked solar wind magnetic field is aligned to the magnetospheric field at that location.
Observationally, evidence for the KHI linear stage (steepening of the waves along the magnetopause) as well as its nonlinear stage (rolled-up vortices) have been reported (Fairfield et al. 2000;Gustafsson et al. 2001;Hasegawa et al. 2004;Owen et al. 2004). The reported events tend to occur for northward rather than southward magnetic field conditions, in agreement with theoretical expectations, although observations of KHI under southward IMF conditions have recently been presented (Hwang et al. 2011). The most convincing evidence for the existence of rolled-up KH vortices leading to plasma transport across the magnetopause was obtained by the four Cluster spacecraft during a flank magnetopause crossing (Hasegawa et al. 2004). The spacecraft detected large flow and magnetic field vortices, in addition to the presence of shocked solar wind plasma on magnetospheric field lines embedded inside the vortices. These observations provide evidence that the KHI could play a major role in the transport of solar wind plasma into the magnetosphere from the flanks during northward solar wind magnetic field conditions when reconnection is not expected to be efficient at the low-latitude magnetopause and explain in part why mass transport across the magnetopause is enhanced during northward IMF.

Diffusive Plasma Entry
Cross-magnetic-field diffusion is a possible means for solar wind plasma to cross the magnetopause (e.g., Axford and Hines 1961;Sonnerup 1980). In collisionless plasmas, classical Spitzer diffusion is extremely weak and would have minimal impact on plasma transfer across the magnetopause. However, wave-particle interactions due to micro-or macro-instabilities could lead to anomalous diffusion (e.g., Lotko and Sonnerup 1995;Treumann et al. 1995;Johnson and Cheng 1997;Chaston et al. 2008). Expected signatures for diffusive solar wind entry creating the boundary layer include (1) boundary layer flows tangential to the magnetopause that are aligned with the direction of the shocked solar wind flow on the other side of the magnetopause, (2) smoothly varying velocity and density profiles across the boundary layer, (3) increasing boundary layer thickness with increasing distance from the subsolar point, and (4) boundary layer located on closed field lines. Such boundary layer characteristics have been reported primarily when the solar wind magnetic field points northward and at the low-latitude magnetopause (e.g., Eastman et al. 1985;Mitchell et al. 1987;Phan et al. 1997). Furthermore, there have also been observations showing that the outermost portion of the boundary layer (closest to the magnetopause itself) exhibits reconnection jet signatures with orientations vastly different from the shocked solar wind flow direction, while the inner part of the boundary layer displayed velocity profiles consistent with diffusion (Fujimoto et al. 1996;Phan et al. 2005b). These observations seem to suggest that the diffusion process is always present to create a boundary layer, but if the conditions are such that reconnection also occurs, reconnection acts to destroy the diffusion generated boundary layer.

Basic Structure of Earth's Magnetotail and Typical Properties
The interaction of the solar wind with the Earth's magnetic field leads to the stretching of field lines connected to the planet on the night side. In this section we briefly review some aspects of magnetotail structure and dynamics. Whilst our main focus is the Earth, we will also compare and contrast the behaviour of other planetary magnetotails in the solar system. The Earth's magnetotail and its properties and dynamics are an area of considerable active research and it is not possible to cover all aspects in a single review; for more information the reader should consult, for example, reviews by Walker et al. (1999), Nishida (2000), Russell (2001), Sergeev et al. (2012), Milan (2014) and Eastwood and Kiehas (2014). Figure 1 shows that the magnetotail can be divided into two halves, with oppositely directed magnetic fields connecting to the two magnetic poles of the Earth. The magnetic field points Earthward in the northern lobe and tailward in the southern lobe. The lobes are separated by the magnetotail current sheet, which is enveloped by the plasma sheet (Ness 1965;Behannon 1968). The plasma sheet contains hot plasma, bounded on the north and south by plasma sheet boundary layers that contain beams and field-aligned flow. The density of the plasma sheet is typically about 0.1-1 cm −3 with a temperature of 1-10 keV (Baumjohann et al. 1989;Walker et al. 1999). The plasma sheet is predominantly a hydrogen plasma (e.g., Haaland et al. 2010), but can contain oxygen, especially during active times (e.g., Moore and Horwitz 2007). The locations of these regions have been mapped out by several different satellites (e.g., Christon et al. 1998).
The most well studied region of the magnetotail is the near-Earth magnetotail, which usually refers to the region up to 30R E downtail. The overall structure of the distant magnetotail has been mapped out by Geotail and ISEE-3 with the basic structure extending to at least 240R E (Fairfield 1992;Christon et al. 1998). Further observations far downstream of the Earth in the solar wind indicate that signatures of the magnetotail may persist and extend to 3100R E from the Earth (Intriligator et al. 1979). The magnetotail has a diameter of 50-60R E beyond 30-50R E downtail (Walker et al. 1999;Russell 2001), but whether or not the magnetotail is flattened, or has a circular cross section is still not well understood because of a lack of measurements, and variability in the solar wind conditions as we now discuss.

Correlation of Earth's Magnetotail Properties with Solar Wind Properties
The properties of the Earth's magnetotail depend on the solar wind (e.g., Borovsky et al. 1998 and references therein). In particular, the density of the plasma sheet is correlated with the solar wind density, the temperature of plasma sheet correlates with solar wind speed, and B y in the plasma sheet is correlated with B y in solar wind. The so-called 'penetration' of IMF B y is a direct effect of magnetopause reconnection which also results in twisting of the tail (Cowley 1981). This happens because the external IMF B y field exerts a torque on the internal, lobe field, such that the northern lobe twists towards dawn for a positive B y and towards dusk for a negative B y (Sibeck et al. 1985;Maezawa et al. 1997). The shape of the tail also varies in response to the orientation of the solar wind magnetic field. Observations show that the tail flaring angle (i.e., the angle between the magnetopause and the x-direction) depends on the B z component of the IMF. If B z is southward, then the flaring angle increases as the size of B z increases, whereas for northward IMF the angle is fairly constant (Petrinec and Russell 1996).

Magnetospheric Convection
The basic dynamics of the Earth's magnetosphere for southward IMF were first outlined by Dungey (1961), and are illustrated in Fig. 8. Magnetic reconnection between the closed magnetospheric field (red line) and the solar wind magnetic field (blue) leads to the formation of 'open' field lines that are connected to the planet at one end (purple). Via the action of the solar wind, and the unbending of the kinked magnetic field, plasma is transported poleward, through the cusps and into the magnetotail. This leads to the accumulation of magnetic flux on open field lines in the tail. Magnetic reconnection across the tail current sheet returns plasma on closed field lines (red) back towards the nightside of the Earth. This basic pattern of magnetospheric convection is known as the Dungey cycle. In the context of the Earth's magnetosphere, based on lobe convection calculations (e.g. Haaland et al. 2007), the tail reconnection site may be understood as a distant X-line ∼100R E downtail, and reconnection there is thought to lead to the formation of the plasma sheet (Walker et al. 1999), although the temporal and spatial scales of reconnection at the distant X-line are still not well understood.

Substorms
Whilst the concept of the open magnetosphere and the Dungey cycle is crucial to understanding the behaviour of the magnetosphere, it does not capture the fact that the magnetosphere can be highly dynamic. Continued dayside reconnection during an interval of   (Rostoker et al. 1980;Baker et al. 1996;. This process involves the formation of a second neutral line closer to Earth, as shown in Fig. 9. As the magnetic field strength in the lobe increases, the magnetotail current sheet thins. Whilst there is still some debate about the exact trigger, a reconnection X-line forms between 20-30R E from the Earth (Nagai et al. 1998). Initially reconnection occurs on closed field lines, leading to the formation of a closed loop in this idealised cartoon (Hones 1977). This is a plasmoid, which is bounded by magnetic tension of the surrounding closed field lines connected at both ends to the Earth. Eventually, reconnection begins to process open field lines, at which point the plasmoid is released and can move downtail (Hones 1977;Baker et al. 1996;Slavin et al. 1999Slavin et al. , 2002. In reality, if the reconnecting fields are not perfectly anti-parallel, then the plasmoid will in fact be a flux rope. The formation and properties of flux ropes in Earth's magnetotail is discussed in detail by Eastwood and Kiehas (2014).
The formation of the near Earth neutral line results in the Earthward injection of plasma and leads to bright auroral displays and associated disturbances to ground based magnetometers-the auroral substorm (Akasofu 1964). Since intervals of southward IMF occur naturally in the solar wind, substorms occur on a daily basis (Borovsky et al. 1993).
The dynamics of substorms are very complex and are the principal subject of the THEMIS mission . For a comprehensive overview of recent progress in understanding the physics of substorms the reader is referred to the review by Sergeev et al. (2012). THEMIS, consisting of five satellites distributed in the magnetotail and a comprehensive network of ground-based imaging and magnetometers, has made great progress in establishing the timeline of events during substorms. Results appear to show that transport of magnetic flux (from reconnection) in the mid-magnetotail precedes auroral breakup (Liu et al. 2011), extending previous statistical investigations (Miyashita et al. 2009). The timing is consistent with tracking of distinct auroral features (streamers, or poleward boundary intensifications) which propagate equatorward with auroral breakup subsequently being observed (Nishimura et al. 2010). One issue regarding timing which remains to be resolved is that the time delay between reconnection onset and auroral breakup can be surprisingly short ). This may be due to kinetic physics effects, and the transmission of kinetic Alfvén waves from the reconnection site at speeds considerably greater than the bulk outflow (Shay et al. 2011). Another major focus of activity for THEMIS has been the study of Dipolarization Fronts, thin interfaces which form at the leading edge of the reconnection jet ). Satellite data shows that these fronts can propagate relatively long distances through the magnetotail whilst remaining coherent and, for example, are sites for particle acceleration (e.g., Runov et al. 2009;Khotyaintsev et al. 2011;. Given the dynamic behaviour of the magnetotail, it is perhaps not surprising that the instantaneous (or even the short-term average) reconnection rates at the dayside magnetopause and in the magnetotail need not match. As such, the amount of 'open' magnetic field constantly varies with time. This area of open field, the polar cap, therefore varies according to the balance between the rates of flux opening and closing on the dayside and nightside and is referred to as the Expanding/Contracting Polar Cap (ECPC) paradigm (e.g., Milan 2014). The size of the polar cap, i.e., the location of the open/closed field line boundary, can be approximated by the size of the auroral oval. This provides a means by which magnetotail loading and unloading can be monitored on a global level by analysing auroral observations (e.g., Milan 2009).

Storms
If the solar wind magnetic field is southward for a long period of time (hours), then a geomagnetic storm may develop (Gonzalez et al. 1994;Russell 2001). Storms are characterised by energization of the radiations belts and enhanced associated particle fluxes, which cause a significant depression in the equatorial magnetic field, measured by the Dst index for example. Storms result from strong, prolonged convection of plasma into the inner magnetosphere. The corresponding solar wind conditions tend to correspond to coherent solar wind structure such as Coronal Mass Ejections (CMEs) and Corotating Interaction Regions (CIRs) (Gonzalez et al. 1999), which can both provide long intervals of southward IMF (Forbes 2000;Tsurutani et al. 2006). CMEs are responsible for the largest geomagnetic disturbances, with the storm size depending on the solar wind speed, the field strength and the southward component of the magnetic field (Gosling et al. 1991;Richardson et al. 2001). The connection between storms and substorms is not straightforward, in the sense that a storm does not necessarily consist of a series of elemental substorms (Kamide et al. 1998), and in fact the dipolarization of the magnetotail by the enhanced ring current may inhibit substorm onset (Milan 2009).

Earth's Magnetotail: Northward IMF
During intervals of low geomagnetic activity, observations show that the plasma sheet can become significantly colder and denser (e.g., Terasawa et al. 1997 and references therein). This so-called cold dense plasma sheet (CDPS) has densities of ∼1 cm −3 , and temperatures <1 keV  and is found on closed field lines, with larger densities nearer the flanks than in the center of the magnetotail (e.g., ). The CDPS does not contain cold O + ions and so is not thought to be sourced from the ionosphere (Rème et al. 2001).
In fact, the plasma content of the CDPS increases during intervals of northward IMF with the best correlation occurring when the IMF parameters are averaged ∼9 hours before the plasma sheet observations (Terasawa et al. 1997). As such, the CDPS is due to solar wind plasma entering under northward IMF conditions. Further work using in-situ data , and maps derived from precipitating particles (Wing and Newell 2002) show that cold and dense populations appear along the tail flanks, suggesting entry through the flank low latitude boundary layer. As described in Sect. 3, it is thought that magnetopause plasma entry processes during northward IMF lead to the formation of the CDPS. In particular, the Kelvin-Helmholtz Instability will occur and enable the transfer of cold solar wind plasma into the magnetosphere at the flanks (Hasegawa et al. 2004). In fact the CDPS is a stable and persistent feature. In a case study examining the response of the magnetosphere to more than 32 hours of northward IMF, the CDPS was observed for more than 30 hours (Øieroset et al. 2005).

Other Planets
Several other solar system bodies also exhibit global magnetospheres and magnetotails. In particular, the magnetospheres of Mercury, Jupiter and Saturn have been extensively explored with orbiting spacecraft (MESSENGER, Galileo and Cassini respectively), and we now briefly mention some similarities and differences in the context of what we know about Earth's magnetotail. For a comprehensive review of solar system magnetotails, we refer the reader to the recent AGU Chapman Monograph on this subject (Keiling et al. 2014).

Mercury
The MESSENGER spacecraft, which entered orbit around Mercury in March 2011, has transformed our understanding of Mercury's magnetosphere. Whilst Mercury has a dipole magnetic field (Anderson et al. 2011), its magnetosphere is very small (Johnson et al. 2012), and is strongly driven by the solar wind (DiBraccio et al. 2013) (as mentioned in Sect. 1). Basic elements of this interaction were revealed during the first three flybys (Slavin et al. 2012a). During the first MESSENGER flyby, the solar wind magnetic field was largely northward, and the magnetotail, observed relatively close to the planet was quiescent. During the second flyby, the solar wind magnetic field was southward, and the magnetotail was highly dynamic, with evidence for numerous plasmoids. During the third flyby, the IMF orientation was variable, and MESSENGER observed dynamic loading and unloading corresponding to Hermian substorms.

Jupiter
Jupiter has the largest magnetosphere in the solar system and its properties act as a useful counterpoint to Earth (Bagenal et al. 2007). Its interaction with the solar wind is very different to that of the Earth's magnetosphere, and this is due to its strong magnetic field, its rapid rotation, and the presence of internal plasma sources (Delamere and Bagenal 2010). The first observations by Pioneer and Voyager revealed the presence of a strong internal plasma source, Io, which produces sulphur and oxygen atoms that subsequently ionise. This plasma corotates with Jupiter in a plasma disk, since centrifugal forces confine the plasma to a disk with the corresponding equatorial magnetic field stretched into a magnetodisk. As the plasma disk rotates, it is confined by the solar wind pressure on the dayside. On the nightside plasma-laden flux tubes can stretch out, and reconnect, leading to the ejection of a plasmoid down-tail. This plasmoid removes the internally generated plasma, and the cycle of loading and releasing was first presented by Vasyliunas (1983), now referred to as the Vasyliunas cycle.
A key question is then whether the solar wind plays any role in the dynamics of Jupiter's magnetotail. Observations made by Ulysses during a fly-by showed the presence of antisunward flow in the dawn magnetotail and solar wind type plasma in the high-latitude magnetosphere (Cowley et al. 1993). This suggested that the Dungey cycle and the Vasyliunas cycle could operate in tandem (Cowley et al. 2003), an idea further developed by Kivelson and Southwood (2005). However, the size of Jupiter's magnetosphere means that the timescale for the Dungey cycle appears to be much larger than the rotation rate and so it has been proposed that turbulent reconnection on the flanks intermittently creates small regions of open field (Delamere and Bagenal 2010).

Saturn
Saturn's magnetosphere has mainly been explored by the Cassini spacecraft (Dougherty et al. 2009), as well as by Pioneer 11, Voyager 1 and Voyager 2 during flybys. Like Jupiter, Saturn is a rapid rotator, with a relatively strong magnetic field. Cassini also showed that there is a significant internal plasma source: in this case, the moon Enceladus generates plasma, which also creates a magnetodisk. However, the dynamics of Saturn's magnetotail appear to involve a balance between rotational and solar wind driven effects ). The first evidence for magnetotail reconnection came during Saturn Orbit Insertion , and subsequently plasmoids have been observed (Jackman et al. 2007(Jackman et al. , 2011.

Using Simulations to Accurately Capture Magnetosphere Structure and Dynamics
The magnetosphere occupies a large volume relative to typical plasma scale lengths, especially in the magnetotail, which is very extended. One could attempt to model the whole magnetosphere with a single plasma code that can properly represent all the relevant physical processes, such as non-thermal energy distribution, gradient and curvature drifts, multiple ion species, reconnection physics, etc. These processes cannot be captured with a simple magnetohydrodynamic (MHD) code, so one would need to use a particle-in-cell (PIC), a hybrid, or a Vlasov solver. The PIC code represents the kinetic effects with macro-particles. The macro-particles are much larger and heavier than the actual ions and electrons, and they represent an ensemble of particles with similar positions and velocity vectors. Hybrid codes are similar to PIC codes but they treat the electrons as a fluid to allow both larger grid cells and time steps and to reduce the computational costs. A Vlasov code solves the continuous Vlasov equations for the distribution function in a six dimensional (6D) phase space representing the distribution of particles in spatial coordinates and velocity space. All three of these techniques are computationally expensive, and so tend to be used more for studying phenomena locally (see e.g. Scholer 2013 andKarimabadi et al. 2013 for recent reviews in the context of shock physics and reconnection respectively). To date, the hybrid code is the only one that has been used to represent the whole magnetosphere (Karimabadi et al. , 2011, but even this simulation required about 10 5 CPU cores. Full PIC simulations have been used to model a part of the magnetosphere, for example dipolarization fronts in the tail in 2D (Sitnov and Swisdak 2011).  used the Vlasiator code, a Vlasov solver, for a 3D magnetosphere simulation initially in a test particle mode in combination with a global MHD solver. Subsequently, Vlasiator has been used to simulate the entire dayside magnetospheric interaction, resulting in good reproduction of ion kinetic features in the foreshock and magnetosheath commonly observed by spacecraft, including backstreaming ion beams, wave generation and magnetosheath mirror modes .
At the time of writing, kinetic codes are still too expensive to be used for full 3D and time dependent magnetosphere simulations. The alternative is to use fluid codes that assume a thermal distribution of the particles. Further commonly used simplifications are to assume isotropy of the pressure tensor, use a single ion species, and to neglect the Hall term, explicit resistivity, heat conduction, and viscosity all of which leads to an ideal MHD description of the plasma. There are several MHD codes (e.g., BATS-R-US- Powell et al. 1999;, LFM-Lyon et al. 2004, OpenGGCM-Raeder et al. 2001and GUMICS-Janhunen et al. 2012) that can model the 3D magnetosphere with roughly real time speed on a moderate number of CPU cores (50-100) and with a reasonable grid resolution (≈1/4RE) near the inner boundary that is placed at 2 to 3 planet radii from the center of the planet. Although MHD models miss many kinetic effects, they can still show good agreement with some in situ observations: the location of the bow shock, the location of the magnetopause, the plasma density, temperature and velocity in the magnetosheath, and the magnetic field in most of the magnetosphere. The global MHD models are less successful in reproducing the measurements in the inner magnetosphere and the magnetotail especially during disturbed times.
Coupling multiple models can provide an efficient yet reasonably accurate way to represent the structure and dynamics of the magnetosphere, as illustrated in Fig. 10. Almost all global MHD models are coupled to an ionosphere electrodynamics model that provides the inner boundary conditions for the MHD code. Although this is an improvement over a simpler boundary condition (like a perfectly conducting sphere) it does not address the major shortcomings of the fluid description.
A major improvement over a pure MHD model is using a kinetic code for the inner magnetosphere defined by the closed field lines that are attached to the planet at both ends. These kinetic codes use a bounce-averaged description of the electrons and ions, which is valid as long as the bounce period of the charged particles between the magnetic mirror points is significantly shorter than the dynamic time scales of the system. Bounce-averaging reduces the spatial dimensionality of the problem from three to two dimensions: the location of a particle is given by magnetic field line it is gyrating around, and the field line is identified by its foot point on the surface of the planet, or the intersection with the magnetic equatorial plane. The velocity distribution is also described with reduced dimensionality. Some inner magnetosphere models, like the Rice Convection Model (RCM-Wolf et al. 1982;Toffoletto et al. 2003), assume an isotropic velocity distribution and solve for the energy distribution, while other models (e.g., CRCM-Fok et al. 2001, HEIDI-Liemohn et al. 2001, RAM-SCB-Jordanova et al. 1994Zaharia et al. 2006) solve for energy and pitch angle distribution. These models treat the electrons as a separate species and also allow for multiple ion species. This means that the MHD model should also allow for multiple ion species Fig. 10 It is necessary to couple multiple models to simulate the magnetosphere. The text next to green arrows show the most important quantities passed from one model to another. The red text indicates potential difficulties due to differences between the physics of different models to supply consistent boundary conditions for the inner magnetosphere model. The major source of heavy ions for the Earth comes from the ionosphere along the open field lines. One can use an empirical model (Strangeway et al. 2000) or a first-principles model (e.g., PWOM-Glocer et al. 2009b) that solves for the advection and acceleration of individual fluids along the magnetic field lines as well as the motion of the field lines due to the ionospheric E × B drift. Radiation belt models (e.g., RBE-Fok et al. 2008) are essentially the same as inner magnetosphere models but they deal with higher energy electrons only.
Coupling these models is a non-trivial problem. There are challenges due to the different physics and numerical schemes in the different models, as well as the requirement of making the coupling accurate and efficient. Coupling a single fluid MHD code to an inner magnetosphere model provides an excellent example for both problems. The MHD code has to provide magnetic field information for the inner magnetosphere model as well as the boundary conditions at the edge of the closed field line region. Ideally these boundary conditions should provide the pitch angle and energy distribution function of the electrons and the ion species used in the inner magnetosphere model. Clearly, a single fluid ideal MHD code cannot provide that. One has to assume an isotropic Maxwellian velocity distribution and pick some ratio between ion densities and temperatures as well some fraction for the electron pressure. Using a more advanced extended MHD (XMHD) model that allows for multiple ion fluids, anisotropic pressure tensor, and separate electron pressure can provide a more consistent boundary condition, although it is still incomplete. Providing the magnetic field to the inner magnetosphere model is physically straightforward, but computationally challenging. One needs to trace tens of thousands of field lines through the MHD solution every time the codes are coupled. Doing this accurately and efficiently, so that the overall simulation is not slowed down, is quite challenging, and in fact, currently only the Space Weather Modeling Framework (SWMF-Toth et al. 2005 can do coupled global-inner magnetosphere simulations with real time speed (De Zeeuw et al. 2004;Glocer et al. 2009a). In the other direction the inner magnetosphere provides full distribution functions for the MHD code inside the closed field line region. Simply overwriting the pressure and density (or pressures and densities for XMHD) can lead to numerical instabilities and artefacts. It was found that it works better to 'nudge' the MHD pressure(s) and density (densities) towards the inner magnetosphere values with a short but finite relaxation time (De Zeeuw et al. 2004). The SWMF attained reasonable success modelling the magnetosphere of the Earth using coupled models, e.g. (Ridley et al. 2002;Zhang et al. 2007;Welling and Ridley 2010). Recently  integrated and coupled the CRCM inner magnetosphere model that solves for multiple ions with an arbitrary pitch angle distribution into the SWMF. This, as well as other applications, required the extension of the capabilities of the BATS-R-US code towards XMHD. Currently it can solve for Hall MHD (Toth et al. 2008) with separate electron pressure, multiple ion and neutral fluids (Glocer et al. 2009c), and anisotropic ion pressure (Meng et al. 2012a(Meng et al. , 2012b. BATS-R-US can also solve for a non-ideal equation of state, heat conduction (isotropic or field aligned), resistivity (constant or anomalous) and viscosity. Not all combinations of these extensions are allowed at this time, but there is steady progress towards that goal. It is also important to realize that replacing ideal MHD with XMHD does not automatically lead to a more realistic model. A pure multi-fluid MHD model can develop unrealistic large relative velocities of the fluids along field lines, while the pure anisotropic MHD code can produce unreasonably large anisotropies. The reason for this unphysical behaviour is that XMHD does not contain the kinetic instabilities that limit the relative speed or the anisotropy. To solve these issues, one can use source terms based on the theory of kinetic instabilities that mimic such kinetic effects on the XMHD scales (Glocer et al. 2009c;Meng et al. 2012a).
To illustrate the above points, we mention our simulations of the July 22, 2008 geomagnetic storm by . We performed four simulations with identical grids and solvers in BATS-R-US and the ionosphere electrodynamics code RIM, but we used two different inner magnetosphere models (RCM and CRCM) and two different MHD models (isotropic and anisotropic ion pressure). The simulations were then compared to magnetic field measurements from several satellites. Although none of the four models are perfect, the RMS errors are the smallest for the anisotropic MHD model coupled with CRCM that also allows for anisotropy. This single example shows (but does not prove in general) that a more sophisticated model can provide better agreement with measurements. In a recent study, requested by the U.S. national Space Weather Prediction Center (SWPC), Pulkkinen et al. (2013) compared several empirical and physics based magnetosphere models for several geomagnetic events and found that the SWMF using the coupled BATS-R-US, RCM and RIM models consistently outperformed all the empirical models as well as the global MHD models that were not coupled with an inner magnetosphere model, and in fact the SWMF has been selected to be transitioned to operations at NOAA's Space Weather Prediction Center (SWPC).
The required sophistication of the computational model is very problem dependent. Up to this point we have focused on the modelling of Earth's magnetosphere and emphasized space weather type applications. While the coupled global MHD and kinetic inner magnetosphere models of the SWMF are quite efficient and reasonably accurate for this application, they do not address all aspects of the dynamics and structure of the magnetosphere. For example, the fine structure of the collisionless bow shock and the detailed dynamics of magnetic reconnection are not captured by these codes. One would need to use a local kinetic code to properly model these phenomena. In some cases, using a more sophisticated local model can have a significant effect on the global dynamics. For example, the rate of reconnection in a small volume can influence the magnetic topology and the overall dynamics of the whole system.
One approach is to couple the global MHD code with a test particle model to study the acceleration and propagation of energetic particles (e.g., Peroomian et al. 2011). A test particle code does not provide feedback to the MHD code so it is only valid if the charge carried by the energetic particles is small compared to the thermal plasma represented by the MHD model. A more self-consistent approach is to couple the MHD model with an embedded kinetic model in regions where the kinetic effects are important. Daldorff et al. (2014) have recently succeeded in two-way coupling the implicit Particle-in-Cell code iPIC3D with the global MHD code BATS-R-US. In their 2D magnetospheric simulation the embedded PIC model solves for the dayside reconnection while the coupled MHD code provides the global solution. Future extensions of this new MHD with Embedded PIC (MHD-EPIC) method to 3D will allow for realistic representation of the reconnection and other local kinetic processes in a global 3D magnetospheric simulation. The upcoming Magnetospheric Multiscale (MMS) mission is aimed at studying the reconnection process at the electron scales. This will provide an excellent opportunity to validate local, embedded or possibly global kinetic magnetosphere models if they become feasible .
Once one moves away from the Earth, the requirements for a good model can vary drastically. For unmagnetized planets, like Mars or Venus, the solar wind directly interacts with the ionosphere, so the computational grid has to extend down to the surface and one needs to model a large number of ion (and neutral) species with corresponding chemical reactions, charge exchange, photoionization and recombination processes. The neutral atmosphere may be represented by a separate atmosphere/thermosphere model that is coupled to the multispecies/multifluid MHD solver. If the ion gyroradius becomes comparable with the typical length scales due to the weak magnetic field, one may need to switch to Hall MHD ), or in some cases fluid solvers may not be appropriate at all, and global hybrid/kinetic models are needed (e.g., Jarvinen et al. 2009;Kallio et al. 2010;Brecht and Ledvina 2012), for example to model heavy ion escape. Mercury represents a unique challenge, being physically small but magnetised and without a significant atmosphere (Omidi et al. 2006). Other magnetized planets, like Jupiter and Saturn, have moons that load the plasma with heavy ions that play a major role in the dynamics of these magnetospheres (e.g., Jia et al. 2012). Near the polar regions of these giant planets the classical Alfvén speed may become larger than the speed of light so one has to use a semi-relativistic MHD model .
In general, the required complexity of an appropriate computational model is determined both by the system studied and by the quantities of interest, but it is often limited by the lack of observations and computational resources. Computational modelling, inevitably, is an art of compromise.

Conclusions
In this review we have attempted to summarize some aspects concerning the structure and dynamics of planetary magnetospheres, mainly concentrating on the Earth's magnetosphere. We have examined three important regions-the bow shock, the magnetopause and the magnetotail. Whilst there are many important controlling parameters, perhaps the most important from a simple qualitative point of view is the orientation of the interplanetary magnetic field. At the bow shock, this controls the regions of quasi-parallel and quasi-perpendicular geometry, and therefore the structure of the foreshock, the locations of particle acceleration, and the occurrence of magnetosheath high speed jets. At the magnetopause, rapid transport of solar wind energy via dayside reconnection occurs under southward IMF conditions. Under northward IMF, the KHI at the flanks, together with dual-lobe reconnection, means that mass transport (of cold dense plasma) is enhanced. Finally, in the Earth's magnetotail, the storage and release of energy in magnetic substorms and storms is strongly controlled by the IMF orientation and the manner in which plasma enters at the magnetopause. As such, for cosmic plasma structures in general, ascertaining the orientation of the magnetic field is of key importance.
The future prospects for gaining an even deeper and more detailed understanding of magnetospheric structure and dynamics are very bright. The demand for further improvements in our understanding is driven in part by an increasing societal need to understand the physics of space weather, so as to better predict and mitigate against its effects . In this context our experimental knowledge of the key processes at work will continue to grow as new missions such as Magnetospheric Multi-Scale are launched, and novel concepts (e.g. using X-rays created by solar wind charge exchange to perform magnetospheric imaging) offer intriguing opportunities. Finally, continuing developments in computing power and processing speeds mean that ever more complex and detailed simulations will be available to explore the underlying physics.
Turning to the connection between magnetospheric observations and more general studies of cosmic plasma structure, we make the following observations. Firstly, it is clear that very precise studies of specific plasma physics processes can be performed in the magnetosphere. Examples include the structure of the bow shock, wave-particle interactions that occur in the foreshock, the physics of magnetic reconnection under asymmetric boundary conditions, plasma transport rates by the KHI, the onset of explosive energy release in current sheets, the structure of the reconnection diffusion region, the generation of energetic particles during storms and substorms, etc.
However, care must be taken in generalising these observations. For example, the Earth's bow shock is highly curved, and rather small in an astrophysical sense, so there is significant cross-talk between the quasi-perpendicular and -parallel sides, which may not occur in general. As a second example, studies based on Earth alone may lead to the conclusion that magnetospheres are driven by stellar winds, but the comparison of Mercury, Earth, Jupiter and Saturn shows that this is not always the case. In applying our knowledge of these magnetospheres to other astrophysical objects, it is very important to determine all the plasma conditions described in Sect. 1 so as to make the correct comparison.
We would like to finish by clarifying that this connection is not a one-way street. The parameter regime experienced in the solar system is inevitably limited, but the plasma conditions that cause infrequent, yet very important, extreme events (e.g. a Carrington-class geomagnetic storm) may occur more commonly in other astrophysical environments. Thus studying similar plasma phenomena elsewhere under different, more unusual conditions will help us to understand how Earth's magnetosphere would behave under extreme conditions. As such, an improved dialogue and cross-fertilization of ideas between all those studying different cosmic plasma structures can only help to further improve our understanding of magnetospheric physics.