{'fraction_non_alphanumeric': 0.052087096851891994, 'fraction_numerical': 0.025796661608497723, 'mean_word_length': 3.6460944494180842, 'pattern_counts': {'":': 0, '<': 173, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 59, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Interaction of a highly magnetized impulsive relativistic flow with an external medium

Important astrophysical sources, such as gamma-ray bursts (GRBs) or tidal disruption events, are impulsive -- strongly varying with time. These outflows are likely highly magnetized near the central source, but their interaction with the external medium is not yet fully understood. Here I consider the combined impulsive magnetic acceleration of an initially highly magnetized shell of plasma and its deceleration by the external medium. I find four main dynamical regimes, that (for a given outflow) depend on the external density. (I) For small enough external densities the shell becomes kinetically dominated before it is significantly decelerated, thus reverting to the familiar unmagnetized"thin shell"case, which produces bright reverse shock emission that peaks well after the prompt GRB. (II) For larger external densities the shell remains highly magnetized and the reverse shock is strongly suppressed. It eventually transfers most of its energy through pdV work to the shocked external medium, whose afterglow emission peaks on a timescale similar to the prompt GRB duration. (III) For even larger external densities there is no initial impulsive acceleration phase. (IV) For the highest external densities the flow remains Newtonian.


Introduction
The composition of relativistic jets or outflows in different astrophysical sources, and in particular their degree of magnetization, is highly uncertain and of great interest. Pulsar winds are almost certainly Poynting flux dominated near the central source, and the same most likely also holds for active galatic nuclei (AGN) and tidal disruption events (TDEs) of a star by a super-massive black hole. In AGN and TDEs, since the central accreting black hole is super-massive, then even close to it the Thompson optical depth τ T may not be high enough for thermal acceleration by radiation pressure -the main competition to magnetic acceleration -to work efficiently (e.g., Ghisellini 2011). In GRBs or micro-quasars, however, thermal acceleration could also work (τ T ≫ 1 is possible, or even likely), and the dominant acceleration mechanism is less clear.
One of the most important open questions about outflows that start out highly magnetized near the central source is how they convert most of their initial electromagnetic energy to other forms, namely bulk kinetic energy or the energy in the random motions of the particles, which also produce the radiation we observe from these sources. Observations of relevant sources, such as AGN, GRBs or pulsar wind nebulae suggest that the outflow magnetization is rather low at large distances from the source. This is known as the σ problem, namely how to transform from σ ≫ 1 near the source to σ ≪ 1 very far from the source, where the magnetization parameter σ is the Poynting-to-matter energy flux ratio. Different approaches to this problem have been considered so far. Outflows that are Poynting flux dominated near the source are usually treated under ideal MHD, axi-symmetry and steady-state (minaly for simplicity). Under these conditions, however, it is hard to achieve σ < 1 (or σ ≪ 1) far from the source that would enable efficient energy dissipation in internal shocks (Komissarov et al. 2009;Lyubarsky 2009Lyubarsky , 2010a. One possible solution to this problem is that the magnetization remains high (σ ≫ 1) also at large distances from the source and the observed emission is powered by magnetic reconnection rather than by internal shocks (Lyutikov & Blandford 2003;Lyutikov 2006;Giannios & Spruit 2006;Giannios 2008). Alternatively, the non-axi-symmetric kink instability could randomize the direction of the magnetic field, causing it to behave more like a fluid and enhancing magnetic reconnection, which both increase the acceleration and help lower the magnetization (Heinz & Begelman 2000;Drenkhahn & Spruit 2002;Giannios & Spruit 2006). Another option that may be relevant for AGN and GRBs (Lyubarsky 2010b), is that if the Poynting flux dominated outflow has alternating fields (e.g. a striped wind) then the Kruskal-Schwarzschild instability (i.e. the magnetic version of the Rayleigh-Taylor instability) of the current sheets could lead to significant magnetic reconnection, which in turn increases the initial acceleration resulting in a positive feedback and self-sustained acceleration that leads to a low σ.
While most previous works have assumed a steady state (i.e. no time dependence), here the focus is on the effects of strong time dependence -impulsive outflows that are initially highly magnetized, under ideal MHD. Granot, Komissarov & Spitkovsky (2011, hereafter paper I) have recently found a new impulsive magnetic acceleration mechanism for relativistic outflows, which is qualitatively different from its Newtonian analog (Contopoulos 1995), and can lead to kinetic energy dominance and low magnetizations that allow for efficient dissipation in internal shocks. Paper I focused mainly on the acceleration of an initially highly magnetized shell of plasma into vacuum, and only briefly discussed the effects of its interaction with the external medium. Here I analyze in detail the effects of its interaction with an unmagnetized external medium whose density varies as a power-law with the distance from the central source.
Most astrophysical relativistic outflow sources, such as AGN, micro-quasars or pulsar wind nebulae (PWN), operate more or less steadily over long periods of time. Therefore, the deceleration of their outflow due to its interaction with external medium becomes important only at very large distances from the source (at the "hot spots" near the leading edge of AGN or micro-quasar jets 1 and at the wind termination shock in PWN). AGN or micro-quasar jets occasionally produce bright flares, which likely correspond to a sudden and short lived large increase in their jet power (or energy output rate). If the resulting ejected shell (or blob) of plasma is highly magnetized then it can accelerate by the impulsive mechanism found in paper I. Since it would be propagating in the evacuated channel cleared by the preceding long lived steady outflow from the same source, the deceleration by the external medium would become important only well after the acceleration is over. There are, however, also sources that are both impulsive and short-lived, such as GRBs, TDEs or potentially also relativistic outflows from giant flares in soft gamma-repeaters. In such sources the deceleration because of the interaction with the external medium can become important already during the acceleration stage, and this may have important implications for our understanding of these sources and the interpretation of their observations. The deceleration of an unmagnetized uniform 2 relativistic shell through its interaction with the external medium has been studied in the context of GRBs (Sari & Piran 1995;Sari 1997;Kobayashi & Sari 2000;Kobayashi & Zhang 2003;Nakar & Piran 2004). The main results are summarized and extended to a general power-law (with the distance from the central source) external density profile in § 2. The deceleration of a uniform magnetized relativis-tic shell by an unmagnetized external medium has also been studied (Zhang & Kobayashi 2005;Giannios, Mimica & Aloy 2008;Mimica, Giannios & Aloy 2009;Mizuno et al. 2009;Lyutikov 2011). However, most of the treatments so far have assumed arbitrary initial conditions just before the deceleration radius where most of the energy is transfered to the shocked external medium, which can result in some unrealistic outcomes (notable exceptions are paper I and Levinson 2010).
This work self-consistently considers the combined impulsive magnetic acceleration and deceleration by a unmagnetized external medium of an initially highly magnetized shell. The main results for the acceleration into vacuum of such a highly magnetized shell (paper I) are described in § 3. The test case that was studied in detail in paper I features a magnetized shell initially at rest whose back end leans against a conducting wall with vacuum in front of it, with initial width l 0 , magnetic field B 0 , rest mass density ρ 0 and magnetization The shell is crossed by a strong, self-similar rarefaction wave essentially on its light crossing time so that at a radius R 0 ∼ l 0 it reaches a typical magnetization σ ∼ σ 2/3 0 and Lorentz factor Γ ∼ σ 1/3 0 . It then becomes super-fast-magnetosonic and looses causal contact with the wall, resulting in a much slower subsequent impulsive acceleration phase in which Γ ∝ R 1/3 . Eventually it becomes kinetically dominated at the coasting radius R c ∼ R 0 σ 2 0 , and at larger radii it starts coasting at a constant Lorentz factor ( Γ ∼ σ 0 ) and spreading radially while its magnetization rapidly drops with radius ( σ ∼ R c /R).
The combined acceleration and deceleration for an expansion into an unmagnetized external medium with a power-law density profile is addressed in detail in § 4. The test case from paper I is generalized by replacing the vacuum with an appropriate external medium. Five distinct dynamical regimes are identified, and their main properties are derived and discussed. In regime I the external density is sufficiently low that early on it hardly affects the shell, which accelerates essentially as if into vacuum (as described above) until well after its coasting radius R c . By the time the effects of the external medium become important the magnetization is already low, so that regime I effectively reverts to the unmagnetized thin shell case (where both the reverse shock emission and afterglow emission peak on a timescale longer than that of the prompt GRB emission). In regime II the external density is sufficiently large that it starts to strongly affect the shell during its impulsive acceleration phase, while it is still highly magnetized. The shell then starts to decelerate or accelerate more slowly until it transfers most of its energy to the shocked external medium. In regime II the shell is highly magnetized all the way to its deceleration radius, and therefore this strongly suppresses the reverse shock (which is either non-existent or very weak) and its associated emission. Thus, regime II can be thought of as a highly magnetized thick shell case, in which no bright reverse shock emission is expected, and the afterglow emission peaks on a timescale comparable to that of the prompt GRB. In regime III the external density is high enough that from the very start it inhibits the acceleration so that there is no impulsive acceleration phase, and the dynamics become essentially independent of the flow composition (i.e. of σ 0 , while σ scales linearly with σ 0 but affects only the small fraction of the total energy that is in kinetic form, (1 + σ) −1 ≈ σ −1 ≪ 1). The observational signatures of regime III are very similar to those of regime II. In regime IV the external density is so high that the flow remains Newtonian all along. This regime might be relevant for a highly magnetized jet trying to bore its way out of a massive star progenitor in long duration GRBs. Finally, regime II * occurs only for a highly stratified external medium for which it replaces regime II, and where also regimes I and III all show interesting and qualitatively different behavior compared to smaller stratifications. Table 1 summarizes the main notations and definitions that are used in this work in order to help the reader follow the text. The new results found in this work are compared to previous works in § 5, and their implications are discussed in § 6.

Deceleration of an unmagnetized impulsive relativistic flow
Before generalizing the dynamics to the case of a highly magnetized outflow, I begin with a detailed description of the deceleration of an unmagnetized shell (corresponding to σ ≪ 1 where σ is defined in the next section), that initially coasts and propagates relativistically into an unmagnetized external medium with a power law density profile.
For simplicity I assume spherical symmetry, and that the original ejecta from the GRB form a uniform shell of initial Lorentz factor Γ 0 and initial width ∆ 0 , were a subscript '0' is used to denote the initial value of a quantity. Bulk Lorentz factors (denoted by Γ), as well as the radius R and width ∆ of the shell are measured in the rest frame of the central source (which is also the rest frame of the external medium, and thus serves as the lab frame), while thermodynamic quantities like the rest-mass density ρ, the number density n, the pressure p, and the internal energy density e are measured in the local rest frame of the fluid. A reasonable variation in Γ 0 of δΓ 0 ∼ Γ 0 will result in a significant radial spreading of the shell from the spreading radius, R s ∼ ∆ 0 Γ 2 0 , so that its (lab-frame) width evolves as ∆ ∼ max(∆ 0 , R/Γ 2 0 ) ∼ ∆ 0 max(1, R/R s ). The ambient medium is assumed to have a power law mass density profile, ρ 1 = AR −k , where for simplicity I consider only k < 3, which is also the parameter range of most physical interest. Of particular interest are the cases k = 0, which corresponds to a constant density medium like the ISM, and k = 2, which is expected for the stellar wind of a massive star progenitor.
As the shell interacts with the external medium and sweeps it up, two shocks are formed: a forward shock that propagates into the ambient medium and a reverse shock that goes back into the shell and slows it down. The shocked shell material and the shocked external medium are separated by a contact discontinuity. There are thus four different regions: (1) unperturbed external medium, (2) shocked external medium, (3) shocked shell material, and (4) unperturbed shell material. Quantities at each region are denoted by the appropriate subscript i = 1, 2, 3, 4. We have Γ 4 = Γ 0 , Γ 1 = 1, and since regions 2 and 3 are separated by a contact discontinuity, Γ 2 = Γ 3 = Γ and p 2 = p 3 = p. Together with the shock jump conditions between regions 3 and 4 (for the reverse shock) and between regions 2 and 1 (for the forward shock), the resulting set of equations (together with the equations of state in the different regions) can be solved to obtain Γ, e, ρ 2 and ρ 3 (as well as the Lorentz factors of the reverse and forward shock fronts) as a function of Γ 0 and the density ratio f = ρ 4 /ρ 1 of the unperturbed shell material and external medium. There are two limits for which there is a simple analytic solution (Sari & Piran 1995): for f ≫ Γ 2 0 the reverse shock is Newtonian, and 3 Γ ≈ Γ 0 , while for f ≪ Γ 2 0 the reverse shock is relativistic, Γ ≈ 2 −1/2 Γ 1/2 0 f 1/4 and the relative Lorentz factor between the fluid in regions 4 and 3 is Γ E = 10 53 E 53 erg is the (isotropic equivalent) kinetic energy of the ejecta shell, and is the Sedov radius where the (isotropic equivalent) swept up mass equals E/c 2 . Numerical values are provided for the physically interesting cases of k = 0, which correspond to a uniform medium of number density n = n 0 cm −3 (A = nm p where m p is the proton mass), and k = 2, which corresponds to the stellar wind of a massive star progenitor, with A * = A/(5 × 10 11 gr cm −1 ). It is clear from Eq. (2) that k = 2 is a critical value below which f decreases with radius and above which f increases with radius, before the shell starts spreading (i.e. while ∆ ≈ ∆ 0 and is independent of radius). Since k = 2 is also a physically interesting value, it will be discussed separately below. The case 2 < k < 3 will also be briefly mentioned. We shall, however, first concentrate on k < 2.
3 more accurately Γ = Γ 0 (1 − √ ǫ) and Γ 43 = 1 + 2ǫ, where ǫ = 2Γ 2 0 /7f ≪ 1 For k < 2, f decreases with radius. Thus the reverse shock is initially Newtonian, and becomes relativistic at a radius R N given by f (R N ) = Γ 2 0 , or R N ∼ min(R Γ , R N,0 ) with where ζ = (1 + z)/3, Γ 2.5 = Γ 0 /10 2.5 , T GRB = (1 + z)∆ 0 /c = 30T 30 s is the observed duration of the GRB and is the radius where a rest mass E/Γ 2 0 c 2 of the external medium is swept up. In this work T denotes the observed time (at which photons reach the observer), while t denotes the lab frame time. The observed times corresponding to R N,0 and R Γ are where b ∼ 1 − 2 and b ∼ 2 reflect the typical photon arrival times from regions 3 and 2, respectively, and b = 2 is used to obtain the numerical values. Two additional important radii are the spreading radius R s ∼ Γ 2 0 ∆ 0 ∼ R 3−k Γ R k−2 N,0 mentioned above (where the shell starts spreading radially), and the radius at which the reverse shock finishes crossing the shell, . It is also convenient to define the parameter . Note that R Γ = R Γ,0 and R s = R s,0 since R Γ does not depend on ∆ and R s depends on ∆ 0 rather than on ∆. Thus, we have so that the initial relative ordering of the different radii is determined by the value of Υ 0 , while the evolution of this ordering is determined by that of Υ.
The condition Υ 0 > 1 can be written as ∆ 0 < ∆ cr or Γ 0 < Γ cr where so that this case is often referred to as a "thin" or "slow" shell. Similarly, the case Υ 0 < 1 corresponds to ∆ 0 > ∆ cr or Γ 0 > Γ cr and is referred to as a "thick" or "fast" shell. Note that

Thin Shells
For Υ 0 > 1 (a thin or slow shell) and k < 2, the initial ordering of the critical radii is R s < R ∆,0 < R Γ < R N,0 and the shell starts spreading early on 5 so that at R > R s we have ∆ ∼ R/Γ 2 0 ∼ (R/R s )∆ 0 and Υ ∼ Υ 0 (R/R s ) −1 starts decreasing, which leads to a triple coincidence, R ∆ ∼ R Γ ∼ R N with Υ ∼ 1 at that radius (see Eq. [9]). In this case the reverse shock is mildly relativistic during the period when most of the energy is extracted from the shell, near the radius R ∆ ∼ R Γ ∼ R N or the corresponding time T Γ when the reverse shock finishes crossing the shell. At larger times or radii, most of the energy has already been transferred to the shocked external medium and the flow approaches the adiabatic (i.e. with a constant energy E) self-similar Blandford & McKee (1976, hereafter BM76) solution.
For k = 2, f is initially (at R < R s ) independent of radius and f /Γ 2 0 = l S /Γ 4 0 ∆ = Υ (= Υ 0 as long as the shell does not spread significantly). Therefore, for thin shells the reverse shock is Newtonian with a constant shock velocity at R < R s . However, for thin shells R s is smaller than all other critical radii, so that the shell begins to spread early on. Therefore, again at R > R s we have ∆ ∼ R/Γ 2 0 ∼ (R/R s )∆ 0 and Υ ∼ Υ 0 (R/R s ) −1 starts decreasing with radius, leading to R ∆ ∼ R Γ ∼ R N with Υ ∼ 1 at that radius, so that the reverse shock is mildly relativistic by the time it finishes crossing the shell, at T Γ .
For 2 < k < 3 and Υ 0 > 1, the initial ordering of the critical radii is R N,0 < R s < R ∆,0 < R Γ and f initially (at R < R s ) increases with radius (and time). Hence the reverse shock is initially relativistic until R N,0 (T N,0 ) and then becomes Newtonian. At R > R s the shell begins to spread and from this point on ∆ ∼ (R/R s )∆ 0 and therefore f and Υ begin to decrease with radius (as R k−3 and R −1 , respectively). This again leads to R ∆ ∼ R Γ ∼ R N with Υ ∼ 1 at that radius, where the reverse shock finishes crossing the shell. Here R N is the radius where the reverse shock becomes relativistic again, i.e. it becomes mildly relativistic when it finishes crossing the shell, at T Γ .

Thick Shells
For Υ 0 < 1 (a thick or fast shell) and k < 2, the initial ordering of the critical radii is R N,0 < R Γ < R ∆,0 < R s . Since R s is the largest of the critical radii, spreading is unimportant, and therefore ∆ ≈ ∆ 0 , R N ≈ R N,0 , and R ∆ ≈ R ∆,0 . The reverse shock becomes relativistic before it crosses most of the shell, and therefore in this case most of the kinetic energy is converted to internal energy (of the shocked shell and the shocked external medium) at R ∆,0 corresponding to an observed time T E ∼ (1 + z)R ∆,0 /cΓ 2 BM (R ∆,0 ) ∼ (1 + z)∆ 0 /c ∼ T GRB , where Γ BM (R) ∼ (E/Ac 2 ) 1/2 R (k−3)/2 is the Lorentz factor of the adiabatic BM76 selfsimilar solution. Here R Γ is no longer relevant since the relativistic reverse shock implies that Γ ≪ Γ 0 so that the energy in the swept up external medium of rest mass M is now Γ 2 Mc 2 ≪ Γ 2 0 Mc 2 , and an external medium of rest mass much larger than M 0 /Γ 0 = E/Γ 2 0 c 2 (by a factor of Γ 2 0 /Γ 2 ≈ 2Γ 0 /f 1/2 ≫ 1, where M 0 is the original shell's rest mass) needs to be shocked in order for it to reach an energy comparable to E (and this occurs only at R ∆,0 ). I now generalize the results of Sari (1997), which are for a uniform external density (k = 0), to a more general power law external density (with k < 3; see also Granot & Ramirez-Ruiz 2011) For k = 2, Γ remains constant at this stage while for k < 2 it decreases with time (see below). Since T z = T /(1 + z) ∝ R/Γ 2 ∝ R (4−k)/2 we have dR/dT z = [2/(4 − k)]dR/dT z and the observed rate of production of internal energy in the forward shock is where dE/dR ≈ 4πR 2 ρ 1 (R)c 2 Γ 2 (R) = 4πAc 2 Γ 2 R 2−k . Substituting Eq. (13) into Eq. (14) we see that regardless of the value of k, the luminosity of the forward shock is constant, T 30 s is the time when the energy in the shocked external medium becomes comparable to E. The Lorentz factor at this time is independent of the initial Lorentz factor Γ 0 , After the time T E most of the energy is in the forward shock, which quickly approaches the BM76 self-similar solution, in which its Lorentz factor scales as Γ BM ∝ R −(3−k)/2 ∝ T −(3−k)/2(4−k) , which implies L int,obs ∝ T −1 .
For k = 2 and thick shell (Υ 0 < 1) we have R s > R ∆,0 so that the shell hardly spreads radially (∆ ≈ ∆ 0 ) while it is crossed by the reverse shock. This implies that f /Γ 2 0 = l S /Γ 4 0 ∆ = Υ ≈ Υ 0 , i.e. the reverse shock is relativistic and its strength (or Γ 43 ) is constant with radius until it finishes crossing the shell at R ∆,0 (corresponding to an observed time T E ). Therefore, for thick shells R N,0 and T N,0 go to zero, and the Lorentz factor of the shocked fluid is constant in time, Γ(T < T E ) = Γ(T E ) ∼ Γ cr (note that this value is ≪ Γ 0 ). At T > T E (or equivalently, R > R ∆,0 ) the flow approaches the BM76 self-similar solution.
For 2 < k < 3 and a thick shell (Υ 0 < 1), the initial ordering of the critical radii is R Γ < R ∆,0 < R s < R N,0 and f increases with radius (and time). Therefore the reverse shock is relativistic until it finishes crossing the shell at R ∆,0 (or T E ). Again, Γ is given by Eq. (13) at T < T E (or R < R ∆ 0 ), where it increases with time (and radius) at this stage, while at T > T E (or R > R ∆,0 ) it is given by the BM76 self-similar solution, Γ BM (R) ∼ (E/Ac 2 ) 1/2 R (k−3)/2 .

Acceleration of a highly magnetized impulsive flow into vacuum
This was addressed in great detail in paper I, and here I summarize the main results that were derived in there. Paper I has studied, under ideal MHD, the test case of a cold (with a negligible thermal pressure) finite shell of initial (at t = 0) width l 0 (occupying −l 0 < x < 0) and magnetization σ 0 = B 2 0 /4πρ 0 c 2 ≫ 1, whose back end leans against a conducting wall (at x = −l 0 ) 6 and with vacuum in front of it (at x > 0), where the magnetic field is perpendicular to the direction of motion. A correspondence was shown in this case between the dynamical equations in planar and spherical geometries. A strong rarefaction wave develops at the vacuum interface and propagates toward the wall at the initial fast magnetosonic speed of the unperturbed shell, c ms,0 = β ms,0 c, reaching the wall at t = t 0 = l 0 /c ms,0 ≈ l 0 /c. For a cold shell the dimensionless fast-magnetosonic speed is given by β ms,0 = σ 0 /(1 + σ 0 ) and corresponds to a Lorentz factor of Γ ms,0 = (1 − β 2 ms,0 ) −1/2 = √ 1 + σ 0 and a dimensionless 4-velocity of u ms,0 = Γ ms,0 β ms,0 = σ 1/2 0 . In our case σ 0 ≫ 1 so that Γ ms,0 ≈ u ms,0 = σ 1/2 0 ≫ 1 and β ms,0 ≈ 1. The rarefaction wave accelerates the shell to a typical (or weighted mean over the energy in the lab frame) Lorentz factor of Γ (t 0 ) ∼ σ 1/3 0 while the typical magnetization drops to σ (t 0 ) ∼ σ 2/3 0 . This result has a simple explanation: as long as σ ≫ 1 and most of the energy is in electromagnetic form, energy conservation implies that Γ σ ∼ σ 0 ; such very fast acceleration can occur only as long as the flow pushes against the "wall" (or static source), and stops when the flow looses causal contact with it, i.e. when it becomes superfast-magnetosonic, Γ ∼ Γ ms ∼ σ 1/2 ∼ σ 1/2 0 Γ −1/2 , which corresponds to Γ ∼ σ 1/3 0 and σ ∼ σ 2/3 0 . Such a shell is broadly similar to a uniform (quasi-) spherical outflow from a static source that lasts a finite time, t 0 , during which it reaches a radius R 0 ≈ ct 0 , Lorentz factor Γ (t 0 ) ∼ σ 1/3 0 and magnetization σ (t 0 ) ∼ σ 2/3 0 , being quickly accelerated from Γ ∼ 1 and σ = σ 0 near the source.
In a spherical steady-state flow the acceleration becomes inefficient once the flow loses causal contact with the static source (or "wall") and there is no significant subsequent acceleration so that Γ ∼ σ 1/3 0 also asymptotically, at very large distances from the source (Goldreich & Julian 1970). For a non-spherical flow collimation can result in further acceleration up to Γ ∼ σ 1/3 0 θ −2/3 j (e.g., Lyubarsky 2009), where θ j is the asymptotic half-opening angle of the jet (at which point lateral causal contact across the jet is lost, so the center of the jet cannot push against the ambient material; for simplicity, factors of order unity are discarded here and until the end of this subsection). However, for an impulsive source, which corresponds to a shell of finite width l 0 or a outflow lasting for a finite time t 0 ≈ l 0 /c, efficient subsequent acceleration (at t > t 0 ) does occur. This happens since the shell pushes against itself and significantly expands in its own rest frame, under its own magnetic pressure (while its width in the lab frame remains constant, ∆ = ∆ ′ /Γ ∼ l 0 , since its comoving width ∆ ′ increases linearly with its Lorentz factor Γ as it accelerates). While in the comoving frame the expansion is roughly symmetric between the back and front parts of the shell, in the lab frame most of the energy remains in the front part of the the shell, resulting in a constant effective width (∆ ∼ l 0 , where most of the energy resides).
The radial expansion of the shell in its own rest frame as its accelerates results in a dispersion δΓ ∼ Γ in its Lorentz factor. This causes the shell width in the lab frame to increase as ∆ ∼ R 0 + R/ Γ 2 . Ideal MHD implies that the shell's electromagnetic energy scales as E EM ∝ 1/∆. Therefore, at the radius R c where the shell doubles its initial width, half of the initial magnetic energy is converted into kinetic form, so that σ = E EM /E kin ∼ 1 and Γ ∼ σ 0 at this radius. Therefore, R c must correspond to the coasting radius where the acceleration saturates and after which the shell becomes kinetically dominated and starts coasting at Γ ∼ σ 0 . This, in turn, implies that R c ∼ R 0 σ 2 0 , which provides the scaling of Γ with R during the acceleration phase: At t > t c the flow becomes essentially unmagnetized (i.e. with a low magnetization, σ < 1), its internal (magnetic) pressure becomes unimportant dynamically, and each fluid element within the shell coasts at a constant speed (ballistic motion). As we have seen above, the shell starts spreading radially significantly in the lab frame at R c , and subsequently its width grows linearly with R, t or x, . Moreover, the growth in the width of the shell causes a significant drop in its magnetization: 4. Acceleration and Deceleration of an Impulsive High-σ Relativistic Outflow 4.1. The general framework, and a spherical self-similar solution for k = 2 For concreteness, let us specify to a spherically symmetric flow expanding into a powerlaw external density profile, ρ 1 = Ar −k , where r is the spherical radial coordinate. The outflow is taken to be cold (with no thermal pressure), and with a high initial magnetization, σ 0 ≫ 1. The original outflow remains cold as long as it is not shocked by a reverse shock. The shocked swept-up external medium, however, is typically heated to relativistic temperatures. The motion is in the radial direction (β =r) and the magnetic field is tangential (r · B = 0).
It has been shown in paper I that the relevant cold (no thermal pressure) MHD equations for spherical and planar geometries are identical when written in terms of the normalized, barred variables, which can apply to both a planar and a spherical geometry, is the normalized comoving magnetic field. When there is thermal pressure then it violates this rescaling 7 . There is a convenient analytic solution for the relevant planar the Riemann problem with a uniform unmagnetized external medium (paper I; Lyutikov 2010), which has a corresponding spherical solution according to the above rescaling, for k = 2. This solution would be valid within the original cold magnetized shell, i.e. at r < R CD (t), where R CD is the radius of the contact discontinuity (CD) that forms. 8 A shock propagates into the cold unmagnetized external medium, with a shock radius R sh (t), which heats the material passing through it to a relativistically hot temperature. Therefore, in the region between the shock front and the CD, R CD (t) < r < R sh (t), the simple self-similar solution for the planar case where this region is uniform with the same pressure and velocity as the CD itself, is no longer valid in the spherical case. However, for the spherical case with k = 2 and a constant velocity of the CD (Γ CD = const) there is a different self-similar solution shown in Figs. 4-6 of BM76, corresponding to k = 2, q = 0 (energy injection by a constant power source), and m = 0 (the Lorentz factor has no explicit time dependence, and instead depends only on the value of the self-similar variable, where ξ = r/ct, so that the Lorentz factor of the shock front, Γ sh , or the CD, Γ CD , are constant). In our case, this unmagnetized (σ = 0) solution would apply in the region between the CD and the shock front, R CD (t) < r < R sh (t), while the inner part (r < ξ u ct < R CD (t), where ξ u is introduced below) of the global solution is given by the selfsimilar solution mentioned above for the cold magnetized shell, which can be simply scaled from planar to spherical geometry. Please note that the shock location, χ = 1, corresponds to ξ sh = β sh ≈ 1 − 1/2Γ 2 sh and that the CD location is (from Table I However, the Lorentz factor of the material just behind the shock front is Γ(χ = 1) ≈ Γ sh / √ 2, and therefore Γ CD /Γ(χ = 1) = (2/χ CD ) 1/2 ≈ 1.06. This shows that the Lorentz factor of the shocked external medium increases only by about 6% from just behind the shock front to the CD (and its square increases by 13%, as can be seen in Fig. 5 of BM76). Therefore, a uniform Lorentz factor is a reasonable approximation for this region (and I shall occasionally use this approximation). Moreover, the normalized width of this region is This spherical self-similar solution for k = 2 is a very useful starting point for the current discussion. It will be described it in terms of the corresponding planar solution, where a uniform region would correspond to an r −2 dependence of the density or magnetic pressure in the spherical solution. We are interested in an initially highly magnetized flow (σ 0 ≫ 1), and for all cases of interest (except regime IV, which is described separately in § 4.5) the shock that is driven into the external medium is (at least initially) highly relativistic, the shock front moving with Γ sh = (1 − β 2 sh ) −1/2 ≫ 1. The planar Riemann problem contains 5 regions (see Fig. 1): (1) at ξ > ξ sh , where ξ ≡ x/ct and ξ = ξ sh = x sh (t)/ct = β sh at the location of the shock front, there is cold, unmagnetized, unperturbed uniform external medium at rest with rest mass density ρ 1 , (2) at ξ CD < ξ < ξ sh there is a uniform 9 region of shocked external medium, moving at Γ 2 = (1−β 2 2 ) −1/2 ≈ Γ sh / √ 2 with e 2 = 3p 2 = 4Γ 2 2 ρ 1 c 2 , where at ξ CD = β 2 there is a contact discontinuity (CD), (3) at ξ u < ξ < ξ CD there is a uniform region (moving at Γ 3 = Γ 2 with e 3 = p 3 = (B 3 /Γ 3 ) 2 /8π = p 2 ) occupied by magnetized material (originating from region 5, or from the original magnetized outflow in an astrophysical context) that has passed through a rarefaction wave (region 4) and is accumulating between the front end of the rarefaction wave, at 10 ξ u = [β 2 −β ms (β 2 )]/[1 −β 2 β ms (β 2 )], and the CD, (4) at ξ rf < ξ < ξ u is a region with a rarefaction wave described by the self-similar solution in Appendix A of paper I, where ξ rf = −β ms,0 = −[σ 0 /(1 + σ 0 )] 1/2 is its tail, and (5) at ξ < ξ rf is the original unperturbed uniform, cold magnetized shell at rest with rest mass density ρ 0 , magnetic field B 0 , and magnetization σ 0 = B 2 0 /4πρ 0 c 2 ≫ 1. Now, let us consider such an initial shell of finite initial width l 0 , whose back end is leaning against a conducting "wall" (at x = −l 0 ). At t 0 = l 0 /c ms,0 (where t 0 ≈ l 0 /c for σ 0 ≫ 1) the tail of the leftward moving rarefaction wave reaches the wall and a secondary right-going rarefaction wave forms that decelerates the material at the back of the flow. The head 11 of the secondary rarefaction wave is located at ξ * (t) = x * (t)/ct and moves to the right with a dimensionless speed where β(ξ ≥ ξ * ) and β ms (ξ ≥ ξ * ) are given by the self-similar solution for the original expansion (describing a leftward moving rarefaction), since the part of the flow ahead of the secondary (or "reflected") rarefaction wave (ξ > ξ * ) does not "know" about the existence of the "wall". At this stage region 5 described above no longer exists, and a new region is formed behind the head of the secondary (right-going) rarefaction wave. This new region carries a very small fraction of the total energy as long as the magnetization at its head is large, σ(ξ * ) = σ 0ρ * ≫ 1 whereρ * =ρ(ξ * )/ρ 0 , which implies that this rarefaction is strong and significantly decelerates the fluid that passes through it (see paper I for details). Therefore, as long as this condition holds, most of the energy and momentum in the flow, as well as most of the original rest mass of the magnetized shell, remain in a shell of constant width ≈ 2l 0 between ξ * and ξ sh .
The value of ξ u is determined by pressure balance at the CD. Since both the normalized pressure,p =b 2 /2 = r 2 b 2 /2, and the fluid velocity are constant in the range ξ u ≤ ξ < ξ sh = β sh (corresponding to regions 2 and 3; see Fig. 1), and R sh (t) ≈ R CD (t) ≡ R(t) ≈ ct so that the external density can be evaluated at either of these radii, whereρ ≡ρ/ρ 0 is the normalized density (i.e. ρ/ρ 0 in the planar case and ρr 2 /ρ 0 R 2 0 in the spherical case) andρ u =ρ(ξ u )/ρ 0 is its value at ξ u , while Eq. (24) holds for Γ CD ≫ 1.
Although the self-similar solution at r < R CD (t) is strictly valid only for k = 2, for which Γ CD is constant, we shall make the approximation that it still provides a reasonable description of the flow for k = 2, in which case Γ CD , σ CD , etc., gradually evolve with time.
Denoting the initial shell to external density ratio by where σ u = σ(ξ u ). For the self-similar rarefaction wave solution in region 4 (see paper I), where σ = σ(ξ) = σ 0ρ = σ 0ρ (ξ)/ρ 0 is the local value of the magnetization parameter, and the Riemann invariant J + approaches a value of 16σ 2 0 for σ 0 ≫ 1. We are interested primarily in the relativistic part of region 4, for which Γ 4 ≫ 1 is given by 12 At 1 ≪ σ ≪ σ 0 the Lorentz factor varies significantly with σ = σ 0ρ as Γ 4 ≈ σ 0 /2σ, while for σ ≪ 1 it approaches a constant value of Γ 4 ≈ 2σ 0 . The transition between these two regimes occurs at σ ∼ 1 for which Γ 4 ∼ σ 0 [though Γ 4 (σ = 1) ≈ 0.343σ 0 , and Γ 4 (σ = 1/8) = σ 0 ]. We 12 The result for the bulk of the rarefaction wave (where Γ ≫ 1 and σ ≫ 1) can be understood considering a finite shell of initial width l 0 and energy (per unit area) E 0 = l 0 (B 2 0 /8π)(1 + 2/σ 0 ) ≈ l 0 B 2 0 /8π. After the passage of the rarefaction wave, the shell width becomes ≈ 2l 0 , and since it is relativistic there is an electric field in the lab frame that is almost equal to the magnetic field so that the shell energy is E ≈ 2l 0 (B 2 /4π). Now, E = E 0 requires B ≈ B 0 /2, and B = B 0 Γρ since B/Γρ = const, implying Γ ≈ 1/2ρ. More generally, are particularly interested in when this also corresponds to the transition between regions 4 and 3, i.e. Γ 4 (ξ u ) = Γ 2 ∼ σ 0 and σ u ∼ 1, which according to Eq. (25) corresponds to f 0 ∼ σ 3 0 (R/R 0 ) 2−k , or to a radius R 1 that can be defined by σ u (R 1 ) = 1 and is given by For k = 2 both Γ CD = Γ u and σ CD = σ u do not change with radius, so that generally σ u is either always below 1 or always above 1, corresponding, respectively, to regimes I and II that are discussed below, so that in this case there is no radius R 1 where σ u (R 1 ) = 1.
If the magnetization in region 3 or just behind the CD is low, σ u ≈ σ CD ≪ 1, then Γ CD ≈ 2σ 0 according to Eq. (27), so that Eq. (25) implies If, on the other hand, the magnetization in region 3 or just behind the CD is high, σ u ≈ σ CD ≫ 1, then Eq. (27) implies Γ 4 ≈ 1/2ρ (since σ ≥ σ u in all of the region behind the CD), and in particular Γ CD = Γ 4 (ξ u ) ≈ 1/2ρ u , so that Eq. (25) gives where R cr ∼ R 0 Γ 2 cr is the radius at which Γ CD reaches the value Γ cr when σ u ≈ σ CD ≫ 1, and an expression for this radius is provided in Eq. (46) below.

Regime I
From the derivation above it becomes clear that for f 0 ≫ σ 7−2k 0 the external medium would hardly affect the acceleration phase, and the magnetized shell would accelerate essentially as if it were expanding into vacuum (as described in paper I, and summarized in § 3). This can be seen from the fact that this condition corresponds to σ u (R c ) ≪ 1, i.e. that even by the coasting radius R c ∼ R 0 σ 2 0 the region of the original shell that had been affected by the external medium (region 3) occupies only a small part of the flow near its head that carries a small fraction of its energy. The transition, where f 0 ∼ σ 7−2k 0 , corresponds to the equality of the coasting radius (or distance), R c ∼ R 0 σ 2 0 , and the deceleration radius 13 . In planar symmetry with a constant external density ρ 1 (which corresponds to k = 2 in spherical symmetry), conservation of energy implies E ∼ l 0 σ 0 ρ 0 c 2 ∼ σ 2 0 l dec ρ 1 c 2 and thus the deceleration distance is given by l dec ∼ l 0 ρ 0 /σ 0 ρ 1 = l 0 f 0 /σ 0 (where for simplicity we discard factors of order unity) so that indeed l dec ∼ l c ∼ l 0 σ 2 0 corresponds to f 0 ∼ σ 3 0 , as it should. For spherical symmetry, energy conservation reads . Note that in this regime R dec essentially corresponds to R Γ that is given in Eq.
For k < 2, σ u increases with radius (see Eq. [29]) and since we have seen that regime I corresponds to σ u (R c ) ≪ 1 this implies that σ u ≪ 1 all along. For 2 < k < 10/3, on the other hand, σ u decreases with radius passing through the value of 1 at a radius R 1 given by In this parameter regime R 0 < R 1 < R c , so that Eqs. (29) and (30) One can find the time when the reflected rarefaction wave reaches region 3, ξ * = ξ u , or the corresponding radius R u . Relying on the derivations in paper I, one obtains R u /R c ≈ 2σ −3/4 u , which upon substitution of σ u (R u ) from Eq. (29) and solving for R u gives where R RS (discussed below) is the radius where a strong reverse shock develops. Therefore, clearly R u < R RS , and the reflected rarefaction reaches region 3 well before a strong reverse shock develops. The rarefaction wave also reaches the CD (ξ * = ξ CD at a radius R * ,CD ) within a single dynamical time from reaching ξ u (i.e. R * ,CD ∼ R u ), where ∆R = R * ,CD −R u and the last approximate equality is valid since β ms (β CD ) ≈ σ 1/2 u ≪ 1. Once the right-going rarefaction wave reaches the CD, this triggers a gradual deceleration of the CD, which is initially weak as the rarefaction is weak at this stage since u ms = √ σ u ≪ 1.
13 The deceleration radius R dec is the radius at which most of the energy is transferred to the shocked swept-up external medium. Here its post-shock Lorentz factor is Γ 2 ∼ σ 0 and therefore the energy given to a swept-up external rest mass M is (Γ 2 2 − 1)M c 2 ∼ σ 2 0 M c 2 , and R dec is given by E ∼ σ 2 0 M (r < R dec )c 2 .
-19 -In regime I, which corresponds to f 0 ≫ σ 7−2k 0 ⇐⇒ σ 0 ≪ Γ cr ∼ (f 0 σ 0 ) 1/(8−2k) or R c ≪ R dec ∼ R Γ , there are three main stages in the dynamics of the shell (see Figs. 2 through 7): (i) initially (at R 0 < R < R c ) the shell accelerates, its typical Lorentz factor increasing as Γ ∼ (σ 0 R/R 0 ) 1/3 while its typical magnetization decreases as σ ∼ σ 2/3 0 (R/R 0 ) −1/3 (since magnetic energy is converted into kinetic energy while the total energy is conserved, Γ σ ∼ σ 0 ), (ii) at the coasting radius, R c ∼ R 0 σ 2 0 , the kinetic energy becomes comparable to the magnetic energy, σ ∼ 1, so that at R c < R < R dec most of the energy is already in kinetic form and the shell coasts at Γ ∼ σ 0 while its magnetization decreases as σ ∼ R c /R, (iii) at R dec ∼ (E/σ 2 0 Ac 2 ) 1/(3−k) ∼ R Γ (Γ 0 → σ 0 ) most of the energy is transfered to the shocked external medium 14 , and at R > R dec the flow approaches the BM76 self-similar solution where Γ ∼ (E/Ac 2 ) 1/2 R (k−3)/2 . This is summarized in the following equation: (33) Please note that in regime I, Γ CD ∼ σ 0 at R > max(R 0 , R 1 ) ≪ R c ≪ R dec . However, at R > R dec as the original magnetized shell becomes part of the BM76 self-similar solution its Lorentz factor is ∼ Γ CD and it decreases with time along with its magnetization and total energy. As long as it is relativistically hot and thus part of the BM76 solution, its Lorentz factor scales as Γ CD ∝ R (2k−7)/2 ∝ T (2k−7)/[4(4−k)] while its magnetization decreases as σ ∝ R (2k−9)/2 ∝ T (2k−9)/[4(4−k)] , where T ∼ R/cΓ 2 CD is the time when radiation from the original magnetized shell reaches the observer. However, since the reverse shock is only mildly relativistic the shell's temperature quickly becomes sub-relativistic and it deviates from the BM76 solution (and the corresponding scalings above), decelerating more slowly (Kobayashi & Sari 2000).
In regime I, the typical magnetic pressure in the ejecta shell at R c is p m (R c ) ∼ ρ(R c )c 2 ∼ ρ 0 c 2 σ −5 0 (where ρ is its typical or average proper density), while the pressure of the shocked external medium is , so that the typical or average magnetic pressure in the shell is much larger, p m (R c )/p 2 (R c ) ∼ f 0 /σ 7−2k 0 ≫ 1. However, at larger radii the two pressure scale as p m ∝ R −4 and p 2 ∝ R −k so that their ratio drops with radius as p m /p 2 ∝ R k−4 and the two pressures become comparable at R RS , where A strong reverse shock must form at R ∼ R RS , since at that stage the magnetic pressure can no longer balance the thermal pressure of the shocked external medium at the CD, and a new source of pressure is needed, which comes in the form of thermal pressure that is generated by the reverse shock that develops and soon becomes dominant. While a weak reverse shock might develop earlier, at R < R RS the thermal pressure it generates would be much smaller than the magnetic pressure, so that it would not have a significant effect on the dynamics and would dissipate only a small fraction of the total energy. The reverse shock is initially Newtonian, until it becomes mildly relativistic at R dec . This can be seen by balancing the pressure behind the forward shock, which implies a reverse shock upstream to downstream relative 4-velocity of u RS ∼ (R/R dec ) (3−k)/2 . This is the familiar "thin shell" case for the deceleration of an unmagnetized initially coasting shell (described in § 2). The shell starts spreading significantly (in the lab frame) at R c ∼ R 0 Γ 2 (R c ) ∼ R 0 σ 2 0 , resulting in the formation of a reverse shock that becomes thermal pressure dominated around R RS , and gradually strengthens until it becomes mildly relativistic near its shell crossing radius, which is the deceleration radius, R dec ∼ (E/σ 2 0 Ac 2 ) 1/(3−k) . Near R dec , where most of the energy is given to the shocked external medium, and where the reverse shock crosses most of the shell, the typical magnetization of the shell is low, [11] with R 0 ). Note that this regime corresponds to Γ(R c ) ∼ σ 0 ≪ Γ cr , which can also be expressed as Γ cr /σ 0 ∼ (f 0 σ 2k−7 0 ) 1/(8−2k) ∼ Υ (3−k)/(8−2k) 0 ≫ 1 where in the expression for Υ 0 (Eq. [8]) one substitutes ∆ 0 → R 0 and Γ 0 → σ 0 , thus clearly corresponding to the unmagnetized (or low magnetization) thin shell case. A larger magnetic field downstream (and also somewhat upstream) of the reverse shock is possible due to magnetic field amplification in the reverse shock itself, which may allow for a reasonable radiative efficiency coupled to the rather effective energy dissipation in the mildly relativistic reverse shock.
Altogether, I find that R * ,CD ∼ R u , R RS ∼ R cr , R dec ∼ R Γ , and The ordering of the relevant critical radii in the different regimes are given in Tables 2 and 3. In regime I with k < 2 or with 2 < k < 10/3 and f 0 > σ 3 0 we have R 0 < R c < R u ∼ R * ,CD < R RS ∼ R cr < R dec ∼ R Γ while for 2 < k < 10/3 and σ 7−2k 0 < f 0 < σ 3 0 we also have the critical radius R 1 so that R 0 < R 1 < R c < R u ∼ R * ,CD < R RS ∼ R cr < R dec ∼ R Γ .
For k = 2 we have a self-similar solution for the rarefaction wave, thanks to the equivalence of the cold MHD equations for a spherical flow to those for a planar flow, which make it easier to explicitly calculate much of the relevant dynamics. For a general value of k we do not have this privilege, and I have relied on the approximation that this self-similar solution still approximately holds in this case where Γ CD = Γ(ξ u ) and ξ u gradually change with time. In order to further justify this, I now provide an alternative derivation of Eq. (30). The pressure balance at the CD reads (B CD /Γ CD ) 2 /8π ≈ a(4/3)Γ 2 CD ρ 1 c 2 , implying where L CD ≈ cB 2 CD R 2 CD is the instantaneous Poynting flux through a static spherical surface at r = R CD . Note that L CD is close to the mean (isotropic equivalent) luminosity (or power) of the source, L ≈ Ec/2R 0 ≈ πρ 0 σ 0 c 3 R 2 0 [identifying the initial width of the shell ∆ 0 with its initial radius R 0 , where the shell initially occupies the region 0 < r ≤ R 0 , while E ≈ E EM,0 = 2πρ 0 σ 0 c 2 R 3 0 and ρ 0 = ρ(t = 0, r = R 0 )], only where the magnetization parameter just before the CD is large, σ CD ≫ 1, which corresponds to Γ CD ≪ σ 0 . In this case L CD ≈ L and we have This is valid as long as the value of the lab-frame magnetic field B at the CD (i.e. the head of the outflow) is close to its original value, i.e. for σ CD = σ u ≫ 1, which holds at max(R 0 , R 1 ) < R < R dec .
The condition that f 0 ≫ σ 1/3 0 in regime II implies that Γ CD (R 0 ) ∼ Γ (4−k)/2 cr ∼ (f 0 σ 0 ) 1/4 ≫ σ 1/3 0 , and therefore at t 0 region 4 (see Fig. 1) holds most of the volume and energy, and Γ ∼ σ 1/3 0 (R/R 0 ) 1/3 ≈ (σ 0 t/t 0 ) 1/3 at t ≥ t 0 . At this stage the typical or mean value (weighted average over the energy in the lab frame) of the Lorentz factor within the magnetized shell, Γ , increases with time, while for k = 2 the Lorentz factor of the uniform region at its front, Γ(ξ u ) = Γ 3 = Γ CD , remains constant. More generally, Γ CD (R 0 ≤ R ≤ R cr ) is given by the smaller between the expression in Eq. (37) and 2σ 0 . This acceleration (increase in Γ ) lasts until the secondary (or reflected) rarefaction wave finishes crossing region 4, i.e. until ξ * ≈ 1 − 2R 0 /ct ≈ 1 − 2R 0 /R equals (where since Γ ms ≫ 1, we have Γ 2 ms ≈ u 2 ms = σ = σ 0ρ ≈ σ 0 /2Γ and specifically Γ 2 ms (β CD ) ≈ σ 0 /2Γ CD ), at R = R u , which corresponds to which is different from the result for regime I (see Eq. [31]), where R u /R c ≈ 2σ At this stage (R = R u or t = t u ) most of the energy in the flow is in 15 region 3, which moves with Γ 3 ≈ Γ CD given by Eq. (37), that represents Γ at this stage (R u < R < R * ,CD ). Region 3 is gradually crossed by the right going rarefaction wave, until it reaches the CD at R * ,CD ∼ R cr ∼ R dec (as shown in detail below), which marks the end of this stage. At that point most of the energy is in the shocked external medium 16 , and the flow approaches the BM76 self-similar solution (first the rarefaction wave crosses region 2, within a few dynamical times, 17 and then the adiabatic BM76 self-similar solution is quickly approached).
The width of region 3 at t u (when the rarefaction wave reaches ξ u ) in the lab frame is so that (1 − β * ) ≪ (1 − β CD ) ≈ 1/2Γ 2 CD and therefore ∆v = (β * − β CD )c ≈ c/2Γ 2 CD and the increase in radius, ∆R = R * ,CD − R u (or time, ∆t = t * ,CD − t u ≈ ∆R/c), during the time it takes the rarefaction wave to cross region 3 is ∆R ≈ 2R 0 c/∆v ≈ 4R 0 Γ 2 CD ∼ R dec for k = 2, while more generally 15 This can be seen as follows for k = 2. The pressure is continuous across the CD, and therefore the energy density of regions 2 and 3 in the lab frame is similar, and their relative energy is determined by their relative width in the lab frame. For region 2, using the uniform velocity approximation ξ sh − ξ CD = β sh − β CD ≈ 1/2Γ 2 CD − 1/2Γ 2 sh ≈ 1/4Γ 2 CD (for the BM76 solution ξ sh − ξ CD ≈ (1 − χ −1 CD )/2Γ 2 CD ≈ 1/4.60Γ 2 CD , which is rather similar), while for region 3, ξ CD − ξ u ≈ σ 0 /Γ 3 CD − 1/2Γ 2 CD = (2σ 0 /Γ CD − 1)/2Γ 2 CD , and therefore the width of region 3, ∆ 3 , is larger than that of region 2, ∆ 2 , by a factor of ∆ 3 /∆ 2 ≈ 2(2σ 0 /Γ CD − 1) ≫ 1, since Γ CD ≪ σ 0 in this regime. 16 At R u < R < R dec ∼ R cr only a small fraction of the total energy is in the shocked external medium, E ext /E ∼ (R/R cr ) (4−k)/2 . 17 For k = 2, making the approximation that the region between the CD and shock front has the constant velocity of the CD and that Γ sh = √ 2Γ CD and using Eq. (21) one obtains that during the time the rarefaction wave travels from the CD to the shock front the radius increases by a factor of 1 + (1 − χ −1 CD )2( √ 3 + 1)/(3 − √ 3) ≈ 2.87. If we self-consistently use the above assumption to estimate the width of this region (even though this is not fully self-consistent) this gives (R sh − R CD )/R CD ≈ 1/4Γ CD instead of Eq. (21), and a growth in radius during the rarefaction crossing by a factor of 1 + ( √ 3 + 1)/(3 − √ 3) ≈ 3.15. In both cases it is close to a factor of ∼ 3. This factor is relatively large since the sound speed in region 2 in "only" c s ≈ c/ √ 3 (as it is unmagnetized but relativistically hot, while regions 3 and 4 are cold but highly magnetized) and the shock front moves somewhat faster than the fluid in region 2.
so that the rarefaction reaches the CD at R * ,CD ≈ ∆R ∼ R cr ∼ R dec .
The deceleration radius in this regime can be obtained by equating the initial magnetic energy to the energy of the swept-up external medium, and therefore R dec ≈ R cr where R cr is the radius at which Γ CD = Γ BM , and is the typical Lorentz factor during the subsequent constant energy self-similar (BM76) stage.
Estimating the value of R cr from Eqs. (37) and (45) and identifying R 0 with ∆ 0 gives, During the initial acceleration (at R > R 0 ), Γ ∼ (σ 0 R/R 0 ) 1/3 . This lasts until most of the energy is transfered to the part of the magnetized shell with Γ ∼ Γ CD , which occurs at a radius R u , Lorentz factor Γ u , and magnetization σ u (R u ) given by Moreover, so that near the transition to regime I, Γ u ∼ Γ cr ∼ σ 0 and R u ∼ R cr ∼ R c .
so that for 2 < k < 10/3 or for k < 2 and σ 1/3 0 < f 0 < σ 3 0 we have R 1 < R 0 < R u < R cr ∼ R dec ∼ R * ,CD < R c and R 1 is irrelevant (as σ u ≫ 1 all along), while for k < 2 and σ 3 0 < f 0 < σ 7−2k 0 we have R 0 < R 1 < R u < R cr ∼ R dec ∼ R * ,CD < R c and R 1 is relevant. In all cases R c is not relevant physically (since it looses its meaning as a coasting radius).
The typical magnetization of the shell in the intermediate stage is so that at R dec ∼ R cr we have σ ∼ σ 0 /Γ cr ≫ 1. Thus, altogether in regimes I and II we have while in regime II we have

Regime III
In regime II we had Γ CD (R 0 ) ≫ σ 1/3 0 so that the plasma near the CD was super-fastmagnetosonic with respect to the "wall" already at R ∼ R 0 , with Γ CD /Γ ms ≈ (2Γ 3 CD /σ 0 ) 1/2 ≫ 1, and thus not in causal contact with the source. Here, in regime III, we consider what happens when 1 ≪ Γ CD (R 0 ) ≪ σ 1/3 0 . In all the regions behind the CD, the fast magnetosonic Lorentz factor is given by Γ 2 ms ≈ u 2 ms = σ ≥ σ CD ≈ σ 0 /2Γ CD ≫ 1, so that as long as Γ CD ≪ σ 1/3 0 the flow remains in causal contact with the "wall" or central source, Γ/Γ ms < (2Γ 3 CD /σ 0 ) 1/2 ≪ 1. Thus, the flow remains roughly uniform and the conditions just behind the CD are representative of the typical values in the shell, so that the conditions near R cr are very similar to those in regime II: In this regime Γ CD is still given by Eq. (36) while so that region 3 initially occupies most of the volume, ∆ 3 (t < t u )/ct = ξ CD − ξ u ≈ 2 − 1/2Γ 2 CD + 4Γ 3 CD /σ 0 ∼ 2. This demonstrates again that already at t = t 0 the conditions just behind the CD (region 3) dominate the average values over the original magnetized shell, so that Γ ≈ Γ CD and σ ≈ σ CD are given by Eqs. (37) and (38), respectively. Region 4 occupies only a small fraction of the total volume already at t = t 0 , ∆ 4 (t 0 )/ct 0 = ξ u + β ms,0 ≈ 4Γ 3 CD /σ 0 ≪ 1, and it is very quickly crossed by the right-going rarefaction wave, which reaches region 3 (ξ * = ξ u ) at t = t u (and R = R u ) that corresponds to This implies that R u ≈ R 0 and the time since t 0 when the right-going rarefaction wave reaches the CD (t CD − t 0 ) is dominated by its propagation time through region 3. For k = 2, so that it reaches the CD at a radius R * ,CD ≈ ct CD ≈ 4Γ 2 CD R 0 ∼ R cr ∼ R dec . Similarly, since in this case R u ≈ R 0 then for a general k-value Eq. (43) implies R * ,CD /R 0 ≈ ∆R/R 0 ≈ [2(4 − k)Γ 2 CD (R 0 )] 2/(4−k) ∼ Γ 2 cr ∼ R cr /R 0 , so that again, R * ,CD ∼ R cr ∼ R dec .
The effect of the external medium in this regime is very large, in the sense that it causes most of the energy to be in the uniform region 3, with a sub-fast-magnetosonic speed relative to the "wall". Nevertheless, since this region is still relativistic, it takes the rarefaction wave that is reflected from the wall a long time to cross this region in the lab (or wall) frame, and this occurs at a large distance from the wall, R * ,CD ∼ R dec ∼ R cr ∼ R 0 Γ 2 cr ≫ R 0 , near the deceleration radius where most of the energy is transferred to the shocked external medium. Altogether, in regime III we have R 0 ∼ R u < R cr ∼ R dec ∼ R * ,CD < R c (see Table 2), and similar regime II, here as well R c does not have a physical significance (and the same also holds for R 1 , since we always have σ u ≫ 1 in regime III).
In regime III, Γ (R ≥ R 0 ) becomes independent of σ 0 while σ (R ≥ R 0 ) scales linearly with σ 0 , when fixing L, A, k and R 0 (which fixes Γ cr ) while letting σ 0 and ρ 0 ∝ 1/σ 0 vary (since σ 0 ≫ 1 we have L ∼ Ec/R 0 ∼ σ 0 ρ 0 c 3 R 2 0 ∝ σ 0 ρ 0 , so that fixing L implies that ρ 0 ∝ 1/σ 0 ). Such a variation of the parameters means fixing the overall properties of the flow and changing only its composition or magnetization (as is done in Figs. 2 through 7). In this regime the global dynamics become insensitive to the exact composition. This can be thought of as the high magnetization limit, where the behavior of the outflow approaches that of an electromagnetic wave that is emitted at the source and reflected by the CD, where the time when the back end of the finite wave reflects off the CD corresponds to the time when the right-going rarefaction wave reaches the CD, t CD ≈ R * ,CD /c. Figs. 8 and 9, one could fix the properties of the magnetized flow: L, R 0 , σ 0 , ρ 0 (and thus also R c ∼ R 0 σ 2 0 ) and vary the normalization of the external density: A or ρ 1 (R 0 ) = AR −k 0 (while fixing its power-law index, k), which effectively varies Γ cr and R cr . It can be seen from Figs. 8 and 9 that as the external density goes to zero we have f 0 → ∞, Γ cr ∼ (f 0 σ 0 ) 1/(8−2k) → ∞ and R dec ∼ R Γ → ∞, and this the solution approaches that of expansion into vacuum (or the extreme limit of regime I). As the external density increases f 0 , Γ cr and R dec all decrease, until when Γ cr ∼ σ 0 , f 0 ∼ σ 7−2k 0 and R dec ∼ R Γ ∼ R cr there is a transition to regime II. As the external density increases even further a transition to regime III occurs when Γ cr ∼ σ 2/(12−3k) 0 , f 0 ∼ σ 1/3 0 and R u ∼ R 0 . Finally, when the external density becomes so large that Γ cr ∼ 1, f 0 ∼ σ −1 0 , and R cr ∼ R 0 , the flow remains Newtonian and there is a transition to regime IV that is discussed below.

Regime IV
For a sufficiently large external density, f 0 ≪ σ −1 0 , the formal expression for Γ cr gives Γ cr ≪ 1 and the flow remains Newtonian. If we consider a source that is active over a time t 0 then when the central source finishes ejecting the highly magnetized outflow, it would be bounded within R CD (t 0 ) ∼ β CD (t 0 )ct 0 ≈ β CD (t 0 )R 0 , where I neglect factors of order unity for simplicity (here R 0 is still defined through the relation R 0 ≈ ct 0 , even though it loses its physical meaning from the relativistic regime). More generally, at t ≤ t 0 the radius of the CD satisfies R CD (t) ∼ β CD (t)ct ≈ β CD (t)R 0 t/t 0 . For a tangential magnetic field, which scales as B/B 0 ≈ R 0 /R, the magnetic pressure at CD (t), would be balanced by the ram pressure of the shocked external medium at the frame of the CD, .
This implies β CD (t 0 ) ∼ (f 0 σ 0 ) 1/(4−k) ∼ Γ 2 cr ≪ 1, which demonstrates self-consistency by showing that the flow is indeed Newtonian in this regime. The magnetic energy in the original outflow, at R < R CD (t), is given by where L 0 ≈ B 2 0 R 2 0 c and E 0 ≈ L 0 t 0 are the injected luminosity and corresponding energy over a time t 0 for a relativistic outflow. This would violate conservation of energy, if the outflow emanating from the central source was indeed relativistic (this is basically the well-known σ-problem). 18 However, since in this regime the outflow is sub-sonic (or sub-fast-magnetosonic) and Newtonian, the information about the existence of the external medium must propagate back to the source producing a back reaction that results in a Newtonian outflow with a speed ∼ β CD (t). For such a Newtonian magnetized outflow the electromagnetic luminosity is L = 4πR 2 (c/4π)| E × B| = B 2 R 2 βc, and for β(t) ∼ β CD (t) this gives L(t) ∼ β CD (t)B 2 R 2 c ≈ β CD (t)L 0 and E(t) ≈ tL(t) ∼ β CD (t)L 0 t, which is consistent with the above estimate. Even during the initial injection phase (t < t 0 ) the shocked external medium holds a good fraction of the total energy at any given time. After the injection stops, at t > t 0 , most of the energy is quickly transfered to the shocked external medium on the dynamical time (up to t ∼ 2t 0 or so), and the flow settles into an adiabatic Sedov-Taylor solution with velocity If we start with a magnetized spherical shell or "ball" of radius R 0 , initially at rest, then in this case the magnetic pressure at R CD ∼ R 0 is ∼ B 2 0 ∼ σ 0 ρ 0 c 2 and equating it to the ram pressure of the shocked external medium, ∼ ρ 1 (R 0 )β 2 CD c 2 , implies β CD ∼ (f 0 σ 0 ) 1/2 ∼ Γ 4−k cr ≪ 18 For a steady central source that ejects a magnetized outflow over a finite time t 0 this regime resorts back to the well known σ problem, where in ideal MHD the stored magnetic energy grows quadratically with the injection time of the central source, while the actual injected energy grows only linearly with this time, implying a breakdown of one or more of the underlying assumptions. This may be relevant, e.g., for a millisecond magnetar born inside a collapsing massive star, as a possible progenitor of long duration GRBs.
1. Therefore, it would significantly increase its radius and transfer most of its energy to the shocked external medium on its dynamical time, which corresponds to a timescale of At t > t dec most of the energy is in the shocked external medium and the flow settles into an adiabatic Sedov-Taylor solution with velocity 4.6. Regime II * (10/3 < k < 4): When the external density drops very sharply with radius, k > 10/3, then Γ CD initially grows with radius faster than R 1/3 , which has interesting implications. Regime II that exists for k < 10/3 disappears for k = 10/3 and reappears for 10/3 < k < 4 in a different form that we shall call regime II * , which corresponds to σ 7−2k 0 ≪ f 0 ≪ σ 1/3 0 . For 10/3 < k < 4, Regime I holds for f 0 ≫ σ 1/3 0 and regime III holds for σ −1 In regime I, for f 0 > σ 3 0 ⇐⇒ σ 0 < Γ (4−k)/2 cr there in no R 1 (as σ CD ≪ 1 and Γ CD ∼ σ 0 all along) and the shocked external medium decouples from the magnetized shell at a decoupling radius of R dcp ∼ R 0 < R c , as the forward shock accelerates down the steep external density gradient, and the shocked external medium carries only a very small fraction of the total energy, E ext /E ∼ σ 0 /f 0 < σ −2 0 ≪ 1. In the parameter range σ 1/3 0 < f 0 < σ 3 0 ⇐⇒ Γ (4−k)/2 cr < σ 0 < Γ (12−3k)/2 cr , on the other hand, there is a radius R 1 where σ CD ≈ σ u = 1 and the ordering of the critical radii is R 0 < R 1 ∼ R dcp < R c , so that Γ CD ∼ σ 0 /σ CD ∝ R (k−2)/4 following Eq. (51) until Γ CD ∼ σ 0 and σ CD ∼ 1 at R ∼ R 1 ∼ (f 0 σ −3 0 ) 1/(2−k) , and the decoupling of the forward shock from the magnetized shell occurs at R dcp ∼ R 1 . In both cases at R > R dcp the shell accelerates in the wake of the accelerating forward shock, almost as if into vacuum. At R > R c it starts coasting and spreading radially, where it can in principle keep coasting indefinitely (or more realistically until the assumption of a very steep external density profile breaks down, and enough external mass is swept-up that could decelerate the forward shock and, in turn, also the shell).
In regime II * the ordering of the critical radii is R 0 < R u < R 1 ∼ R dcp < R c < R cr (see Table 3). Initially, at R 0 < R < R u , the typical Lorentz factor and magnetization are similar to those at the CD and are determined by the pressure balance at the CD, Γ ∼ Γ CD ∼ σ 0 / σ ∼ σ 0 /σ CD ∝ R (k−2)/4 following Eqs. (37) and (51). At R u < R < R cr the bulk of the shell decouples from the CD and accelerates as Γ ∼ σ 0 / σ ∼ (σ 0 R/R 0 ) 1/3 until reaching the coasting radius R c ∼ R 0 σ 2 0 (where it starts to coast and spread, as in regime I), while Γ CD ∼ σ 0 /σ CD ∝ R (k−2)/4 keeps following Eq. (51) until Γ CD ∼ σ 0 and . At R > R 1 ∼ R dcp we have σ CD < 1 and Γ CD ∼ σ 0 , while the shocked external medium decouples from the shell, carrying with it only a small fraction of the total energy, E ext /E ∼ R 1 /R c ∼ (f 0 σ 2k−7 0 ) 1/(2−k) ≪ 1, as it keeps accelerating down the steep external density gradient, with Γ BM ∝ R (k−3)/2 (where the same energy is given to a decreasing amount of newly swept-up external rest mass). The original shell keeps coasting and spreading radially in the evacuated region in the wake of the accelerating forward shock, essentially as if into vacuum. Near the transition to regime III we have f 0 ∼ σ 7−2k 0 and therefore E ext /E ∼ 1, so that the energy in the shocked external medium becomes comparable to the total energy.
In regime III the ordering of the critical radii is R 0 < R cr ∼ R dcp ∼ R dec , and there are no R u or R 1 . At R 0 < R < R cr the shell accelerates as Γ ∼ Γ CD ∼ σ 0 /σ CD ∼ σ 0 / σ ∝ R (k−2)/4 following Eq. (51), where the typical values of Γ and σ are close to those at the CD. The shocked external medium decouples from the original magnetized shell at R dcp ∼ R cr , but since in this case σ CD (R cr ) ∼ σ 0 /Γ cr ≫ 1 the rarefaction wave is still strong when it reaches R cr so that it effectively decelerates the shell and very little energy remains in the original shell at later times (or larger radii), while most of the energy is transfered to the shocked external medium, which approaches the BM76 self-similar solution.

Summary
The different regimes are summarized in Tables 2 and 3 as well as in Figure 10. Tables 2 and 3 provide the ordering of the various critical radii in the different regimes, along with the parameter range occupied by each regime, in terms of the initial shell to external medium density ratio f 0 = ρ 0 /ρ 1 (R 0 ), initial magnetization σ 0 , and Γ cr ∼ (f 0 σ 0 ) 1/(8−2k) . Figure 10 shows the regions of parameter space occupied by each regime within the two dimensional planes spanned by f 0 -σ 0 (top left panel for k < 10/3 and bottom right panel for 10/3 < k < 4), Γ cr -σ 0 (top right panel for k < 10/3), f 0 -Γ cr plane (bottom left panel for k < 10/3).
In order to gain some intuition for these results and better understand them, it is useful to follow the behaviour of the system when varying one key physical parameter and leaving the others fixed. First, I vary the initial magnetization σ 0 (and ρ 0 ∝ 1/σ 0 for consistency) while keeping fixed the energy (E ∼ Lt 0 ≈ LR 0 /c or L), initial time or length scale (t 0 ≈ R 0 /c or R 0 ) and external density (k and A or ρ 1 (R 0 ) = AR −k 0 ), and thus also Γ cr ∼ (f 0 σ 0 ) 1/(8−2k) and R cr ∼ R 0 Γ 2 cr . This corresponds to a constant Γ cr and varying σ 0 ∝ 1/f 0 , or in Figure  In regime I (1 < σ 0 < Γ cr ) the acceleration is almost as if into vacuum: Γ ∝ R 1/3 and σ ∝ R −1/3 until most of the energy is converted to kinetic form at the coasting radius R c ∼ R 0 σ 2 0 , where Γ ∼ σ 0 and σ ∼ 1. Then the shell starts coasting (at Γ ∼ σ 0 ) and its width in the lab frame starts growing linearly with radius resulting in a fast drop in its magnetization, σ ∼ R c /R. At R > R c this regime reverts back to the well-studied unmagnetized "thin shell" case, with a reasonable spread in its Lorentz factor, δΓ ∼ Γ . A reverse shock develops and is initially Newtonian, but strengthens as the shell widens, until it becomes mildly relativistic when it finishes crossing the shell at the deceleration radius, In regime II (1 < Γ cr < σ 0 < Γ (12−3k)/2 cr ) the initial acceleration of Γ ∝ R 1/3 is limited by the external medium at R u , where most of the energy is still in magnetic form ( σ (R u ) ∼ σ CD (R u ) ≫ 1), and thus there is no coasting phase. Between R u and R cr the typical Lorentz and magnetization of the shell are similar to those just behind the CD and determined by the pressure balance at the CD, Γ ∼ σ 0 / σ ∝ R (k−2)/4 . A rarefaction wave gradually crosses the shell from its back to its front, until reaching the CD at R * ,CD ∼ R cr ∼ R dec . At that point the shocked external medium starts dominating the total energy and the flow approaches the BM76 self-similar solution.
In regime III (σ 0 > Γ (12−3k)/2 cr > 1) the external density is large enough that there is no impulsive acceleration stage with Γ ∝ R 1/3 . Instead, the pressure balance at the CD determines the shell's typical Lorentz factor and magnetization from the very start, Γ ∼ σ 0 / σ ∝ R (k−2)/4 at R 0 < R < R cr ∼ R dec , and the dynamics become insensitive to the exact composition [i.e. to the value of σ 0 , when fixing the external density (A and k) and the shell luminosity (L) and initial width (R 0 )]. This is the high-σ limit where the flow behaves like an electromagnetic wave that is emitted at the source and reflected at the CD.
There are also more "exotic" regimes, such as regime IV where the external density is so high that flow remains Newtonian, or regime II * that exists only for a highly stratified external density (10/3 < k < 4) where the external shock accelerates down the steep external density gradient and decouples from the original shell, carrying a small fraction of the total energy, while the original shell travels in its wake essentially as if into vacuum, similar to regime I. Note that regime IV corresponds to Γ cr < 1 and thus cannot be reached when fixing Γ cr to a value larger than 1 and varying σ 0 ∝ 1/ρ 0 .
A slightly different way to gain perspective about these results is by varying the external density normalization (A or ρ 1 (R 0 ) = AR −k 0 or f 0 = ρ 0 /ρ 1 (R 0 )) while keeping the other -32parameters fixed (k, σ 0 , ρ 0 , R 0 , and therefore also E and L). In this case R c ∼ R 0 σ 2 0 remains constant while Γ cr ∼ (f 0 σ 0 ) 1/(8−2k) and R cr ∼ R 0 Γ 2 cr vary, where both f 0 and Γ cr ∼ (f 0 σ 0 ) 1/(8−2k) ∝ f 1/(8−2k) 0 decrease when the external density increases. In Figure 10 this corresponds to a vertical line in all but the bottom left panel, where it corresponds to a slightly diagonal line parallel to the f 0 = Γ 8−2k cr line (the left boundary of the colored regions). The behavior in this case is illustrated in Figures 8 and 9. For a sufficiently low external density, corresponding to f 0 > σ 7−2k 0 or Γ cr > σ 0 we are in regime I, where the expansion is initially essentially as if into vacuum, reaching the coasting radius at R c that is independent of f 0 and decelerating significantly only at . As the external density increases, Γ CD (R 0 ) decreases, bringing about first regime II (σ < R cr /R c < 1), and at even larger external densities regime III (1 < Γ cr < σ 2/(12−3k) 0 ). For the highest external densities (R cr < R 0 , Γ cr < 1 or f 0 < σ −1 0 ) the flow remains Newtonian all along (regime IV).

Comparison with Previous Works
The unmagnetized case for the deceleration of a finite uniform relativistic shell by the external medium has been studied in the context of GRBs (Sari & Piran 1995;Sari 1997;Kobayashi & Sari 2000;Kobayashi & Zhang 2003;Nakar & Piran 2004). The main results have been summarized in § 2 and extended to a general power-law of the external density profile, and are consistent with the previous results. The deceleration of a magnetized relativistic shell by an unmagnetized external medium has also been studied (Zhang & Kobayashi 2005;Giannios, Mimica & Aloy 2008;Mimica, Giannios & Aloy 2009;Mizuno et al. 2009;Levinson 2010;Lyutikov 2011).
formation of a reverse shock in the ideal Riemann problem addressed in ZK05 is correct, such initial conditions are not realistic and the formation of a reverse shock and its properties can be sensitive to the exact initial conditions or to fluctuations in the external density, etc. Moreover, in the high-σ limit even if such a shock exists it has a very small effect on the global dynamics, which are the main focus of the present work, and therefore this is not addressed here in detail. In Mimica, Giannios & Aloy (2009) the problem is addressed with a similar initial setup but using high resolution 1D RMHD numerical simulations. There, the regime that is argued to have no reverse shock in Giannios, Mimica & Aloy (2008) is correctly found to have either a weak or no reverse shock. They also demonstrate numerically that the flow quickly approaches the BM76 self-similar solution after the deceleration radius. Mizuno et al. (2009) point out that for the Riemann problem of a magnetized shell moving relativistically relative to an unmagnetized region (or "external medium") at rest, above some critical value of magnetization parameter σ there is a rarefaction wave that propagates into the magnetized shell and accelerates it, and only below that critical value there is a (reverse) shock that decelerates the shell. While this observation is correct, this Riemann problem is not a realistic setup for the deceleration of magnetized GRB ejecta, since it uses arbitrary "initial" conditions near the deceleration radius. Lyutikov (2011) has analyzed the similar problem of the deceleration of a shell with arbitrary initial Lorentz factor and magnetization, concluding that the differences between the magnetized and unmagnetized cases are rather small, and involve mainly the existence or strength of the reverse shock at early times (which may be non-existent or weak for high magnetizations), rather than the global gross properties of the flow. I find that this is a right answer for the wrong question, in the sense that the initial setup is too arbitrary to realistically apply to GRB outflows. The impulsive acceleration process determines the conditions near the deceleration radius, which are therefore not arbitrary, and some regions of parameter space and their corresponding dynamical regimes cannot be realized under realistic circumstances.
Paper I has addressed mainly the impulsive acceleration into vacuum of a highly magnetized shell, starting at rest. However, at the end of its subsection 5.2 it also briefly addressed the expansion of such a shell into an unmagnetized external medium. There it has outlined the two main dynamical regimes, which in the current work are referred to as regimes I and II. Levinson (2010) has also considered the acceleration and of an impulsive magnetized notion that a shock must always travel faster than the relevant corresponding wave. It arises since they use the formula for the radius at which the reverse shock crosses the shell from Eq. (38) of ZK05 that is valid only for a strong reverse shock (with a relativistic upstream to downstream 4-velocity, u RS ≫ 1, or γ 34 ≫ 1 in the notation of ZK05) also outside its range of applicability, while the result for a fast-magnetosonic wave is approached in the opposite limit of a weak reverse shock (u RS ≪ 1 or γ 34 − 1 ≪ 1).
shell and its deceleration due to the interaction with the external medium, following paper I and treating the latter part in more detail. Levinson (2010) also identified regimes I and II. His expressions for the maximal Lorentz factor of the shell in regime II are only a factor of 1.09 lower than Eq. (11) of the current work for k = 0, and a factor of 1.57 lower for k = 2 (the latter difference might appear larger since he used z = 0, E 53 = 0.1 and A * ≈ 33 for his fiducial values while the current work uses z = 2, E 53 = 1 and A * = 1). The current work finds that for k < 2 the maximal value of Γ is obtained at R u , and is a factor of ∼ (σ 0 /Γ cr ) (2−k)/(10−3k) > 1 (see Eq. [49]) larger than Γ cr . However, for the values of σ 0 10 3 and Γ cr = 180 considered by Levinson (2010) this factor if 1.4 for k = 0, and thus consistent with his results (see his Fig. 5). Levinson (2010) has argued, however, that multiple sub-shells with an initial separation comparable to their initial width would collide and merge while still highly magnetized, which is incorrect and in contradiction with paper I. An accompanying paper (Granot 2011) focuses on the possible role of multiple sub-shells, which can alleviate some of the requirements on the Lorentz factor of the outflow and may help accommodate GRB observations much better.

Discussion and Conclusions
This work has presented a detailed and unified treatment of the magnetic acceleration of an impulsive, initially highly magnetized (σ 0 ≫ 1) shell and its deceleration by an unmagnetized external medium (with a power-law density profile). The dynamics divide into three main regimes (I, II, and III) and two more "exotic" regimes (relevant for an external density that either sharply drops with radius [II * ], or is very large [IV], leading to a Newtonian flow).
In regime I the external density is low enough that the shell accelerates almost as if into vacuum. At the coasting radius, R c ∼ R 0 σ 2 0 , it reaches its maximal Lorentz factor of Γ ∼ σ 0 < Γ cr (where Γ cr is given in Eq. [11]) and becomes kinetic energy dominated. At R > R c this regime reverts back to the well-studied unmagnetized "thin shell" case (Sari & Piran 1995), where the shell coasts and spreads radially, ∆(R > R c ) ∼ (R/R c )R 0 , as its magnetization rapidly decreases well below unity, σ(R > R c ) ∼ R c /R. In this regime the reverse shock is initially Newtonian, starts dominating the pressure behind the CD at R RS ∼ R cr , and becomes mildly relativistic when it finishes crossing the shell, at R Γ ∼ R dec . The deceleration radius, R dec , which corresponds to an observed deceleration time T dec , is where most of the energy dissipation in the shell takes place and most of the energy is transfered to the shocked external medium. Thus, both the reverse shock emission and the afterglow emission are expected to peak on the timescale of T ∼ T dec . At R > R dec (or T > T dec ) the flow quickly approaches the BM76 self-similar solution, which for GRBs signals the start of the usual long-lived decaying afterglow emission. The magnetization at the deceleration radius is low, σ (R dec ) ∼ R c /R dec ∼ (σ 0 /Γ cr ) 2(4−k)/(3−k) ≪ 1. If it is very low then magnetic field amplification in the mildly relativistic collisionless (reverse) shock that develops could bring the downstream magnetic field to within a few percent of equipartition, thus allowing a good radiative efficiency for synchrotron emission, resulting in a bright reverse shock emission. In this regime the reverse shock emission and the afterglow emission both peak on a timescale T dec that is larger than the duration T GRB of the prompt GRB emission, T dec /T GRB ∼ R dec /R c ≫ 1. Moreover, the degree of magnetization behind the reverse shock, ∼ σ (R dec ) ∼ T GRB /T dec ≪ 1, can be directly inferred from the ratio of these two observable times.
In regimes II or III the shell remains highly magnetized near the deceleration radius, σ (R dec ) ∼ σ 0 /Γ cr ≫ 1, which strongly suppresses the reverse shock (which either becomes very weak or non-existent) and its associated emission. The energy in the flow is transfered to the shocked external medium (mostly near R dec ∼ R cr ) with very little dissipation within the original shell as long as ideal MHD holds. This is a highly magnetized "thick shell" case, and the afterglow onset time is similar to the initial shell light crossing time, T dec ∼ (1 + z)R 0 /c. For a single shell ejected from the source the prompt emission in this case might either arise from the onset of the forward shock emission (for an external shock origin, which makes it difficult to account for significant variability, and in which case T GRB ∼ T dec ∼ (1 + z)R 0 /c) or alternatively due to magnetic reconnection events within the highly magnetized shell. The latter might be induced by the deceleration of the shell due to the external medium, in which case they might peak near R dec ∼ R cr , since the angular size of causally connected regions (∼ Γ −1 ) grows as the shell decelerates (Γ CD ∝ R (k−2)/4 decreases with radius for k < 2) and at R R dec ∼ R cr most of the energy is still in the original magnetized shell (this would again lead to T GRB ∼ T dec ∼ (1 + z)R 0 /c).
For the single shell case that was analyzed in this work there is either the low magnetization "thin shell" (regime I) or the high magnetization "thick shell" (regimes II or III). There is no low magnetization "thick shell" case where a strong highly relativistic reverse shock develops, which can result in a bright reverse shock emission on a timescale comparable to that of the prompt gamma-ray emission in GRBs (T dec ∼ T GRB ). Similarly, there is no high magnetization "thin shell" case where the reverse shock is severely suppressed by a high magnetization in the shell near the deceleration radius and the afterglow onset occurs well after the prompt GRB emission (T dec ≫ T GRB ). Therefore, a bright reverse shock emission is possible only in the low magnetization "thin shell" case -regime I, in which case this reverse shock emission (as well as the afterglow emission) would peak on a timescale larger than the duration of the prompt GRB emission, T dec ≫ T GRB ∼ (1 + z)R 0 /c. An accompanying paper (Granot 2011), however, shows that if the flow consists of many distinct sub-shells instead of a single shell, then this may also allow a low magnetization "thick shell" regime.
The Lorentz factor of the emitting region in GRBs must be high enough to overcome the compactness problem and avoid excessive pair production within the source (Krolik & Pier 1991;Fenimore et al. 1993;Woods & Loeb 1995;Baring & Harding 1997;Lithwick & Sari 2001). It had been recently argued (Levinson 2010) that the interaction with the external medium might not enable an impulsive highly magnetized outflow in GRBs to accelerate up to sufficiently high Lorentz factors, and that its maximal achievable Lorentz factor is largely limited to Γ Γ cr . This would pose a particularly severe problem for a stellar wind-like external medium (k = 2) for which typically Γ cr 10 2 (see Eq. [11]). Recent high-energy observations by the Fermi Large Area Telescope (LAT) have set a lower limit of Γ 10 3 for the emitting region in a number of GRBs with a bright high-energy emission (Abdo et al. 2009a,b;Ackermann et al. 2010) using a simplified one-zone model. However, a more detailed and realistic treatment shows that the limit is lower by a factor of ∼ 3 (Granot et al. 2008;Ackermann et al. 2011;Hascoët et al. 2011), which would correspond to Γ 10 2.5 for the brightest Fermi LAT GRBs. Nevertheless, this might still pose a problem for a single highly magnetized shell in a stellar-wind environment.
Regime I implies a maximal Lorentz factor of the flow, Γ σ 0 ≪ Γ cr (where Γ cr is given in Eq. [11]). In regime II, a higher maximal Lorentz factor is possible for k < 2, and Γ peaks at Γ u where it exceeds Γ cr by a factor of ∼ (σ 0 /Γ cr ) (2−k)/(10−3k) > 1 (see Eq. [49]), while Γ CD can reach values as high as ∼ σ 0 at R R 1 (however, the material with such a Lorentz factor would carry only a small fraction of the total energy, ∼ (Γ cr /σ 0 ) (8−2k)/(2−k) ≪ 1 at R ∼ R 1 ). In regime III the typical Lorentz factor is close to that of the CD, Γ ∼ Γ CD , and for k < 2 they both peak at R 0 where they exceed Γ cr by a factor of ∼ Γ (2−k)/2 cr > 1, while Γ ∼ Γ cr (R/R cr ) (k−2)/4 at R 0 < R < R cr . All this could help increase Γ above Γ cr for k < 2. However, for a stellar wind-like (or steeper) external medium, k = 2 (or k < 2), we have Γ Γ cr , which makes it very difficult to satisfy the observational constraints on Γ from pair opacity (mentioned above), and to a lesser extent also those from the onset time of the afterglow emission (usually around a few hundred; Sari & Piran 1999;Molinari et al. 2007;Zou & Piran 2010;Gruber et al. 2011). The accompanying paper (Granot 2011) shows, however, that if instead of a single shell the flow is initially divided into multiple, well separated sub-shells, then it can reach Γ ≫ Γ cr and reasonably efficient internal shocks can naturally take place at such high Lorentz factors. This greatly helps to satisfy the observational constraints on Γ.