1 Introduction

Einstein’s general theory of relativity (GR) is currently the most acceptable theory for describing gravitational phenomena [1]. It has successfully explained and given accurate calculations of the deflection of light which passes near massive bodies, and the more complex motions of objects in strong gravitational fields. The detection of gravitational waves, and additional outcome of GR, has also been confirmed and is now actively studied. Compact objects such as neutron stars are ideal systems for the application of general relativity. The field equations obtained relate the metric functions, sometimes labelled gravitational potentials, to the matter content which is also to be determined to some extent depending on the method of closure. It is common to choose a well established potential, such as that of Vaidya and Tikekar [2], and then solve for the remaining metric function in the case of a line element involving two metric functions. Inherent in proceeding with the solution process, an equation of state is often used [3,4,5] or some other constraint on the matter variables, such as pressure isotropy [6]. Constraints can also be imposed on the spacetime geometry, such as the Karmarkar condition which constrains the Riemann tensor to allow for embedding into a five-dimensional flat metric [7, 8].

The complexity factor as proposed by Herrera [9] offers itself as an additional means of constraining the matter content, perhaps an alternative route to imposing an equation of state. Moreover, the complexity factor may be considered for both static and dynamical systems [9, 10]. It has thus become significant in modelling relativistic, self-gravitating systems such as massive, compact objects. In the complexity factor formalism, an additional relationship is established, connecting the principal quantities obtained from the energy momentum tensor, namely, the energy density, the pressures, shear stresses and the heat flux in the case of dynamical, dissipative collapse. A definition of complexity based on these bulk properties is quite different from the original definition, based on information content and disequilibrium approached from a statistical analysis [11, 12] which has also been applied to compact stars [13, 14]. For astrophysical systems, the more recent definition for the complexity factor arose from the orthogonal splitting of the Riemann tensor and an analysis of the five structure scalars which emerged. Initially studied by Bel [15] and then followed up by Gómez-Lobo [16] and Herrera et al. [17], structure scalars were obtained which could be used to develop a new notion of complexity. In the case of static systems, the complexity factor is in essence an interplay between the pressure anisotropy and the energy density inhomogeneity.

The concept of complexity within the context of relativistic, compact stellar objects has thus been of much interest and has expanded the methods for obtaining physically viable interior solutions for self-gravitating, relativistic stars [18, 19]. The complexity factor formalism was initially only investigated from a mathematical perspective. However the benefits of using the current definition are seen when it is used as an additional condition for closing the system of structure equations required for hydrostatic equilibrium. The case of vanishing complexity factor is somewhat of an ideal situation however it allows for the removal of other constraints such as pressure isotropy and imposing of an equation of state [20]. In particular, the complexity factor may be used as a self-consistent way to introduce anisotropy. The success of applying the vanishing complexity condition has been shown in recent studies, even for systems to which modified and higher order gravity theory has been applied [21,22,23].

In this work we obtain solutions for relativistic stars which are described by Vaidya–Tikekar (V–T) geometry [2]. The V–T potential is well-suited to the study of superdense compact objects [24,25,26,27,28]. The matter distribution is considered to be anisotropic and the complexity factor formalism is used to obtain the complementary metric function. A model is generated and applied to the well-studied ultra-compact binary \(4U 1820-30\) which has a short orbital period of about 11 min [29, 30]. The neutron star component has a well-determined mass and radius, typical of those expected for neutron stars. The model generated is shown to be stable, satisfying the energy conditions and physically reasonable it terms of the calculated quantities which may be compared with other models for such a system.

The paper is organized as follows: In Sect. 2, the Einstein equations corresponding to the spherically symmetric anisotropic matter distribution have been laid down. In Sect. 3, the vanishing of complexity factor has been used to generate the new exact solutions to construct a stellar model. The Sect. 4, deals with the necessary physical requirements for a realistic star to validate the model. In Sect. 5, the matching of the interior with the exterior Schwarzschild metric provided to meet the physical requirement for constructing realistic star and to fix the model parameters. In Sect. 6, using the current data available for the pulsar \(4U 1820-30\), has been used to analyze the physical features of the model. Section 7 is dedicated to analyzing the stability of the model under different required conditions. Finally, in Sect. 8, some concluding remarks have been given by highlighting some main results.

2 The field equations

The interior spacetime of a spherically symmetric compact object in the system of coordinates (\(x^0 = t\), \(x^1=r\), \(x^2 = \theta \), \(x^3 = \phi \)) is given by the line element

$$\begin{aligned} ds^2 = e^{\nu (r)}dt^2 - e^{\lambda (r)}dr^2 - r^2(d\theta ^2 + \sin ^2{\theta }d\phi ^2), \end{aligned}$$
(1)

where \(e^{\nu (r)}\) and \(e^{\lambda (r)}\) are the gravitational potentials to be determined.

The matter distribution of the stellar interior is assumed to be anisotropic with respect to pressure, so that the energy-momentum tensor takes the form

$$\begin{aligned} T_{\alpha \beta } = (\rho + p_t)u_{i} u_{j} + p_{t} g_{i j} + (p_r - p_t)\chi _{i} \chi _{j}, \end{aligned}$$
(2)

where \(\rho \) denotes the energy-density, and \(p_r\) and \(p_t\) are the fluid pressures along the radial and transverse directions respectively. The four-vectors involved are the four-velocity, \(u^i\), and a unit space-like vector, \(\chi ^i\), along the radial direction such that \(u^i u_i = -1\), \(\chi ^i \chi _j =1\) and \(u^i\chi _j=0 \).

The Einstein field equations for the line element (1) (in the system of units where \(G =1\) and \(c=1\)), are

$$\begin{aligned} 8\pi \rho= & {} \frac{\left( 1 - e^{-\lambda }\right) }{r^2} + \frac{\lambda ^{\prime }e^{-\lambda }}{r}, \, \end{aligned}$$
(3)
$$\begin{aligned} 8\pi p_r= & {} \frac{\nu ^{\prime }e^{-\lambda }}{r} - \frac{\left( 1 - e^{-\lambda }\right) }{r^2},\, \end{aligned}$$
(4)
$$\begin{aligned} 8\pi p_t= & {} \frac{e^{-\lambda }}{4}\left( 2\nu ^{\prime \prime } + {\nu ^{\prime }}^2 - \nu ^{\prime }\lambda ^{\prime } + \frac{2\nu ^\prime }{r} - \frac{2\lambda ^\prime }{r}\right) , \end{aligned}$$
(5)

where primes \((')\) denote differentiation with respect to the radial coordinate r.

The pressure anisotropy \((p_t - p_r)\) of the stellar fluid is then

$$\begin{aligned} 8\pi \varDelta (r)= & {} \frac{e^{-\lambda }}{4} \bigg (2\nu ^{\prime \prime } + {\nu ^{\prime }}^2 - \nu ^{\prime }\lambda ^{\prime } - \frac{2}{r}(\nu '+\lambda ') \nonumber \\{} & {} + \frac{4}{r^2}(e^{\lambda }-1)\bigg ). \nonumber \\ \end{aligned}$$
(6)

Our system is thus described by four Eqs. (3)–(6) in which the potentials, \(e^{\lambda }\) and \(e^{\nu }\), determine \(\rho \), \(p_r\), \(p_t\) and \(\varDelta \). By imposing the condition of vanishing complexity factor, we solve for the potential \(e^{\nu }\) which then completes the description of the model. Another popular way of solving for an unknown potential is via an equation of state (EoS) however the EoS chosen must then be well-motivated [4, 28]. More sophisticated EoSs might only provide approximate solutions via numerical methods due to computational limitations [31].

3 Generating a new model via vanishing complexity

We make use of the Vaidya–Tikekar (V–T) ansatz [2] for the metric potential \(g_{rr}\), which is suitable for describing the geometry within superdense compact matter. The V–T potential is given by

$$\begin{aligned} e^{\lambda (r)} = \frac{1 - K(r^2/L^2)}{1 - (r^2/L^2)}, \end{aligned}$$
(7)

where K is the dimensionless spheroidal geometric parameter and measures the departure from radial spherical symmetry. L is a curvature parameter of dimension length. Thus the V–T ansatz has a specific geometric interpretation in that it describes a spheroidal geometry for the t = constant hyper-surface characterized by the parameters L and K. The V–T metric will represent spherically symmetric spacetime which is well-behaved and non-singular at the origin for \(r < L\) and \(K < 1\). This spheroidal 3-space geometry represents flat 3-space for \(K=1\), while for \(K = 0\) it reduces to the spherical Schwarzschild interior metric. Previously, the V–T ansatz was utilized widely in developing realistic models of compact stars [24, 25, 32]. In this work, the V–T potential has been utilized to generate a new class of solution that could describe relativistic anisotropic compact stellar objects in which the complexity factor vanishes.

In accordance with Herrera [9], the complexity factor for a static configuration is defined as

$$\begin{aligned} Y_{TF}= \pi (p_r-p_t) - \frac{4 \pi }{2 r^3} \int _0^r x^3 \rho '(x) dx. \end{aligned}$$
(8)

By substituting values of \(p_r\), \(p_t\) and \(\rho \) into the above equation, we obtain

$$\begin{aligned} Y_{TF} = \frac{\nu '[r(\lambda '-\nu ')+2]-2 r \nu ''}{4 r}e^{\lambda }, \end{aligned}$$
(9)

and vanishing complexity then requires that

$$\begin{aligned} \nu '[r(\lambda '-\nu ')+2]-2 r \nu ''=0. \end{aligned}$$
(10)

Integration yields an expression for the remaining metric function \(\nu \), given as

$$\begin{aligned} e^{\nu /2}= A_1 \int r e^{\lambda /2} dr + B_1, \end{aligned}$$
(11)

where \(A_1\) and \(B_1\) are constants to be determined from the junction conditions. Applying the V–T potential (7) we then obtain,

$$\begin{aligned} e^{\nu /2}= & {} -\frac{1}{2} \omega _1 \bigg (\sqrt{\left( L^2-r^2\right) \left( L^2 - K r^2\right) } \nonumber \\{} & {} -\frac{(K-1)}{\sqrt{-K}} L^2 \sin ^{-1}\left( \sqrt{\frac{K \left( L^2-r^2\right) }{(K-1) L^2}}\right) \bigg ) + \omega _2,\nonumber \\ \end{aligned}$$
(12)

where \(\omega _1\) and \(\omega _2\) are constants in terms of \(A_1\) and \(B_1\). The matter quantities are then

$$\begin{aligned} 8\pi \rho= & {} \frac{(1 - K)(3L^2 - K r^2)}{(L^2 - K r^2)^2}, \end{aligned}$$
(13)
$$\begin{aligned} {8\pi p_r}&= \frac{(K-5) \sqrt{\left( L^2-r^2\right) \left( L^2-K r^2\right) } - \frac{(K-1)^2}{\sqrt{-K}}L^2 \sin ^{-1}\left( \sqrt{\frac{K \left( L^2-r^2\right) }{(K-1)L^2}}\right) - 2 (K - 1) \frac{\omega _2}{\omega _1}}{ \left( L^2-K r^2\right) \bigg (\sqrt{\left( L^2-r^2\right) \left( L^2-K r^2\right) } - \frac{(K-1)}{\sqrt{-K}} L^2 \sin ^{-1}\left( \sqrt{\frac{K \left( L^2-r^2\right) }{(K-1)L^2}}\right) - 2 \frac{\omega _2}{\omega _1}\bigg )}, \end{aligned}$$
(14)
$$\begin{aligned} {8\pi p_t}&= \frac{\left( (K-5) L^2+4 K r^2\right) \sqrt{ \left( L^2-r^2\right) \left( L^2-K r^2\right) } - \frac{(K-1)^2}{\sqrt{-K}}L^4 \sin ^{-1}\left( \sqrt{\frac{K \left( L^2-r^2\right) }{(K-1)L^2}}\right) - 2 L^2 (K - 1) \frac{\omega _2}{\omega _1}}{\left( L^2-K r^2\right) ^2 \bigg (\sqrt{\left( L^2-r^2\right) \left( L^2-K r^2\right) } - \frac{(K-1)}{\sqrt{-K}} L^2 \sin ^{-1}\left( \sqrt{\frac{K \left( L^2-r^2\right) }{(K-1)L^2}}\right) - 2 \frac{\omega _2}{\omega _1}\bigg )}. \end{aligned}$$
(15)

and the pressure anisotropy, defined as \(\varDelta = p_t - p_r \), is given by

$$\begin{aligned} 8\pi \varDelta = \frac{(K - 1) K r^2}{(L^2 - K r^2)^2}. \end{aligned}$$
(16)

The mass contained within a sphere of radius r is calculated as

$$\begin{aligned} m(r) = \int _0^r 4\pi q^2 \rho (q) dq = \frac{(K - 1)r^3}{2(K r^2 - L^2)}. \end{aligned}$$
(17)

4 Physical requirements

The following constraints are relevant in developing models for compact stellar objects:

  • The metric should be non-singular and regular (finite and positive) throughout the stellar interior. Also, at the centre it is required that \(e^{-\lambda (0)} = 1\) and \(e^{\nu (0)}\) = constant.

  • At the boundary surface of the star, the interior geometry should match continuously to the exterior Schwarzschild spacetime metric. Additionally, the radial pressure must vanish at the boundary however there is no restriction on the energy density and the tangential pressure.

  • The density, and radial and tangential pressures should be non-negative inside the star: \(\rho> 0,~ p_r> 0,~ p_t > 0 ;\) Also at the centre they should be finite with the radial and transverse pressures at the centre being equal. In general, the tangential pressure remains larger than the radial pressure for an anisotropic stellar configuration.

  • The gradients of the density, radial pressure and tangential pressure are all zero at the centre and negative at all other points of the interior. These ensure the monotonically decreasing nature of the physical quantities from their maximum values at the centre. Mathematically, \(\rho ' \le 0,~ p_r' \le 0,~ p_t' \le 0\);

  • The various energy conditions must be satisfied at each point of the interior of the star. In general relativity, the energy conditions represent certain inequalities between the energy density and the pressures, namely the weak energy condition (WEC), null energy condition (NEC), strong energy condition (SEC) and dominant energy condition (DEC). Their definitions are:

    1. (1)

      Weak energy condition (WEC): \(\rho > 0\)\(p_r + \rho \ge 0\)\(p_t + \rho \ge 0\),

    2. (2)

      Null energy condition (NEC): \(p_r + \rho \ge 0\)\(\rho +p_t \ge 0\),

    3. (3)

      Strong energy condition (SEC): \(\rho + p_r + 2 p_t \ge 0\),

    4. (4)

      Dominant energy conditions (DEC): \(\rho - |p_r| \ge 0\) and \(\rho -|p_t|\ge 0\), One can note that since for a realistic star the energy density (\(\rho \)) and pressures (\(p_r\)\(p_t\)) are positive, energy conditions (1), (2) and (3) are always satisfied. Also for an energy density greater than the pressures in the interior points, condition (4) is satisfied. Thus all of the energy conditions are obeyed. On the other hand, one needs to check the trace energy condition (TEC) [33, 34], given by \(\rho -p_r -2 p_t \ge 0\).

  • The radial and tangential sound speeds should not exceed the speed of light. This is referred as the causality condition (\(c=1\) in our system of units): \( 0 \le \frac{dp_r}{d\rho } \le 1 , 0 \le \frac{dp_t}{d\rho } \le 1 ;\) This constraint ensures causality of the speed of sound within the object.

5 Matching conditions

It is necessary to match the interior solution obtained to the Schwarzschild exterior metric,

$$\begin{aligned} ds^2= & {} \left( 1 - \frac{2M}{r}\right) dt^2 - \frac{dr^2}{\left( 1 - \frac{2M}{r} \right) } \nonumber \\{} & {} + r^2 \left( d\theta ^2 + \sin ^2 \theta d\phi ^2\right) , \end{aligned}$$
(18)

at the boundary \(r = b\) with \(M = m(b)\). Thus,

$$\begin{aligned} e^{\nu (b)}= & {} \left( 1 - \frac{2M}{b}\right) \end{aligned}$$
(19)
$$\begin{aligned} e^{\lambda (b)}= & {} \left( 1 - \frac{2M}{b}\right) ^{-1}. \end{aligned}$$
(20)

Together with the condition that the radial pressure vanishes at the surface (\(p_r(b) = 0\)) we may obtain the following expressions,

$$\begin{aligned} L= & {} b \sqrt{K + \frac{b(1 - K)}{2M}} \end{aligned}$$
(21)
$$\begin{aligned} \omega _1= & {} \frac{M}{b^3} \end{aligned}$$
(22)
$$\begin{aligned} \omega _2= & {} \frac{1}{4b}\bigg [(5-K) \sqrt{b (b-2 M)} + (b (1-K)+2 K M)\nonumber \\{} & {} \times \frac{(1-K)}{\sqrt{-K}} \sin ^{-1}\left( \sqrt{\frac{2M - b}{2M - b (1 - 1/K)}}\right) \bigg ]. \end{aligned}$$
(23)

6 Application of the physical requirements to modelling compact stellar objects

In order to demonstrate the viability of our model, we consider the pulsar \(4U 1820-30\) with an estimated mass of \(M = 1.58M_\odot \) and radius \(b = 9.1~km\) [30, 35, 36]. Using these values with the spheroidal parameter set at \(K = -1\), the remaining model parameters are determined using the junction conditions. We obtain: \(\{L = 15.50~km ; \omega _1 = 0.003096 ; \omega _2 = 1.500\} \). Reverting to S.I. units, physical quantities from the energy-momentum tensor are calculated and represented graphically. These are then compared with observed data and results from other models.

In Fig. 1, the regularity and non-singular nature of the metric potentials, in addition to smooth matching at the surface boundary, have been shown.

Fig. 1
figure 1

Metric functions with exterior matching

Fig. 2
figure 2

Energy density profile

Figure 2, 3, 4 shows the nature of the energy density and pressures along the radial and transverse directions respectively. All of the physical quantities decrease monotonically from their maximum value at the center as expected. At a particular distance the radial pressure vanishes thus defining the boundary of the star. The energy density and transverse pressure are however non-vanishing at the bounding surface.

Fig. 3
figure 3

Radial pressure profile

Fig. 4
figure 4

Tangential pressure profile

Variation of anisotropy along the radial direction has been depicted in Fig. 5 and is zero at the center as expected.

Fig. 5
figure 5

Anisotropic pressure profiles

The monotonically increasing mass function is shown in Fig. 6 with regularity at the centre \(m(0)=0\).

Even though we have not assumed any particular EoS in developing the model, we are still able to infer information about the dependence of the pressure with respect to the energy density. The nature of the EoS of the matter distribution has been shown to obey a linear relationship in Fig. 7.

All the energy conditions (WECSECDECNEC and TEC) stated in Sect. (4) are satisfied, supporting the physical viability of the model. This is shown graphically in Fig. 8.

For a fixed surface density of magnitude \(4.0\times 10^{14} gm-cm^{-3}\) the mass–radius (MR) relationship has been generated as shown in Fig. 9. A few well-known pulsars have been included, namely SAX J\(1748.9-2021\) (M = \(1.81^{+0.25}_{-0.37} M_\odot \); b = \(11.7 \pm 1.7\) km), 4U\(1820-30\) (M = \(1.46 \pm 0.21 M_\odot \); b = \(11.1 \pm 1.8\) km), Vela X-1 (M = \(1.77 \pm 0.08 M_\odot \); b = 10.654 km), Her X - 1 (M = \(0.85 \pm 0.15 M_\odot \); b = 8.1 km), GW\(170817-1\) (M = \(1.45 M_\odot \); b = 11.9 km) and the secondary component of GW190814 (\(2.59_{-0.09}^{+0.08}M_{\odot }\)).

7 Stability analysis

We shall discuss the stability of a star based on the following criteria:

  • Adiabatic index: The adiabatic index \(\varGamma \), or ratio of the specific heat capacities, is an important measure of the stability of an anisotropic stellar configuration. It is given by

    $$\begin{aligned} \varGamma =\frac{\rho +p}{p}\frac{dp}{d\rho }. \end{aligned}$$
    (24)

    To ensure stability of a relativistic sphere, the adiabatic index should be greater than 4/3 [37, 38]. In our model, this condition is met as shown in Fig. 10.

  • Causality condition: Another test of stability concerns the radial and tangential speeds of sound, given by

    $$\begin{aligned} v_r^2 = \frac{dp_r}{d\rho } ; ~~ v_t^2 = \frac{dp_t}{d\rho }. \end{aligned}$$

    with the full expressions for our model given in appendix A. These are plotted in Fig. 11. As can be seen, causality is maintained \((\frac{dp_r}{d\rho }, ~\frac{dp_t}{d\rho } < 1)\).

  • Cracking: Stability with respect to cracking is another important criterion. The idea of cracking was introduced by Herrera [39] by considering the outcome of a perturbation on an equilibrium configuration with respect to radial forces. Later, Abreu et al. [40] found a simple upper bound on the difference between tangential and radial sound speeds that promotes stability within a star. It was determined that \((v_t^2-v_r^2 < 1)\) promotes stability whereas \((v_t^2-v_r^2 > 1)\) was unstable. Figure  12 shows that the sound speed stability factor is favourably negative.

  • Tolman–Oppenheimer–Volkoff (TOV) stability condition: The stability of a star is described in terms of the well-known Tolman–Oppenheimer–Volkoff equation. For static equilibrium, a star maintains its stability by the balance of gravitational, hydrostatic and anisotropic forces. The TOV equation is given by,

    $$\begin{aligned} -\frac{\nu '}{2}(\rho +P_r)-\frac{dP_r}{dr}+\frac{2}{r}(P_t-P_r)=0. \end{aligned}$$
    (25)

    The above Eq. (25) can be written as

    $$\begin{aligned} F_g(r)+F_h(r)+F_a(r)=0, \end{aligned}$$
    (26)

    where \(F_g(r) =-\frac{\nu '}{2}(\rho +p_r)\) is the gravitation force, \(F_h(r) = -\frac{dp_r}{dr}\) the hydrostatic force and \(F_a(r) = 2(p_t-p_r) / r\) the force due to pressure anisotropy. The force components and their sum are represented graphically in Fig. 13. As shown, the configuration is in static equilibrium with the hydrostatic and anisotropic forces together balancing the force due to gravity.

  • HZN condition: According to the Harrison–Zeldovich–Novikov (HZN) stability condition [41, 42], a stable stellar configuration requires that \(dM (\rho _0) /d\rho _0 > 0\) where M, \(\rho _0\) denotes the mass and central density of the compact star. In our V–T complexity vanishing model,

    $$\begin{aligned} \frac{\partial M}{\partial \rho _0}= \frac{3 (K-1)^2 b^3}{2 (3-3 K+K b^2 \rho _0)^2}. \end{aligned}$$
    (27)

    This has been depicted graphically in Fig. 14 and stability in terms of this condition is supported.

Fig. 6
figure 6

Mass profile

Fig. 7
figure 7

Equation of state

Fig. 8
figure 8

Energy conditions

Fig. 9
figure 9

Mass–radius (M–b) relationship

Fig. 10
figure 10

Adiabatic index

Fig. 11
figure 11

Radial and tangential sound speeds squared

Fig. 12
figure 12

Sound speed stability factor

Fig. 13
figure 13

Forces due to gravity, pressure gradient and pressure anisotropy

Fig. 14
figure 14

Variation of \(dM/d\rho _c\) vs central density \(\rho _c\)

8 Conclusion

In this research exposition we sought an exact solution of the classical Einstein field equations describing a compact stellar object in which the radial and transverse pressures are different at each interior point. In order to obtain the full gravitational behaviour of the interior spacetime, we imposed the condition of vanishing complexity, which in our framework requires that the pressure anisotropy should be supported in magnitude by the energy density inhomogeneity. The vanishing of the complexity factor reduced the problem to a quadrature relating the two interior gravitational potentials. We employed the Vaidya-Tikekar ansatz, suitable for superdense, relativistic compact objects, to complete the gravitational behaviour of the model. We demonstrated that our stellar model has many salient features including regularity of the metric functions and associated physical quantities. The contour plots in Figs. 25 reinforce the regularity of the density, radial and tangential pressures, and the pressure anisotropy throughout the stellar interior. In Fig. 5b we observe that the anisotropy factor is everywhere positive, indicative of a repulsive force due to anisotropy. This repulsive contribution due to pressure anisotropy helps stabilize the stellar configuration against the inwardly driven gravitational force. The study of the (MR) curves revealed the robustness of our model which successfully accounted for the mass-radii characteristics of some well-known pulsars viz., SAX J\(1748.9-2021\), 4U\(1820-30\), Vela X-1 and Her X - 1. In addition, our model predicted low-mass stars as well as compact objects with masses beyond \(2 M_\odot \) which may be progenitors in binary mergers responsible for gravitational events. This is encouraging within standard classical general relativity without having to appeal to exotic matter such as dark matter and dark energy as well as modified gravity theories.