1 Introduction

Due to the highly nonlinear behavior of Einstein’s field equations, it remains a great challenge to obtain solutions that meet the requirements in order to be an admissible solution from both physical and mathematical point of view [1]. The early works by Schwarzschild [2], Tolman [3] and Oppenheimer and Volkoff [4] on self-gravitating isotropic fluid spheres, established (as was pointed out by Murad [5]) two classical approaches that can be followed so as to resolve the field equations. The first one consists in making a suitable assumption for one of the metric functions or for the energy density. This leads to the remaining unknown variables, which are the isotropic pressure and the other metric potential. However, in the framework of this scheme not always is possible to obtain an acceptable solution (sometimes one obtain nonphysical pressure-density configurations). The second approach starts with an equation of state which is integrated (iteratively from the center of the compact object) until the pressure vanished indicating that the object surface has been reached. As before, this scheme also presents some drawbacks since it does not always lead to a closed form of the solutions.

On the other hand, a stellar configuration not necessary need to meet the isotropic condition at all (equal radial \(p_{r}\) and tangential \(p_{t}\) pressure). In fact, the theoretical studies by Ruderman [6], Canuto [7,8,9] and Canuto et al.  [10,11,12,13] revealed that when the matter density is higher than the nuclear density, it may be anisotropic in nature and must be treated relativistically. So, relaxing the isotropic condition and allow the presence of anisotropies (it leads to unequal radial and tangential pressure \(p_{r}\ne p_{t}\)) within the stellar configuration represent a more realistic situation in the astrophysical sense. Furthermore, Bowers and Liang’s pioneering contribution to local anisotropic properties [14] for static spherically symmetric and relativistic configurations, gave rise an extensive studies within this framework, specifically studies focused on the dynamical incidence of the anisotropies in the arena of equilibrium and stability on collapsed structures [15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]. Moreover, as Mak and Harko have contended [35], anisotropy can merge in various settings such as: the presence of a strong center or by the existence of type 3A superfluid [42], pion condensation [43] or various types of regime transitions [44].

Over the years many researches have successfully addressed the investigation and comprehension of the pretended by the anisotropy in astrophysical insides [45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81]. The nearness of anisotropy presents a few highlights in the distribution of matter, e.g. if we have a positive anisotropy parameter \(\varDelta \equiv p_{t}-p_{r}>0\), the astrophysical configuration encounters a repulsive force (attractive in the situation of negative anisotropy parameter) that counteracts the gravitational slope. Consequently, it permits the construction of more compact stars when utilizing anisotropic fluid than when utilizing isotropic fluid [27, 33, 35, 82, 83]. Moreover, a positive anisotropy parameter upgrades the stability and the stellar system equilibrium.

After the study of Randall and Sundrum [84] on the theory of brane, the embedding of n-dimensional space \(V^{n}\) in a pseudo-Euclidean space \(E^{n}\) attracted much consideration. Many authors also use embedded spaces for the investigation of string and membranes, extrinsic gravity, solid particles, and Zitterbewegung theory [85]. In the event that a n-dimensional at space \(V^{n}\) can be incorporated in (\(n+p\))-dimensional space, where p is a floor amount of additional dimensions, at this stage \(V^{n}\) is aforesaid to be p-class embedding. Numerous physically significant arrangements, for instance, the Kerr metric [86] belong to class five (\(p=5\)), the well-known Schwarzschild external solution [87] belong to class two (\(p=2\)), interior solutions of Schwarzschild and The Universe of Friedmann [87] belong to class one (\(p=1\)). Two solutions for isotropic pressure are generally conceivable. The first one is the Schwarzschild interior in which the inner solution is conformally flat, which depicts a limited configuration. The second case is the Kohler-Chao solutions in which the inner solution is conformally non-flat, representing limitless configurations.

In recent years, the use of the embedding class one spacetime via Karmarkar [88] condition as a methodical and powerful technique for obtaining new and pertinent arrangements from the field equations of Einstein, has developed [89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123]. For a spherically symmetric 4-dimensional spacetime, the Karmarkar condition in terms of curvature components takes the form

$$\begin{aligned} R_{1010}R_{2323}-R_{1212}R_{3030}=R_{1220}R_{1330}. \end{aligned}$$
(1)

However, as was pointed out by Sharma and Pandey [124], the above condition is not enough to spherically symmetric 4-dimensional spacetime render to be class one. So, in order to be class one a 4-dimensional manifold must satisfies

$$\begin{aligned} R_{2323}\ne 0, \end{aligned}$$
(2)

along with (1). As we will see later Eqs. (1) and (2) arrive to a specific differential equation that connects the two metric potentials \(e^{\nu }\) and \(e^{\lambda }\). Therefore, one only needs to define one of the metric potential. Finally the remainder of the physical quantities like density, pressure, sound speed, anisotropy, etc. can be entirely established from \(e^{\nu }\) and \(e^{\lambda }\). Moreover, our stellar model incorporates a family of new solutions for a static spherically symmetric anisotropic ïňĆuid structure within the class I condition to find the full space-time representation interior the stellar system.

The remainder of the article is arranged as follows: Sect. 2 presents the Einstein’s field equations for anisotropic matter distributions and the approach followed in order to solve them, in Sect. 3 we match the obtained model with the exterior spacetime given by Schwarzschild metric, in order to obtain the constant parameters. In Sect. 4 we analyze the physical and mathematical features of the model, studying analytic and graphically the behavior of the metric potentials, thermodynamic observables, mass function, Moment of inertia(I), energy conditions and central and surface redshift. Section 5 is devoted to the study of the equilibrium via Tolman–Oppenheimer–Volkoff (TOV) equation and the steadiness of the present stellar system via Abreu’s criterion, relativistic adiabatic index and Harrison–Zeldovich–Novikov criterion. The Herrera-Ospino- Prisco generators of the solution has been discussed in Sect. 6. At last, the concluding remarks close this paper.

2 Einstein’s field equations

In Schwarzschild like coordinates, the inside of a compact static spherically symmetric object is represented by the following line element

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

where \(\nu =\nu (r)\) and \(\lambda =\lambda (r)\) are purely radial functions only. Assuming an anisotropic matter distribution within the stellar configuration, the corresponding stress–energy tensor is

$$\begin{aligned} T^{\nu }_{\mu }=\left( \rho +p_{t}\right) U^{\nu }U_{\mu }-p_{t}\delta ^{\nu }_{\mu }- \left( p_{t}+p_{r}\right) V^{\nu }V_{\mu }, \end{aligned}$$
(4)

being \(U^{\nu }\) the four-velocity \(e^{\nu (r)/2} U^{\alpha } = \delta ^{\alpha }_{0}\), while \(V^{\alpha }\) is a unit spacelike vector in the radial direction \(V^{\alpha }= e^{-\lambda /2}\delta ^{\alpha }_{1}\), which is orthogonal to \(U^{\alpha }\). Here \(\rho \), \(p_{r}\), \(p_{t}\) are the matter density, the radial pressure and the transverse pressure of the fluid in the orthogonal direction to \(p_{r}\), respectively. Then, the Einstein field equations for the above line element (3) and the stress–energy tensor (4) are expressed as

$$\begin{aligned} 8\pi {\rho }= & {} \frac{1}{r^2}-e^{-\lambda }\left( \frac{1}{r^2}-\frac{\lambda ^{\prime }}{r}\right) , \end{aligned}$$
(5)
$$\begin{aligned} 8\pi {p}_{r}= & {} -\frac{1}{r^2}+e^{-\lambda }\left( \frac{1}{r^2}+\frac{\nu ^{\prime }}{r}\right) , \end{aligned}$$
(6)
$$\begin{aligned} 8\pi {p}_{t}= & {} \frac{1}{4}e^{-\lambda }\left( 2\nu ^{\prime \prime }+\nu ^{\prime 2}-\lambda ^{\prime }\nu ^{\prime }+2\frac{\nu ^{\prime }-\lambda ^{\prime }}{r}\right) . \end{aligned}$$
(7)

The primes denote the derivative as a function to the radial coordinate r. From now, we will work in the units where \(c=G=1\).

So, combining the expressions (6) and (7) we get

$$\begin{aligned} \varDelta\equiv & {} {p}_{t}-{p}_{r} \nonumber \\= & {} \frac{e^{-\lambda }}{8\pi }\bigg [\frac{\nu ^{\prime \prime }}{2}-\frac{\lambda ^{\prime }\nu ^{\prime }}{4}+\frac{\nu ^{\prime 2}}{4}+\frac{\nu ^{\prime }-\lambda ^{\prime }}{2r}+\frac{e^{\lambda }-1}{r^{2}}\bigg ], \end{aligned}$$
(8)

where \(\varDelta \) is called the anisotropy parameter which measures the anisotropy inner the spherical object.

2.1 Karmarkar condition

At this stage we have five unknown function, namely \(\nu \), \(\lambda \), \(\rho \), \(p_{r}\) and \(p_{t}\). In order to solve the system of Eqs. (5)–(7) we employ the method used by Karmarkar [88] where the obtained solutions are classified as class one spacetime. In this method the Riemann curvature tensor \(R_{\alpha \beta \mu \nu }\) satisfies a particular equation that finally links the two metric component \(e^{\nu }\) and \(e^{\lambda }\) in a single equation, i.e. the two metric components are dependent on each other.

The non zero component of the Riemann curvature tensor for the line element (3) are

$$\begin{aligned} R_{1010}= & {} -e^{\nu }\left( \frac{\nu ^{\prime \prime }}{2}-\frac{\lambda ^{\prime }\nu ^{\prime }}{4}+\frac{\nu ^{\prime 2}}{4}\right) , \end{aligned}$$
(9)
$$\begin{aligned} R_{2323}= & {} -e^{-\lambda }r^{2}\sin ^{2}\theta \left( e^{\lambda }-1\right) , \end{aligned}$$
(10)
$$\begin{aligned} R_{3030}= & {} -\frac{r}{2}\nu ^{\prime }e^{\nu -\lambda }\sin ^{2}\theta , \end{aligned}$$
(11)
$$\begin{aligned} R_{1212}= & {} -\frac{r}{2}\lambda ^{\prime }, \end{aligned}$$
(12)

then all the above components of Riemann curvature satisfy Karmarkar condition [88]

$$\begin{aligned} R_{1010}R_{2323}-R_{1212}R_{3030}=R_{1220}R_{1330}. \end{aligned}$$
(13)

However, as was pointed out by Pandey and Sharma [124], the above condition is only a necessary one but it is not sufficient to spacetime becomes class one. In order to be class one a spacetime must satisfies (13) along with \(R_{2323}\ne 0\) [124].

On substituting (9)–(12) in (13) we obtain the following differential equation

$$\begin{aligned} 2\frac{\nu ^{\prime \prime }}{\nu ^{\prime }}+\nu ^{\prime }=\frac{\lambda ^{\prime }e^{\lambda }}{e^{\lambda }-1}, \end{aligned}$$
(14)

with \(e^{\lambda }\ne 1\). Solving (14) we arrive to

$$\begin{aligned} e^{\nu }=\bigg (A+B\,\int {\sqrt{e^{\lambda (r)}-1}\,dr}\bigg )^2, \end{aligned}$$
(15)

where A and B are an integration constants. Expression (15) establishes a relationship between the metric potentials \(e^{\nu }\) and \(e^{\lambda }\). Using the Karmarkar condition (15) in the expression for anisotropy (8) we get [99],

$$\begin{aligned} \varDelta (r)= & {} \frac{\nu ^{\prime }}{32\pi \,e^\lambda } \bigg [\frac{2}{r}-\frac{\lambda ^{\prime }}{e^\lambda -1} \bigg ] \bigg [\frac{\nu ^{\prime } e^\nu }{2\,r\,B^2}-1 \bigg ]. \end{aligned}$$
(16)

2.2 Relativistic embedding class one solution

Now, we have a system of equations consisting of four equations, more precisely, the Einstein field equations (5)–(8) and five unknowns, namely \(\rho (r)\) \(p_r(r)\), \(p_t(r)\), \(\nu (r)\) and \(\lambda (r)\). Hence to find the determinate solution of the system of equations, we need two conditions which are as follows: (a) either by picking a particular gravitational mass expressions m(r) by that deciding the state equation must take the specific form \(p=p(\rho )\), (b) or developing a connection between the metric potentials \(\nu (r)\) and \(\lambda (r)\). Hence, to acquire a well-behaved solution, both metric potentials must meet certain physical and mathematical prerequisites realizing that gravitational potentials can not be built arbitrarily. In this respect, Lake [125] has performed that the gravitational potential \(\nu (r)\) ought to be regular, finite, monotonic increasing function and free from any singularities inside the stellar configuration, which gives a physically acceptable fluid spherical object solution of Einstein’s field equations. However, \(e^{\lambda (r)}=1+O(r^2)\) is necessary for a physically feasible structure to be regular at the origin. In this paper, in order to solve the field equations, we will attribute a physically feasible form of the metric potential \(\lambda (r)\) that fulfills the above prerequisites, then using embedding class I condition to establish another metric potential \(\nu (r)\). Therefore, we will not consider any system state equations in this investigation. For this purpose, we assume new gravitational potential to find new closed-form solutions of Einstein’s field equation for anisotropic fluid spherical objects,

$$\begin{aligned} e^{\lambda (r)}=1 +a r^2\,[1 + \sin (br^2 + c)]^n \end{aligned}$$
(17)

We pointed out that the above metric function is a generalization of Fuloria and Pant [126] solution.

Employing (17) into (15) we get

$$\begin{aligned} e^{\nu }=\left( A+\frac{\sqrt{2\,a}\, B\, \cos (br^2+c)\,F(r)\,f_1(r)\,f_2(r)}{b (n+1)\,\sqrt{1 - \sin (b r^2+c)}}\right) ^2 \end{aligned}$$
(18)

where, \(F(r)= 2F\big [\frac{1 + n}{2},\frac{1}{2}, \frac{3+n}{2}, \sin ^2\big (\frac{2 c + \pi + 2 b r^2}{4}\big )\big ]\) represents a Gauss hypergeometric function and

$$\begin{aligned} f_1(r)= & {} [(\cos (c + br^2)/2 + \sin (c + br^2)/2 )^2]^{-n/2}\\ f_2(r)= & {} [1 + \sin (c+br^2)]^{n} \end{aligned}$$

where A and B are constant parameters.

Therefore, the class one spacetime reads

$$\begin{aligned} ds^{2}= & {} \left( A+\frac{\sqrt{2\,a}\, B\, \cos (br^2+c)\,F(r)\,f_1(r)\,f_2(r)}{b (n+1)\,\sqrt{1 - \sin (b r^2+c)}}\right) ^2\,dt^{2}\nonumber \\&-\frac{1}{1 +a r^2\,[1 + \sin (br^2 + c)]^n }dr^{2}-r^{2}d\varOmega ^{2}, \end{aligned}$$
(19)

where \(d\varOmega ^{2}\equiv \sin ^{2}\theta ~d\phi ^{2}+d\theta ^{2}\). On employing (17) and (18), one can rewrite the quantities of \(\rho \), \(p_{r}\), \(p_{t}\) and \(\varDelta \) as

$$\begin{aligned} \rho (r)= & {} \frac{a\,[1 + \sin (c + b r^2)]^{n-1}}{\big (1 + a r^2 [1 + \sin (c + b r^2)]^n\big )^2}\Big [2\,b\,n\,r^2\, \cos (c + b r^2) \nonumber \\&+\big \{1 + \sin (c + b r^2)\big \}\,\big (3+ a r^2\, [1 + \sin (c + b r^2)]^n\big )\Big ],\nonumber \\ \end{aligned}$$
(20)
$$\begin{aligned} p_r(r)= & {} \frac{1}{f(r)~\big [1 + a r^2 (1 + \sin (br^2+c))^n\big ]} \Big [4\,\sqrt{a}~B \nonumber \\&\quad \sqrt{[1 + \sin (br^2+c)]^n}-{af(r) \over [1 + \sin (br^2+c)]^{-n}} \Big ], \end{aligned}$$
(21)
$$\begin{aligned} p_t(r)= & {} \frac{\{1 + \sin (br^2+c)\}^{-1}}{f(r)\,\big [1 + a r^2 \{1 + \sin (br^2+c)\}^n\big ]^2} \bigg (-b\,n r^2\nonumber \\&\quad \cos (br^2+c)\,\Big [\sqrt{a}\,f(r)\,\{1 +\sin (br^2+c)\}^n - 2 B \nonumber \\&\quad \sqrt{\{1 +\sin (br^2+c)\}^{n}}\,\Big ]+\{1+\sin (br^2+c)\} \Big [-\sqrt{a} \nonumber \\&\quad f(r) \,\{1 + \sin (br^2+c)\}^n+4 B \sqrt{\{1 + \sin (br^2+c)\}^n}\nonumber \\&\quad + 2 a B r^2 \{1 +\sin (br^2+c)\}^{3/2}\Big ]\,\bigg ), \end{aligned}$$
(22)
$$\begin{aligned} \varDelta (r)= & {} \frac{\{1 + \sin (br^2+c)\}^{-1}}{f(r)\,\big [1 + a r^2 \{1 + \sin (br^2+c)\}^n\big ]^2} \bigg (\sqrt{a}\,r^2 \Big [-bn \nonumber \\&\quad \cos (c + b r^2) + a\,\{1 + \sin (br^2+c)\}^{1 + n}\Big ] \Big [\sqrt{a}\,f(r) \nonumber \\&\quad \{1 + \sin (br^2+c)\}^n - 2\,B\,\sqrt{1 + \sin (br^2+c)} \Big ]\bigg ). \end{aligned}$$
(23)

where,

$$\begin{aligned}&f(r)=\bigg (A+\frac{\sqrt{2\,a}\, B\, \cos (br^2+c)\,F(r)\,f_1(r)\,f_2(r)}{b (n+1)\,\sqrt{1 -\sin (b r^2+c)}}\bigg ) \end{aligned}$$

3 Junction conditions

We must match our inside solution (3) to the outside Schwarz-schild solution at the limit of the spherical object, in order to find the arbitrary constants A, B and a. The line element of the external Schwarzschild solution [2] is given by

$$\begin{aligned} ds^{2}=\left( 1-\frac{2M}{r}\right) dt^{2}-\left( 1-\frac{2M}{r}\right) ^{-1}dr^{2} -r^{2}d\varOmega ^{2}.\nonumber \\ \end{aligned}$$
(24)

In this regard, we are going to use the Israel-Darmois junction conditions [127, 128]. Now at the limit \(r=R\) the coefficients of \(g_{tt}\) and \(g_{rr}\) all are continuous. This implies

$$\begin{aligned}&A+\frac{\sqrt{2\,a}\, B\, \cos (bR^2+c)\,F(R)\,f_1(R)\,f_2(R)}{b (n+1)\,\sqrt{1 - \sin (b R^2+c)}} \nonumber \\&\quad = \sqrt{1-\frac{2{M}}{R}}, \end{aligned}$$
(25)
$$\begin{aligned}&1 +a R^2\,[1 + \sin (bR^2 + c)]^n = \left( 1-\frac{2{M}}{R}\right) ^{-1} . \end{aligned}$$
(26)

Moreover, the null radial pressure condition at the boundary

$$\begin{aligned} p_{r}(R)=0, \end{aligned}$$
(27)

leads to

$$\begin{aligned} \frac{A}{B}= & {} \frac{1}{\sqrt{a}\,b\,(1 + n)\,\sqrt{1 - \sin (c + b R^2)}}\nonumber \\&\quad \times \Bigg [ \{1 +\sin (c + b R^2)\}^{-n} \sqrt{\{1 + \sin (c + b R^2)\}^n}\nonumber \\&\quad \times \bigg (4\, b\, (1 + n)\, \sqrt{1 - \sin (c +b R^2)}\nonumber \\&\quad -\sqrt{2} f_2(R)\, a \cos (c + b R^2) F (R)\nonumber \\&\quad \quad \times \big [1 + \sin (c + b R^2) \big ]^{\frac{3n}{2}}\bigg )\Bigg ], \end{aligned}$$
(28)
$$\begin{aligned} B= & {} \frac{M}{R^2\,\sqrt{a}\,\sqrt{[1+\sin (c+bR^2)]^n}}\,\sqrt{\frac{R}{R-2M}} , \end{aligned}$$
(29)
$$\begin{aligned} a= & {} \frac{2M}{R^2(R-2M)\,[1+\sin (bR^2+c)]^n} \end{aligned}$$
(30)

where,

$$\begin{aligned} F(R)= & {} 2F\bigg [\frac{1 + n}{2},\frac{1}{2}, \frac{3+n}{2}, \sin ^2\Big (\frac{2 c + \pi + 2 b R^2}{4}\Big )\bigg ],\\ f_{1}(R)= & {} \Big [\cos (c + bR^2)/2 + \sin (c + bR^2)/2 \Big ]^{-n}\\ f_2(R)= & {} \Big \{1 + \sin (c+bR^2)\Big \}^{n/2}\,\sqrt{\{1 + \sin (c+bR^2)\}^n} \end{aligned}$$

Equations (28), (29) and (30) are the requisite and sufficient conditions to establish the constants A, B and a. In addition, the values of the radius R and the mass M have been determined founded on the acquired data from the strange spherical object candidate SAX J1808.4-3658 (\(M=0.9 ~M_{\odot }\), \(R=7.951 ~km\)) as reported by Elebert et al. [129], and we also chose n, b and c as free parameters.

4 Physical and mathematical analysis

In this section we perform an analytic and graphical analysis in order to check the physical and mathematical properties of our model. The following conditions have been generally recognized to be crucial for anisotropic fluid spheres [41].

4.1 Metric potentials and thermodynamic observables

From expressions (17) and (18) is clear that the present stellar system is free from physical and geometric singularities as can be seen evaluating at the center \(r=0\) of the compact configuration

$$\begin{aligned} e^{\lambda (r)}|_{r=0}= & {} 1 \quad \text{ and } \quad \nonumber \\ e^{\nu (r)}|_{r=0}= & {} \bigg (A+\frac{\sqrt{2a}\,B\,\cos c\, F (0) \sqrt{(1 + \sin c)^n}}{(n+1)\,b\,\sqrt{(1 -\sin c)}}\bigg )^2.\nonumber \\ \end{aligned}$$
(31)

where,     \(F(0)= _2F\big [\frac{1 + n}{2},\frac{1}{2}, \frac{3+n}{2}, \sin ^2\big (\frac{2 c + \pi }{4}\big )\big ]\)

Figure 1 shows the positive monotonically increasing behaviour of both metric potentials (17) and (18) within the compact star. Respect to the density energy \(\rho \), radial \(p_{r}\) and tangential \(p_{t}\) pressures they must have their maximum values at the origin of the spherical object and monotonically decreasing behaviour towards the surface. Moreover, the radial pressure \(p_{r}\) must vanish at the boundary \(\varSigma \), defined by \(r=R\). The central values of \(\rho \), \(p_{r}\) and \(p_{t}\) can be obtained from expressions (20), (21) and (22) yielding to

$$\begin{aligned} \rho (0)= & {} \frac{3\,a\,(1+\sin c)^n}{8\,\pi } , \end{aligned}$$
(32)
$$\begin{aligned} p_{r}(0)= & {} \frac{1}{8\pi }\bigg [\frac{4\sqrt{a}\,Bb \sqrt{(1 + \sin c)^n}\, (1+n)}{A\,b\, (1+n)+\sqrt{2a}\,B\,\cos c~F(0)\,\sqrt{{(1 + \sin c)^n \over 1 - \sin c}}}\nonumber \\&-a (1 + \sin c)^n\bigg ]=p_t(0). \end{aligned}$$
(33)

From (33), the non-negative pressure leads the following inequality,

$$\begin{aligned} \frac{A}{B}< \frac{[4\,b\,(n+1)\,\sqrt{1-\sin c} -\sqrt{2}\,a\,\cos c\,F(0)\,(1+\sin c)^n]}{\sqrt{a}\,b\,(n+1)\,\sqrt{(1 + \sin c)^n}\,\sqrt{1-\sin c}},\nonumber \\ \end{aligned}$$
(34)

and using Zeldovich’s condition [130]

$$\begin{aligned}&\frac{p_{r}(0)}{\rho (0)}\le 1 \Rightarrow ~~~~~~~~~~\nonumber \\&\frac{b\,(n+1)\,\sqrt{1-\sin c} -\sqrt{2}\,a\,\cos c\,F(0)\,(1+\sin c)^n}{\sqrt{a}\,b\,(n+1)\,(1+\sin c)^n\,\sqrt{1-\sin c}} \le \frac{A}{B},\nonumber \\ \end{aligned}$$
(35)

so, from above inequalities (34) and (35) we obtain,

$$\begin{aligned}&\frac{b\,(n+1)\,\sqrt{1-\sin c} -\sqrt{2}\,a\,\cos c\,F(0)\,(1+\sin c)^n}{\sqrt{a}\,b\,(n+1)\,(1+\sin c)^n\,\sqrt{1-\sin c}} \nonumber \\&\quad \le \frac{A}{B}< \nonumber \\&\qquad \frac{4\,b\,(n{+}1)\,\sqrt{1-\sin c} {-}\sqrt{2}\,a\,\cos c\,F(0)\,(1+\sin c)^n}{\sqrt{a}\,b\,(n+1)\,\sqrt{(1 + \sin c)^n}\,\sqrt{1-\sin c}},\nonumber \\ \end{aligned}$$
(36)

Therefore, the ratio A / B should satisfy above inequality (36) in order to ensure the positiveness of \(p_{r}\) and \(p_{t}\) inside the configuration. Figures 2 and 3 shows that all the above quantities are well behaved within the star. At this stage it is worth mentioning that the current stellar system exhibits a positive anisotropy parameter \(\varDelta \), it can be seen in Fig. 3 where \(p_{t}>p_{r}\) then \(\varDelta >0\). Thus the object is revealed to a repulsive force that counteracts the gravitational slope, this fact allows the construction of a more compact structure [27]. Figure 4 display the conduct of the anisotropy parameter \(\varDelta \). It disappears at \(r=0\), that is so because at the origin the effective radial pressure and the effective transverse pressure coincide. Moreover, as the radius increases the values of the effective radial and transverse pressures drift apart, and consequently, the anisotropy increases in the direction of the spherical object surface. Furthermore Fig. 5 shows that the state equation parameters i.e. (\(\omega _r=p_r/\rho \)) and (\(\omega _t=p_t/\rho \)) are less than 1, proving Zeldovich’s condition is satisfies everywhere inside the object. Table 1 indicates values matching to surface and central density which is according to the expected ranges for a star formed by a quark fluid, also the radial pressure is outlined at the origin of the spherical object.

Fig. 1
figure 1

Variation of metric potentials with the radial coordinate r for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), \(n=1.08\) (orange color), \(n=1.66\) (purple color), \(n=2.24\) (blue color), \(n=2.82\) (brown color), \(n=3.4\) (red color)

Fig. 2
figure 2

Variation of energy density (\(\rho \)) with the radial coordinate r for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), \(n=1.08\) (orange color), \(n=1.66\) (purple color), \(n=2.24\) (blue color), \(n=2.82\) (brown color), \(n=3.4\) (red color)

Fig. 3
figure 3

Variation of radial pressure (\(p_r\)) and tangential pressure (\(p_t\)) with the radial coordinate r for SAX J1808.4-3658 with \(R=7.951,~ b=0.001,~ c=0.1\). For this graph we choose: \(n=0.5\) (black line), \(n=1.08\) (orange color), \(n=1.66\) (purple color), \(n=2.24\) (blue color), \(n=2.82\) (brown color), \(n=3.4\) (red color)

Fig. 4
figure 4

Variation of anisotropic factor with the radial coordinate r for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), \(n=1.08\) (orange color), \(n=1.66\) (purple color), \(n=2.24\) (blue color), \(n=2.82\) (brown color), \(n=3.4\) (red color)

Fig. 5
figure 5

Variation of (\(p_r/\rho \)) and (\(p_t/\rho \)) with the radial coordinate r for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), \(n=1.08\) (orange color), \(n=1.66\) (purple color), \(n=2.24\) (blue color), \(n=2.82\) (brown color), \(n=3.4\) (red color)

4.2 Energy conditions

Inside the anisotropic matter distribution, the energy should be positive. In order to guarantee it, the stress–energy tensor needs to comply with the null energy condition (NEC), which infers that local mass–energy density must not be negative, the weak energy condition (WEC) in both radial and tangential direction, suggesting that the flow of energy interior the spherical object must not be quicker than the speed of light. Finally, the strong energy condition (SEC) and the dominant energy conditions (DEC) in both radial and tangential direction, [131, 132]:

  1. 1.

    (NEC): \(\rho \ge 0\).

  2. 2.

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

  3. 3.

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

  4. 4.

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

Figures 2 and 6 demonstrated that all the above inequalities are fulfilled inside the spherical object. In this way we have a well-behaved stress–energy tensor.

Table 1 The values of \(a,~A,~B,~z_c,~z_s\) and \(u_s\) parameters values of the compact star SAX J1808.4-3658 with mass \(M =0.9M_\odot \) and predicted radius \(R=7.951\) km, \(b=0.00,~ c=0.1\) for different values of n [129]

4.3 Mass function and compactness factor

In the presence of an anisotropic matter distribution, the mass-radius ratio is quite different with respect to the isotropic charged case [133]. It can be obtained from the relationship between \(e^{\lambda }\) and mass function m(r), i.e.

$$\begin{aligned} e^{-\lambda }=1-\frac{2m(r)}{r}. \end{aligned}$$
(37)

Thus, we obtain the relationship of the mass function as follows

$$\begin{aligned} m(r)=\frac{a r^3\,[1 + \sin (br^2 + c)]^n }{2\,\{1 + a r^2\,[1 + \sin (br^2 + c)]^n\} } \end{aligned}$$
(38)

The compactness factor u for the model is obtained as

$$\begin{aligned} u(r)=\frac{2m(r)}{r}=\frac{a r^2\,[1 + \sin (br^2 + c)]^n }{\{1 + a r^2\,[1 + \sin (br^2 + c)]^n\} } . \end{aligned}$$
(39)

From Eq. (39) we can observe that the compactness factor u of the strange star depends on the mass function. The compactness factor increases with the increase of mass, as well as the compactness value u satisfies the Buchdahl condition i.e., cannot be more than 8 / 9 (see Fig. 7). However, Fig. 8 displays the profile of the maximum mass M with the radius R for the strange spherical object candidate chosen in this work. Then this \(M-R\) graph suggests that the solution gives a rigid state equation as parameter n increases. Since we have chosen a particular compact object i.e. SAX J1808.4-3658, the compactness parameter at the surface is always constant i.e. independent of n and its value is 0.334 (see Fig. 7).

Fig. 6
figure 6

Variation of energy conditions with the radial coordinate r for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), \(n=1.08\) (orange color), \(n=1.66\) (purple color), \(n=2.24\) (blue color), \(n=2.82\) (brown color), \(n=3.4\) (red color)

Fig. 7
figure 7

Variations of mass function and compactness parameter with the radial coordinate r for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), n=1.08 (orange color), \(n=1.66\) (purple color), \(n=2.24\) (blue color), \(n=2.82\) (brown color), \(n=3.4\) (red color)

4.4 Surface and central redshift

The surface redshift can be determined utilizing the compactness factor u given by (39), as

$$\begin{aligned} z_{s}=e^{\lambda (R)/2}-1=\frac{1-\sqrt{1-2u_s}}{\sqrt{1-2u_s}}, \end{aligned}$$
(40)

explicitly it reads

$$\begin{aligned} z_{s}=\sqrt{1 + a R^2\,[1 + \sin (bR^2 + c)]^n}-1. \end{aligned}$$
(41)

A positive anisotropy factor \(\varDelta >0\) (like in our case) does not foist an upper limit on the surface redshift \(z_{s}\), different is the isotropic distributions case, where the most extreme value that the surface redshift \(z_{s}\) can reaches as \(z_ {s} = 4.77\) [14]. Therefore, the surface redshift for anisotropic matter distributions is bigger than its isotropic partner. On the other hand the central redshift z can be obtained as follows

$$\begin{aligned} z= & {} e^{-\nu (r)/2}-1\nonumber \\= & {} \left( A+\frac{\sqrt{2\,a}\, B\, \cos (br^2+c)\,F(r)\,f_1(r)\,f_2(r)}{b (n+1)\,\sqrt{1 - \sin (b r^2+c)}}\right) ^{-1}-1.\nonumber \\ \end{aligned}$$
(42)

Figure 9 shows that both the surface \(z_{s}\) and the central \(z_{0}\) redshift is positive and bounded within the star. The status of central redshift efficiency by the solutions is maximum for \(n=0.5\) and minimum for \(n=3.4\); nevertheless, the status of surface redshift is actually equivalent to all values of n. This is because the surface redshift depends only on the surface compactness parameter (see 40) and hence independent of the parameter n. As per Ivanov [33], the maximum surface redshift can’t exceed 3.842 if an anisotropic fluid distribution is considered. Therefore, the resulting surface redshift \(z_s=0.137\) (see Fig. 9) from the solution also compatible with Ivanov’s findings.

4.5 Moment of inertia (I)

Here we use an approximate formula of the moment of inertia I based on Bejger-Haensel method [134] which transforms a static system to rotating system. More specifically, we consider the case where the maximum mass of uniformly rotating configurations gives the approximate moment of inertia I in the following form

$$\begin{aligned} I= & {} \frac{2\,}{5\,}{[1+x]\,M\,R^2\,},~~~~~~~~ \end{aligned}$$
(43)

where the parameter x is defined as \(x={(M/{M_{\odot }})}{(km/R)}\). Now using formula (43), we find the behavior of maximum moment of inertia I against the mass M which is represented in Fig. 10. From this figure, it is easy to see that, for all the increasing value choices of n as shown in Table 1, the maximum moment of inertia I is still increasing from the zero central value till up to a certain mass limit value, and then diminishes rapidly. Consequently, we can conclude that the sensitivity of \(I-M\) graph increases, the corresponding rigidity of the state equation is better in the case where the parameter n is increasing.

Fig. 8
figure 8

Variation of mass \(M_{\odot }\) with the radius R for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), n=1.08 (brown color), \(n=1.66\) (blue color), \(n=2.24\) (orange color), \(n=2.82\) (green color), \(n=3.4\) (red color)

Fig. 9
figure 9

Variation of redshift function with the radial coordinate r for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), \(n=1.08\) (orange color), \(n=1.66\) (purple color), \(n=2.24\) (blue color), \(n=2.82\) (brown color), \(n=3.4\) (red color)

Fig. 10
figure 10

Variation of moment of inertia I with the mass \(M_{\odot }\) for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), \(n=1.08\) (brown color), \(n=1.66\) (blue color), \(n=2.24\) (orange color), \(n=2.82\) (green color), \(n=3.4\) (red color)

5 Stability and equilibrium conditions

5.1 Causality condition and Abreu’s criterion

The sound velocity inside the compact stars can be determined by using

$$\begin{aligned} v_{r}(r)=\sqrt{\frac{dp_{r}(r)}{d\rho (r)}}, \quad v_{t}(r)=\sqrt{\frac{dp_{t}(r)}{d\rho (r)}}. \end{aligned}$$
(44)

Both the radial and tangential subliminal sound speed inside the star should be less than the light speed (causality condition). As appeared in Fig. 11 both speeds satisfy the above prerequisite (taking \(c=1\) in relativistic geometrized units).

To check whether local anisotropic matter distribution is stable or not, one can use the proposal of Herrera [40] known as overturning of the star. Based on it Abreu and his collaborators [37] proposed another choice for considering the stability of a self-gravitating anisotropic fluid spherical object. Basically, this approach indicates whether the zone is potentially steady where the radial sound speed is bigger than the transverse sound speed. According to the Abreu et al. [37], the region for stability of the compact objects can be given by following criterion,

$$\begin{aligned}&-1\le v^{2}_{t}-v^{2}_{r}\le 1 \nonumber \\&=\left\{ \begin{array}{ll} -1\le v^{2}_{t}-v^{2}_{r}\le 0~~~~~ &{} \mathrm {Potentially\ stable\ } \\ 0< v^{2}_{t}-v^{2}_{r}\le 1 ~~~~~ &{} \mathrm {Potentially\ unstable} \end{array} \right\} ,~~~~~ \end{aligned}$$
(45)

We note from Fig. 11 that the radial speed of sound (\(v^{2}_{r}\)) and the transverse speed of sound (\(v^{2}_{t}\)) are satisfies the causality conditions, i.e., both \(v^{2}_{r}\), \(v^{2}_{t}\) are less than 1 and monotonically decreasing outward against the radial coordinate r. On the other hand, Fig. 12 shows the stability factor i.e., (\(v^{2}_{t}-v^{2}_{r}\)) which satisfies the concept of cracking Abreu et al. [37] everywhere inside the compact object. Hence, we can conclude that our compact star model provides a stable configuration.

5.2 Relativistic adiabatic index

The stability of the relativistic anisotropic spherical object likewise relies on the adiabatic index \(\varGamma \). Heintzmann and Hillebrandt [15] recommended that neutron spherical object systems with anisotropic state equation are steady in the presence of a positive and increasing anisotropy parameter \(\varDelta =p_{t}-p_{r}>0\). Establishing the stability condition for an anisotropic relativistic compact object is given by \(\varGamma >4/3\). In distinction with the non-relativistic and isotropic case (Newtonian fluids), neutron spherical object system has no upper mass limit for the adiabatic index \(\varGamma >4/3\) [135]. So, the relativistic adiabatic index \(\varGamma \) is defined by [23]

$$\begin{aligned} \varGamma =\frac{\rho +p_{r}}{p_{r}}\frac{dp_{r}}{d\rho }. \end{aligned}$$
(46)

It is worth mentioning that Eq. (46), corresponds to the adiabatic index in the radial direction, this is because the gravitational collapse occurs in that direction. On the other hand, for Newtonian spheres the collapsing condition is \(\varGamma <4/3\), and for anisotropic relativistic sphere is given by [25, 26]

$$\begin{aligned} \varGamma <\frac{4}{3}+\left[ \frac{1}{3}\kappa \frac{\rho _{0}p_{r0}}{|p^{\prime }_{r0}|}r+ \frac{4}{3}\frac{\left( p_{t0}-p_{r0}\right) }{|p^{\prime }_{r0}|r}\right] _{max}, \end{aligned}$$
(47)

where \(\rho _{0}\) is the initial density, \(p_{r0}\) and \(p_{t0}\) are the radial and transverse pressures when the fluid is in static equilibrium. The second term in the right-hand side depicts the relativistic corrections in the case of Newtonian perfect fluid and the third term is the contribution due to anisotropy. It is obvious from expression (47) that in the situation of a non-relativistic matter distribution and taking \(p_{r}\) be equal to \(p_{t}\) ı.e \(\varDelta =0\), the bracket disappears and we recast the collapsing Newtonian limit \(\varGamma <4/3\). We can see from Fig. 13 that the stellar system is complete concurrence with the condition \(\varGamma >4/3\), accordingly the stellar system is steady everywhere interior the structure.

5.3 Harrison–Zeldovich–Novikov static stability criterion

Any solution representing stable astrophysical objects have to fulfill the stability criterion. This criterion examines whether the solution is static and stable under small radial perturbation. This criterion imply that any solution represents static and stable configuration if the total mass is an increasing function of its central density i.e. \(\partial M(\rho _c)/\partial \rho _c > 0\) and potentially unstable if \(\partial M(\rho _c)/\partial \rho _c < 0\) [136, 137]. For the solution, the expression for mass as a function of \(\rho _c\) is given by

$$\begin{aligned} M(\rho _c)= & {} \frac{R}{2} \bigg [1-\frac{1}{\frac{8}{3} \pi R^2 \rho _c f_2(R) (\sin c+1)^{-n}+1} \bigg ] \end{aligned}$$
(48)
$$\begin{aligned} {\partial M \over \partial \rho _c}= & {} \frac{12 \pi R^4 (\sin c+1)^n f_2(R)}{\left[ 8 \pi f_2(R) R^3 \rho _c+3 (\sin c+1)^n\right] {}^2} >0. \end{aligned}$$
(49)

It is found that the solution gains its stability with an increase in parameter n (see Fig. 14). This is because of the range of central density until the saturation increases with n. This signifies that the system will hold the stability while varying the central density due to small radial perturbation.

Fig. 11
figure 11

Variation of speed of sound \(v^2_r\) and \(v^2_t\) with radial coordinate r for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), \(n=1.08\) (orange color), \(n=1.66\) (purple color), \(n=2.24\) (blue color), \(n=2.82\) (brown color), \(n=3.4\) (red color)

Fig. 12
figure 12

Variation of stability factor with the radial coordinate r for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), \(n=1.08\) (orange color), \(n=1.66\) (purple color), \(n=2.24\) (blue color), \(n=2.82\) (brown color), \(n=3.4\) (red color)

Fig. 13
figure 13

Variation of adiabatic index \(\varGamma \) with the radial coordinate r for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), \(n=1.08\) (orange color), \(n=1.66\) (purple color), \(n=2.24\) (blue color), \(n=2.82\) (brown color), \(n=3.4\) (red color)

Fig. 14
figure 14

Variation of mass verses (m(r)) central density (\(\rho _c\)) for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), \(n=1.08\) (orange color), \(n=1.66\) (purple color), \(n=2.24\) (blue color), \(n=2.82\) (brown color), \(n=3.4\) (red color)

5.4 Equilibrium under three different forces

The equilibrium of the system is based on the Tolman–Oppen- heimer–Volkoff (TOV) equation [3, 4]. Using the TOV equation we want to investigate whether our present stellar system is in a stable equilibrium stage under the three following forces: the hydrostatic force \(F_{h}\), the gravitational force \(F_{g}\) and the anisotropic repulsive force \(F_{a}\) presented by the existence of a positive anisotropy parameter \(\varDelta \). As pointed out before, the presence of a positive anisotropy parameter counterbalances the gravitational gradient. Therefore, this implies that the sum of three different forces is becoming zero

$$\begin{aligned} -\underbrace{\frac{\nu ^{\prime }}{2}\left( \rho +p_{r}\right) }_{F_{g}} - \underbrace{\frac{dp_{r}}{dr}}_{F_{h}}+\underbrace{\frac{2}{r}\varDelta }_{F_{a}}=0. \end{aligned}$$
(50)

The explicit expressions of these forces are

$$\begin{aligned}&F_{a} = \frac{2/f(r)}{\{1 + \sin (br^2+c)\}\,\big [1 + a r^2 \{1 + \sin (br^2+c)\}^n\big ]^2}\nonumber \\&\quad \bigg (\sqrt{a}\,r\, \big [-b\,n \,\cos (c + b r^2) + a\,\{1 + \sin (br^2+c)\}^{1 + n} \big ]\, \nonumber \\&\quad \Big [\sqrt{a}\,f(r)\, \{1 + \sin (br^2+c)\}^n \nonumber \\&\quad -2\,B\,\sqrt{1 + \sin (br^2+c)} \Big ]\bigg ), \end{aligned}$$
(51)
$$\begin{aligned}&F_g(r) = \frac{B\,\sqrt{a}\,\sqrt{[1 + \sin (br^2+c)]^n}}{-f(r)} \nonumber \\&\quad \Bigg (\frac{a\,[1 + \sin (c + b r^2)]^{n-1}\,F_{g1}(r)}{\big (1 + a\, r^2\, [1 + \sin (c +br^2)]^n\big )^2} + 4\,\sqrt{a}\,B\nonumber \\&\quad \frac{\sqrt{[1 + \sin (br^2+c)]^n\,-a\,f(r)\, [1+\sin (br^2+c)]^n}}{f(r)\,\,\big [1 + a r^2 (1 +\sin (br^2+c))^n\big ]}\Bigg ),\nonumber \\ \end{aligned}$$
(52)
$$\begin{aligned}&F_h(r) = \frac{2\,r\,[F_{h1}(r)+F_{h2}(r)] \{1+\sin (br^2+c)\}^{-1}}{\big (f(r) + a\, r^2\,f(r)\, [1 + \sin (c + b r^2)]^n\big )^2}\Bigg .\nonumber \\ \end{aligned}$$
(53)

where,

$$\begin{aligned} F_{g1}(r)= & {} 2\,b\,n\,r^2\, \cos (c + b r^2) +\big [1 + \sin (c + b r^2)\big ]\,\\&\quad \big (3+ a r^2\,[1 + \sin (c + b r^2)]^n\big ) ,\\ F_{h1}(r)= & {} \sqrt{a}\,b\,n\,f(r)\,\cos (c + b r^2)\, \{\sqrt{a}\, f(r)\, \\&\quad [1 + \sin (br^2+c)]^n \\&\quad -2\, B\,\sqrt{[1 + \sin (c + b r^2)]^n} + 2 \,a\, B\, r^2\, \\&\quad [1 + \sin (c + b r^2)]^{3n/2}\},\\ F_{h2}(r)= & {} a[1 + \sin (c + b r^2)]^{n+2} \,\{-a\, f(r)^2 \\&\quad [1 + \sin (c + b r^2)]^n\\&\quad + 4\,\sqrt{a}\, B\,f(r)\, \sqrt{[1 + \sin (c + b r^2)]^n} + 4\, B^2 \\&\quad [1 + a r^2 \{1 + \sin (c + b r^2)\}^n]\}. \end{aligned}$$

The Fig. 15 shows that gravitational force dominates the hydrostatics and anisotropic force and the model is in equilibrium as the gravitational force counterbalances the combined effect of hydrostatic and anisotropic forces.

Fig. 15
figure 15

Variations of hydrostatic, anisotropic and gravitational forces acting on the model with the radial coordinate r for SAX J1808.4-3658 with \(R=7.951, b=0.001, c=0.1\). For this graph we choose: \(n=0.5\) (black line), n=1.08 (orange color), \(n=1.66\) (purple color), \(n=2.24\) (blue color), \(n=2.82\) (brown color), \(n=3.4\) (red color)

Table 2 Physical parameters values of the compact star SAX J1808.4-3658 with mass \(M =0.9\left( M_\odot \right) \) and predicted radius \(R=7.951\) (km), \(b=0.001,~ c=0.1\) for different values of n [129]

6 Herrera–Ospino–Di Prisco generators of the solution

It has been demonstrated that all the spherically symmetric static anisotropic solutions of the Einstein’s field equations can be generated from two generating functions \(\zeta (r)\) and \(\varPi (r)\) [29]. The generator \(\zeta (r)\) linked with the metric potential \(e^\nu \) and other with pressure anisotropy. These generators are defined via

$$\begin{aligned} e^\nu= & {} \exp \bigg [\int \bigg (2\zeta (r)-{2 \over r} \bigg ) dr \bigg ] \end{aligned}$$
(54)
$$\begin{aligned} \varPi= & {} 8\pi (p_r-p_t) \end{aligned}$$
(55)

and for this solution we get the generators as

$$\begin{aligned} \zeta (r)= & {} \frac{1}{r}+ \frac{a b B (n+1) r^2 f_2(r)}{\sin \left( b r^2+c\right) -1} \Big [4 \sin \left( b r^2+c\right) \nonumber \\&+ \cos \left( 2 \left\{ b r^2+c\right\} \right) -3 \Big ] \Big [a B r f_2(r) \cos \left( b r^2+c\right) \nonumber \\&\quad \times F(r) \sqrt{2{-}2 \sin \left( b r^2{+}c\right) } {-}2 A b (n+1) \sqrt{a r^2 f_2(r)} \nonumber \\&\quad \times \left\{ \sin \left( b r^2+c\right) -1\right\} \Big ]^{-1} \end{aligned}$$
(56)
$$\begin{aligned} \varPi (r)= & {} -8\pi \,\varDelta (r). \end{aligned}$$
(57)

where \(\varDelta (r)\) is given by the Eq. (23).

7 Concluding remarks

Embedding class one spacetime using Karmarkar’s condition has been proved as a simple and powerful tool to obtain the solution of Einstein’s field equations. Despite its simplicity, the obtained model describing anisotropic fluid spheres fulfills all the requirements in order to be an admissible solution from both the physical and mathematical point of view.

It has been observed that the behavior of physical quantities of both metric potentials, viz, \(e^{\nu }\) and \(e^{\lambda }\), respectively, with respect to the radial coordinate r, are illustrated in Fig. 1, which exhibit that these two metric potentials are finite at the center and monotonically increasing towards the limit at the surface. Furthermore, to process the present stellar model, we demonstrate that the energy density \(\rho \), the radial \(p_{r}\) and tangential \(p_{t}\) pressures are completely finite and positive quantities within the stellar configuration, which is outlined in Figs. 2 and 3. So from these three Figs. 12, and 3 we valid that our stellar system is completely free of any physical and geometric singularities. The anisotropy of the stellar model is represented in Fig. 4, which exhibit, that anisotropy increases as the radius increases. For instance, the anisotropy is minimum, i.e., zero at the origin and maximum on the surface of the stellar system.

To analyze the physical agreeableness of our anisotropic stellar structure, we have examined the energy conditions, mass function, and compactness, stability and equilibrium conditions of the stellar model and other features. We note from Fig. 5 that the state equation parameters i.e. (\(\omega _r=p_r/\rho \)) and (\(\omega _t=p_t/\rho \)) are less than 1, proving Zeldovich’s condition is satisfies everywhere inside the compact object. Furthermore, in Table 1 we have shown the possible values of the physical parameters a, A and B using parameters values of the compact star SAX J1808.4-3658 with mass \(M =0.9\left( M_\odot \right) \) and predicted radius \(R=7.951~(km)\) for different values of n. Whereas, Table 2 shows that the central energy density is within this range, which is in complete agreement with many other reported results in the literature [45,46,47,48,49,50,51,52,53,54,55, 57,58,59,60,61, 63,64,80]. Figure 6 clearly shows that our stellar system fulfills all the energy conditions which are a basic condition for a compact astrophysical structure to be physically acceptable. In Fig. 7, we have shown the variations of mass function and compactness parameter with respect to the radial coordinate r. From our stellar model, we find that \(u<9/8\) for the specific strange spherical object candidate chosen i.e. SAX J1808.4-3658. Hence, Buchdahl’s condition [138] holds useful for our stellar system. Also, as r \(\longrightarrow \) 0 we find m(r\(\longrightarrow \) 0 which demonstrates that the mass function is regular at the origin for all values of parameter n. Further, in Fig. 8 variation of maximum mass M with respect to the radial coordinate R are exhibited for different values of parameter n. It shows that the maximum mass points as shown by the solid circles in the figure, and we find that for the chosen increasing values of parameter n, i.e., \(n= 0.5, 1.08, 1.66, 2.24, 2.82\)  and  3.4, the values of the maximum masses are increasing progressively. In the current study, the central \(Z_{0}\) and the surface \(Z_{s}\) redshift are both positive and bounded (see Fig. 9), as well as the resulting surface redshift \(Z_{s}\) = 0.137 from the solution also comply with the Ivanov’s findings [33] which are quite pertinent for strange spherical object candidates. In Fig. 10 we have also shown the behavior of maximum moment of inertia I against the solar mass. We find for all the increasing value choices of n as appeared in Table 1, the maximum moment of inertia I is still increasing from the zero central value till up to a specific mass limit value, and then diminishes rapidly. Consequently, the obtained solutions are validated by the Bejger–Haensel idea, which could give a precise tool to the coordinating rigidity of the state equation due to different values of n. Respect for the stability of the stellar model, it was studied analyzing causality condition Abreu’s criterion, relativistic adiabatic index \(\varGamma \) and Harrison–Zeldovich–Novikov static stability criterion. The graphs of these criteria have been plotted in Figs. 1112, 13 and 14, respectively. From the point of view of causality condition and Abreu’s criterion the stellar model is completely stable, because the square of sound speed is less than 1 everywhere within the star (Fig. 11), besides there is no change in sign \(v^{2}_{t}-v^{2}_{r}\) and stability factor \((v^{2}_{t}-v^{2}_{r})\) lies between \(-1\) and 0 for stable configuration and 0 to 1 for unstable configuration (Fig. 12). Moreover, the relativistic adiabatic index \(\varGamma \) is greater than 4 / 3 and are also increasing monotonically outward, it means according to Heintzmann and Hillebrandt [15] our system is completely stable (Fig. 13). Finally, in Fig. 14 we have given a profile of M with respect to the central density of the matter distribution, \(\rho _{c}\). Figure 14 demonstrates that with the increase of parameter n the value of density increases. In this way, as the value of n increases the stellar structure of a strange spherical object gets shrunk and the density interior the configuration increases progressively to make an ultra-dense compact stellar system. On the other hand, the compact stellar system is in equilibrium under three different forces, namely the hydrostatic force \(F_{h}\), the gravitational force \(F_{g}\) and the anisotropic force \(F_{a}\) (Fig. 15). The latest one causes a repulsive force that counteracts the gravitational gradient, this is so because we are in the presence of a positive anisotropy factor \(\varDelta \) as can be seen in Fig. 4. As was pointed out by Ruderman [6] and Canuto [7] in their early theoretical works, anisotropy can arise in ultra-high-density ranges. As a final comment, in the current paper, we have effectively exhibited a stable and physically adequate anisotropic astrophysical model, which is reasonable to study ultra-dense strange spherical systems.