1 Introduction

Recently, compact stars, the most elemental objects of the galaxies, acquire much attention to the researchers to study their ages, structures and evolutions in cosmology as well as astrophysics. After the stellar death, the residue portion is formed as compact stars which can be classified into white dwarfs, neutron stars, strange stars and black holes. Compact star is very densed object i.e., posses massive mass and smaller radius as compared to the ordinary star. In astrophysics, the study of neutron star and the strange star motivates the researchers to explore their features and structures very much. Massive neutron star again collapses into black hole but lower mass neutron star converts into quark star. Basically, neutron star consists of neutrons whereas strange star is made up with quarks or strange matters. After the discovery of neutrons [1], the researchers have first imagined about the presence of neutron star. Then Hewish et al. [2] has confirmed this prediction by observation of pulsars (considered as rotating neutron stars later) like Her X-1, 4U \(1820-30\), RXJ \(1856-37\) and SAX J \(1808.4-3658\). In 1916, Karl Schwarzschild [3, 4] has first given the interior stellar solution which must be matched with the exterior solution. We have noticed for a long time that the isotropic fluid (having equal radial pressure (\(p_{r}\)) and transversal pressure (\(p_{t}\))) is considered in the core of the stellar objects to study stellar structure and stellar evolution. In 1972, Ruderman [5] for the first time observed that the interior geometry of the nuclear matter with a density of order \(10^{15} gm/cc\) posses anisotropic behavior (having \(p_{r}\ne p_{t}\)). This nature may come from different sources: the existence of solid core, in presence of type P superfluid, phase transition, rotation, magnetic field, mixture of two fluids, viscosity etc. Herrera et al. [6] have given a review to analyze local anisotropic nature for self gravitating systems. A stable structure of stellar objects has been found in the context of anisotropic nature by Hossein et al. [7]. Kalam et al. [8] have investigated anisotropic neutron star with quintessence dark energy. A new exact solution for compact star has been discovered by Paul et al. [9] to preserve the hydrostatic equilibrium. Many astrophysical phenomena of quark star and neutron star have been discussed in ref. [10, 11]. Rahaman et al. [12] have observed the existence of strange star using MIT bag model to study mass and redshift functions. Again, a stable anisotropic quintessence strange star model has been proposed by Bhar [13]. Murad [14] has also studied anisotropic charged strange star with MIT bag model to find out the radial pressure and energy density. A stability of strange star with the influence of anisotropic context using MIT bag model has been investigated by Arba\({\tilde{n}}\)il and Malheiro [15].

After publishing of Einstein’s General Relativity (GR) in 1915, our mysterious universe has been sketched more clearly to people. Recently, we have come to know from many observational evidences like Large Scale Structure (LSS), Cosmic Microwave Background (CMB) radiation etc. that our universe is expanding with acceleration which asserts that the cosmic expansion is going due to some peculiar source of energy having a massive negative pressure, known as Dark Energy (DE). Similarly, there exists also a mysterious component, known as Dark Matter (DM). A telescope is unable to detect dark matter but its gravitational effects on visible matter and gravitational lensing of the background radiation are giving us the evidence of its existence. On the other hand the Equation of State (EoS) of DE is given by \(w=p/\rho \) where w is called the EoS parameter lying in the range \(w<-1/3\). If \(-1<w<-1/3\) then it is referred as Quintessence DE and if \(w<-1\) then another peculiar DE viz., as Phantom DE producing Big Rip Singularity and violating Null Energy Condition (NEC) also. The phantom DE has been discussed in many references [16,17,18]. In particular, \(w=-1\) gives the EoS of “Gravastar”, gravitationally vacuum condense star [19,20,21,22,23,24].

However, GR is not sufficiently enough to describe our present universe from theoretical as well as physical point of view. So, we need an alternative theories to GR to present the scenario of DE and DM. We know from the references that if the torsion scalar T is instead of Ricci scalar R in Einstein-Hilbert action then the obtained equations of motion of this theory of gravity, known as Teleparallel Equivalent of General Relativity (TEGR) [25], are equivalent to those of GR. If generalization of GR is possible by inserting f(R) or f(T) instead of R or T respectively then our accelerating expansion of our universe can be explained where f(R) or f(T) are arbitrary nonlinear functions of R or T. It is seen that fourth order differential equations arrive in the case of f(R) gravity whereas f(T) gravity gives second order differential equations in the tetrad field like GR. So, the later approach is more convenient than the former one. In the background space-time, there has nonzero torsion with no curvature. According to Einstein, this is the definition of space-time to relate gravitation with tetrad and torsion. Many authors have revealed wide interest in [26,27,28,29,30,31,32,33,34,35,36,37,38].

In theoretical astrophysics, Dent [39] has derived the solution of BTZ black hole in f(T) version in 3-dimensions. Later, first violation of black hole thermodynamics in f(T) gravity has been seen through violation of Lorentz invariance [40]. For the existence of astrophysical stars in f(T) theory, the physical conditions have been investigated [41] with very much attention after acquiring a large group of static perfect fluid solutions [42]. Some static solutions for spherically symmetric case with charged source in f(T) theory has been obtained [43]. Capozziello et al. [44] have observed the removal of singularity of the exact black hole by f(T) gravity instead of f(R) gravity in D dimensions. Sharif and Rani [45] have studied wormhole under f(T) gravity. They have studied static wormhole solution in f(T) gravity to investigate energy conditions [46] and also proved that this solution exists by violating energy conditions for charged noncommutative wormhole [47, 48].

The study of anisotropic stars in the background of General Relativity (GR) and modified gravity has drawn much interest to many researchers [49,50,51,52,53,54]. Krori-Barua (KB) metric [55, 56] is the most useful metric to discuss the compact star models. Abbas and his collaborations [57,58,59,60,61] have also studied this type of stars in GR, f(R), f(G) and f(T) with the help of (KB) metric. Abbas et al. [60] have investigated anisotropic strange star taking \(p=\alpha \rho \) where \(0<\alpha <1\) which plays as a quintessence dark energy model. A study of strange star with MIT bag model in the framework of f(T) gravity has also been analyzed by Abbas et al. [62]. Recently, many authors have studied anisotropic stars in GR and different types of modified gravity with (KB) metric [63,64,65,66,67,68]. Saha and Debnath [69] have considered a metric where the unknown functions a(r) and b(r) have been taken some different from KB metric to investigate anisotropic stars in f(T) gravity with modified Chaplygin gas. This model also reveals as a quintessence dark energy model like the previous cases. In this work, our motivation is to explore anisotropic compact stars in the frame-work of f(T) gravity with diagonal tetrad in presence of electric field and quintessence field along transversal direction with modified Chaplygin gas by considering a metric like the previous work [69] where we take the general forms of a(r) and b(r) instead of particular forms. In Sect. 2, an introduction of f(T) gravity is given and we take anisotropic fluid with quintessence field along transversal direction. In Sect. 3, we investigate anisotropic compact star with electromagnetic field and quintessence field in f(T) gravity by taking modified Chaplygin gas. We calculate all physical quantities of our proposed model. In Sect. 4, we apply matching of two metrics to find out the unknown constants of our model. We observe the nature of our model by plotting some figures. Section 5 gives anisotropic behaviour. We make stability analysis and verify the energy conditions of our model. Again, we calculate the mass function, compactness and surface redshift function from our model to make comparison with observational data. In Sect. 6, we deliver the conclusions of the work.

2 An introduction of f(T) gravity, electromagnetic field and quintessence field

First we review the formulation of f(T) gravity in the concept of tetrad formalism. We assume the general form of space-time metric is in the form

$$\begin{aligned} ds^{2}=g_{\mu \nu }dx^{\mu }dx^{\nu }. \end{aligned}$$
(1)

In the tetrad formalism, the above metric can be written as

$$\begin{aligned} ds^{2}=\eta _{ij}\theta ^{i}\theta ^{j} \end{aligned}$$
(2)

where

$$\begin{aligned} dx^{\mu }=e^{\mu }_{i}\theta ^{i}~,~\eta _{ij}=diag[-1,1,1,1]~,~e^{\mu }_{i}e^{\nu }_{j}=\delta ^{\mu }_{\nu }. \end{aligned}$$
(3)

The non-vanishing Christoffel symbols are

$$\begin{aligned} \Gamma ^{\alpha }_{\mu \nu }=e^{\alpha }_{i}\partial _{\nu }e^{i}_{\mu }=-e^{i}_{\mu }\partial _{\nu }e^{\alpha }_{i}. \end{aligned}$$
(4)

The torsion and the con-torsion tensor can be defined as follows [62]:

$$\begin{aligned}&T_{\mu \nu }^{\alpha }=\Gamma _{\nu \mu }^{\alpha }-\Gamma _{\mu \nu }^{\alpha }=e_{i}^{\alpha }(\partial _{\mu }e_{\nu }^{i}-\partial _{\nu }e_{\mu }^{i}), \end{aligned}$$
(5)
$$\begin{aligned}&K_{\alpha }^{\mu \nu }=-\frac{1}{2}(T_{\alpha }^{\mu \nu }-T_{\alpha }^{\nu \mu }-T_{\alpha }^{\mu \nu }). \end{aligned}$$
(6)

The tensor \(S_{\alpha }^{\mu \nu }\) are defined as in the form

$$\begin{aligned} S_{\alpha }^{\mu \nu }=\frac{1}{2}(K_{\alpha }^{\mu \nu }+\delta _{\alpha }^{\mu }T_{\beta }^{\beta \nu }-\delta _{\alpha }^{\nu }T_{\beta }^{\beta \mu }). \end{aligned}$$
(7)

The torsion scalar is defined as follows

$$\begin{aligned} T=T_{\mu \nu }^{\alpha }S_{\alpha }^{\mu \nu }. \end{aligned}$$
(8)

Now, the modified teleparallel action is defined as follows [70, 71]

$$\begin{aligned} S=\int d^{4}xe\Big [\frac{1}{16\pi }f(T)+\textit{L}_{Matter}(\Phi _{A})\Big ] \end{aligned}$$
(9)

where \(G=c=1\) and \(\textit{L}_{Matter}(\Phi _{A})\) is the matter Lagrangian.

Now, we consider our model containing quintessence field and electromagnetic field along with anisotropic pressure. So, the Einstein equations can taken as

$$\begin{aligned} G_{\mu \nu }=8\pi G(T_{\mu \nu }^{Matter}+T_{\mu \nu }^{q}+T_{\mu \nu }^{EM}). \end{aligned}$$
(10)

Here, the ordinary matter corresponding to anisotropic fluid has energy-momentum tensor as

$$\begin{aligned} T_{\mu \nu }^{Matter}=(\rho +p_{t})u_{\mu }u_{\nu }-p_{t}g_{\mu \nu }+(p_{r}-p_{t})v_{\mu }v_{\nu } \end{aligned}$$
(11)

where \(u^{\mu }\) is the four-velocity and \(v^{\mu }\) radial four vector satisfying \(u_{\mu }u^{\mu }=1,~v_{\mu }v^{\mu }=-1\) and \(u_{\mu }v^{\mu }=0\). Here \(\rho \) the energy density, \(p_{r}\) is the radial pressure and \(p_{t}\) is transverse pressure. Also \(T_{\mu \nu }^{q}\) is the energy momentum tensor of quintessence field having energy density \(\rho _{q}\) and equation of state parameter \(w_{q}\) (\(-1<w_{q}<-1/3\)). According to Kiselev [72], the components of this tensor require to satisfy additivity and linearity. Taking different signatures as in line elements, the components are given by

$$\begin{aligned} T_{t}^{t}=T_{r}^{r}= & {} -\rho _{q}, \end{aligned}$$
(12)
$$\begin{aligned} T_{\theta }^{\theta }= & {} T_{\phi }^{\phi }=\frac{1}{2}(3w_{q}+1)\rho _{q}. \end{aligned}$$
(13)

Further, the energy momentum tensor for electromagnetic field is given by

$$\begin{aligned} E_{\mu \nu }^{EM}=\frac{1}{4\pi }(g^{\delta \omega }F_{\mu \delta }F_{\omega \nu }-\frac{1}{4}g_{\mu \nu }F_{\delta \omega }F^{\delta \omega }) \end{aligned}$$
(14)

where \(F_{\mu \nu }\) is the Maxwell field tensor defined as \(F_{\mu \nu }=\Phi _{\nu ,\mu }-\Phi _{\mu ,\nu }\) and \(\Phi _{\mu }\) is the four potential. The corresponding Maxwell electromagnetic field equations are

$$\begin{aligned} (\sqrt{-g}~F^{\mu \nu }),_{\nu }=4\pi J^{\mu }\sqrt{-g}~,~F_{[\mu \nu ,\delta ]}=0 \end{aligned}$$
(15)

where \(J^{\mu }\) is the current four-vector satisfying \(J^{\mu }=\sigma u^{\mu }\), the parameter \(\sigma \) is the charge density.

3 Anisotropic compact star with electromagnetic field and quintessence field in f(T) gravity

Let us assume the spherically symmetrical metric for the interior space-time solution as [73]

$$\begin{aligned} ds^{2}=-e^{a(r)}dt^{2}+e^{b(r)}dr^{2}+r^{2}(d\theta ^{2}+\sin ^{2}\theta d\phi ^{2}). \end{aligned}$$
(16)

Here, we take a(r) and b(r) in the following forms:

$$\begin{aligned} a(r)=Br^{\alpha }+Cr^{\beta }~~,~~b(r)=Ar^{\gamma } \end{aligned}$$
(17)

where A, B and C are arbitrary constants. Here, \(\alpha \ge 2\), \(\beta \ge 2\) and \(\gamma \ge 2\) are constants but \(\alpha \ne \beta \). For \(\alpha =2\), \(\beta =\gamma =3\), the unknown functions a(r) and b(r) reduce to the forms in which anisotropic quintessence star has been studied in [69]. For this metric, the torsion scalar T and its derivative are given as [62]

$$\begin{aligned} T(r)= & {} \frac{2e^{-b}}{r}\Big (a'+\frac{1}{r}\Big ), \end{aligned}$$
(18)
$$\begin{aligned} T'(r)= & {} \frac{2e^{-b}}{r}\Big \{a''-\frac{a'}{r}-b'\Big (a'+\frac{1}{r}\Big )-\frac{2}{r^{2}}\Big \} \end{aligned}$$
(19)

where the prime \('\) denotes the derivative with respect to the radial coordinate r.

Now, the equations of motion for anisotropic fluid along with quintessence field and magnetic field in the framework of f(T) gravity are as follows [62]:

$$\begin{aligned}&-\frac{e^{-b}}{r}T'f_{TT}+\frac{f}{2}-\Big \{T-\frac{1}{r^{2}}-\frac{e^{-b}}{r}(a'+b')\Big \}f_{T}\nonumber \\&\quad =8\pi (\rho +\rho _{q})+E^{2}, \end{aligned}$$
(20)
$$\begin{aligned}&(T-\frac{1}{r^{2}})f_{T}-\frac{f}{2}=8\pi (p_{r}-\rho _{q})-E^{2}, \end{aligned}$$
(21)
$$\begin{aligned}&e^{-b}\Big (\frac{a'}{2}+\frac{1}{r}\Big )T'f_{TT}\nonumber \\&\qquad +\Big [\frac{T}{2}+e^{-b}\Big \{\frac{a''}{2}+\Big (\frac{a'}{4}+\frac{1}{2r}\Big )(a'-b')\Big \}\Big ]f_{T}\nonumber \\&\qquad -\frac{f}{2}=8\pi \Big \{p_{t}+\frac{1}{2}(3w_{q}+1)\rho _{q}\Big \}+E^{2}, \end{aligned}$$
(22)
$$\begin{aligned}&\frac{e^{-\frac{b}{2}}\cot \theta }{2r^{2}}T'f_{TT}=0, \end{aligned}$$
(23)
$$\begin{aligned}&E(r)=\frac{1}{r^{2}}\int _{0}^{r}4\pi r^{2}\sigma (r)e^{\frac{b}{2}}dr=\frac{q(r)}{r^{2}} \end{aligned}$$
(24)

where q(r) is the total charge within a sphere of radius r.

Here, we take the total charge q(r) as in the power law form:

$$\begin{aligned} q(r)=q_{0}r^{m} \end{aligned}$$
(25)

where \(q_{0}>0\), \(m>0\). Here we consider the fluid source behaves as modified Chaplygin gas (MCG) whose equation of state is [74]

$$\begin{aligned} p_{r}=\xi \rho -\frac{\zeta }{\rho ^{\alpha '}} \end{aligned}$$
(26)

where \(\xi \), \(\alpha '\) and \(\zeta \) are free parameters of our model.

Now, solving equation (23) we get (assuming \(T'\ne 0\))

$$\begin{aligned} f(T)=\beta _{1}T+\beta _{2}, \end{aligned}$$
(27)

where \(\beta _{1}\) and \(\beta _{2}\) being integration constants and we assume \(\beta _{2}=0\) for simple case.

Now from equations (14), (15), (17), (18), (22) and (23) (taking \(\alpha '=1\)) we obtain the equation in \(\rho \):

$$\begin{aligned}&8\pi r^{2}\rho ^{2}(1+\xi )-\beta _{1}e^{-Ar^{\gamma }}\rho (\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })\nonumber \\&\quad -8\pi r^{2}\zeta =0. \end{aligned}$$
(28)

Solving this equation, we get the value of energy density as

$$\begin{aligned} \rho =\frac{\beta _{1}e^{-Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })+\sqrt{\beta _{1}^{2}e^{-2Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })^{2}+256\pi ^{2}r^{4}\zeta (1+\xi )}}{16\pi r^{2}(1+\xi )}. \end{aligned}$$
(29)

Then we found the expressions of the radial pressure, transverse pressure and density for quintessence field as

$$\begin{aligned} p_{r}= & {} \frac{\xi \beta _{1}e^{-Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })+\xi \sqrt{\beta _{1}^{2}e^{-2Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })^{2}+256\pi ^{2}r^{4}\zeta (1+\xi )}}{16\pi r^{2}(1+\xi )} \nonumber \\&-\frac{16\pi \zeta r^{2}(1+\xi )}{\beta _{1}e^{-Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })+\sqrt{\beta _{1}^{2}e^{-2Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })^{2}+256\pi ^{2}r^{4}\zeta (1+\xi )}}. \end{aligned}$$
(30)
$$\begin{aligned} p_{t}= & {} \frac{1}{8\pi }\left[ \beta _{1}e^{-Ar^{\gamma }}\left\{ \frac{1}{2}(\alpha (\alpha -1)Br^{\alpha -2}+\beta (\beta -1)Cr^{\beta -2}) +\frac{1}{4}(\alpha Br^{\alpha -1}+\beta Cr^{\beta -1})(\alpha Br^{\alpha -1}+\beta Cr^{\beta -1}\right. \right. \nonumber \\&\left. \left. -\gamma Ar^{\gamma -1}){+}\frac{1}{2}(\alpha Br^{\alpha -2}{+}\beta Cr^{\beta -2}{-}\gamma Ar^{\gamma -2})\right\} {-}\frac{\beta _{2}}{2}{-}\frac{q^{2}}{r^{4}}\right] {-}\frac{1}{2}(3w_{q}+1)\frac{1}{8\pi }\left\{ \frac{\beta _{1}e^{-Ar^{\gamma }}}{r^{2}}(\gamma Ar^{\gamma }-1){+}\frac{\beta _{1}}{r^{2}}{+}\frac{\beta _{2}}{2} \right. \nonumber \\&\left. -\frac{q^{2}}{r^{4}}\right\} -\frac{\beta _{1}e^{-Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })+\sqrt{\beta _{1}^{2}e^{-2Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })^{2}+256\pi ^{2}r^{4}\zeta (1+\xi )}}{16\pi r^{2}(1+\xi )}. \end{aligned}$$
(31)
$$\begin{aligned} \rho _{q}= & {} \frac{1}{8\pi }\Big \{\frac{\beta _{1}e^{-Ar^{\gamma }}}{r^{2}}(\gamma Ar^{\gamma }-1)+\frac{\beta _{1}}{r^{2}}+\frac{\beta _{2}}{2}-\frac{q^{2}}{r^{4}}\Big \}\nonumber \\&-\frac{\beta _{1}e^{-Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })}{16\pi r^{2}(1+\xi )} \nonumber \\&+\frac{\sqrt{\beta _{1}^{2}e^{-2Ar^{\gamma }}(\alpha Br^{\alpha }{+}\beta Cr^{\beta }{+}\gamma Ar^{\gamma })^{2}{+}256\pi ^{2}r^{4}\zeta (1{+}\xi )}}{16\pi r^{2}(1{+}\xi )}.\nonumber \\ \end{aligned}$$
(32)

The equation of state parameters \(w_{r}\) and \(w_{t}\) along radial and transversal directions of our model are given by

$$\begin{aligned}&w_{r}=\frac{p_{r}}{\rho }=\xi {-}\left\{ \frac{16\pi \zeta r^{2}(1{+}\xi )}{\beta _{1}e^{{-}Ar^{\gamma }}(\alpha Br^{\alpha }{+}\beta Cr^{\beta }{+}\gamma Ar^{\gamma }){+}\sqrt{\beta _{1}^{2}e^{{-}2Ar^{\gamma }}(\alpha Br^{\alpha }{+}\beta Cr^{\beta }{+}\gamma Ar^{\gamma })^{2}{+}256\pi ^{2}r^{4}\zeta (1{+}\xi )}}\right\} ^{2}\qquad \qquad \qquad \end{aligned}$$
(33)

and

$$\begin{aligned} w_{t}=\frac{p_{t}}{\rho } \end{aligned}$$
(34)

where \(p_{t}\) and \(\rho \) are given by equations (31) and (29).

The above solutions are viable if \(\xi \ne -1\).

4 Matching conditions

By matching condition, many researchers have compared the exterior solution with the interior solution [24, 58, 60, 62]. We make correspondence between our interior solution and the exterior solution evoked by Reissner-Nordstrm metric whose line element is

$$\begin{aligned} ds^{2}= & {} -\Big (1-\frac{2M}{r}+\frac{Q^{2}}{r^{2}}\Big )dt^{2}+\Big (1-\frac{2M}{r}+\frac{Q^{2}}{r^{2}}\Big )^{-1}dr^{2}\nonumber \\&+r^{2}(d\theta ^{2}+\sin ^{2}\theta d\phi ^{2}). \end{aligned}$$
(35)

where m, r and Q are mass, radius and charge respectively. We assume the boundary of interior and exterior regions occurs at \(r{=}R\). So on the boundary, we have \(m(r){=}M\) and

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

where − and \(+\) indicate to interior and exterior solutions. Now, using (36) and the metrics (16), (35), we can obtain

$$\begin{aligned} \left. \begin{array}{ll} A={-}\frac{1}{R^{\gamma }}\ln \Big (1{-}\frac{2M}{R}{+}\frac{Q^{2}}{R^{2}}\Big ),\\ B=\frac{1}{R^{\alpha }(\alpha {-}\beta )}\Big [{-}\beta \ln \Big (1{-}\frac{2M}{R}{+}\frac{Q^{2}}{R^{2}}\Big ){+}2\Big (\frac{M}{R}{-}\frac{Q^{2}}{R^{2}}\Big )\Big (1{-}\frac{2M}{R}{+}\frac{Q^{2}}{R^{2}}\Big )^{{-}1}\Big ],\\ C=\frac{1}{R^{\beta }(\alpha {-}\beta )}\Big [\alpha \ln \Big (1{-}\frac{2M}{R}{+}\frac{Q^{2}}{R^{2}}\Big ){-}2\Big (\frac{M}{R}{-}\frac{Q^{2}}{R^{2}}\Big )\Big (1{-}\frac{2M}{R}{+}\frac{Q^{2}}{R^{2}}\Big )^{{-}1}\Big ] \end{array} \right\} \nonumber \\ \end{aligned}$$
(37)

We consider three different compact stars as Vela X-1 (CS1), SAXJ1808.4-3658 (CS2) and 4U1820-30 (CS3) with their masses and radii in Table 1. With respect to Table 1, we take three sets of values of \(\alpha \), \(\beta \) and \(\gamma \) to get three different sets of numerical values of A, B and C for CS1, CS2 and CS3 in Tables 2, 3, 4 respectively.

Table 1 Different compact stars are taken with their masses and radii
Table 2 The values of A, B and C have been obtained with \(\alpha =2\), \(\beta =\gamma =3\) from Table 1 using equation (37)
Table 3 The values of A, B and C have been obtained with \(\alpha =3\), \(\beta =2\) and \(\gamma =4\) from Table 1 using equation (37)
Table 4 The values of A, B and C have been obtained with \(\alpha =4\), \(\beta =2\) and \(\gamma =3\) from Table 1 using equation (37)
Fig. 1
figure 1

Variations of energy density \(\rho \) (\(MeV/fm^{3}\)) versus r (km) with the numerical values of A, B and C from Tables 2, 3 and 4 respectively

Fig. 2
figure 2

Variations of radial pressure \(p_{r}\) (\(MeV/fm^{3}\)) versus r (km) with the numerical values of A, B and C from Tables 2, 3 and 4 respectively

Fig. 3
figure 3

Variations of \(\rho +3p_{r}\) (\(MeV/fm^{3}\)) versus r (km) with the numerical values of A, B and C from Tables 2, 3 and 4 respectively

Fig. 4
figure 4

Variations of \(\rho _{q}\) (\(MeV/fm^{3}\)) versus r (km) with the numerical values of A, B and C from Tables 2, 3 and 4 respectively

Fig. 5
figure 5

Variations of transversal pressure \(p_{t}\) (\(MeV/fm^{3}\)) versus r (km) with the numerical values of A, B and C from Tables 2, 3 and 4 respectively

Now we have drawn different figures for physical quantities \(\rho \), \(p_{r}\), \(\rho +3p_{r}\), \(\rho _{q}\) and \(p_{t}\) using Eqs.  (29)–(32) with the values of different values of A, B and C taking from Tables 2, 3, 4. Figs. 1, 2, 3 ensure that our proposed model is a candidate of dark energy as \(\rho >0, \rho +3p_{r}<0\) i.e., \(w_{r}<-\frac{1}{3}\) (See equation (33)). Again, from Fig. 3, we can conclude that our model corresponds to quintessence dark energy model, not phantom dark energy candidate due to \(\rho +3p_{r}<0\) i.e., \(w_{r}<-\frac{1}{3}\) and \(\rho +p_{r}>0\) i.e., \(w_{r}>-1\) (See Figs. 10, 11, 12). We have taken quintessence field in transverse direction of anisotropic compact star in f(T) gravity with modified Chaplygin gas. So, Figs. 4, 5 indicate that for quintessence field \(\rho _{q}>0\) and \(p_{t}<0\).

5 Physical analysis

The central density \(\rho _{0}\) and central radial pressure \(p_{0}\) are given by

$$\begin{aligned}&\rho _{0}=\lim _{r\rightarrow 0}\rho = \left\{ \begin{array}{ll} \frac{B\beta _{1}+\sqrt{B^{2}\beta _{1}^{2}+64\pi ^{2}\zeta (1+\xi )}}{8\pi (1+\xi )}~~~~~~~~~\hbox {when}~~\alpha =2,~\beta =\gamma =3,\\ \frac{C\beta _{1}+\sqrt{C^{2}\beta _{1}^{2}+64\pi ^{2}\zeta (1+\xi )}}{8\pi (1+\xi )}~~~~~~~~~\hbox {when}~~\alpha =3,~\beta =2,~\gamma =4~~\hbox {or}~~\alpha =4,~\beta =2,~\gamma =3\\ \end{array} \right. \\&p_{0}=\lim _{r\rightarrow 0}p_{r} = \left\{ \begin{array}{ll} \frac{-32\pi ^{2}\zeta (1+\xi )+B\beta _{1}\xi \{B\beta _{1}+\sqrt{B^{2}\beta _{1}^{2}+64\pi ^{2}\zeta (1+\xi )}\}}{4\pi (1+\xi )\{B\beta _{1}+\sqrt{B^{2}\beta _{1}^{2}+64\pi ^{2}\zeta (1+\xi )}\}}~~~~~~~~~\hbox {when}~~\alpha =2,~\beta =\gamma =3,\\ \frac{-32\pi ^{2}\zeta (1+\xi )+C\beta _{1}\xi \{C\beta _{1}+\sqrt{C^{2}\beta _{1}^{2}+64\pi ^{2}\zeta (1+\xi )}\}}{4\pi (1+\xi )\{C\beta _{1}+\sqrt{C^{2}\beta _{1}^{2}+64\pi ^{2}\zeta (1+\xi )}\}}~~~~~~~~~\hbox {when}~~\alpha =3,~\beta =2,~\gamma =4,\\ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\hbox {or}~~\alpha =4,~\beta =2,~\gamma =3.\\ \end{array} \right. \end{aligned}$$

In the following subsections, we investigate the nature of the anisotropic compact star as follows:

5.1 Anisotropic effects

The anisotropic force (\(\Delta =\frac{2(p_{t}-p_{r})}{r}\)) of our anisotropic quintessence compact object is

$$\begin{aligned} \Delta= & {} \frac{1}{8\pi r}\left[ \beta _{1}e^{-Ar^{\gamma }}\left\{ \frac{1}{2}(\alpha (\alpha -1)Br^{\alpha -2}+\beta (\beta -1)Cr^{\beta -2}) +\frac{1}{4}(\alpha Br^{\alpha -1}+\beta Cr^{\beta -1})(\alpha Br^{\alpha -1}+\beta Cr^{\beta -1}-\gamma Ar^{\gamma -1})\right. \right. \nonumber \\&\left. \left. +\frac{1}{2}(\alpha Br^{\alpha -2}+\beta Cr^{\beta -2}-\gamma Ar^{\gamma -2})\right\} -\frac{\beta _{2}}{2}-\frac{q^{2}}{r^{4}}\right] -\frac{1}{2}(3w_{q}+1)\frac{1}{8\pi r}\left\{ \frac{\beta _{1}e^{-Ar^{\gamma }}}{r^{2}}(\gamma Ar^{\gamma }-1) +\frac{\beta _{1}}{r^{2}}+\frac{\beta _{2}}{2}-\frac{q^{2}}{r^{4}}\right\} \nonumber \\&-\frac{\beta _{1}e^{-Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })+\sqrt{\beta _{1}^{2}e^{-2Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })^{2}+256\pi ^{2}r^{4}\zeta (1+\xi )}}{16\pi r^{3}} \nonumber \\&-\frac{16\pi \zeta r(1+\xi )}{\beta _{1}e^{-Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })+\sqrt{\beta _{1}^{2}e^{-2Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })^{2}+256\pi ^{2}r^{4}\zeta (1+\xi )}}. \end{aligned}$$
(38)
Fig. 6
figure 6

Variations of \(\Delta \) versus r (km) with the numerical values of A, B and C from Tables 2, 3 and 4 respectively

Fig. 7
figure 7

Variations of derivatives of \(\frac{d\rho }{dr}\), \(\frac{dp_{r}}{dr}\), \(\frac{d^{2}\rho }{dr^{2}}\) and \(\frac{d^{2}p_{r}}{dr^{2}}\) with respect to r (km) with the numerical values of A, B and C from Table 2

From Fig. 6, we have noticed that \(\Delta \) is always negative i.e., \(p_{t}<p_{r}\) for three compact stars (CS1, CS2, CS3) which implies that the anisotropic force is attractive like quintessence field. Since, our model consists of ordinary matter and quintessence field so the effective anisotropic force is attractive and that is why our model is very much compatible.

Now, we take derivatives of energy density and radial pressure with respect to radius to see where the energy density and radial pressure achieve their maximum values. With respect to three Tables 2, 3 and 4, if we make \(\frac{d\rho }{dr}=0\) and \(\frac{dp_{r}}{dr}=0\) then

From Data of Table 1:

\(\frac{d^{2}\rho }{dr^{2}}<0\) and \(\frac{d^{2}p_{r}}{dr^{2}}<0\) at \(r=10.11\) for CS1 model, at \(r=7.31\) for CS2 model and at \(r=9.9\) for CS3 model respectively. So, the energy density and radial pressure take maximum values at \(r=10.11\) for CS1 model, at \(r=7.31\) for CS2 model and at \(r=9.9\) for CS3 model respectively.

From Data of Table 2:

\(\frac{d^{2}\rho }{dr^{2}}<0\) and \(\frac{d^{2}p_{r}}{dr^{2}}<0\) at \(r=8.29\) for CS1 model, at \(r=7.06\) for CS2 model and at \(r=9.63\) for CS3 model respectively. So, the energy density and radial pressure take maximum values at \(r=8.29\) for CS1 model, at \(r=7.06\) for CS2 model and at \(r=9.63\) for CS3 model respectively.

Fig. 8
figure 8

Variations of derivatives of \(\frac{d\rho }{dr}\), \(\frac{dp_{r}}{dr}\), \(\frac{d^{2}\rho }{dr^{2}}\) and \(\frac{d^{2}p_{r}}{dr^{2}}\) with respect to r (km) with the numerical values of A, B and C from Table 3

From Data of Table 3:

\(\frac{d^{2}\rho }{dr^{2}}<0\) and \(\frac{d^{2}p_{r}}{dr^{2}}<0\) at \(r=10.66\) for CS1 model, at \(r=7.69\) for CS2 model and at \(r=10.38\) for CS3 model respectively. So, the energy density and radial pressure take maximum values at \(r=10.66\) for CS1 model, at \(r=7.69\) for CS2 model and at \(r=10.38\) for CS3 model respectively.

Fig. 9
figure 9

Variations of derivatives of \(\frac{d\rho }{dr}\), \(\frac{dp_{r}}{dr}\), \(\frac{d^{2}\rho }{dr^{2}}\) and \(\frac{d^{2}p_{r}}{dr^{2}}\) with respect to r (km) with the numerical values of A, B and C from Table 4

Fig. 10
figure 10

Variations of energy conditions versus r (km) with the numerical values of A, B and C from Table 2

However, we conclude for Table 2: with respect to Fig. 7, \(\frac{d\rho }{dr}>0\) always, so the energy density is increasing and \(\frac{dp_{r}}{dr}\) is positive at first then changes its sign to negative, so the radial pressure is increasing first and then decreases; Table 3: with respect to Fig. 8, \(\frac{d\rho }{dr}\) and \(\frac{dp_{r}}{dr}\) both are positive from beginning then turn to negative sign, so consequently, the energy density and the radial pressure both are increasing first and then decrease; Table 4: with respect to Fig. 9, \(\frac{d\rho }{dr}\) and \(\frac{dp_{r}}{dr}\) both are positive from beginning then turn to negative sign like the previous case, so the energy density and the radial pressure both are also increasing first and then decrease in this case.

5.2 Energy conditions

The most crucial physical properties are energy conditions to verify the existence of realistic matter distribution in this stellar model. These energy conditions are divided into three parts: Null Energy Condition (NEC), Weak Energy Condition (WEC) and Strong Energy Condition (SEC). These are very useful in general relativity and modified gravity [24, 59, 62]. The energy conditions are:

$$\begin{aligned} \begin{array}{ll} \mathbf{NEC }: \rho +\frac{E^{2}}{8\pi }\ge 0,\\ \mathbf{WEC }: \rho +p_{r}\ge 0, \rho +p_{t}+\frac{E^{2}}{4\pi }\ge 0,\\ \mathbf{SEC }: \rho +p_{r}+2p_{t}+\frac{E^{2}}{4\pi }\ge 0.\\ \end{array} \end{aligned}$$
Fig. 11
figure 11

Variations of energy conditions versus r (km) with the numerical values of A, B and C from Table 3

Fig. 12
figure 12

Variations of energy conditions versus r (km) with the numerical values of A, B and C from Table 4

Fig. 13
figure 13

Variations of \(v_{sr}^{2}\) versus r (km) with the numerical values of A, B and C from Tables 2, 3 and 4 respectively

Fig. 14
figure 14

Variations of \(v_{st}^{2}\) versus r (km) with the numerical values of A, B and C from Tables 2, 3 and 4 respectively

Fig. 15
figure 15

Variations of \(v_{st}^{2}-v_{sr}^{2}\) versus r (km) with the numerical values of A, B and C from Tables 2, 3 and 4 respectively

Fig. 16
figure 16

Variations of \(|v_{st}^{2}-v_{sr}^{2}|\) versus r (km) with the numerical values of A, B and C from Tables 2, 3 and 4 respectively

Fig. 17
figure 17

Variations of \(\Gamma \) versus r (km) with the numerical values of A, B and C from Tables 2, 3 and 4 respectively

Table 5 Calculated values of mass, energy density and pressure of our model from Table 2
Table 6 Calculated values of mass, energy density and pressure of our model from Table 3
Table 7 Calculated values of mass, energy density and pressure of our model from Table 4

From Figs. 10, 11, 12, we can conclude that our model satisfies first two conditions for arbitrary values of parameters but the last condition is satisfied only when \(\beta _{2}<0\).

5.3 Stability analysis

To analyze stability of stellar structure against external fluctuation plays an essential key role for any physically consistent model. According to Herrera’s cracking condition [24, 59, 62, 75], the sound speed square (\(v_{s}^{2}=dp/d\rho \)) must lie in the interval [0, 1] to be a physically stable stellar object. For our anisotropic quintessence compact star model, we have \(0\le v_{sr}^{2}\le 1\) and \(0\le v_{st}^{2}\le 1\) always (See Figs. 13, 14) where \(v_{sr}^{2}\) and \(v_{st}^{2}\) are sound speeds for radial and transversal components.

Next, we calculate the difference of two speeds of our model to examine whether transversal sound speed square is greater than the radial one or not. Actually, Herrera’s cracking condition [75] has prospected a different way to find out the potentially stable or unstable model. If the radial sound speed square is greater than the transversal sound speed square then the model is potentially stable otherwise it is potentially unstable. From Fig. 15, we can decide that our model is potentially stable. Clearly, \(|v_{st}^{2}-v_{sr}^{2}|\le 1\) is verified [76] from Fig. 16.

We can check stability of our proposed model by adiabatic index [77,78,79,80] which depicts the stiffness of the EoS parameter for our model. By this theory, many researchers have examined the dynamical stability against infinitesimal radial perturbation of the realistic as well as non-realistic stellar objects. For anisotropic fluid, the adiabatic index is defined as

$$\begin{aligned} \Gamma =\Big (1+\frac{\rho }{p_{r}}\Big )\frac{dp_{r}}{d\rho }. \end{aligned}$$

According to [77], the evaluated value of this adiabatic index should be greater than 4 / 3. Fig. 17 ensures that our proposed model satisfies this condition i.e., our anisotropic quintessence compact star model in f(T) gravity with modified Chaplygin gas maintains stability range also.

5.4 Effective mass and compactness

According to [24], the mass function within the radius r is defined by

$$\begin{aligned}&m(r)=\int _{0}^{r} 4\pi r^{2}\rho dr\nonumber \\&\quad =\frac{1}{4(1+\xi )}\int _{0}^{r}\Big [\beta _{1}e^{-Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })\nonumber \\&\qquad {+}\sqrt{\beta _{1}^{2}e^{-2Ar^{\gamma }}(\alpha Br^{\alpha }{+}\beta Cr^{\beta }{+}\gamma Ar^{\gamma })^{2}{+}256\pi ^{2}r^{4}\zeta (1{+}\xi )}\Big ]dr.\nonumber \\ \end{aligned}$$
(39)

Now, we draw the mass functions with respect to radius from the numerical values of Tables 2, 3 and 4 respectively. As \(r\rightarrow 0\), \(m(r)\rightarrow 0\) in Fig. 17 for three different compact stars so we can conclude that the mass function is regular at origin. We also notice that the mass function is monotonic increasing with respect to radius.

Table 8 Calculated values of the desired parameters of our model from Table 2
Table 9 Calculated values of the desired parameters of our model from Table 3
Table 10 Calculated values of the desired parameters of our model from Table 4
Fig. 18
figure 18

Variations of m(r) versus r (km) with the numerical values of A, B and C from Tables 1, 2 and 3 respectively

Again, the form of compactness of the star is defined by u(r) [24]

$$\begin{aligned} u(r)&=\frac{m(r)}{r}\nonumber \\&\quad =\frac{1}{4(1+\xi )r}\int _{0}^{r}\Big [\beta _{1}e^{-Ar^{\gamma }}(\alpha Br^{\alpha }+\beta Cr^{\beta }+\gamma Ar^{\gamma })\nonumber \\&\qquad +\sqrt{\beta _{1}^{2}e^{-2Ar^{\gamma }}(\alpha Br^{\alpha }{+}\beta Cr^{\beta }{+}\gamma Ar^{\gamma })^{2}{+}256\pi ^{2}r^{4}\zeta (1{+}\xi )}\Big ]dr.\nonumber \\ \end{aligned}$$
(40)

Now, we evaluate the values of mass, central energy density, central radial pressure and radial pressure at the boundary for the different three compact stars from our model to compare with observational data (See Tables 5, 6, 7).

5.5 Relation between mass and radius

In this section, we study the relation between mass and radius for three different compact stars to check whether all data are lying in the desired range or not. The factor “M / R” is called compactification factor. We conclude from Tables 8, 9, 10 that it lies between 1 / 4 and 1 / 2 [81]. According to [82], twice of the compactification factor (2M / R) takes maximum allowed value 8 / 9 for our model (See Tables 8, 9, 10).

5.6 Surface redshift

The redshift function is defined as [24, 59, 62]

$$\begin{aligned} z_{s}=\frac{1}{\sqrt{1-\frac{2m(r)}{r}}}-1. \end{aligned}$$
(41)

We calculate the values of redshift for CS1, CS2 and CS3 in Tables 8, 9, 10. According to Bohmer and Harko [83], the surface redshift can be arbitrarily large, it must be less than \(\le 5\) for an anisotropic star in the appearance of a cosmological constant. Though our model does not contain cosmological constant but the maximum surface redshift from our model is always \(\le 5\) (See Tables 8, 9, 10 and Fig. 20). So, our anisotropic quintessence compact star model is quite reasonable.

6 Conclusions

This work has given out the quintessence dark energy behavior of the anisotropic compact star model in f(T) gravity with modified Chaplygin gas consisting of ordinary matter together with quintessence field along tangential component. Using the diagonal tetrad field we have obtained the equations of motion by taking of quintessence field and electromagnetic field with respect to spherically symmetric metric. We have taken the forms of a(r) and b(r) as \(a(r)=Br^{\alpha }+Cr^{\beta }\) and \(b(r)=Ar^{\gamma }\) where we have chosen three sets values of these parameters i.e., \(\alpha =2, \beta =\gamma =3\); \(\alpha =3, \beta =2, \gamma =4\) and \(\alpha =4, \beta =2, \gamma =3\). Here, we have assumed the total charge in the form \(q(r)=q_{0}r^{m}\). Next, we have solved all of these equations to get \(\rho \), \(p_{r}\), \(\rho _{q}\) and \(p_{t}\) in terms of r and some constants. Using matching condition, we have evaluated the values of A, B and C in Tables 2, 3, 4 with respect to Table 1 for those three cases of the parameters \(\alpha \), \(\beta \) and \(\gamma \). By these values of constants we have plotted the figures for the above mentioned physical quantities for CS1, CS2 and CS3 (See Figs. 1, 2, 3, 4, 5). From these figures we can conclude that our model corresponds to quintessence dark energy model as energy density (\(\rho \)) is positive, radial pressure (\(p_{r}\)) is highly negative, \(\rho +3p_{r}<0\), energy density corresponding to quintessence field (\(\rho _{q}\)) is positive and transversal pressure (\(p_{t}\)) is negative due to considering quintessence field along tangential component of our model. Anisotropic force has been calculated to see whether this is positive or negative. From Fig. 6, we can say that \(\Delta <0\) always for CS1, CS2 and CS3 i.e., there exists attractive force like quintessence field to ensure our model to be realistic. Next, we have also noticed from Figs. 7, 8, 9 that the both the energy density (\(\rho \)) and radial pressure (\(p_{r}\)) are monotonic increasing in some region and monotonic decreasing in some places with respect to r and they attain various maximum values for CS1, CS2 and CS3 with respect to three sets values of \(\alpha , \beta , \gamma \).

Fig. 19
figure 19

Variations of u(r) versus r (km) with the numerical values of A, B and C from Tables 2, 3 and 4 respectively

Fig. 20
figure 20

Variations of \(z_{s}\) versus r (km) with the numerical values of A, B and C from Tables 2, 3 and 4 respectively

From Figs. 10, 11, 12, we have noticed that all energy conditions except SEC are satisfied for all values of parameters for our proposed model. The last condition is satisfied only for \(\beta _{2}<0\). By stability analysis given on the basic of Figs. 13, 14, 15, 16, 17, we have seen that \(0<v_{sr}^{2},v_{st}^{2}\le 1\), \(v_{sr}^{2}>v_{st}^{2}\), \(|v_{st}^{2}-v_{sr}^{2}|\le 1\) and \(\Gamma >4/3\) for all of three cases. So, we can guarantee that our model is potentially stable.

In Tables 5, 6, 7, we have evaluated numerical values of masses of CS1, CS2 and CS3 for our model using equation (37) to manifest the closeness with the observational data. Also, we have calculated the corresponding values of central and surface density and central pressure in these tables. Due to Fig. 18, masses of these stars are tending to zero when \(r\rightarrow 0\). From Tables 8, 9, 10, we have calculated the compactification factor (\(u_{r}\)) using Eq.  (34) and observed that the twice of compactification factor is always less than \(<\frac{8}{9}\). We have plotted the figure of u(r) in Fig. 19 which tells that \(u(r)\rightarrow 0\) when \(r\rightarrow 0\). In these tables, using Eq. (35), we have also calculated the numerical values of surface redshift and have drawn figure in Fig. 20. From both calculation and figure, we have maximum values of the surface redshift function which is always less than 5. So, our proposed anisotropic compact stars model in f(T) gravity with quintessence field and modified Chaplygin gas is completely rational.