1 Introduction

General theory of relativity (GTR) is a geometric theory of gravitation formulated on the concept that gravity manifests itself as the curvature of space-time. Although GTR is a fairly successful theory at low energy, it is some serious issues at ultraviolet and infrared limits. Some of the astronomical observational evidences, namely Galactic, extra Galactic and cosmic dynamics, are not understood in the framework of GTR. The needle of hope points to the concept of the existence of exotic matter that represents the dark energy [1,2,3], which is needed if matter sector of GTR is to be modified. On the other hand, a modification of the gravitational sector to fit the missing matter energy of the observed universe is also another important area of the present research. The first work unifying inflation and the present accelerated expansion was done by Peebles and Vilenkin [4] in GTR. However, Nojiri and Odintsov demonstrated that in the frame work of modified gravity theory it is possible to unify the inflation and the observed universe by the effective dark energy concept [5]. In the literature [6,7,8,9,10,11,12,13], a number of theories of gravity with modification of the gravitational sector came up to understand the evolution of the observed universe as well as to solve some of the issues of non-renormalizability [14, 15] in GTR. Modifications to GTR by introducing higher-order curvatures in addition to the Ricci Scalar R was initiated by Weyl [16] and Eddington [17]. Thereafter a nonlinear function of Ricci scalar, namely f(R) gravity theory, was introduced by Buchdahl [18] to remove some of the shortcomings in Friedmann–Lemaître–Robertson–Walker cosmological models. However, it was Starobinsky [19], who first shown the existence of a inflationary universe solution in a higher-order curvature term (viz. \(R^{2}\)) in the Einstein–Hilbert action. A historical development of this class of theories in cosmology was reported by Schmidt [20]. In the literature, there is a trend to construct stellar models using f(R) gravity theory [21,22,23,24]. Recently, a more generalized form of f(R) gravity, namely f(RT) gravity, where R is the Ricci scalar and T is the trace of the energy–momentum tensor, was introduced in cosmology [25]. The modified theory of gravity is interesting as it can accommodate the late accelerating universe satisfactorily. Consequently, there is a spurt in research activities in understanding astrophysical objects of interest using this modified theory of gravity. It is known that the presence of an extra force perpendicular to the four velocity in the f(RT) gravity helps test particles to follow a non-geodesic trajectory. It is shown [26] that for a specific linear form of f(RT) theory, say \(f(R,T)= R + f(T)\), the trajectory of the particles become a geodesic path. It is known [27] that the f(RT) theory of gravity passes solar system test satisfactorily. A number of cosmological models [28,29,30] are constructed in the f(RT) theory of gravity which accommodates the observed universe successfully. Consequently, Moraes et al. [31] studied the equilibrium configuration of quark stars with MIT bag model. It is shown [32] that an analytical stellar model for compact star in f(RT) gravity may be obtained considering a correct form of the Tolman–Oppenheimer–Volkoff (TOV) equation. Deb et al. [33] analyzed both isotropic and anisotropic spherically symmetric compact stars and presented the graphical analysis of LMC X-4 star model. The effect of higher curvature terms present in f(RT) gravity is probed in compact objects [34] making use of EoS given by polytropic and MIT bag model. The physical properties of a compact star can be derived for a given EoS, i.e., \( p= f(\rho ) \). In the case of a compact star, the exact form of the EoS is not known. One can adopt an alternative approach for compact object at very high densities to predict the EoS for a given metric potential [35,36,37,38].

The motivation of the present paper is to obtain relativistic solution for anisotropic compact stars with its interior space-time described by Finch–Skea (FS) geometry in a linear modified f(RT) gravity. It may be mentioned here that FS metric originated to correct the Dourah and Ray [39] metric which is not suitable for compact object. Finch and Skea [40] modified the metric to accommodate relativistic stellar models. Subsequently, FS metric is considered with a modification in 4 dimensions [41,42,43] to obtain anisotropic stellar models. In compact objects, the interior pressure may not be same in all directions; thus, the study of the behavior of anisotropic pressure for a spherically symmetric stellar model is important to explore. Ruderman [47] has shown that at high density (\(> 10^{15} g/cm^{3}\)) nuclear matter object may be treated relativistically which exhibits the property of anisotropy. The reason for incorporating anisotropy is due to the fact that in the high-density regime of compact stars the radial pressure (\(p_{r}\)) and the transverse pressure (\(p_{t}\) ) are not equal which was pointed out by Canuto [48]. There are other reasons to assume anisotropy in compact stars which might occur in astrophysical objects, namely viscosity, phase transition, pion condensation, the presence of strong electromagnetic field, the existence of a solid core or type 3A super fluid, the slow rotation of fluids, etc. In this paper, we construct relativistic stellar models and predict EoS in the framework of a linear f(RT) gravity with anisotropic fluid distribution.

The outline of the paper is as follows: In Sect. 2, we present the basic mathematical formulation of f(RT) theory and the field equations. In Sect. 3, a class of relativistic solutions are obtained for different parameters of the theory. In Sect. 4, the constraints to obtain stellar models are presented. In Sect. 5, general properties of compact stars, the stability of stellar models, energy conditions, mass to radius, etc. are discussed. The EoS of matter inside the star is also predicted. Finally, we discuss the results in Sect. 6.

2 The gravitational action and the field equations in f(RT) gravity

The gravitational action for modified theory of gravity is given by

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

where f(RT) is an arbitrary function of the Ricci scalar (R) and (T) is the trace of the energy–momentum tensor \(T_{\mu \nu }\). The determinant of the metric tensor \(g_{\mu \nu }\) is given by g and \(L_{m}\) is the Lagrangian density of the matter part. We consider gravitational unit \(c=G=1\). The field equations for the modified gravity theory can be obtained by varying the action S with respect to the metric tensor \(g_{\mu \nu }\) which is given by,

$$\begin{aligned}&(R_{\mu \nu }-\nabla _{\mu }\nabla _{\nu })f_{R}(R,T)+ g_{\mu \nu }\; \Box f_{R}(R,T)\nonumber \\&\quad -\frac{1}{2} g_{\mu \nu }\; f(R,T) =8\pi \; T_{\mu \nu }-f_{T}(R,T) \; (T_{\mu \nu }+\varTheta _{\mu \nu }), \end{aligned}$$
(2)

where \(f_{R}(R,T)\) denotes the partial derivative of f(RT) with respect to R and \(f_{T}(R,T)\) denotes the partial derivative of f(RT) with respect to T. \(R_{\mu \nu }\) is the Ricci tensor, \(\Box \equiv \frac{1}{\sqrt{-g}} \partial _{\mu }(\sqrt{-g}\; g^{\mu \nu } \partial _{\nu })\) is the D’Alembert operator and \(\nabla _{\mu }\) represents the covariant derivative, which is associated with the Levi-Civita connection of the metric tensor \(g_{\mu \nu }\). The energy momentum tensor \(T_{\mu \nu }\) for perfect fluid changes the role in the f(RT)-modified gravity because of the presence of \(\nabla _{\mu } \nabla _{\nu } R\), \((\nabla _{\mu }R)(\nabla _{\nu }R)\) and the terms which originate from trace of the energy momentum tensor T in the field equation. In the paper, we consider compact objects with anisotropic matter distribution. The stress–energy tensors \(T_{\mu \nu }\) and \(\varTheta _{\mu \nu }\) are defined as,

$$\begin{aligned} T_{\mu \nu }= & {} g_{\mu \nu } L_{m}-2 \; \frac{\partial L_{m}}{\partial g^{\mu \nu }}, \end{aligned}$$
(3)
$$\begin{aligned} \varTheta _{\mu \nu }= & {} g^{\alpha \beta } \; \frac{ \delta T_{\alpha \beta }}{\delta g^{\mu \nu }}. \end{aligned}$$
(4)

Using Eq. (2), the covariant divergence of the stress–energy tensor can be written as

$$\begin{aligned} \nabla ^{\mu }T_{\mu \nu }=\frac{f_{T}}{8\pi -f_{T}} \left[ ( T_{\mu \nu }+\varTheta _{\mu \nu })\nabla ^{\mu }ln f_{T} +\nabla ^{\mu }\varTheta _{\mu \nu }-\frac{1}{2} \; g_{\mu \nu }\nabla ^{\mu }T \right] . \end{aligned}$$
(5)

It may be mentioned here that the covariant derivative of the stress–energy tensor in f(RT) theory does not vanish, which is different from the f(R)-theory. Consequently we describe an effective energy density and pressure which, however, leads \(T^{\mathrm{eff}}_{\mu \nu };\mu =0\).

In the modified gravity \(f(R,T)=R+2 \, \chi T\), where \(\chi \) is a coupling constant, the field Eq. (2) can be represented as

$$\begin{aligned} G_{\mu \nu }= 8\pi \; T^{\mathrm{eff}}_{\mu \nu }, \end{aligned}$$
(6)

where \(G_{\mu \nu }\) is the Einstein tensor and \(T^{\mathrm{eff}}_{\mu \nu }\) is the effective energy–momentum tensor. The energy–momentum tensor for anisotropic matter distribution is given by

$$\begin{aligned} T_{\mu \nu }=(\rho + p_{t}) \; u_{\mu }u_{\nu }-p_{t} \; g_{\mu \nu }+(p_{r}-p_{t}) \; v_{\mu }v_{\nu }, \end{aligned}$$
(7)

where \(v_{\mu }\) is the radial four-vector, while \(u_{\nu }\) is four velocity vector, and \(\rho \), \(p_{r}\) and \(p_{t}\) are the energy density, the radial and tangential pressures, respectively. Here, we consider the matter Lagrangian \(L_{m}=- P\), where \(P=\frac{1}{3}(2p_{t}+p_{r})\). For anisotropic fluid, \(\varTheta _{\mu \nu }=-2T_{\mu \nu }- g_{\mu \nu } P\). The effective energy–momentum tensor becomes,

$$\begin{aligned} T^{\mathrm{eff}}_{\mu \nu }= T_{\mu \nu } \left( 1+ \frac{\chi }{4 \pi } \right) + g_{\mu \nu }\; \frac{\chi }{ 8 \pi } \left( T + 2 P \right) . \end{aligned}$$
(8)

The above expression contains the original matter stress–energy tensor \(T_{\mu \nu }\) and the curvature terms. For \(f(R,T)=R+2 \, \chi T\), Eq. (5) becomes

$$\begin{aligned} \nabla ^{\mu }T_{\mu \nu }= - \; \frac{\chi }{2( 4\pi + \chi )} ( g_{\mu \nu } \nabla ^{\mu }T + 2 \nabla ^{\mu }(g_{\mu \nu } P) ). \end{aligned}$$
(9)

Now the effective conservation of energy equation is given by

$$\begin{aligned} \nabla ^{\mu }\; T^{\mathrm{eff}}_{\mu \nu } = 0. \end{aligned}$$
(10)

Thus, the modified gravity allows a nonlinear regime in addition to linear regime effectively. The motivation of the paper is to study the characteristics of gravitational dynamics in the compact objects having density greater than the nuclear density in the f(RT) theory of gravity which is an extension of both GTR and f(R) gravity.

3 Modified field equations in f(RT) gravity

We consider a spherically symmetric metric for the interior space-time of a static stellar configuration given by

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

where \(\nu \) and \(\lambda \) are the metric potentials which are functions of radial coordinate (r) only. The nonzero components of the energy momentum tensors are given by

$$\begin{aligned} T^{0}_{0}= & {} \rho (r), \end{aligned}$$
(12)
$$\begin{aligned} T^{1}_{1}= & {} -p_{r}(r), \end{aligned}$$
(13)
$$\begin{aligned} T^{2}_{2}= & {} T^{3}_{3}=-p_{t}(r), \end{aligned}$$
(14)

where \(p_r\) and \(p_t\) are radial and tangential pressures, respectively. Using Eqs. (6)–(8), the field equations can be rewritten as

$$\begin{aligned}&e^{-2\lambda }\Big (\frac{2\nu '}{r}+\frac{1}{r^{2}}\Big )-\frac{1}{r^{2}}= 8\pi p^{\mathrm{eff}}_{r}, \end{aligned}$$
(15)
$$\begin{aligned}&e^{-2\lambda }\Big (\nu ''+\nu ^{'2}+\frac{\nu '-\lambda '}{r}- \nu ' \lambda '\Big ) = 8\pi p^{\mathrm{eff}}_{t}, \end{aligned}$$
(16)
$$\begin{aligned}&e^{-2\lambda }\Big (\frac{2\lambda '}{r}- \frac{1}{r^{2}}\Big )+\frac{1}{r^{2}}= 8\pi \rho ^{\mathrm{eff}}, \end{aligned}$$
(17)

where the prime \((')\) is differentiation w.r.t. radial coordinate, and \(\rho ^{\mathrm{eff}}\), \(p^{\mathrm{eff}}_{r}\) and \(p^{\mathrm{eff}}_{t}\) are the effective density, radial pressure and tangential pressure. We get

$$\begin{aligned} \rho ^{\mathrm{eff}}= & {} \rho + \frac{\chi }{24 \pi }(9 \rho - p_{r} - 2 p_{t}) \end{aligned}$$
(18)
$$\begin{aligned} p^{\mathrm{eff}}_{r}= & {} p_{r}- \frac{\chi }{24 \pi }(3\rho - 7p_{r} - 2p_{t}) \end{aligned}$$
(19)
$$\begin{aligned} p^{\mathrm{eff}}_{t}= & {} p_{t}- \frac{\chi }{24 \pi }(3\rho - p_{r} - 8 p_{t}). \end{aligned}$$
(20)

To study the matter content inside the compact objects, the field Eqs. (15)–(17) are used to determine the components of \(T_{\mu \nu }\), i.e., \(\rho \), \(p_{r}\) and \(p_{t}\). Using Eqs. (15) and (16), we get a second-order differential equation which is

$$\begin{aligned} \nu ^{\prime \prime }+{\nu ^{\prime }}^{2}-\nu ^{\prime }\lambda ^{\prime }-\frac{\lambda ^{\prime }}{r}-\frac{\nu ^{\prime }}{r}-\frac{1}{r^{2}}+\frac{e^{2\lambda }}{r^{2}}=2 (4 \pi +\chi ) \; \xi \; e^{2\lambda }, \end{aligned}$$
(21)

where \(\xi = p_{t}- p_{r} \). Now the difference of effective radial and transverse pressure can be written as,

$$\begin{aligned} p^{\mathrm{eff}}_{r} - p^{\mathrm{eff}}_{t} = \left( 1+ \frac{\chi }{4 \pi } \right) \; \xi . \end{aligned}$$
(22)

It is evident that effective pressure difference vanishes even if \(p_{r} \ne p_{t} \) at \(\chi = - 4 \pi \). We define the measure of anisotropy as,

$$\begin{aligned} \varDelta = \frac{p_{t}-p_{r}}{p_{r}} \end{aligned}$$
(23)

which will be studied inside the star.

Now we consider the following transformations on the metric potentials [49] to obtain relativistic solutions

$$\begin{aligned} y^{2}(x)= e^{2\nu (r)}, \; \; \; \; \; Z(x)=e^{2\lambda (r)}, \; \; \; \; x= Cr^{2}, \end{aligned}$$
(24)

where C is a dimensional constant (inverse of square of the length). It may be mentioned here that in GTR, C determines the central density [40], but in f(RT) gravity the central density depends on C as well as the other two metric parameters a and b.

The above transformation reduces Eq. (21) to a second-order differential equation which is given by

$$\begin{aligned} 4 x^{2}Z \; \ddot{y}+2 x^{2}\; {\dot{Z}}\, {\dot{y}}+y \left[ x \, {\dot{Z}}-Z+1-\left( \frac{2 \xi (4\pi +\chi ) }{C} \right) \,x \right] =0, \end{aligned}$$
(25)

where the overdot denotes differentiation w.r.t. the variable x.

3.1 Exact relativistic solutions in f(RT) gravity

Equation (25) is further simplified introducing Z(x) [50] as

$$\begin{aligned} Z=\frac{1}{1+x}. \end{aligned}$$
(26)

Note that the choice of Z is a sufficient condition for a static perfect fluid sphere which is regular at the center [51]. Equation (25) can be expressed as

$$\begin{aligned} 4(1+x)\; \ddot{y}-2\; {\dot{y}}+(1-\alpha )\; y=0, \end{aligned}$$
(27)

where \( \alpha = \frac{ 2 \xi (x+1)^2 (4 \pi + \chi )}{Cx} \). The measure of anisotropy defined in Eq. (23) is given by

$$\begin{aligned} \varDelta = \frac{\xi }{p_r}= \frac{\alpha x C}{2 p_{r} (x+1)^2 (4 \pi + \chi )} \end{aligned}$$
(28)

for \(\chi \ne -4 \pi \) and \(C\ne 0\). For \(\alpha =0\), one recovers Finch–Skea model with an isotropic pressure distribution. For \( -1< \alpha < 1\), we substitute the following : \(X= 1+ x\) and \(y(X) = Y\) for simplicity in Eq. (27) which yields

$$\begin{aligned} 4X\; \frac{d^{2}Y}{dX^{2}}- 2\; \frac{dY}{dX}+(1-\alpha )\; Y=0. \end{aligned}$$
(29)

Once again, we introduce the following transformations: \(Y= w (X) X^{n}\) and \(u = X^{\gamma }\), where \(\gamma \) and n are real numbers. The above differential equation can be reduced to a standard Bessel equation. For \(\gamma = \frac{1}{2}\) and \( n= \frac{3}{4} \), Eq. (29) reduces to

$$\begin{aligned} u^{2}\frac{d^{2}w}{du^{2}}+ u \frac{dw}{du}+ \left[ (1-\alpha ) \; u^{2} - \frac{3}{2} \right] w=0. \end{aligned}$$
(30)

Now we consider further transformation from u to v variable as \((1-\alpha )^{\frac{1}{2}} u = v\) in Eq. (30) which leads to a second-order differential equation as follows

$$\begin{aligned} v^{2}\; \frac{d^{2}w}{dv^{2}}+ v \; \frac{dw}{dv}+\left[ v^{2} -\left( \frac{3}{2} \right) ^{2}\right] \;w=0, \end{aligned}$$
(31)

which is the Bessel equation of the order \(\frac{3}{2}\). The general solution is given by

$$\begin{aligned} w= c_{1} \; J_{\frac{3}{2}}(v) + c_{2} \; J_{-\frac{3}{2}}(v), \end{aligned}$$
(32)

where \( c_{1}\) and \( c_{2}\) are integration constants, and \( J_{\frac{3}{2}}(v)\) and \(J_{-\frac{3}{2}}(v)\) are the Bessel functions, which can be written in terms of trigonometric functions. The general solution of Eq. (27) for modified FS metric in four dimensions [51] is given by

$$\begin{aligned}&y (x)= (1- \alpha )^{\frac{-3}{4}} [(b - a \sqrt{(1+C\;r^{2})(1- \alpha )}) \nonumber \\&\quad \cos \sqrt{(1{+}C\;r^{2})(1{-} \alpha )}{+} (a {+} b \sqrt{(1{+}C\;r^{2})(1{-} \alpha )}) \sin \sqrt{(1{+}C\;r^{2})(1{-} \alpha )}] \end{aligned}$$
(33)

where \(a = c_{1} \sqrt{\frac{2}{\pi }} \) and \(b = - c_{2} \sqrt{\frac{2}{\pi }} \) are arbitrary constants of the metric. We consider the metric potential of the modified four-dimensional FS metric as

$$\begin{aligned}&e^{2\lambda (r)}= 1+ C\; r^{2}, \end{aligned}$$
(34)
$$\begin{aligned}&e^{2 \nu (r)}= (1- \alpha )^{\frac{-3}{2}} [(b- a \sqrt{(1+C\;r^{2})(1- \alpha )})\nonumber \\&\quad \cos \sqrt{(1+C\;r^{2})(1- \alpha )}+ (a+ b \sqrt{(1+C\;r^{2})(1- \alpha )}) \nonumber \\&\quad \sin \sqrt{(1+C\;r^{2})(1- \alpha )}]^{2}, \end{aligned}$$
(35)

where C, a, b, \(\chi \) and \(\alpha \) are the five unknowns. For \(\alpha = 0\), the Finch–Skea solution obtained in GR for 4 dimensions with isotropic fluid is recovered [40]. The relativistic solution for \(-1< \alpha <1\) obtained here is regular in the interior of the star which can be matched smoothly with the Schwarzschild exterior solution at the boundary. It can be used to construct stellar models determining the metric parameters a , b and C for given values of \(\alpha \) and \(\chi \). It may be mentioned here that for \(\alpha \ge 1\), the stellar models are not stable. Consequently, we consider \(-1<\alpha < 1\) in the f(RT)-modified gravity to construct stellar models for compact objects.

4 Physical analysis

The following conditions [52] are imposed on the relativistic solutions for a physically realistic stellar configurations for compact objects in the modified gravity:

  • At the boundary of a static star (i.e., at \( r=R'\)), the interior space-time is matched with the exterior Schwarzschild solution. For the continuity of the metric functions at the surface, one considers

    $$\begin{aligned}&e^{2\nu (r)}|_{r=R'}=\Big (1-\frac{2M}{R'}\Big ), \end{aligned}$$
    (36)
    $$\begin{aligned}&e^{2\lambda (r)}|_{r=R'}=\Big (1-\frac{2M}{R'}\Big )^{-1}. \end{aligned}$$
    (37)
  • The radial pressure (\(p_r\)) drops from its maximum value (at the center) to vanishing value at the boundary, i.e., at \(r= R'\) , \( p_{(r=R')}=0\), the radius of the star b can be estimated.

  • The causality condition is satisfied when the speed of sound \( v^{2} = \frac{dp}{d\rho } \leqslant 1\) which is also a condition for stable stellar configuration [53].

  • The gradient of the pressure and energy density should be negative inside the stellar configuration, i.e., \(\frac{dp_{r}}{dr}< 0\) and \(\frac{d\rho }{dr} < 0 \).

  • At the center of the star, \(\varDelta (0) = 0\) which implies zero radial and tangential pressure, \(p_{r}(0) = p_{t}(0)\).

  • The energy conditions, viz. (a) null energy condition (NEC), (b) weak energy condition (WEC) and (c) strong energy condition (SEC), obey if it is made up of normal fluid.

  • The adiabatic index : \( \varGamma = \frac{\rho +p}{p} \; \frac{dp}{d\rho } > \frac{4}{3} \) for a given stellar configuration [54].

There are three field equations and five unknowns, to solve the equations two ad hoc assumptions are necessary for obtaining exact solutions. Thus, to construct stellar models, the unknown metric parameters a, b, C for a given mass (M) and radius \(r= R'\) of a star are to be determined from the boundary conditions making use of permissible values of \(\alpha \) and \(\chi \) for a realistic stellar model. For a given mass, we can predict the radius of the compact objects for values of the other parameters.

5 Physical properties of compact stars for \(-1< \alpha <1\)

The physical features of anisotropic compact objects are studied for \(-1< \alpha <1\). As the relativistic solutions are highly complex, we analyze numerically the variations of the energy density, radial pressure, transverse pressures, energy conditions, anisotropy of pressure and stability for a given value of the model parameters. The graphical plots are important for predicting the EoS of the observed compact objects. We consider uncharged anisotropic stellar objects.

5.1 Density and pressure of a compact objects in f(RT) gravity

In the f(RT)-modified gravity, we determine physical parameters, namely energy density (\(\rho \)), radial pressure (\(p_{r}\)) and tangential pressure (\(p_{t}\)). The metric potentials \(e^{2\lambda (r)}\) and \(e^{2\nu (r)}\) given by Eqs. (34) and (35) are employed in Eqs. (15)– (17) to determine the energy density (\(\rho \)), radial pressure (\(p_{r}\)) and tangential pressure (\(p_{t}\)) which are given by

$$\begin{aligned} \rho= & {} \frac{C \left( \sin \left( \sqrt{\mathbf{h_1}}\right) \left( a \; \mathbf{h}_\mathbf{2} +b h_o \sqrt{\mathbf{h}_\mathbf{1}} \right) +\cos \left( \sqrt{\mathbf{h}_\mathbf{1}}\right) \left( b \mathbf{h}_\mathbf{2} -a \mathbf{h}_\mathbf{o} \sqrt{\mathbf{h}_\mathbf{1}} \right) \right) }{g(r,a,b, C, \chi )}, \end{aligned}$$
(38)
$$\begin{aligned} p_{r}= & {} \frac{C \left( \mathbf{h}_\mathbf{3} \cos \sqrt{\mathbf{h}_\mathbf{1}} - \mathbf{h}_\mathbf{4} \sin \sqrt{\mathbf{h}_\mathbf{1}} \right) }{g(r,a,b, C, \chi ) }, \end{aligned}$$
(39)
$$\begin{aligned} p_{t}= & {} \frac{C \left( \mathbf{h}_\mathbf{5} \sin \sqrt{\mathbf{h}_\mathbf{1}}+ \mathbf{h}_\mathbf{6} \cos \sqrt{\mathbf{h}_\mathbf{1}} \right) }{g(r,a,b, C, \chi ) }, \end{aligned}$$
(40)

where the denominator is denoted as \(g(r,a,b, C, \chi ) = 12 \left( \chi ^2+6 \pi \chi +8 \pi ^2\right) \left( C r^2+1\right) ^2 (\sin \sqrt{\mathbf{h_1}} \left( a+b \sqrt{\mathbf{h_1}}\right) +\cos \sqrt{\mathbf{h_1}} \left( b-a \sqrt{\mathbf{h_1}}\right) )\),

\(\mathbf{h_o}=\chi \left( C r^2 (\alpha +3)+12\right) +12 \pi \left( C r^2+3\right) \), \(\mathbf{h_1} = - (\alpha -1) (C r^2+1)\), \(\mathbf{h_2} = \chi (-2 C r^2 (\alpha -3)-3 (\alpha -5))+12 \pi \left( C r^2+3\right) \), \(\mathbf{h_3} =a \sqrt{h_1} \; (C r^2 (\alpha +3) \chi +12 \pi (C r^2+1)) +b \; (\chi (2 C r^2 (3-5 \alpha )-9 \alpha +9)- 12 \pi (2 \alpha -1) \; C r^2+1))\), \(\mathbf{h_4}= a (\chi (2 C r^2 (5 \alpha -3)+9 (\alpha -1))+12 \pi (2 \alpha -1) (C r^2+1))+b \sqrt{h_1} (C r^2 (\alpha +3) \chi +12 \pi \; (C r^2+1))\), \(\mathbf{h_5}= a (\chi (2 C r^2 (3-2 \alpha )-9 \alpha +9)-12 \pi (C r^2 (\alpha -1)+2 \alpha -1))+b \sqrt{h_1} (C r^2 (5 \alpha -3) \; \chi +12 \pi (C r^2 (\alpha -1)-1))\), \(\mathbf{h_6}= a \sqrt{h_1} (C r^2 (3-5 \alpha ) \chi -12 \pi (C r^2 (\alpha -1)-1))+b (\chi (2 C r^2 (3-2 \alpha )-9 \alpha +9)-12 \pi (C r^2 (\alpha -1)+2 \alpha -1))\).

Fig. 1
figure 1

Radial variation of energy density (\(\rho \)) in PSR J0348+0432 for \(\chi = 1\) (Red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple) and \(\chi =10 \) (black) (considering \(\alpha =0.5\))

Fig. 2
figure 2

Radial variation of radial pressure (\(p_{r}\)) in PSR J0348+0432 for \(\chi = 1\) (red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple) and \(\chi =10 \) (black) for \(\alpha =0.5\)

Fig. 3
figure 3

Radial variation of radial pressure (\(p_{r}\)) in PSR J0348+0432 for \(\alpha = 0\) (gray), \(\alpha = 0.1\) (yellow), \(\alpha = 0.2 \) (pink), \(\alpha =0.3\) (cyan), \(\alpha =0.4\)(brown) and \(\alpha = 0.5 \) (red) for \(\chi =1\)

Fig. 4
figure 4

Radial variation of transverse pressure (\(p_{t}\)) in PSR J0348+0432 for \(\chi = 1\) (red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple) and \(\chi =10 \) (black) for \(\alpha =0.5\)

Fig. 5
figure 5

Radial variation of transverse pressure (\(p_{t}\)) in PSR J0348+0432 for \(\alpha = 0\) (gray), \(\alpha = 0.1\) (yellow), \(\alpha = 0.2 \) (pink), \(\alpha =0.3\) (Cyan), \(\alpha =0.4\) (brown) and \(\alpha = 0.5 \) (red) for \(\chi =1\)

Fig. 6
figure 6

Radial variation of energy density gradient (\(\frac{d\rho }{dr}\)) in PSR J0348+0432 for \(\chi = 1\) (red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple) and \(\chi =10 \) (black) for \(\alpha =0.5\)

Fig. 7
figure 7

Radial variation of pressure gradient (\(\frac{dp_{r}}{dr}\)) in PSR J0348+0432 for \(\chi = 1\) (red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple) and \(\chi =10 \) (black) for \(\alpha =0.5\)

The radial variation of the energy density (\(\rho \)), radial pressure (\(p_{r}\)) and tangential pressure (\(p_{t}\)) are plotted for PSR J0348+0432 in Figs. 1, 2 and 4, respectively, for \(\alpha =0.5\) with different \(\chi \). It is evident that the physical quantities are maximum at the origin which, however, decrease monotonically away from the center. As \(\chi \) is increased, the values of the physical parameters decrease. Similarly, the radial variation of radial pressure (\(p_{r}\)) and tangential pressure (\(p_{t}\)) for different \(\alpha \) for \(\chi = 1\) are plotted in Figs. 3 and 5, respectively. It is noted that as \(\alpha \) increases, the radial pressures and tangential pressure decrease which are positive and regular at the origin with maximum values. Thus, the model is free from physical and mathematical singularities. The radial variation of energy density gradient and radial pressure gradient for different values of \(\chi \) is plotted in Figs. 6 and 7, respectively, which are found to be negative.

5.2 Anisotropic star

We define the measure of anisotropy of a compact object by,

$$\begin{aligned} \varDelta = \frac{p_{t} - p_{r}}{p_{r}} = \frac{\alpha x C}{2 p_{r} (x+1)^2 (4 \pi + \chi )}. \end{aligned}$$
(41)

It is evident that an isotropic stellar model is obtained here for \(\alpha =0\) in 4-dimensions, but for nonzero \(\alpha \) the modified gravity considered here always permits an anisotropic star unless \(\chi = - 4 \pi \) which follows from Eq. (41). The structure of f(RT) gravity is interesting that permits an anisotropic star always in a four-dimensional FS metric, which is different from GR. In Fig. 8, we plot the radial variation of anisotropic measure \(\varDelta \) for different coupling parameters \(\chi \) values with a given \(\alpha \) (\(\alpha \)= 0.5). It is also found that for \(\chi > 0\), the measure of anisotropy is positive implying \(p_{t}> p_{r}\), i.e., the anisotropic stress is directed outwards; hence, there exists a repulsive gravitational force that allows the formation of super massive stars. For a negative \(\alpha \), it implies the measure of anisotropy \(\varDelta <0\) (i.e., \(p_{r}> p_{t}\)) for positive values of \(\chi \) with \(\chi \ne -4 \pi \). The measure of anisotropy increases as \(\alpha \) increases, whereas it decreases when \(\alpha < 0\). It is found that the stellar model is not allowed for negative \(\chi \) values with positive \(\alpha \).

Fig. 8
figure 8

Radial variation of anisotropy parameter (\(\varDelta \)) in PSR J0348+0432 for \(\chi = 1\) (red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple) and \(\chi =10 \) (black) for \(\alpha =0.5\)

5.3 Stability of the Stellar model

5.3.1 Herrera cracking concept

The stability of a stellar model is studied numerically plotting the radial variation of the square of the radial speed of sound (\(v_{r}^{2}= \frac{dp_{r}}{d\rho }\)) and square of the transverse speed of sound (\(v_{t}^{2}= \frac{dp_{t}}{d\rho }\)) separately in Figs. 9 and 10, respectively. It is found that a stable configuration of anisotropic compact object can be accommodated. Herrera and Abreu [55] pointed out that for a physically stable stellar system made of anisotropic fluid distribution the difference of square of the sound speeds should maintain its sign inside the stellar system. Accordingly, in a potentially stable region, square of the radial sound speed should be greater than the square of the tangential sound speed. The stability of the stellar model must satisfy the Herreras cracking conjecture, i.e., \(|v_{t}^{2}- v_{r}^{2}| \le 1\) for a stable configuration. In Fig. 11, the radial variation of \(|v_{t}^{2}- v_{r}^{2}|\) is plotted for different values of \(\chi \) with \(\alpha =0.5\) and found to satisfy the criteria for a stable stellar model.

Fig. 9
figure 9

Radial variation of \(v_{r}^{2}\) in PSR J0348+0432 for \(\chi = 1\) (red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple) and \(\chi =10 \) (black) (considering \(\alpha =0.5\))

Fig. 10
figure 10

Radial variation of \(v_{t}^{2}\) in PSR J0348+0432 for \(\chi = 1\) (red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple) and \(\chi =10 \) (black) (considering \(\alpha =0.5\))

Fig. 11
figure 11

Radial variation of \(|v_{t}^{2}- v_{r}^{2}| \) in PSR J0348+0432 for \(\chi = 1\) (red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple) and \(\chi =10 \) (black) (considering \(\alpha =0.5\))

5.3.2 Adiabatic index

The stiffness of the EoS for given energy density is characterized by adiabatic index which has significant importance for understanding the stability of a relativistic compact objects. Chandrasekhar began the study of the dynamical stability against infinitesimal radial adiabatic perturbation of the stellar systems. The stability of a star is confirmed if the adiabatic index is greater than \(\frac{4}{3}\) as pointed out by Bondi [56] . In the f(RT) gravity, the expressions of \(\varGamma _{r}\) and \(\varGamma _{t}\) are highly complex. To determine the suitability of the model, we plot radial variation of \(\varGamma _{r}\) and \(\varGamma _{t}\). For anisotropic fluid distribution, the adiabatic index is given by,

$$\begin{aligned} \varGamma = \frac{\rho +p}{p}\; \frac{dp}{d\rho }. \end{aligned}$$
(42)

The radial variation of the radial adiabatic index (\(\varGamma _{r}\)) is plotted in Fig. 12 for different values of \(\chi \). The corresponding stellar models are dynamically stable as \(\varGamma \ge \frac{4}{3}\). The stars are stable against infinitesimal radial adiabatic perturbations. Similarly, in Fig. 13 we plot the radial variation of tangential adiabatic index (\(\varGamma _{t}\)) for different values of the parameter \(\chi \). We plot both \(\varGamma _{r}\) and \(\varGamma _{t}\) for negative \(\chi = -1\) and \(\chi =-3\). It is seen that the adiabatic index lie below the limiting value of \(\frac{4}{3}\). So we conclude that negative \(\chi \) values are not permissible for the theoretical model of compact objects considered in f(RT) theory.

Fig. 12
figure 12

Radial variation of \(\varGamma _{r}\) in PSR J0348+0432 for \(\chi = 1\) (red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple), \(\chi =10 \) (Black), \(\chi = 1\) (red, dotted) and \(\chi = 3\) (blue, dotted) (considering \(\alpha =0.5\)) [sky blue line for \(\frac{4}{3}\) limit]

Fig. 13
figure 13

Radial variation of \(\varGamma _{t}\) in PSR J0348+0432 for \(\chi = 1\) (red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple), \(\chi =10 \) (black),\(\chi = 1\)(red, dotted) and \(\chi = 3\) (blue, dotted) (considering \(\alpha =0.5\)) [brown line for \(\frac{4}{3}\) limit]

Fig. 14
figure 14

WEC 1

Fig. 15
figure 15

WEC 2

Fig. 16
figure 16

DEC 1

Fig. 17
figure 17

DEC 2

Fig. 18
figure 18

SEC

5.4 Energy conditions of the stellar model in the f(RT) gravity

The energy conditions (EC) play a crucial role in determining the observe normal or exotic nature of matter inside the stellar model. The energy conditions are null (NEC), dominant (DEC), strong (SEC) and weak energy conditions (WEC). In an anisotropic fluid distribution, ECs are expressed as:

$$\begin{aligned}&{{ NEC:}}\; \rho \ge 0, \end{aligned}$$
(43)
$$\begin{aligned}&{{ WEC1:}}\; \rho +p_{r} \ge 0, \;\;\;\; {{ WEC2:}} \rho + p_{t} \ge 0,\end{aligned}$$
(44)
$$\begin{aligned}&{{ SEC:}}\; \rho +p_{r}+2 p_{t} \ge 0, \end{aligned}$$
(45)
$$\begin{aligned}&{{ DEC1:}}\; \rho - p_{r} \ge 0, \;\;\;\; {{ DEC2:}} \;\rho - p_{t} \ge 0. \end{aligned}$$
(46)

The evolution of all the energy conditions against the radial coordinate r for the compact stellar structure is studied here for different \(\chi \) with \(\alpha = 0.5\) in f(RT) gravity. These are shown graphically in Figs. 14, 15, 16, 17, 18.

5.5 Stellar mass–radius relation

For a static spherically symmetric stellar models with anisotropic fluid, Buchdahl found a limit on the mass to radius ratio, i.e., \(\frac{2M}{R'}< \frac{8}{9}\) [57]. In this section, we analyze graphical behavior of the mass–radius relation for different values of the parameters. The effective mass is given by

$$\begin{aligned} m(r) = \int _{0}^{r} 4 \pi r'^{2}\rho \mathrm{d}r'. \end{aligned}$$
(47)

We consider PSR J0348+0432 with observed mass equal to \(M= 2.01\) ± 0.04 \(M_{\odot }\). Now plotting the observed mass in the mass–radius curve in Fig. 19, it is found that one can predict the variation of the size of a compact object for different \(\chi \) values. Figure 19 shows that for a given mass of known object, the radius increases for the increasing values of \(\chi \); thus, the compactness factor of the star decreases. Thus, we can state that for lower values of \(\chi \) we can find more dense object comparatively. The mass function is regular at the center of the compact stellar structure.

Fig. 19
figure 19

Mass–radius relation in PSR J0348+0432 \(\chi = 1\) (red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple) and \(\chi =10 \) (black) for \(\alpha =0.5\)

5.6 Class of Stellar models with EoS

The different model parameters a, b, C of Finch–Skea metric given by Eqs. (34) and (35) are determined using the boundary conditions, satisfying the criterion for a physically realistic stellar object. We tabulated different metric parameters in Tables 1 and 2 for PSR J0348 + 0432 which admits a class of stellar models in f(RT) gravity. In Table 1, the observed mass and radius of the star PSR J0348 + 0432 is found with best fitted values \(a= 0.166662\), \(b= 0.24751\) and \(C=0.009664\) for \(\alpha =0.5\) and \(\chi =1\). As the radius of a star with observed mass is not known precisely, we can predict its radius for different compactness factor as shown in Table 1. We note that as the compactness factor decreases the radius of star increases along with decrease in central density and radial pressure. It is also noted that if the radius is less than 11 km, then the physically realistic stellar model cannot be obtained, because in this case \(\varGamma < \frac{4}{3}\). Considering the best fitted C value, i.e., \(C =0.009664\), we also determine the model parameters for different gravitational coupling constant \(\chi \) at \(\alpha =0.5\). The parametric plot of pressure and density for PSR J0348 + 0432 is shown in Fig. 20 with \(\chi =1\), \(\chi =3\), \(\chi =5\), \(\chi =7\) and \(\chi =10\). For smaller values of \(\chi \), it is found that quadratic fitting of the EoS curve is better than a linear one. However, we note linear EoS for higher values of \(\chi \). In the above, it is noted that the MIT Bag Model EoS in a compact star is not suitable in the framework of f(RT) gravity with FS geometry. This result is new compare to the earlier results, as in Ref. [33, 34], where they have considered MIT Bag model for obtaining stellar models. In Table 2, it is also evident as the gravitational coupling constants increases, the central density and the central pressure decreases. Considering five more known compact objects, namely Vela X-1, Cen X-3, EXO 1745-268, SAX J1748.9-2021 and M13, we also determine the best fitted model parameters for a realistic stellar model, which are tabulated in Table 3.

Table 1 Different model parameters for a variation of compactness factor of PSR J0348+0432 [60] in modified gravity taking \(\chi =1\) and \(\alpha =0.5\)
Table 2 Physical parameters for PSR J0348+0432 [60] in f(RT) gravity for different \(\chi \) values with best fitted \(C=0.009664\) and \(\alpha = 0.5\)

5.7 Modified Tolman–Oppenheimer–Volkoff (TOV) equation in f(RT) gravity

The stable configuration of a compact star satisfies the generalized TOV equation. To check the stability of the stellar model, we study Eq. (6), which must give the general physical requirements of the Einstein field equation for the f(RT) gravity theory. Since f(RT) is a non-conservative theory, the hydrostatic balance of the compact structure in principle might not be satisfied by the three forces \(F_h\), \(F_g\) and \(F_a\) only. So, to ensure the appropriate physical behavior one can rewrite the usual conservation law representing the energy momentum tensor by an effective one. Explicitly it is written as \(\nabla ^{\mu }\; T^{\mathrm{eff}}_{\mu \nu } = 0\). The above equation leads to the modified TOV equation for a spherically anisotropic stellar interior in f(RT) gravity theory, which is given by

$$\begin{aligned} \frac{-\nu '}{2}(\rho + p_{r})- \frac{dp_{r}}{dr}+\frac{2}{r}(p_{t}-p_{r})+\frac{\chi }{3(8\pi +2\chi )}\left( 3\frac{d\rho }{dr}-\frac{dp_{r}}{dr}-2\frac{dp_{t}}{dr}\right) = 0. \end{aligned}$$
(48)

In the modified TOV, we represent \(\frac{-\nu '}{2}(\rho + p_{r}) = F_{g}\) for the gravitational force, \(\frac{dp_{r}}{dr} = F_{h}\) for the hydrodynamic force, \(\frac{2}{r}(p_{t}-p_{r})= F_{a}\) for the anisotropic force and \(\frac{\chi }{3(8\pi +2\chi )}\left( 3\frac{d\rho }{dr}-\frac{dp_{r}}{dr}-2\frac{dp_{t}}{dr}\right) = F_{\chi }\) for the extra force originated from the coupling between the geometry and the matter. The equilibrium condition in compact stellar system demands a vanishing resultant force given by \( F=F_{g}+ F_{h}+ F_{a}+ F_{\chi }= 0\). The profile of four different forces is plotted in Fig. 21, and we have shown in Fig. 21 that the equilibrium of the forces is attained for the values of \(\chi \) with \(\alpha =0.5\), which validates the stability of our model. Consequently, Fig. 21 indicates that for \(\chi > 0\) the combined impact of the two anisotropic and hydrodynamic forces is counterbalanced by the sum of the gravitational force and the resultant force of the coupling between the matter and geometry.

5.8 Compactification factor

The upper limit of compactification factor \(u= \frac{M}{R'}\) of a star in GTR with perfect fluid \(\frac{M}{R'} < \frac{4}{9}\) [57]. In the case of a charged sphere, the compactness factor is generalized by Mak et al. [58]. On the basis of compactification factor, stars can be classified into different categories [59] as follows : (i) a normal star:\(\frac{M}{R'} \sim 10^{-5}\), (ii) white dwarf:\(\frac{M}{R'} \sim 10^{-3}\), (iii) neutron star: \(10^{-1}< \frac{M}{R'} < \frac{1}{4}\) , (iv) ultra dense compact star: \(\frac{1}{4}< \frac{M}{R'} <\frac{1}{2}\) and (v) black hole: \(\frac{M}{R'} = \frac{1}{2}\). In the f(RT) gravity, compactification factor depends on the gravitational coupling parameter, and we plot radial variation of u in Fig. 22 for different values of \(\chi \). The compactification factor decreases with the increase in \(\chi \). The plot shows that in f(RT) gravity the stellar models permit neutron stars.

Fig. 20
figure 20

EoS in PSR J0348+0432 for \(\chi = 1\) (red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple) and \(\chi =10 \) (black) for \(\alpha =0.5\)

6 Discussion

In the paper, we obtain a class of relativistic solutions for compact objects in hydrostatic equilibrium in a modified gravity \(f(R,T)=R+2\chi T\) with Finch–Skea ansatz. The modified gravity considered here might play an important role in astrophysics as it has wide application in cosmology. Since the field equations are highly complex, we adopt a technique to project the field equation in a second-order differential equation. The anisotropic stellar models are constructed here. We analyze the stellar models numerically and predicted the EoS of matter inside the compact objects assuming a modified Finch–Skea metric. For \(\chi =0\), it corresponds to GR and it represents isotropic stellar configuration [40]. In the modified gravity, it is found that stellar models represent anisotropic uncharged compact objects always unless \(\chi = -4 \pi \). It is also found that realistic stellar models are permitted for a given range of values of anisotropy \(-1< \alpha < +0.5 \) which are stable. We study the physical features of the compact stars of known observed mass. As the EoS in a compact object at extreme condition of density is not yet known, we adopted a different technique; considering a modified Finch–Skea ansatz in the framework of modified gravity, the EoS is predicted with different values of the model parameters. For known stars, its mass is precisely known but not its radius; consequently, the parameters of the model are determined analytically to find the probable radius and the EoS of the matter inside the compact objects. We note the following:

(i):

The radial variation of energy density, radial pressure and tangential pressure plotted in Figs. 1, 2, 3, 4 show that they are maximum at the origin which, however, decrease away from the center. The radius of the star is determined from the condition that the radial pressure vanishes at the surface. The coupling parameter \(\chi \) in the gravitational action is playing an important role to accommodate anisotropic compact objects. We note that both the central density and pressure decrease as \(\chi \) is increased. We note that as \(\chi \) is decreased it accommodates a more dense star.

(ii):

There is no physical and mathematical singularities as the radial variation of the radial pressure (\(p_{r}\)) and tangential pressure (\(p_{t}\)) shown in Figs. 2, 3, 4, 5 is positive and regular at the origin.

(iii):

An isotropic stellar configuration is obtained for \(\alpha =0\) in Eq. (41). For PSR J0348+0432, the radial variation of \(\varDelta \) for different \(\chi \) in Fig. 8 shows that \(\varDelta >0\), i.e., \(p_{t}> p_{r}\) for \(\chi > 0\) which implies that the anisotropic stress is directed outwards. There exists a repulsive gravitational force that allows the formation of super massive star in this case. It is evident that when \(\chi =0\) it corresponds to isotropic star (\(\alpha =0\)) in four dimensions, but for a negative \(\alpha <0\) it implies the measure of anisotropy \(\varDelta <0\) for positive values of \(\chi \) with \(|\chi | \ne 4 \pi \).

Table 3 Best fitted values of model parameters for different known compact object taking \(\alpha =0.5\) and \(\chi =1\)
(iv):

The radial variation of the radial adiabatic index \(\varGamma _{r}\) plotted in Fig. 12 shows that the stellar models are stable as it satisfies the limit \(\varGamma > \frac{4}{3}\). Similarly, in Fig. 13 we plot the radial variation of tangential adiabatic index (\(\varGamma _{t}\)) for different values of the parameter \(\chi \). The stellar models obtained here are stable configuration in f(RT) modified gravity.

(v):

All the energy conditions, viz. (a) null energy condition (NEC), (b) weak energy condition (WEC) and (c) strong energy condition (SEC), drawn in Figs. 14, 15, 16, 17, 18 are satisfied. Thus, no exotic matter required for building stellar models.

(vi):

The mass–radius relation of PSR J0348+0432 plotted in Fig. 19 for different values of \(\chi \) shows that for a given mass of the compact object, the radius increases for an increasing value of \(\chi \). Thus, for lower \(\chi \), the models accommodates very compact object as the compactness factor \(\left( \frac{M}{R}\right) \) increases (where R is the radius of a star).

(vii):

We constructed stellar models for PSR J0348 + 0432 without assuming EoS as it is not yet known. Instead we preassume modified FS metric ansatz to determine the EoS for the metric coefficients a, b and gravitational coupling parameter \(\chi \) in an anisotropic configuration with \(\alpha =0.5\). The predicted EoS are tabulated in Table 2, and it is evident that both linear and quadratic EoS are obtained. The numerical fitting of the pressure and density curves shows that the goodness of fit for the quadratic fitting is better than that of the linear one for lower values of \(\chi \). However, the linear EoS obtained here is different from that corresponds to MIT bag model [33, 34]. The EoS for matter interior to a compact star in modified gravity is predicted here which is nonlinear for massive star. The anisotropy lies in the range \( -1.0< \alpha < 0.5\) for \(\chi = 1\) in a stable stellar model.

(viii):

We have tabulated different metric parameters in Tables-1 for PSR J0348 + 0432 which admits a class of stellar models in f(RT) gravity. In Table 1, the observed mass and radius of the star PSR J0348 + 0432 are found with best fitted values \(a= 0.166662\), \(b= 0.24751\) and \(C=0.009664\) for \(\alpha =0.5\) and \(\chi =1\). As the radius of a star with observed mass is not known precisely, we can predict its radius for different compactness factor as shown in Table 1. We note that as the compactness factor decreases the radius of star increases along with the decrease in central density and radial pressure. It is also noted that if the radius is less than 11 km, then the physically realistic stellar model cannot be obtained, because in this case \(\varGamma < \frac{4}{3}\). Considering the best fitted C value, i.e., \(C =0.009664\), we also determine the model parameters for different gravitational coupling constant \(\chi \) at \(\alpha =0.5\).

(ix):

Considering five more known compact objects, namely Vela X-1, Cen X-3, EXO 1745-268, SAX J1748.9-2021 and M13, we also determine the best fitted model parameters for a realistic stellar model, which are tabulated in Table 3.

(x):

The four different forces, namely the hydrodynamic force (\(F_{h}\)), gravitational force (\(F_{g}\)), anisotropic force (\(F_{a}\)) and extra force (\(F_{\chi }\)) (arises from the matter gravity coupling in the modified gravity f(RT) gravity), in Eq. (48) lead to hydrostatic equilibrium in the stellar system. In Fig. 21, we draw the forces and it is evident that the equilibrium condition of the stellar system is attained under the action of four different forces as \(F_{tot} =F_h+ F_g+F_a+F_{\chi }=0\). We note that the combined effect of the anisotropic and hydrodynamic forces counterbalance the total forces due to the gravitational force and the extra force that arises from the coupling between the matter and geometry witj \(\chi > 0\) in f(RT)-theory.

(xi):

We have studied the compactification factor u and shown graphically in Fig. 22 for different values of \(\chi \). It is found that for the increasing values of \(\chi \), the compactness factor of the star decreases. Thus, the effect of \(\chi \) is important which plays a significant role in determining the compactification factor of the compact object in f(RT) gravity. The maximum value of u implies that our model corresponds to a neutron star.

Fig. 21
figure 21

Mass–radius relation in PSR J0348+0432 for \(\chi = 1\) (blue) and \(\chi =3\) (green), \(\chi = 5 \) (black), \(\chi = 7 \) (red), \(\chi = 10 \) (gray) taking \(\alpha = 0.5\) [Here, in lower portion: \(F_{g}\)(solid),\(F_{\chi }\)(dot dashed) and in upper portion:\(F_{a}\)(dashed), \(F_{h}\)(dotted)]

Fig. 22
figure 22

Compactification factor in PSR J0348+0432 for \(\chi = 1\) (red), \(\chi = 3\) (blue), \(\chi = 5\) (green), \(\chi =7\) (purple) and \(\chi =10 \) (black) for \(\alpha =0.5\) [brown line is for Buchdahl limit]

Thus, a class of new relativistic solutions are obtained in f(RT) gravity with FS geometry which are employed to build stellar models satisfactorily. The precise measurement of the radius of a neutron star in future will be useful to understand the role of modification incorporated in the gravitational action. The EoS of matter inside the star at very high densities can be predicted for different gravitational coupling parameter \(\chi \) with a modified FS geometry. The exact determination of the radius of the compact stars will be useful to accept or rule out stellar models. The numerical analysis of pressure with density for the stellar models determines the EoS. The EoS is of the linear form, e.g.,  \(p= \mu _{0}(\rho -\rho _0)\) where \(\mu _{0}\) and \(\rho _{0}\) are constants obtained in a given stellar configuration or a polynomial of the form \(p= f(\rho )\), shown in Table 2. The work may be extended with extra dimension to accommodate compact objects with their different physical features as studied in Ref. [44,45,46].