1 Introduction

The study of (2+1) dimensional gravity has become a subject of considerable interest. Newtonian theory can not be obtained as a limit of Einstein’s theory in (2+1) dimensional spacetime. In this case gravity is localized that means there is no propagation of gravity outside the sources. Also, it is argued that (2+1) dimensional gravity provides some new features towards a better understanding of the physically relevant (3+1) dimensional gravity [18]. Most of the studies on this respect are black hole spacetimes, star or cosmological models [9, 10]. However, in recent years various studies have been done. Rahaman et al. [11] have proposed a new model of a gravastar in (2+1) anti-de Sitter space-time. They have also generalized their earlier work on gravastar in (2 + 1) dimensional anti-de Sitter space-time to (2+1) dimensional solution of charged gravastar [12]. Some authors [1317] have also discussed wormhole solutions in (2+1) dimensional spacetime.

In recent past, Krori and Barua (KB) [18] constructed static, spherically symmetric solutions based on a particular choice of the metric components g 00 and g 11 in curvature coordinates. Recently, KB’s approach was adopted by various authors for constructing star models [1924]. These studies are confined within (3+1) dimensional spacetimes. Therefore, it will be interesting to search whether nonsingular solutions of KB type will be existed in (2+1) dimensional fluid sphere. We are looking forward to get some extra features as our (2+1) dimensional models include an additional parameter, cosmological constant. In 1999, Lubo et al. [24] has discussed regular (2+1) spherically symmetric solutions, however, there approach were different. Anisotropy was used in the compact star configuration to allow some interesting studies and we mention some papers that yield meaningful results [2528].

In this investigation, we explore the possibility of applying the Krori-Barua [18] metric to describe the interior spacetime of a star in (2+1) dimension. Nowadays, it is known that the dark energy represents 73 % of the whole mass-energy of our Universe. This conclusion is given by the Wilkinson Microwave Anisotropy Probe (WMAP) that also indicates that the dark-energy is causing a speeding of the expansion of the rate of the universe. The subject of compact stars is of actuality and under study in the last decades. One of the possibility for the formation of compact anisotropic stars is to use the cosmological constant. For this reason, we have considered cosmological constant in our model. We have discussed two models, one with constant Λ and the other with variable Λ.

The structure of our work is as follows: In Sect. 2, the non-singular model for anisotropic stars with constant Λ based on the Krori and Barua (KB) metric in (2+1) dimensions is developed. In Sect. 3, we have discussed some physical features of the model. In Sect. 4, we have presented the model with variable Λ. In Sect. 5, we have analyzed some physical properties of the model given in Sect. 4. Finally, in Sect. 6, we have made a conclusion about our work.

2 Non-singular model for anisotropic stars with constant Λ

Let us assume that the interior space-time of a star in (2+1) dimension is described by the KB metric

$$ ds^2=-e^{2\nu(r)}dt^2 + e^{2\mu(r)}dr^2 +r^2 d\theta^2 , $$
(1)

with 2μ(r)=Ar 2 and 2ν(r)=Br 2+C where A, B and C are arbitrary constants which will be determined on the ground of various physical requirements. The energy momentum tensor in the interior of the anisotropic star is assumed in the following standard form

$$T_{ij}=\operatorname {diag}(\rho,-p_r,-p_t), $$

where ρ, p r and p t correspond to the energy density, normal pressure and transverse pressure respectively.

Therefore, the Einstein field equations for the metric (1) with constant Λ can be written as (assuming natural units G=c=1)

(2)
(3)
(4)

Now, plugging the metric (1) in (2)–(4), we get the following expressions of energy density ρ, normal pressure p r , tangential pressure p t as

(5)
(6)
(7)

Using (5)–(7), the equations of state (EOS) parameters corresponding to radial and transverse directions are written as

(8)
(9)

3 Physical Analysis

In this section we will discuss the following features of our model:

3.1 Matching Conditions

The exterior (p=ρ=0) solution corresponds to a static, BTZ black hole is written in the following form as

$$ ds^{2}=- \bigl(-M_0 - \varLambda{r^2} \bigr)dt^2 + \bigl(-M_0 - \varLambda{r^2} \bigr)^{-1}dr^2 + r^2d\theta^2, $$
(10)

Here we match our interior metric to the exterior BTZ metric and as a consequence, we get

(11)
(12)
(13)

3.2 Regularity at the Centre

In this analysis, we consider anti-de Sitter space-time and to ensure that cosmological constant is always negative, we write Λ=−K 2. Since the radial EOS is always less than unity, therefore (8) at once indicates that the cosmological constant should be negative.

Now, we find the central density and central pressures (radial and transverse) as

(14)
(15)

From (5) and (6), we find

$$\frac{d\rho}{dr}= -\frac{A^2}{\pi}re^{-Ar^2} < 0, $$

and

$$\frac{d p_r}{dr}= -\frac{AB}{\pi}re^{-Ar^2} <0. $$

which gives a meaningful result that density and pressure are decreasing function of r. The above equations imply at r=0,

(16)

and

$$\frac{d^2 p_r}{dr^2} = -\frac{AB}{\pi}< 0. $$

which support maximality of central density and radial central pressure.

For our model, the measure of anisotropy, Δ=p t p r , is given by

$$ \varDelta = \frac{B(B-A)}{2\pi}r^2e^{-Ar^2}. $$
(17)

The anisotropy, as expected, vanishes at the center.

The energy density and the two pressures are continuous function of radial coordinate r that means they are well behaved in the interior of the stellar configuration. The radius of star is obtained by letting p r (r=R)=0 , which gives

$$ R=\sqrt{\frac{1}{A} \ln \biggl(\frac{B}{K^2} \biggr)}. $$
(18)

We have considered the data from a 3 spatial dimensional object in order to fix the constants of the model. Although it is not very clear the physical meaning by considering stellar objects of 2 spatial dimensions, however, if an observer is sitting in the plane, θ=constant, then he sees all characteristics as a (2+1) dimensional picture. So apparently, one can use all the data which are more or less the same for both spacetimes.

Therefore, we have used the data from X ray buster 4U 1820-30 to calculate the corresponding constants. It is known that the mass of X ray buster 4U 1820-30 is 2.25 M and radius 10 km. To understand the physical behavior of the solutions of our model, we have assumed certain values of Λ. As we considered the anti de-Sitter spacetime, we have used negative values, say, Λ=−0.035,−0.038,−0.04 (see [29, 30]).

Using the data from X ray buster 4U 1820-30, we have obtained the values of the constants A and B via (11) and (12) for different values of Λ in units of km−2 (see Table 1).

Table 1 Values of the constants A, B for X ray buster 4U 1820-30 for different values of Λ

Plugging in G and c in the relevant equations, we have calculated the central density ρ 0=9.49×1015 gm cm−3, surface density ρ R =9.23×1015 gm cm−3, central pressure p r (r=0)=p t (r=0)=3.28×1036 dyne cm−2 for Λ=−0.04.

We draw the figures for the density variation and pressures at the stellar interior of X ray buster 4U 1820-30 (see Figs. 1 and 2). Figure 3 indicates that Δ>0 i.e. the ‘anisotropy’ is directed outward. Thus our model exerts a repulsive ‘anisotropic’ force (Δ>0) which allows the construction of more massive distributions. In Fig. 2, one can note that transverse pressure is increasing towards the surface. These types of stars are composed of unknown matters whose density is above the normal nuclear density, ρ n ∼4.6×1014 gm cm−3. As a result, these highly compact stars are anisotropic in nature and peculiar phenomena may be happened there.

Fig. 1
figure 1

Density (along vertical axis) variation at the stellar interior of X ray buster 4U 1820-30 of mass 2.25 M and radius 10 km for different values of Λ

Fig. 2
figure 2

Radial and transverse pressures variation at the stellar interior X ray buster 4U 1820-30 of mass 2.25 M and radius 10 km for different values of Λ. Solid lines and chain lines indicate radial and transverse pressures respectively

Fig. 3
figure 3

The anisotropic behavior at the stellar interior X ray buster 4U 1820-30 of mass 2.25 M and radius 10 km for different values of Λ

3.3 TOV Equation

The generalized TOV equation for an anisotropic fluid distribution is given by

$$ \frac{d}{dr} \biggl(p_r -\frac{\varLambda}{2\pi} \biggr) + \nu^\prime (\rho +p_r ) + \frac{1}{r} (p_r - p_t ) = 0. $$
(19)

According to Ponce de León [31] suggestion, one can rewrite the above TOV equation as

(20)

where M G =M G (r) is the gravitational mass inside a sphere of radius r and is given by

$$ M_G(r)=r^2e^{\frac{\nu-\mu}{2}}\nu^{\prime}. $$
(21)

[This can be derived from the Tolman-Whittaker formula using Einstein field equations.]

This modified form of TOV equation delineates the equilibrium condition for the X ray buster 4U 1820-30 subject to the gravitational and hydrostatic plus another force due to the anisotropic nature of the stellar object. Now, we write the above equation as

$$ F_g+ F_h + F_a=0, $$
(22)

where

(23)
(24)
(25)

The profiles of F g , F h and F a for our chosen source are shown in Fig. 4. The figure provides the information about the static equilibrium due to the combined effect of pressure anisotropy, gravitational and hydrostatic forces.

Fig. 4
figure 4

Three different forces acting on fluid elements of X ray buster 4U 1820-30 of mass 2.25 M and radius 10 km in static equilibrium is shown against r with Λ=−0.04

3.4 Maximum Mass-Radius Relation

We calculate the mass m(r) within a radial distance r as

$$ m(r) = \int_0^r 2\pi \rho \tilde{r}d\tilde{r} = \frac{1}{2} \bigl[1+K^2 r^2- e^{-Ar^2} \bigr] . $$
(26)

In Fig. 5, we have plotted this mass to radius relation. One can note that the upper bound on the mass in our model can be written as

$$ 2m(r) \equiv 1+K^2 r^2- e^{-Ar^2} \leq 1+K^2r^2 -e^{-AR^2}, $$
(27)

which implies

$$ \biggl(\frac{m(r)}{r} \biggr)_{max} \equiv \frac{M}{R} \leq \frac{1+ K^2 R^2 -e^{-AR^2}}{2R}. $$
(28)

The plot \(\frac{m(r)}{r}\) against r (see Fig. 6) indicates that the ratio \(\frac{m(r)}{r}\) is an increasing function of the radial parameter. It is interesting to note that the constraint on the maximum allowed mass-radius ratio in our case falls within the limit to the (3+1) dimensional case of isotropic fluid sphere i.e., \((\frac{m(r)}{r} )_{max} = 0.216 < \frac{4}{9}\) (here we have used Λ=−0.04).

Fig. 5
figure 5

Variation of mass function at stellar interior for different values of Λ

Fig. 6
figure 6

Variation of \(\frac{m(r)}{r}\) is shown against r for different values of Λ

3.5 Compactness and Redshift

From the above mass function (26), we obtain the compactness of the star as

$$ u= \frac{ m(r)}{r}= \frac{1}{2r} \bigl( 1+K^2 r^2- e^{-Ar^2} \bigr), $$
(29)

and correspondingly the surface redshift (Z s ) is given by

$$ Z_s= ( 1-2 u)^{-\frac{1}{2}} - 1, $$
(30)

where

$$ Z_s= \biggl[ 1- \frac{1}{r} \bigl( 1+K^2 r^2- e^{-Ar^2} \bigr) \biggr]^{-\frac{1}{2}} - 1 . $$
(31)

Thus, the maximum surface redshift of our (2+1) dimensional star of radius 10 km can be found as Z s =0.328 (here we have used Λ=−0.04).

Figure 7 indicates the variation of redshift function Z s against r for different values of Λ.

Fig. 7
figure 7

The variation of redshift function Z s is shown against r for different values of Λ

4 Variable Λ

Now, we consider the model taking the cosmological constant as radial dependence i.e. Λ=Λ(r)=Λ r (say).

To get the physically acceptable stellar models, we assume that the radial pressure of the compact star is proportional to the matter density i.e.

$$ p_r = m\rho,\quad m>0, $$
(32)

where m is the equation of state parameter.

Now, using the above equation of state and (1)–(4), we get the energy density ρ, normal pressure p r , tangential pressure p t and cosmological parameter Λ r , respectively as

(33)
(34)
(35)
(36)

Also, the equation of state (EOS) parameters corresponding to normal and transverse directions can be written as

(37)
(38)

5 Physical Analysis

In this section we will discuss the following features of our model:

One can see from (33) and (34) that

$$\frac{d\rho}{dr}= - \biggl[\frac{A(A+B)}{\pi (m+1)}re^{-Ar^2} \biggr] < 0, $$

and

$$\frac{d p_r}{dr}= - \biggl[\frac{m(A+B)A}{\pi (m+1)}re^{-Ar^2} \biggr] < 0. $$

Also, at r=0, our model provides

and

$$\frac{d^2 p_r}{dr^2} = -\frac{mA(A+B)}{\pi (m+1)} < 0. $$

which indicate maximality of central density and central pressure.

The central density and radial central pressures are given by

(39)
(40)

It is obvious that the radial pressure vanishes at the surface i.e. at r=R, p r (r=R)=0 where R is the radius of the star. Equation (34) implies either m=0 or A=−B. But, A=−B implies ρ=0, which is not possible, therefore, we should take m=0. In other words, in (2+1) dimensional KB spacetime with variable Λ, only dust anisotropic model exists.

The measure of anisotropy, Δ=p t p r , in this model is obtained as

$$ \varDelta = \frac{B(B-A)}{2\pi}r^2e^{-Ar^2}. $$
(41)

At the center Δ=0 i.e. anisotropy dies out as expected.

We match the interior metric to the exterior BTZ matric and get fortunately the same values of constants A, B and C given in (11)–(13).

As before, we have considered X ray buster 4U 1820-30 and have chosen the values of the parameters A and B as A=0.003834 and B=0.05869 to obtain the central density and surface density which are given by ρ 0=1.36×1016 gm cm−3 and ρ R =9.234×1015 gm cm−3 respectively.

In this case the TOV equation is written as

$$ F_g+ F_h + F_a=0, $$
(42)

where

(43)

We note that here the variable Λ contributes to the hydrostatic force and transverse pressure provide the effect of pressure anisotropy.

The profiles of F g , F h and F a for our chosen source are shown in Fig. 8. The figure provides the information of the static equilibrium due to the combined effect of pressure anisotropy, gravitational and hydrostatic forces.

Fig. 8
figure 8

Three different forces acting on the fluid elements of X ray buster 4U 1820-30 of mass 2.25 M and radius 10 km in static equilibrium is shown against r

The effective mass m(r) within a radial distance r is defined as

$$m_{eff}(r) = \int_0^r 2\pi \biggl[ \rho + \frac{\varLambda_r }{2 \pi} \biggr] \tilde{r}d\tilde{r} $$

Hence, we get

$$ m_{eff}(r) = \frac{1}{2} \bigl[1 - e^{-Ar^2}\bigr] . $$
(44)

In Fig. 9, we plot this mass to radius relation. One can note that the upper bound on the mass in our model can be written as

$$ 2m_{eff}(r) \equiv 1- e^{-Ar^2} \leq 1 -e^{-AR^2}, $$
(45)

which implies

$$ \biggl(\frac{m_{eff}(r)}{r} \biggr)_{max} \equiv \frac{M_{eff}}{R} \leq \frac{1 -e^{-AR^2}}{2R}. $$
(46)

The plot \(\frac{m_{eff}(r)}{r}\) against r (see Fig. 10) indicates that the ratio \(\frac{m_{eff}(r)}{r}\) is an increasing function of the radial parameter. Again, we see that maximum allowed mass-radius ratio in our case falls within the limit to the (3+1) dimensional case of isotropic fluid sphere i.e., \((\frac{m_{eff}(r)}{r} )_{max} = 0.01598 < \frac{4}{9}\) (here we have used A=0.003834 and B=0.05869).

Fig. 9
figure 9

Variation of mass function against r at stellar interior

Fig. 10
figure 10

Variation of \(\frac{m_{eff}}{r}\) is shown against r at stellar interior

The compactness of the star is given as

$$ u= \frac{ m(r)}{r}= \frac{1}{2r} \bigl( 1 - e^{-Ar^2} \bigr), $$
(47)

and correspondingly the surface redshift (Z s ) is given by

$$ Z_s= ( 1-2 u)^{-\frac{1}{2}} - 1, $$
(48)

where

$$ Z_s= \biggl[ 1- \frac{1}{r} \bigl( 1- e^{-Ar^2} \bigr) \biggr]^{-\frac{1}{2}} - 1 . $$
(49)

Thus, the maximum surface redshift of our (2+1) dimensional star of radius 10 km can be found as Z s =0.0164 (here we have used A=0.003834 and B=0.05869). The Fig. 11 indicates the variation of redshift function Z s against r.

Fig. 11
figure 11

The variation of redshift function Z s is shown against r at stellar interior

6 Concluding Remarks

By taking the Krori and Barua metric as input and treating the matter content as anisotropic in nature, we have obtained some new types non-singular solutions for stars with constant Λ and variable Λ. In this phenomenological model, we have employed physical data of the X ray buster 4U 1820-30 in our models. It is found that the central density ρ 0=9.49×1015 gm cm−3 and surface density ρ R =9.23×1015 gm cm−3 for the first case which are beyond the normal nuclear density. For the later case, densities are more than the former one. The models are attainable in static equilibrium conditions due to the combined effect of pressure anisotropy, gravitational and hydrostatic forces. One can note that the maximum allowed mass-radius ratio in our cases falls within the limit to the (3+1) dimensional case of isotropic fluid sphere i.e., \((\frac{m_{eff}(r)}{r})_{max} < \frac{4}{9}\). We have seen that in (2+1) dimensional KB spacetime with variable Λ, only dust anisotropic model exists. This feature is absent in (3+1) dimension. Investigation on full collapsing model of a (2+1) dimensional star is beyond the scope of this analysis. We would like to perform this study in the future.