1 Introduction

Investigation of relativistic stellar structures has now become an interesting research pursuit in astrophysics. The fundamental features of compact stars have encouraged several researchers not only in the prospect of usual general relativity \(({\mathcal{G}\mathcal{R}})\) but also in broadly emerging gravitational alternative theories during the last few decades [1,2,3,4,5,6,7,8,9,10].

Compact stars are originated as the result of gravitational collapse that happens due to the pressure of the relativistic objects. The gravitational collapse occurs at the center of the massive star which is highly exothermic and this happens when the internal pressure of the stars fails to maintain the pressure against the external force. As the result of gravitational collapse, either a compact star will be born, like neutron stars, white dwarfs, or it will be extended as a black hole. \({\mathcal{G}\mathcal{R}}\) provides most suitable results in the study of stellar objects and develop basic understanding about gravitational theories. However, \({\mathcal{G}\mathcal{R}}\) alone does not provide satisfactory outcomes in order to determine the mysterious nature of dark energy. Due to the limitation of \({\mathcal{G}\mathcal{R}}\), the modified theories have gained the attention of researchers. As an alternative to the theory of \({\mathcal{G}\mathcal{R}}\), modified theories of gravity have played an important role to somehow explain the accelerating expansion of the universe. Various modified gravitational theories are presented in literature, some of mostly debated are \(f({\mathcal {R}})\), \(f({\mathcal {R}},{\mathcal {T}})\), \(f({\mathcal {G}})\), \(f({\mathcal {G}},{\mathcal {T}})\), \(f({\mathcal {R}},{\mathcal {G}})\) [11,12,13,14,15]. A recently proposed theory namely \(f({\mathcal {R}}, {\mathcal {A}})\) gravity has also gained some popularity due to the involvement of bivariate function of Ricci and anti-curvature scalars [16].

We require a precise solution to the Einstein field equations (\({{\mathcal {EFE}}}\)) to examine celestial compact structure models. Schwarzschild [17] was the first who discovered the \({\mathcal {EFE}}\) solution for the internal structure of compact stars in 1916. Tolman [18] and Oppenheimer [19] explored some feasible models of stellar objects to represent the relationship between internal pressure and the gravitational force. Bowers and Liang [20] introduced the idea of non-zero anisotropy in a stellar arrangement. Ruderman [21] was the first to discover that the nuclear density becomes anisotropic at the center of compact objects. Errehymy et al. [22] investigated the solutions of dense stars in the domain of \({\mathcal{G}\mathcal{R}}\). A new class of solution describing an anisotropic star which is satisfying Karmarkers condition was reported by Maurya et al. [23]. The discussion of compact structures in modified gravity also seems interesting. Nojiri and Odintsov [24] discussed some viable and stable results of different models in the framework of \(f({\mathcal {R}})\) gravity. Starobinsky [25] also presented the outcomes of various models of \(f({\mathcal {R}})\) gravity. Hu and Sawicki [26] suggested several \(f({\mathcal {R}})\) gravity models. Cognola et al. [27] examined the physical behavior of the compact stars in the exponential type models of \(f({\mathcal {R}})\) gravity. Schlai [28] identified the embedding problem on geometrically significant spacetimes. Shamir et al. [29] explored the solutions of dense stars using Karmarkar condition in the background of \(f({\mathcal {R}})\) theory of gravity. Naz et al. [30] investigated the existence of solutions of anisotropic compact objects through embedding approach in the context of \(f({\mathcal {R}})\) gravity by applying Karmarkar condition.

Motivated from the interesting properties of stellar structures in modified theories of gravity, we aim to investigate anisotropic compact structures in the background of Ricci inverse \(({\mathcal{R}\mathcal{I}})\) gravity. In particular, we provide a detailed investigation of stellar structure for twelve important compact stars from the recent literature namely \(4U~1538{-}52\), \(SAX~J1808.4{-}3658\), \(Her~X{-}1\), \(LMC~X{-}4\), \(SMC~X{-}4\), \(4U~1820{-}30\), \(Cen~X{-}3\), \(4U~1608{-}52\), \(PSR~J1903{+}327\), \(PSR~J1614{-}2230\), \(Vela~X{-}1\), \(EXO~1785{-}248\). Our work is managed as follows: Section 2 presents the fundamental concepts, structure, and the modified field equations of \({\mathcal{R}\mathcal{I}}\) gravity. In Sect. 3, the matching constraints for the chosen linear \({\mathcal{R}\mathcal{I}}\) gravity model (\({\mathcal {R}}+ \alpha {\mathcal {A}}\)) are developed using Schwarzschild’s geometry. Section 4 is devoted to calculate and analyze physical properties such as energy density, pressure profiles etc. The last section contains final remarks.

2 \(f({\mathcal {R}},{\mathcal {A}})\) gravity and modified field equations

The inverse of the Ricci tensor known as the anticurvature tensor helps to form an alternative theory namely \(f({\mathcal {R}},{\mathcal {A}})\) gravity [16], where \({\mathcal {R}}\) and \({\mathcal {A}}\) are the traces of curvature and anticurvature respectively. This theory can be explored to verify the widespread presence of spectral instabilities and to understand the effects of perturbations such as the propagation of gravitational waves, perturbation growth, or the Newtonian bound. Such theory is confirmed as a suitable choice to be regarded as a cosmological model after deriving the general field equations of the Lagrangian \(f({\mathcal {R}},{\mathcal {A}})\). According to a no-go theorem, every Lagrangian action \(f({\mathcal {R}},{\mathcal {A}})\) containing terms with any positive or negative exponent of anticurvature \({\mathcal {A}}\) can be used to justify dark energy [16]. Thus, it would be exceptionally intriguing to analyze this theory further. In this work, we focus ourselves to study compact structures in this theory. The starting point to derive the field equations is to define a tensor \({\mathcal {A}}^{\eta \xi }\) as inverse of \({\mathcal {R}}_{\eta \xi }\), such that

$$\begin{aligned} {\mathcal {A}}^{\eta \alpha } {\mathcal {R}}_{\alpha \xi }= \delta ^{\eta }_{\xi }. \end{aligned}$$
(1)

In order to develop the modified field equations, we need the following definition of the \(f({\mathcal {R}},{\mathcal {A}})\) gravitational action:

$$\begin{aligned} S= \int d^4x\sqrt{-g}[f({\mathcal {R}},{\mathcal {A}}) + {\mathcal {L}}_{m}], \end{aligned}$$
(2)

where, the arbitrary function \(f({\mathcal {R}},{\mathcal {A}})\) depends on the Ricci scalar \({\mathcal {R}}\) and the anticurvature scalar \({\mathcal {A}}\), which are the traces of the Ricci tensor and the anticurvature tensor respectively. Here, \({\mathcal {L}}_{m}\) is matter Lagrangian and g represents the determinant of the metric. We get the following \(f({\mathcal {R}},{\mathcal {A}})\) gravity field equation by varying the action mentioned in Eq. (2) with respect to the metric tensor

$$\begin{aligned}&f_{{\mathcal {R}}} {\mathcal {R}}^{\eta \xi } - f_{{\mathcal {A}}} {\mathcal {A}}^{\eta \xi } - \frac{1}{2} f g^{\eta \xi } + g^{\mu \eta } \nabla _{\beta } \nabla _{\mu } (\ f_{{\mathcal {A}}} {\mathcal {A}}_{\sigma }^{\beta } {\mathcal {A}}^{\xi \sigma })\nonumber \\&\quad -\frac{1}{2} \nabla ^{\kappa } \nabla _{\kappa } (\ f_{{\mathcal {A}}} {\mathcal {A}}_{\sigma }^{\eta } {\mathcal {A}}^{\xi \sigma })- \frac{1}{2} g^{\eta \xi } \nabla _{\beta }\nabla _{\mu } (\ f_{{\mathcal {A}}} {\mathcal {A}}_{\sigma }^{\beta } A^{\mu \sigma })\nonumber \\&\quad -\nabla ^{\eta } \nabla ^{\xi } f_{{\mathcal {R}}} + g^{\eta \xi } \nabla ^{\kappa } \nabla _{\kappa }f_{{\mathcal {R}}} = {\mathcal {T}}^{\eta \xi }, \end{aligned}$$
(3)

where, \(f = f({\mathcal {R}},{\mathcal {A}})\), \(f_{{\mathcal {R}}}= \frac{\partial f}{\partial {\mathcal {R}}}\), \(f_{{\mathcal {A}}}= \frac{\partial f}{\partial {\mathcal {A}}}\), \({\mathcal {A}}^{\eta \xi }\) is the anticurvature tensor which is the inverse of the Ricci tensor \({\mathcal {R}}_{\eta \xi }\). The stress–energy momentum tensor \({\mathcal {T}}_{\eta \xi }\) is chosen as

$$\begin{aligned} {\mathcal {T}}_{\eta \xi }=(\rho + p_{t}) u_{\eta } u_{ \xi } - p_{t} g_{\eta \xi } + (p_{r} - p_{t}) {\chi }_{\eta } {\chi }_{\xi }. \end{aligned}$$
(4)

Here, \(\rho ,\) \(p_{r}\) and \(p_{t}\) are energy density, radial and transverse pressure components respectively, while \(u_{\eta }\) and \({\chi }_{\eta }\) are four velocity vectors, which satisfy the relations \(u^{\eta } u_{\eta }= - {\chi }^{\eta } {\chi }_{\eta }=1\). Furthermore, we consider a static spherically symmetric line element which is represented as

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

where, \(\nu \) and \(\lambda \) are the functions of radial coordinate. Our stress–energy tensor is assumed to be anisotropic, with relativistic geometrized units \(8\pi G = 1\). Moreover, the embedded class-I family is represented by the metric tensor (5), if it fulfills the Karmarkar condition, i.e.

$$\begin{aligned} {\mathcal {R}}_{1414} {\mathcal {R}}_{2323} = {\mathcal {R}}_{1212} {\mathcal {R}}_{3434} + {\mathcal {R}}_{1224} {\mathcal {R}}_{1334}, \end{aligned}$$
(6)

with \({\mathcal {R}}_{2323}\ne 0\). The following differential equation for the given metric (5) is developed by using the well-known Karmarkar condition as

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

where \(e^{\lambda } \ne 1\). Integrating Eq. (7), we obtain

$$\begin{aligned} e^{\nu } = \left[ (A + B \int \sqrt{e^{\lambda } - 1} dr)^{2}\right] . \end{aligned}$$
(8)

In this case, A and B are integration constants. Further, due to the highly non-linear nature of modified field equations, we have no other choice but to choose the component \(g_{rr} = e^{\lambda (r)}\) in the following shape [2, 31]

$$\begin{aligned} e^{\lambda } =1 + a^{2} r^{2} (1 + b r^{2})^{x}, \end{aligned}$$
(9)

where one can choose any real value of x other than zero. It is really important to mention here that in order to establish embedded class-I spacetime, the parameters a and b should not be zero. In the domain of \({\mathcal{G}\mathcal{R}}\), Singh and Pant [31] investigated the properties of stellar structures by considering some positive values of x for embedding class-I solutions of different models of compact stars. Later, Bhar et al. [2] also used this metric potential by taking the value of \(x = - 4\), and the corresponding results are found stable in the context of \({\mathcal{G}\mathcal{R}}\). Inspired by the work of Bhar et al. [2], we aim to expand the study in the framework of \({\mathcal{R}\mathcal{I}}\) gravity by choosing \(x = - 4\). Interestingly, we tried some other possibilities for the choice of x (both positive and negative), however, we could not obtain physically acceptable results in those cases. Manipulating Eqs. (8) and (9), the metric potential expression becomes

$$\begin{aligned} e^{\nu } = \left[ \left( A - \frac{a B}{2 b (1 + b r^{2})}\right) ^{2}\right] . \end{aligned}$$
(10)
Fig. 1
figure 1

Graphical Behavior of \(g_{tt}\) and \(g_{rr}\) of \(S_{1}\) (), \(S_{2}\) (), \(S_{3}\) (), \(S_{4}\) (), \(S_{5}\) (), \(S_{6}\) (), \(S_{7}\) (), \(S_{8}\) (), \(S_{9}\) (), \(S_{10}\) (), \(S_{11}\) (), \(S_{12}\) ()

Further, to analyze the properties of compact stars, we probe the necessary conditions for the metric potentials of static spherically symmetric spacetime, namely \(e^{\lambda (0)} = 1\) and \(((e^{\lambda (r)})^{\prime })_{r=0} = 0\). The graphical response of \(g_{rr}\) should not contain any singularities, and the curvature must be regular. From Fig. 1, it is evident that all above properties are satisfied and also the plot of \(e^{\lambda }\) exhibits monotonically increasing behavior, reaching its maximum value near the boundary.

3 Viable \({\mathcal{R}\mathcal{I}}\) gravity model and matching conditions

In this section, we provide some discussions about linear \({\mathcal {R}}+ \alpha {\mathcal {A}}\) gravity model and the matching conditions. By substituting this model in Eq. (3), the field equations are simplified as

$$\begin{aligned}{} & {} {\mathcal {R}}^{\eta \xi } - \frac{1}{2} {\mathcal {R}} g^{\eta \xi } - \alpha {\mathcal {A}}^{\eta \xi } - \frac{1}{2} \alpha {\mathcal {A}} g^{\eta \xi }\nonumber \\{} & {} \quad + \frac{\alpha }{2} (2 g^{\mu \eta } \nabla _{\beta }\nabla _{\mu } {\mathcal {A}}_{\sigma }^{\beta } {\mathcal {A}}^{\xi \sigma } - \nabla ^{\kappa } \nabla _{\kappa } {\mathcal {A}}_{\sigma }^{\eta } {\mathcal {A}}^{\xi \sigma }\nonumber \\{} & {} \quad - g^{\eta \xi } \nabla _{\beta }\nabla _{\mu } {\mathcal {A}}_{\sigma }^{\beta } {\mathcal {A}}^{\mu \sigma }) = {\mathcal {T}}^{\eta \xi }. \end{aligned}$$
(11)

Using Eq. (11) and spacetime (5), modified field equations turn out to be

$$\begin{aligned} \rho&= e^{- \nu } \Gamma _{1} - \frac{1}{2} \Gamma _{2} - \alpha e^{\nu } \Gamma _{3} - \frac{1}{2} \alpha \Gamma _{4}\nonumber \\&\quad +\frac{\alpha }{2} \Bigg (e^{\nu - \lambda } \Gamma _{5}^{\prime \prime } + e^{\nu - \lambda } \nu ^{\prime \prime } \Gamma _{5} + 2 e^{\nu - \lambda } \nu ^{\prime } \Gamma _{5}^{\prime } + e^{\nu - \lambda } (\nu ^{\prime })^{2} \Gamma _{5}\nonumber \\&\quad - \frac{\lambda ^{\prime }}{2} e^{\nu - \lambda } \Gamma _{5}^{\prime } -\frac{\nu ^{\prime }\lambda ^{\prime }}{2} e^{\nu - \lambda } \Gamma _{5} + \frac{2}{r} e^{\nu - \lambda } \Gamma _{5}^{\prime } + \frac{2 \nu ^{\prime }}{r} e^{\nu - \lambda } \Gamma _{5}\nonumber \\&\quad - \Gamma _{6}^{\prime \prime } - \lambda ^{\prime \prime } \Gamma _{6} - \frac{3}{2} \lambda ^{\prime } \Gamma _{6}^{\prime } - \frac{(\lambda ^{\prime })^{2}}{2} \Gamma _{6} - 2 r e^{- \lambda } \Gamma _{7}^{\prime } - \frac{4}{r^{2}} \Gamma _{6}\Bigg ), \end{aligned}$$
(12)
$$\begin{aligned} p_{r}&= e^{- \lambda } \Gamma _{8} + \frac{1}{2} \Gamma _{2} - \alpha e^{\lambda } \Gamma _{9} + \frac{1}{2} \alpha \Gamma _{4}\nonumber \\&\quad + \frac{\alpha }{2} \Bigg (- \frac{(\nu ^{\prime })^{2}}{2} e^{\nu - \lambda } \Gamma _{5} + \frac{\nu ^{\prime } \lambda ^{\prime }}{2} \Gamma _{6} + \frac{\nu ^{\prime }}{2} \Gamma _{6}^{\prime } + 4 e^{- \lambda } \Gamma _{7}\nonumber \\&\quad + \frac{2 \lambda ^{\prime }}{r} \Gamma _{6} + \frac{2}{r} \Gamma _{6}^{\prime } - \frac{\nu ^{\prime }}{2} e^{\nu - \lambda } \Gamma _{5}^{\prime } + 2 r e^{- \lambda } \Gamma _{7}^{\prime }\Bigg ), \end{aligned}$$
(13)
$$\begin{aligned} p_{t}&= \frac{1}{r^{2}} \Gamma _{10} + \frac{1}{2} \Gamma _{2} - \alpha r^{2} \Gamma _{11} + \frac{1}{2} \alpha \Gamma _{4}\nonumber \\&\quad +\frac{\alpha }{2} \Bigg (\frac{\nu ^{\prime }}{2} r^{2} e^{- \lambda } \Gamma _{7}^{\prime } + r e^{- \lambda } \nu ^{\prime } \Gamma _{7} + r^{2} e^{- \lambda } \Gamma _{7}^{\prime \prime } + 4 e^{- \lambda } \Gamma _{7} \nonumber \\&\quad + 6 r e^{- \lambda } \Gamma _{7}^{\prime } -\frac{\lambda ^{\prime }}{2} r^{2} e^{- \lambda } \Gamma _{7}^{\prime } - r e^{- \lambda } \lambda ^{\prime } \Gamma _{7}\nonumber \\&\quad - \frac{\nu ^{\prime }}{2} e^{\nu - \lambda } \Gamma _{5}^{\prime } + \frac{(\nu ^{\prime })^{2}}{2} \Gamma _{6} + \Gamma _{6}^{\prime \prime } \nonumber \\&\quad + \lambda ^{\prime \prime } \Gamma _{6} + \frac{3}{2} \lambda ^{\prime } \Gamma _{6}^{\prime } + \frac{(\lambda ^{\prime })^{2}}{2} \Gamma _{6} + \frac{2}{r^{2}} \Gamma _{6}\Bigg ), \end{aligned}$$
(14)

where, the values of \(\Gamma _{i}\)’s \((i=1\ldots 11)\) are mentioned in Appendix and the prime represents the derivative with respect to r.

The star’s geometrical structure, whether viewed from the outside or the inside, has no impact on the interior boundary metric. The metric components must be continuous to the boundary regardless of the referential frame in this emerging situation. While evaluating several matching conditions and exploring compact objects in the context of \({\mathcal{G}\mathcal{R}}\), the Schwarzschild solution seems to be the right approach. According to the Jebsen–Birkhoff theorem, given spherically symmetric spacetime, the solution of the Einstein field equations \(({\mathcal {EFE}})\) must be asymptotically flat and static. In modified gravitational theories, the exterior geometry solution may vary from the Schwarzschild solution when we consider modified \(({\mathcal {TOV}})\) equations [18, 19] with zero pressure and energy density. Furthermore, the Schwarzschild solution can be achieved in \({\mathcal{R}\mathcal{I}}\) gravity by choosing a realistic and viable \({\mathcal {R}}+ \alpha {\mathcal {A}}\) gravity model with non-zero density and pressure components. The Birkhoff theorem contradicts modified theories as a result [32]. Numerous studies using Schwarzschild solution in matching constraints have produced impressive findings [33,34,35,36]. The radial pressure \(p_{r}(r = R) = 0\) is used to calculate the field equations solution under the specified boundary conditions at \(r = R\). Thus, we compare the internal geometry solution to the Schwarzschild external geometry provided by

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

where the entire mass contained within the star is represented by M. The following expressions are derived at \(r = R\) by probing at the metric potentials as follows:

$$\begin{aligned} g_{tt}^{+} = g_{tt}^{-}, \quad g_{rr}^{+} = g_{rr}^{-}, \quad \frac{\partial g_{tt}^{+}}{\partial r} = \frac{\partial g_{tt}^{-}}{\partial r}, \end{aligned}$$
(16)

where, (+) refers to the external geometry and (−) represents the internal geometry. The values of the required unknown quantities can be obtained by comparing the inner and outer matrices as shown below:

$$\begin{aligned} a&=\frac{(1+bR^{2})^{2}}{R} \sqrt{\frac{\frac{2M}{R}}{1-\frac{2M}{R}}}, \quad b=\frac{4M-R}{R^{2}(9R-20M)}, \end{aligned}$$
(17)
$$\begin{aligned} A&=\frac{aB}{2b(1+bR^{2})}+\sqrt{1-\frac{2M}{R}}, \quad B=\left( \frac{1}{2R}\right) \sqrt{\frac{2M}{R}}. \end{aligned}$$
(18)

We will use these matching conditions to analyze different compact star models in the background of \({\mathcal {R}}+ \alpha {\mathcal {A}}\) gravity. It is worthwhile to mention here that we provide a detailed comparison by considering 12 compact star models namely \(4U~1538{-}52\), \(SAX~J1808.4{-}3658\), \(Her~X{-}1\), \(LMC~X{-}4\), \(SMC~X{-}4\), \(4U~1820{-}30\), \(Cen~X{-}3\), \(4U~1608{-}52\), \(PSR~J1903{+}327\), \(PSR~J1614{-}2230\), \(Vela~X{-}1\), \(EXO~1785{-}248\). The values of the input parameters radius and mass of considered compact stars are given in Table 1.

Table 1 Approximated values of input parameters

By using the values of the input parameters from Table  1 and manipulating Eqs. (17, 18), the values of the output parameters a, b, A, and B are shown in Table 2.

Table 2 Approximated values of output parameters with \(\alpha = 1.3\times 10^{-11}\)
Fig. 2
figure 2

Behavior of \(\rho \), \(p_r\) and \(p_t\) of \(S_{1}\) (), \(S_{2}\) (), \(S_{3}\) (), \(S_{4}\) (), \(S_{5}\) (), \(S_{6}\) (), \(S_{7}\) (), \(S_{8}\) (), \(S_{9}\) (), \(S_{10}\) (), \(S_{11}\) (), \(S_{12}\) (). The magnified images in the figure show the behavior of the star \(Vela~X{-}1\) for two different values of parameter \(\alpha = 1.0\times 10^{-9}\), \(\alpha = 1.9\times 10^{-8}\)

Fig. 3
figure 3

Variation of \(\frac{d\rho }{dr}\), \(\frac{dp_r}{dr}\) and \(\frac{dp_t}{dr}\) of \(S_{1}\) (), \(S_{2}\) (), \(S_{3}\) (), \(S_{4}\) (), \(S_{5}\) (), \(S_{6}\) (), \(S_{7}\) (), \(S_{8}\) (), \(S_{9}\) (), \(S_{10}\) (), \(S_{11}\) (), \(S_{12}\) ()

Further, the requirements for a well-behaved compact structure are specified as:

  • The plots of \(\rho \), \(p_r\), and \(p_t\) must always be positive, finite, and maximum at the center.

  • The gradient of \(\rho \), \(p_r\), and \(p_t\) should be negative.

  • All of the energy requirements must be achieved.

  • The equation of state (EoS) should satisfy the mandatory constraints, namely \(0 < \omega _r\), \(\omega _t < 1\).

  • The equilibrium stability condition must be fulfilled by all of the forces.

  • The parameters of speed of sound must be between [0, 1], i.e. \(0 < \upsilon _r^2\), and \(\upsilon _t^2 < 1\).

  • Adiabatic index must be greater than \(\frac{4}{3}\) for an anisotropic fluid sphere.

4 Physical characteristics of the compact star models

In this section, we discuss some important physical properties of the observed compact stars in the context of considered \({\mathcal {R}}+ \alpha {\mathcal {A}}\) gravity model. For this purpose, we provide the graphical representations of energy density, pressure components, energy conditions, mass function, adiabatic index, stability and equilibrium conditions. Moreover, for our given model, we take the parameter \(\alpha = 1.3\times 10^{-11}\) for various compact stars. The parameter \(\alpha \) has a very limited range which provides us physically accepted results. We have checked two other values of parameter \(\alpha = 1.0\times 10^{-9}\), \(\alpha = 1.9\times 10^{-8}\) and found that there is a very slight difference in the behavior of the graphs towards the boundary. That difference is shown for one star \(Vela~X{-}1\) as a magnified image in Fig. 2.

4.1 Energy density and pressure profiles

We display the graphical behavior of \(\rho \), \(p_r\) and \(p_t\) for \({\mathcal {R}}+ \alpha {\mathcal {A}}\) model in this subsection. The graphical action of these aspects is presented in Fig. 2. In addition, we also show the graphical response of gradients of \(\rho \), \(p_r\) and \(p_t\) in the Fig. 3. It is clearly seen from the Fig. 2 that plots of energy density, radial and transverse pressures are positive as well as finite. One can easily notice that the demonstration of \(\rho \), \(p_r\) and \(p_t\) components reach the maximum values at the center of compact star and decline towards the stellar surface boundary.

Fig. 4
figure 4

Evolution of \(\Delta \) of \(S_{1}\) (), \(S_{2}\) (), \(S_{3}\) (), \(S_{4}\) (), \(S_{5}\) (), \(S_{6}\) (), \(S_{7}\) (), \(S_{8}\) (), \(S_{9}\) (), \(S_{10}\) (), \(S_{11}\) (), \(S_{12}\) ()

Fig. 5
figure 5

Profiles of the energy conditions of \(S_{1}\) (), \(S_{2}\) (), \(S_{3}\) (), \(S_{4}\) (), \(S_{5}\) (), \(S_{6}\) (), \(S_{7}\) (), \(S_{8}\) (), \(S_{9}\) (), \(S_{10}\) (), \(S_{11}\) (), \(S_{12}\) ()

In Fig. 3, the gradients of \(\rho \), \(p_r\) and \(p_t\) are plotted which are finite but negative. These elements indicate the high compactness character of the compact stars.

4.2 Anisotropy

In this portion, we discuss the graphical response of anisotropy parameter [37] which is represented by \(\Delta \) and defined as the difference between the transverse and radial pressures i.e. \(\Delta = p_t - p_r\). The nature of \(\Delta \) is attractive if \(p_t < p_r\) and repulsive if \(p_t > p_r\). Therefore, the anisotropy must indicate repulsive nature [38] for the compact stars to exist. From Fig. 4, it is obvious that anisotropy remains positive in our case i.e. \(\Delta > 0\), which implies that anisotropic force is drawn outwards.

Fig. 6
figure 6

Behavior of \({\mathcal {F}}_h\), \({\mathcal {F}}_g\) and \({\mathcal {F}}_a\) of \(S_{1}\) (), \(S_{2}\) (), \(S_{3}\) (), \(S_{4}\) (), \(S_{5}\) (), \(S_{6}\) (), \(S_{7}\) (), \(S_{8}\) (), \(S_{9}\) (), \(S_{10}\) (), \(S_{11}\) (), \(S_{12}\) ()

4.3 Energy conditions

The significant role of energy conditions in describing the existence of anisotropic compact stars is widely known in literature [39]. These energy limitations are classified namely null energy, strong energy, weak energy and dominant energy bounds represented by \({\mathcal {NEC}}\), \({\mathcal {SEC}}\), \({\mathcal {WEC}}\) and \({\mathcal {DEC}}\), sequentially and expressed as

$$\begin{aligned}&{\mathcal {NEC}}: \rho + p_r \ge 0, \quad \rho + p_t \ge 0, \nonumber \\&{\mathcal {WEC}}: \rho \ge 0, \quad \rho + p_r \ge 0, \quad \rho + p_t \ge 0, \nonumber \\&{\mathcal {SEC}}: \rho + p_r + 2p_t \ge 0, \nonumber \\&{\mathcal {DEC}}: \rho \ge 0, \quad \rho - |p_r| \ge 0, \quad \rho - |p_t| \ge 0. \end{aligned}$$
(19)

From Fig. 5, it is clearly observed that all energy conditions are satisfied for considered \({\mathcal {R}}+ \alpha {\mathcal {A}}\) gravity model.

Fig. 7
figure 7

Profiles of \(\omega _r\) and \(\omega _t\) of \(S_{1}\) (), \(S_{2}\) (), \(S_{3}\) (), \(S_{4}\) (), \(S_{5}\) (), \(S_{6}\) (), \(S_{7}\) (), \(S_{8}\) (), \(S_{9}\) (), \(S_{10}\) (), \(S_{11}\) (), \(S_{12}\) ()

Fig. 8
figure 8

Behavior of speeds of sound parameters, and Abreu condition of \(S_{1}\) (), \(S_{2}\) (), \(S_{3}\) (), \(S_{4}\) (), \(S_{5}\) (), \(S_{6}\) (), \(S_{7}\) (), \(S_{8}\) (), \(S_{9}\) (), \(S_{10}\) (), \(S_{11}\) (), \(S_{12}\) ()

Fig. 9
figure 9

Graphs of mass function (left panel), compactness factor (middle panel), and redshift(right panel) of \(S_{1}\) (), \(S_{2}\) (), \(S_{3}\) (), \(S_{4}\) (), \(S_{5}\) (), \(S_{6}\) (), \(S_{7}\) (), \(S_{8}\) (), \(S_{9}\) (), \(S_{10}\) (), \(S_{11}\) (), \(S_{12}\) ()

Fig. 10
figure 10

Variation of \(\gamma _r\), and \(\gamma _t\) of \(S_{1}\) (), \(S_{2}\) (), \(S_{3}\) (), \(S_{4}\) (), \(S_{5}\) (), \(S_{6}\) (), \(S_{7}\) (), \(S_{8}\) (), \(S_{9}\) (), \(S_{10}\) (), \(S_{11}\) (), \(S_{12}\) ()

4.4 Equilibrium conditions

Now, we investigate the equilibrium condition of our model under the existence of hydrostatic force, gravitational force and anisotropic force. The equilibrium condition among all these forces can be written as

$$\begin{aligned} \frac{M_G(r)(\rho + p_r)}{r}e^{\frac{\lambda - \upsilon }{2}} + \frac{dp_r}{dr} - \frac{2}{r}(p_t - p_r) = 0. \end{aligned}$$
(20)

The effective gravitational mass \(M_G(r)\) is expressed as

$$\begin{aligned} M_G(r) = \frac{1}{2}\upsilon ^{\prime }e^{\frac{\upsilon - \lambda }{2}}. \end{aligned}$$
(21)

Inserting value of \(M_G(r)\) in Eq. (21), we get

$$\begin{aligned} \frac{\upsilon ^{\prime }}{2}(\rho + p_r) + \frac{dp_r}{dr} - \frac{2}{r}(p_t - p_r) = 0, \end{aligned}$$
(22)

where, \({\mathcal {F}}_g = -\frac{\upsilon ^{\prime }}{2}(\rho + p_r)\), \({\mathcal {F}}_h = -\frac{dp_r}{dr}\) and \({\mathcal {F}}_a = \frac{2}{r}\Delta \) with \({\mathcal {F}}_g\), \({\mathcal {F}}_h\) and \({\mathcal {F}}_a\) identified as gravitational force, hydrostatic force and anisotropic force. The sum of these three forces should be equal to zero for the system to be balanced. Therefore, Eq. (23) gives

$$\begin{aligned} {\mathcal {F}}_g + {\mathcal {F}}_h + {\mathcal {F}}_a = 0. \end{aligned}$$
(23)

It can be easily noticed from Fig. 6, that all these forces express the required equilibrium condition.

4.5 Equation of state

Further, we determine EoS parameters for radial and tangential pressures, presented by

$$\begin{aligned} \omega _r = \frac{p_r}{\rho }, \quad \omega _t = \frac{p_t}{\rho }. \end{aligned}$$
(24)

The graphical illustration of both parameters in Fig. 7, clearly shows that \(0 < \omega _r\), \(\omega _t < 1\). Thus, it is concluded that the EoS satisfy the necessary conditions for compact stars under discussion.

4.6 Causality condition

The causality condition is subjected to the sound speed of both pressure components, i.e. radial and transverse pressures which are expressed as

$$\begin{aligned} \upsilon _r^2 = \frac{dp_r}{d\rho }, \quad \upsilon _t^2 = \frac{dp_t}{d\rho }. \end{aligned}$$
(25)

Here, \(\upsilon _r^2\) and \(\upsilon _t^2\) stand for radial and tangential sound speed. Using the concept of Herrera [40] i.e., \((0 \le \upsilon _r^2, \upsilon _t^2 \le 1)\), both of the sound speeds of pressure components must vary from 0 to 1 to stabilize our system. Further, we examine the graphical response of our selected model for the Andreasson condition [41], \(|\upsilon _r^2 - \upsilon _t^2| \le 1\). The graphical representations in Fig. 8, indicate the stability and balanced nature of \({\mathcal {R}}+ \alpha {\mathcal {A}}\) model satisfying the causality condition.

4.7 Mass function, compactness factor and redshift analysis

The mass function [2] attained by making use of the metric potential \(g_{rr}^{-} = g_{rr}^{+}\) is given as

$$\begin{aligned} {\mathcal {M}}(r) = \frac{a^2 r^3}{2[(1 + b r^2)^4 + a^2 r^2]}. \end{aligned}$$
(26)

Moreover, we compute the compactness parameter \({\mathcal {U}}(r)\) [42] and the redshift function \({\mathcal {Z}}(r)\) [37], derived as the following expressions

$$\begin{aligned} {\mathcal {U}}(r)= & {} \frac{2 {\mathcal {M}}(r)}{r} = \frac{a^2 r^2}{[(1 + b r^2)^4 + a^2 r^2]}, \end{aligned}$$
(27)
$$\begin{aligned} {\mathcal {Z}}(r)= & {} e^{-\frac{\nu }{2}} - 1. \end{aligned}$$
(28)

Figure 9 shows the graphical behavior of \({\mathcal {M}}(r)\), \({\mathcal {U}}(r)\) and \({\mathcal {Z}}(r)\). The nature of mass function meets the Buchdahl [43] and Bondi [44] constraint i.e., \(\frac{2 M}{R} < \frac{8}{9}\). In addition, it can be noticed that as we advance towards the boundary, mass function and compactness parameter increase monotonically while the plot of redshift indicates monotonically decreasing behavior. Therefore, we sum up that these graphs illustrate the satisfactory behavior for our model.

4.8 Adiabatic index

The stiffness of EoS for a given energy density is described by adiabatic index. It verifies the stability of stellar objects, both relativistically and non relativistically. Chandrasekhar [45] presented the theory of dynamical stability for the infinitesimal, radial adiabatic oscillations of stellar spheres. His idea has been tested by many authors for isotropic and anisotropic stellar structures [46,47,48,49,50,51]. The value of adiabatic index should be greater than \(\frac{4}{3}\), for compact star models to be stable. Adiabatic index of pressure components, \(p_r\) and \(p_t\) have the following expressions respectively

$$\begin{aligned}&\gamma _r = \frac{\rho + p_r}{p_r}\left( \frac{dp_r}{d\rho }\right) = \frac{\rho + p_r}{p_r} v_r^2, \nonumber \\&\gamma _t = \frac{\rho + p_t}{p_t}\left( \frac{dp_t}{d\rho }\right) = \frac{\rho + p_t}{p_t} v_t^2. \end{aligned}$$
(29)

It is concluded from Fig. 10 that the considered \({\mathcal {R}}+ \alpha {\mathcal {A}}\) model is potentially balanced under the above stability condition.

5 Summary and concluding remarks

We assume a realistic \({\mathcal {R}}+ \alpha {\mathcal {A}}\) gravity model by using the Karmarkar condition to investigate a novel family of embedded class-I solutions in the anisotropic framework. Since the Karmarkar condition provides a link between \(g_{rr}\) and \(g_{tt}\), it simplifies the solution generating process of \({\mathcal {EFE}}\) to a single metric potential. Assuming the metric potential \(e^{\lambda } = 1 + \frac{a^{2} r^{2}}{(1 + b r^{2})^{4}}\) for this purpose, we use the Karmarkar condition to determine the second metric potential, \(e^{\nu } = \left[ \left( A - \frac{a B}{2 b (1 + b r^{2})}\right) ^{2}\right] \), where a, b, A, and B are arbitrary constants. We also determine the unknown constants by applying matching constraints between the internal and Schwarzschild external geometries. We examine the physical behavior of twelve different compact stars to confirm that the discussed solutions are physically feasible. The primary objective of our research is to study stellar structures using a viable \({\mathcal {R}}+ \alpha {\mathcal {A}}\) gravity model in the context of an anisotropic matter source. The notable results are listed below.

  • Metric potentials are frequently used to characterize the properties of spacetime. According to Fig. 1, both the metric potentials \(g_{rr} = e^{\lambda }\) and \(g_{tt} = e^{\nu }\) exhibit graphical behavior that is finite, positive, singularity-free, and satisfies the criteria, i.e., \(e^{\lambda (r=0)} = 1\) and \(e^{\nu (r=0)} = \left[ A - \frac{a B}{2 b} \right] ^{2}\). Since these graphs expand monotonically and reach their maximum values at the boundary, the progression of both potentials exhibits excellent outcomes, supporting the \({\mathcal {R}}+ \alpha {\mathcal {A}}\) gravity model.

  • The trend of density and pressure components for \({\mathcal {R}}+ \alpha {\mathcal {A}}\) gravity model is shown in Fig. 2. For this purpose, we consider the model parameter \(\alpha = 1.3\times 10^{-11}\). It is important to mention here that the parameter \(\alpha \) has a very limited range which provides us physically accepted results. We have checked two other values of parameter \(\alpha = 1.0\times 10^{-9}\), \(\alpha = 1.9\times 10^{-8}\) and found that there is a very slight difference in the behavior of the graphs towards the boundary. That difference is shown for one star only \(Vela~X{-}1\) as a magnified image in Fig. 2. The variations of \(\rho \), \(p_r\), and \(p_t\) with respect to r are finite and regular at the center. It is also evident that graphs of \(\rho \), \(p_r\), and \(p_t\) reach their highest values at the center and show a diminishing response toward the border, supporting the stability of our model. The gradient of \(\rho \), \(p_r\), and \(p_t\) has been depicted in Fig. 3. These graphs exhibit negative behavior, demonstrating the consistency of our suggested model.

  • It is clear from Fig. 4 that anisotropy is positive throughout the stellar objects. This behavior demonstrates that anisotropy has a repulsive nature, confirming its existence for compact objects.

  • The energy bounds for the suggested \({\mathcal {R}}+ \alpha {\mathcal {A}}\) model are shown in Fig. 5. We observed that our given model fulfills all energy bounds.

  • The equilibrium conditions of \({\mathcal {F}}_g\), \({\mathcal {F}}_h\), and \({\mathcal {F}}_a\) of our physically acceptable model show balancing behavior in Fig. 6.

  • The graphical response of EoS must fulfill the requirements \(0 < \omega _r\), \(\omega _t < 1\) for the consistency of the stellar objects. The corresponding graphical representation in Fig. 7 depicts that both EoS ratios have a stable character.

  • The radial component sound velocity \(\upsilon _{r}^{2}\) plot and the transverse component sound velocity \(\upsilon _{t}^{2}\) plot should fall within the range [0, 1] for compact stars. According to Fig. 8, the stability constraints for our model are stable.

  • From Fig. 9, it is easy to notice that the graphs of the mass function and the compactness parameter demonstrate monotonically increasing responses. On the other hand, the graphical illustration of redshift analysis reveals monotonically decreasing behavior. The behavior shows that our given model achieves the stability criteria.

  • In Fig. 10, the adiabatic index of \(\gamma _r\) and \(\gamma _t\) for our given model is more than \(\frac{4}{3}\), confirming the stability of our system.

As a final observation, we have used the Karmarkar condition to provide a stellar system that is both well-stable and singularity-free. We conclude that \({\mathcal {R}}+ \alpha {\mathcal {A}}\) gravity model supports the existence of compact objects which follow observable patterns. Furthermore, it is worth mentioning that our suggested results are almost similar to the outcomes investigated by Naz et al. [30] in the context of \(f({\mathcal {R}})\) theory of gravity. It may be noted that due to the involvement of inverse curvature terms, we get more dense stars in our case.