<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>An Efficient Method for Fitting Radiation-mediated Shocks to Gamma-Ray Burst Data: The Kompaneets RMS Approximation</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>01/01/2022</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10333935</idno>
					<idno type="doi">10.3847/1538-4357/ac332a</idno>
					<title level='j'>The Astrophysical Journal</title>
<idno>0004-637X</idno>
<biblScope unit="volume">925</biblScope>
<biblScope unit="issue">1</biblScope>					

					<author>Filip Samuelsson</author><author>Christoffer Lundman</author><author>Felix Ryde</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Abstract            Shocks that occur below a gamma-ray burst (GRB) jet photosphere are mediated by radiation. Such radiation-mediated shocks (RMSs) could be responsible for shaping the prompt GRB emission. Although well studied theoretically, RMS models have not yet been fitted to data owing to the computational cost of simulating RMSs from first principles. Here we bridge the gap between theory and observations by developing an approximate method capable of accurately reproducing radiation spectra from mildly relativistic (in the shock frame) or slower RMSs, called the Kompaneets RMS approximation (KRA). The approximation is based on the similarities between thermal Comptonization of radiation and the bulk Comptonization that occurs inside an RMS. We validate the method by comparing simulated KRA radiation spectra to first-principle radiation hydrodynamics simulations, finding excellent agreement both inside the RMS and in the RMS downstream. The KRA is then applied to a shock scenario inside a GRB jet, allowing for fast and efficient fitting to GRB data. We illustrate the capabilities of the developed method by performing a fit to a nonthermal spectrum in GRB 150314A. The fit allows us to uncover the physical properties of the RMS responsible for the prompt emission, such as the shock speed and the upstream plasma temperature.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">Introduction</head><p>The launching, propagation,and collimation of a highly supersonic jetunavoidably lead to immense shock formation inside the jet and its surroundings (see, e.g., <ref type="bibr">L&#243;pez-C&#225;mara et al. 2013</ref><ref type="bibr">, 2014;</ref><ref type="bibr">Gottlieb et al. 2019)</ref>. Shocks that occur deep inside gamma-ray burst (GRB) jets are mediated by radiation. Such radiation-mediated shocks (RMSs) fill the jet with hot, nonthermal radiation, which is advected toward the jet photosphere, where it is released.The released spectra will range from strongly nonthermal to thermal, depending on whether the radiation has had time to thermalize via scatterings before reaching the photosphere or not.</p><p>GRBs are observed to have strong spectral evolution, in terms of both peak energy <ref type="bibr">(Golenetskii et al. 1983)</ref> and shape (e.g., the width of the spectrum; <ref type="bibr">Wheaton et al. 1973</ref>). In around one-quarterof GRB pulses, the narrowest, timeresolved spectrum is consistent with a thermal spectrum, which strongly suggests that the whole pulse is of a photosphericorigin <ref type="bibr">(Yu et al. 2019;</ref><ref type="bibr">Acuner et al. 2020;</ref><ref type="bibr">Dereli-B&#233;gu&#233;et al. 2020;</ref><ref type="bibr">Li et al. 2021)</ref>. It is plausible, therefore,that the wider, nonthermalspectra in such pulses have undergone subphotospheric dissipation <ref type="bibr">(Rees &amp; M&#233;sz&#225;ros 2005;</ref><ref type="bibr">Ryde et al. 2011)</ref>. Even though RMSs are a natural cause of this dissipation,so far RMS models have not been fitted to the data. <ref type="foot">3</ref>The main reason for this is that RMSs are expensive to simulate from first principles. RMSs have previously been considered in one spatial dimension <ref type="bibr">(Levinson &amp; Bromberg 2008;</ref><ref type="bibr">Nakar &amp; Sari 2012;</ref><ref type="bibr">Beloborodov 2017;</ref><ref type="bibr">Ito et al. 2018;</ref><ref type="bibr">Lundman et al. 2018;</ref><ref type="bibr">Lundman &amp; Beloborodov 2019;</ref><ref type="bibr">Ito et al. 2020;</ref><ref type="bibr">Levinson &amp; Nakar 2020;</ref><ref type="bibr">Levinson 2020;</ref><ref type="bibr">Lundman &amp; Beloborodov 2021</ref>).The 1D simulations illustrate the main features of the nonthermal RMS radiation expected inside GRB jets: a broad power-law spectrum for up to mildly relativistic shocks (that have relative relativistic speed between the up-and downstreams of&#946;&#947; &#61576; few,where &#946; is the speed in units of speed of light c and &#947; is the Lorentz factor), while faster shocks have more complex spectral shapes owing to Klein-Nishina effects,anisotropic radiation in the shock, and photon-photon pair production. Once advected into the downstream, the RMS spectrum gradually thermalizes through scatterings.</p><p>Currently, these 1D simulations are not fast enough to build a table model of simulated RMS spectra overthe relevant parameterspace,which is an efficient way to test models against data. However, model testing is of crucial importance to further develop our understanding of the prompt emission in GRBs. With this motivation, in this work we explore an alternative path to connecting RMS theory and GRB observations. In Section 2, we construct an approximate, but very fast, method called the Kompaneets RMS approximation (KRA). The approximation is based on the strong similarities between bulk Comptonization of radiation inside an RMS and thermal Comptonization of radiation on hot electrons,the latter being described by the Kompaneets equation. The KRA is appropriate to use for mildly relativistic (and slower), optically thick RMSs. We validate the KRA by comparing simulated radiation spectra to those produced by the full radiation hydrodynamics simulations,finding excellent agreement.The KRA is then applied to a minimal model of a shock inside a GRB jet in Section 3, which generatessynthetic photosphericspectra, accounting for both adiabatic cooling and thermalization of the photon distribution. The KRA simulations are about four orders of magnitude faster to run than the corresponding 1D simulations, allowing for table model construction.As an illustration of the model capabilities, we use the table model to perform a fit to the prompt emission of GRB 150314A in Section 4. We conclude by summarizing and discussing our results in Section 5.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">The Kompaneets RMS Approximation</head><p>In this section, we develop the KRA and compare the resulting spectra to full-scale, special relativistic RMS simulations in planar geometry. The approximation is valid for RMSs where the photonsinside the shock do not obtain energies exceeding the electron rest mass energy, as the transfer problem then becomes more complicated, including Klein-Nishina scattering effects,anisotropy, and &#947;&#947;-pair production. This typically corresponds to shocks that are mildly relativistic<ref type="foot">foot_1</ref> or slower, inside plasma where the downstream radiation pressure dominates over the magnetic pressure.</p><p>As is appropriate for RMSs inside GRB jets, the RMS is assumed to be photon rich <ref type="bibr">(Bromberg et al. 2011)</ref>, i.e., the photons inside the RMS are mainly supplied by advection of upstream photons, as opposed to photon production inside the RMS and in the immediate downstream. The RMS is also assumed to be in an optically thick region, which is appropriate deep below the photosphere. The approximation will therefore not hold for shocks that dissipate most of their energy close to the photosphere;such shocks require full radiation hydrodynamics simulations. <ref type="foot">5</ref> We note that <ref type="bibr">Blandford &amp; Payne (1981)</ref> showed that the shape of a photon spectrum traversing a photon-rich,nonrelativistic RMS can be obtained analytically. Although their analyticalcalculation is impressive, it ignores photon energy losses due to electron recoil. The photon spectrum, therefore, lacks a high-energy cutoff, which makes it accurate only for soft spectra where the bulk energy is not carried by the high-energy photons. Due to this limitation, their solution is not applicable here.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1.">Bulk Comptonization inside the RMS</head><p>The following treatment assumes a nonrelativistic shock, but comparison to full RMS simulations shows thatthe approximation is valid also for mildly relativistic shocks with &#947;&#946; &#61576; few (see also Section 2.4).</p><p>In the shock rest frame, the incoming speed of the upstream is greater than the outgoing speed of the downstream, leading to a speed gradient inside the shock. The photons that diffuse inside the RMS speed gradient directly tap the incoming kinetic energy by scattering on fast electrons. If the photon mean free path is &#955;, the velocity difference of the plasma over a scattering length is &#61576; &#955;(d&#946;/dx) = d&#946;/d&#964;, where x is the spatial coordinate and d&#964; = dx/&#955; measures the optical depth along the xcoordinate.Doppler-boosting the photon to the frame ofthe scatterer,performing a scattering,and averaging over the scattering angles, one finds a relative energy gain of</p><p>per scattering, e.g., a first-order Fermi process. Here the photon energy &#242; is given in units of electron rest mass,&#242; = h&#957;/m e c 2 , where h is Planck's constant and &#957; is the photon frequency. Equation ( <ref type="formula">1</ref>) is valid for a relative energy gain &#916;&#242;/&#242; &lt; 1, where &#916;&#242; is the energy gain in a scattering for a photon with initial energy &#242;. Note that d&#946;/d&#964; is a local quantity that changes continuously across the RMS transition region and vanishes in the far up-and downstreams, where the plasma velocity is constant(see Figure <ref type="figure">1</ref> for a schematic of the velocity profile across the shock). The d&#946;/d&#964; profile is self-consistently determined by the radiation feedback onto the plasma:the photons gain precisely the available kinetic energy such that the Rankine-Hugoniot shock jump conditions are satisfied. Since plasma is advected through the RMS, so are the photons that scatter inside the plasma. However,photons also diffuse within the flow, and a fraction of the photons will stay inside the RMS much longer than the advection time across the RMS, accumulating more scatterings and therefore more energy.As is always the case when both the probability of escaping the shock and the relative energy gain per scattering, &#916;&#242;/&#242;, are energy independent, a power-law spectrum develops. The power law extends up to energies where the energy gain per scattering is balanced by energy losses due to electron recoil, which occurs when &#916;&#242;/&#242; &#8776; &#242;.This gives a maximum photon energy inside the shock of</p><p>where the brackets on the right-hand side indicate a weighted average across the shock. The exact expression for&#225;D &#241; &#61682; &#61682; is difficult to determine from first principles. With &#61682;u and &#61682;d as the average photon energies in the up-and downstreams, respectively, and &#946; u &#947; u the four-velocity of the upstream evaluated in the shock rest frame, we empirically find in Appendix A that b g x</p><p>with &#958; = 55 is a good approximation across the relevant shock parameter space. Although Equation (3) contains the relativistic four-velocity,it is only valid while &#225;D</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2.">Modeling an RMS as Thermal Comptonization</head><p>The energy gain process described in Section 2.1 looks strikingly similar to thermalComptonization on hotelectrons (see, e.g., <ref type="bibr">Rybicki &amp; Lightman 1979)</ref>. Consider a hot cloud of nonrelativistic electrons at a constant temperature&#952; = kT/ m e c 2 = 1, where k is the Boltzmann constant and T is the temperature, with injection of low-energy photons (&#242; = &#952;) into the cloud and an escape probability that is energy independent. The low-energy photons will gain a relative energy per scattering of&#916;&#242;/&#242; &#8776; 4&#952;, and the energy gain continues until balanced by recoil losses at q &#187; D &#187; &#61682; &#61682; &#61682; 4 max . Such Comptonization is described by the Kompaneets equation, with a source term s for the photon injection and escape from the cloud</p><p>where t sc = &#955;/c is the Thompson scattering time and n is the photon occupation number.Stimulated scattering (&#8733;n 2 ) has been omitted in Equation ( <ref type="formula">4</ref>), as this effectis insignificantas long as the occupation number is small, n = 1, which is true for the nonthermal emission considered here. Motivated by the similarities between the two systems, our aim is to constructan approximate RMS model based on the Kompaneets equation. The plasma is splitinto three discrete zones: the upstream zone, the RMS zone, and the downstream zone. The time evolution of the radiation spectrum inside each zone is computed using the Kompaneets equation. Each zone has an effective electron temperature,and the zones are connected via source terms. A schematic of the KRA is shown in Figure <ref type="figure">1</ref>.</p><p>The upstream zone feeds thermal radiation into the RMS zone, which passesradiation onto the downstream zone. Dissipation occurs only inside the RMS zone. This is achieved by prescribing an effective electron temperature q &#187; D &#61682; &#61682; r 1 4 , found from Equation (3) as</p><p>The subscriptr here and henceforth denotes quantities in the RMS zone,and the subscripts u and d will be used to denote quantities in the upstream and downstream zones, respectively. Equation (5) assures that the maximum photon energy and the energy gain per scattering in the RMS zone mimic those of a real RMS. By matching how long photons stay in the shock such that the average downstream energies in the two systems become equal, the evolution of the photon distribution in the KRA will closely match that of a real shock. This is achieved by using appropriate source terms (see Section 2.3).</p><p>The up-and downstream zonesdo not dissipate energy. Therefore, the temperaturesinside these zones equal the radiation Compton temperature &#952; C , defined as the electron temperature with which there is no net energy transfer between the photon and electron populations. It is given by</p><p>where the integrals are taken overall photon energies.The upstream temperature of the radiation,<ref type="foot">foot_3</ref> &#952; u , is a free parameter of the model, but the downstream Compton temperature is not a free parameter, as it is determined by the upstream temperature and the amountof dissipation in the shock.The nonthermal radiation that streams from the RMS zone is accumulated in the downstream zone, where it gradually thermalizes<ref type="foot">foot_4</ref> via scatterings. The downstream zone contains all photons thatpassed through the RMS zone, and the degree of thermalization of the radiation inside the downstream zone increases with time.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3.">The KRA Source Terms</head><p>The three zones in the KRA are coupled by source terms. Denoting the source of photons that stream into the RMS by s in and the source that streams out of the RMS by s out , one gets</p><p>The probability for a photon to escape the RMS into the downstream is independentof the photon energy. Thus, s out = kn r , where k is a constant and n r is the occupation number inside the RMS zone. In this scenario,one can show (e.g., <ref type="bibr">Rybicki &amp; Lightman 1979</ref>) that the steady-state solution to the Kompaneets equation inside the RMS zone is a powerlaw distribution, n &#8733; &#242; -&#945; , with a q = &#61682; + ( ) k 3 2 9 4 r 1 2 . In analogy with <ref type="bibr">Rybicki &amp; Lightman (1979)</ref>, we identify the RMS zone y-parameter as y r = 4&#952; r /k. Therefore,</p><p>The RMS zone y-parameterdetermineshow much time photons spend inside the shock; therefore, it is a measure of the average photon energy gain inside the RMS. As such,y r sets the hardness of the nonthermal spectrum that is injected into the downstream.A value of y r = 1 corresponds to a flat &#957;F &#957; spectrum,with larger values of y r giving harder slopes.The value of y r in the KRA is chosen such that the average downstream photon energy obtained equals that of a real RMS. The full conversion between the parameters that specify the RMS and the corresponding KRA parametersis shown in Appendix A.</p><p>Requiring thatthe photon number inside the RMS zone is conserved, one finds from Equation ( <ref type="formula">8</ref>)</p><p>where the integrals are again taken over all photon energies.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.4.">Estimating the KRA Upper Speed Limit</head><p>The energy gain inside the RMS qualitatively changes when the relative energy gain per scattering, &#916;&#242;/&#242;, becomes comparable to unity. This is because the upper photon energy inside the shock is</p><p>, and the radiative transfer is different for such high-energy photons. In particular, Klein-Nishina effects modify the scattering cross section, and &#947;&#947;-pair production is triggered. Furthermore, shocks with such a high energy gain per scattering will have a narrow width (comparable to a few photon mean free paths), which makes the radiation anisotropic. The KRA is therefore limited to modeling shocks with &#916;&#242;/&#242; &#61576; 1. This corresponds to (see Equation ( <ref type="formula">3</ref></p><p>with &#958; &#8776; 55.</p><p>The ratio of average downstream to upstream photon energies can vary significantly but enters Equation ( <ref type="formula">12</ref>) only as a logarithmic factor. For a typical energy ratio of = &#61682; &#61682; 10 d u 2 , one gets an upper velocity limitof &#946; u &#947; u &#8776; 3.5. Thus, the KRA is expected to be applicable to shocks with &#946; u &#947; u &#61576; 3,with the exact value only marginally dependent on the shock parameters.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.5.">Quasi-thermal RMS Spectra</head><p>The radiation in the downstream of an RMS becomes quasithermal if the energy dissipation per photon is either very low or very high. In the former case the upstream photon distribution is largely unaltered,while in the latter case the photons gain so much energy that they pile up in a thermal Wien distribution around&#61682; max (i.e., saturated Comptonization). In both cases, the radiation relaxes to a near-thermal distribution after a few scatterings in the downstream, at which point the information from the shock is all but lost. When fitting to data, such shocks are almost indistinguishable from each other and from outflows where no dissipation occurred. As such, they are less interesting from an observational perspective.</p><p>Shocks with small photon-to-proton ratios, n &#947; /n p , where n &#947; and n p are the photon and proton number densities, respectively,tend to have more thermal-like spectra inside the RMS. This is because the average downstream photon energy&#61682;d is inversely proportional to the photon-to-proton ratio (i.e., more photons sharing the same shock kinetic energy), while the maximum photon energy &#61682; max is proportionalto the logarithm of &#61682;d (see Equation ( <ref type="formula">3</ref>)). Thus, as the photon number shrinks,&#61682;d increases faster than &#61682; max , until the spectrum appears quasi-thermal with &#61682; &#61682; 2 , one finds a critical photon-to-proton ratio of n &#947; /n p &#8776; 1.1 &#215; 10 4 . Shocks that have photon-to-proton ratios close to this value will result in quasi-thermal radiation spectra.Below, we illustrate this fact with a simulation that has n &#947; /n p &#8776; 4 &#215; 10 4 .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.6.">Comparing the Kompaneets RMS Approximation to Full RMS Simulations</head><p>In this subsection, we will compare the spectrum inside the RMS and downstream regions as computed by the two codes radshock and Komrad, the latter implementing the KRA. The radshock code is a special relativistic, Lagrangian radiation hydrodynamicscode <ref type="bibr">(Lundman et al. 2018)</ref>. The radiation field is computed using the Monte Carlo method, which self-consistently connectsto the hydrodynamicsvia energy and momentum source terms. The RMS is set up by smashing plasma into a wall boundary condition and allowing the code to relax into an RMS thatpropagates steadily away from the wall. For the case of a thermal upstream radiation spectrum, the RMS solution is fully specified by three parameters. These can be taken to be the temperature of the upstream radiation,&#952; u , the speed of the upstream plasma relative to the shock, &#946; u , and the photon-to-proton ratio, n &#947; /n p , inside the upstream <ref type="bibr">(Lundman et al. 2018)</ref>.</p><p>Komrad implements the KRA described in the previous subsections, evolving the radiation in the RMS zone and the downstream zone<ref type="foot">foot_6</ref> using Kompaneets solvers (e.g., <ref type="bibr">Chang &amp; Cooper1970)</ref>. We choose the following three parameters to describe the RMS in Komrad: the temperature of the upstream photons,&#952; u, K (where the subscript K indicates Komrad), the effective electron temperature inside the RMS zone, &#952; r , and the Compton y-parameter of the RMS zone, y r . As mentioned above, the conversion from the KRA parameters to the corresponding RMS parameters is given in Appendix A.A nontrivial point is that the two codes will have somewhat different upstream temperatures.This is because plasma compression inside the RMS will increase the internal energy density and shift the upstream spectral peak, and no analog to this compression exists for the KRA.</p><p>A simulation is fully specified by the three shock parameters and the total simulation time t/t sc . The simulation time affects the degree to which the downstream has been thermalized. To highlight the similarities between the downstream spectra, we do not include the radiation produced during the initial RMS formation. This is becausethe formation of the shock is different between the simulations.Therefore,the simulation time starts when the RMS is already in steady state.</p><p>The RMS transition region in radshock is continuous, and it is not obvious a priori what part should be compared to the RMS zone in Komrad. For the comparison,we chose the radiation in radshock that is located atthe point where the shock has just finished dissipating all incoming energy, as this represents the spectrum that is injected into the downstream. This location is determined as the point where the average photon energy has reached its downstream value. The plasma that has passed through thislocation after the start of the simulation time belongs to the downstream. At the end of the simulation, the radiation inside the downstream is collected and its spectrum computed.</p><p>Figures <ref type="figure">2</ref> and<ref type="figure">3</ref> show the results of six different shock simulations,labeled Runs A-F.The Komrad parameters for the six runs are shown in Table <ref type="table">1</ref>, and the radshock parameters are found in Table <ref type="table">2</ref>. The simulation parameters were chosen to test the KRA in different regions of the shock parameterspace, resulting in differently shaped radiation spectra inside the shock. The Komrad parameters for the six  <ref type="table">1</ref> and<ref type="table">2</ref>. runs are calculated from the corresponding radshock parameters using the method described in Appendix A. The only free parameter in the conversion is &#958; from Equation (3). All Komrad runs are made with &#958; = 55, as we empirically found that this value gave good agreement across the parameter space.</p><p>In Figure <ref type="figure">2</ref>, Runs A-E are shown in five differentpanels. The spectra produced by the two codes are remarkably similar, highlighting the close analogy between bulk and thermal Comptonization.We conclude that the KRA can accurately capture the RMS radiation physics.</p><p>In Figure <ref type="figure">3</ref>, we show the spectra for Run F, which is a mildly relativistic shock with upstream speed &#946; u &#947; u = 3 in the shock rest frame. The KRA neglects relativistic effects such as Klein-Nishina suppressionand pair production. Furthermore,as shown in, e.g., <ref type="bibr">Ito et al. (2018)</ref>, anisotropy starts to become important when the shock becomesrelativistic. However, Komrad can still capture the behaviorof mildly relativistic shocks,as long as the photon energies inside the RMS do not exceed the electron restmass, i.e., as long as &#61682; &#61682; 1 max as discussed in Section 2.4.</p><p>In this run, the relative energy gain per scattering is close to unity, and the shock is only a few Thomson optical depths wide in the radshock simulation. Hence, photons have a high probability of diffusing in and out of the different regions, and there are no sharp "zone boundaries" in radshock. Therefore, the comparison to a discrete RMS zone in Komrad is less accurate.Furthermore,Klein-Nishina suppression startsto become important. This can be seen in the high-energy tail of the photon distribution in the downstream.The high-energy photons in radshock have cooled less than those in Komrad, due to their lower scattering cross section. However, this effect will likely be unimportant when the KRA is fitted to actual data,as radiation with &#242; &#61576; 1 has time to downscatter to lower energies before reaching the photosphere, even with Klein-Nishina suppression. Furthermore, the high-energy part of the spectrum is often given little weight in the fitting process owing to the lower photon counts at high energies in the GBM energy channels <ref type="bibr">(Yu et al. 2019)</ref>. Overall the approximation is surprisingly accurate even in this case when &#946; u &#947; u = 3, especially in the downstream zone, which contains the radiation that will later be observed.This indicates thatany anisotropy of the radiation field within the shock does not have a major impact on the shape of the spectrum in this case. We conclude that the limit of the KRA is when &#187; &#61682; max q D &#187; &#61682; &#61682; 4 r starts to approach unity.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Applying the Kompaneets RMS Approximation to a GRB Jet</head><p>RMSs come with a variety of dynamical behaviors. Explosions,such as supernovae, generate an outward-going shock wave. The shock wave propagates through the star until it either breaks out of the stellar surface (i.e., the photosphere) or dissolves as the downstream pressure becomes too small, due to the limited explosion energy budget. A different dynamical behavior is seen in recollimation shocks, which arise as the jet propagates in a confining medium. Such shocks can be approximately stationary with respect to the star and might therefore never break out. However, the radiation that is advected through the recollimation shock is energized, and the emission released at the photosphere can be nonthermal. Yet another behavior is seen in shocks that arise owing to internal collisions of plasma inside the jet. When two plasma blobs collide, the plasma in between the blobs is compressed, increasing the pressure adiabatically until the pressure profile is steep enough to launch two shocks. The shocks propagate in opposite directions into the two colliding blobs while sharing a causally connected downstream region. Such shocks cease when they have dissipated most of the available kinetic energy in the two blobs. The time it takes the shocks to cross the blobs is roughly a dynamical time (as they cross the causally connected jet ejecta).</p><p>Dynamical effects on the shock structure are important if the shock reaches the jetphotosphere. For instance,part of the RMS can transform into a pair of collisionless shocks at the point of breakout when the photons mediating the shock start to leak out toward infinity <ref type="bibr">(Lundman &amp; Beloborodov 2021</ref>). The KRA is not able to handle such dynamical effects. On the other hand, the KRA is well suited for simulating plasma thatis u &#947; u = 3 (Run F). The RMS width is only a few optical depths wide, and photons can easily diffuse in and out of the shock. Thus, the comparison to a discrete, welldefined zone in Komrad becomes less accurate. In the downstream,Klein-Nishina effects suppress the cooling of the highest-energy photons. Parameter values for the run are given in Tables <ref type="table">1</ref> and<ref type="table">2</ref>. shocked while still being optically thick and then advected toward the jet photosphere, where the emission is later released.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1.">A Minimal Subphotospheric Shock Model</head><p>One shock scenario that can be modeled by the KRA is the collision inside the jet of two blobs of similar mass and density but differentspeeds. This is a minimal scenario with few free parameters. More complex models with additional parameters can be considered in the future, if the current model fails to fit prompt GRB data. In Appendix B we compute the speed of the two shocks,the energy dissipated, and the radius at which the shocks have finished dissipating most of the available energy. For blobs of similar properties (i.e., similar mass and density), we show thatalso the properties of the shocks are similar. In that case,only one of the two shocks has to be explicitly simulated,and the numberof model parameters is kept at a minimum.</p><p>The KRA is valid for shocks where &#916;&#242;/&#242; &#61576; 1, as discussed in Section 2.4. In Appendix B we translate this limit to jet quantities in the context of internal shocks. It corresponds to a Lorentz factor ratio of &#915; 2 /&#915; 1 &#61576; 30, where &#915; 2 and &#915; 1 are the lab frame Lorentz factors of the fast and slow blobs, respectively. As an example, &#915; 1 = 50 and &#915; 2 = 1000 produce shocks that the KRA can accurately model.</p><p>A schematic illustration of the minimal shock model at four different stages of its evolution is shown in Figure <ref type="figure">4</ref>. In the first stage,the two blobs have recently collided. The RMS has started to propagate into the upstream, and a few photons have had time to diffuse into the downstream. In the second stage, the shock has almost crossed the upstream. The shock has finished crossing the upstream and dissolved in the third stage, with all photons accumulated in the downstream, and the fourth stage shows the radiation being released at the photosphere. Each of the three zones accountsfor thermalization of the photon spectrum via scatterings and adiabatic cooling.</p><p>The time over which shocks dissipate their energy is not a free parameter; it should be found self-consistently from, e.g., hydrodynamical simulations. However, the shock crossing time is always comparable to the dynamical timescale of the jet, which corresponds to a doubling of the jet radius.Therefore, we let the KRA dissipate energy overa doubling of the jet radius in our shock model. This also corresponds to a halving of the optical depth as we consider the case of a conical outflow. After the shock stops dissipating,the downstream plasma containing the shocked radiation is advected toward the photosphere, while it gradually thermalizes through scatterings and cools adiabatically. The simulation ends when the shocked radiation reaches the photosphere.</p><p>As mentioned above,we omit photon production by the plasma (i.e., the shock is photon rich). This is a valid assumption, as the advected flux of upstream photons already existing inside the GRB jet is much larger than the number of photons produced by bremsstrahlung ordouble Compton scattering (e.g., <ref type="bibr">Bromberg etal. 2011;</ref><ref type="bibr">Lundman &amp; Beloborodov 2019)</ref>. Photon production will occur in the downstream, but the timescale for such production is long; the photon spectrum thermalizes into a Wien spectrum via scatterings long before photon production acts to modify the Wien spectrum into a Planck spectrum. As shown by <ref type="bibr">Levinson (2012)</ref>,photon production has time to modify the spectrum if the shock occurred at optical depths of &#8764; 10 5 . In that case, the radiation will have lost essentially allits energy to adiabatic expansion before reaching the photosphere and is therefore of little interest.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2.">KRA Implementation in Spherical Geometry</head><p>A conical jet appears locally as spherically symmetric. The Kompaneets equation inside a steady-state, spherical relativistic outflow (with outflow bulk velocity &#946; &#8594; 1) is given by Equation (3) of <ref type="bibr">Vurm &amp; Beloborodov (2016)</ref>. With the assumptions of a constant bulk Lorentz factor &#915;, no induced scattering (n = 1),and no emission or absorption of photons, the Kompaneets equation can be written as where = r r R ph is a normalized radius and R ph is the radius of the photosphere. The normalized radius equals t = r 1 , where &#964; = &#963; T n e r/&#915; is the optical depth of the jet (not to be confused with the optical depth of the RMS), with &#963; T being the Thomson cross section and n e the electron number density. The comoving time coordinate in the Kompaneetsequation has here been rewritten into a lab frame radial coordinate (using t = r/&#915;c).</p><p>The last term in the curly brackets of Equation ( <ref type="formula">15</ref>) accounts for adiabatic cooling of the spectrum.<ref type="foot">foot_7</ref> In the optically thick regime, this causes the average energy of the photon distribution to decrease as - r 2 3 , while the shape of the spectrum is preserved.When the photons start to decouple close to the photosphere (&#964; &#61576; 1), the evolution changes and the idealized cooling of - r 2 3 is no longer valid (Pe'er 2008; Beloborodov 2011). To accountfor this, we numerically stop the cooling at an optical depth of &#964; = 3. The total adiabatic cooling of the photon distribution is then similar to that of a At some opticaldepth &#964; i (small r), the shock is initiated.Photons start to diffuse through the shock region and gain energy. The photons that pass through the RMS are collected in the downstream region, which gains more and more photons (stages 1 and 2). When the RMS has crossed the upstream,it dissolves,leaving only the downstream (stage 3). The photons in the downstream continue to scatter until they are released at the photosphere (stage 4).</p><p>real spectrum where the proper radiation transfer is taken into account (see <ref type="bibr">Beloborodov 2011)</ref>.Scattering is incorporated until &#964; = 1.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3.">Lab frame Transformation of the Simulated Radiation Spectrum</head><p>The simulation outputs the comoving radiation spectrum at the jet photosphere. The simplestapproximate transformation to the lab frame involves multiplying all photon energies by a factor &#915; (the Doppler boost for a typical photon), where &#915; is the Lorentz factor of the downstream zone.Since &#915; does not explicitly enter the simulation, it is effectively a postprocessing parameter.</p><p>In reality, the radiation spectrum broadens somewhat as it decouples from the plasma at the jet photosphere <ref type="bibr">(Pe'er 2008;</ref><ref type="bibr">Beloborodov 2010;</ref><ref type="bibr">Lundman et al. 2013)</ref>. This is because individual photons decouple at different angles to the line of sight, which affects their Doppler boosts, and also at different radii, which affects their energy losses due to adiabatic expansion.These effects are important to take into account when performing spectral fits to data, specifically to narrow bursts <ref type="bibr">(Ryde et al. 2017)</ref>. This spectralbroadening can be approximately computed in a post-processing step, under the assumption thatthe jet Lorentz factor &#915; is constantat the photosphere. The post-processing calculation is fairly long and will be described in full detail elsewhere.</p><p>The Kompaneetsequation without the induced scattering term is linear in the photon occupation number n. Therefore, the total photon number of the simulation is also a free parameter, which effectively makes the normalization ofthe GRB luminosity a post-processing parameter.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.4.">New Parameters Based on Parameter Degeneracy</head><p>In the case of planar geometry described in Section 2, the KRA has three parameters: &#952; u , &#952; r , and y r . In the case of a jet, the optical depth of the jet where the shock is initiated, &#964; i , is an additional parameter. Together, they determine the shape of the photosphericspectrum in the rest frame of the outflow. Additionally, as described in the subsection above, the bulk Lorentz factor &#915; and the luminosity L &#947; are two post-processing parameters that shift the observed spectrum in energy and flux.</p><p>However, there exists a degeneracy in the current parameter set.As long as the product &#964; i &#952; r , the ratio &#952; r /&#952; u , and y r remain unchanged, the spectral shape in the rest frame of the outflow is identical. With the translationalfreedoms given by &#915; and L &#947; , this becomesdegenerate. Therefore,a more suitable set of parametersis &#964;&#952; &#8801; &#964; i &#952; r , R &#8801; &#952; r /&#952; u , and y r . This brings the number of simulation parametersdown from four to three, which simplifies the process of table model building.</p><p>The degeneracy can be understood as follows. Imagine that &#964; i is increased by some factor f but &#952; r and &#952; u are decreased by the same amount. The evolution of the photon distribution with optical depth is slower, as the energy transfer per scattering is proportional to the electron temperature (when the photon gains energy in the scattering) or the photon energy (when the photon loses energy),both of which have decreased by a factorf. However,the numberof scatterings is ftimes larger,so the relative energy transfer is the same, i.e., the spectrum evolves similarly but is a factor f lower in energy. The net effect is that the evolution of the whole system is equivalent. The shape of the photospheric spectrum is identical, but shifted down in energy by a factor f 5/3 , where an additional factor f 2/3 comes from the increasedadiabatic cooling. The degeneracyin number of scatterings and energy gain per scattering is not unique to our model.Indeed,it is inherentto all jetted RMS models.</p><p>To see how each parameterinfluencesthe shape of the released photospheric spectrum, in Figure <ref type="figure">5</ref> we vary &#964;&#952; (top panel), R (middle panel), and y r (bottom panel), while keeping the other parameters constant. The value of the parameter being varied increases from black to red. As can be seen in the figure, the combined parameter &#964;&#952; determines the amount of thermalization after the shock has finished dissipating its energy.A higher &#964;&#952; implies a higher number of scatterings and/or higher energy transfer per scattering, leading to a faster thermalization.For large &#964;&#952; the downstream spectrum relaxes to a Wien spectrum, in which case the original shock parameters cannot be retrieved. The ratio R &#8801; &#952; r /&#952; u determines the separation between thelower and upper cutoff in the spectrum. A large R leads to a long power-law segment in the downstream.The slope of the power-law dependson the Compton y-parameter y r , which is a measure of how much energy is dissipated in the shock. Higher values of y r lead to harder spectra, with y r = 1 correspondingto a flat &#957;F &#957; spectrum.The spectralbroadening discussed in Section 3.3 has been omitted in Figure <ref type="figure">5</ref>, so that the effect of each parameter on the final spectrum is more clearly seen.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Fitting GRB Data with the Kompaneets RMS Approximation</head><p>As a proof of conceptof fitting an RMS model to prompt GRB emission data, we present an analysis of a time-resolved spectrum in GRB 150314A. This luminous burst was observed by the Fermi Gamma-ray Space Telescope and its Gamma-ray Burst Monitor (GBM), which covers the energy range of 8 keV-40 MeV. GRB 150314A is an example of a GRB pulse in which the spectrum becomes very narrow during a portion of its duration <ref type="bibr">(Yu et al. 2019)</ref>. The low-energy photon index, &#945;, of the Band function <ref type="bibr">(Band et al. 1993</ref>) reachesa very large value, a = -0.27 max . Such a large &#945;-value strongly suggestsa photospheric origin of the emission during the analyzed time bin <ref type="bibr">(Acuner et al. 2020)</ref>. It is further natural to assume that the same emission mechanism operates throughout a coherent pulse structure such as the one in GRB 150314A <ref type="bibr">(Yu et al. 2019)</ref>. Therefore, the whole pulse can be argued to be photospheric, even though mostof the other time bins have nonthermal spectra (&#945; &#8764; -1). As described in the introduction, these nonthermal spectramust then have been formed by subphotospheric dissipation <ref type="bibr">(Rees &amp; M&#233;sz&#225;ros 2005;</ref><ref type="bibr">Ryde et al. 2011)</ref> with RMSs as the most probable source of dissipation (e.g., <ref type="bibr">Levinson &amp; Bromberg 2008;</ref><ref type="bibr">Lundman &amp; Beloborodov 2019)</ref>.</p><p>In order to perform fast and efficient fits with the RMS model, we generate synthetic photospheric spectra over a large parameterspaceusing Komrad within the minimal shock model as explained above. With the photospheric spectra, we construct a table model in the Multi-Mission Maximum Likelihood Framework (3ML; <ref type="bibr">Vianello et al. 2015)</ref>.Here,we include the broadening effect described in Section 3.3 by postprocessing of the spectra. Our initial table modelconsists of 125 spectra.</p><p>Figure <ref type="figure">6</ref> shows a fit to one of the nonthermal spectra in GRB 150314A with our RMS model. The data are from a narrow time bin at around 4.6 s after the trigger. The fit indicates that there are two spectral breaks present, one at around 30 keV and the other at around 400 keV.The high-energy break corresponds to the energy the high-energy photons,those that reached the maximum energy q &#61682; 4 r max in the RMS, have downscattered to before decoupling. Conversely, the lowenergy break depends on how much the low-energy photons, those that entered the downstream with energy &#61503;&#61682;u, are heated by scatterings before they reach the photosphere (see also Section 5.1). A corresponding fit with the Band function yields &#945; = -0.73 &#177; 0.06 and a high-energy index &#946; = -2.47 &#177; 0.25, which are typical values for nonthermal spectra in GRBs (e.g., <ref type="bibr">Yu et al. 2016)</ref>. Both the Band function and the RMS model have AIC = 1610 and can therefore equally well describe the data.The modelparameters of the best fit of the RMS model are &#964;&#952; = 11.3 &#177; 2.9,R = 290 &#177; 50,and y r = 1.72 &#177; 0.14. The initial separation between &#952; r and &#952; u was thus relatively large and the thermalization moderate, which allow for the broad, nonthermal shape of the spectrum. The slope of the power-law segmentat around 200 keV reveals that quite a lot of energy Figure <ref type="figure">5</ref>. Photospheric spectra generated by Komrad in the minimal shock model.In each panel,one of the three parameters &#964;&#952;, R, and y r is varied as indicated in the panels, while the other two parameters are kept constant. The constant parameter values are &#964;&#952; = 5, R = 100, and y r = 0.7. The value of the varying parameter increases from black to red, being evenly log-spaced from 1.5 to 50 for &#964;&#952;, from 10 to 10 3 for R, and from 0.5 to 3 for y r . Increasing &#964;&#952; increases the thermalization. The ratio R determines the separation between the lower and upper cutoff in the spectrum, and y r determines the slope of the power-law segment. All spectra have been normalized to unity in photon number (N &#957; = 1) at &#242; = 1.</p><p>Figure <ref type="figure">6</ref>. Time-resolved spectrum in GRB 150314A from a narrow time bin at around 4.6 s after the GBM trigger.Top panel:&#957;F &#957; spectrum of the best-fit RMS model.Two breaks are present at around 30 and 400 keV. The best-fit model is depicted by the black line, and the gray region is its statistical uncertainty. The data points are derived from the counts fit and correspond to three of the triggered GBM detectors. Note that the nonlinearity of the GBM response matrix meansthat the data points will not be accurate in a &#957;F &#957; spectrum; they are here shown only for visual purposes. Bottom panel: the bestfit model to the observed count data, including the residuals,which show random variation, indicating a good fit.</p><p>has been dissipated in the shock, causing a large value of y r . Assuming a Lorentz factor of &#915; = 300, the parameters can be decoupled.<ref type="foot">foot_8</ref> This gives &#952; r = 0.055 and &#964; i = 206. Translating this into the physical RMS parametersyields the upstream 4-velocity as &#946; u &#947; u = 1.89, an upstream temperature of &#952; u = 8.81 &#215; 10 -5 , and a photon-to-proton ratio of n &#947; /n p = 2.01 &#215; 10 5 . This fit thus illustrates that our model can be used to study the flow properties and the shock physics in observed GRBs.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.">Discussion and Conclusion</head><p>Dissipation in the optically thick regions of a GRB jethas the potential to generate a wide variety of released photospheric spectralshapes; therefore,it is a promising candidate for the prompt emission.Although RMSs are a natural dissipation mechanism, so far no such model has been fitted to data. In this paper,we have for the first time performed a fit to a timeresolved spectrum of the prompt emission in a GRB using an RMS model. This allowed us to determine the physical properties of the initial shock, such as its speed and the upstream photon temperature.</p><p>The main reason for the previous lack of fitted prompt spectra within an RMS framework is that RMSs are computationally expensive to simulate from firstprinciples. To overcome this obstacle,we developed an approximate model (KRA; see Figure <ref type="figure">1</ref> for a schematic) based on the similarities between the bulk Comptonization of photons crossing an RMS and thermal Comptonization of photons on hot electrons. By comparing the simulated spectra from Komrad, a code employing the KRA,to those generated by a special relativistic radiation hydrodynamics code, we verified that the KRA can indeed accurately reproduce the RMS and downstream spectrafrom the full simulations in a wide parameter range (see Figures <ref type="figure">2</ref> and<ref type="figure">3</ref>).</p><p>We connected the KRA to GRB prompt observations by creating a minimal shock model considering a single RMS occurring well below the photosphere. The downstream of the shock is allowed to thermalize and cool adiabatically asit advects to the photosphere, where its radiation is released (see Figure <ref type="figure">4</ref> for a schematic).The model has only three free parameters determining the shape of the released spectrum: the combined parameter&#964;&#952;, which determines the amount of thermalization;R, which determines the extent of the powerlaw segment;and y r , which determines the hardness of the power law (see Figure <ref type="figure">5</ref>). Additionally, there are two postprocessing parameters for the normalization and the frequency shift. We generated 125 spectra using the model and, after accounting for broadening of the observed spectrum due to high-latitude effects and a radially varying photosphere, performed a fit to a broad spectrum in a narrow time bin of GRB 150314A as a proof of concept (see Figure <ref type="figure">6</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1.">Qualitative Spectral Features</head><p>Within the minimal shock modeldeveloped in this paper, there are some clear observational predictions. The spectra will consist of smooth low-and high-energy cutoffs, with a powerlaw segment in between. The low-energy cutoff is very smooth owing to the broadening effects discussed in Section 3.3, while there is an exponential cutoff at the highest energies. Typically, a single-break function is used to fit the spectral GRB data, e.g., the Band function, with its peak at E p . Depending on the hardness of the power-law segment, E p can correspond to either the low-energy cutoff (when y r &lt; 1) or the high-energy cutoff (when y r &gt; 1). Breaks both above and below the peak energy have been detected. Additional breaks atlow energies (&lt;10 keV) were reported in,e.g., <ref type="bibr">Strohmayeret al. (1998)</ref>, while additional high-energy breaksare discussed in, e.g., <ref type="bibr">Barat et al. (1998)</ref>. Within our model, bursts that have an additional low-energy break should be well fitted with an exponentialcutoff above E p or very soft values of the highenergy power-law index &#946; in the Band function. Conversely, bursts that have reported high-energy breaks above E p should produce hard, low-energy slopes, as long as the smooth curvature is within the detectorenergy range.However, we note that many of our generated spectra will appear as a single smooth curvature over a large range of energies (see, e.g.,the best fit in Figure <ref type="figure">6</ref>), due to the effects of thermalization on the downstream spectrum, as well as the broadening effectsof high-latitude emission and radially varying emission.</p><p>As it propagates toward the jet photosphere, the downstream spectrum will tend toward a Wien spectrum at the Compton temperature. The more thermalized the downstream spectrum becomes, the more difficult it will be to retrieve the original shock parameters. Once the spectrum has relaxed into a Wien spectrum,the shock information is lost. This is an inherit degeneracy in photospheric models that is important to keep in mind when drawing conclusions about the physics from the parameter estimation.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2.">Optical Emission</head><p>Although the curvature of the spectrum is very smooth, and although it may be outside the observable energy range of the prompt detectors, the Rayleigh-Jeans limit always exists in our spectra at low energies.Therefore,our minimal model with a single shock cannot account for low-energy observations such as opticalduring the promptphase.Thus, we must conclude that any early opticalemission is partof the afterglow.Early optical observations are rare, and very few are within &#8764; 100 s after trigger (see <ref type="bibr">Oganesyan et al. 2021</ref> for a recent example). Optical detections are commonly reported as prompt as long as they are observed within the T 90 of the GRB<ref type="foot">foot_9</ref>  <ref type="bibr">(Yost et al. 2007;</ref><ref type="bibr">Klotz et al. 2009)</ref>. This definition disregards whether the GRB had a quiescentperiod within the active phase ornot. Given that most optical observationsoccur quite late, they could be the onset of the afterglow. This highlights the need for early opticalobservations in GRBs, which have the power to discriminate between the current models of the prompt emission (see also <ref type="bibr">Oganesyan et al. 2019)</ref>. Early optical observations also have the potential to discern whether GRBs are significantcontributors to the observed ultra-high-energy cosmic ray flux, as discussed in <ref type="bibr">Samuelsson et al. (2019</ref><ref type="bibr">Samuelsson et al. ( , 2020))</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.3.">Recollimation and Multiple Shocks</head><p>Recollimation shocks below the photosphereand their connection to the prompt emission in GRBs have been investigated by severalauthors (e.g., <ref type="bibr">Gottlieb et al. 2019)</ref>.</p><p>Although not discussed in this paper, we expect the KRA to be able to model recollimation shocks as well. Such shocks have different dynamics, but bulk Comptonization is still responsible for the energy dissipation, leading to the same spectral features, that is, a power-law segment with a cutoff at high energies and a Rayleigh-Jeansslope at low energies. Indeed, oblique shocks,such as recollimation shocks, can be transformed into parallel shocks with a suitable Lorentz transformation <ref type="bibr">(Henriksen &amp; Westbury 1988)</ref>. Therefore, a recollimation shock could plausibly be responsible for the subphotospheric dissipation in a GRB whose spectra can be wellfitted with the KRA.</p><p>The minimal shock model considered here consists of a single RMS, dissipating energy overa dynamical time. It is easy to imagine a more complex jet structure with multiple shocks and turbulence. However, although the dynamics below the photosphere are complicated, it is not inconceivable that the shape of a time-resolved spectrum is dominated by a single, strong dissipation event. The good fit to the emission in GRB 150314A shows that the current minimal shock model can plausibly explain the data. Additional model complexity should be considered only if the current model is found inadequate to explain the observations. Further investigation will tell whether the current minimal model is sufficient when applied to a larger sample of GRBs. plot of the RMS spectrum from radshock: by comparing the power-law slope to the spectra in the bottom panel of Figure <ref type="figure">5</ref>, the value of y r can be estimated. Appendix B When Can the KRA Model Internal Shocks? Consider a part of the jet that consists mainly of two masses: a slower and a faster mass with lab frame Lorentz factors &#915; 1 ? 1 and &#915; 2 ? &#915; 1 , respectively. The masses are assumed to be initially separated by a lab frame distance &#948;r &#61576; &#948;l 1 , &#948;l 2 , where &#948;l 1 and &#948;l 2 are the corresponding initial lab frame widths of the slower and fastermass,respectively.The faster mass catches up to the slower mass at radius d &#187; G R r 2 i 1 2 . By then, the plasma between the masses has been highly compressed, increasing its pressureadiabatically until a forward and a reverse shock forms. The forward and reverse shocks propagate into the slower and faster masses, respectively.The speed of the shocked region (i.e., the shared downstream,which is bounded by the forward and reverse shocks) is found by balancing the momentum flux in the rest frame of the shocked region, &#946; 2 &#915; 2 h + p, from both sides. Here h &#8801; &#961;c 2 + e + p is the specific enthalpy,where &#961; is the mass density and p is the pressure, all of which are measured in the respective rest frame of the unshocked masses. If we suppose that the initial pressure inside the two masses is small (such that h &#8776; &#961;c 2 ), then we can solve for the lab frame Lorentz factor &#915; of the shocked material as</p><p>where &#961; 1 and &#961; 2 are the proper densities of the respective mass, before being shocked. In a wide range of density ratios,</p><p>2 holds and the above expression can be simplified to</p><p>The condition</p><p>2 also ensures that &#915; 2 ? &#915; ? &#915; 1 . The radii where the two shocks have crossed their respectivemassesare then R 2 &#8776; 2&#915; 2 &#948;l 2 and d &#187; G R l 2 1 1 2 1 , respectively.The massesare related to their widths and densities by &#948;m &#8776; 4&#960;r 2 &#915;&#961;&#948;l, and so the ratio of the radii where the reverse and forward shocks have crossed the respective masses can be written as The relative Lorentz factors between the upstream (moving with Lorentz factor &#915; 1 and &#915; 2 for the forward and reverse shocks,respectively)and the downstream (Lorentz factor &#915;) give a measure of how relativistic the two shocks are. They can be computed using Equation (B2),</p><p>and their ratio is r r</p><p>The energy dissipated for each mass (in the rest frame of the shocked plasma) is d &#187; -G ( &#175;) E mc 1 2 , whereG &#175;is the relative Lorentz factor between the up-and downstream, so that r r</p><p>Based on the analysis above, we see that the collision of two masses with similar properties, &#948;m 1 &#8764; &#948;m 2 and &#961; 1 &#8764; &#961; 2 , results in shocks of similar strengths, ~ G G &#175;1</p><p>2 . The shocks also dissipate roughly the same amount of energy,E 1 &#8764; E 2 , and finish dissipating roughly at the same time, R 1 &#8764; R 2 . The heated radiation is located in the shared downstream between the two shocks. Since the shocks have similar strengths and the heated radiation from both shocks sits inside plasma that propagates with the same Lorentz factor (here called simply &#915;), modeling of only one shock is necessary.</p><p>The KRA can accurately model shocks as long as the relative energy gain per scattering is less than unity, &#916;&#242;/&#242; &#61576; 1.In Appendix A we found that As an example, two masses of similar properties that propagate with initial Lorenz factors of &#915; 1 &#8776; 50 and &#915; 2 &#8776; 1000 would give rise to two RMSs with &#916;&#242;/&#242; &lt; 1,which can be modeled by the KRA.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>ORCID iDs</head><p>Filip Samuelsson <ref type="url">https://orcid.org/0000-0001-7414-5884</ref> Christoffer Lundman <ref type="url">https://orcid.org/0000-0002-</ref>0642-1055 Felix Ryde <ref type="url">https://orcid.org/0000-0002-9769-8016</ref> </p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_0"><p>We note that<ref type="bibr">Ahlgren et al. (2015)</ref> and<ref type="bibr">Vianello et al. (2018)</ref> fit photospheric models including dissipation to the data. However, their assumed energy dissipation mechanism was different.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_1"><p>We illustrate this point later with a shock simulation that has an upstream four-velocity of &#946;&#947; = 3.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="5" xml:id="foot_2"><p><ref type="bibr">Lundman &amp; Beloborodov (2021)</ref> show the evolution of a mildly relativistic RMS that reaches the edge of neutron star merger ejecta. The shock evolution is complex:the radiation begins leaking ahead of the shock, while a forward collisionless shock and a reverse collisionless shock are formed at the photosphere.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="6" xml:id="foot_3"><p>We use a Wien distribution for the upstream radiation, which is a Planck spectrum with nonzero chemical potential.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="7" xml:id="foot_4"><p>That is, high-energy photons preferentially lose energy as they scatter, while low-energy photons gain energy. The net effect is to gradually thermalize the photon distribution, while keeping the average photon energy constant.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_5"><p>The Astrophysical Journal, 925:65 (13pp),2022 January 20Samuelsson, Lundman,&amp; Ryde   </p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="8" xml:id="foot_6"><p>The upstream zone has no need for a Kompaneets solver, as the radiation is assumed to be thermal and the shape of the spectrum is known analytically.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="9" xml:id="foot_7"><p>The Kompaneets solver method described in<ref type="bibr">Chang &amp; Cooper (1970)</ref> with a small grid size is not directly applicable here anymore, since no stationary solution to the Kompaneets equation exists when adiabatic cooling is included. However, increasing the energy grid size assures that convergence is obtained.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="10" xml:id="foot_8"><p>The details of how &#915; is related to the fitted parameters will be described in an upcoming paper,which focuses on GRB data analysis using the KRA model.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="11" xml:id="foot_9"><p>The T 90 is defined as the time during which 90% of the total fluence was detected, from 5% to 95%.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="12" xml:id="foot_10"><p>Integration of the RMS zone instead of the downstream zone assures that there is no contamination from the shock formation history.The equations given here are valid for an RMS in steady state, and &#61682;d describes the average downstream energy from once the shock is in steady state. As the average downstream energy remains constant in planar geometry, the average photon energy in the steady-state RMS spectrum equals &#61682;d.</p></note>
		</body>
		</text>
</TEI>
