1 Introduction

In last few decades, various extended theories of gravity have been proposed as the most promising candidates of mysterious dark energy for exploring the accelerated expansion aspects of our cosmos. There are several independent observations in the context of astrophysics that provide evidences about the accelerated expanding nature of space. These astrophysical experiments include the outcomes acquired from the supernova type Ia (SNIa) [1,2,3,4,5,6,7,8], large scale construction surveys [9], X-ray brightness from galaxy erect [10], cosmic microwave background radiation (CMBR) [11,12,13], weak lensing and the baryon acoustic oscillation (BAO) surveys [14]. This phenomenon of accelerating cosmic expansion is regarded as an outstanding critical riddles of contemporary physics. It is argued that the expansion of cosmos is accelerated due to the presence of some uncertain dominant source of energy labeled as dark energy (DE). In order to incorporate this unusual motive of dynamical cosmos, some modifications in the Lagrangian density of Einstein’s general relativity have been presented in the literature. One of the way to deal with the problem is to modify the matter profile of the density by adding some DE terms as scalar field or cosmological constant, k-essence, canonical kinetic scalar term, quintessence, and different versions of chaplying gas etc. [15,16,17,18,19,20]. While in the alternative approach, researchers extended the gravitational part by adding some extra degrees of freedom there, which provided the group of extended theories of gravity. In this respect, some leading examples include \(f(T,T_{G})\) theory, \(f(\mathrm {G})\) gravity, \(f(\mathcal {R})\) framework, braneworld scenarios, Kalb–Ramond background, Gauss–Bonnet gravity and Brans–Dicke gravity theories etc. [21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]. Based on these modifications, many other remarkable generalized modifications are also available, which help to explore various cosmic aspects successfully. These all modifications have passed different astrophysical and necessary solar system constraints and are regarded as viable candidates.

After the formulation of general theory of relativity (GR), the \(f(\mathcal {R})\) theory is regarded as one of the most interesting and viable extension of GR. Later on, its different modified versions have been presented by researchers that are also proved as successful in various respects. Particularly, its recent extension namely \(f(\mathcal {R},\mathcal {T})\) gravity, proposed by Harko et al. [37] almost 6 years ago, has attracted many researchers. This modification is based on a governing function \(f(\mathcal {R},\mathcal {T})\) depending on the Ricci scalar \(\mathcal {R}\) and the trace \(\mathcal {T}\) of anisotropic like energy-momentum tensor. They also derived the corresponding field equation by utilizing the metric potentials formalism and discussed the significance of this modification. Further, the authors have presented different models for \(f(\mathcal {R},\mathcal {T})\) function in separable form, i.e., \(f(\mathcal {R},\mathcal {T})=f_{1}(\mathcal {R})+f_{2}(\mathcal {T})\). It is considered as a very interesting modification because the resulting field equations have not much difficult form or un-handled order. There is a sufficient literature available where numerous cosmological aspects of this theory have been explored like expansion of universe due to accelerated matter, Birkhoff’s theorem, scalar field reconstructions, stability using cosmological perturbation, large scale structure, thermodynamical laws and its relevant features, constrains regarding solar system, stellar equilibrium configurations of compact stars, neutron stars, gravitational collapse phenomenon [38,39,40,41,42,43,44,45,46,47,48].

The study of compact stars formation and phenomenon of gravitational collapse is regarded as one of the most fascinating subjects in modern cosmology and astronomy. In 1916, Carl Schwarzschild presented the exact solution of interior of symmetric star spherically by using the uniform density based matter profile [49]. In 1939, Oppenheimer and Snyder [50] contributed to explore the gravitational collapse with homogeneity based dust sphere. In literature [51,52,53,54,55], hundreds of static analytic models representing the relativistic stars have been constructed by introducing bulk viscous effects, anisotropic pressures, charge, multilayered fluids and equations of state etc. The discussion of ultra densities for matter profile of order \(10^{15}\;{\text {g cm}}^{-3}\) provides a new idea that radial pressure profile and tangential pressure profile are unequal. In this context, Ruderman [56] was the pioneer who predicted that in the high density, relativistic interaction of nuclear matter yields anisotropy as an inherent feature. Lobo [57] used barotropic EoS for exploring some compact object models which is defined as \(p=\epsilon \rho ;~ -1<\epsilon <-1/3\), for the dark stars existence. He also presented a modified version of Mazur–Mottola gravastar model by utilizing the junction conditions to match Schwarzschild vacuum solution with static line element. Egeland [58] explained Neutron stars by taking mass-radius relationship into account. In another study [59], Mak and Harko proposed a spherically symmetric model exhibiting the characteristics of strange stars. Further, Rahaman et al. [60] discussed the possibility of compact stars formation by using Krori–Barua model in the presence of Chaplygin gas matter distribution. In modified gravitational frameworks like f(R) gravity and scalar-tensor theories, much work has already been done for modeling the massive as well as neutron stars [61,62,63,64,65]. Hossein et al. [66] have developed some compact stars models with anisotropic matter and variable cosmological constant where they assumed a linear equation of state. In different collaborations [67, 68], Herrera discussed some interesting anisotropic solutions for static as well as non static sources. In the context of GR and modified gravitational frameworks of f(T) and f(G) theories, much work has already been done by the researchers [69,70,71,72,73,74,75,76]. Zubair and Abbas [77] have explored some interior compact star models in f(R) extension of GR by including Krori and Barua solutions and discussed different physical features as well as the stability of the obtained models.

Naidu and Govender [78] investigated two new stellar models with same radii and mass but distinct pressure distributions. In another study, Zubair et al. [51,52,53,54,55] investigated the possible existence of compact stars in f(R,T) framework by taking the analytic models of Krori and Barua line element into account and presented a detailed analysis of the models by discussing some physical features. In 2013, Herrera and Barreto [79] acquired a mathematical procedural technique to produce a relativistic-polytropes with radial and tangential pressure profiles by using curvature coordinates. Recently, a considerable approach for deriving the analytic solutions of Einstein field equations, representing the compact objects, has been proposed by the researchers namely the Karmarkar condition [80,81,82,83,84,85,86,87]. This condition was firstly proposed by Karmarkar [88] and is regarded as a compulsory condition for a spherically symmetric spacetime to be of embedding class-I. It is basically a mathematical tool which helps us in obtaining the exact solutions of field equations. In literature [89,90,91,92,93], this condition has been used by numerous researchers for discussing the compact stars models. In the present paper, we shall adopt the Karmarkar condition to develop the analytic solutions representing compact objects in \(f(\mathcal {R},\mathcal {T})\) gravity.

Being motivated from the above literature, in the present manuscript, we will discuss the formation of compact stars in \(f(\mathcal {R},\mathcal {T})\) modified gravity by considering three different models of compact stars. For this purpose, we will consider static spherically geometry filled with anisotropic matter contents and also take the well-known Karmarkar condition. In the up-coming section, we will define the mathematical structure of \(f(\mathcal {R},\mathcal {T})\) gravity and formulate its field equations. In the same section, we will present the Karmarkar condition briefly and calculate isotropic like Class-I solutions with two different cases of \(f(\mathcal {R},\mathcal {T})\) gravity. In Sect. 3, we will discuss the set up for a new family of embedding class-I solutions along with the physical boundary conditions. In Sect. 4, we will present the analysis of obtained solutions using three different models for compact stars like 4U 1538-52, LMC X-4 and PSR J1614-2230 by investigating different physical properties analytically and graphically. In the same section, we will discuss the stability of obtained model using different viable measures. In last, we will conclude the whole discussion by focusing on the main achievements.

2 \(f(\mathcal {R},\mathcal {T})\) gravity field equations and anisotropic fluid distribution

In this segment, we will describe the basic formulation of \(f(\mathcal {R} ,\mathcal {T})\) modified theory of gravity and develop its field equations for a static spherically symmetric spacetime geometry. Here we will also briefly explain the idea of Karmarker condition and some assumptions taken for this work. The modified Einstein–Hilbert action defining the well-known \(f(\mathcal {R}, \mathcal {T})\) gravitational framework is given by [37]

$$\begin{aligned} \mathbf {S}_{\textit{action}}=\frac{1}{16\pi }\int f(\mathcal {R}, \mathcal {T})\sqrt{-\mathrm {g}}d^{4}x+\int \mathcal {L}_{\mathrm {m}}\sqrt{-\mathrm {g}}d^{4}x, \end{aligned}$$
(1)

where \(\mathcal {L}_{\mathrm {m}}\) denotes the Lagrangian density of ordinary matter and \(f(\mathcal {R},\mathcal {T})\) represents a generic function depending on two variables namely the scalar curvature \(\mathcal {R}\) and the energy-momentum tensor trace \(\mathcal {T}_{\mu \nu }\), which is defined as \(\mathcal {T}=\mathcal {T}^{\mu \nu }\mathcal {T}_{\mu \nu }\). The variation of the above modified action with respect to metric tensor leads to the following set of field equations:

$$\begin{aligned}&8\pi \mathcal {T}_{\mu \nu }-f_{\mathcal {T}}(\mathcal {R},\mathcal {T})\mathcal {T}_{\mu \nu }-f_{\mathcal {T}}(\mathcal {R},\mathcal {T})\Theta _{\mu \nu }\nonumber \\&\qquad -(\mathrm {g}_{\mu \nu }\Box -\nabla _{\mu }\nabla _{\nu })f_{\mathcal {R}}(\mathcal {R} ,\mathcal {T})\nonumber \\&\quad =-\frac{1}{2}f(\mathcal {R},\mathcal {T})\mathrm {g}_{\mu \nu }+f_{\mathcal {R}}(\mathcal {R},\mathcal {T})\mathcal {R}_{\mu \nu }. \end{aligned}$$
(2)

In the above set of equations, the notation \(\nabla \) refers to the covariant derivative, while the symbol \(\Box \) denotes the d’Alembert operator, i.e., \(\Box =\partial _{\mu }(\sqrt{-\mathrm {g}}\mathrm {g}^{\mu \nu }\partial _{\nu })/\sqrt{-\mathrm {g}}\). Moreover, the function \(f(\mathcal {R}, \mathcal {T})\) with subscripts \(\mathcal {R}\) and \(\mathcal {T}\) represent the respective derivatives, i.e., \(f_{\mathcal {R}}(\mathcal {R},\mathcal {T})=\partial f(\mathcal {R},\mathcal {T})/\partial \mathcal {R}\) and \(f_{T}(\mathcal {R},\mathcal {T})=\partial f(\mathcal {R},\mathcal {T})/\partial \mathcal {T}\). Also, the term \(\Theta _{\mu \nu }\) is given by

$$\begin{aligned} \Theta _{\mu \nu }=\frac{\mathrm {g}^{\alpha \beta }\delta \mathcal {T}_{\mu \nu }}{\delta \mathrm {g}^{\mu \nu }}=-2\mathrm {g}^{\alpha \beta }\frac{\partial ^{2}\mathcal {L}_{\mathrm {m}}}{\partial \mathrm {g}^{\mu \nu }\partial \mathrm {g}^{\alpha \beta }}-2\mathcal {T}_{\mu \nu }+\mathrm {g}_{\mu \nu }\mathcal {L}_{\mathrm {m}}. \end{aligned}$$

The energy-momentum tensor representing the anisotropic matter profile within a star is defined by

$$\begin{aligned} \mathcal {T}_{\mu \nu }=(\rho +p_{t})\zeta _{\mu }\zeta _{\nu }-p_{t}\mathrm {g}_{\mu \nu }+(p_{r}-p_{t})\xi _{\mu }\xi _{\nu }, \end{aligned}$$
(3)

where \(\zeta _{\mu }\) and \(\xi _{\mu }\) represent the 4-velocity vectors defined by the relations \(\zeta ^{\mu }=e^{-a}\delta ^{\mu }_{0}\) and \(\xi ^{\mu }=e^{-b}\delta ^{\mu }_{1}\) and also satisfy the condition \(\zeta ^{\mu }\zeta _{\mu }=-\xi ^{\mu }\xi _{\mu }=1\). Here, the terms \(\rho ,~ p_{t}\) and \(p_{r}\) all are radial coordinate dependent functions and represent the energy density, radial and tangential components of pressure, respectively. It is also interesting to mention here that the function \(p_{t}\) is orthogonal in the direction of \(\xi _{\nu }\), while \(p_{r}\) is orthogonal in the direction of \(\xi _{\mu }\). By taking the variation of indices along with energy-momentum tensor (3), the set of field equations (2) take the following form

$$\begin{aligned} \mathcal {G}_{\mu \nu }= & {} \frac{1}{f_{\mathcal {R}}(\mathcal {R},\mathcal {T})}\left( (8 \pi +f_{\mathcal {T}}(\mathcal {R},\mathcal {T}))\mathcal {T}_{\mu \nu }\nonumber \right. \\&+(\nabla _{\mu }\nabla _{\nu }-\mathrm {g}_{\mu \nu }\Box )f_{\mathcal {R}}(\mathcal {R},\mathcal {T})\nonumber \\&+\left. \frac{1}{2}(f(\mathcal {R},\mathcal {T})-\mathcal {R} f_{\mathcal {R}}(\mathcal {R},\mathcal {T}))\mathrm {g}_{\mu \nu }-\rho \mathrm {g}_{\mu \nu }f_{\mathcal {T}}(\mathcal {R},\mathcal {T})\right) .\nonumber \\ \end{aligned}$$
(4)

The line element representing the geometry of a static object exhibiting spherically symmetry is given by

$$\begin{aligned} d{s}^2=-e^{\mu (r)}dt^2+e^{\nu (r)}d{r}^2+r^2d\Omega ^{2}, \end{aligned}$$
(5)

where \(d\Omega ^{2}=(d\theta ^2+\sin ^2\theta d\phi ^2)\) and defines the \(\mathrm {g}_{\theta \theta }\) and \(\mathrm {g}_{\phi \phi }\) components. For the simplicity in calculations, we choose an interesting simple model of \(f(\mathcal {R},\mathcal {T})\) given by [38,39,40,41,42,43,44,45,46,47,48]

$$\begin{aligned} f(\mathcal {R},\mathcal {T})= \mathcal {R}+\lambda \mathcal {T}, \end{aligned}$$
(6)

where \(\lambda \) is an arbitrary constant. Using metric (5) in the Eq.(4) and then by re-arranging the resulting field equations for the functions \(\rho ,~ p_{r}\) and \(p_{t}\), we obtain

$$\begin{aligned}&\rho =\frac{e^{-\nu (r)}}{32\pi (\lambda +1) (2 \lambda +1) r^2}\left( -4 \lambda +4 \lambda r^2 \mu ''(r)\right. \nonumber \\&\qquad \left. +(2 \lambda +1) r^2 \mu '(r)^2-(\lambda +1) \left( 2 r^2 \mu ''(r)\right. \right. \nonumber \\&\qquad -\left. r^2 \mu '(r) \nu '(r)+r^2 \mu '(r)^2+4 r \mu '(r)\right. \nonumber \\&\qquad \left. -4 r \nu '(r)-4 e^{\nu (r)}+4\right) +2 r^2 \mu ''(r)\nonumber \\&\qquad -\left. (2 \lambda +1) r \mu '(r) \left( r \nu '(r)-4\right) +4 \lambda r \nu '(r)+4 \lambda e^{\nu (r)}\right) , \end{aligned}$$
(7)
$$\begin{aligned}&p_{r}=\frac{e^{-\nu (r)}}{32\pi \left( 2 \lambda ^2+3 \lambda +1\right) r^2}\left( -2 \left( (2 \lambda +1) r^2 \mu ''(r)\right. \right. \nonumber \\&\qquad \left. +2 \lambda \left( e^{\nu (r)}-1\right) \right) +(2 \lambda +1) r^2 \mu '(r) \nu '(r)\nonumber \\&\qquad -\left. (2 \lambda +1) r^2 \mu '(r)^2+(\lambda +1) \left( 2 r^2 \mu ''(r)-r^2 \mu '(r) \nu '(r)\right. \right. \nonumber \\&\qquad +r^2 \mu '(r)^2+4 r \mu '(r)\nonumber \\&\qquad -\left. \left. 4 r \nu '(r)-4 e^{\nu (r)}+4\right) +4 (\lambda +1) r \nu '(r)\right) ,\end{aligned}$$
(8)
$$\begin{aligned}&p_{t}=\frac{e^{-\nu (r)}}{32\pi \left( 2 \lambda ^2+3 \lambda +1\right) r^2}\left( (\lambda +1) \left( 2 r^2 \mu ''(r)\right. \right. \nonumber \\&\qquad -r^2 \mu '(r) \nu '(r)+r^2 \mu '(r)^2+4 r \mu '(r)-4 r \nu '(r)\nonumber \\&\qquad -\left. 4 e^{\nu (r)}+4\right) +2 \left( -(2 \lambda r+r) \mu '(r)\right. \nonumber \\&\qquad \left. \left. +2 (\lambda +1) \left( e^{\nu (r)}-1\right) +r \nu '(r)\right) \right) ,\end{aligned}$$
(9)
$$\begin{aligned}&8\pi ( p_{t}-p_{r})=\frac{e^{-\nu (r)}}{4 (\lambda +1) r^2}\left( r \left( 2 r \mu ''(r)+\mu '(r) \left( r \mu '(r)\nonumber \right. \right. \right. \\&\qquad \left. \left. \left. -r \nu '(r)-2\right) -2 \nu '(r)\right) +4 \left( e^{\nu (r)}-1\right) \right) . \end{aligned}$$
(10)

Here the last equation for \(8\pi ( p_{t}-p_{r})\) gives a measurement of anisotropy which is denoted by \(\triangle \), i.e., \(\triangle =8\pi ( p_{t}-p_{r})\). For having isotropic pressures condition, this equation should be vanished, \(\triangle =0\).

Now we will explain the well-known Karmarker condition briefly which is the most important tool considered in the present study. The foundation of Karmarkar condition depends upon the Riemannian space of class-I. Eisenhart [80] presented a necessary and sufficient condition which is based on a symmetric tensor of second order \(\beta _{\mu \eta }\) and the Riemann curvature tensor and is defined in terms of the following equations:

$$\begin{aligned} \Xi (\beta _{\mu \eta }\beta _{\nu \gamma }-\beta _{\mu \gamma }\beta _{\nu \eta })= & {} \mathcal {R}_{\mu \nu \eta \gamma }, \end{aligned}$$
(11)
$$\begin{aligned} \beta _{\mu \nu ;\eta }-\beta _{\mu \eta ;\nu }= & {} 0, \end{aligned}$$
(12)

where \({\texttt {;}}\) denotes the covariant derivative and \(\Xi =\pm 1\). These values refer to a time-like or space-like manifold depending on the sign taken as − or \(+\), respectively.

Now, by utilizing the non-zero Riemann curvature components for the spacetime geometry (5) along with the non-zero components of second order of symmetric tensor \(\beta _{\mu \eta }\) in Eq.(11), we get a relationship of the form

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

This relation represents the well-known Karmarkar condition where \(\mathcal {R}_{2323}\ne 0\). Here the expression \(\mathcal {R}_{2323}\ne 0\) represents the Pandey–sharma condition [94]. Pandey and Sharma presented an argument about the Karmarkar condition that this condition is not a sufficient condition for a symmetric space time for being a class-I model. Further, by plugging all the respective values of the Riemann curvature components in Eq.(13), we get a differential equation, given by

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

where \(e^{\nu (r)}\ne 1\). The integration of Eq.(14) leads to a relationship between \(\mathrm {g}_{rr}\) and \(\mathrm {g}_{tt}\) components of the line element given by

$$\begin{aligned} e^{\nu (r)}=\frac{(\mu ^{'}(r))^{2}e^{\mu (r)}K}{4}+1, \end{aligned}$$
(15)

where K is introduced as a constant of integration. Now, we calculate the derivative of \(\nu (r)\) with respect to radial coordinate r, which can be written as

$$\begin{aligned} \nu '(r)=\frac{e^{\mu (r)} \mu '(r) \left( 2 \mu ''(r)+\mu '(r)^2\right) }{4 B^2+e^{\mu (r)} \mu '(r)^2}, \end{aligned}$$
(16)

where \(B^{2}=1/K\). Using these value of \(e^{\nu (r)}\) and \(\nu '(r)\) in Eq. (10), the anisotropy function for \(f(\mathcal {R},\mathcal {T})\) takes the following form

$$\begin{aligned} \triangle= & {} 8\pi ( p_{t}-p_{r})=\frac{\mu '(r)}{4 (\lambda +1) e^{\nu (r)}}\left( \frac{2}{r}-\frac{\nu '(r)}{e^{\nu (r)}-1}\right) \nonumber \\&\quad \left( \frac{e^{\mu (r)} \mu '(r)}{2 B^2 r}-1\right) , \end{aligned}$$
(17)

where \(\lambda \ne -1\). In the upcoming sections, we will talk about the solutions representing stellar models for isotropic as well as anisotropic cases respectively.

3 Isotropic like class-I solutions for \(f(\mathcal {R},\mathcal {T})\) theory

In this segment, we shall discuss the case of isotropic pressures and its consequent outcomes. The isotropic case, where \(p_r=p_t\), yields the anisotropy measure function as zero, i.e., \(\triangle =0\). Assuming \(\mu '(r)\ne 0\), Eq. (17) provides two interesting results given by

$$\begin{aligned} \left( \frac{2}{r}-\frac{\nu '(r)}{e^{\nu (r)}-1}\right) =0, \end{aligned}$$
(18)

or

$$\begin{aligned} \left( \frac{e^{\mu (r)} \mu '(r)}{2 B^2 r}-1\right) =0 \end{aligned}$$
(19)

or the product of both expressions equal to zero. Here Eq. (18) corresponds to Schwarzschild’s constant like density model, which is already presented by Bhar et al. [95], while the second result given by Eq.(19) leads to the Kohler–Chao cosmological like solution.

3.1 Schwarzschild interior solution for \(f(\mathcal {R},\mathcal {T})\) theory

In order to find the Schwarzschild interior solution [49], we integrate Eq. (18), which yields the following solution:

$$\begin{aligned} e^{-\nu }=1-cr^{2}, \end{aligned}$$
(20)

where c is a constant of integration. Now, by utilizing Eq. (20) in the Eq. (15), we get a differential equation given by

$$\begin{aligned} \frac{e^{\mu (r)} \mu '(r)^2}{4 B^2}+1=\frac{1}{1-c r^2}. \end{aligned}$$
(21)

By solving this differential equation for \(\mu (r)\), we obtain a final solution for the \(\mathrm {g}_{tt}\) component of the line element given by

$$\begin{aligned} e^{\mu (r)}=\left( A-B \sqrt{\frac{1-c r^{2}}{c}}\right) ^2, \end{aligned}$$
(22)

where A is another constant of integration. The above solution (22) is a well-known Schwarzschild interior solution model that describes an incompressible static sphere with uniform energy density. Now, we present the expressions for energy density and both pressure components, which are calculated in Eqs. (7) and (8). In the present case, these expressions take the following form:

$$\begin{aligned} 8\pi \rho= & {} \frac{3 c \left( A \sqrt{c} (2 \lambda +1) \sqrt{1-c r^2}+B (\lambda +1) \left( c r^2-1\right) \right) }{(\lambda +1) (2 \lambda +1) \left( A \sqrt{c} \sqrt{1-c r^2}+B \left( c r^2-1\right) \right) },\nonumber \\ \end{aligned}$$
(23)
$$\begin{aligned} 8\pi p= & {} -\frac{c \left( A \sqrt{c} (2 \lambda +1) \sqrt{1-c r^2}+3 B (\lambda +1) \left( c r^2-1\right) \right) }{(\lambda +1) (2 \lambda +1) \left( A \sqrt{c} \sqrt{1-c r^2}+B \left( c r^2-1\right) \right) },\nonumber \\ \end{aligned}$$
(24)
$$\begin{aligned} \frac{p}{\rho }= & {} -\frac{A \sqrt{c} (2 \lambda +1) \sqrt{1-c r^2}+3 B (\lambda +1) \left( c r^2-1\right) }{3 \left( A \sqrt{c} (2 \lambda +1) \sqrt{1-c r^2}+B (\lambda +1) \left( c r^2-1\right) \right) }.\nonumber \\ \end{aligned}$$
(25)

This Schwarzschild solution is very interesting as well as simple solution and have already been studied by several researchers in literature.

3.2 Kohler–Chao cosmological like solution for \(f(\mathcal {R},\mathcal {T})\) theory

Here we discuss the Kohler–Chao cosmological model like solution [96]. For this purpose, we integrate Eq. (19) which leads to the following solution for the reciprocal of \(\mathrm {g}_{rr}\) component of the line element given as follows

$$\begin{aligned} e^{-\mu }=\frac{1}{A+Br^2}, \end{aligned}$$
(26)

where A denotes a constant of integration. Now, by using the value from Eq. (26) of \(e^{\mu }\) in the Eq. (15), we acquire the following solution for reciprocal of \(\mathrm {g}_{tt}\) component:

$$\begin{aligned} e^{-\nu (r)}=\frac{Br^{2}+A}{2Br^{2}+A}. \end{aligned}$$
(27)

The above solution (27) corresponds to the Kohler–Chao cosmological model like solution. Also, the corresponding expressions for energy density and pressure components take the following forms:

$$\begin{aligned} 8\pi \rho= & {} \frac{B \left( A (9 \lambda +3)+2 B (4 \lambda +1) r^2\right) }{(\lambda +1) (2 \lambda +1) \left( A+2 B r^2\right) ^2},\end{aligned}$$
(28)
$$\begin{aligned} 8\pi p= & {} \frac{B \left( -A \lambda +A+2 B r^2\right) }{\left( 2 \lambda ^2+3 \lambda +1\right) \left( A+2 B r^2\right) ^2},\end{aligned}$$
(29)
$$\begin{aligned} \frac{p}{\rho }= & {} \frac{-A \lambda +A+2 B r^2}{A (9 \lambda +3)+2 B (4 \lambda +1) r^2}. \end{aligned}$$
(30)

Here the parameter B is assumed to be a positive quantity.

4 A new setup for a family of embedding class-I models

In this section, we shall study new stellar models which are based on anisotropic fluid and are compatible with the Karmarker condition. It is a considerable point that the pressure anisotropy, i.e., \(\triangle \) has an important role in the discussion of gravitational collapse process. Recently, Naidu and Govender [78] studied the collapse dynamics which is related to its radial pressure and density function of radial coordinate under the stellar fluid. Further, they have assumed a linear form of equation of state within a static configuration which can be presented by the expression \(p_{r}=\epsilon \rho -\varepsilon \), with \(\epsilon \) and \(\varepsilon \) as constants. They argued that the succeeding collapse is responsive to the correlation of energy density function and radial pressure. Further, they discussed the impact of parameter \(\epsilon \) on the temperature description of collapsing configuration.

For having a family of solutions compatible with the Karmarker condition and involve anisotropic matter contents, we assume a specific model for the component \(\mathrm {g}_{rr}\) which is acceptable for all the gravitational aspects and is given by

$$\begin{aligned} e^{\nu (r)}=1+ar^{2}sin^{2}(c+br^{2}), \end{aligned}$$
(31)

where \(a,\,c\) and b are parameters which can be calculated from some physical boundary conditions. This models has been extensively used and explored in many directions related to astrophysics and cosmology. In 1999, Raychaudhuri and Dadhich discussed its significance without utilizing the Big Bang singularity to find the oscillating cosmological model. Another important characteristic of this model is that it permits the divination of blue shifts beyond violating the GR basic aspects. By utilizing the Eq. (31) in Eq. (15), we get a differential equation of the following form:

$$\begin{aligned} \frac{1}{4} K e^{\mu (r)} \mu '(r)^2=a r^2 \sin ^2\left( c+b r^2\right) . \end{aligned}$$
(32)

Solving Eq. (32) for the expression of \(\mu (r)\), we get a relationship for the metric component \(\mathrm {g}_{tt}\) as follows

$$\begin{aligned} e^{\mu (r)}=\left( A-\frac{\sqrt{a}}{2 b}B \cos \left( c+b r^2\right) \right) ^2. \end{aligned}$$
(33)

Further, we use the values of \(\mathrm {g}_{tt}\) and \(\mathrm {g}_{rr}\) components in the field Eqs. (7)–(10), we get the expressions of the following quantities:

$$\begin{aligned}&8\pi \rho \nonumber \\&\quad =\frac{1}{(\lambda +1) (2 \lambda +1) \left( a r^2 \sin ^2\left( b r^2+c\right) +1\right) ^2 \left( 2 A b-\sqrt{a} B \cos \left( b r^2+c\right) \right) }\nonumber \\&\quad \left( \sqrt{a} \left( a^{3/2} (2 \lambda +1)\nonumber \right. \right. \\&\quad \times r^2 \sin ^4\left( b r^2+c\right) \left( 2 A b-\sqrt{a} B \cos \left( b r^2+c\right) \right) \nonumber \\&\quad -3 \sqrt{a} (2 \lambda +1) \sin ^2\left( b r^2+c\right) \left( \sqrt{a} B \cos \left( b r^2+c\right) \right. \nonumber \\&\quad -\left. 2 A b\right) +4 a b B \lambda r^2 \sin ^3\left( b r^2+c\right) \nonumber \\&\quad -2 b B \sin \left( b r^2+c\right) \left( 2 a (2 \lambda +1) r^2 \cos ^2\right. \nonumber \\&\quad \left. \left( b r^2+c\right) -3 \lambda \right) \nonumber \\&\quad +\left. 4 b^2 B \lambda r^2 \cos \left( b r^2+c\right) \right) \nonumber \\&\quad \left. +4 a A b^2 (2 \lambda +1) r^2 \sin \left( 2 \left( b r^2+c\right) \right) \right) , \end{aligned}$$
(34)
$$\begin{aligned}&8\pi p_{r}\nonumber \\&\quad =\frac{1}{(\lambda +1) (2 \lambda +1) \left( a r^2 \sin ^2\left( b r^2+c\right) +1\right) ^2 \left( 2 A b-\sqrt{a} B \cos \left( b r^2+c\right) \right) }\nonumber \\&\quad \left( \left( \sqrt{a} \left( \sin \left( b r^2+c\right) \right. \right. \right. \nonumber \\&\quad \times \left. \left. \left. \left( 2 b \left( a^{3/2} (-A) (2 \lambda +1) r^2 \sin ^3\left( b r^2+c\right) \right. \right. \right. \right. \right. \nonumber \\&\quad -\sqrt{a} A (2 \lambda +1) \sin \left( b r^2+c\right) +2 a B (\lambda +1) r^2\nonumber \\&\quad \times \left. \sin ^2\left( b r^2+c\right) +B (\lambda +2)\right) \nonumber \\&\quad \left. +a B \lambda \sin \left( 2 \left( b r^2+c\right) \right) \right) \nonumber \\&\quad +B \cos \left( b r^2+c\right) \left( a^2 (2 \lambda +1)\right. \nonumber \\&\quad \times \; r^2 \sin ^4\left( b r^2+c\right) \nonumber \\&\quad \left. \left. \left. \left. +a \sin ^2\left( b r^2+c\right) -4 b^2 \lambda r^2\right) \right) \right. \right) , \end{aligned}$$
(35)
$$\begin{aligned}&8\pi p_{t}\nonumber \\&\quad =\frac{1}{(\lambda +1) (2 \lambda +1) \left( a r^2 \sin ^2\left( b r^2+c\right) +1\right) ^2 \left( 2 A b-\sqrt{a} B \cos \left( b r^2+c\right) \right) }\nonumber \\&\quad \left( \left( \sqrt{a} \left( \cos \left( b r^2+c\right) \right. \right. \right. \nonumber \\&\quad \times \left. \left. \left( -4 \sqrt{a} A b^2 (2 \lambda +1) r^2 \sin \left( b r^2+c\right) \right. \right. \right. \nonumber \\&\quad \left. +a B \sin ^2\left( b r^2+c\right) +4 b^2 B (\lambda +1) r^2\right) \nonumber \\&\quad +\sin \left( b r^2+c\right) \nonumber \\&\quad \times \left( -2 \sqrt{a} A b (2 \lambda +1) \sin \left( b r^2+c\right) \right. \nonumber \\&\quad +a B \lambda \sin \left( 2 \left( b r^2+c\right) \right) \nonumber \\&\quad +b B \left( -a r^2 \cos \left( 2 \left( b r^2+c\right) \right) \nonumber \right. \\&\quad +\left. \left. a r^2+2 \lambda +4\right) \right) \nonumber \\&\quad \left. \left. \left. +2 a b B (2 \lambda +1) r^2 \sin \left( b r^2+c\right) \cos ^2\left( b r^2+c\right) \right) \right. \right) , \end{aligned}$$
(36)
$$\begin{aligned} \triangle= & {} \frac{\sqrt{a} r^2 \left( a \sin ^3\left( b r^2+c\right) -2 b \cos \left( b r^2+c\right) \right) \left( -4 \sqrt{a} A b \sin \left( b r^2+c\right) +a B \sin \left( 2 \left( b r^2+c\right) \right) +4 b B\right) }{16\pi (\lambda +1) \left( a r^2 \sin ^2\left( b r^2+c\right) +1\right) ^2 \left( \sqrt{a} B \cos \left( b r^2+c\right) -2 A b\right) }. \end{aligned}$$
(37)

4.1 Physical boundary conditions

In this portion, we shall describe some physically acceptable boundary conditions by matching interior solution to the exterior solution. Here we consider the exterior solution as Schwarzschild space-time which is defined as

$$\begin{aligned} d{s}^2=-\mho dt^2+\mho ^{-1} d{r}^2+r^2d\Omega ^{2}, \end{aligned}$$
(38)

where \(\mho =(1-2M/r)\) which further implies \(\mho ^{-1}=(1-2M/r)^{-1}\) and \(d\Omega ^{2}=d\theta ^{2}+sin^{2}\theta d\phi ^{2}\). Here we have enforced a condition on the radial coordinate given by \(r>r_{\varsigma }\), where \(r_{\varsigma }\) is termed as Schwarzschild radius. It is interesting to mention here that without enforcing this restriction, we may get some black hole solutions.

Now, at the boundary \(r=R\), the junction conditions for the continuity of metric components \(\mathrm {g}_{tt}\), \(\mathrm {g}_{rr}\) and \(\frac{\partial \mathrm {g}_{tt}}{\partial r}\) are given by

$$\begin{aligned} \mathrm {g}_{tt}^-=\mathrm {g}_{tt}^+,\,\;\,\;\,\;\,\;\;\mathrm {g}_{rr}^-=\mathrm {g}_{rr}^+,\;\;\;\;\;\;\;\;\; \frac{\partial \mathrm {g}_{tt}^-}{\partial r}=\frac{\partial \mathrm {g}_{tt}^+}{\partial r}, \end{aligned}$$
(39)

where − and \(+\) correspond to the interior and exterior solutions, respectively. By plugging all the corresponding values, we obtain the relations

$$\begin{aligned} \left( 1-\frac{2M}{R}\right)= & {} A^{2}+\frac{a}{4} \left( \frac{B}{b} \cos \left( c+b R^2\right) \right) ^2\nonumber \\&-A B \left( \frac{\sqrt{a}}{ b} \cos \left( c+b R^2\right) \right) ,\end{aligned}$$
(40)
$$\begin{aligned} \left( 1-\frac{2M}{R}\right)= & {} \frac{1}{1+aR^{2}sin^{2}(c+bR^{2})},\end{aligned}$$
(41)
$$\begin{aligned} p_{r}(r=R)= & {} 0. \end{aligned}$$
(42)

Further, by utilizing these boundaries conditions (40) and (42), we get the following relations for unknowns:

$$\begin{aligned} a= & {} -\frac{2 M \csc ^2\left( \text {bR}^2+c\right) }{R^2 (2 M-R)}, \end{aligned}$$
(43)
$$\begin{aligned} B= & {} \frac{\frac{a^2 R^2}{8 \pi (\lambda +1) \left( a R^2+\csc ^2\left( b R^2+c\right) \right) ^2}+\frac{a \csc ^2\left( b R^2+c\right) }{8 \pi (\lambda +1) \left( a R^2+\csc ^2\left( b R^2+c\right) \right) ^2}}{\frac{a^{3/2} R^{5/2} \csc \left( b R^2+c\right) }{4 \pi (2 \lambda +1) \sqrt{R-2 M} \left( a R^2+\csc ^2\left( b R^2+c\right) \right) ^2}+\frac{\sqrt{a} \sqrt{R} \csc ^3\left( b R^2+c\right) \left( -2 b \lambda R^2 \cot \left( b R^2+c\right) +\lambda +2\right) }{8 \pi (\lambda +1) (2 \lambda +1) \sqrt{R-2 M} \left( a R^2+\csc ^2\left( b R^2+c\right) \right) ^2}},\nonumber \\ \end{aligned}$$
(44)
$$\begin{aligned} A= & {} \frac{\sqrt{a} B \cos \left( b R^2+c\right) }{2 b}+\frac{\sqrt{R-2 M}}{\sqrt{R}}, \end{aligned}$$
(45)
Table 1 Calculated values of \(a,\, A\) and B for different three small values of \(\lambda \), under three different well-known compact stars 4U 1538-52, LMC X-4 and PSR J1614-2230
Table 2 Calculated values of \(a,\, A\) and B for different three large values of \(\lambda \), under three different well-known compact stars 4U 1538-52, LMC X-4 and PSR J1614-2230

where the parameters b and c are treated as free parameters. Moreover, M and R represent the mass and radius of the object, respectively. Here we consider three different models for the compact stars namely 4U 1538-52, LMC X-4 and PSR J1614-2230 for the discussion of the new obtained stellar model of the present study. Since in the present study, we have used a linear model of generic function given by \(f(\mathcal {R},\mathcal {T})=\mathcal {R}+\lambda \mathcal {T}\) which demonstrates the coupling of the Ricci scalar and the trace of the energy-momentum tensor, so it is very important to explore the impact of parameter \(\lambda \) on the obtained solutions. Here we shall investigate the impact of this parameter by taking few small and large values of parameter \(\lambda \) into account. For graphical analysis and further calculations, we have considered its three small values from the range \(0<\lambda <1\), i.e., \(\lambda =0.35, \,\lambda =0.45\), and \(\lambda =0.55\) and three large values such that \(\lambda >1\), i.e., \(\lambda =2.00, \,\lambda =4.00\), and \(\lambda =6.00\). In the first place, we have considered its small values and the calculated values of different unknowns against these \(\lambda \) values are provided in Table 1. Further in Table 2, we have provided the values of theses unknowns against three assumed slightly large values of \(\lambda \). From both tables, it can be observed that the values of parameters A and B increase with the increasing values of \(\lambda \).

Table 3 Calculated values of different physical properties at center and boundary for different three values of \(\lambda \)

5 Analysis of the physical properties of the \(f(\mathcal {R},\mathcal {T})\) stellar model

In this section , we explore our results in more detail by focusing on some physical aspects and necessary properties of the obtained \(f(\mathcal {R},\mathcal {T})\) stellar configuration using three different stellar objects observation data values. For this purpose, we shall present the discussions about some physical measures analytically and graphically by taking different values of parameter \(\lambda \). Here we shall consider three different models for stellar objects like 4U 1538-52, LMC X-4 and PSR J1614-2230.

5.1 Evolution of metric functions, energy density and pressure components

Here we first discuss the behavior of metric function in the stellar objects, i.e., \(\mathrm {g}_{tt}=e^{\mu }\) and \(\mathrm {g}_{rr}=e^{\nu }\). It can be noticed from the Eqs. (31) and (33) that \(e^{\nu (r =0)}=1\) and \(e^{\mu (r =0)}\ne 0\) which indicates that this model is physically realistic and acceptable. Moreover, from the left penal of Figs. 1 and 4, it is observed that the metric potential components are regular and monotonically increasing in the inner side of the stellar object. Here the green graphs show the behavior of metric components for 4U 1538-52 model, the blue graphs represent the metric components for LMC X-4 model while the red graphs describe the metric components for PSR J1614-2230 model. Now we calculate the energy density and pressure components at the central values \(r=0\), i.e., \(\rho (r =0),~ p_{r}(r =0)\) and \(p_{r}(r =0)\) which are given as follows

$$\begin{aligned}&\rho _{c}=\rho (r =0)\nonumber \\&\quad =\frac{\sqrt{a} \left( 6 b B \lambda \sin (c)-3 \sqrt{a} (2 \lambda +1) \sin ^2(c) \left( \sqrt{a} B \cos (c)-2 A b\right) \right) }{8 \pi (\lambda +1) (2 \lambda +1) \left( 2 A b-\sqrt{a} B \cos (c)\right) }, \end{aligned}$$
(46)
$$\begin{aligned}&p_{rc}=p_{r}(r =0)\nonumber \\&\quad =\frac{\sqrt{a} \left( \sin (c) \left( 2 b \left( B (\lambda +2)-\sqrt{a} A (2 \lambda +1) \sin (c)\right) +a B \lambda \sin (2 c)\right) +a B \sin ^2(c) \cos (c)\right) }{8 \pi (\lambda +1) (2 \lambda +1) \left( 2 A b-\sqrt{a} B \cos (c)\right) },\end{aligned}$$
(47)
$$\begin{aligned}&p_{tc}=p_{t}(r =0)=p_{rc}=p_{r}(r =0). \end{aligned}$$
(48)

It can be easily observed from the Eqs. (46) and (47) that the ratio \(p_{rc}/ \rho _{c}\) is consistent with the Zeldovich’s condition. In the present scenario, the Zeldovich’s condition for \(f(\mathcal {R},\mathcal {T})\) theory can be written as

$$\begin{aligned} \frac{4 b B (\lambda +1)}{6 b B \lambda -3 \sqrt{a} (2 \lambda +1) \sin (c) \left( \sqrt{a} B \cos (c)-2 A b\right) }-\frac{1}{3}\le 1.\nonumber \\ \end{aligned}$$
(49)

We have calculated the values of different physical parameters like metric potentials, energy density and pressures at the center for both small and large choices of \(\lambda \). The obtained results are summarized in form of Tables 3 and 4. From Table 3, it can be observed that the metric components satisfy the important condition at the center, i.e., \(e^{\nu (r =0)}=1\) and \(e^{\mu (r =0)}\ne 0\), for all three small \(\lambda \) choices. We have also calculated that the values of energy density and pressure components at the centre, i.e., \(\rho (r =0)\), \(p_{r}(r =0)\) and \(p_{r}(r =0)\) which indicate that the values of energy density, pressure components at the center, energy density at the boundary, and the ratio \(p_{r_{c}}/\rho _{0}=p_{t_{c}}/\rho _{0}\) (Zeldovich’s condition) gradually decreasing as the \(\lambda \) increases.

Table 4 Calculated results for three different compact stars in \(f(\mathcal {R},\mathcal {T})\) theory under Karmarkar condition
Fig. 1
figure 1

Displays the evolution of metric functions and energy density function against r, for 4U 1538-52, LMC X-4 and PSR J1614-2230 along with the values of parameters from Table 1. Here \(\lambda =0.35\) (solid), \(\,\lambda =0.45\) (dashed), and \(\lambda =0.55\) (small dashed)

Fig. 2
figure 2

Shows the graph of radial and tangential pressures versus r, for 4U 1538-52, LMC X-4 and PSR J1614-2230, with the values of parameters from Table 1. Here \(\lambda =0.35\) (solid), \(\,\lambda =0.45\) (dashed), and \(\lambda =0.55\) (small dashed)

Fig. 3
figure 3

Indicates the behavior of anisotropy function and radial derivatives of \(\rho ,\,p_{r}\) and \(p_{t}\) versus r, for 4U 1538-52, LMC X-4 and PSR J1614-2230 along with the values of parameters from Table 1

Fig. 4
figure 4

Displays the evolution of metric functions and energy density function versus r, for 4U 1538-52, LMC X-4 and PSR J1614-2230, along with the values of parameters from Table 2. Here \(\lambda =2.00\) (solid), \(\,\lambda =4.00\) (dashed), and \(\lambda =6.00\) (small dashed)

Fig. 5
figure 5

Shows the behavior of radial and tangential pressures versus r, for 4U 1538-52, LMC X-4 and PSR J1614-2230, under the values of parameters from Table 2

Fig. 6
figure 6

Shows the behavior of anisotropy function and radial derivatives of \(\rho ,\,p_{r}\) and \(p_{t}\) versus radial coordinate r, for 4U 1538-52, LMC X-4 and PSR J1614-2230, under the values of parameters from Table 2

This behavior can also be observed from the Figs. 1, 2, 3, 4, 5 and 6. Figure 1 shows that the energy density function exhibits positive and gradually decreasing behavior for small increasing values of \(\lambda \) for 4U 1538-52, LMC X-4, and PSR J1614-2230 stellar models. From Fig. 2, it can be seen that both pressure components are also gradually decreasing against increasing small values of \(\lambda \). The existence of non-zero anisotropy is considered as a significant aspect in the relativistic stellar configurations without an electric charge. In the present case, the non-zero anisotropy played a special role for exploring the compact stars solutions. Now we describe the graphical development of anisotropy function, i.e., \(\triangle (r)\) and the derivatives of \(\rho , \, p_{r}\) and \(p_{t}\) with respect to radial coordinate r (gradients) in the current scenario. For 4U 1538-52 model, the anisotropy function exhibits positive behavior for increasing \(\lambda \) through small values. For LMC X-4 model, the anisotropy function is observed positive for \(\lambda =0.35\), and \(\lambda =0.45\) while it exhibits negative behavior for \(\lambda =0.55\). Further for PSR J1614-2230 model, it shows positive behavior for \(\lambda =0.35\) only. It is seen that in contrast to small \(\lambda \) values, the anisotropy function exhibits negative behavior for all large choices of this parameter. Clearly, in such cases where the anisotropy function remains positive with increasing behavior, it supports to the condition \(p_{t}>p_{r}\). Further, it is seen from the left part of Figs. 3 and 6 that the anisotropy function is vanished at the central value, i.e, \(\triangle (r=0)=0\), which is also another required condition for the anisotropic distribution. This behavior of anisotropy parameter against different small increasing choices of parameter \(\lambda \) are summarized in Table 5. From Table 5, it can be concluded that under the condition of non-zero anisotropy, our obtained solutions are stable only when \(\lambda =0.35\). It is evident from the graphs that all derivatives exhibit negative and decreasing behavior and hence satisfy the necessary conditions given by \(d\rho /dr<0, \,dp_{r}/dr<0\) and \(d p_{t}/dr<0\). It is also observed that these derivatives are vanished at the central radius, i.e., \(d\rho (r=0)/dr<0, \,dp_{r}(r=0)/dr<0\) and \(d p_{t}(r=0)/dr<0\). Finally, we can conclude that all these gradients satisfy the required conditions in \(f(\mathcal {R},\mathcal {T})\) theory. Likewise, a similar behavior can also be noticed from the Figs. 4, 5 and 6 where the large values of \(\lambda \) has been taken into account. In this case, it can be concluded that these physical parameters exhibit a quite similar behavior but their values are decreasing more rapidly as compared to the small values of \(\lambda \). Mathematically, these results are also summarized in Table 4.

Table 5 The behavior of anisotropy function for different three values of \(\lambda \), under three different well-known compact stars 4U 1538-52, LMC X-4 and PSR J1614-2230

5.2 Equilibrium condition

In this part, we shall investigate the stability of obtained solutions by utilizing the equilibrium condition for three different models of stellar system in \(f(\mathcal {R},\mathcal {T})\) gravity. For this purpose, we take the well-known Tolman–Oppenheimer–Volkov (TOV) equation [38,39,40,41,42,43,44,45,46,47,48] given as follows

$$\begin{aligned} \frac{2}{r}(p_{t}-p_{r})-\frac{dp_{r}}{dr}-\frac{\mu ^{'}(r)}{2}(\rho +p_{r})=0. \end{aligned}$$
(50)

The above Eq. (49) defines the equilibrium condition for a configuration by taking three forces into account namely hydrostatic, gravitational and anisotropic forces. The following are the mathematical expressions for these forces

$$\begin{aligned} \mathcal {F}_{\mathrm {a}}= & {} \frac{2}{r}(p_{t}-p_{r}),\,\;\,\;\;\;\;\;\mathcal {F}_{\mathrm {h}}=-\frac{dp_{r}}{dr}, \;\;\;\;\;\;\;\;\nonumber \\ \mathcal {F}_{\mathrm {g}}= & {} -\frac{\mu ^{'}(r)(\rho +p_{r})}{2} \end{aligned}$$
(51)

and consequently, Eq.(50) can be rewritten in the form given by

$$\begin{aligned} \mathcal {F}_{\mathrm {a}}+\mathcal {F}_{\mathrm {h}}+\mathcal {F}_{\mathrm {g}}=0. \end{aligned}$$
(52)

The graphical illustration of these forces are provided in the left penal of Figs. 7 and 8 for increasing small and large values of \(\lambda \). Here the green, blue and red curves provide the forces for 4U 1538-52, LMC X-4 and PSR J1614-2230 model, respectively. From these graphs, it can be noticed that the gravitational forces are displayed below the x-axis, the anisotropic forces are observed almost on the x-axis, while the curves representing hydrostatic forces are above the x-axis for all three stellar models with small increasing values of \(\lambda \). So it can be concluded that these forces almost balance each other’s effect and hence leave the configuration stable with necessary mass and radii as described in Tables 1 and 2 in \(f(\mathcal {R},\mathcal {T})\) theory of gravity

Fig. 7
figure 7

Illustrates the graphical behavior of forces namely \(\mathcal {F}_{\mathrm {a}},\,\mathcal {F}_{\mathrm {h}}\) and \(\mathcal {F}_{\mathrm {g}}\) and energy conditions versus r for 4U 1538-52, LMC X-4 and PSR J1614-2230 along with the values of parameters from Table 1. Here the solid, dashed and small dashed curves refer to the choices \(\lambda =0.35,\,\lambda =0.45\) and \(\lambda =0.55\), respectively

Fig. 8
figure 8

Illustrates the behavior of \(\mathcal {F}_{\mathrm {a}},\,\mathcal {F}_{\mathrm {h}}\) and \(\mathcal {F}_{\mathrm {g}}\) and energy constraints versus r for 4U 1538-52, LMC X-4 and PSR J1614-2230. Here \(\lambda =2.00, \,\lambda =4.00\), and \(\lambda =6.00\), respectively

5.3 Energy conditions

Energy condition bounds have many cosmological applications in the context of GR and modified gravity theories. In general, these conditions are defined in terms of four constraints namely DEC, SEC, WEC and NEC and are given as

$$\begin{aligned} \begin{array}{lll} NEC: \quad &{}&{} \rho \ge 0,\\ WEC: \quad &{}&{} \rho -p_{t}\ge 0, \quad \rho -p_{r}\ge 0,\\ SEC: \quad &{}&{} \rho -p_{r}-2p_{t}\ge 0,\\ DEC: \quad &{}&{} \rho >|p_r|, \quad |p_t|. \end{array} \end{aligned}$$

Here we shall discuss the behavior of energy constraints namely NEC, WEC, SEC and DEC versus radial coordinate which is provided in the right penal of the Figs. 7 and 8 where we have considered the small as well as large values of \(\lambda \). In these Figures, the green, blue and red curves correspond to the energy conditions for 4U 1538-52, LMC X-4 and PSR J1614-2230 models, respectively. It is seen from these graphs that these constraints are satisfied for the present model as these constraints show positive but gradually decreasing behavior against the increasing values of parameter \(\lambda \). This is considered as one of the necessary conditions for the stability of compact stars under the observational data of Tables 1 and 2. Here the impact of \(\lambda \) on the obtained solutions is if we increase its value then these conditions decrease more rapidly but remain satisfied. It is interesting to mention here that the behavior of other constraints have already been presented in the Figs. 1, 2, 3, 4, 5 and 6.

5.4 Mass function, compactness parameter and gravitational red-shift function

Here we will discuss the relation of mass and radius of a compact star, which is defined by the following equation

$$\begin{aligned} m(r)=\int ^{r}_{0}(4\pi r^{2}\rho )dr, \end{aligned}$$
(53)

where m represents the mass function depending on the radial coordinate. Also, the compactness parameter of a compact star is defined by the following expression

$$\begin{aligned} u(r)=\frac{2m}{r}. \end{aligned}$$
(54)

From Eq. (43) the gravitational red-shift of a stellar system is given by

$$\begin{aligned} z(r)=\frac{1}{A-\frac{\left( \sqrt{a} B\right) \cos \left( b r^2+c\right) }{2 b}}-1. \end{aligned}$$
(55)
Fig. 9
figure 9

Shows the graph of mass-radius relation function and compactness parameter versus r for, 4U 1538-52, LMC X-4 and PSR J1614-2230, under the values of parameters from Table 1 with \(\lambda =0.35\) (solid), \(\,\lambda =0.45\) (dashed) and \(\lambda =0.55\) (small dashed)

Fig. 10
figure 10

Shows the trend of mass-radius relation function and compactness parameter versus r for, 4U 1538-52, LMC X-4 and PSR J1614-2230, under the values of parameters from Table 2 with \(\lambda =2.00\) (solid), \(\,\lambda =4.00\) (dashed) and \(\lambda =6.00\) (small dashed)

Fig. 11
figure 11

Illustrates the behavior of the gravitational red-shift function (left graph) and the ratios like \(\frac{p_r}{\rho }\) and \(\frac{p_t}{\rho }\) (right graph) versus r for 4U 1538-52, LMC X-4 and PSR J1614-2230 by using the values of parameters from Table 1. Here solid, dashed and small-dashed curves correspond to \(\lambda =0.35, \,\lambda =0.45\) and \(\lambda =0.55\), respectively

Here we shall explore the impact of parameter \(\lambda \) on the obtained solutions by discussing the behavior of corresponding mass function, compactness parameter and gravitational red-shift function versus radial coordinate graphically. It can be observed from the Figs. 9, 10, 11 and 12 that mass function and compactness parameter exhibit a regular increasing behavior with the increasing values of small or large \(\lambda \) choices while the gravitational red-shift function indicates the decreasing behavior in both cases of parameter \(\lambda \). Here it can also be seen that the \(\lambda \) has an impact on the obtained solutions, i.e., if we consider large \(\lambda \) values, then function are showing gradually increasing or decreasing behavior as compared to its small values. These behavior show that all these physical parameters satisfy the required condition for compact stars in \(f(\mathcal {R},\mathcal {T})\) theory.

5.5 Equation of state

In this part, we formulate the equations of state parameter for radial and tangential pressures denoted by \(w_r\) and \(w_t\), respectively. These parameters are defined as follows

$$\begin{aligned} w_r= & {} \frac{p_r}{\rho }, \end{aligned}$$
(56)
$$\begin{aligned} w_t= & {} \frac{p_t}{\rho }. \end{aligned}$$
(57)
Fig. 12
figure 12

Demonstrate the graphical behavior of gravitational red-shift function (left graph) and pressure density ratios (right graph) versus r for 4U 1538-52, LMC X-4 and PSR J1614-2230 using the values of parameters from Table 2. Here \(\lambda =2.00\) (solid), \(\,\lambda =4.00\) (dashed) and \(\lambda =6.00\) (small dashed)

Table 6 The development of Herrera cracking criterion, i.e., \(-1\le v^{2}_{t}-v^{2}_{r}\le 0\) for different three values of \(\lambda \), under three different well-known compact stars 4U 1538-52, LMC X-4 and PSR J1614-2230

Here we discuss the graphical development of two different ratios, i.e., \(w_r\) and \(w_t\) versus radial coordinate. It is observed from the right penal of Figs. 11 and 12, both ratios \(\frac{p_r}{\rho }\) and \(\frac{p_t}{\rho }\) exhibit monotonically decreasing behavior less than 1 against different small and large values of parameter \(\lambda \) which is regraded as one of the necessary condition for compact stars. It can also be noticed that these ratios decrease more rapidly as \(\lambda \) increases.

5.6 Causality stability analysis

In this portion, we discuss the causality condition for a compact star. For this purpose, we take radial and tangential speeds of sound for three different models of compact stars which are denoted by \(v^{2}_{r}\) and \(v^{2}_{t}\), respectively and are defined by

$$\begin{aligned} v^{2}_{r}= \frac{dp_{r}}{d\rho }, \quad v^{2}_{t}= \frac{dp_{t}}{d\rho }. \end{aligned}$$
(58)

According to causality condition, both radial and tangential velocities should be less than 1 and also, the difference of both velocities, i.e., \(v^{2}_{t}-v^{2}_{r}\) must satisfy the constraint given by \(-1\le v^{2}_{t}-v^{2}_{r}\le 0\). To check where the local anisotropic matter source is stable or not, we assumed the Herrera cracking criterion, i.e., \(-1\le v^{2}_{t}-v^{2}_{r}\le 0\). This describes that the region is potentially stable, where the radial velocity of sound is greater than the transverse velocity of sound. In the present work, it is seen from the Tables 4 and 6 that our obtained solutions have not fulfilled this criterion for \(\lambda =0.45\), and \(\lambda =0.55\) and even for the large values satisfying \(\lambda >1\). This indicates that our obtained solutions are stable only for \(\lambda =0.35\). This behavior can also be noticed from the Figs. 13 and 14. Hence it is concluded that the causality stability can be attained only for very small values of \(\lambda \).

Fig. 13
figure 13

Shows the behavior of \(v^{2}_{r},\,v^{2}_{t}\) and \(v^{2}_{t}-v^{2}_{r}\) against r for 4U 1538-52, LMC X-4 and PSR J1614-2230 using the values of parameters from Table 1 with \(\lambda =0.35\) (solid), \(\,\lambda =0.45\) (dashed) and \(\lambda =0.55\) (small dashed)

Fig. 14
figure 14

Describes the behavior of \(v^{2}_{r},\,v^{2}_{t}\) and \(v^{2}_{t}-v^{2}_{r}\) against r for all three stellar models using the values of parameters from Table 2 where \(\lambda =2.00\) (solid), \(\,\lambda =4.00\) (dashed) and \(\lambda =6.00\) (small dashed)

5.7 Adiabatic index stability analysis

In the reference of adiabatic index, here we shall discuss the ratio of two specific heat functions given by

$$\begin{aligned} \Gamma _{r}= \frac{\rho +p_{r}}{p_{r}}v^{2}_{r} \end{aligned}$$
(59)

It is interesting to mention here that the above parameter yield the stability of Newtonian sphere under the condition \(\Gamma _{r}>4/3\). Further this relation is used to define an expression representing neutral equilibrium under the condition \(\Gamma _{r}=4/3\). While for \(\Gamma _{r}<4/3\), we assume an unstable sphere with anisotropic matter contents. Now we define a condition for anisotropic matter profile which is described as

$$\begin{aligned} \Gamma _{r}=\frac{4}{3}+\left( \frac{\kappa }{2}\frac{\rho _{0}p_{r0}}{|p^{'}_{r0}|}r+\frac{4}{3}\frac{(p_{t0}-p_{r0})}{|p^{'}_{r0}|r}\right) \end{aligned}$$

where \(\kappa \) is taken as an arbitrary constant and \(p_{t0}, \,p_{r0}\) and \(\rho _{0}\), denote the initial tangential, radial components of pressure distribution and energy density.

Fig. 15
figure 15

Demonstrate the behavior of Adiabatic index function against r for all three stellar models. Here we have used the values of parameters from Table 1 and the solid, dashed and small-dashed curves refer to \(\lambda =0.35, \,\lambda =0.45\), and \(\lambda =0.55\), respectively

Fig. 16
figure 16

Provides the graphical illustration of Adiabatic index function versus r for all three stellar models using the values of parameters from Table 2. Here \(\lambda =2.00\) (solid), \(\,\lambda =4.00\) (dashed) and \(\lambda =6.00\) (small dashed)

In Figs. 15 and 16, we describe the graphical behavior of \(\Gamma _{r}\) parameter versus radial coordinate along with different small and large values of parameter \(\lambda \). It can be observed that the expression \(\Gamma _{r}\) shows monotonically increasing behavior with values greater than \(\frac{4}{3}\) for all 4U 1538-52, LMC X-4 and PSR J1614-2230 models as shown by the green, blue and red curves, respectively. Hence, it can be concluded that the adiabatic index is compatible with the stability condition in the reference of \(f(\mathcal {R},\mathcal {T})\) theory.

6 Conclusion

In the present paper, we have described a new set up for a new family of embedding class-I models in \(f(\mathcal {R},\mathcal {T})\) theory by using the well-known Karmarkar condition along with the Pandey–Sharma condition for three different compact stars namely 4U 1538-52, LMC X-4 and PSR J1614-2230. Here, for exploring physical validity of the obtained solutions, we have discussed all the compact stars related physical parameters analytically and graphically. For the present study, we have employed the matter contents as anisotropic fluid without any net electric charge for a spherically symmetric space-time. The physical behavior of all relevant parameters have been presented in the Figs. 1, 2, 3, 4, 5, 6, 7 and 8 for the considered stellar models. All achieved results can be summarized as follows

  • Energy density function and pressure profile It is evident from Tables 3 and 4 that all the necessary conditions for a physical model like the behavior of energy density function as well as both pressure components like radial and tangential profiles to be positive, have been achieved throughout in the stellar interior for all 4U 1538-52, LMC X-4 and PSR J1614-2230 compact stars models. Also, these functions provided their compatible maximum values at the center and then decreased monotonically as the radial coordinate increases towards the boundary surface. Further the ratio of central pressure and density satisfied the Zeldovich’s condition, i.e., \(p_{rc}/ \rho _{c}\le 1\). It is also concluded from Tables 3 and 4 that the radial derivatives of energy density, radial as well as tangential pressure components showed negative behavior for U 1538-52, LMC X-4 and PSR J1614-2230 compact stars models in \(f(\mathcal {R},\mathcal {T})\) theory. It is seen that the parameter \(\lambda \) has a significant effect on the obtained spherically symmetric solutions.

  • Anisotropic pressure It is noticed that the measure of anisotropic pressure \(\triangle (r)\) is positive in few cases when the small values of \(\lambda \) has been taken into account. In case \(\lambda >1\), the anisotropic pressure shows negative behavior for all three compact stars.

  • Equilibrium condition It is seen from Tables 3 and 4 that the forces \(\mathcal {F}_{\mathrm {a}},\,\mathcal {F}_{\mathrm {h}}\) and \(\mathcal {F}_{\mathrm {g}}\) satisfied the equilibrium condition for U 1538-52, LMC X-4 and PSR J1614-2230 models. It is also noticed from the same table that these forces balanced each other’s effect and hence leaving a stable configuration for all choices of small and large \(\lambda \) values. These forces have been illustrated graphically in the Figs. 7 and 8.

  • Energy conditions It is seen from the Tables 3 and 4 that all the functions \(\rho \), \(p_r\), \(p_t\), \(\rho -p_{r}\), \(\rho -p_{t}\), \(\rho -p_{r}-2p_{t}\), which are presented graphically and analytically satisfied the respective bounds namely NEC, WEC, SEC and DEC.

  • Mass function, compactness parameter and gravitational red-shift function In the present scenario, mass-radii function, compactness parameters and gravitational parameters have been investigated graphically. Tables 3 and 4 along with the corresponding graphs indicated that the mass-radii function m(r) and compactness parameter u(r) remained positive, regular and increasing and satisfy the Buchdahl limit, i.e., \(u(r)\le 8/9\). Further, the gravitational red-shift function z(r) showed positive decreasing behavior for all these compact star models and \(\lambda \) choices.

  • Equation of state In radial and tangential directions, we have investigated the equation of state (EoS) parameters \(w_r\) and \(w_t\) graphically. From Table 2, it is noticed that the value of these parameters remained positive inside the stellar objects and also less than 1 for all three U 1538-52, LMC X-4 and PSR J1614-2230 models in all cases.

  • Causality stability analysis It is concluded from Tables 4 and 6 that the radial and tangential speeds of sound for the considered compact stars, denoted by \(v^{2}_{r}\) and \(v^{2}_{t}\), satisfied the condition of decreasing behavior with velocities less than 1 for all choices of \(\lambda \). Furthermore, another necessary condition \(-1\le v^{2}_{t}-v^{2}_{r}\le 0\), the difference of tangential velocity and radial velocity is satisfied for the \(\lambda =0.35\) only.

  • Adiabatic index stability analysis In the reference of adiabatic index, it is seen from Tables and the corresponding graphs that the adiabatic index \(\Gamma _{r}\), satisfied the condition \(\Gamma _{r}<4/3\) and showed an increasing development versus radial coordinate for all choices of \(\lambda \).

Thus it is concluded that our calculated results showed consistency with all necessary conditions and hence all result are physically interesting and acceptable.