**2. Dynamics of Two-Shell Collision**

In the popular internal shock model, an ultrarelativistic fireball consisting of a series of shells with different Lorentz factors can produce prompt emission through collisions among these shells. For the dynamics of two-shell collision, we adopt the same approach as the one in [36]. In order to present one GRB prompt emission component (with duration ∼ few seconds), we here consider two thick shell–shell collision to produce a consistent GRB pulse with a duration of few seconds (i.e., the slow pulse) and the fast pulses with a duration of ∼0.01 s in GRBs may be caused by the density fluctuation of the shell. Under this assumption, a prior slow thick shell A with bulk lorentz factor *γ<sup>A</sup>* and kinetic luminosity *Lk*,*A*, and a posterior fast thick shell B with bulk lorentz factor *γ<sup>B</sup>* (where *γ<sup>B</sup>* > *γ<sup>A</sup>* 1) and kinetic luminosity *Lk*,*<sup>B</sup>* is adopted. The collision of the two shells begins at radius [36]

$$R\_{col} = \beta\_B c \frac{\beta\_A \Delta t\_{int}}{\left(\beta\_B - \beta\_A\right)} \simeq \frac{2\gamma\_A^2 c \Delta t\_{int}}{1 - \left(\gamma\_A / \gamma\_B\right)^2}$$

$$\equiv 2\gamma\_A^2 c \delta t \simeq 5.4 \times 10^{14} \gamma\_{A,2.5}^2 \delta t\_{-1} \text{ cm},\tag{1}$$

where ∆*tint* is the time interval between the two thick shells, and *δt* ≡ ∆*tint*/[1 − (*γA*/*γB*) 2 ] is a redefined time interval. For *γ<sup>A</sup> γB*, *δt* ' ∆*tint*. The conventional expression *Q*,*<sup>m</sup>* = *Q*/10*<sup>m</sup>* is used. During the collision, there are four regions separated by internal forward-reverse shocks: (1) the unshocked shell A; (2) the shocked shell A; (3) the shocked shell B; and (4) the unshocked shell B, where regions 2 and 3 are separated by a contact discontinuity.

The particle number density of a shell measured in its comoving frame can be calculated as [37]:

$$m'\_i = \frac{L\_{k,i}}{4\pi R^2 \gamma\_i^2 m\_p c^3} \tag{2}$$

where *R* is the radius of the shell and subscript *i* can be taken as A or B. As in the literature [36–40], we derive the dynamics of internal forward-reverse shocks. In order to get a high prompt emission luminosity, it is reasonable to assume *γ<sup>A</sup> γ<sup>B</sup>* and *Lk*,*<sup>A</sup>* = *Lk*,*<sup>B</sup>* ≡ *L<sup>k</sup>* . Assuming that *γ*1, *γ*2, *γ*3, and *γ*<sup>4</sup> are Lorentz factors of re-

gions 1, 2, 3 and 4 respectively, we have *γ*<sup>1</sup> = *γA*, *γ*<sup>4</sup> = *γB*, and *n* 0 <sup>1</sup> *n* 0 4 . If a fast shell with low particle number density catches up with a slow shell with high particle number density and then they collide with each other, a Newtonian forward shock (NFS) and a relativistic reverse shock (RRS) may be generated [36,37]. So we can obtain *γ*<sup>1</sup> ' *γ*<sup>2</sup> = *γ*<sup>3</sup> = *γ γ*4. Then, according to the jump conditions between the two sides of a shock [41], the comoving internal energy densities of the two shocked regions can be calculated following *e* 0 <sup>2</sup> = (*γ*<sup>21</sup> − 1)(4*γ*<sup>21</sup> + 3)*n* 0 <sup>1</sup>*mpc* <sup>2</sup> and *e* 0 <sup>3</sup> = (*γ*<sup>34</sup> − 1)(4*γ*<sup>34</sup> + 3)*n* 0 <sup>4</sup>*mpc* 2 , where *γ*<sup>21</sup> = <sup>1</sup> 2 (*γ*1/*γ*<sup>2</sup> + *γ*2/*γ*1) and *γ*<sup>34</sup> = <sup>1</sup> 2 (*γ*3/*γ*<sup>4</sup> + *γ*4/*γ*3) are the Lorentz factors of region 2 relative to the unshocked region 1, and region 3 relative to region 4, respectively. It is required that *e* 0 <sup>2</sup> = *e* 0 3 because of the mechanical equilibrium. We have [36,37]

$$\frac{(\gamma\_{21}-1)(4\gamma\_{21}+3)}{(\gamma\_{34}-1)(4\gamma\_{34}+3)} = \frac{n\_4'}{n\_1'} = \left(\frac{\gamma\_1}{\gamma\_4}\right)^2 \equiv f. \tag{3}$$

Two relative Lorentz factors can be calculated as *γ*<sup>21</sup> ≈ *f γ* 2 4 7*γ* 2 1 + 1 = <sup>8</sup> 7 , and *γ*<sup>34</sup> = *γ*4 <sup>2</sup>*γ*<sup>1</sup> 1. Assuming that *t* is the observed shell–shell interaction time since the prompt flare onset, the radius of the system during the collision can be written as

$$R = R\_{col} + 2\gamma^2 ct \simeq 2\gamma\_1^2 c(t + \delta t). \tag{4}$$

During the propagation of the shocks and before the shock crossing time, the instantaneous electron injection numbers (in *dt*) in regions 2 and 3 can be calculated as follows [38]:

$$dN\_{\varepsilon,2} = 8\pi R^2 n\_1'(\gamma\_{21}\beta\_{21}/\gamma\beta)\gamma^2 cdt\tag{5}$$

and

$$dN\_{\varepsilon,3} = 8\pi R^2 n\_4' (\gamma\_{34}\beta\_{34}/\gamma\beta)\gamma^2 cdt,\tag{6}$$

respectively.
