1 Introduction

The most common matter-energy distribution for modeling the internal structure of compact stars is an isotropic perfect fluid. Nevertheless, there are strong arguments suggesting that nuclear matter at very high densities and pressures could naturally be described by an anisotropic fluid, that is, when the radial and tangential components of the pressure are not equal. As a matter of fact, the anisotropy could be generated by the presence of strong magnetic fields [1,2,3,4], solid cores [5, 6], superfluidity [7, 8], pion condensed phase configurations in neutron stars [9, 10], etc. Furthermore, it is possible to obtain an anisotropic perfect fluid by combining the energy-momentum tensors of two isotropic perfect fluids [11,12,13].

As widely reported in the literature [14,15,16,17,18,19,20,21,22,23,24,25], the presence of anisotropy affects a number of important physical properties of compact stars such as the mass-radius relation, compactness, surface redshift, moment of inertia as well as the scalarization in scalar-tensor theories [26]. Indeed, the equation of state (EoS) plays a fundamental role in determining the internal structure of such stars and, consequently, in imposing stability limits. Therefore, it is important to carry out a stability analysis of anisotropic neutron stars taking into account the LIGO-Virgo constraints on the EoS for nuclear matter as a result of observation of the event GW170817 – the first direct detection of gravitational waves from the coalescence of a neutron star binary system [27, 28]. In that respect, we are interested in considering a realistic EoS, which is compatible with the restriction obtained from this merger, and exploring the effects it can have on the physical characteristics of stable and unstable anisotropic stars.

It is a well known fact that the solutions of the Tolman–Oppenheimer–Volkov (TOV) equations describe stellar configurations in hydrostatic equilibrium. Nonetheless, such an equilibrium can be stable or unstable with respect to a compression or decompression caused by radial perturbations. Indeed, a conventional technique widely used to indicate the onset of instability is the \(M(\rho _c)\) method [17], also known as a necessary condition for stability analysis of compact stars [29, 30]. This boundary between the stable and unstable stars describes the maximum amount of mass that can exist in a configuration before it must undergo a gravitational collapse. On the other hand, a sufficient condition for stability is to calculate the frequencies of the normal radial modes of relativistic vibrations [29,30,31], where Einstein field equations have to be linearized around the equilibrium configuration. If any of these squared frequencies is positive we have stable radial oscillations, whereas negative squared frequencies imply increasing or decreasing perturbations with time, i.e. the star is unstable.

In general relativity (GR), the stability analysis for isotropic compact stars with respect to radial perturbations has been widely discussed in the literature [32,33,34,35,36,37,38,39,40,41,42,43,44,45,46], whereas within the context of anisotropic configurations the normal radial modes technique has been used only in some specific cases, see e.g., [17, 20, 47,48,49,50]. In particular, for anisotropic strange stars described by the MIT bag model EoS, it was shown that the \(M(\rho _c)\) method is not compatible with the calculation of frequencies to predict the onset of instability [20] for the anisotropy profile proposed by Bowers and Liang [14], this is, the maximum-mass stellar configurations do not correspond to the zero squared frequencies of the fundamental mode. Therefore, it is required to calculate the frequency of the oscillation modes in order to have absolute certainty about the radial stability of an anisotropic neutron star. But what could be the origin of the stellar oscillations? Just as the oscillations inside the Earth are excited by earthquakes and used in seismology to study the structure of the Earth, the fluid pulsations in neutron stars can be excited by cracks in the crust (a starquake) [51], as well as by tidal effects in binary inspirals [52, 53].

In the present paper, in addition to generating hydrostatically stable anisotropic configurations, we are also interested in studying the process of gravitational collapse of the unstable configurations. In this regard, the pioneering work about gravitational collapse for a spherically symmetric distribution of matter in the form of dust cloud was carried out by Oppenheimer and Snyder [54]. Such idealized treatment has been improved by introducing a pressure gradient [55] and by replacing the exterior Schwarzschild metric by the Vaidya one [56]. In this way, the relativistic equations for the adiabatic, spherically symmetric gravitational collapse as given in Ref. [55] were modified by Misner [57] in order to allow an extremely simplified heat-transfer process (where the internal energy is converted into an outward flux of neutrinos). Moreover, the equations that govern the gravitational collapse of a ball of charged perfect fluid were derived by Bekenstein [58].

Over the years, it has been possible to construct physically viable gravitational collapse scenarios for isotropic fluids that include dissipative fluxes such as heat flow [59,60,61,62,63,64] and shear and bulk viscosities [65]. In turn, gravitational collapse models have also been developed for anisotropic fluids with dissipative processes [66,67,68,69,70,71], in the presence of electromagnetic field [72,73,74,75,76] and with cosmological constant [77, 78]. Particularly the gravitational collapse of neutron stars considered as initial configurations has been investigated by the authors in [66, 70, 79, 80], however, they did not perform an a priori analysis on the stellar stability of the initial static Schwarzschild configurations against radial pulsations. A complete analysis on stability and gravitational collapse for isotropic fluids was conducted by Ghezzi [81] (where the charged neutron stars in the unstable branch collapse directly to form black holes), and more recently in Ref. [45] for neutron stars with realistic EoSs.

We construct families of anisotropic neutron stars based on an EoS compatible with the recent observations, and we obtain the oscillation spectrum for each family by means of radial perturbations. In addition, we investigate the dynamical evolution of unstable anisotropic stars whose final fate is the formation of a black hole as a consequence of a non-adiabatic gravitational collapse. The spherical surface of the collapsing star divides spacetime into two different four-dimensional manifolds; an interior region with heat flux – described by a shear-free line element – and an exterior region which is described by the Vaidya metric for pure outgoing radiation. The paper is organized as follows: In Sect. 2 we present the basic formalism to describe equilibrium configurations for four anisotropy ansatze and deal with the normal radial modes. In Sect. 3 we develop a gravitational collapse model by introducing a time dependency on the metric functions that allows us to recover the static case under a certain limit. In Sect. 4 we present a discussion of the numerical results. The paper ends with our conclusions in Sect. 5. We adopt the signature \((-, +, +, +)\) and physical units will be used throughout this work.

2 Basic equations for stellar structure

The line element describing the interior spacetime of a spherically symmetric star, is written in the well-known form

$$\begin{aligned} ds^2 = g_{\mu \nu }dx^\mu dx^\nu = -e^{2\psi }(dx^0)^2 + e^{2\lambda } dr^2 + r^2d\varOmega ^2, \end{aligned}$$
(1)

where \(x^\mu = (ct, r, \theta , \phi )\), and \(d\varOmega ^2 = d\theta ^2 + \sin ^2\theta d\phi ^2\) is the line element on the unit 2-sphere. The metric functions \(\psi \) and \(\lambda \), in principle, depend on \(x^0\) and r.

With regard to the matter-energy distribution, we assume that the system is composed of an anisotropic perfect fluid, where the components of the pressure are not equal to each other, namely [14, 18, 82]

$$\begin{aligned} T_{\mu \nu } = (\varepsilon + p_t) u_\mu u_\nu + p_t g_{\mu \nu } - \sigma k_\mu k_\nu , \end{aligned}$$
(2)

with \(u^\mu \) being the four-velocity of the fluid, \(\varepsilon = c^2\rho \) the energy density (where \(\rho \) denotes mass density), \(\sigma \equiv p_t - p_r\) the anisotropy factor, \(p_r\) the radial pressure, \(p_t\) the tangential pressure, and \(k^\mu \) is a unit spacelike four-vector. The four-vectors \(u^\mu \) and \(k^\mu \) must satisfy the following properties

$$\begin{aligned} u_\mu u^\mu = -1, \quad k_\mu k^\mu = 1, \quad u_\mu k^\mu = 0. \end{aligned}$$
(3)

Within the context of GR, the spacetime geometry and the matter-energy distribution are related by the Einstein field equations

$$\begin{aligned} G_{\mu \nu } \equiv R_{\mu \nu } - \frac{1}{2}R g_{\mu \nu } = \kappa T_{\mu \nu }, \end{aligned}$$
(4)

where \(\kappa \equiv 8\pi G/c^4\), \(G_{\mu \nu }\) is the Einstein tensor, \(R_{\mu \nu }\) the Ricci tensor, and R denotes the scalar curvature. Here G is the gravitational constant and c is the speed of light in physical units.

2.1 Background and TOV equations

In the case of hydrostatic equilibrium none of the metric and thermodynamic quantities depends on the time coordinate \(x^0\), which entails that \(k^\mu = (0, e^{-\lambda }, 0, 0)\) and hence the energy-momentum tensor contains only non-zero diagonal components \(T_{\mu }^{\ \nu } = \mathrm{diag}(-\varepsilon , p_r, p_t, p_t)\). Consequently, from Eqs. (1)–(4) together with the conservation law of energy and momentum, the relativistic structure of an anisotropic star in the state of hydrostatic equilibrium is governed by the TOV equations

$$\begin{aligned} \frac{dm}{dr}= & {} 4\pi r^2 \rho , \end{aligned}$$
(5)
$$\begin{aligned} \frac{dp_r}{dr}= & {} -\left[ \frac{p_r + c^2\rho }{c^2} \right] \left[ \frac{Gm}{r^2} + \frac{4\pi G}{c^2}rp_r \right] e^{2\lambda } + \frac{2}{r}\sigma , \end{aligned}$$
(6)
$$\begin{aligned} \frac{d\psi }{dr}= & {} -\frac{1}{p_r + c^2\rho }\frac{dp_r}{dr} + \frac{2 \sigma }{r(p_r + c^2\rho )}, \end{aligned}$$
(7)

where m(r) is the mass enclosed in the sphere of radius r. The metric function \(\lambda (r)\) is obtained by means of the relation

$$\begin{aligned} e^{-2\lambda } = 1 - \frac{2Gm}{c^2r} . \end{aligned}$$
(8)

As usual, we define the radius of the star when the radial pressure vanishes, i.e., the surface of the anisotropic star is reached when \(p_r(r = R) = 0\), and the total gravitational mass of the star is given by \(M \equiv m(R)\).

Given a barotropic EoS of the form \(p_r = p_r(\rho )\) and a defined anisotropy relation for \(\sigma \), Eqs. (5) and (6) can be integrated for a given central density and by guaranteeing regularity at the center of the star. Besides that, since the equilibrium system is a spherically symmetric star, the exterior spacetime of the anisotropic fluid must be described by the Schwarzschild metric so that the continuity of the metric on the surface imposes another boundary condition for the differential Eq. (7). Thus, the system of Eqs. (5)–(7) is solved under the requirement of the following boundary conditions

$$\begin{aligned} \rho (0) = \rho _c, \ \quad m(0) = 0, \ \quad \psi (R) = \frac{1}{2}\ln \left[ 1 - \frac{2GM}{c^2R} \right] . \end{aligned}$$
(9)

2.2 Stability criterion through adiabatic radial oscillations

In order to study the (in)stability of anisotropic neutron stars, it is necessary to calculate the frequencies of normal vibration modes. In fact, this involves an examination of radial perturbations in anisotropic fluid configurations. For such analysis we consider adiabatic vibrations, that is, we shall neglect the heat transfer between neighboring fluid elements.

Oscillation frequencies about the equilibrium state can be found by considering small deviations with respect to the state of hydrostatic equilibrium. In other words, the equilibrium configuration governed by the TOV Eqs. (5)–(7) is radially perturbed in such a way that its spherical symmetry is maintained. Such a perturbation will cause motions in the radial directions so that a fluid element located at radial coordinate r in the unperturbed configuration is displaced to radial coordinate \(r+ \xi (x^0,r)\) in the perturbed configuration, where \(\xi \) is the Lagrangian displacement. This involves solving the perturbed Einstein equations \(\delta G_{\mu \nu } = \kappa \delta T_{\mu \nu }\) for small radial oscillations from equilibrium. Therefore, in order to do a tractable analysis of the pulsations, all equations are linearized in the Eulerian perturbation functions \(\delta h\), where the quantity h represents any metric or fluid variable and is decomposed as \(h(x^0, r) = h_0(r) + \delta h(x^0, r)\). The quantities denoted by a subscript zero stand for the solutions in the equilibrium configuration.

It is important to note here that the relation between Eulerian and Lagrangian perturbations is given as follows

$$\begin{aligned} \varDelta h(x^0, r) \equiv h[x^0, r+ \xi (x^0, r)] - h_0(r) \cong \delta h + \frac{dh_0}{dr}\xi ,\nonumber \\ \end{aligned}$$
(10)

where \(\varDelta h\) is the Lagrangian perturbation, that is, the change measured by an observer who moves with the fluid.

If in the perturbed state we define \(v \equiv \partial r/\partial x^0 = \partial \xi /\partial x^0\), to first order in \(\xi \) the non-zero components of the energy-momentum tensor (2) take the form

$$\begin{aligned} T_{00}= & {} e^{2\psi }\varepsilon , \quad T_{0r} = T_{r0} = -(\varepsilon _0 + p_{r0})e^{2\lambda _0}v, \nonumber \\ T_{rr}= & {} e^{2\lambda }p_r, \quad T_{\theta \theta } = r^2p_t , \quad T_{\phi \phi } = r^2p_t\sin ^2\theta , \end{aligned}$$
(11)

where the four-velocity and the unit four-vector are given by \(u^\mu = (e^{-\psi }, ve^{-\psi _0}, 0, 0)\) and \(k^\mu = (ve^{\lambda -2\psi }, e^{-\lambda }, 0, 0)\), respectively. Afterward, by retaining the terms only of first order in \(\xi \) and \(\delta h\), the linearized field equations are

$$\begin{aligned} \delta \lambda= & {} -\xi \frac{d}{dr}(\psi _0 + \lambda _0) = -\frac{\kappa }{2}r(\varepsilon _0 + p_{r0})e^{2\lambda _0}\xi , \end{aligned}$$
(12)
$$\begin{aligned} \frac{\partial (\delta \psi )}{\partial r}= & {} \left[ \frac{\delta p_r}{\varepsilon _0 + p_{r0}} - \left( 2\frac{d\psi _0}{dr} + \frac{1}{r} \right) \xi \right] \nonumber \\&\times \frac{d}{dr}(\psi _0 + \lambda _0), \end{aligned}$$
(13)
$$\begin{aligned} \delta \varepsilon= & {} -\frac{1}{r^2}\frac{\partial }{\partial r}\left[ r^2(\varepsilon _0 + p_{r0})\xi \right] = -\xi \frac{d\varepsilon _0}{dr} \nonumber \\&- \, (\varepsilon _0 + p_{r0})\frac{e^{\psi _0}}{r^2}\frac{\partial }{\partial r}(r^2\xi e^{-\psi _0}) - \frac{2}{r}\xi \sigma _0 . \end{aligned}$$
(14)

In addition, the \(\mu = r\) component for the four-divergence of the energy-momentum tensor \(\nabla _\nu T_\mu ^{\ \nu } =0\), provides the following relation

$$\begin{aligned}&\frac{\partial T_r^{\ 0}}{\partial x^0} + \frac{\partial T_r^{\ r}}{\partial r} + T_r^{\ 0}\frac{\partial }{\partial x^0}(\psi + \lambda ) \nonumber \\&\quad + \, (T_r^{\ r} - T_0^{\ 0})\frac{\partial \psi }{\partial r} + \frac{2}{r}(T_r^{\ r} - p_t) = 0, \end{aligned}$$
(15)

or alternatively,

$$\begin{aligned}&(\varepsilon _0 + p_{r0})e^{2(\lambda _0 - \psi _0)}\frac{\partial v}{\partial x^0} + \frac{\partial (\delta p_r)}{\partial r} + (\varepsilon _0 + p_{r0})\frac{\partial (\delta \psi )}{\partial r} \nonumber \\&\quad + \, (\delta p_r + \delta \varepsilon )\frac{d\psi _0}{dr} - \frac{2}{r}\delta \sigma = 0 . \end{aligned}$$
(16)

Through Einstein equations it was possible to express some perturbations in terms of the Lagrangian displacement \(\xi \) and the unperturbed variables. Nonetheless, we still need to have an expression for the perturbation \(\delta p_r\), and to obtain it, an additional condition is necessary (the conservation of the baryon number). If n is the number of baryons per unit volume, its conservation in GR is given by \(\nabla _\mu J^\mu = 0\), where \(J^\mu \equiv nu^\mu \) is the baryon number current. At the same time, if we consider that the EoS has the general structure \(n = n(\varepsilon , p_r)\), we have

$$\begin{aligned} \delta p_r = -\xi \frac{dp_{r0}}{dr} - \gamma p_{r0}\frac{e^{\psi _0}}{r^2}\frac{\partial }{\partial r}(r^2\xi e^{-\psi _0}) + \frac{2}{r}\sigma _0\xi \frac{\partial p_r}{\partial \varepsilon },\nonumber \\ \end{aligned}$$
(17)

where \(\gamma \equiv \frac{n}{p_r}\frac{dp_r}{dn}\) is a dimensionless quantity that determines the changes of radial pressure associated with variations in the particle number density. If the entropy is conserved, we obtain the adiabatic index given by

$$\begin{aligned} \gamma= & {} \frac{1}{p_r(\partial n/\partial p_r)}\left[ n - (\varepsilon + p_r)\frac{\partial n}{\partial \varepsilon } \right] \nonumber \\= & {} \left( 1+ \frac{\varepsilon }{p_r} \right) \frac{dp_r}{d\varepsilon } . \end{aligned}$$
(18)

We now assume that the Lagrangian displacement has a harmonic time dependence as \(\xi (x^0, r) = \xi (r) e^{i\alpha x^0}\) where \(c\alpha \equiv \omega \) is a characteristic frequency to be determined. The same procedure is applied for the metric functions and thermodynamic quantities. Thus, the substitution of Eq. (13) into (16), leads to

$$\begin{aligned}&\alpha ^2(\varepsilon _0 + p_{r0})e^{2(\lambda _0 - \psi _0)}\xi = \frac{d(\delta p_r)}{dr} + \delta p_r \frac{d}{dr}(2\psi _0 + \lambda _0) \nonumber \\&\quad - \, (\varepsilon _0 + p_{r0})\left( 2\frac{d\psi _0}{dr} + \frac{1}{r} \right) \left( \frac{d\psi _0}{dr} + \frac{d\lambda _0}{dr} \right) \xi \nonumber \\&\quad + \, \frac{d\psi _0}{dr}\delta \varepsilon - \frac{2}{r}\delta \sigma . \end{aligned}$$
(19)

By means of Eqs. (7), (14), (17) and the \(\theta \theta \)-component of the field equations, the last expression can be written in terms of the unperturbed variables

$$\begin{aligned}&\alpha ^2(\varepsilon _0 + p_{r0})e^{2(\lambda _0 - \psi _0)}\xi =\ \varDelta p_r \frac{d}{dr}(2\psi _0 + \lambda _0) + \frac{d}{dr}(\varDelta p_r) \nonumber \\&\quad + \, \kappa p_t e^{2\lambda _0}(\varepsilon _0 + p_{r0})\xi - \xi (\varepsilon _0 + p_{r0})\left( \frac{d\psi _0}{dr} \right) ^2 \nonumber \\&\quad + \, \frac{4\xi }{r}\frac{dp_{r0}}{dr} - \frac{2\sigma _0\xi }{r}\left[ \frac{d}{dr}(2\psi _0 + \lambda _0) + \frac{4}{r} \right] \nonumber \\&\quad - \, \frac{d}{dr}\left[ \frac{2\sigma _0\xi }{r} \right] - \frac{2}{r}\delta \sigma . \end{aligned}$$
(20)

Because all terms are now the amplitudes of the perturbations and quantities of the static background, we can delete all reference to subscripts zero. Furthermore, let us define a new variable \(\zeta \equiv \xi /r\), so that Eqs. (17) and (20) can be rewritten as two first-order time-independent equations

$$\begin{aligned} \frac{d\zeta }{dr}= & {} -\frac{1}{r}\left( 3\zeta + \frac{\varDelta p_r}{\gamma p_r} + \frac{2\sigma \zeta }{\varepsilon + p_r} \right) + \frac{d\psi }{dr}\zeta , \end{aligned}$$
(21)
$$\begin{aligned} \frac{d(\varDelta p_r)}{dr}= & {} \ \zeta \left\{ \frac{\omega ^2}{c^2}e^{2(\lambda - \psi )}(\varepsilon + p_r)r - 4\frac{dp_r}{dr} \right. \nonumber \\&\left. - \, \kappa (\varepsilon + p_r)e^{2\lambda }rp_r + r(\varepsilon + p_r)\left( \frac{d\psi }{dr}\right) ^2 \right. \nonumber \\&\left. + \, 2\sigma \left( \frac{4}{r} + \frac{d\psi }{dr} \right) + 2\frac{d\sigma }{dr} \right\} + 2\sigma \frac{d\zeta }{dr} \nonumber \\&- \, \varDelta p_r \left[ \frac{d\psi }{dr} + \frac{\kappa }{2}(\varepsilon + p_r)re^{2\lambda } \right] + \frac{2}{r}\delta \sigma , \end{aligned}$$
(22)

where the specific form of the perturbation \(\delta \sigma \) depends on the anisotropy ansatz that we are going to use afterwards. These equations govern the adiabatic radial oscillations in the interior of an anisotropic spherical star, and we highlight that such equations differ considerably from those obtained by the authors in Ref. [20]. We have a Sturm–Liouville type problem for determining the radial oscillation modes with eigenvalues \(\omega _0^2< \omega _1^2 \cdots< \omega _n^2 < \cdots \), where n stands for the number of nodes inside the anisotropic stellar fluid. It is evident that when \(\sigma = 0\), the above system of equations assumes the Gondek’s form for isotropic fluids [37, 39, 45].

To numerically solve Eqs. (21) and (22), it becomes necessary to specify some physically meaningful boundary conditions. Analogous to a vibrating string that is fixed at its endpoints, the radial pulsations in the inner region of a star occur between its center and the surface. Indeed, since Eq. (21) has a singularity at the origin, it is required that as \(r \rightarrow 0\) the coefficient of 1/r term must vanish, namely

$$\begin{aligned} \varDelta p_r = -\frac{2\sigma \zeta }{\varepsilon + p_r}\gamma p_r -3\gamma \zeta p_r \quad \ \mathrm{as} \quad \ r\rightarrow 0 . \end{aligned}$$
(23)

Meanwhile, at the stellar surface where \(p_r(R) = 0\), the appropriate boundary condition is that Lagrangian perturbation of the radial pressure vanishes, this is,

$$\begin{aligned} \varDelta p_r = 0 \quad \ \mathrm{as} \quad \ r\rightarrow R . \end{aligned}$$
(24)

Notice that the Lagrangian displacement must vanish at the center due to spherical symmetry, that is \(\xi (0)=0\). Nevertheless, our equations are in terms of \(\zeta \), so a particularly simple approach that is often adopted is to normalize the eigenfunctions so that \(\zeta (0) =1\) at the center. In addition, we point out that in the treatment carried out by Misner et al. [83] for isotropic configurations, the radial oscillations are described by a second-order ordinary differential equation in the “renormalized displacement function” given by \(\eta \equiv r^2\xi e^{-\psi }\). In this regard, for anisotropic fluids we obtain the following differential equation governing the adiabatic radial pulsations

$$\begin{aligned}&\frac{d}{dr}\left[ {\mathscr {P}}\frac{d\eta }{dr} + {\mathscr {P}}\frac{2\sigma \eta }{r\gamma p_r}\left( \frac{\gamma p_r}{\varepsilon + p_r} + 1 \right) \right] \nonumber \\&\quad + \left[ {\mathscr {Q}} + \frac{\omega ^2}{c^2}{\mathscr {W}} \right] \eta = 0, \end{aligned}$$
(25)

where

$$\begin{aligned} {\mathscr {P}}\equiv & {} \frac{\gamma p_r}{r^2}e^{3\psi + \lambda }, \end{aligned}$$
(26)
$$\begin{aligned} {\mathscr {W}}\equiv & {} \frac{\varepsilon + p_r}{r^2}e^{\psi + 3\lambda }, \end{aligned}$$
(27)
$$\begin{aligned} {\mathscr {Q}}\equiv & {} \frac{1}{r^2}\left[ \frac{p_r'^2}{\varepsilon + p_r} - \frac{4p_r'}{r} - \kappa (\varepsilon + p_r)p_te^{2\lambda } \right. \nonumber \\&\left. - \frac{4\sigma }{r(\varepsilon + p_r)}\left( p_r' - \frac{\sigma }{r} \right) + \frac{8\sigma }{r^2} + \frac{2}{r}\frac{\delta \sigma }{\xi } \right] e^{3\psi + \lambda } . \end{aligned}$$
(28)

Equation (25) leads to a self-adjoint eigenvalue problem for the oscillation frequencies. Indeed, when the anisotropy vanishes (i.e., \(p_t = p_r\)), such equation is reduced to the form given in Refs. [38, 83].

2.3 Equation of state and anisotropy ansatz

The conventional way to tackle the problem of anisotropic configurations is by specifying an EoS for radial pressure, i.e. \(p_r = p_r(\rho )\), and additionally an anisotropy function \(\sigma \equiv p_t - p_r\) must be assigned. Here, we are going to use a well known EoS and four different functions for \(\sigma \).

Based on the SLy effective nucleon-nucleon interaction, Douchin and Haensel [84] calculated an unified equation of state (the so-called SLy EoS) that covers three main regions of neutron-star interior: outer crust, inner crust and liquid core (consisting of neutrons, protons, electrons and negative muons). Such an EoS is compatible with the constraints of the gravitational-wave event GW170817 (observed by the LIGO-Virgo detectors [27]), and the analytical parameterization of pressure as a function of density for non-rotating stars is as follows [85]

$$\begin{aligned} {\mathscr {A}}(y)= & {} \frac{a_1 + a_2y + a_3y^3}{1 + a_4y}K_0(a_5(y - a_6)) \nonumber \\&+ \, (a_7 + a_8y)K_0(a_9(a_{10} - y)) \nonumber \\&+ \, (a_{11} + a_{12}y)K_0(a_{13}(a_{14} - y)) \nonumber \\&+ \, (a_{15} + a_{16}y)K_0(a_{17}(a_{18} - y)), \end{aligned}$$
(29)

where \({\mathscr {A}} \equiv \log (p_r/ \mathrm dyn\ cm^{-2})\), \(y \equiv \log (\rho / \mathrm g\ cm^{-3})\), and \(K_0(x) \equiv 1/(e^x +1)\). The fitting parameters of this expression \(a_i\) can be found in Ref. [85]. Furthermore, below we specify the anisotropy functions provided in the literature to model anisotropic matter at high densities:

2.3.1 Quasi-local ansatz

Horvat et al. [17] suggested an anisotropy ansatz as being a bilinear function in the radial pressure and compactness, namely

$$\begin{aligned} \sigma \equiv \beta _{\mathrm{H}} p_r \mu , \end{aligned}$$
(30)

where \(\beta _{\mathrm{H}}\) is a dimensionless parameter that measures the degree of anisotropy within the star, and \(\mu (r) \equiv 2Gm/c^2r\) is known as compactness. The advantage of this ansatz is that the fluid becomes isotropic at the stellar center since \(\mu \sim r^2\) when \(r \rightarrow 0\). On the other hand, (30) is important only for relativistic configurations which is in agreement with the assumption that the anisotropy may arise at high densities. A similar ansatz for the anisotropy measure was used to describe gravastar models in Ref. [86]. Moreover, in the calculations it is common to assume \(-2 \le \beta _{\mathrm{H}} \le 2\) [4, 17, 26, 82, 87].

According to Eq. (8), the Eulerian perturbation for the anisotropy function (30), can be written as

$$\begin{aligned} \delta \sigma= & {} \beta _{\mathrm{H}} (1 - e^{-2\lambda })(\varDelta p_r - r\zeta p_r') \nonumber \\&- \, \beta _{\mathrm{H}}\kappa p_r(\varepsilon + p_r) r^2\zeta . \end{aligned}$$
(31)

2.3.2 Bowers–Liang ansatz

Another relation for anisotropic models was proposed by Bowers and Liang [14], given by

$$\begin{aligned} \sigma \equiv \beta _{\mathrm{BL}}\frac{G}{c^4}(\varepsilon + p_r)(\varepsilon + 3p_r)\frac{r^2}{1-\mu }, \end{aligned}$$
(32)

where the anisotropy factor depends nonlinearly on the radial pressure and energy density. The anisotropy vanishes at the origin in order to yield regular solutions, and it is (in part) gravitationally induced since \(1- \mu = e^{-2\lambda }\). Here the literature offers a similar range for the free parameter \(\beta _\mathrm{BL}\) as in the first model mentioned above (see Refs. [26, 87, 88]).

In this case, \(\delta \sigma \) assumes the form

$$\begin{aligned} \delta \sigma= & {} \frac{2\beta _{\mathrm{BL}} G}{c^4} r^2e^{2\lambda } \left[ (2\varepsilon + 3p_r)(\varDelta p_r - r\zeta p_r') \right. \nonumber \\&\left. + \, (\varepsilon + p_r)(\varepsilon + 3p_r)(\zeta + \delta \lambda ) + (\varepsilon + 2p_r)\delta \varepsilon \right] . \end{aligned}$$
(33)

2.3.3 Herrera–Barreto ansatz

An ansatz that was initially studied in Ref. [89] in order to find a family of non-isotropic configurations from any isotropic model, and later summarized by Herrera and Barreto [18], is the following

$$\begin{aligned} \sigma \equiv \frac{(h-1)r}{2h} \frac{dp_r}{dr}, \end{aligned}$$
(34)

where h is a constant throughout the sphere, and for \(h=1\) we recover the isotropic case. Here we are going to define \(\beta _\mathrm{HB} \equiv (h-1)/2h\) so that \(\sigma = \beta _{\mathrm{HB}} rp_r'\). The possibility (34), like the other ansatze, guarantees that the anisotropy must vanish at the center of symmetry of the fluid. In this case \(\beta _{\mathrm{HB}}\) cannot be positive in order to the tangential pressure to be always positive throughout the stellar interior. We must point out that physically relevant solutions correspond to \(p_r, p_t \ge 0\) for \(r \le R\).

The Eulerian perturbation for the ansatz (34) is given by

$$\begin{aligned} \delta \sigma = \beta _{\mathrm{HB}} r\zeta p_r' + \beta _{\mathrm{HB}} r\frac{d}{dr}(\varDelta p_r - r\zeta p_r'). \end{aligned}$$
(35)

2.3.4 Covariant ansatz

Finally we will consider an additional ansatz that has recently been introduced by Raposo et al. [90] in order to study the dynamical properties of anisotropic self-gravitating fluids in a covariant framework, that is, \(\sigma \equiv -{\mathscr {C}}f(\varepsilon )k^\mu \nabla _\mu p_r = -{\mathscr {C}}f(\varepsilon )e^{-\lambda }p_r'\), where \({\mathscr {C}}\) is a free constant that measures the deviation from isotropy. For simplicity, we are going to consider \(f(\varepsilon ) = \varepsilon \), and since we are using physical units, we have

$$\begin{aligned} \sigma = \beta _{\mathrm{R}}\frac{G}{c^4}\varepsilon e^{-\lambda }p_r', \end{aligned}$$
(36)

where now the free parameter is \(\beta _{\mathrm{R}} \le 0\) and, unlike previous models, it has units of cubic meters. At the stellar origin the fluid becomes isotropic since the radial pressure is maximum at this point, and at the surface both pressures vanish.

For this anisotropic model, \(\delta \sigma \) takes the following form

$$\begin{aligned} \delta \sigma = \frac{\beta _{\mathrm{R}}G}{c^4} e^{-\lambda }\left[ (\delta \varepsilon - \varepsilon \delta \lambda )p_r' + \varepsilon \frac{d}{dr}(\varDelta p_r - r\zeta p_r') \right] .\nonumber \\ \end{aligned}$$
(37)

3 Non-adiabatic gravitational collapse

The goal in this section is to study the dynamical evolution of unstable anisotropic neutron stars whose ultimate fate is the formation of an event horizon, and to describe the formation of black holes it is necessary to use models that involve non-ideal fluids [91]. The gravitational collapse is a highly dissipative phenomenon in which massless particles (photons and neutrinos) carry thermal energy for exterior spacetime [92, 93]. In this respect, we are going to deal with the problem following the standard procedure, namely, the spherical hypersurface \(\varSigma \) of the collapsing star divides the spacetime into two different regions where each one is described by a particular matter-energy distribution.

3.1 Interior spacetime and generalized TOV equations

We model the collapsing configuration by means of a locally anisotropic fluid, bounded by \(\varSigma \), and that undergoes dissipation in the form of heat flow. Accordingly, in the diffusion approximation, the energy-momentum tensor is given by [92]

$$\begin{aligned} T_{\mu \nu }^-= & {} (\varepsilon + p_t)u_\mu u_\nu + p_tg_{\mu \nu } + (p_r - p_t)k_\mu k_\nu \nonumber \\&+ \, q_\mu u_\nu + q_\nu u_\mu , \end{aligned}$$
(38)

where, as in the static background, \(\varepsilon \) represents the energy density, \(p_r\) the radial pressure and \(p_t\) the tangential pressure. The four-velocity \(u^\mu \), the heat flux \(q^\mu \) and the unit four-vector along the radial direction \(k^\mu \), must satisfy the following relations

$$\begin{aligned} u_\mu u^\mu = -1, \quad k_\mu k^\mu = 1, \quad q_\mu u^\mu = 0 . \end{aligned}$$
(39)

In order to introduce a time dependence on the metric functions such that under a certain limit we can recover the static case, we assume that the geometry of the interior spacetime is described by the following spherically symmetric, shear-free line element [45]

$$\begin{aligned} ds_-^2 = g_{\mu \nu }^- dx^\mu _- dx^\nu _-= & {} -e^{2\psi (r)}(dx^0_-)^2 + e^{2\lambda (r)}f(x^0_-)dr^2 \nonumber \\&+ \, r^2f(x^0_-)d\varOmega ^2, \end{aligned}$$
(40)

where \(x^\mu _- = (ct, r, \theta , \phi )\) are the coordinates in the interior manifold and \(df/dx_-^0 <0\) in the case of collapsing configurations. From relations (39) and by using comoving coordinates, we get

$$\begin{aligned} u^\mu = e^{-\psi }\delta _0^\mu , \quad k^\mu = \frac{e^{-\lambda }}{\sqrt{f}}\delta _r^\mu , \quad q^\mu = \frac{q}{c}\delta _r^\mu , \end{aligned}$$
(41)

being \(q = q(x^0_-, r)\) the rate of energy flow per unit area along the radial coordinate. In the static limit \(f(x^0_-) \rightarrow 1\) we recover Eq. (1) which describes the initially static anisotropic star.

The explicit form of the Einstein field equations for the energy-momentum tensor (38) and metric (40), is given by

$$\begin{aligned} G_{00}^-= & {} -\frac{e^{2\psi }}{r^2e^{2\lambda }f}( 1- e^{2\lambda } - 2r\lambda ' ) + \frac{3}{4}\frac{{\dot{f}}^2}{f^2} = \kappa \varepsilon e^{2\psi },\nonumber \\ \end{aligned}$$
(42)
$$\begin{aligned} G_{rr}^-= & {} \frac{1- e^{2\lambda } + 2r\psi '}{r^2} - \frac{e^{2\lambda }}{e^{2\psi }}\left( {\ddot{f}} - \frac{{\dot{f}}^2}{4f} \right) = \kappa p_r e^{2\lambda }f,\nonumber \\ \end{aligned}$$
(43)
$$\begin{aligned} G_{\theta \theta }^-= & {} \frac{r^2}{e^{2\lambda }}\left( \psi '^2 + \psi '' - \psi '\lambda ' + \frac{\psi '}{r} - \frac{\lambda '}{r} \right) \nonumber \\&- \, \frac{r^2}{e^{2\psi }}\left( {\ddot{f}} - \frac{{\dot{f}}^2}{4f} \right) = \kappa p_t r^2f, \end{aligned}$$
(44)
$$\begin{aligned} G_{0r}^-= & {} \psi '\frac{{\dot{f}}}{f} = -\kappa \frac{q}{c}e^{\psi + 2\lambda }f, \end{aligned}$$
(45)

where the dot and the prime denote differentiation with respect to \(x^0_-\) and r, respectively. The mass entrapped within the radius r and at time t, is given by the following expression [92, 94]

$$\begin{aligned} m(t,r)= & {} \frac{c^2r\sqrt{f}}{2G}R^{\phi }_{\ \theta \phi \theta } \nonumber \\= & {} \frac{c^2r\sqrt{f}}{2G}\left[ 1 - \frac{1}{e^{2\lambda }} + \frac{r^2}{4e^{2\psi }}\frac{{\dot{f}}^2}{f} \right] . \end{aligned}$$
(46)

As a consequence, the generalized TOV equations within a non-adiabatic context are derived from the four-divergence of the energy-momentum tensor (38) along with Eq. (43), that is,

$$\begin{aligned} \frac{\partial p_r}{\partial r}= & {} -\frac{\varepsilon + p_r}{c^2}\left[ \frac{Gm}{r^2\sqrt{f}} + \frac{4\pi G}{c^2}rp_rf + \frac{c^2r}{2e^{2\psi }}\left( {\ddot{f}} - \frac{{\dot{f}}^2}{2f} \right) \right] \nonumber \\&\times \left[ 1- \frac{2Gm}{c^2r\sqrt{f}} + \frac{r^2{\dot{f}}^2}{4e^{2\psi }f} \right] ^{-1} + \frac{2}{r}\sigma \nonumber \\&- \, \frac{f}{ce^\psi }\left[ {\dot{q}} + \frac{5q{\dot{f}}}{2f} \right] \left[ 1- \frac{2Gm}{c^2r\sqrt{f}} + \frac{r^2{\dot{f}}^2}{4e^{2\psi }f} \right] ^{-1}, \end{aligned}$$
(47)
$$\begin{aligned} \frac{d\psi }{dr}= & {} -\frac{1}{\varepsilon + p_r}\frac{\partial p_r}{\partial r} + \frac{2\sigma }{r(\varepsilon + p_r)} \nonumber \\&- \,\frac{e^{2\lambda - \psi }f}{c(\varepsilon + p_r)}\left( {\dot{q}} + \frac{5q{\dot{f}}}{2f} \right) , \end{aligned}$$
(48)

where it should be noted that now the energy density, radial pressure, heat flux, anisotropy ansatz, and mass function depend on both t and r, whereas \(\psi = \psi (r)\), \(\lambda = \lambda (r)\) and \(f = f(t)\). It becomes apparent that at the static limit such equations are reduced to those already known in (6) and (7), respectively. Furthermore, we remark that Eq. (46) is the dissipative analogue of the relation (8).

3.2 Junction conditions on the stellar surface

Since the star is radiating energy, the exterior spacetime is described by the Vaidya metric [56, 95], given as follows

$$\begin{aligned} ds_+^2= & {} g_{\mu \nu }^+ dx^\mu _+ dx^\nu _+ = -\left[ 1 - \frac{2Gm(\upsilon )}{c^2\chi } \right] c^2d\upsilon ^2 \nonumber \\&+ \, 2e c d\upsilon d\chi + \chi ^2d\varOmega ^2, \end{aligned}$$
(49)

where \(x_+^\mu = (c\upsilon , \chi , \theta , \phi )\), \(m(\upsilon )\) is the mass function that depends on the retarded time \(\upsilon \), and \(e = \pm 1\) describes the incoming (outgoing) flux of radiation around the source of gravitational field. In our collapse model the radiation is expelled into outer region so that \(dm/d\upsilon \le 0\).

Since the collapsing star is described by two spacetime regions with distinct geometric properties, it becomes necessary to invoke the junction conditions on \(\varSigma \) established by Israel [96, 97]. Such conditions require continuity of the line element and extrinsic curvature through the hypersurface, namely

$$\begin{aligned} (ds^2_-)_\varSigma = (ds^2_+)_\varSigma = ds^2_\varSigma , \quad (K_{ij}^-)_\varSigma = (K_{ij}^+)_\varSigma , \end{aligned}$$
(50)

where the intrinsic metric to \(\varSigma \) is given by

$$\begin{aligned} ds^2_\varSigma = g_{ij}d\varsigma ^i d\varsigma ^j = -c^2d\tau ^2 + {\mathscr {R}}^2(\tau )d\varOmega ^2 . \end{aligned}$$
(51)

The extrinsic curvature tensor is defined by

$$\begin{aligned} K_{ij}^\pm = -n_\mu ^\pm \frac{\partial ^2 x_\pm ^\mu }{\partial \varsigma ^i \partial \varsigma ^j} - n_\mu ^\pm \varGamma _{\alpha \beta }^\mu \frac{\partial x_\pm ^\alpha }{\partial \varsigma ^i}\frac{\partial x_\pm ^\beta }{\partial \varsigma ^j}, \end{aligned}$$
(52)

where \(x_\pm ^\mu \) are the coordinates of the exterior and interior spacetime, \(\varsigma ^i = (c\tau , \theta , \phi )\) are the coordinates that define the comoving timelike hypersurface, and \(n_\pm ^\mu \) are the unit normal vectors to \(\varSigma \) which have already been calculated by Santos [59]. The non-vanishing extrinsic curvature components \(K_{ij}^\pm \) are given explicitly in Apendix A. As a result, the junction conditions (50) imply that

$$\begin{aligned} \chi _\varSigma= & {} \left[ r\sqrt{f}\right] _\varSigma = {\mathscr {R}}, \end{aligned}$$
(53)
$$\begin{aligned} m_\varSigma= & {} \frac{c^2R\sqrt{f}}{2G}\left[ 1 + \frac{r^2}{4e^{2\psi }}\frac{{\dot{f}}^2}{f} - \frac{1}{e^{2\lambda }} \right] _\varSigma , \end{aligned}$$
(54)
$$\begin{aligned} z_\varSigma= & {} \left[ \frac{d\upsilon }{d\tau } \right] _\varSigma - 1 = \left[ \frac{1}{e^\lambda } + \frac{r}{2e^\psi }\frac{{\dot{f}}}{\sqrt{f}} \right] _\varSigma ^{-1} - 1, \end{aligned}$$
(55)
$$\begin{aligned} p_{r, \varSigma }= & {} \left[ \frac{q}{c}e^{\lambda }\sqrt{f} \right] _\varSigma , \end{aligned}$$
(56)

with \(z_\varSigma \) being the boundary redshift of the radial radiation emitted by the non-adiabatic sphere. Eq. (53) is the equality of the proper radii as measured from the perimeter of \(\varSigma \). The expression (54) is a measure of the total mass of the star as it collapses, and Eq. (56) indicates that the radial pressure on the surface of the star is different from zero unless the heat flow vanishes. It is evident that in the static limit \(m_\varSigma \) corresponds to the total mass of the initial Schwarzschild configuration M, and the redshift is reduced to \(z_\varSigma = e^{\lambda (R)} - 1\), namely, the gravitational redshift of light emitted at the surface of the initially static neutron star.

3.3 Evolution quantities

The fact that the radial pressure does not vanish on the surface leads to an additional differential equation that allows us to fix the time evolution of our model. By taking into account Eqs. (43) and (45) into (56), we obtain

$$\begin{aligned} \frac{d^2f}{dt^2} - \frac{1}{4f}\left( \frac{df}{dt} \right) ^2 - \frac{GM}{cR^2}\frac{1}{\sqrt{f}}\frac{df}{dt} = 0, \end{aligned}$$
(57)

which can be integrated to generate the following equation

$$\begin{aligned} \frac{df}{dt} = \frac{4GM}{cR^2}\left[ \sqrt{f} - f^{1/4} \right] , \end{aligned}$$
(58)

where the integration constant has been determined by applying the static limit. Then the solution of Eq. (58) is given by

$$\begin{aligned} t = \frac{cR^2}{2GM}\left[ \sqrt{f} + 2f^{1/4} + 2\ln \left( 1 - f^{1/4}\right) \right] . \end{aligned}$$
(59)

For an observer at rest at infinity, the redshift (55) diverges at the time of formation of an event horizon. This means that a black hole has been formed as outcome of the gravitational collapse of an unstable anisotropic star when

$$\begin{aligned} f_{bh} = \left[ \frac{2GM}{c^2R} \right] ^4. \end{aligned}$$
(60)

For systems describing gravitational collapse we must have \(0 < f \le 1\), i.e. the time function f decrease monotonically from \(f = 1\) to \(f = f_{bh}\). In other words, the time goes from \(t = -\infty \) (when the model is static) to \(t = t_{bh}\) (when the star becomes a black hole), but a time displacement can be done without loss of generality. Consequently, one obtains from Eq. (54) the mass of the formed black hole, which reads:

$$\begin{aligned} m_{bh} = \frac{2GM^2}{c^2R} . \end{aligned}$$
(61)
Fig. 1
figure 1

Mass-radius diagrams for anisotropic neutron stars with SLy EoS (29) and for the anisotropy ansatze (30) in the upper left panel, (32) in the upper right panel, (34) in the lower left panel, and (36) in the lower right panel. The isotropic case is shown in all plots as a benchmark by a solid black line, and the cigar-shaped yellow region is one of both mass and radius measurements for PSR J0030 + 0451 from NICER data [99]. The horizontal narrow band in cyan color stands for the recent restriction of maximum mass of neutron stars as a result of observation of the GW event GW170817 [100]

Table 1 Maximum-mass stellar configurations with SLy EoS for different values of the anisotropy parameter. The mass density values correspond to the critical central density where the function \(M(\rho _c)\) is a maximum. The fundamental mode frequency with an asterisk means that it is imaginary, and \(z(R) = e^{\lambda (R)} -1\) is the gravitational redshift of light emitted at the surface of the equilibrium star

Notice that Eq. (59) provides t as a function of f, nonetheless, is more useful to obtain f(t) in order to analyze the dynamical quantities as a function of time as a stellar configuration collapses. Thus, it is convenient to numerically solve Eq. (57) as a final value problem by specifying a value of f(t) and df(t)/dt at time \(t = t_{bh}\), where the two final conditions are established through Eqs. (58)–(60). The relevant physical quantities during the collapse such as energy density, radial pressure, tangential pressure and heat flow, are given by

$$\begin{aligned} \varepsilon (t, r)= & {} -\frac{1 - e^{2\lambda } - 2r\lambda '}{\kappa r^2e^{2\lambda }f} + \frac{12a^2}{\kappa e^{2\psi }}\left[ \frac{\sqrt{f} - f^{1/4}}{f} \right] ^2 \nonumber \\= & {} \frac{2}{\kappa r^2f}\left[ \frac{1 + r\lambda '}{e^{2\lambda }} + \frac{3Gm}{c^2r\sqrt{f}} -1 \right] , \end{aligned}$$
(62)
$$\begin{aligned} p_r(t, r)= & {} \ \frac{1 - e^{2\lambda } + 2r\psi '}{\kappa r^2e^{2\lambda }f} + \frac{4a^2}{\kappa e^{2\psi }}\left[ \frac{f^{-1/4} - 1}{f} \right] , \end{aligned}$$
(63)
$$\begin{aligned} p_t(t, r)= & {} \frac{1}{\kappa e^{2\lambda }f}\left[ \psi '^2 + \psi '' - \psi '\lambda ' + \frac{1}{r}(\psi '-\lambda ') \right] \nonumber \\&+ \, \frac{4a^2}{\kappa e^{2\psi }}\left[ \frac{f^{-1/4} - 1}{f} \right] , \end{aligned}$$
(64)
$$\begin{aligned} q(t, r)= & {} -\frac{4ac\psi '}{\kappa e^{\psi +2\lambda }}\left[ \frac{\sqrt{f} - f^{1/4}}{f^2} \right] , \end{aligned}$$
(65)

where \(a \equiv GM/c^2R^2\), and the anisotropy factor takes the following form

$$\begin{aligned} \sigma (t, r)= & {} \frac{1}{\kappa e^{2\lambda }f}\left[ \psi '^2 + \psi '' - \psi '\lambda ' \right. \nonumber \\&\quad \left. + \frac{1}{r^2}(e^{2\lambda } - 1 - r\psi ' - r\lambda ') \right] . \end{aligned}$$
(66)

Finally, a kinematic quantity that provides information about the rate of expansion of the fluid sphere is given by the four-divergence of the four-velocity [13, 92]

$$\begin{aligned} \varTheta = c\nabla _\mu u^\mu = \frac{6ac}{e^\psi }\left[ \frac{\sqrt{f} - f^{1/4}}{f} \right] , \end{aligned}$$
(67)

that is, the expansion scalar and whose action is to change the volume of the spherical star but it preserves the principal axes. In fact, when \(f \rightarrow 1\), the heat flow and the expansion scalar vanish and, therefore, the fluid becomes perfect. The other physical quantities are reduced to those already known in the static background.

3.4 Energy conditions

The dissipative anisotropic fluid must satisfy the energy conditions throughout the gravitational collapse in order for it to be physically acceptable. This means that the energy-momentum tensor (38) has to be diagonalized by means of equation \(\vert T_{\mu \nu }^- - \varUpsilon g_{\mu \nu }^- \vert = 0\), so that the eigenvalues \(\varUpsilon \) take the explicit form

$$\begin{aligned} \varUpsilon _0= & {} -\frac{1}{2}(\varepsilon - p_r + \varDelta ), \end{aligned}$$
(68)
$$\begin{aligned} \varUpsilon _1= & {} -\frac{1}{2}(\varepsilon - p_r - \varDelta ), \end{aligned}$$
(69)
$$\begin{aligned} \varUpsilon _2= & {} \varUpsilon _3 = p_t, \end{aligned}$$
(70)

where we defined \(\varDelta \equiv \sqrt{ (\varepsilon + p_r)^2 - 4{\tilde{q}}^2 }\) and \({\tilde{q}} \equiv \frac{q}{c}e^\lambda \sqrt{f}\). Thus, the following energy conditions must hold [98]

\(\star \):

Weak energy conditions (WEC)

(a):

\(-\varUpsilon _0 \ge 0\),

(b):

\(-\varUpsilon _0 + \varUpsilon _i \ge 0, \quad \mathrm {for} \ i = 1, 2, 3.\)

Such inequalities entail that

$$\begin{aligned}&\varDelta \ge 0, \end{aligned}$$
(71)
$$\begin{aligned}&\varepsilon + \varDelta - p_r \ge 0, \end{aligned}$$
(72)
$$\begin{aligned}&\varepsilon + \varDelta - p_r +2p_t \ge 0. \end{aligned}$$
(73)
\(\star \):

Dominant energy conditions (DEC)

(a):

\(-\varUpsilon _0 \ge 0\),

(b):

\(-\varUpsilon _0 + \varUpsilon _i \ge 0, \quad \mathrm {for} \ i = 1, 2, 3.\)

(c):

\(\varUpsilon _0 + \varUpsilon _i \le 0, \quad \mathrm {for} \ i = 1, 2, 3.\)

The first two inequalities have already been included in weak energy conditions. As regards the third inequality, we obtain

$$\begin{aligned}&\varepsilon - p_r \ge 0, \end{aligned}$$
(74)
$$\begin{aligned}&\varepsilon + \varDelta - p_r - 2p_t \ge 0 . \end{aligned}$$
(75)
\(\star \):

Strong energy conditions (SEC)

(a):

\(-\varUpsilon _0 + \sum _{i=1}^3 \varUpsilon _i \ge 0\),

(b):

\(-\varUpsilon _0 + \varUpsilon _i \ge 0, \quad \mathrm {for} \ i = 1, 2, 3.\)

Specifically, the first inequality implies that

$$\begin{aligned} \varDelta + 2p_t \ge 0, \end{aligned}$$
(76)

whereas the second inequality has been considered in the other energy conditions.

Therefore, to know whether our collapse model is physically acceptable, it is only necessary to verify that the energy conditions (71), (74), (75) and (76) are respected.

4 Numerical results and discussion

4.1 Equilibrium configurations and radial oscillations

Given different values of central density and an anisotropy ansatz with EoS (29), the background Eqs. (5)–(7) can be numerically solved under the conditions (9) to produce a family of anisotropic neutron stars in hydrostatic equilibrium. Figure 1 illustrates the landscape of these configurations for each anisotropy ansatz. In the case of the ansatze proposed by Horvat et al. (30) and Raposo et al. (36), for low enough central densities, the configurations have a mass similar to the isotropic case. Nevertheless, above a certain central density value, the masses deviate considerably from those provided by isotropic solutions. It is evident that depending on the degree of anisotropy within the configurations, the curves in the M versus R plane can move significantly away from the isotropic case.

One of the most interesting approaches to determining the neutron-star matter EoS is through measurements of the masses and radii of these stars. The observations made in the last few years are allowing us to improve our understanding of the properties of cold dense matter and, therefore, to constrain the EoS. In that regard, we expect that the effects generated by anisotropic pressure are also within the constraints obtained by recent observations. Indeed, we consider one of both mass and radius measurements for the millisecond pulsar PSR J0030 + 0451 from Neutron Star Interior Composition Explorer (NICER) data, which was obtained by using a Bayesian inference approach to analyze its energy-dependent thermal X-ray waveform [99]. According to Fig. 1, it is possible to construct anisotropic neutron stars that lie within the region provided by the NICER data. Furthermore, from the observation of the GW event GW170817 there is a recent restriction on the maximum mass of neutron stars [100]. To ensure that our results are consistent with such a restriction, bounds on anisotropy parameters must be established. This hints that \(\beta _{\mathrm{H}} \lesssim 0.40\), \(\beta _{\mathrm{BL}} \lesssim 0.23\), \(\beta _{\mathrm{HB}} \gtrsim -0.042\), and \(\beta _{\mathrm{R}} \gtrsim -4.6 \times 10^{11}\ \mathrm m^3\).

Fig. 2
figure 2

Absolute value of the Lagrangian perturbation of the radial pressure at the stellar surface on a logarithmic scale for a set of trial values of \(\omega ^2\) with a central mass density \(\rho _c = 2.0 \times 10^{18}\ \mathrm{{kg}}/\mathrm{{m}}^3\) and different anisotropy ansatze. The minima in each curve correspond to the correct frequencies of the oscillation modes for equilibrium configurations. Since \(\omega _0^2 >0\), the four anisotropic neutron stars are stable against radial oscillations

Fig. 3
figure 3

Lagrangian perturbation of the anisotropy factor for the first five normal oscillation modes as a function of the radial coordinate obtained for a central mass density \(\rho _c = 2.0 \times 10^{18}\ \mathrm{kg}/\mathrm{m}^3\) with SLy EoS (29). The upper left, upper right, lower left and lower right panels correspond to the anisotropy ansatze (30) with \(\beta _{\mathrm{H}} = 0.5\), (32) with \(\beta _{\mathrm{BL}} = 0.25\), (34) with \(\beta _{\mathrm{HB}} = -0.05\), and (36) with \(\beta _{\mathrm{R}} = -5.0\times 10^{11}\ \mathrm{m}^3\), respectively. The radius, mass, and frequency of the fundamental mode for such stars are shown in Table 2

In Table 1, we list the mass and radius of the maximum-mass configurations for each anisotropic model with different values of the free parameter. According to the \(M(\rho _c)\) method, the first maximum on the \(M(\rho _c)\) curve corresponds to a critical central density \(\rho _c = \rho _{crit}\) which delimits a family of stars that is stable against gravitational collapse. This means that the unstable branch in the sequence of stars is located after the critical density where \(dM/d\rho _c <0\). Due to its simplicity, this condition has been widely used in the literature. However, such a condition is just necessary but not sufficient to determine the limits of stability.

Once the equilibrium quantities are known by solving the TOV equations, our second task is to verify if the \(M(\rho _c)\) method is compatible with the calculation of frequencies. To that end, we have to solve the system of coupled first-order equations (21) and (22) with boundary conditions (23) and (24). The numerical solution of these equations is carried out using the shooting method, that is, we integrate the equations for a set of trial values of \(\omega ^2\) satisfying the condition (23). Besides that, we consider that normalized eigenfunctions correspond to \(\zeta (0) = 1\) at the center, and we integrate to the stellar surface. The values of the squared frequency for which the boundary condition (24) is satisfied are the correct frequencies of the radial oscillations. In particular, for a central mass density \(\rho _c = 2.0 \times 10^{18}\ \mathrm {kg}/\mathrm {m}^3\) with anisotropy parameters \(\beta _{\mathrm{H}} = 0.50\), \(\beta _{\mathrm{BL}} = 0.25\), \(\beta _{\mathrm{HB}} = -0.05\) and \(\beta _{\mathrm{R}} = -5.0\times 10^{11}\ \mathrm m^3\), we display in Fig. 2 the Lagrangian perturbation of the radial pressure for a set of test values \(\omega ^2\), where each minimum indicates the appropriate frequency. In other words, for a given stellar configuration there are different eigenvalues \(\omega _n^2\) with their respective eigenfunctions \(\zeta _n(r)\) and \(\varDelta p_{r,n}(r)\), where n represents the number of nodes inside the anisotropic star. In Fig. 2, the first (leftmost) minimum represents the fundamental oscillation mode and it has no nodes between the center and the surface, whereas the first overtone \((n=1)\) has a node, the second overtone \((n=2)\) has two, and so forth. These radial pulsations in the anisotropy ansatz can be visualized in more detail in Fig. 3 and whose fundamental mode oscillation frequencies are shown in Table 2.

Table 2 Anisotropic neutron stars with central mass density \(\rho _c = 2.0 \times 10^{18}\ \mathrm {kg}/\mathrm {m}^3\) for some anisotropy parameters. The first five eigenfunctions for oscillation modes of these configurations are shown in Fig. 3
Fig. 4
figure 4

On the left panel is shown the frequency of the fundamental mode \(f_0 = \omega _0/2\pi \) as a function of the central mass density \(\rho _c\), and on the right panel is displayed the squared frequency of the fundamental oscillation mode \(\omega _0^2\) against the central density for different values of \(\beta \). The isotropic case is shown in both plots as a benchmark by a solid black line

Fig. 5
figure 5

Energy density (upper panel) and radial pressure (lower panel) as functions of the radial coordinate at different times, for a central mass density \(\rho _c = 2.6 \times 10^{18}\ \mathrm{{kg}}/\mathrm{{m}}^3\) with anisotropy ansatz (32) for \(\beta _\mathrm{BL} = 0.2\). This configuration corresponds to an unstable anisotropic neutron star with radius \(R = 10.183\ \mathrm{{km}}\), initial mass \(M = 2.145\ M_\odot \) and \(m_{bh} = 1.335\ M_\odot \) at the end of the collapse

Fig. 6
figure 6

Upper panel: Evolution of the EoS \(p_r = p_r(\varepsilon )\) during the gravitational collapse. Lower panel: Heat flux as a function of the radial coordinate at different times. The central density and anisotropy parameter have the same values as in Fig. 5

Fig. 7
figure 7

Radial profile of the anisotropy ansatz (upper panel) described by Eq. (66), mass function (intermediate panel) given by (46), and expansion scalar (lower panel) during the collapse process at different instants of time. The results are for the same solution as in Fig. 5

Using the central density as a parameter, the family of anisotropic stars that are actually stable is shown in the left plot of Fig. 4. The squared frequency of the fundamental oscillation mode against the central density is shown in the right plot of the same figure. Unlike the case of strange stars with MIT bag model EoS (where the frequency of the fundamental mode always decreases with increasing central density), in neutron stars \(\omega _0^2\) increases to a maximum value and then decreases with \(\rho _c\) regardless of the anisotropic model. In addition, for larger values of \(\beta _\mathrm{H}\) and \(\beta _{\mathrm{BL}}\), the onset of instability is indicated at a smaller and smaller central density value. On the other hand, for larger values of \(\beta _{\mathrm{HB}}\) and \(\beta _{\mathrm{R}}\), the onset of instability is found at a greater and greater central density value as we approach the isotropic case.

Taking into account the data recorded in Table 1, we see that only for the ansatze proposed by Horvat et al. (30) and Raposo et al. (36), the onset of instability indicated by the \(M(\rho _c)\) method is located exactly at the configuration that has vanishing frequency of the fundamental mode. In other words, for these two anisotropy profiles, the maximum-mass point \(M_{\mathrm{max}}\) and \(\omega _0^2 = 0\) are reached at the same central density value. Nevertheless, for the anisotropic models suggested by Bowers–Liang (32) and Herrera–Barreto (34), the squared frequency of the fundamental mode does not pass through zero at the critical central density corresponding to the maximum-mass configuration. Therefore, it is evident that anisotropy affects the stellar stability and the critical central density does not always correspond to the onset of instability.

4.2 Dynamical evolution of gravitational collapse

Anisotropic neutron stars in hydrostatically stable equilibrium oscillate with a purely real (fundamental) frequency when are subjected to a radial perturbation, whereas the unstable stars (with imaginary frequency of the lowest oscillation mode) undergo a gravitational collapse from rest to form a black hole. We assume that the unstable configurations are initially in a state of hydrostatic equilibrium and then gradually begin to collapse until the formation of an event horizon. In the case of unstable anisotropic neutron stars with SLy EoS and anisotropic model proposed by Bowers and Liang (32), for an initial central mass density \(\rho _c = 2.6 \times 10^{18}\ \mathrm{{kg}}/\mathrm{{m}}^3\) and anisotropy parameter \(\beta _{\mathrm{BL}} = 0.2\), we solve Eq. (57) with final conditions \(f = 0.150\) and \(df/dt = -8.613 \times 10^3\ \mathrm {s}^{-1}\) at time \(t =t_{bh} = -1.723 \times 10^{-5}\ \mathrm {s}\). For this particular configuration, the tangential pressure dominates the radial pressure and \(\omega _0^2 = -13.001\times 10^6 \ \mathrm s^{-2}\). Then we perform a time displacement so that this unstable star evolves from the initial instant \(t = 0\) (when the interior structure is governed by the background equations and the external solution is Schwarzschild-type) until the moment of horizon formation \(t_{bh} = 1.981\ \mathrm{{ms}}\), that is, when the star has collapsed and the mass of the resulting black hole is \(m_{bh} = 1.335\ M_\odot \).

The energy density (62) and radial pressure (63) as functions of the radial coordinate at different times are displayed in the upper and lower panels of Fig. 5, respectively. Both thermodynamic quantities present their maximum values at the stellar center and change significantly in the last moments of the collapse, while near the surface the changes are relatively small. Unlike the static case, the radial pressure at the surface is no longer zero during the dynamical evolution of the gravitational collapse because there exist a radial heat flux according to Eq. (56). As a result, we can investigate how the EoS behaves as the star collapses. The upper panel of Fig. 6 reveals that the EoS for the radial pressure undergoes sudden changes during the collapse of an unstable neutron star, where the maximum and minimum values in each curve correspond to the center and the surface of the star, respectively.

In the lower panel of Fig. 6 we plot the radial heat flux (65), which undergoes great alterations in the intermediate regions of the collapsing configuration and its value is not zero on the surface. Indeed, when the heat flux vanishes, the radial pressure also vanishes on the surface and the exterior solution is the Schwarzschild vacuum solution. According to the upper panel of Fig. 7, the degree of anisotropy in the pressures increases as the star collapses and it always vanishes at the origin as well as at the surface for any instant of time. The radial profile of the mass function (46) is displayed in the intermediate panel of the same figure, indicating that it decreases during the gravitational collapse due to the emission of particles into outer spacetime. On the stellar surface and at the moment of event horizon formation, we have \(m(t_{bh}, R) = 1.335\ M_\odot \) which precisely coincides with the value obtained by means of the junction condition (61). The masses corresponding to the black hole formed by the gravitational collapse of anisotropic neutron stars for some central density values are shown in Tables 3 and 4 of Appendix B.

In the lower panel of Fig. 7 we illustrate the radial behaviour of the expansion scalar (67) during the collapse process. For any instant of time, it can be seen that \(\varTheta < 0\) and \(\partial \varTheta /\partial r > 0\), which means that the stellar system is collapsing. In addition, it is clear that \(\varTheta \rightarrow 0\) as \(t \rightarrow 0\).

At long last, the collapsing anisotropic neutron star with initial central mass density \(\rho _c = 2.6 \times 10^{18}\ \mathrm {kg}/\mathrm {m}^3\), SLy EoS for radial pressure and anisotropy parameter \(\beta _{\mathrm{BL}} = 0.2\), is physically reasonable because it obeys the energy conditions in the full extent of the star and throughout the collapse process. It is worth emphasizing that we have tested this procedure for the other anisotropy ansatze (30), (34) and (36), obtaining a similar behaviour during the dynamical evolution of the collapse.

5 Conclusions

In this paper, we have constructed families of anisotropic neutron stars for an EoS compatible with the recent observation of the event GW170817 and for four different anisotropy ansatze, aiming to settle bounds on the maximum masses reachable in this kind of anisotropic models. We have carried out an analysis of adiabatic radial pulsations for such stars in order to study their radial stability against gravitational collapse. We have also developed a dynamical model that describes the non-adiabatic gravitational collapse of the unstable anisotropic configurations, and TOV equations have been generalized within this context. To summarize, the main conclusions of this work are:

  1. 1.

    For the SLy EoS in the radial pressure, we have constrained the anisotropy parameters provided in the literature in order to satisfy the recent restriction of the maximum mass of neutron stars based on gravitational wave observations. Our results thus suggest that \(\beta _{\mathrm{H}} \lesssim 0.40\), \(\beta _{\mathrm{BL}} \lesssim 0.23\), \(\beta _{\mathrm{HB}} \gtrsim -0.042\), and \(\beta _{\mathrm{R}} \gtrsim -4.6 \times 10^{11}\ \mathrm{m}^3\). However, we must point out that these bounds can be slightly altered for other EoSs.

  2. 2.

    Anisotropy affects the stellar stability and the critical central density (where \(dM/d\rho _c =0\)) does not always correspond to the onset of instability. In particular, the maximum point on the \(M(\rho _c)\) curve does not indicate the onset of instability for the anisotropic models proposed by Bowers–Liang [14] and Herrera–Barreto [18]. Nevertheless, we remark that this criterion is compatible with the calculation of the oscillation frequencies in the case of the ansatze suggested by Horvat et al. [17] and Raposo et al. [90].

  3. 3.

    Given an initial value of central mass density and a specific anisotropy ansatz for an unstable anisotropic neutron star, we have investigated the evolution of the EoS for radial pressure and anisotropy ansatz as the star undergoes a non-adiabatic gravitational collapse. The sudden changes in all relevant physical quantities occur near the formation of the event horizon as a consequence of a radial heat flow.