1 Introduction

The discovery of general theory of relativity (GTR) by Einstein in the year 1915 laid the foundation of relativistic astrophysics and served as a tool to study the properties of compact objects such as neutron stars (NS), strange stars (SS), black holes (BH) etc. Since then, strenuous efforts have been made to obtain singularity-free solution of Einstein’s field equations (EFE). In the context of GTR, Schwarzschild [1] obtained two exact solutions of EFE. The first solution describes the exterior space–time geometry of perfect fluid sphere in hydrostatic equilibrium whereas the second one is known as the interior Schwarzschild solution and is related to the interior geometry of a fluid sphere having homogeneous distribution of energy density. It is to be mentioned that a large number of exact solutions of EFE are known as of now but not all of them give physically relevant stellar model of compact objects. In [2, 3], a number of solutions are available corresponding to static, spherically symmetric matter distribution. Conventionally, one may obtain stellar models by integrating TOV equation [4], from the centre to the surface of the star where the radial pressure drops to zero, for a particular choice of equation of state (henceforth EOS) starting from a known value of central density/pressure. Alternatively, one may solve EFE to obtain stellar models considering suitable forms of metric potential. Due to inherent non-linearity in the field equations which are actually a set of second-order differential equations, a numerical procedure may be adopted to obtain their plausible solutions. Recent studies reveal that masses and radii of a large number of compact objects, namely X-ray pulsar Her X-1 [5], X-ray burster 4U 1820-30 [6], X-ray sources 4U 1728-34 [7], PSR 0943+10 [8], PSR 1937+21 [9] etc. are not in good agreement with the available standard neutron star models. Such objects have both mass and radius less than that of neutron stars but have greater compactification factors (ratio of mass to radius). The behaviour of matter due to its high density especially near the central region is not well known of such super-dense objects and hence no relevant information about the EOS is available which remains a major unsolved issue in astrophysics till date. Practically, the maximum allowed mass of any neutron star is EOS-dependent. A wide variety of neutron star masses (1.46–2.48)\(M_{\odot }\) where \(M_{\odot }\) is the solar mass expressed in km and radii (9–11.7) km have been predicted [10] based on different EOSs. It is pointed out in [11] that majority of the pulsars fall within a narrow mass range \((1.35 \pm 0.04)M_{\odot }\). NS mass, radii measurement and their implications on EOS have been addressed in [12, 13]. After the conjecture of Bodmer [14] and Witten [15] that strange quark matter may be the true ground state of hadrons, a new category of stars known as ‘strange stars’ has been hypothesised. Since then, different equations of states and their implications on the size of a compact star have come in the theory [16,17,18]. Lattimer and Prakash [19] studied the structure of neutron stars by obtaining analytic solutions of EFE and carefully constrained the EOS. To make the EFE tractable and to obtain physically viable model of superdense stars, Vaidya and Tikekar [20] presented an alternative approach in which the physical 3-space of the star is assumed to have the geometry of a three-spheroid. Vaidya and Tikekar [20] proposed an ansatz for the metric component \(g_{rr}\) characterised by two parameters, namely spheroidal parameter \(\lambda \) and geometrical parameter R in which \(\lambda \) is a free parameter and R is determined from boundary conditions. Several investigators have worked on the ansatz proposed by Vaidya and Tikekar to investigate some physical aspects of compact objects [21,22,23,24,25,26]. Knutsen [22] explained the stability criterion under small radial pulsation in Vaidya–Tikekar approach. It has been shown that this model has a scaling property [27]. In some articles, this model has been used to describe some properties of HER X-1 and SAX J 1808.4-3658 [28, 29]. An alternative ansatz was proposed by Tikekar and Jotania [30]. In their model, the physical 3-space of the star has the geometry of a 3 pseudospheroid immersed in a four-dimensional Euclidean space. Later, both these models were generalised in higher dimensions [31, 32]. It was suggested by Ruderman [33] and Canuto [34] that a pressure anisotropy may be developed inside a superdense star if the matter density exceeds that corresponds to nuclear matter regime. After the theoretical investigations of Bowers and Liang [35], many research works on anisotropic stars have been reported. Maharaj and Marteens [36] obtained an anisotropic model which admits uniform density of matter content. Later, a more realistic model was developed by Gokhroo and Mehra [37] having non-uniform density profile. Generally, in a compact object, anisotropy may arise due to pion condensation [38] or phase transition [39]. On the other hand, the presence of type-3A superfluid [40] or a solid stellar core also explains the possibility of anisotropic pressure inside a compact object. Anisotropic matter distribution with linear EOS can be seen in different articles [41, 42]. In this article, we have used modified Vaidya–Tikekar metric ansatz by introducing an extra parameter denoted by \(\kappa \) to obtain a general solution of EFE with anisotropic pressure and study some properties of compact objects for different values of \(\kappa \). Therefore, we have now two independent parameters \(\lambda \) and \(\kappa \) in hand and these two can be used to fix the EOS. We mainly focussed our analysis having the value of \(\kappa \) within the range \(-1\le \kappa \le 1\) including \(\kappa =0\). In this subclass solution, we note some interesting results.

The paper is organised as follows: in §2 Einstein field equations in the presence of anisotropic fluid and its solutions are presented. The physical requirements of a realistic anisotropic stellar model are given in §3. In §4 different matching conditions at the surface of a compact object are stated. The physical analysis of our model for different cases are studied in §5. In §6 mass–radius relation is discussed. Special emphasis is also given on maximum mass that can be sustained within a given radius. Physical applications of our model based on observed mass and radius data of some known compact objects are given in §7. In §8 stability of the model is discussed with the help of TOV equations, Herrera cracking condition and adiabatic index. In §9 equation of state is obtained for different set-up of model parameters. Finally, we conclude our work by discussing some of its remarkable features in §10.

2 Anisotropic stellar model

We consider the interior of a static spherically symmetric anisotropic star to be described by the following line element:

$$\begin{aligned} \mathrm {d}s^2= & {} -\,\mathrm {e}^{2\nu (r)}\mathrm {d}t^2 + \mathrm {e}^{2\mu (r)}\mathrm {d}r^2 \nonumber \\&+ r^2(\mathrm {d}\theta ^2+\sin ^2\theta \,\mathrm {d}\phi ^2). \end{aligned}$$
(1)

EFE is given by

$$\begin{aligned} \mathbf{R}_{ij} - \frac{1}{2}g_{ij}{} \mathbf{R} = \frac{8\pi G}{c^2} \mathbf{T}_{ij}. \end{aligned}$$
(2)

We take the energy–momentum tensor describing the anisotropic pressure in the most general form [31, 43]

$$\begin{aligned} \mathbf{T_{ij}}=\text{ diag }(\rho ,-p_{r},-p_{t},-p_{t}). \end{aligned}$$
(3)

Using eqs (2) and (3), the EFEs now take the form

$$\begin{aligned}&\frac{2\mu '\mathrm {e}^{-2\mu }}{r}+\frac{1-\mathrm {e}^{-2\mu }}{r^2}= \frac{8\pi G \rho }{c^2}, \end{aligned}$$
(4)
$$\begin{aligned}&\frac{2\nu '\mathrm {e}^{-2\mu }}{r}-\frac{1-\mathrm {e}^{-2\mu }}{r^2}= \frac{8\pi G p_{r}}{c^2}, \end{aligned}$$
(5)
$$\begin{aligned}&\mathrm {e}^{-2\mu }\left[ \nu ''+\nu '^2-\mu '\nu '-\frac{\mu '}{r}+\frac{\nu '}{r}\right] = \frac{8\pi G p_{t}}{c^2}, \end{aligned}$$
(6)

where \((')\) denotes differentiation with respect to the space coordinate r. We consider a modified Vaidya–Tikekar metric ansatz by introducing an extra parameter denoted by \(\kappa \) as given below.

$$\begin{aligned} \mathrm {e}^{2\mu }=\frac{1+\lambda r^2/R^2}{1+\kappa r^2/R^2}. \end{aligned}$$
(7)

The ansatz given by eq. (7) reduces to that of pseudo-spheroidal geometry for \(\kappa =1\), spheroidal geometry for \(\kappa =-1\) and for \(\kappa =\lambda \), the \(t=\mathrm{constant}\) hypersurface represents flat space–time. With this additional parameter \(\kappa \), our metric becomes identical with the metric used in the previous work of Komathiraj and Maharaj [44]. However, they obtained the solution in the form of infinite series in powers of radial coordinate. In our present work, we do not apply the series solution method but obtain a solution in closed form in the form of trigonometric functions which are shown to be regular. A similar form of the metric ansatz is also used by Komathiraj and Sharma [45] for relativistic charged star, by Nasheeha et al [46] for anisotropic generalisation of isotropic superdense star solutions, isotropic neutron star models by Thirukkanesh and Maharaj [47], Thirukkanesh and Ragel [48] and others [49,50,51,52,53]. Recently, Mafa Takisa et al [54] applied this particular form of the metric ansatz to study core envelope structure of compact relativistic star. However, we use here a different approach to obtain an analytical solution for a class of static anisotropic compact stellar object and show that a wider class of solutions to the EFE are possible by adapting this particular form of the metric potential. It is noteworthy that our metric ansatz admits some previously obtained solutions, e.g. (i) superdense star solution by Maharaj and Leach [23], (ii) Tikekar superdense star model [21] for \(\lambda =7\) and \(\kappa =-1,\) (iii) superdense stellar model developed by Vaidya and Tikekar [20] for \(\lambda =2\) and \(\kappa =-1\) and (iv) Durgapal and Bannerji model [55] for \(\lambda =1\) and \(\kappa =-1/2\). We take the difference between transverse pressure \((p_t)\) and radial pressure \((p_r)\) as a measure of the pressure anisotropy denoted by \(\Delta =p_{t}-p_{r}\) [23, 56,57,58,59] and using the transformation \(\mathrm {e}^{\nu }=\psi \) and \(x^2=1+\kappa ({r^2}/{R^2})\), we obtain the following second-order differential equation in \(\psi \):

$$\begin{aligned}&\bigg [1+\frac{\lambda }{\kappa }(x^2-1)\bigg ]\psi _{xx}-\frac{\lambda }{\kappa }x \psi _{x}+\frac{\lambda }{\kappa }\bigg (\frac{\lambda }{\kappa }-1\bigg )\psi \nonumber \\&\quad - 8\pi G R^2\frac{[1+\frac{\lambda }{\kappa }(x^2-1)]^2}{\kappa (x^2-1)} \Delta \psi = 0, \end{aligned}$$
(8)

where we have considered \(c=1\). Now using the transformation

$$\begin{aligned} z=\sqrt{\frac{\lambda /\kappa }{\lambda /\kappa -1}}x \end{aligned}$$

in the differential equation (8), we get the following form:

$$\begin{aligned} (1-z^2)\psi _{zz}+z\psi _{z}+\bigg [1-\frac{\lambda }{\kappa }(1-\alpha )\bigg ]\psi =0. \end{aligned}$$
(9)

Here we consider the expression of \(\Delta \) as

$$\begin{aligned} \Delta = \frac{\alpha \frac{\lambda ^2}{\kappa }(x^2-1)}{8 \pi G R^2[1+\frac{\lambda }{\kappa }(x^2-1)]^2}. \end{aligned}$$
(10)

This expression of \(\Delta \) is so chosen to ensure the regularity at the centre of the star and to obtain well-behaved relativistic solution similar to that obtained by previous investigators for the field eqs (4)–(6). In eq. (10) we note that \(\Delta \) vanishes at the centre as \(p_{r}=p_{t}\) at the centre. It is also evident from eq. (10) that for \(\kappa =1\) which corresponds to pseudospheroidal geometry, \(\Delta \) takes the form as mentioned in ref. [60] and \(\kappa =-1\) corresponds to spheroidal geometry, \(\Delta \) takes the form as used by Karmakar et al [61]. To obtain general solution of eq. (9), we consider the following cases:

Case I: \(\kappa <0\)

In this case, we rewrite eq. (9) in the form

$$\begin{aligned} (1-z^2)\psi _{zz}+z\psi _{z}+(\Omega +1)\psi =0, \end{aligned}$$
(11)

where we have taken \(\Omega =\frac{\lambda }{\gamma }(1-\alpha )\), \(\gamma =-\kappa \) and note that eq. (11) is similar to that obtained in refs [62, 63]. Now differentiating eq. (11) with respect to z, we get the following equation:

$$\begin{aligned} (1-z^2)\psi _{zzz}-z\psi _{zz}+(\Omega +2)\psi _{z}=0. \end{aligned}$$
(12)

We now introduce the parameter \(\phi =({\mathrm {d}\psi }/{\mathrm {d}z})\) so that eq. (12) reduces to the form

$$\begin{aligned} (1-z^2)\phi _{zz}-z\phi _{z}+(\Omega +2)\phi =0. \end{aligned}$$
(13)

Finally, considering the parametrisation \(z=\cos (\xi )\), the following solution is obtained:

$$\begin{aligned} \psi= & {} \frac{1}{n^2-1}\left[ a_{2}\left\{ n \sin (\xi )\cos (n\xi )-\cos (\xi ) \sin (n\xi )\right\} \right. \nonumber \\&\left. -a_{1}\left\{ n \sin (\xi )\sin (n\xi )+\cos (\xi )\cos (n\xi )\right\} \right] , \end{aligned}$$
(14)

where \(n=\sqrt{\Omega +2}\). Equation (14) can further be reduced to a simpler form if we take the substitution \(a_{2}=-2A \sin ~\theta \) and \(a_{1}=2A \cos ~\theta \). So the final solution of eq. (11) can be put in the form

$$\begin{aligned} \psi =A\left[ \frac{\cos [(n+1)\xi +\theta ]}{n+1}-\frac{\cos [(n-1)\xi +\theta ]}{n-1}\right] \quad \end{aligned}$$
(15)

which is similar to the solution obtained by Mukherjee et al [62].

Case II: \(\kappa >0\)

In this case, eq. (9) can be written in the form

$$\begin{aligned} (1-z^2)\psi _{zz}+z\psi _{z}+(\beta ^2-1)\psi =0, \end{aligned}$$
(16)

where \(\beta ^2=2-\frac{\lambda }{\kappa }(1-\alpha )\). To obtain general solution of eq. (16) we take \(z=\cosh (\xi )\) and follow similar procedure as in Case I and ultimately arrive at the following result:

  1. 1.

    When \(\frac{\lambda }{\kappa }(1-\alpha )>2\) we consider \(\beta ^2=- \beta '^2\) where \(\beta '=\sqrt{\frac{\lambda }{\kappa }(1-\alpha )-2}\) is positive.

    $$\begin{aligned} \psi= & {} c_{1}[\beta '\sqrt{z^2-1}\cos (\beta '\xi )-z\sin (\beta '\xi )]\nonumber \\&+c_{2}[\beta '\sqrt{z^2-1}\,\sin (\beta '\xi )+z\,\cos (\beta '\xi )].\nonumber \\ \end{aligned}$$
    (17)
  2. 2.

    When \(\frac{\lambda }{\kappa }(1-\alpha )<2\) so that \(\beta =\sqrt{2-\frac{\lambda }{\kappa }(1-\alpha )}\) is positive, the solution is

    $$\begin{aligned} \psi= & {} c_{1}[\sqrt{z^2-1}\beta \,\sinh (\beta \xi )-z\,\cosh (\beta \xi )]\nonumber \\&+c_{2}[\sqrt{z^2-1}\beta \,\cosh (\beta \xi )-z\,\sinh (\beta \xi )]. \nonumber \\ \end{aligned}$$
    (18)

For \(\kappa =1\), eqs (17) and (18) reduce to the equation obtained by Tikekar and Jotania [30]. The most general expressions of energy density \((\rho )\), radial pressure \((p_r)\) and tangential pressure \((p_t)\) take the form

$$\begin{aligned}&\rho =\frac{-\kappa }{8\pi G R^2(1-z^2)}\left[ 1-\frac{2\kappa }{(1-z^2)(\lambda -\kappa )}\right] , \end{aligned}$$
(19)
$$\begin{aligned}&p_{r}=\frac{\kappa }{8\pi G R^2(1-z^2)}\left[ 1-\frac{2z\kappa }{\lambda -\kappa }\frac{\psi _{z}}{\psi }\right] , \end{aligned}$$
(20)
$$\begin{aligned}&\Delta =\frac{\alpha \lambda \left\{ (\frac{\lambda }{\kappa }-1)z^2-\frac{\lambda }{\kappa }\right\} }{8\pi G R^2\left[ 1+\left\{ (\frac{\lambda }{\kappa }-1)z^2-\frac{\lambda }{\kappa }\right\} \right] ^2}, \end{aligned}$$
(21)
$$\begin{aligned}&p_{t}=p_{r}+\Delta . \end{aligned}$$
(22)

Case III: \(\kappa =0\)

In this case, we note that for \(\kappa =0\) the solutions corresponding to Case-I and Case-II fail and do not give any physically viable model in view of eqs (19)–(22). For \(\kappa =0\), energy density \((\rho )\) and radial pressure \((p_r)\) vanish at all interior points in view of eqs (19) and (20). On the other hand, transverse pressure \((p_t)\) and anisotropy \((\Delta )\) become infinite at all interior points in view of eqs (21) and (22). Therefore, to overcome these difficulties and to obtain solution for \(\kappa =0\), we proceed in the following way. For \(\kappa =0\), the ansatz given by eq. (7) becomes

$$\begin{aligned} \mathrm {e}^{2\mu }=1+\frac{\lambda }{R^2}r^2. \end{aligned}$$
(23)

If we take \(\mathrm {e}^{2\mu }=\tau ^{-1}\) and e\(^{2\nu }=y^2\), we note that metric potential (23) is similar to the special case of Matese and Whitman [64] solution for a static, isotropic fluid sphere. Dayanandan et al [65] generalised the Matese and Whitman solution for anisotropic matter distribution. However, in our analysis, the particular form of the metric potential is constructed out of a generalised VT metric. Moreover, our anisotropic counterpart of the Matese and Whitman solution [64] is extensively anisotropy–dependent. We obtained the following equation using eqs (5) and (6) taking \(p_{t}-p_{r}=\Delta \) and \(x=\frac{r^2}{R^2}\).

$$\begin{aligned} \frac{4x\tau }{y}\frac{\mathrm {d}^{2}y}{\mathrm {d}x^{2}}+2\frac{x}{y} \frac{\mathrm {d}\tau }{\mathrm {d}x}+\frac{\mathrm {d}\tau }{\mathrm {d}x}+\frac{1-\tau }{x}=8\pi GR^2\Delta . \end{aligned}$$
(24)

To obtain solution of eq. (24) similar to Matese and Whitman [64], we use the transformation

$$\begin{aligned} y=\sqrt{1+\frac{\lambda }{2}x}~\phi . \end{aligned}$$
(25)

Under this transformation, eq. (24) takes the form

$$\begin{aligned} \frac{\mathrm {d}^2\phi }{\mathrm {d}x^2}+f(x)\frac{\mathrm {d}\phi }{\mathrm {d}x}+\left( q(x)-\frac{2\pi GR^2\Delta }{x\tau }\right) \phi =0, \end{aligned}$$
(26)

where

$$\begin{aligned} f(x)=\frac{1}{2}\frac{\mathrm {d}}{\mathrm {d}x}\ln \left[ \left( 1+\frac{\lambda }{2}x\right) \tau \right] \end{aligned}$$
(27)

and

$$\begin{aligned} q(x)= & {} \frac{1}{4x\tau }\frac{1+\lambda x}{1+\frac{\lambda }{2}x}\frac{\mathrm {d}\tau }{\mathrm {d}x}+\frac{1- \tau }{4x^2\tau }\nonumber \\&-\frac{\lambda ^2}{16}\left( 1+\frac{\lambda }{2}x\right) ^{-2}. \end{aligned}$$
(28)

To make eq. (26) tractable we assume the following form of \(\Delta \):

$$\begin{aligned} \Delta =\alpha \frac{qx\tau }{2\pi GR^2}=\frac{1}{4}~\frac{\alpha \lambda ^2x}{8\pi GR^2(1+\frac{\lambda }{2}x)^2}. \end{aligned}$$
(29)

This choice of \(\Delta \) is physically reasonable as it vanishes at the centre (\(r=0\)). Putting the value of \(\Delta \) given by eq. (29) in eq. (26) and making use of the transformation \({\bar{q}}=q(1-\alpha )\), we can write eq. (26) in the following form:

$$\begin{aligned} \frac{\mathrm {d}^2\phi }{\mathrm {d}x^2}+f(x)\frac{\mathrm {d}\phi }{\mathrm {d}x}+{\bar{q}}\phi =0. \end{aligned}$$
(30)

To proceed further, we introduce a new independent variable

$$\begin{aligned} z=\int {|q|^{{1}/{2}}\mathrm {d}}x. \end{aligned}$$
(31)

Then eq. (30) reduces to

$$\begin{aligned} \frac{\mathrm {d}^2\phi }{\mathrm {d}z^2}+\frac{1}{2}\frac{\mathrm {d}}{\mathrm {d}z}\ln \left[ \left( 1+\frac{\lambda }{2}x\right) ^2\tau |q|\right] \frac{\mathrm {d}\phi }{\mathrm {d}z}+\frac{{\bar{q}}}{|q|}\phi =0.\nonumber \\ \end{aligned}$$
(32)

From our choice of \(\tau \) and q we notice that

$$\begin{aligned} \left( 1+\frac{\lambda }{2}x\right) ^2\tau |q| = \frac{\lambda ^2}{16} = \mathrm {constant}. \end{aligned}$$
(33)

Equation (32) can be integrated to obtain the final solution. In comparison with [64], it may appear that only one solution can be obtained from eq. (32) in view of eq. (33). However, \({\bar{q}}\) in eq. (32) depends on \(\alpha \) through the relation \({\bar{q}}=q(1-\alpha )\) and therefore depending on the value of anisotropy parameter \(\alpha \), three independent solutions of eq. (32) are possible which are given as follows:

$$\begin{aligned} \phi ={\left\{ \begin{array}{ll} A \,\sin \left( \sqrt{\dfrac{{\bar{q}}}{|q|}}~z\right) \\ \quad + B \,\cos \left( \sqrt{\dfrac{{\bar{q}}}{|q|}} ~z\right) \hbox {,~}\ &{}\alpha <1\\ \textit{A\,z} + B, \hbox { }\ &{}\alpha =1\\ A~\exp \left( {\sqrt{\dfrac{-{\bar{q}}}{|q|}}z}\right) \\ \quad + B ~\exp \left( {-\sqrt{\dfrac{-{\bar{q}}}{|q|}}z}\right) \hbox { ,~}\ &{}\alpha >1. \end{array}\right. } \end{aligned}$$
(34)

Then, from eq. (25), the complete solutions of eq. (24) are

$$\begin{aligned} y={\left\{ \begin{array}{ll} \sqrt{1+\dfrac{\lambda }{2}x}~\left[ A ~\sin \left( \sqrt{\dfrac{{\bar{q}}}{|q|}} ~z\right) \right. \\ \left. + B ~\cos \left( \sqrt{\dfrac{{\bar{q}}}{|q|}} ~z\right) \right] \\ \sqrt{1+\dfrac{\lambda }{2}x}~\left( A~z+B\right) \\ \sqrt{1+\dfrac{\lambda }{2}x}~\left[ A ~\exp \left( {\sqrt{\dfrac{-{\bar{q}}}{|q|}}z}\right) \right. \\ \left. + B ~\exp \left( {-\sqrt{\dfrac{-{\bar{q}}}{|q|}}z}\right) \right] \end{array}\right. } \end{aligned}$$
(35)

where

$$\begin{aligned} z=\sqrt{1+\frac{\lambda }{2}x}-\tan ^{-1}\left( \sqrt{1+\frac{\lambda }{2}x}\right) . \end{aligned}$$

It should be mentioned that the third solution of eq. (35) is not considered in [64, 65] as it leads to some unphysical behaviour of pressure or density. However, in our model presented here, the presence of the anisotropy parameter term \(\alpha \) makes it possible to extract physically acceptable model which will be discussed in the subsequent section. Now using eqs (4) and (5), we obtain the expression of energy density and radial pressure, respectively in the following form for \(\kappa =0\):

$$\begin{aligned}&\rho =\frac{\lambda }{8\pi GR^2}\frac{1}{1+\lambda x}\left[ 1+\frac{2}{1+\lambda x}\right] \end{aligned}$$
(36)
$$\begin{aligned}&p_{r}=-\frac{1}{8\pi GR^2(1+\lambda x)}\left[ \lambda - \frac{4y_{x}}{y}\right] . \end{aligned}$$
(37)

From eqs (36) and (37), we note that the energy density and pressure have finite values at the interior points of a star for \(\kappa =0\).

3 Physical requirements of anisotropic stellar model

  1. 1.

    The metric potentials \(\mu \), \(\nu \) as given by eq. (1) and the physical parameters like \(\rho \), \(p_{r}\), \(p_{t}\) and \(\Delta \) should be well defined and singularity free throughout the interior of a star.

  2. 2.

    Inside the star energy density (\(\rho \)), radial pressure (\(p_{r}\)) and tangential pressure (\(p_{t}\)) should be positive, i.e., \(\rho >0\), \(p_{r}>0\) and \(p_{t}>0\).

  3. 3.

    Energy density and pressure should monotonically decrease from the centre to the surface of the star, i.e. \(({\mathrm {d}\rho }/{\mathrm {d}r})<0\), \(({\mathrm {d}p_{r}}/{\mathrm {d}r})<0\) and \(({\mathrm {d}p_{t}}/{\mathrm {d}r})<0\).

  4. 4.

    At the surface, radial pressure \((p_{r})\) should vanish, i.e., \(p_{r=b}=0\). However, the tangential pressure (\(p_{t}\)) may assume non-zero value at the surface \((r=b)\).

  5. 5.

    At the centre \((r=0)\) of the star, both pressures become equal and therefore \(\Delta =0\).

  6. 6.

    The causality condition should be satisfied throughout the interior of the star which means that \(v_{r}^{2}=({\mathrm {d}p_{r}}/{\mathrm {d}\rho })\le 1\) and \(v_{t}^{2}=({\mathrm {d}p_{t}}/{\mathrm {d}\rho })\le 1\).

  7. 7.

    For an anisotropic fluid sphere, the following energy conditions [66] should be fulfilled throughout the interior of the fluid sphere:

    1. (a)

      Null energy condition (NEC): \((\rho + p_{r})\ge 0, (\rho + p_{t}) \ge 0\).

    2. (b)

      Weak energy condition (WEC): \((\rho + p_{r})\ge 0, \rho \ge 0, (\rho + p_{t}) \ge 0\).

    3. (c)

      Strong energy condition (SEC): \((\rho + p_{r})\ge 0, (\rho + p_{r} + 2p_{t}) \ge 0\).

    4. (d)

      Dominant energy condition (DEC): \(\rho \ge 0, (\rho - p_{r}) \ge 0, (\rho -p_{t}) \ge 0\).

  8. 8.

    At the surface of the star (\(r=b\)), the interior solution should be matched with the exterior Schwa-  rzschild solution. This condition relates the metric potentials with the mass and radius of the star in terms of the relation

    $$\begin{aligned} \mathrm {e}^{2\nu (r=b)}=\mathrm {e}^{-2\mu (r=b)}=\bigg (1-\frac{2M}{b}\bigg ). \end{aligned}$$

4 Boundary conditions

At the surface of the star (\(r=b\)), the interior solution given by the metric in eq. (1) should be matched with the exterior Schwarzschild metric given by

$$\begin{aligned} \mathrm {d}s^2= & {} -\left( 1-\frac{2M}{r}\right) \mathrm {d}t^2+\left( 1-\frac{2M}{r}\right) ^{-1}\mathrm {d}r^2 \nonumber \\&+r^2(\mathrm {d}\theta ^2+\sin ^{2}\theta \,\mathrm {d}\phi ^2). \end{aligned}$$
(38)

The continuity of the metric functions at the surface of the star yields

$$\begin{aligned} \mathrm {e}^{2\nu (r=b)}=\left( 1-\frac{2M}{b}\right) \end{aligned}$$
(39)

and

$$\begin{aligned} \mathrm {e}^{2\mu (r=b)}=\frac{1+\lambda b^2/R^2}{1+\kappa b^2/R^2}=\left( 1-\frac{2M}{b}\right) ^{-1}. \end{aligned}$$
(40)

At the surface of the star \((r=b)\) radial pressure \((p_r)\) should vanish. From eq. (20), we get the following condition when \(\kappa \ne 0\):

$$\begin{aligned} \left( \frac{\psi _{z}}{\psi }\right) _{z=z_{b}}=\frac{\lambda -\kappa }{2z_{b}\kappa }, \end{aligned}$$
(41)

where

$$\begin{aligned} z_{b}=\sqrt{\frac{\lambda /\kappa }{\lambda /\kappa -1}}\sqrt{1+\kappa \frac{b^2}{R^2}} \end{aligned}$$

and from eq. (37), we get the following condition for \(\kappa =0\):

$$\begin{aligned} \frac{y_{x}}{y}=\frac{\lambda }{4}. \end{aligned}$$
(42)

5 Physical analysis

Case I: \(\kappa <0\)

In this case, using eqs (19)–(22), the expression for the square of the radial and transverse sound velocities takes the form:

$$\begin{aligned}&v_{r}^2=\bigg (\frac{\mathrm {d}p_{r}}{\mathrm {d}\rho }\bigg )\nonumber \\&\quad =\frac{z(1-z^2)^2 (\frac{\psi _{z}}{\psi })^2-(1-z^2)(\frac{\psi _{z}}{\psi })-z(1-z^2)\frac{\lambda }{\gamma }\alpha }{z(1-z^2)(\frac{\lambda }{\gamma }+1)+4z}\nonumber \\ \end{aligned}$$
(43)
$$\begin{aligned}&v_{t}^2=\bigg (\frac{\mathrm {d}p_{t}}{\mathrm {d}\rho }\bigg )\nonumber \\&=\frac{z(1-z^2)^2 (\frac{\psi _{z}}{\psi })^2-(1-z^2)(\frac{\psi _{z}}{\psi })-z(1-z^2)\frac{\lambda }{\gamma }\alpha }{z(1-z^2)(\frac{\lambda }{\gamma }+1)+4z}\nonumber \\&\quad -\frac{\alpha \lambda \left[ (\gamma -\lambda )+(\gamma +\lambda )z^2\right] }{(\lambda +\gamma )\left[ (\lambda +\gamma )(1-z^2)+4\gamma \right] }. \end{aligned}$$
(44)

Here we consider \(-\kappa =\gamma \). The second term of eq. (44) is positive definite showing that \(v_{r}^{2}>v_{t}^{2}\). Therefore, to maintain the causality condition throughout the interior and at the surface of the star, it is sufficient to have \(v_{r}^{2}\le 1\), which leads to the condition

$$\begin{aligned} \frac{1}{1-z^2}\left[ \frac{1}{2z}-D_{1}\right] \le \frac{\psi _{z}}{\psi } \le \frac{1}{1-z^2}\left[ \frac{1}{2z}+D_{1}\right] , \end{aligned}$$
(45)

where

$$\begin{aligned} D_{1}=\sqrt{\frac{1}{4z^2}+4+(1-z^2)\bigg (\frac{\lambda }{\gamma }+1\bigg )+ (1-z^2)\frac{\lambda }{\gamma }\alpha }. \end{aligned}$$

The radial pressure should be positive within a star which gives the condition

$$\begin{aligned} \bigg (\frac{\psi _{z}}{\psi }\bigg )\le -\frac{\lambda +\gamma }{2z\gamma }. \end{aligned}$$
(46)

For a realistic solution, \({\psi _{z}}/{\psi }\) should be real from which we get a lower bound on the ratio (\({\lambda }/{\gamma }\)) as

$$\begin{aligned} \lambda >\gamma \left[ \frac{2\sqrt{3\alpha +25}-7}{17+4\alpha }\right] \end{aligned}$$
(47)

which for \(\gamma =1\) and \(\alpha =0\) reduces to \(\lambda >\frac{3}{17}\) as obtained by Mukherjee et al [62]. In figure 1, we have shown the plot of the minimum value of the ratio \(({\lambda }/{\gamma })\) vs. \(\alpha \) as calculated from eq. (47) and note that the lower bound on \(({\lambda }/{\gamma })\) decreases as \(\alpha \) increases.

Fig. 1
figure 1

Variation of lower bound of \({\lambda }/{\gamma }\) with \(\alpha \).

Table 1 Lower limit of \(\lambda \) for \(\kappa <0\) and for different values of \(\alpha \).

The lower limit of \(\lambda \) calculated from eqs (47) for \(\kappa <0\) for different values of \(\alpha \) are tabulated in table 1. Note also that the lower bound on \(\lambda \) decreases as \(\gamma \) decreases for a fixed \(\alpha \), i.e. the parameter \(\kappa \) has some effect on the lower bound of \(\lambda \) for the realistic model. Using eqs (45) and (46), we get an upper bound on the reduced radius \(({\tilde{b}}=\frac{b}{R})\), which is given by

$$\begin{aligned} {\tilde{b}}^{2} \le \frac{Y-\left( 12+2\frac{\lambda }{\gamma }\alpha -\frac{4(\frac{\lambda }{\gamma }) ^2\alpha }{\frac{\lambda }{\gamma }+1}\right) }{\lambda \left( \frac{\lambda }{\gamma }+5+ \frac{4\frac{\lambda }{\gamma }\alpha }{\frac{\lambda }{\gamma }+1}\right) }, \end{aligned}$$
(48)

where

$$\begin{aligned} Y=\sqrt{(17+4\alpha +4\alpha ^2)\bigg (\frac{\lambda }{\gamma }\bigg )^2+(82+36\alpha ) \bigg (\frac{\lambda }{\gamma }\bigg )+129}. \end{aligned}$$

Case II: \(\kappa >0\)

The expression for the radial sound velocity for \(\kappa >0\) is given by

$$\begin{aligned} v_{r}^2= & {} \bigg (\frac{\mathrm {d}p_{r}}{\mathrm {d}\rho }\bigg )\nonumber \\ {}= & {} \frac{z(z^2-1)^2( \frac{\psi _{z}}{\psi })^2+(z^2-1)(\frac{\psi _{z}}{\psi })-z(z^2-1)\frac{\lambda }{\kappa }\alpha }{z(z^2-1)(\frac{\lambda }{\kappa }-1)+4z}.\nonumber \\ \end{aligned}$$
(49)

The tangential sound velocity takes the form

$$\begin{aligned} v_{t}^2= & {} \bigg (\frac{\mathrm {d}p_{t}}{\mathrm {d}\rho } \bigg )\nonumber \\= & {} \frac{z(z^2-1)^2(\frac{\psi _{z}}{\psi })^2+(z^2-1)(\frac{\psi _{z}}{\psi })- z(z^2-1)\frac{\lambda }{\kappa }\alpha }{z(z^2-1)(\frac{\lambda }{\kappa }-1)+4z}\nonumber \\&\qquad -\frac{\alpha \lambda \left[ (\lambda +\kappa )-(\lambda -\kappa )z^2\right] }{(\lambda -\kappa )\left[ (\lambda -\kappa )(z^2-1)+4\kappa \right] }. \end{aligned}$$
(50)

Positivity of energy density (\(\rho \)) requires that \(\lambda > \kappa \). If we take \(\kappa \le 1\) and \(\lambda > 5\) [32], then in eq. (50), the second term is always positive giving \(v_{r}^{2}>v_{t}^{2}\) as before. Therefore, fulfilment of acoustic condition within a star requires only \(v_{r}^{2}\le 1\) and subsequently the tangential sound velocity will satisfy the causality condition automatically. Using the causality condition, we note that the ratio \(({\psi _{z}}/{\psi })\) can take values within the range given as follows:

$$\begin{aligned} \frac{1}{z^2-1}\left[ -\frac{1}{2z}-D_{2}\right] \le \frac{\psi _{z}}{\psi }\le \frac{1}{z^2-1}\left[ -\frac{1}{2z}+D_{2}\right] ,\nonumber \\ \end{aligned}$$
(51)

where

$$\begin{aligned} D_{2}=\sqrt{\frac{1}{4z^2}+4+(z^2-1)\bigg (\frac{\lambda }{\kappa }-1\bigg )+(z^2-1)\frac{\lambda }{\kappa }\alpha }. \end{aligned}$$

To maintain the radial pressure as positive throughout the interior of the star, we get another limit on the ratio \(({\psi _{z}}/{\psi })\) given by

$$\begin{aligned} \bigg (\frac{\psi _{z}}{\psi }\bigg )\le \frac{\lambda -\kappa }{2z\kappa }. \end{aligned}$$
(52)

For physically realistic solution \(({\psi _{z}}/{\psi })\) should be real which can be attained when \(({\lambda }/{\kappa })\) satisfies the following inequalities:

$$\begin{aligned}&\lambda =\lambda _{1} > \kappa \left[ \left( 2\alpha +3\right) +2\sqrt{\alpha ^2+3\alpha +1}\right] \end{aligned}$$
(53)
$$\begin{aligned}&\lambda =\lambda _{2} < \kappa \left[ \frac{7}{17+4\alpha }-\frac{2\sqrt{25+3\alpha }}{17+4\alpha }\right] \end{aligned}$$
(54)

It may be pointed out here that, to obtain physically realistic solutions for isotropic star \((\alpha =0\)) with \(\kappa =1\) eqs (53) and (54) give the bounds on the spheroidicity parameter (\(\lambda \)) as (i) \(\lambda >5\) and (ii) \(\lambda <-\frac{3}{17}\) respectively [32]. In figure 2, the lower bound of the ratio \(({\lambda }/{\kappa })\) is plotted with \(\alpha \) and it is noted that this lower bound increases with the increase of \(\alpha \).

Fig. 2
figure 2

Variation of lower bound of \({\lambda }/{\kappa }\) with \(\alpha \).

Table 2 Lower limit of \(\lambda \) for \(\kappa >0\) and for different values of \(\alpha \).

From eqs (51) and (52), we get an upper bound on the reduced radius \(({\tilde{b}}=\frac{b}{R})\) given by the following equation:

$$\begin{aligned} {\tilde{b}}^2\le \frac{Y+\left[ 12-2\frac{\lambda }{\kappa }\alpha -\frac{4\left( \frac{\lambda }{\kappa }\right) ^2\alpha }{1-\frac{\lambda }{\kappa }}\right] }{\lambda \left[ \frac{\lambda }{\kappa }-5+\frac{4\frac{\lambda }{\kappa }\alpha }{1-\frac{\lambda }{\kappa }}\right] }, \end{aligned}$$
(55)

where

$$\begin{aligned} {Y=\sqrt{(17+4\alpha +4\alpha ^2)\bigg (\frac{\lambda }{\kappa }\bigg )^2-(82+36\alpha \bigg (\frac{\lambda }{\kappa }\bigg )+129}} . \end{aligned}$$

In table 2, we have shown the lower bound of the spheroidal parameter \(\lambda \) calculated from eq. (53) for \(\kappa >0\) and for different values of \(\alpha \).

However, to maintain the radial pressure gradient negative \((({\mathrm {d}p_{r}}/{\mathrm {d}r})<0)\) throughout the interior of the fluid sphere, we note that an upper limit of \(\alpha \) exists, which can be obtained as follows: Since for \(\kappa >0\), \(\frac{\mathrm {d}z}{\mathrm {d}r}>0\), hence, the condition \(\frac{\mathrm {d}p_{r}}{\mathrm {d}r}<0\) is equivalent to \(\frac{\mathrm {d}p_{r}}{\mathrm {d}z}<0\). Using this condition, we get

$$\begin{aligned} \bigg (\frac{\psi _{z}}{\psi }\bigg )>\frac{-1+\sqrt{1+4z^2(z^2-1)\frac{\lambda }{\kappa }\alpha }}{2z(z^2-1)}. \end{aligned}$$
(56)

Now combining eq. (52) with eq. (56), we get the following inequality:

$$\begin{aligned}&\left( \frac{\lambda }{\lambda -\kappa }\right) \left( 1+\frac{\kappa r^2}{R^2}\right) \nonumber \\&\quad > \frac{\lambda ^2-\lambda \kappa (3+2\alpha )+\kappa (2\kappa +P)}{\lambda ^2-2\lambda \kappa (1+2\alpha )+\kappa ^2}, \end{aligned}$$
(57)

where \(P^2=\lambda ^2(1+4\alpha ^2-4\alpha )-2\lambda \kappa (1-2\alpha )+\kappa ^2\). It is clear that the condition given by eq. (57) will be satisfied throughout the interior of the star once it is satisfied at \(r=0\). This subsequently gives the upper limit of the anisotropy parameter \(\alpha \) as

$$\begin{aligned} \alpha <\left( \frac{3}{4}\right) \left( 1-\frac{\kappa }{\lambda }\right) ^2. \end{aligned}$$
(58)

Similarly, it can be shown that the condition \((\frac{\mathrm {d}p_{t}}{\mathrm {d}r})<0\) gives the upper limit of the anisotropy parameter \(\alpha \) as

$$\begin{aligned} \alpha <\frac{3}{4}\frac{(\frac{\lambda }{\kappa }-1)^2}{\frac{\lambda }{\kappa }(\frac{\lambda }{\kappa }+\lambda )}. \end{aligned}$$
(59)

In comparison with eq. (58), the upper limit of \(\alpha \) given by eq. (59) is always less. So it is sufficient to consider the upper limit of \(\alpha \) given by eq. (59).

Case III: \(\kappa =0\)

In this case, the behaviour of density and pressure can be studied using eqs (36) and (37). At the centre of the star, the expressions for density and pressure take the form

$$\begin{aligned}&\rho _{c}=\frac{3\lambda }{R^2} \end{aligned}$$
(60)
$$\begin{aligned}&(p_{r})_{c}=\frac{1}{R^2\left( 1+\lambda x\right) }\left( 4\left( \frac{y_{x}}{y}\right) _{0}-\lambda \right) . \end{aligned}$$
(61)

From eq. (60), it is clear that the central density \(\rho _{c}\) always assumes positive values in this model. The requirement of positive central pressure implies

$$\begin{aligned} \left( \frac{y_{x}}{y}\right) _{0}>\frac{\lambda }{4}. \end{aligned}$$

The expression for the square of the radial \((v_{r}^{2})\) and transverse \((v_{t}^{2})\) sound velocities are given as follows:

$$\begin{aligned} v_{r}^{2}= & {} \frac{\mathrm {d}p_{r}}{\mathrm {d}\rho }=\frac{1}{\lambda ^2\left( 5+\lambda x\right) }\left[ 4\left( 1+\lambda x\right) ^2\left( \frac{y_{x}}{y}\right) ^2 \right. \nonumber \\&\left. + 2\lambda \left( 1+\lambda x\right) \left( \frac{y_{x}}{y}\right) -\frac{\alpha \lambda ^2}{4}\frac{(1+\lambda x)^3}{\left( 1+\frac{\lambda }{2}x\right) ^2}\right] \end{aligned}$$
(62)

and

$$\begin{aligned} v_{t}^{2}= & {} \frac{\mathrm {d}p_{t}}{\mathrm {d}\rho }=\frac{1}{\lambda ^2\left( 5+\lambda x\right) }\left[ 4(1+\lambda x)^2\left( \frac{y_{x}}{y}\right) ^2 \right. \nonumber \\&\left. + 2\lambda (1+\lambda x)\left( \frac{y_{x}}{y}\right) \right] -\frac{\alpha }{2}\frac{(1+\lambda x)^3}{(5+\lambda x)\left( 1+\frac{\lambda }{2}x\right) ^3}.\nonumber \\ \end{aligned}$$
(63)

In eq. (63), we note that the second term is always positive giving \(v_{r}^{2}>v_{t}^{2}\) in view of eqs (62) and (63) as before. So, to fulfil acoustic condition, it is sufficient to satisfy the condition \(v_{r}^{2}\le 1\) within a star only and subsequently the tangential sound velocity will satisfy the causality condition automatically. To maintain the causality condition, it is required that

$$\begin{aligned}&\frac{\lambda }{4(1+\lambda x)}\left[ -1-D_{3}\right] \nonumber \\&\quad \le \frac{y_{x}}{y}\le \frac{\lambda }{4(1+\lambda x)}\left[ -1+D_{3}\right] , \end{aligned}$$
(64)

where

$$\begin{aligned} D_{3}=\sqrt{21+4\lambda x+\alpha \frac{(1+\lambda x)^3}{\left( 1+\frac{\lambda }{2}x\right) ^2}}. \end{aligned}$$

It is stated in § 2 that the physically acceptable solution of eq. (24) can be obtained in the exponential form given by eq. (35) without violating finite density or pressure conditions. This can be justified as follows: The central density is independent of y as evident from eq. (60) and the central pressure will be positive if

$$\left( \frac{y_{x}}{y}\right) _{0}>\frac{\lambda }{4}.$$

This can be achieved if the following condition is obeyed:

$$\begin{aligned} \frac{B}{A}<\exp \left( 2\sqrt{\alpha -1}\left( 1-\frac{\pi }{4}\right) \right) . \end{aligned}$$
(65)

The constants A and B are to be evaluated using boundary conditions defined in §4. Therefore, the physically realistic solution depends on mass and radius of the compact objects as well as on spheroidal parameter \(\lambda \) and anisotropy parameter \(\alpha \). In particular, it is possible to extract physically viable configuration only upto a certain value of \(\alpha \). Again, to maintain finite pressure and causality condition simultaneously at the centre, the ratio of constants A and B should satisfy some limiting conditions. For example, we note that

$$\begin{aligned} 1.27<\frac{A}{B}<17.7\quad \hbox {for}\; \alpha =1. \end{aligned}$$

6 Mass–radius relation

The mass of a star contained within a radius (b) is given by the expression

$$\begin{aligned} M(b)=\int _{0}^{b}4\pi r'^{2}\rho (r')\,\mathrm {d}r', \end{aligned}$$
(66)

where \(\rho (r')\) represents energy density at \(r=r'\). Thus, the total mass of a star within radius (b) can be obtained using eq. (19) or (36) in eq. (66) from \(r=0\) to \(r=b\) for \(\kappa \ne 0\) and \(\kappa =0\) respectively. The following results are obtained.

figure a

Here we consider \(8 \pi G=1\). From eq. (67), it is observed that \(M(b)>0\) only if \(\lambda >\kappa \). Another point to be noted is that one can obtain the same expression of mass as in eq. (68) if \(\kappa \) in eq. (67) is set to zero. This is possible as energy density is a function of metric potential \(\mu \) only and does not depend on anisotropy parameter \(\alpha \). Using eqs (67) and  (68), we get the general expression for the compactness of a star as follows:

$$\begin{aligned} u=\frac{M}{b}= \frac{(\lambda -\kappa )}{2R^2}\frac{b^2}{\left( 1+\lambda \frac{b^2}{R^2}\right) }. \end{aligned}$$
(69)

In this model, we note that the total mass within a star of radius b can also be obtained by knowing its central density in the following form:

$$\begin{aligned} M(b)=\frac{\rho _{c}}{6}\frac{b^3}{1+\frac{\lambda \rho _{c}}{3(\lambda -\kappa )}b^2}, \end{aligned}$$
(70)

where

$$\begin{aligned} \rho _c=\frac{(\lambda -\kappa )}{3R^2}. \end{aligned}$$

From eq. (70), we note that the total mass of a star is independent of the spheroidal parameter \(\lambda \) when \(\kappa =0\). In this case, the total mass depends on the central density \((\rho _c)\) and radius of the star (b). In figures 35, we have shown the variation of mass with radius for different values of central density \((\rho _{c})\). It is observed that greater amount of mass is contained within a given radius for higher values of the central density which also depends on the geometry defining parameters \(\lambda \) and \(\kappa \). From figure 3, we note that when \(\kappa <0\), the mass of a star decreases with the decrease of \(\kappa \). On the other hand, from figure 4, we note a different result. When \(\kappa >0\), the mass of a star increases with the decrease of \(\kappa \).

Fig. 3
figure 3

Variation of mass with radius for different values of central density taking \(\lambda =6\). Here solid, dashed, dotted and dot-dashed lines represent \(\kappa =-0.1\), \(\kappa =-0.5\), \(\kappa =-1.0\) and \(\kappa =-7.0,\) respectively.

Fig. 4
figure 4

Variation of mass with radius for different values of central density taking \(\lambda =6\). Here solid, dashed and dotted lines represent \(\kappa =0.1\), \(\kappa =0.5\) and \(\kappa =1.0\), respectively.

Fig. 5
figure 5

Variation of mass with radius for different values of central density for \(\kappa =0\).

Fig. 6
figure 6

Variation of mass with central density (\(\rho _{c}\)) for different values of \(\kappa \) taking \(\lambda =10\).

Again, it is well known that for a static system, mass (M) of the star should increase with increase in central density (\(\rho _{c}\)), i.e. \(({\partial M}/{\partial \rho _{c}})>0\) [67, 68]. On the other hand, if small perturbations are applied, the condition \(({\partial M}/{\partial \rho _{c}})<0\) corresponds to an unstable stellar model. In figure 6, the mass of the stellar system is plotted against its central density (\(\rho _{c}\)). It is observed that this model satisfies this static stability criterion. According to Buchdahl [69], the mass to radius ratio of a fluid sphere should lie within the range

$$\begin{aligned} \frac{2M}{b}<\frac{8}{9}. \end{aligned}$$

In the present model, we note that the maximum mass to radius ratio is

$$\begin{aligned} \frac{M}{b}=0.316<\frac{4}{9} \end{aligned}$$

for \(\kappa =-1.0\) as evident from figure 3. The surface redshift function can be obtained from eq. (69) using the following relation:

$$\begin{aligned} Z_{s}=\left( 1-2u\right) ^{-{1}/{2}}-1. \end{aligned}$$
(71)

The variation of surface redshift with radius is shown graphically in figures 79. According to Böhmer and Harko [70], the surface redshift should be \(Z_{s}\le 5\). In our model, we note that the maximum surface redshift is 0.6 for \(b=14\) km, \(\kappa =-1.0\), \(\lambda =6\) and \(\rho _{c}=4\times \rho _{\mathrm {nuclear}}\) as evident from figure 7.

Fig. 7
figure 7

Variation of surface redshift (\(Z_{s}\)) with radius (b) for different values of central density taking \(\lambda =6\). Here solid, dashed and dotted lines represent \(\kappa =-0.1\), \(\kappa =-0.5\) and \(\kappa =-1.0\), respectively.

Fig. 8
figure 8

Variation of surface redshift (\(Z_{s}\)) with radius (b) for different values of central density taking \(\lambda =6\). Here solid, dashed and dotted lines represent \(\kappa =0.1\), \(\kappa =0.5\) and \(\kappa =1.0\), respectively.

Fig. 9
figure 9

Variation of surface redshift (\(Z_{s}\)) with radius (b) for different values of central density for \(\kappa =0\) taking \(\lambda =6\).

From figure 7, it is evident that when \(\kappa <0\), the surface redshift decreases with decrease in \(\kappa \). On the other hand, from figure 8, we note a different result. When \(\kappa >0\), the surface redshift increases with decrease in \(\kappa \). The value of surface redshift for \(\kappa =0\) is intermediate between the values corresponding to \(\kappa <0\) and \(\kappa >0\) when all other parameters are kept unchanged.

6.1 Maximum mass

To obtain maximum mass, we follow the technique adopted by Sharma et al [71] and Paul et al [72]. The square of the sound velocity should maintain the inequality \(({\mathrm {d}p_{r}}/{\mathrm {d}\rho })\le 1\) throughout the interior of a compact object. We assume that \(({\mathrm {d}p_{r}}/{\mathrm {d}\rho })\) takes maximum value at the centre and causality condition is not violated throughout the interior of a star. From eq. (45), this leads to the condition for \(\kappa <0\):

(72)

Here we substitute \(\kappa =-\gamma \). Again from eq. (15), one may get

$$\begin{aligned}&\bigg (\frac{\psi _{z}}{\psi }\bigg )=\frac{n^2-1}{\sqrt{1-z^2}}\nonumber \\&\times \frac{\left[ \sin \left\{ (n+1)\xi +\theta \right\} -\sin \left\{ (n-1)\xi +\theta \right\} \right] }{\left[ (n-1)\cos \left\{ (n+1)\xi +\theta \right\} -(n+1)\cos \left\{ (n-1)\xi +\theta \right\} \right] }. \nonumber \\ \end{aligned}$$
(73)

Combining eqs (72) and  (73) at \(z=z_{0}\), we get a limiting value of \(\theta \). Now, substituting \(\kappa =-\gamma \) in eq. (41) and using eq. (73) at \(z=z_{b}\), we can evaluate a maximum value of the ratio \(({b^2}/{R^2})\). For this limiting value of \(({b^2}/{R^2})_{\mathrm {max}}\), the maximum mass contained within the radius b is given by

$$\begin{aligned} M_{\mathrm {max}}=\frac{\lambda +\gamma }{2}\frac{b}{\frac{1}{\left( {b^2}/{R^2}\right) _{\mathrm {max}}}+\lambda }. \end{aligned}$$
(74)

Similarly for \(\kappa >0\), we get the lower bound of the ratio \(({\psi _{z}}/{\psi })\) at the centre of a star as follows:

$$\begin{aligned}&\left( \frac{\psi _{z}}{\psi }\right) _{z=z_{0}}\le \frac{\frac{\lambda }{\kappa }-1}{2\sqrt{\frac{\lambda }{\kappa }}}\left[ -\sqrt{\frac{\lambda }{\kappa }-1}\right. \nonumber \\&\quad \left. +\sqrt{21\frac{\lambda }{\kappa }-1+\frac{4\alpha \left( \frac{\lambda }{\kappa }\right) ^2}{\frac{\lambda }{\kappa }-1}}\right] . \end{aligned}$$
(75)

Now depending on the sign of the factor \(\beta ^2\) as defined in eq. (16), we have two different expressions for the ratio \(({\psi _{z}}/{\psi })\) as calculated from eqs (17) and (18) given by

$$\begin{aligned}&\left( \frac{\psi _{z}}{\psi }\right) \nonumber \\&\quad =\frac{-c_{1}(\beta '^2+1)\sin (\beta '\xi )+c_{2}(\beta '^2+1)\cos (\beta '\xi )}{\psi }\nonumber \\ \end{aligned}$$
(76)
$$\begin{aligned}&\left( \frac{\psi _{z}}{\psi }\right) \nonumber \\&\quad =\frac{c_{1}(\beta ^2-1)\cosh (\beta \xi )+c_{2}(\beta ^2-1)\sinh (\beta \xi )}{\psi }.\nonumber \\ \end{aligned}$$
(77)
Fig. 10
figure 10

Variation of maximum mass with \(\kappa \) for different values of \(\lambda \) when \(\alpha =0\) and \(\kappa <0\) taking \(b=10\) km.

Fig. 11
figure 11

Variation of maximum mass with \(\kappa \) for different values of \(\lambda \) when \(\alpha =0\) and \(\kappa >0\) taking \(b=10\) km.

Fig. 12
figure 12

Variation of maximum mass with \(\kappa \) for different values of \(\lambda \) when \(\alpha =0.3\) and \(\kappa <0\) taking \(b=10\) km .

Fig. 13
figure 13

Variation of maximum mass with \(\kappa \) for different values of \(\lambda \) when \(\alpha =0.3\) and \(\kappa >0\) taking \(b=10\) km.

Table 3 Table showing maximum mass for \(\kappa =0\).

In eqs (76) and (77), there are two unknown constants \(c_{1}\) and \(c_{2}\). If we use eq. (41) with either eq. (76) or (77) at \(z=z_{b}\), we get a functional relation between the constants \(c_{1}\) and \(c_{2}\) which depends on \({b^2}/{R^2}\). Therefore, combining eq. (75) and eq. (76) or (77) at the centre of a star \((z=z_{0})\), we get a maximum value of the ratio \(({b^2}/{R^2})\). When \(({b^2}/{R^2})\) is maximum, the mass is also maximum as evident from expression given as follows:

$$\begin{aligned} M_{\mathrm {max}}=\frac{\lambda -\kappa }{2}\frac{b}{\frac{1}{\left( {b^2}/{R^2}\right) _{\mathrm {max}}}+\lambda }. \end{aligned}$$
(78)

In figures 1013, we have plotted maximum mass contained within a radius against different values of parameter \(\kappa \). we note that when \(\kappa \rightarrow 0\), the maximum mass is almost independent of the spheroidal parameter \(\lambda \). It is also found that maximum mass is almost constant when \(\lambda \) takes large values. The maximum mass for \(\kappa =0\) is tabulated in table 3. From figures 1013, we note an interesting result.

Table 4 Observed mass and radius of some compact objects.
Table 5 Geometrical parameter R in km for \(\kappa <0\).
Table 6 Geometrical parameter R in km for \(\kappa >0\).
Fig. 14
figure 14

Radial variation of energy density (\(\rho \)) inside 4U 1608-52. Here \(\lambda =2\) for \(\kappa <0\) and \(\kappa =0\). \(\lambda =10\) for \(\kappa >0\).

Table 7 Tabulated values of \(\theta \) for \(\lambda =2\).
Table 8 Different values of the constants \(c_{1}\) and \(c_{2}\) calculated from boundary conditions for \(\lambda =10\).
Table 9 Tabulation of different constants for \(\kappa =0\) with \(\lambda =2\).

In the case of an isotropic star, maximum mass increases with the decrease of \(|\kappa |\) as evident from figures 10 and 11 and when \(\kappa \rightarrow 0\), maximum mass approaches the value corresponding to the case \(\kappa =0\). This value is \(\sim \) \(2.433M_\odot \). But in the presence of anisotropy, maximum mass approaches \({\sim }2.58M_\odot \) when \(\kappa \rightarrow 0\) for \(\alpha =0.3\) as evident from figures 12 and 13, which is greater than the maximum mass obtained from the case \(\kappa =0\) \(({\sim }2.5M_\odot )\) having the same \(\alpha \) \((=0.3)\) and radius \((b=10\) km) as given in table 3. We also found that maximum mass corresponding to the case \(\kappa =0\) is independent of spheroidal parameter \(\lambda \) as evident from table 3. In this case, the maximum mass \(({\sim }3.2M_\odot )\) of a compact object predicted by Rhoades and Ruffini [73] can be achieved in our model with \(\alpha =0\), \(b=13.15\) km and \(\alpha =0.3\), \(b=12.815\) km, i.e., radius of a compact object having maximum mass depends on anisotropy parameter \(\alpha \) only for \(\kappa =0\).

7 Physical properties of the compact objects

To fit our model with observational data, we have considered a few well-known compact objects such as 4U 1608-52, EXO 1745-248, PSR J1614-2230 and LMC X-4. The observed masses and radii of these compact objects are given in table 4. In the present work, the solutions of the field equations are divided into three regions: (i) \(\kappa <0,\) (ii) \(\kappa =0\) and (iii) \(\kappa >0\). Depending on the sign of \(\kappa \), the behaviour of the physical parameters, namely, energy density (\(\rho \)), radial pressure (\(p_{r}\)), pressure anisotropy function \((\Delta )\), tangential pressure (\(p_{t}\)) etc. can be studied in these three regions characterised by \(\kappa \). The metric ansatz given by eq. (7) contains two free parameters \(\lambda \) and \(\kappa \) and an unknown parameter R. The parameter R can be evaluated using the boundary condition given by eq. (40) using the 1observed mass (M) and radius (b) of a compact object. We have calculated R for 4U 1608-52, EXO1745-248, PSR J1614-2230 and LMC X-4 and are tabulated in table 5 for \(\kappa <0\) and  6 for \(\kappa >0\). Now it is possible to study the radial variation of different physical parameters inside the compact objects. The variation of energy density (\(\rho \)) is plotted in figure 14 for 4U 1608-52. It is noticed that in the region \(\kappa <0\), if \(|\kappa |\) is decreased \(\rho \) increases. However, in the region \(\kappa >0\), the dependence of \(\rho \) on \(\kappa \) is reversed. Therefore, we note that the parameter \(\kappa \) in metric ansatz has some effect on the value of energy density \(\rho \). To study the variation of radial pressure \((p_{r})\), the ratio \(({\psi _{z}}/{\psi })\) has to be evaluated which takes different forms depending on the sign of the parameter \(\kappa \). If we consider \(\kappa <0\), we have to determine the unknown parameter \(\theta \) appearing in eq. (73), which is calculated from the boundary condition eq. (41) together with eq. (73) and are tabulated in table 7 for different compact objects. On the other hand, when \(\kappa >0\), there are two possible expressions for \(({\psi _{z}}/{\psi })\) depending on the sign of \(\beta ^2\) appeared in eqs (76) and (77). Here, two unknown constants \(c_{1}\) and \(c_{2}\) have to be calculated from boundary conditions (39) and (41) respectively. The choice of \(\lambda \), \(\kappa \) and \(\alpha \) are crucial here. If we take \(\lambda =10\) and \(\kappa =1.0\), the upper limit of \(\alpha \) from eq. (59) is 0.304. Accordingly in our model calculation, we take \(\alpha =0.1\) and 0.3. When \(\alpha =0.3\), the lower bound on \(({\lambda }/{\kappa })\) is 6.421 as can be seen from table 2. Therefore, our choice of \(\lambda \) and \(\kappa \) are consistent with this lower limit. Using these set of values of \(\lambda \) and \(\kappa \), we have tabulated the values of \(c_{1}\) and \(c_{2}\) in table 8 for different compact objects. Values of different constants, e.g. R, A and B are tabulated in table 9 for \(\kappa =0\). The variation of the radial pressure \((p_{r})\) inside 4U 1608-52 is shown in figure 15. It is noticed that in the region where \(\kappa <0\), if \(|\kappa |\) is decreased \(p_r\) increases. However, in the region where \(\kappa >0\), the dependence of \(p_r\) on \(\kappa \) is reversed. The dependence of transverse pressure \((p_t)\) on \(\kappa \) is similar and is shown in figure 17 for 4U 1608-52. Therefore, we also note that the parameter \(\kappa \) in metric ansatz has some effect on the value of fluid pressures. It is observed that increase in anisotropy \((\alpha )\) leads to decrease in the radial pressure \((p_{r})\). However, figure 16 indicates that the pressure anisotropy \((\Delta )\) picks up higher values with an increase in anisotropy parameter \(\alpha \) for any value of \(\kappa \). However, we note that pressure anisotropy \((\Delta )\) picks up higher values in the region \(\kappa <0\) when \(|\kappa |\) decreases. Situation is reversed in region \(\kappa >0\). It is also evident from the figure that \(\Delta \) is zero at the centre of the star and gradually increases upto the surface. In table 10, central density (\(\rho _{c}\)), surface density (\(\rho _{s}\)) and central pressure (\(p_{rc}\)) are tabulated for a few known compact objects used for our analysis. It is observed that in the region \(\kappa <0\), central density decreases with increase in magnitude of \(\kappa \) whereas surface density increases. For \(\kappa >0\), a reverse variation is observed. Comparison of central pressure for different values of \(\alpha \) reveals that the central pressure decreases with increase in \(\alpha \) for a given value of \(\kappa \). However, the dependence of central pressure on \(\kappa \), which is the geometry defining parameter, is strictly anisotropy-dependent. In both cases, there is an upper limit of \(\alpha \) above which reverse effect is observed which indeed varies for different compact objects. Therefore, in the case of an anisotropic star, higher pressure anisotropy adversely affects the EOS which is determined by the factor \(\kappa \) (if we assume \(\lambda \) is kept constant). From the plots in figures 18 and 19, it is evident that density and pressure gradients are negative, indicating that both density and pressures decrease monotonically from the centre up to the surface.

Table 10 Central density (\(\rho _{c}\)), surface density (\(\rho _{s}\)) and central pressure (\(p_{rc}\)) calculated for different compact objects.
Fig. 15
figure 15

Radial variation of radial pressure (\(p_{r}\)) inside 4U 1608-52. Solid and dashed lines represent \(\alpha =0.1\) and \(\alpha =0.3\) respectively. Here \(\lambda =2\) for \(\kappa <0\) and \(\kappa =0\). \(\lambda =10\) for \(\kappa >0\).

Fig. 16
figure 16

Radial variation of anisotropic pressure (\(\Delta \)) inside 4U 1608-52. Solid and dashed lines represent \(\alpha =0.1\) and \(\alpha =0.3\) respectively. Here \(\lambda =2\) for \(\kappa <0\) and \(\kappa =0\). \(\lambda =10\) for \(\kappa >0\).

Fig. 17
figure 17

Radial variation of tangential pressure (\(p_{t}\)) inside 4U 1608-52. Solid and dashed lines represent \(\alpha =0.1\) and \(\alpha =0.3\) respectively. Here \(\lambda =2\) for \(\kappa <0\) and \(\kappa =0\). \(\lambda =10\) for \(\kappa >0\).

Fig. 18
figure 18

Behaviour of energy density gradient \(({\mathrm {d}\rho }/{\mathrm {d}r})\) inside 4U 1608-52. Here \(\lambda =2\) for \(\kappa <0\) and \(\kappa =0\). \(\lambda =10\) for \(\kappa >0\).

Fig. 19
figure 19

Behaviour of different pressure gradients inside 4U 1608-52. Here solid curves and dashed curves represent \(({\mathrm {d}p_{r}}/{\mathrm {d}r})\) and \(({\mathrm {d}p_{t}}/{\mathrm {d}r})\), respectively. Here \(\lambda =2\) for \(\kappa <0\) and \(\kappa =0\). \(\lambda =10\) for \(\kappa >0\).

Fig. 20
figure 20

Variation of the squared radial sound velocity \((v_{r}^{2})\) with radial distance (r) for 4U 1608-52. Plots are obtained for different values of \(\kappa \) using \(\lambda =2\) for \(\kappa <0\) and \(\kappa =0\). \(\lambda =10\) for \(\kappa >0\).

7.1 Causality condition

The behaviour of radial and tangential sound velocities has already been discussed in §5 for different cases. It is required that velocity of sound does not exceed the speed of light for a realistic model, i.e. the conditions

$$\begin{aligned} 0<v_{r}^{2}=\left( \frac{\mathrm {d}p_{r}}{\mathrm {d}\rho }\right) <1 \end{aligned}$$

and

$$\begin{aligned} 0<v_{t}^{2}=\left( \frac{\mathrm {d}p_{t}}{\mathrm {d}\rho }\right) <1 \end{aligned}$$

hold simultaneously. In this section, different sound velocities are presented graphically in figures 20 and 21 for 4U 1608-52. It is observed that causality condition is satisfied in this model for the choice of new parameter \(\kappa \). An interesting point to be noted here is that, when \(\kappa =0\) and \(\alpha >1\), sound velocities decrease monotonically from the centre to the surface of a compact object. \(\alpha \) is limited due to the real and finite nature of sound speeds. Numerically, this can be obtained by probing sound velocities at different radial distances inside a compact object. However, we can get an upper limit of \(\alpha \) analytically, if we assume sound speeds monotonically decrease with radial distance (which in this case holds good). Since \(v_{t}^2<v_{r}^2\), for real and finite tangential sound speed \(v_{t}^2\ge 0\) gives an upper limit of \(\alpha \) which is given as follows:

$$\begin{aligned} \alpha <\frac{(1-u)^3(3-4u)}{2(1-2u)^2}, \end{aligned}$$
(79)

where u is the compactness of the object. The upper bound  (79) is obtained by using eqs (42), (63) and (69) with \(\kappa =0\).

Fig. 21
figure 21

Variation of the squared tangential sound velocity \((v_{t}^{2})\) with radial distance (r) for 4U 1608-52. Plots are obtained for different values of \(\kappa \) using \(\lambda =2\) for \(\kappa <0\) and \(\kappa =0\). \(\lambda =10\) for \(\kappa >0\).

7.2 Energy conditions

In the context of general relativity, energy conditions are some physically reasonable restrictions on the energy–momentum tensor \(T_{ij}\). In general relativity, the mutual influence of space–time and matter is encoded in EFEs. However, in Einstein’s equation the properties of matter is not usually specified leaving \(T_{ij}\) arbitrary. It is convenient to impose some restrictions on matter to remove this arbitrariness of \(T_{ij}\). In the past decades, various energy conditions found vast applications in positive mass theorem [79], theory of superluminal travel [80,81,82], the singularity theorems [83]. The energy conditions are expressed in the following forms [66]:

  1. 1.

    Null energy condition (NEC): \(\rho + p_{r}\ge 0, \rho + p_{t} \ge 0\)

  2. 2.

    Weak energy condition (WEC): \(\rho + p_{r}\ge 0, \rho \ge 0, \rho + p_{t} \ge 0\)

  3. 3.

    Strong energy condition (SEC): \(\rho + p_{r}\ge 0, \rho + p_{r} + 2p_{t} \ge 0\)

  4. 4.

    Dominant energy condition (DEC): \(\rho \ge 0, \rho - p_{r} \ge 0, \rho - p_{t} \ge 0\)

Different energy conditions are plotted for 4U 1608-52 and are shown in figures 14, 2226. It is found that all the energy conditions are satisfied in our model for the inclusion of the new parameter \(\kappa \).

Fig. 22
figure 22

Variation of \(\rho +p_r\) inside 4U 1608-52. Solid and dashed curves represent \(\alpha =0.1\) and \(\alpha =0.3\), respectively. Here we have considered \(\lambda =2\) for \(\kappa <0\) and \(\kappa =0\). \(\lambda =10\) for \(\kappa >0\).

Fig. 23
figure 23

Variation of \(\rho -p_r\) inside 4U 1608-52. Solid and dashed curves represent \(\alpha =0.1\) and \(\alpha =0.3\) respectively. Here we have considered \(\lambda =2\) for \(\kappa <0\) and \(\kappa =0\). \(\lambda =10\) for \(\kappa >0\).

Fig. 24
figure 24

Variation of \(\rho +p_t\) inside 4U 1608-52. Solid and dashed curves represent \(\alpha =0.1\) and \(\alpha =0.3\) respectively. Here we have considered \(\lambda =2\) for \(\kappa <0\) and \(\kappa =0\). \(\lambda =10\) for \(\kappa >0\).

Fig. 25
figure 25

Variation of \(\rho -p_t\) inside 4U 1608-52. Solid and dashed curves represent \(\alpha =0.1\) and \(\alpha =0.3\) respectively. Here we have considered \(\lambda =2\) for \(\kappa <0\) and \(\kappa =0\). \(\lambda =10\) for \(\kappa >0\).

Fig. 26
figure 26

Variation of \(\rho +p_r+2p_t\) inside 4U 1608-52. Solid and dashed curves represent \(\alpha =0.1\) and \(\alpha =0.3\), respectively. Here we have considered \(\lambda =2\) for \(\kappa <0\) and \(\kappa =0\). \(\lambda =10\) for \(\kappa >0\).

8 Stability of the system

8.1 TOV equation

A compact object will be in stable equilibrium under three forces, namely, gravitational force (\(F_{g}\)), hydrostatic force (\(F_{h}\)) and anisotropic force (\(F_{a}\)), if their resultant force vanishes throughout the interior of the object. The mathematical formulation is known as TOV equation which is given by [84]

$$\begin{aligned} -\frac{M_{G}(r)(\rho +p_{r})}{r^2}\mathrm {e}^{(\mu -\nu )}-\frac{\mathrm {d}p_{r}}{\mathrm {d}r}+\frac{2\Delta }{r}=0, \end{aligned}$$
(80)

where \(M_{G}\) is the Tolman–Whittaker active gravitational mass of the system [85] given as follows:

$$\begin{aligned} M_{G}(r)=r^2(\nu )'\mathrm {e}^{(\nu -\mu )}. \end{aligned}$$
(81)

Substituting eq. (81) in eq. (80) we get

$$\begin{aligned} -\nu '(\rho +p_{r})-\frac{\mathrm {d}p_{r}}{\mathrm {d}r}+\frac{2\Delta }{r}=0. \end{aligned}$$
(82)

Here

$$\begin{aligned} F_{g}=-\nu '(\rho +p_{r}), \end{aligned}$$
$$\begin{aligned} F_{h}=-\frac{\mathrm {d}p_{r}}{\mathrm {d}r} \end{aligned}$$

and

$$\begin{aligned} F_{a}=\frac{2\Delta }{r}. \end{aligned}$$

The expressions of \(F_{g}\), \(F_{h}\) and \(F_{a}\) for different cases are given as follows:

Case I: \(\kappa <0\)

$$\begin{aligned}&F_{g}=\frac{2\gamma r}{R^4}\sqrt{\lambda (\lambda +\gamma )}\left( 1-\gamma \frac{r^2}{R^2}\right) ^{-{1}/{2}}\nonumber \\&\qquad \times \left( 1+\lambda \frac{r^2}{R^2}\right) ^{-2} h_{1}(r)\bigg [1-z_{1}(r)\nonumber \\&\qquad \times (1-z_{1}^{2}(r))h_{1}(r)\bigg ] \\&F_{h}=-\frac{2r}{R^4}\sqrt{\lambda (\lambda +\gamma )}\left( 1-\gamma \frac{r^2}{R^2}\right) ^{-{1}/{2}}\nonumber \\&\qquad \quad \times \left( 1+\lambda \frac{r^2}{R^2}\right) ^{-2}\nonumber \end{aligned}$$
(83)
$$\begin{aligned}&\qquad \times \left[ z_{1}(r)\lambda \alpha +\gamma h_{1}(r)-\gamma z_{1}(r)(1-z_{1}^{2}(r))h_{1}^{2}(r)\right] \nonumber \\ \end{aligned}$$
(84)
$$\begin{aligned}&F_{a}=\frac{2\alpha \lambda ^2r}{R^4\left[ 1+\lambda \frac{r^2}{R^2}\right] ^2} \end{aligned}$$
(85)

where

$$\begin{aligned}&h_{1}(r)=\frac{n^2-1}{\sqrt{1-z_{1}^{2}(r)}}\left( \frac{h_{2}(r)-h_{3}(r)}{h_{4}(r)-h_{5}(r)}\right) , \\&h_{2}(r)=\sin \left[ (n+1)\cos ^{-1}(z_{1}(r))+\theta \right] , \\&h_{3}(r)=\sin \left[ (n-1)\cos ^{-1}(z_{1}(r))+\theta \right] , \\&h_{4}(r)=(n-1)\cos \left[ (n+1)\cos ^{-1}(z_{1}(r))+\theta \right] , \\&h_{5}(r)=(n+1)\cos \left[ (n-1)\cos ^{-1}(z_{1}(r))+\theta \right] , \\&\theta =\tan ^{-1}\left[ \frac{X\cot (\cos ^{-1}(z_{1b}))-\tan (n\cos ^{-1}(z_{1b}))}{1+X\cot (\cos ^{-1}(z_{1b}))\tan (n\cos ^{-1}(z_{1b}))}\right] , \\&X=\frac{1}{n}\left[ \frac{2\gamma (n^2-1)}{\lambda +\gamma }-1\right] , \\&n=\sqrt{\frac{\lambda }{\gamma }(1-\alpha )+2}, \\&z_{1}(r)=\sqrt{\frac{\lambda }{\lambda +\gamma }}\sqrt{1-\gamma \frac{r^2}{R^2}}, \\&z_{1b}=\sqrt{\frac{\lambda }{\lambda +\gamma }}\sqrt{1-\gamma \frac{b^2}{R^2}}. \end{aligned}$$

Case II: \(\kappa >0\)

$$\begin{aligned} F_{g}= & {} -\frac{2\kappa r}{R^4}\sqrt{\lambda (\lambda -\kappa )}\left( 1+\kappa \frac{r^2}{R^2}\right) ^{-{1}/{2}}\nonumber \\&\times \left( 1+\lambda \frac{r^2}{R^2}\right) ^{-2} \nonumber \\&\times h_{6}(r)\left[ 1+z_{2}(r)(z_{2}^2(r)-1)h_{6}(r)\right] \end{aligned}$$
(86)
$$\begin{aligned} F_{h}= & {} -\frac{2r}{R^4}\sqrt{\lambda (\lambda -\kappa )}\left( 1+\kappa \frac{r^2}{R^2}\right) ^{-{1}/{2}}\nonumber \\&\times \left( 1+\lambda \frac{r^2}{R^2}\right) ^{-2} \left[ z_{2}(r)\lambda \alpha -\kappa h_{6}(r)\right. \nonumber \\&\left. -\kappa z_{2}(r)(z_{2}^{2}(r)-1)h_{6}^{2}(r)\right] , \end{aligned}$$
(87)
$$\begin{aligned} F_{a}= & {} \frac{2\alpha \lambda ^2r}{R^4\left[ 1+\lambda \frac{r^2}{R^2}\right] ^2}, \end{aligned}$$
(88)

where

$$\begin{aligned} h_{6}(r)=\frac{-L_{1}h_{7}(r)+h_{8}(r)}{L_{1}h_{9}(r)+h_{10}(r)} \end{aligned}$$

for \( \frac{\lambda }{\kappa }(1-\alpha )>2\),

$$\begin{aligned} {h_{6}(r)}=\frac{L_{2}h_{11}(r)+h_{12}(r)}{L_{2}h_{13}(r)+h_{14}(r)} \end{aligned}$$

for \( \frac{\lambda }{\kappa }(1-\alpha )<2\),

$$\begin{aligned}&h_{7}(r)=(\beta '^2+1)\sin (\beta '\cosh ^{-1}z_{2}(r)),\\&h_{8}(r)=(\beta '^2+1)\cos (\beta '\cosh ^{-1}z_{2}(r)),\\&h_{9}(r)=\beta '\sqrt{z_{2}^2(r)-1}\cos (\beta '\cosh ^{-1}z_{2}(r))\\&\quad - z_{2}(r)\sin (\beta '\cosh ^{-1}z_{2}(r)),\\&h_{10}(r)=\beta '\sqrt{z_{2}^2(r)-1}\sin (\beta '\cosh ^{-1}z_{2}(r))\\&\quad +z_{2}(r)\cos (\beta '\cosh ^{-1}z_{2}(r)),\\&h_{11}(r)=(\beta ^2-1)\cosh (\beta \cosh ^{-1}z_{2}(r)),\\&h_{12}(r)=(\beta ^2-1)\sinh (\beta \cosh ^{-1}z_{2}(r)),\\&h_{13}(r)=\beta \sqrt{z_{2}^2(r)-1}\sinh (\beta \cosh ^{-1}z_{2}(r))\\&\quad -z_{2}(r)\cosh (\beta \cosh ^{-1}z_{2}(r),\\&h_{14}(r)=\beta \sqrt{z_{2}^2(r)-1}\cosh (\beta \cosh ^{-1}z_{2}(r))\\&\quad -z_{2}(r)\sinh (\beta \cosh ^{-1}z_{2}(r)),\\&L_{1}=\frac{\tilde{h_{8}}-\tau \tilde{h_{10}}}{\tilde{h_{7}}+\tau \tilde{h_{9}}},\\&L_{2}=\frac{\tau \tilde{h_{14}}-\tilde{h_{12}}}{\tilde{h_{11}}-\tau \tilde{h_{13}}},\\&\tilde{h_{7}}=(\beta '^2+1)\sin (\beta '\cosh ^{-1}z_{2b}),\\&\tilde{h_{8}}=(\beta '^2+1)\cos (\beta '\cosh ^{-1}z_{2b}),\\&\tilde{h_{9}}=\beta '\sqrt{z_{2b}^2-1}\cos (\beta '\cosh ^{-1}z_{2b})\\&\quad -z_{2b}\sin (\beta '\cosh ^{-1}z_{2b}),\\&\tilde{h_{10}}=\beta '\sqrt{z_{2b}^2-1}\sin (\beta '\cosh ^{-1}z_{2b})\\&\quad +z_{2b}\cos (\beta '\cosh ^{-1}z_{2b}),\\&\tilde{h_{11}}=(\beta ^2-1)\cosh (\beta \cosh ^{-1}z_{2b}),\\&\tilde{h_{12}}=(\beta ^2-1)\sinh (\beta \cosh ^{-1}z_{2b}),\\&\tilde{h_{13}}=\beta \sqrt{z_{2b}^2-1}\sinh (\beta \cosh ^{-1}z_{2b})\\&\quad -z_{2b}\cosh (\beta \cosh ^{-1}z_{2b}),\\&\tilde{h_{14}}=\beta \sqrt{z_{2b}^2-1}\cosh (\beta \cosh ^{-1}z_{2b})\\&\quad -z_{2b}\sinh (\beta \cosh ^{-1}z_{2b}),\\&\tau =\frac{\lambda -\kappa }{2z_{2b}\kappa },\\&z_{2}(r)=\sqrt{\frac{\lambda }{\lambda -\kappa }}\sqrt{1+\kappa \frac{r^2}{R^2}},\\&z_{2b}=\sqrt{\frac{\lambda }{\lambda -\kappa }}\sqrt{1+\kappa \frac{b^2}{R^2}},\\&\beta =\sqrt{2-\frac{\lambda }{\kappa }(1-\alpha )} \end{aligned}$$

and

$$\begin{aligned} \beta '=\sqrt{\frac{\lambda }{\kappa }(1-\alpha )-2}. \end{aligned}$$

Case III: \(\kappa =0\)

$$\begin{aligned} F_{g}= & {} -\frac{4\lambda r}{R^4}\frac{h_{15}(r)}{(1+\lambda \frac{r^2}{R^2})^2}\left[ 1+\frac{2(1+\lambda \frac{r^2}{R^2})}{\lambda }h_{15}(r)\right] ,\nonumber \\ \end{aligned}$$
(89)
$$\begin{aligned} F_{h}= & {} -\frac{2r}{R^4}\left[ \frac{\alpha \lambda ^2}{4(1\,{+}\,\frac{\lambda }{2}\frac{r^2}{R^2})^2}\,{-}\,\frac{2\lambda h_{15}(r)}{(1\,{+}\,\lambda \frac{r^2}{R^2})^2}\,{-}\,\frac{4h_{15}^2(r)}{1\,{+}\,\lambda \frac{r^2}{R^2}}\right] ,\end{aligned}$$
(90)
$$\begin{aligned} F_{a}= & {} \frac{\alpha \lambda ^2 r}{2R^4(1+\frac{\lambda }{2}\frac{r^2}{R^2})^2}, \end{aligned}$$
(91)

where

\(h_{15}(r)=\dfrac{\lambda }{4}\left[ \dfrac{h_{16}(r)+h_{17}(r)}{h_{18}(r)}\right] \) for \(\alpha <1\),

\(=\dfrac{\lambda }{4}\left[ \dfrac{(L_{4}z_{3}(r)+1)+L_{4}\sqrt{1+\lambda \frac{r^2}{R^2}}}{(1+\frac{\lambda }{2}\frac{r^2}{R^2})(L_{4}z_{3}(r)+1)}\right] \) for \(\alpha =1\),

\(=\dfrac{\lambda }{4}\left[ \dfrac{h_{19}(r)+h_{20}(r)}{h_{21}(r)}\right] \) for \(\alpha >1\),

\(h_{16}(r)=L_{3}\sin (\sqrt{1-\alpha }z_{3r})+\cos (\sqrt{1-\alpha }z_{3r})\),

\(h_{17}(r)=\sqrt{1-\alpha }\sqrt{\bigg (1+\lambda \dfrac{r^2}{R^2}\bigg )}\)

\(\quad \times \left\{ L_{3}\cos (\sqrt{1-\alpha }z_{3}(r))-\sin (\sqrt{1-\alpha }z_{3}(r))\right\} \),

\(h_{18}(r)=\bigg (1+\dfrac{\lambda }{2}\dfrac{r^2}{R^2}\bigg )L_{3}\sin (\sqrt{1-\alpha }z_{3}(r))\)

\(+\bigg (1+\dfrac{\lambda }{2}\dfrac{r^2}{R^2}\bigg )\cos (\sqrt{1-\alpha }z_{3}(r))\),

\(h_{19}(r)=L_{5}\mathrm {e}^{\sqrt{\alpha -1}z_{3}(r)}+\mathrm {e}^{-\sqrt{\alpha -1}z_{3}(r)}\),

\( h_{20}(r)=\sqrt{\alpha -1}\sqrt{1+\lambda \dfrac{r^2}{R^2}}(L_{5}\mathrm {e}^{\sqrt{\alpha -1}z_{3}(r)}\)

\(\quad -\mathrm {e}^{-\sqrt{\alpha -1}z_{3}(r)})\),

\(h_{21}(r)=\bigg (1+\dfrac{\lambda }{2}\dfrac{r^2}{R^2}\bigg )h_{19}(r)\),

$$L_{3}=\dfrac{(\frac{\lambda }{2}\frac{b^2}{R^2})\cos (\sqrt{1-\alpha }z_{3b})+\sqrt{1-\alpha }\sqrt{1+\lambda \frac{b^2}{R^2}}\sin (\sqrt{1-\alpha }z_{3b})}{\sqrt{1-\alpha }\sqrt{1+\lambda \frac{b^2}{R^2}}\cos (\sqrt{1-\alpha }z_{3b})-(\frac{\lambda }{2}\frac{b^2}{R^2})\sin (\sqrt{1-\alpha }z_{3b})},$$

\(L_{4}=\frac{\frac{\lambda }{2}\frac{b^2}{R^2}}{\sqrt{1+\lambda \frac{b^2}{R^2}}-\frac{\lambda }{2}\frac{b^2}{R^2}z_{3b}}\),

\(L_{5}=\frac{\frac{\lambda }{2}\frac{b^2}{R^2}+\sqrt{\alpha -1}\sqrt{1+\lambda \frac{b^2}{R^2}}}{\sqrt{\alpha -1}\sqrt{1+\lambda \frac{b^2}{R^2}}-\frac{\lambda }{2}\frac{b^2}{R^2}}\mathrm {e}^{-2\sqrt{\alpha -1}z_{3b}}\),

\(z_{3}(r)=\sqrt{1+\lambda \dfrac{r^2}{R^2}}-\tan ^{-1}\bigg (\sqrt{1+\lambda \dfrac{r^2}{R^2}}\bigg )\),

\(z_{3b}=\sqrt{1+\lambda \dfrac{b^2}{R^2}}-\tan ^{-1}\bigg (\sqrt{1+\lambda \dfrac{b^2}{R^2}}\bigg ).\)

Fig. 27
figure 27

Variation of different forces with respect to radial distance (r) inside 4U 1608-52. Here solid, dotted and dashed curves represent \(\kappa =-0.5\), \(\kappa =0\) and \(\kappa =0.5\), respectively. Here we have used (i) \(\lambda =2\), \(\kappa =-0.5,\) (ii) \(\lambda =2\), \(\kappa =0\) and (iii) \(\lambda =50\), \(\kappa =0.5\). The anisotropy parameter \(\alpha \) is set to 0.1.

From figure 27, we observe that gravitational force (\(F_{g}\)), hydrostatic force (\(F_{h}\)) and anisotropic force (\(F_{a}\)) are finite and continuous at the centre and throughout the interior of the compact object considered here. The anisotropic force (\(F_{a}\)) increases monotonically from the centre up to the surface whereas both gravitational (\(F_{g}\)) and hydrostatic (\(F_{h}\)) forces increase from the centre, pick up maximum value at some point interior to the compact object then decreases towards the boundary. It is also noted that the hydrostatic (\(F_{h}\)) and anisotropic (\(F_{a}\)) forces together balance the gravitational force (\(F_{g}\)) so that their resultant effect is zero throughout the interior of the stellar model. Hence, our model is in stable equilibrium under the mutual influence of these forces for the choice of new parameter \(\kappa \) in the metric ansatz.

8.2 Herrera cracking condition

For any anisotropic stellar model, it is required that the stellar model should be stable against fluctuations of its physical parameters. A criterion known as ‘cracking’ was introduced by Herrera [86] to check if an anisotropic matter configuration is stable or not. Abreu et al [87] gave a criterion on the basis of Herrera’s concept which depicts that any stellar model will be stable if the radial (\(v_{r}\)) and tangential (\(v_{t}\)) sound speeds satisfy the condition

$$\begin{aligned} 0 \le |v_{t}^{2}-v_{r}^2| \le 1. \end{aligned}$$
(92)
Fig. 28
figure 28

Variation of \(|v_{t}^{2}-v_{r}^2|\) with respect to radial distance (r) inside 4U 1608-52. Here solid, dotted and dashed curves represent \(\kappa =-0.5\), \(\kappa =0\) and \(\kappa =0.5\) respectively. Here we have used (i) \(\lambda =2\), \(\kappa =-0.5,\) (ii) \(\lambda =2\), \(\kappa =0\) and (iii) \(\lambda =50\), \(\kappa =0.5\). The anisotropy parameter \(\alpha \) is set to 0.1.

The difference between the square of the tangential and radial sound velocities is shown in figure 28 for 4U 1608-52. It is found that Abreu’s inequality given by eq. (92) is satisfied throughout the interior of the compact star mentioned here. Therefore, the model adopted here is stable for the choice of new parameter \(\kappa \) in the metric ansatz.

8.3 Adiabatic index

The relativistic adiabatic index (\(\Gamma \)) is defined as

$$\begin{aligned} \Gamma =\frac{\rho +p_{r}}{p_{r}}\bigg (\frac{\mathrm {d}p_{r}}{\mathrm {d}\rho }\bigg )=\frac{\rho +p_{r}}{p_{r}}v_{r}^{2}. \end{aligned}$$
(93)

According to Heintzmann and Hillebrandt [88], the stability of a Newtonian isotropic fluid sphere requires that \(\Gamma > \frac{4}{3}\). For a relativistic anisotropic fluid sphere, Chan et al [89] showed that this Newtonian limit changes to

$$\begin{aligned} \Gamma >\Gamma ' \end{aligned}$$
(94)

where

$$\begin{aligned} \Gamma '=\frac{4}{3}-\left[ \frac{4}{3}\frac{(p_{r}-p_{t})}{|p'_{r}|r}\right] _{\mathrm {max}}. \end{aligned}$$
(95)
Fig. 29
figure 29

Plot of adiabatic index (\(\Gamma \)) with respect to radial distance (r) inside 4U 1608-52. Here solid, dotted and dashed curves represent \(\kappa =-0.5\), \(\kappa =0\) and \(\kappa =0.5,\) respectively. Here we have used (i) \(\lambda =2\), \(\kappa =-0.5,\) (ii) \(\lambda =2\), \(\kappa =0\) and (iii) \(\lambda =50\), \(\kappa =0.5\). The anisotropy parameter \(\alpha \) is set to 0.1. The horizontal black line represents \(\Gamma '\) as given by eq. (95).

Table 11 Equation of state for 4U 1608-52.

In figure 29 the adiabatic index is plotted for 4U 1608-52. It is evident that the condition given by Chan et al [89] is satisfied throughout the interior of the compact object considered here for the choice of new parameter \(\kappa \) in the metric ansatz.

9 Equation of state

The equation of state (EOS) has a significant effect on mass–radius relation and structural properties of a compact object. However, the EOS of matter near the core region of a compact object is not well understood till date. Many investigators have approximated a linear EOS [90,91,92,93] to explain the structural properties of such compact objects. Vaidya–Tikekar model admitting spheroidal geometry has been used by Sharma and Mukherjee [94] to obtain core envelope model of a compact object. In their work, the spheroidal parameter \(\lambda \) itself determines the EOS. Recently, Singh et al [95] obtained a core envelope structure by assuming three layered neutron star defined by different EOS for its matter. The maximum mass and radius of a compact object using MIT Bag EOS have been determined by Goswami et al [96] in higher-dimensional spheroidal space–time geometry. In the present work, due to the complexity in the expressions of energy density (\(\rho \)) and pressure (\(p_r\)), it is difficult to obtain an analytical relation between pressure and density. Therefore, we adopt a numerical technique to predict the EOS. The EOS of the interior matter of 4U 1608-52 in this model is shown in table 11 for different combinations of \(\lambda \), \(\kappa \) and \(\alpha \).

Fig. 30
figure 30

Linear and quadratic fitted equations of state for 4U 1608-52 taking \(\alpha =0.1\) and \(\kappa =-1.0\).

To predict EOS, we fit the data set of energy density \((\rho )\) and radial pressure \((p_r)\) for various combinations of parameters and note that the linear fit agrees with the EOS approximately having slope \(\frac{1}{3}\), and therefore corresponds to MIT Bag model equation of state [16, 17] having the value of Bag constant given in table 11. From table 11, we note that for a suitable combination of \(\lambda \), \(\kappa \) and \(\alpha \), the model allows MIT Bag EOS for 4U 1608-52. A quadratic EOS is also presented for the chosen values of model parameters. It is also interesting to note that \(\lambda \) has no effect on EOS for \(\kappa =0\). Therefore, in this case EOS is only \(\alpha \)-dependent. In figure 30, the EOS for the interior matter content of 4U 1608-52 is plotted for \(\alpha =0.1\) and \(\kappa =-1.0\). It is observed that quadratic fit nearly follows the actual data sets obtained from our model.

10 Conclusions

The main objective of this paper is to investigate the effects of an extra parameter (\(\kappa \)) included in the metric ansatz given in eq. (7), which may be looked upon as the generalised Vaidya–Tikekar metric, on global properties like mass–radius relation, maximum mass, energy density, pressure, surface redshift etc. We note some interesting results due to the inclusion of extra parameter (\(\kappa \)) in the metric potential. In this article, we have presented relativistic solutions of a class of anisotropic compact objects described by a modified Vaidya–Tikekar ansatz which are regular and well-behaved. Solutions of EFE are available using Vaidya–Tikekar ansatz in spheroidal and pseudospheroidal geometry characterised by a spheroidal parameter \(\lambda \) and a geometrical parameter R. In the present work, we have considered a closed form of the metric ansatz by introducing an extra parameter (\(\kappa \)) so that by switching this parameter to particular values, the known forms of the metric ansatz and their corresponding solutions are recovered. For instance, one can recover the ansatz in ref. [20] by setting \(\kappa =-1\) or that in ref. [30] by puting \(\kappa =1\). A series solution of this particular type of metric ansatz given in eq. (7) was previously obtained by Komathiraj and Maharaj [44]. We present here a different procedure in which an analytical solution is obtained in terms of trigonometric and algebraic functions which is a more desirable form for the physical description of a relativistic compact object. Here, we have two independent parameters that can define the pressure and density relation to describe EOS. It is worthwhile to mention that this type of metric ansatz also appears in the work of different researchers [45,46,47, 49]. We particularly obtain a solution similar to Mukherjee et al [62], Tikekar and Jotania [30] and others [31, 32]. For \(\kappa <0\) and \(\kappa >0\), a lower bound on the spheroidal parameter \(\lambda \) is obtained which reduces for isotropic case to \(\lambda >\frac{3}{17}\) and \(\lambda >5\) for \(\kappa =-1\) and \(\kappa =1\) respectively, thus follows the earlier results of Mukherjee et al [62] and Chattopadhyay and Paul [32]. In the present work, we generate wider range of \(\lambda \) by including the pressure anisotropy (\(\alpha \)) for well-behaved solutions. Inclusion of the new parameter \(\kappa \) in the \(g_{rr}\) component of metric potential increases the allowed values of anisotropy parameter \(\alpha \) as given in eqs (58) and (59) upto which the physically viable model can be constructed for compact stars. Another notable feature of our present model is that for \(\kappa =0\), we get Matese and Whitman solution [64] in anisotropic regime. Three different categories of solutions are possible in this case depending on the value of anisotropy parameter \(\alpha \). One such solution was not considered in refs [64, 65] due to its unphysical behaviour in the determination of density and pressure. Here, we generate physically realistic solution in the presence of anisotropy for \(\kappa =0\). Moreover, for \(\alpha >1\), our anisotropic extension of Matese and Whitman solution exhibits monotonically decreasing sound velocity which imposes another restriction on the value of anisotropy parameter \(\alpha \) given in eq. (79). In figures 1013, we have plotted maximum mass contained within a radius for different values \(\kappa \). It is noted that when \(\kappa \rightarrow 0\), the maximum mass is almost independent of the spheroidal parameter \(\lambda \) and maximum mass approaches a constant value when \(\lambda \) takes large values for any \(\kappa \). The maximum mass for \(\kappa =0\) is tabulated in table 3. In the case of an isotropic star, maximum mass increases with the decrease of \(|\kappa |\) as evident from figures 10 and 11 and when \(\kappa \rightarrow 0\), maximum mass approaches the value \(\sim \) \(2.433M_\odot \) corresponding to the case \(\kappa =0\). But, in the presence of anisotropy, maximum mass approaches \(\sim \) \(2.58M_\odot \) when \(\kappa \rightarrow 0\) for \(\alpha =0.3\) as evident from figures 12 and 13, which is greater than the maximum mass obtained from the case \(\kappa =0\) \((\sim {2.5}M_\odot )\) having the same \(\alpha \) \((=0.3)\) and radius \((b=10~\mathrm {km})\). We also found that maximum mass corresponding to \(\kappa =0\) is independent of the spheroidal parameter \(\lambda \). In this case, the maximum mass \((\sim 3.2M_\odot )\) of a compact object predicted by Rhoades and Ruffini [73] can be achieved in our model with \(\alpha =0\), \(b=13.15\) km and \(\alpha =0.3\), \(b=12.815\) km, i.e., for \(\kappa =0\), radius of a compact object having maximum mass depends only on anisotropy parameter \(\alpha \). Mass to radius ratio is found to remain below the Buchdahl limit (4/9) for the choices of new parameter \(\kappa \). Calculation of maximum mass shows that it increases with the increase in anisotropy. A plausible explanation of this result is that for higher anisotropy, radial pressure decreases and since density remains unchanged, equation of state is softer for higher anisotropy which allows more mass for a given radius. The mass vs. radius plots in figures 3 and 5 show that for higher central density, higher mass is contained within a given radius. However, for \(\kappa =-7\) it is observed that mass corresponding to lower central density becomes higher than that for higher central density which is shown in figure 3. The density and pressure are regular, positive and well-behaved as evident from figures 1417. The pressure and density gradients are negative as shown in figures 18 and 19. In the linear approximation, the best fit corresponds to MIT Bag model EOS which is obtained by properly choosing model parameters \(\kappa \), \(\lambda \) and \(\alpha \) as shown in table 11 for 4U 1608-52. Apart from these features, our model also satisfies all the stability criteria.