1 Introduction

Soon after the formulation of general relativity (GR), several theories were constructed in view of fixing as many issues as possible related to the gravitational field. Among these theories, there is the one formulated by H. Weyl which tried to unify gravitation and electromagnetism in 1918 [1]. Einstein himself, in 1928 [2], adopted the same philosophy by Weyl adopting the Weitzenböck geometry. In this formulation, one has to introduce tetrad fields to describe dynamics, unlike GR whose dynamical variable is the metric. The tetrad field has 16 components which made Einstein think that the extra 6 components, with respect to the metric, could describe the components of the electromagnetic field. Nevertheless, it was shown that these extra 6 components are linked to the local Lorentz invariance of the theory [3, 4].

Despite the failure of the Weyl and Einstein attempts, the new approaches supplied the notion of gauge theory and thus the search for a gauge gravity started [5, 6]. In 1979, Hayashi and Shirafuji [7] proposed a gravitational theory, called “New General Relativity” that is a gauge theory for the translation group. This theory involves three free parameters to be determined by the experiment.

Another theory that is built up through the Weitzenböck geometry is the Teleparallel Equivalent of General Relativity (TEGR). TEGR and GR are equivalent at the level of field equations however, at the level of actions, they are different for a total divergence term [8,9,10,11,12,13]. In TEGR, gravity is encoded in the torsion field, with vanishing curvature, unlike GR where gravity is encoded in metric and curvature fields with vanishing torsion [14,15,16,17,18,19,20,21,22].

In this situation, a good approach could be testing different formulations of gravitational interaction by searching for signatures discriminating among concurrent theories. Systems, in strong field regime, are natural candidates to this aim. Signatures can come from compact objects like neutron stars or black holes, or from polarizations of gravitational waves [10, 23,24,25].

From a physical point of view, compact objects are, in general, stars exhausting their nuclear fuel. They can give rise to stable compact objects or to black holes. For example, neutron stars are compact objects which are boosted by their neutron degeneracy pressure against the attraction of gravity. Another type of compact stars are the white dwarfs, boosted by the electron degeneracy pressure against the gravity.

From a theoretical viewpoint, it is well know that the first exact vacuum solution of GR was the Schwarzschild one [26]. Thereafter many solutions investigating compact stars have been proposed. In particular, searching for interior solutions, describing realistic compact objects, became a fertile domain to probe GR and other theories. Using the equation of state (EoS), one can study the stability structure of compact stellar objects and then guess on their internal composition. Specifically, the EoS is useful to investigate the physical behavior of the stellar structure through the Tolman–Oppenheimer–Volkov (TOV) equation which is the general relativistic equation of the stellar interior coming from the internal Schwarzschild solution.

In order to study stellar configurations, one can assumes, at the beginning, that the distribution of matter is isotropic which means that the radial and tangential pressures are equal. However, in realistic cases, such assumption does not hold and one finds that the two components of radial and tangential pressures are not equal: the differences between them create the anisotropy. Such stellar configurations have unequal radial and tangential pressures. Lemaître, in 1933, was the first which proposed anisotropic models [27]. Moreover, it possible to show that, in order to reach stable configurations, at the maximal star surface, the radial pressure has to decrease and, at the center, it has to vanish [28, 29].

There are several factors to be taken into account to study anisotropic stars; among these, the high density regime where the nuclear interactions have to be relativistically treated [30, 31]. Moreover the existence of a solid core or a 3A type superfluid may cause the star to be anisotropic [32]. There is another source that makes the star anisotropic: it is a strong magnetic field [33, 34]. The slow rotation can be considered another source of anisotropy [35]. Letelier showed that combinations between perfect and null fluids can give rise to anisotropic fluids [36]. Other reasons can be taken into account to generate anisotropies like pion condensation [37], strong electromagnetic field [38] and phase transition [39].

Dev and Gleiser [40, 41] and Gleiser and Dev [42] investigated the operators that induce the pressure to be anisotropic. It was shown that the effect of shear, electromagnetic field, etc. on self-bound systems can be neglected, if the system is anisotropic [43]. Systems that consist of scalar fields like boson stars possess anisotropy [44]. Gravastars and wormholes can be considered as anisotropic models [45,46,47,48]. An application of anisotropic model to stable configurations of neutron stars has been discussed in [49]. They showed that anisotropy might have non-negligible effects on the equilibrium mass and on the surface red-shift.

A nice study describing the origin and the effects of anisotropy can be found in [50, 51]. Super dense and anisotropic neutron stars have been considered and a conclusion is that there is no limiting mass of such stars [52].

Supermassive neutron stars in alternative gravity are considered, for example, in [53,54,55,56]. The presence of torsion field in neutron star models is studied in [57]. The issue of stability of anisotropic stars has been analyzed in [58] and a conclusion is that the stability of such systems is similar to that of isotropic stars.

There are many anisotropic models that deal with the anisotropic pressure in the energy–momentum tensor. Several exact spherically symmetric solutions of interior stellar have been developed [59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94].

Beside this, adding charge effects in compact objects is an issue widely considered in literature, especially for neutron and quark stars [95,96,97,98,99,100]. An important result is the fact that the distribution of net charge can improve the maximum mass of compact stars. For example for white dwarfs, there are several results related to the charge effects affecting the structure (see, e.g. [101]). For this reason, we consider here charged compact star models showing that the net charge effects can increase the maximum mass.

The aim of the present paper is to derive a novel charged anisotropic solution in the framework of TEGR and compare it with realistic stellar configurations using physical assumptions on the form of metric potential and the combination of charge and anisotropy. In particular, we consider the pulsar \(\textit{PSR J 1614-2230}\) which estimated mass \(M= 1.97 \pm 0.04 M_{\circledcirc }\) and radius is \(R = 9.69 \pm 0.2\) km [102]. This peculiar system escapes the standard GR explanation of neutron stars because it is too massive to be stable unless one assumes exotic EoS or alternative gravities. We discuss the physical parameters of such a pulsar considering our solution derived in the framework of TEGR. From our point of view, this can constitute a possible test for the theory.

The set up of the paper is the following. In Sect. 2, we sketch the TEGR theory in presence of the electromagnetic field. Sect. 3 is devoted to the discussion of charged compact stars in TEGR. The requirements for a physically consistent stellar model in TEGR are discussed in Sect. 4. The physical properties of the model are considered in Sect.5. The model is matched with realistic compact stars, in particular with \(\textit{PSR J 1614-2230}\), in Sect. 6. In Sect.7, the stability of the model is taken into account with respect to the TOV equation and the adiabatic index. In particular, we report the (MR) relation and how it is affected by the electromagnetic field. Discussion and conclusions are reported in Sect. 8.

2 Teleparallel equivalent of general relativity and the electromagnetic field

In TEGR theory, at each point of the spacetime manifold, M, can be defined a tangent Minkowski spacetime \(\eta _{i j}=(+1,-1,-1,-1)\).Footnote 1 As is well-known that the dynamical fields of TEGR are the four linearly independent vierbeins (tetrads) from where we can define the metric and its inverse as

$$\begin{aligned} g_{\mu \nu } = \eta _{ab}l^a{}_\mu l^b{}_\nu , \quad g^{\mu \nu } = \eta ^{ab}L_a{}^\mu L_b{}^\nu , \end{aligned}$$
(1)

with \( \eta _{ab}\) being the flat Minkowski metric of the tangent space and \(l^b{}_\nu \), \(L_b{}^\nu \) are the covariant and contra-variant tetrad fields. Using Eq. (1) we can define the following orthogonal conditions

$$\begin{aligned} L_i{}^\mu l^i{}_\nu&= \delta ^\nu _\mu ,&l^i{}_\mu L_j{}^\mu&= \delta ^i_j.\end{aligned}$$
(2)

From the above definitions, we can define the torsion tensor asFootnote 2

$$\begin{aligned} T^a{}_{\mu \nu } = 2 \left( \partial _{[\mu }l^a{}_{\nu ]} + \omega ^a{}_{b[\mu } l^b{}_{\nu ]}\right) . \end{aligned}$$
(3)

where \(\omega ^a{}_{b\mu } \) is the spin connection which we can set equal zero due to TEGR. Therefore the torsion tensor (3) reduces to

$$\begin{aligned} T^a{}_{\mu \nu } = \partial _{[\mu }l^a{}_{\nu ]}.\end{aligned}$$
(4)

TEGR with electromagnetic field is recovered from the action

$$\begin{aligned} S_{\mathrm{TEGR}}= \int \mathrm {d}^4x\ |l| \left( \frac{1}{2\kappa ^2} T + \mathcal {{{\mathcal {F}}}} \right) \,, \end{aligned}$$
(5)

where \(\kappa ^2=8\pi \), \(|l|=\det (l^a{}_\mu )=\sqrt{-g}\) is the determinant of the tetrad field, \(\mathcal{{{\mathcal {F}}}}\) is a gauge-invariant scalar defined as \({{\mathcal {F}}} = \frac{1}{4}{{\mathcal {F}}}_{\alpha \beta }{{\mathcal {F}}}^{\alpha \beta }\) [103, 104]. The torsion scalar T is defined as

$$\begin{aligned} T&= T^a{}_{\mu \nu }S_a{}^{\mu \nu } =\frac{1}{2} \left( L_a{}^\sigma g^{\rho \mu } L_b{}^\nu + 2 L_b{}^\rho g^{\sigma \mu } L_a{}^\nu \right. \nonumber \\&\quad \left. + \frac{1}{2} \eta _{ab} g^{\mu \rho } g ^{\nu \sigma } \right) T^a{}_{\mu \nu } T^b{}_{\rho \sigma }\,, \end{aligned}$$
(6)

where \(S_a{}^{\mu \nu }\) is the superpotential defined as

$$\begin{aligned} S_a{}^{\mu \nu } = \frac{1}{2}(K^{\mu \nu }{}_a - L_a{}^\mu T_\lambda {}^{\lambda \nu } + L_a{}^\nu T_\lambda {}^{\lambda \mu }) \end{aligned}$$
(7)

in terms of the contortion tensor

$$\begin{aligned} K^{\mu \nu }{}_a = \frac{1}{2}(T^{\nu \mu }{}_a + T_a{}^{\mu \nu } - T^{\mu \nu }{}_a)\,. \end{aligned}$$
(8)

The metric components are functions of the tetrads. The variation with respect to the tetrad \(l^a{}_\mu \) yields the field equations (see [105] for details)

$$\begin{aligned} \frac{1}{4}T L_a{}^\mu + T^b{}_{\nu a} S_b{}^{\mu \nu } + \frac{1}{h}\partial _{\nu }(l S_a{}^{\mu \nu })&= \frac{1}{2}\kappa ^2 {{\mathcal {T}}}_a{}^\mu \,. \end{aligned}$$
(9)

The stress–energy tensor \( {{\mathcal {T}}}_a{}^\mu \) consists of two terms

$$\begin{aligned} {{\mathcal {T}}}_a{}^\mu \,={{\mathcal {T}}}_a{}^\mu {}_{AF}+{{\mathcal {T}}}_a{}^\mu _{EM}, \end{aligned}$$
(10)

where

$$\begin{aligned} {{\mathcal {T}}}_a{}^\mu {}_{AF}=(p_t+\rho )u^\mu u_a+p_t\delta _a{}^\mu +(p_r-p_t)\xi _a \xi ^\mu \,, \end{aligned}$$
(11)

is the energy–momentum tensor of an anisotropic fluid, and

$$\begin{aligned} {{\mathcal {T}}}_a{}^\mu {}_{EM}=\frac{1}{4}\left( {{\mathcal {F}}}_{a \alpha } {{\mathcal {F}}}^{\mu \alpha }-\frac{1}{4} \delta _a{}^\mu {{\mathcal {F}}}_{\alpha \beta } {{\mathcal {F}}}^{\alpha \beta }\right) \,, \end{aligned}$$
(12)

is the energy–momentum tensor of the electromagnetic field. Here \(u_\mu \) is the time-like vector defined as \(u^\mu =[1,0,0,0]\) and \(\xi _\mu \) is the unit space-like vector in the radial direction defined as \(\xi ^\mu =[0,1,0,0]\) such that \(u^\mu u_\mu =-1\) and \(\xi ^\mu \xi _\mu =1\). In this paper, \(\rho \) is the energy-density, \(p_r\) and \(p_t\) are the radial and the tangential pressures respectively. Furthermore, the electromagnetic tensor \(F_{\mu \nu }\) satisfies the Maxwell equations

$$\begin{aligned}&F_{\mu \nu ,\gamma }+F_{\nu \gamma ,\mu }+F_{\gamma \mu , \nu }=0,\nonumber \\&\left( \sqrt{-g}F^{\mu \nu }\right) _{\, ,\nu }=4\pi J^\mu \sqrt{-g}, \end{aligned}$$
(13)

where \(J^\mu =\sigma u^\mu \) is the current density and \(\sigma \) is the charge density. In the next section, we are going to apply the field equations (9) and (13) to a spherically symmetric tetrad space and try to solve the resulting system of differential equations.

3 Charged compact stars

Let us begin with the following spherically symmetric metric using the spherical coordinates \((t,r,\theta , \phi )\)

$$\begin{aligned} ds^2=-G(r) \,dt^2+H(r)dr^2+r^2(d\theta ^2+\sin ^2\theta d\phi ^2)\,,\nonumber \\ \end{aligned}$$
(14)

where G(r) and H(r) are two unknown functions depending on the radial coordinate r. The above metric (14) can be reproduced from the following covariant tetrad field [106]

$$\begin{aligned} l^a{}_{\mu }=\left( \begin{array}{cccc} \sqrt{G(r)} &{} 0 &{} 0 &{} 0 \\ 0 &{} \sqrt{H(r)} \cos (\phi ) \sin (\theta ) &{} r \cos (\phi ) \cos (\theta ) &{} -r \sin (\phi ) \sin (\theta ) \\ 0 &{} \sqrt{H(r)} \sin (\phi ) \sin (\theta ) &{} r \sin (\phi ) \cos (\theta ) &{} r \cos (\phi ) \sin (\theta ) \\ 0 &{} \sqrt{H(r)} \cos (\theta ) &{} -r \sin (\theta ) &{} 0 \\ \end{array} \right) \,.\nonumber \\ \end{aligned}$$
(15)

The tetrad (15) is the output of the product of a diagonal tetrad and a local Lorentz transformation which can be written as

$$\begin{aligned}&l^a{}_{\mu }=\Lambda ^a{}_b l^b{}_{\mu _{diag}}\nonumber \\&\Rightarrow \left( \begin{array}{cccc} \sqrt{G(r)} &{} 0 &{} 0 &{} 0 \\ 0 &{} \sqrt{H(r)} \cos (\phi ) \sin (\theta ) &{} r \cos (\phi ) \cos (\theta ) &{} -r \sin (\phi ) \sin (\theta ) \\ 0 &{} \sqrt{H(r)}\sin (\phi ) \sin (\theta ) &{} r \sin (\phi ) \cos (\theta ) &{} r \cos (\phi ) \sin (\theta ) \\ 0 &{} \sqrt{H(r)} \cos (\theta ) &{} -r \sin (\theta ) &{} 0 \\ \end{array} \right) \nonumber \\&\equiv \underbrace{\left( \begin{array}{cccc} 1 &{} 0 &{} 0 &{} 0 \\ 0 &{} \cos (\phi ) \sin (\theta ) &{} \cos (\phi ) \cos (\theta ) &{} - \sin (\phi ) \\ 0 &{} \sin (\phi ) \sin (\theta ) &{} \sin (\phi ) \cos (\theta ) &{} \cos (\phi ) \\ 0 &{}\cos (\theta ) &{} -\sin (\theta ) &{} 0 \\ \end{array} \right) }_{Local\, \, Lorentz \, \,transformation}\nonumber \\&\quad \times \underbrace{\left( \begin{array}{cccc} \sqrt{G(r)} &{} 0 &{} 0 &{} 0 \\ 0 &{} \sqrt{H(r)} &{} 0 &{} 0 \\ 0 &{} 0 &{} r &{} 0 \\ 0 &{}0 &{} 0 &{} r \sin (\theta ) \\ \end{array} \right) }_{Diagonal\, \, tetrad} \,.\end{aligned}$$
(16)

It is worth noticing that the diagonal tetrad can be applied to the field equations of f(T) TEGR models [106]. Here we shall take into account the effect of local Lorentz transformation given by Eq. (16) and see if the results are different from those presented in [107].

Using Eq. (15) into Eq. (6), the torsion scalar takes the form

$$\begin{aligned} T= \frac{2\left( 2G\sqrt{H}-GH+r\sqrt{H}G'-G-rG'\right) }{GHr^2}\,. \end{aligned}$$
(17)

Despite the fact that the diagonal tetrad in Eq. (16) and tetrad (15) reproduce the same metric, their torsion scalars are different. The reason for this difference is the Local Lorentz transformation (LLT) in (16). The torsion scalar of Eq. (17) goes to zero when both the unknown functions G(r) and H(r) tend to one, which is the necessary condition to achieve the asymptotic flatness. Nevertheless, the torsion scalar presented in [107] does not vanish as it should when we apply the same condition. So the existence of LLT makes our torsion scalar more physically motivated.

Using Eq. (17) into field Eqs. (9) and (13), we get

$$\begin{aligned}&-8\pi \rho +E^2(r)= \frac{H[1-H]-rH'}{r^2H^2}\,,\nonumber \\&\qquad 8\pi p_r+E^2(r)=\frac{rG'-G(H-1)}{2r^2GH}\,,\nonumber \\&\qquad 8\pi p_t-E^2(r)\nonumber \\&\quad =\frac{2GH[G'+rG'']-rHG'^2-2G^2H'-rGG'H'}{8rG^2H^2}\,,\nonumber \\&\qquad \Delta (r)=\nonumber \\&\qquad \frac{r^2H[2GG''-G'^2]-rGG'[2H+rH']-2G^2[2H(1-H)+rH']}{8r^2G^2H^2}+2E^2(r)\,,\nonumber \\&\qquad \sigma (r)=\frac{\sqrt{H(r)}(r^2E)'}{4\pi r^2}, \end{aligned}$$
(18)

where the prime indicates derivatives w.r.t the radial coordinate r and \(\Delta =8\pi (p_t-p_r)\) is the pressure difference. We used the energy–momentum tensor \({{\mathcal {T}}}^{\mu }_{\nu }\) to get the form

$$\begin{aligned}&\text{ diag }\,{{\mathcal {T}}}^\mu _{\nu }\nonumber \\&\quad =\left( -\rho +E^2(r)\,,p_r+E^2(r)\,,p_t-E^2(r)\,,p_t-E^2(r)\right) \,, \end{aligned}$$
(19)

where \(E^2(r)\) is the electric field defined as

$$\begin{aligned} E(r)&= \frac{q(r)}{r^2}\, , \qquad \text {and} \, q(r)\, \text {is} \, \text {defined} \, \text {as}\nonumber \\ q(r)&= 4\pi \int _{0}^r \sigma (\xi ) \xi ^2d\xi \,, \end{aligned}$$
(20)

with q(r) being the electric charge inside a sphere of radius r and \(\sigma \) is the charge density (for details see, e.g., [108, 109]). Here \(\Delta (r)\) is the anisotropic parameter of the stellar system. Field Eqs. (18) coincide with those given in [107], and can be recast also in the field equations presented in [110] and in [111].

The above differential system are five independent equations in seven unknown functions, G, H, \(\rho \), \(p_r\), \(p_t\), E(r) and \(\Delta (r)\). Therefore, we need two extra conditions to solve the above system. One of these extra conditions is assuming the metric potential \(g_{rr}\) having the form

$$\begin{aligned} H(r) =\frac{1}{\left( 1-\frac{r^2}{k^2}\right) ^4}, \end{aligned}$$
(21)

where k is a constant having the dimension of the length. It will be determined from the matching conditions. Equation (21) shows that, for \(r=0\) and \(H(r)=1\), H(r) is finite at the center. Also the derivative of H is finite at the origin. The second condition comes from the use of Eq. (21) in \(\Delta (r)\) which takes the form

$$\begin{aligned} \Delta (r)= & {} \frac{24r^3k^4-32r^5k^2+12r^7+16k^8k_1{}^2 r^3}{8rk^8} \nonumber \\&+\frac{1}{8rk^8}\left[ r\left( 2k^8+12r^4k^4-8r^6k^2+2r^8-8r^2k^6\right) \frac{G''}{G}\right. \nonumber \\&\left. -\left( 2k^8-12r^4k^4+16r^6k^2-6r^8\right) \frac{G'}{G}\right] \nonumber \\&+\left( \frac{4r^7k^2-rk^8+4r^3k^6-6r^5k^4-r^9}{8rk^8}\right) \frac{G'^2}{G^2}, \end{aligned}$$
(22)

where we have put \(E^2(r)=k_1^2r^2\). Equation (22) is a second order differential equation in the unknown G function. In order to solve Eq. (22), we assume the anisotropic \(\Delta \) to have the form

$$\begin{aligned} \Delta (r)=\frac{24r^2k^4-32r^4k^2+12r^6+16k^8k_1{}^2 r^2}{8k^8}. \end{aligned}$$
(23)

Equation (23) has not been used before for charged stars in GR and TEGR. The present aim is to study the effect of anisotropy, given in (23), in presence of electric charge, on the neutron star structure. Inserting Eq. (23) into Eq. (22), we get

$$\begin{aligned}&\frac{1}{8rk^8}\left[ r\left( 2k^8+12r^4k^4-8r^6k^2+2r^8-8r^2k^6\right) \frac{G''}{G}\right. \nonumber \\&\quad \left. -\left( 2k^8-12r^4k^4+16r^6k^2-6r^8\right) \frac{G'}{G}\right] \nonumber \\&\quad +\left( \frac{4r^7k^2-rk^8+4r^3k^6-6r^5k^4-r^9}{8rk^8}\right) \frac{G'^2}{G^2}=0\,,\nonumber \\ \end{aligned}$$
(24)

The solution of differential equation (24) is

$$\begin{aligned} G=\frac{c_1(1+c_2r^2)^2}{(r^2-k^2)^2}\,. \end{aligned}$$
(25)

Clearly, G goes to a constant value for \(r\rightarrow 0\) and \(r\rightarrow \infty \).

From Eqs. (21) and (25) of the system of differential equations (18), we get the remaining unknown functions

$$\begin{aligned}&\rho =\frac{12k^6-30k^4r^2+28k^2r^4-9r^6+2k^8k_1{}^2r^2}{8\pi k^8}\,, \nonumber \\&p_r=\frac{c_2r^8-r^6(3+8k^2c_2)+2r^4(9k^4c_2-k^8c_2k_1{}^2+4k^2)-2r^2(3k^4+k^8k_1{}^2+8k^6c_2)+4k^8c_2}{8\pi k^8(1+c_2r^2)^2}\,, \nonumber \\&p_t=\frac{c_2[k^8(2+r^4k_1{}^2)-8r^2k^6+12r^4k^4-8k^2r^6+2r^8]+k^8r^2k_1{}^2}{4\pi k^8(1+c_2r^2)^2}\,, \quad \sigma (r)=\frac{3k_1(k^2-r^2)^2}{4\pi k^4}\,. \end{aligned}$$
(26)

If the constant \(k_1=0\), our star is neutral. In this case, Eqs. (26) will be identical with those presented in [107]. Equations (26), at the boundary of the star, take the form

$$\begin{aligned}&\rho =\frac{12k^6-30k^4R^2+28k^2R^4-9R^6+2k^8k_1{}^2R^2}{8\pi k^8}\,, \nonumber \\&p_r=\frac{c_2R^8-R^6(3+8k^2c_2)+2R^4(9k^4c_2-k^8c_2k_1{}^2+4k^2)-2R^2(3k^4+k^8k_1{}^2+8k^6c_2)+4k^8c_2}{8\pi k^8(1+c_2R^2)^2}\,, \end{aligned}$$
(27)
$$\begin{aligned}&p_t=\frac{c_2[k^8(2+r^4k_1{}^2)-8R^2k^6+12R^4k^4-8k^2R^6+2r^8]+k^8r^2k_1{}^2}{4\pi k^8(1+c_2R^2)^2}\, , \end{aligned}$$
(28)

where R is the radius at the boundary of the star. From the second equation of (27), we get the condition for the vanishing of radial pressure, that is

$$\begin{aligned} c_2=\frac{R^2(3R^4-8R^2k^2+6k^4+2k^8k_1{}^2)}{R^8-8R^6k^2-18R^4k_1{}^2+2R^4k^8k_1{}^2+16R^2k^6-4k^8}\,. \end{aligned}$$
(29)

For \(R=8.51M_{\odot }\), which is the boundary radius of the star \( {Her X-1}\), \(c_2\) takes the form

$$\begin{aligned} c_2=\frac{3-8r^2k^2+6k^4+2k^8k_1{}^2}{1-8k^2-18k_1{}^2+2k^8k_1{}^2+16k^6-4k^8}\,. \end{aligned}$$
(30)

If we substitute \(k=33.43508140\), \(k1=0.008680552960\) in Eq. (30), we get \(c_2=0.005\). In other words, if we substitute \(R=8.51M_{\odot }\), \(k=33.43508140\) and \(k1=0.008680552960\) in the second equation of (27), we get a vanishing radial pressure for the pulsar \(\textit{Her X-1}\). It is important to mention that the anisotropic force is defined as \(\frac{2\Delta }{r}\) and it is attractive for \(p_r-p_t>0\) and repulsive for \(p_r-p_t<0\). The mass contained within a radius r of the sphere is defined as

$$\begin{aligned} M(r)={\int _0}^r [4\pi \rho (\xi ) +E(\xi )]\xi ^2 d\xi \,.\end{aligned}$$
(31)

Using Eq. (26) in Eq. (31), we get

$$\begin{aligned} M(r)=\frac{r^3(20k^6+20k^2r^4-5r^6-30k^4r^2+2k^8k_1{}^2 r^2)}{10k^8}\,. \end{aligned}$$
(32)

The compactness parameter of a spherically symmetric source with radius r takes the form [107]

$$\begin{aligned} u(r)= & {} \frac{2M(r)}{r}\nonumber \\= & {} \frac{r^2(20k^6+20k^2r^4-5r^6-30k^4r^2+2k^8k_1{}^2 r^2)}{5k^8}.\nonumber \\ \end{aligned}$$
(33)

In the next section, we are going to discuss the physical requirements to derive viable stellar structures and to see if model (26) satisfy them or not.

4 Requirements for a physically consistent stellar model

A physically viable stellar model has to satisfy the following conditions throughout the stellar configurations:

  • The gravitational potentials G(r) and H(r), and the matter quantities \(\rho \), \(p_r\) , \(p_t\) have to be well defined at the center and regular as well as singularity free throughout the interior of the star.

  • The energy density \(\rho \) has to be positive throughout the stellar interior i.e., \(\rho \ge 0\). Its value at the center of the star should be positive, finite and monotonically decreasing towards the boundary inside the stellar interior, that is \(\frac{d\rho }{dr}\le 0\).

  • The radial pressure \(p_r\) and the tangential pressure \(p_t\) must be positive inside the fluid configuration i.e., \(p_r\ge 0\), \(p_t\ge 0\). The gradient of the pressure must be negative inside the stellar body, i.e., \(\frac{dp_r}{dr}< 0\), \(\frac{dp_t}{dr}< 0\). At the stellar boundary \(r= R\), the radial pressure \(p_r\) has to vanish but the tangential pressure \(p_t\) may not be zero at the boundary. At the center both pressures are equal. This means the anisotropy has to vanish at the center, that is \(\Delta (r = 0) = 0\).

  • For an anisotropic fluid sphere, the fulfillment of the energy conditions refers to the following inequalities in every point inside the fluid sphere:

    1. (i)

      Weak energy condition (WEC): \(p_r+\rho > 0\), \(\rho > 0\).

    2. (ii)

      Null energy condition (NEC): \(p_t+\rho > 0\), \(\rho > 0\).

    3. (iii)

      Strong energy condition (SEC): \(p_r+\rho > 0\), \(p_t+\rho > 0\), \(\rho -p_r-2p_t > 0\).

    4. (iv)

      Dominant energy conditions (DEC): \(\rho \ge |p_r|\) and \(\rho \ge |p_t|\) .

  • Causality condition has to be satisfied to get a realistic model i.e. the speed of sound must be smaller than 1 (assuming the speed of light \(c = 1\)) in the interior of the star, i.e. \(1\ge \frac{dp_r}{dr}\ge 0\), \(1\ge \frac{dp_t}{dr}\ge 0\).

  • The interior metric functions have to match smoothly the exterior Schwarzschild metric at the boundary.

  • For a stable model, the adiabatic index should be greater than \(\frac{4}{3}\).

  • Herrera method [112] to study the stability of anisotropic stars suggests that a viable model should also satisfy \(0>v_r{}^2-v_t{}^2>-1\) where \(v_r\) and \(v_t\) are the radial and transverse speed respectively.

Now we are going to analyze the above physical requirements in details to see if our model satisfy them.

5 Physical properties of the model

Let us test the model (26) and see if it is consistent with realistic stellar structures. To this aim, we discuss the following issues:

5.1 Non-singular model

  1. i

    The metric functions of this model satisfy,

    $$\begin{aligned} G(0)=\frac{c_1}{k^4}\,\qquad \text {and} \qquad H(0)=1, \end{aligned}$$
    (34)

    which means that the gravitational potentials are finite at the center of the stellar configuration. Moreover, the derivatives of these potentials are finite at the center, i.e., \(G'_{r=0}=H'_{r=0}=0\). The above conditions means that the metric is regular at the center and has a well behavior throughout the interior of the stellar.

  2. ii

    Density, radial and tangential pressures of (26), at the center, have the form

    $$\begin{aligned} \rho (0)=\frac{3}{4\pi k^2}\, \qquad p_r(0)=p_t(0)=\frac{c_2}{4\pi }. \end{aligned}$$
    (35)

    Equation (35) show that the density is always positive and the anisotropy is vanishing at the center. The radial and tangential pressures have a positive value as soon as \(c_2>0\) otherwise they become negative. Moreover, the Zeldovich condition [113] states that the radial pressure must be less than or equal to the density at the center i.e., \(\frac{p_r(0)}{\rho (0)}\le 1\). Using the Zeldovich condition in Eq. (35), we get

    $$\begin{aligned} c_2k^2\le 3. \end{aligned}$$
    (36)
  3. iii

    The derivative of energy density, radial and tangential pressures of the model are respectively:

    $$\begin{aligned} \rho '= & {} -\frac{r(30k^4+27r^4-2k^8k_1{}^2-56k^2r^2)}{8\pi k^8},\nonumber \\ p'_r= & {} -\frac{1}{8\pi k^8(1+c_2r^2)^2} \Big [r\Big (2k^2\{k^2(k^4k_1{}^2(c_2r^2+1)^2 +[8k^2c_2+3])+8r^2[c_2r^2(c_2r^2+1)-1]\nonumber \\&-9k^2c_2r^2[c_2r^2+2]\} -c_2{}^2[3r^9-4k^8]+r^4[9-2c_2r^2]\Big )\Big ], \nonumber \\ p'_t= & {} -\frac{r(2c_2k^6[4+k^2c_2]-k^8k_1{}^2(c_2r^2+1)^2-12k^4c_2r^2(c_2r^2+2)+8k^2c_2r^4[2c_2r^2+3]-2c_2r^6[4+3c_2r^2])}{4\pi k^8(1+c_2r^2)^2}\, ,\qquad \nonumber \\ \end{aligned}$$
    (37)

    where \(\rho '=\frac{d\rho }{dr}\), \(p'_r=\frac{dp_r}{dr}\) and \(p'_t=\frac{dp_t}{dr}\). Equation (37) show that the gradients of density, radial and tangential pressures are negative as we will show when we plot them.

  4. iv

    The radial and transverse velocity of sound (c = 1) are obtained as

    $$\begin{aligned} v_r{}^2= & {} \frac{dp_r}{d\rho }=\frac{1}{(c_2r^2+1)^2(30k^4+27r^4-2k^8k_1{}^2-56k^2r^2)} \Big (2k^2\{k^2(k^4k_1{}^2(c_2r^2+1)^2 \nonumber \\&+[8k^2c_2+3])+8r^2[c_2r^2(c_2r^2+1)-1] -9k^2c_2r^2[c_2r^2+2]\} -c_2{}^2[3r^9-4k^8]+r^4[9-2c_2r^2]\Big ), \nonumber \\ v_r{}^2= & {} \frac{dp_t}{d\rho }=\frac{2(2c_2k^6[4+k^2c_2]-k^8k_1{}^2(c_2r^2+1)^2-12k^4c_2r^2(c_2r^2+2)+8k^2c_2r^4[2c_2r^2+3]-2c_2r^6[4+3c_2r^2])}{(1+c_2r^2)^2 (30k^4+27r^4-2k^8k_1{}^2-56k^2r^2)}\, . \nonumber \\ \end{aligned}$$
    (38)

5.2 Matching conditions

We assume that the exterior spacetime for a not-rotating star is empty and described by the exterior Reissner–Nordström solution that is a solution of vacuum teleparallel gravity as shown in [114,115,116]. It has the form

$$\begin{aligned} ds^2= & {} -\Big (1-\frac{2M}{r}+\frac{Q^2}{r^2}\Big )dt^2\nonumber \\&+\Big (1-\frac{2M}{r}+\frac{Q^2}{r^2}\Big )^{-1}dr^2+r^2d\Omega ^2, \end{aligned}$$
(39)

where M is the total mass, Q is the charge and \(\frac{Q^2}{(r-2M)}<1\). We have to match the interior spacetime metric (14) with the exterior Reissner–Nordström spacetime metric (39) at the boundary of the star \(r = R\). The continuity of the metric functions across the boundary \(r = R\) gives the conditions

$$\begin{aligned} G(r=R)= & {} \left( 1-\frac{2M}{R}+\frac{Q^2}{R^2}\right) ,\nonumber \\ H(r=R)= & {} \left( 1-\frac{2M}{R}+\frac{Q^2}{R^2}\right) ^{-1}, \end{aligned}$$
(40)

in addition to the fact that radial pressure approaches to zero at a finite value of the radial parameter r which coincides with the radius of the star R. Therefore, the radius of the star can be obtained by using the physical condition \(p_r (r =R) = 0\). From the above conditions, we get the constraints on the constants \(c_1\), \(c_2\) and k. The constant k, from these conditions, is

$$\begin{aligned} k=\pm \frac{R\sqrt{ R(R\pm \sqrt{A(R)})\pm (A(R)+R)\sqrt{RA(R)^{1/2}}}}{\sqrt{B(R)}},\nonumber \\ \end{aligned}$$
(41)

where \(A(R)=R^2-2MR-Q^2\) and \(B(R)=2MR-Q^2\). The constants \(c_1\) and \(c_2\) are lengthy and useless to be reported here. We shall write their numerical values when confronting with observational data.

Fig. 1
figure 1

Schematic plots of the metric potentials (21) and (25) vs the radial coordinate r in Km using the constants constrained by PSR J 1614-2230 data

Fig. 2
figure 2

Plots of the density, radial and tangential pressures of (26) vs the radial coordinate r in Km adopting PSR J 1614-2230 constraints. According to this, we assume the values of constants as \(k \sim 28.248\), \(c_2\sim 0.003\), \(k_1\sim 0.492\)

6 Matching the model with realistic compact stars

Let us consider now the previous physical conditions of the model derived to test it by using masses and radii of observed pulsars. In order to support our model, we will study the pulsar PSR J 1614-2230 whose estimated mass and radius are \(M = 1.97\pm 0.04 M_\circledcirc \) and \(R = 9.69\pm 0.2\) km, respectively [117]. We can use the maximal values \(M=2.01 M_\circledcirc \) and \(R=9.89\)km as input parameters. The boundary conditions are adopted to determine the constants \(k=28\), \(c_1=174908.5108\) and \(c_2=0.0003\). Adopting these constants, we can plot the physical quantities. The regular behavior of these one can be assumed as a first requirement to fit a realistic star model.

Figure 1a, b represent the behavior of metric potentials for PSR J 1614-2230. As Fig. 1 shows, the metric potentials assume the values \(H(0)=1\) and \(G(0)=0.2733207699\) for \(r=0\). This means that both of them are finite and positive at the center.

Density, radial and tangential pressures, given in Eq. (26), are plotted in Fig. 2.

Figure  2 shows that density, radial and tangential pressures are positive as required for realistic stellar configuration. Moreover, as Fig. 2a shows, the density is high at the center and decreases far from it. Figure 2b shows that the radial pressure goes to the zero at the boundary while the tangential pressure remains non-zero at the boundary. Also this feature is relevant for a realistic model.

Fig. 3
figure 3

Plots of the anisotropy and anisotropic forces for solution (26) vs the radial coordinate r in Km using PSR J 1614-2230 constraints

Fig. 4
figure 4

Plots of the density gradient, radial and tangential pressures of solution (26) versus the radial coordinate r in Km using the PSR J 1614-2230 constraints

Fig. 5
figure 5

Plots of the radial and tangential sound speeds vs the radial coordinate r in Km using the PSR J 1614-2230 constraints

Figure 3a shows that the anisotropy is vanishing at the center and increases at the surface of the star. Specifically, Fig. 3b shows that the anisotropic force \(\frac{\Delta }{r}\) is positive. This means that it is repulsive due to the fact that \(p_t-p_r>0\).

Figure 4 shows that the gradients of density, radial and tangential pressures are negative which confirms the decreasing of density, radial and transverse pressures through the stellar configuration.

In Fig. 5, the radial and tangential speeds of sound are reported. They are positive and both of them are less than one. This result confirms the non-violations of causality condition in the interior of the star.

Figure 6 represent the behavior of the energy conditions. In particular, Fig. 6a–d show the positive values of the WEC, NEC, SEC and DEC energy conditions. Therefore, all the energy conditions are satisfied throughout the stellar configuration as required for a physically meaningful stellar model.

Fig. 6
figure 6

Plots of the weak, null, strong and dominant energy conditions coming from (26) vs the radial coordinate r in Km using the PSR J 1614-2230 constraints

The matching of the interior and exterior metrics at the boundary are shown in Fig. 7. Figure 7a represents the smooth matching between G(R) and \(1-\frac{2M}{R}+\frac{Q^2}{R^2}\). Figure 7b shows the smooth matching between H(R) and \((1-\frac{2M}{R}+\frac{Q^2}{R^2})^{-1}\).

In Fig. 8, we have plotted radial and tangential EoS. As Fig. 8a, b show, the EoS is not linear. In Ref. [118], authors derive the EoS for neutral compact stars and show that it is almost a linear one. Here, both the radial and tangential EoS show non-linear form which is due to the contribution of the electric field.

Fig. 7
figure 7

Plot of the radial coordinate r in Km versus the weak, null, strong and dominant energy conditions from (26) using the constants constrained by PSR J 1614-2230 data

Fig. 8
figure 8

Plot of the density \(\rho \) in \(\mathrm{{MeVfm}}^3\) versus the radial pressure \(p_r\) and tangential pressure \(p_t\) \(\mathrm{{MeVfm}}^3\), using the constants constrained by PSR J 1614-2230

Fig. 9
figure 9

Plot of the Mass function vs the radius r using the constants constrained by PSR J 1614-2230

Fig. 10
figure 10

Plot of the surface red-shift versus the radius r using the constants constrained by PSR J 1614-2230

The mass function given by Eq. (31) is plotted in Fig. 9 which shows that it is a monotonically increasing function of the radial coordinate and \(M(r=0) = 0\). Moreover, Fig. 9 shows the behavior of the compactness parameter of star which is increasing.

The radial variation of the surface red-shift is plotted in Fig. 10. Böhmer and Harko [72] constrained the surface red-shift to be \(Z\le 5\). The surface redshift of this model is calculated according to PSRJ1614-2230 and found to be 0.186927610.

Using Eqs. (26) and (32), it is possible to derive the Mass–Radius \((M-R)\) relation of the model for a given value of the surface density \((\rho (r = R) =1.5 \approx 10^{15} \frac{\mathrm{{g}}}{ \mathrm{{cm}}^3})\). In Fig. 11, it is reported considering also the compactness–radius relation. As Fig. 11c shows, our model has a maximum mass 3\(M_\circledcirc \) which is well beyond the recently reported values of 2.50–2.67\(M_\circledcirc \) recently reported by the LIGO collaboration [119]. This means that anomalous compact objects can be addressed in the framework of TEGR.

7 Stability of the model

In this section we are going to discuss the stability issue using two different techniques; the Tolman–Oppenheimer–Volkoff equations and the adiabatic index.

7.1 Equilibrium analysis through Tolman–Oppenheimer–Volkoff equation

In this subsection we are going to discuss the stability of the model. To this goal, we assume hydrostatic equilibrium through the Tolman–Oppenheimer–Volkoff  (TOV) equation. Using the TOV equation [120, 121] as that presented in [122], we get the following form

$$\begin{aligned}&\frac{2[p_t-p_r]}{r}-\frac{M_g(r)[\rho (r)+p_r]\sqrt{G}}{r\sqrt{H}}\nonumber \\&\quad -\frac{dp_r}{r}+\sigma E\sqrt{H}=0, \end{aligned}$$
(42)

with \(M_g(r)\) being the gravitational mass at radius r, as defined by the Tolman–Whittaker mass formula which gives

$$\begin{aligned} M_g(r)= & {} 4\pi {\int _0}^r\Big ({T_t}^t-{T_r}^r-{T_\theta }^\theta -{T_\phi }^\phi \Big )r^2\nonumber \\ \sqrt{GH}dr= & {} \frac{rG'\sqrt{H}}{2G}\,, \end{aligned}$$
(43)

Inserting Eq. (43) into (42), we get

$$\begin{aligned}&\frac{2(p_t-p_r)}{r}-\frac{dp_r}{dr}-\frac{G'[\rho (r)+p_r]}{2\sqrt{G}}\nonumber \\&\quad +\sigma E\sqrt{H}=F_g+F_a+F_h+F_e=0\,, \end{aligned}$$
(44)

where \(F_g=-\frac{G'[\rho (r)+p_r]}{2{G}}\), \(F_a=\frac{2(p_t-p_r)}{r}\), \(F_h=-\frac{dp_r}{dr}\) and \(F_e=\sigma E\sqrt{H}\) are the gravitational, the anisotropic, the hydrostatic and the electromagnetic forces respectively. The behavior of the TOV equation for the model (26) is shown in Fig. 12.

Fig. 11
figure 11

Plot of the mass–radius and compact–radius with/without electromagnetic field

The four different forces are plotted in Fig. 12. It shows that hydrostatics, anisotropic and electromagnetic forces are positive and dominated by the gravitational force which is negative to keep the system in static equilibrium.

7.2 Stability in the static state

It was shown by Harrison, Zeldovich and Novikov [113, 123] that, for stable compact stars, the gradient of central density, with regard to the mass increasing, must be positive, i.e., \(\frac{\partial M}{\partial \rho _{_{r_0}}}> 0\). If this condition is verified, we have stable configurations. Specifically, stable or unstable regions are separated when we have a constant mass i.e. \(\frac{\partial M}{\partial \rho _{r_0}}= 0\). Now we are going to apply this condition to our solution (26). For this purpose, we calculate the central density for solution (26) and get

$$\begin{aligned} \rho _{_{r_0}}=\frac{3}{2\pi k^2} \Rightarrow k=\pm \frac{\sqrt{3}}{ \pi \sqrt{2\rho _{_{r_0}}}}\,. \end{aligned}$$
(45)

Using Eq. (45) in Eq. (32), we get

$$\begin{aligned} M(\rho _{_{r_0}})=\frac{R^3(81R^2k_1{}^2+\pi [324 k_1R^2+540 \rho _{_{r_0}}-540\pi R^2\rho _{_{r_0}}{}^2+240\pi ^2R^4\rho _{_{r_0}}{}^3-40\pi ^3R^4\rho _{_{r_0}}{}^4])}{405} \,. \end{aligned}$$
(46)

With the help of Eq. (46), we have

$$\begin{aligned} \frac{\partial M}{\partial \rho _{_{r_0}}}=\frac{\pi R^3(540 -1080\pi R^2\rho _{_{r_0}}+720\pi ^2R^4\rho _{_{r_0}}{}^2-160\pi ^3R^6\rho _{_{r_0}}{}^3)}{405} \,.\nonumber \\ \end{aligned}$$
(47)

From Eq. (47), it is crear that solution (26) has a stable configuration since \(\frac{\partial M}{\partial \rho _{r_0}}> 0\). The behavior of (46) and (47) are show in Fig. 13. Figure 13 shows that mass increases as the energy density increases and the mass gradient decreases as energy density increases.

Fig. 12
figure 12

Plot of the gravitational, the anisotropic, the hydrostatic and the electromagnetic forces versus the radius r using the constants constrained from \(\textit{PSR J 1614-2230}\)

Fig. 13
figure 13

Static stability of (26) against \(\rho _{r_0}\) in \(\mathrm {km}^{-3}\) when \(b_0=b_2=0.0001, R=0.1\)

7.3 Adiabatic index

The stable equilibrium configuration of a spherically symmetric system can be studied using the adiabatic index which is a basic ingredient of the stability criterion. Let us consider an adiabatic perturbation, the adiabatic index \(\Gamma \), is defined as [124,125,126]

$$\begin{aligned} \Gamma =\left( \frac{\rho +p}{p}\right) \left( \frac{dp}{d\rho }\right) \,. \end{aligned}$$
(48)

A Newtonian isotropic sphere is in stable equilibrium if the adiabatic index \(\Gamma >\frac{4}{3}\) as reported in Heintzmann and Hillebrandth [52]. For \(\Gamma =\frac{4}{3}\), the isotropic sphere is in neutral equilibrium. Based on some works by Chan et al. [126], one can require the following condition for the stability of a relativistic anisotropic sphere \(\Gamma >\gamma \) where

$$\begin{aligned} \gamma =\frac{4}{3}-\left\{ \frac{4(p_r-p_t)}{3|p'_r|}\right\} _{max}\,. \end{aligned}$$
(49)

Using Eq. (49), we get

$$\begin{aligned} \Gamma= & {} \frac{4}{3}-\frac{2}{3}\Big [(c_2r^2+1)^2(4k_1{}^2k^8+6k^4-8r^2k^2+3r^4)\Big ]\nonumber \\&\times \Big [2(c_2r^2+1)^2k^8k_1{}^2+16k^6c_2\nonumber \\&-18c_2{}^2r^4k^4-36k^4c_2r^2+6k^4\nonumber \\&+16c_2r^4k^2-16k^2r^2+16c_2{}^2r^6k^2\nonumber \\&+2c_2r^6+9r^4-3c_2{}^2r^8+4c_2{}^2k^8\Big ]^{-1}. \end{aligned}$$
(50)
Fig. 14
figure 14

Plot of the adiabatic index versus the radius r using the constants constrained from PSR J 1614-2230

From Eq. (48), we obtain the adiabatic index of solution (26) in the form

$$\begin{aligned} \Gamma _r= & {} \Big \{4(k^2-r^2)^3(3+c_2[2r^2+k^2])\nonumber \\&\times \Big [2k^8(k_1{}^2\{1+c_2{}r^2\}^2+2c_2{}^2)\nonumber \\&+16c_2k^6+6k^4(1-3c_2r^2[2+c_2r^2])\nonumber \\&+16k^2r^2(c_2r^2-1+c_2{}^2r^4)-3c_2{}^2r^8 +2c_2r^6+9r^4\Big ]\Big \}\nonumber \\&\times \Big \{[1+c_2r^2]^2\Big [2k^8(k_1{}^2r^2\{1+c_2r^2\}-2c_2{}^2)\nonumber \\&+16c_2k^6r^2\nonumber \\&+6k^4r^2[1-3c_2r^2]+8k^2r^2(c_2r^2-1)+3r^6 -c_2r^8\Big ]\nonumber \\&\times [2k^8k_1{}^2-30k^4+56k^2r^2-27r^4]\Big \}\,, \nonumber \\ \Gamma _t= & {} \Big [4k^8(k_1{}^2r^2\{1+c_2{}r^2\}+c_2)\nonumber \\&+4k^6(3-c_2r^2)-6k^4r^2(5+c_2r^2)+4k^2r^2(3c_2r^4+7)\nonumber \\&-9r^6-5c_2r^8\Big ]\nonumber \\&\times \Big [k^8(k_1{}^2\{1+c_2r^2\}^2-2c_2{}^2)\nonumber \\&-8c_2k^6+12c_2r^2k^4[c_2r^2+2]\nonumber \\&-8k^2r^4c_2[2c_2r^2+3]+2c_2r^6(4+3r^2c_2)\Big ] \nonumber \\&\times \Big \{[1+c_2r^2]^2\Big [k^8(k_1{}^2r^2\{1+c_2r^2\}+2c_2{})\nonumber \\&-8c_2k^6r^2+12k^4r^4c_2-8k^2r^6c_2+2c_2r^8\Big ][2k^8k_1{}^2\nonumber \\&-30k^4+56k^2r^2-27r^4]\Big \}\,. \end{aligned}$$
(51)

In Fig. 14 we have reported \(\Gamma \), \(\Gamma _r\) and \(\Gamma _t\) respectively. As it is clear from these plots, it can be seen that the values of \(\Gamma _r\) and \(\Gamma _t\) are greater than \(\Gamma \) throughout the stellar interior and hence the stability condition is fulfilled.

Table 1 Values of model parameters
Table 2 Values of physical quantities

Besides PSR J 1614-2230, a similar analysis can be developed for other pulsars. In Tables 1 and 2, we report the results for other observed systems.

8 Discussion and conclusions

An important remark is in order at this point. It is well known that TEGR theory is equivalent to GR up to a total derivative term [127,128,129]. In this paper, we considered a combination of anisotropy and charge in TEGR equations. This situation gives rise to the effects of enhancing mass and modifying the \((M-R)\) relation of GR.

For a class of metric potentials and anisotropy functions, we derived an exact solution capable of figuring out realistic compact star configurations. The regularity conditions of the solution at the origin as well as at the surface of the star show a well behavior throughout the stellar structure. This is different from the results reported in [107] for GR. In that study, the authors show that pressure increases outward which is a non-physical situation. The difference between our results and those reported in [107] is due to the anisotropy given in Eq. (23), the presence of charge, and the non-vanishing of the radial pressure. In [107], they assumed a vanishing radial pressure. In our case, we showed that density, radial and tangential pressures behave regularly according to the observational data of the pulsar \(\textit{PSR J 1614}\)-2230, the first reported very massive neutron star, whose existence ruled out many EoS [102]. In order to explain such a system, exotic matter such as hyperons and kaon condensates, alternative theories of gravity and other hypotheses have been invoked (see e.g. [53,54,55]). The approach seems to work for other systems, as reported in Tables 1 and 2.

Furthermore, we show that the anisotropy has a positive value which can be interpreted as a repulsive force. This fact is because the tangential pressure is greater than the radial pressure, i.e., \(p_t>p_r \) [130]. The issue of stability is studied and we showed that the derived model is stable against the different forces (gravitational, hydrostatic, anisotropic and electromagnetic) acting on it. We also calculated the sound of speed and showed that it is consistent with realistic compact stars in contrast to the analogue charged models formulated in GR, where an imaginary sound speed is derived [107]. Finally we calculated the adiabatic index of our model and showed that also it represents a realistic physical star. It is worth noticing that the adiabatic index presented in [107] has a negative value which is not consistent with realistic stellar models. This indicates, in a clear way, that our assumption of the metric potential (21) and the anisotropy form (23) are physical assumptions that makes the resulting stellar model consistent with real stellar objects.

We tested the model over a wide range of reported observed values of masses and radii of pulsars (Tables 1, 2). The conclusion is that the fit is good also in these cases. Finally, we drew the mass–radius relation and showed the effect of electric field on it.

It is shown that the electric charge plays a central role in improving the results compared with the neutral case. Among these improvements, we have:

  1. i

    In the neutral case, one gets a maximum mass as \(2.788M_{\odot }\) while, in the charged case, the maximum mass becomes \(3M_{\odot }\).

  2. ii

    In the neutral case, one get an increasing radial pressure as reported in [107] while in the charged case, one gets a decreasing one which describes a consistent compact star.

  3. iii

    In the neutral star, one gets an imaginary sound speed [107] while, in the charged case, we get a real physical sound speed as shown in Fig. 5.

The approach can be summarized as follows: we used a non-diagonal form of the tetrad field that gives a null value of the torsion as soon as the metric potentials approach to 1. This is a necessary condition for any physical tetrad field as reported in various studies [93, 131,132,133,134,135,136,137].

We can conclude that the comparison of our exact solution with the physical parameters of pulsars gives indications that the model can realistically represent observed systems. Furthermore, the approach can be extended to a large class of metrics and anisotropies, if the above physical requirements are satisfied. However, a detailed confrontation with observational data is needed. This will be the argument of a forthcoming paper.