1 Introduction

The word complexity refers to a factor that includes all the terms inducing complications in a system. Many attempts have been dedicated towards a precise definition of complexity in various sectors of science [1,2,3,4,5,6,7,8,9,10,11]. However, an exact definition of complexity has not been obtained till now which defines it in every field accumulatively. It may be noted that the definition of complexity depends on the work established by Lopez-Ruiz et al. [7,8,9]. In view of different proposed definitions of complexity, it is related to the idea of information and entropy that describe the structure of the system.

In physics [7], the term complexity begins by examining the perfect crystal which has a periodic behavior and the isolated ideal gas with a random behavior. A perfect crystal is a completely ordered system of atoms that are arranged in a symmetric manner. A small segment of information is sufficient to define the perfect crystal which gives minimum information in the crystal. On the other hand, the isolated gas is totally disordered and all the segments have equal participation to give information related to the ideal gas such that it has a maximum information. These systems are examples of elementary models with zero complexity.

The definition of complexity should also include some other factors beyond information or order. Lopez-Ruiz et al. [7] proposed the abstract idea of disequilibrium which determines distance of the probable distribution in the system of accessible state. Thus disequilibrium should be maximum in case of perfect crystal and it should be zero for the ideal gas. Consequently, disequilibrium and information are introduced to describe the complexity by a quantity that is a result of these two notions.

The definition of disequilibrium and information which include probability distribution is redefined in [12,13,14,15,16,17] by the term energy density in the fluid distribution. However, the term energy density is not enough to describe the phenomenon of complexity because the pressure is absent which appears in the energy-momentum tensor and plays a vital role in the structure formation of the fluid distribution.

In literature [12,13,14,15,16,17], the idea of complexity has also been applied to the self-gravitating systems like neutron stars and white dwarfs. Recently, Herrera [18] introduced a quite different definition of complexity for a self-gravitating system. This definition is related to the notion of structure of the spherical system but is not related to disequilibrium or information. He used the notion of Tolman mass which may be considered the active gravitational mass for the fluid distribution. This mass depends on the inhomogeneity of the energy density along with anisotropy of the pressure. These two terms represent a single scalar function which is a complexity factor. This vanishes when the pressure is isotropic and energy density is homogenous and may also vanish when the two notions namely, inhomogeneous energy density and anisotropic pressure cancel each other. The variable which is responsible for a complexity factor appears in the structure scalars obtained from the orthogonal splitting of the Riemann tensor.

In literature, the study of charge in spherically symmetric self-gravitating system started with the pioneer work of Rosseland and Eddington [19]. Bonnor [20] examined the impact of charge on spherical collapse of dust cloud and concluded that the process of collapse slows down due to electric repulsion. Ray et al. [21] investigated the role of charge on compact stars and found that \(10^{20}\) Coulomb charge is present in the astrophysical objects producing an electric field of \(10^{21}~\mathrm{V/m}\). Sharif and Bhatti [22] studied the effect of charge on the instability of isotropic cylinder and deduced that the charge with other matter variables control the stable as well as unstable configuration. The same authors [23] investigated instability of charged spherical system with the viscous dissipative matter distribution and found the instability range from adiabatic index. Sharif and Sadiq [24] analyzed the effect of electromagnetic field on the stability of stellar object and concluded that it is stable for specific choice of polytropic index. The same authors [25] obtained exact solutions for anisotropic spherical system in the presence of electromagnetic field and found that stability increases with the effect of charge. Takisa and Maharaj [26] studied the charged anisotropic stellar solutions obeying polytropic equation of state and found that the behavior of energy density and pressure are consistent with the literature.

This paper studies the effects of charge on the definition of complexity proposed by Herrera [18]. The paper has the following format. In the next section, we formulate basic equations defining the structure of a stellar configuration. Section 3 gives brief review of the orthogonal splitting of the Riemann tensor as well as structure scalars. In Sect. 4, we introduce the complexity factor and obtain solutions of the Einstein–Maxwell field equations for vanishing complexity factor. Finally, we summarize our results in the last section.

2 Basic equations

Here we discuss physical variables as well as the equations necessary to define static charged stellar structure consisting of anisotropic fluid. We consider static spherically symmetric geometry in the interior of stellar structure defined by the line element

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

bounded by the hypersurface \(\Sigma \). We consider the energy-momentum tensor for anisotropic fluid distribution as

$$\begin{aligned} T^{\beta }_{\alpha } = \mu u^{\beta }u_{\alpha }-Ph^{\beta }_{\alpha }+\Pi ^{\beta }_{\alpha }+E ^{\beta }_{\alpha }, \end{aligned}$$
(2)

where \(\mu \) is the energy density and

$$\begin{aligned}&\Pi ^{\beta }_{\alpha } = \Pi \left( s^{\beta }s_{\alpha }+\frac{1}{3}h^{\beta }_{\alpha }\right) , \quad P = \frac{1}{3}(P_{r}+ 2P_{\bot }), \nonumber \\&\quad \Pi = -(P_{\bot }-P_{r}), \quad h^{\beta }_{\alpha } = \delta ^{\beta }_{\alpha }-u^{\beta }u_{\alpha }. \end{aligned}$$
(3)

The four velocity and four-vector are defined by

$$\begin{aligned} u^{\beta } = \left( \frac{1}{e^{\frac{\alpha }{2}}},0,0,0\right) ,\quad s^{\beta } = \left( 0,\frac{1}{e^{\frac{\gamma }{2}}},0,0\right) , \end{aligned}$$
(4)

with the properties

$$\begin{aligned} u^{\beta }u_{\beta }=1,\quad s^{\beta }s_{\beta }=-1, \quad s^{\beta }u_{\beta }=0. \end{aligned}$$
(5)

The electromagnetic field tensor is given by

$$\begin{aligned} E^{\beta }_{\alpha } = \frac{1}{4\pi }\left( -F^{\mu }_{\alpha } F^{\beta }_{\mu }+\frac{1}{4} F^{\mu \nu } F_{\mu \nu } \delta ^{\beta }_{\alpha }\right) , \end{aligned}$$
(6)

where \(F_{\beta \alpha }\) is the Maxwell field tensor described by \(F_{\beta \alpha } = \phi _{\alpha ,\beta }-\phi _{\beta ,\alpha }\) and \(\phi _{\alpha }\) is the four potential determined by \(\phi _{\beta } = \phi \delta ^{0}_{\beta }\).

The Maxwell field equations in four-vector formalism are given by

$$\begin{aligned} F^{\beta \alpha }_{;\alpha } = \mu _{0} J^{\beta }, \quad F_{[\beta \alpha ;\gamma ]}=0, \end{aligned}$$

where \(\mu _{0}\) is the magnetic permeability and \(J^{\beta }\) is the four current defined by \(J_{\beta } = \xi u_{\beta }\), where \(\xi \) is the charge density. For the metric (1), the Maxwell field equations yield

$$\begin{aligned} \phi ^{''}+\left( \frac{2}{r}-\frac{\alpha ^{'}}{2}-\frac{\gamma ^{'}}{2}\right) \phi ^{'} = 4\pi \xi e^{\frac{\alpha }{2}+\gamma }. \end{aligned}$$

Integration of the above equation gives

$$\begin{aligned} \phi ^{'}=\frac{e^\frac{\alpha +\gamma }{2}q(r)}{r^{2}}, \end{aligned}$$

where

$$\begin{aligned} q(r)=4\pi \int ^{r}_{0}\xi e^{\frac{\gamma }{2}}\hat{r}^{2}d\hat{r}, \end{aligned}$$

represents the total charge within the sphere. The Einstein–Maxwell field equations are

$$\begin{aligned} G^{\alpha }_{\beta }= 8\pi (T^{\alpha }_{\beta } + E^{\alpha }_{\beta }), \end{aligned}$$
(7)

leading to

$$\begin{aligned} \mu= & {} -\frac{1}{8\pi }\left[ e^{-\gamma }\left( \frac{1}{r^{2}}-\frac{\gamma '}{r}\right) -\frac{1}{r^{2}}+\frac{q^{2}}{r^{4}}\right] , \end{aligned}$$
(8)
$$\begin{aligned} P_{r}= & {} -\frac{1}{8\pi }\left[ \frac{1}{r^{2}}-e^{-\gamma }\left( \frac{1}{r^{2}} +\frac{\alpha ^{'}}{r}\right) -\frac{q^{2}}{r^{4}}\right] , \end{aligned}$$
(9)
$$\begin{aligned} P_{\bot }= & {} \frac{e^{-\gamma }}{32\pi }\left( 2\alpha ^{''}+\alpha ^{'2} +2\frac{\alpha ^{'}-\gamma ^{'}}{r}-\gamma ^{'}\alpha ^{'}\right) -\frac{q^{2}}{8\pi r^{4}},\nonumber \\ \end{aligned}$$
(10)

where prime represents derivative with respect to r. The conservation law gives the hydrostatic equilibrium equation

$$\begin{aligned} P'_{r}=-\frac{\alpha '}{2}(\mu +P_{r})+\frac{2}{r}\left[ (P_{\bot } -P_{r})+\frac{qq'}{8\pi r^{3}}\right] . \end{aligned}$$
(11)

This is also called the generalized Tolman–Opphenheimer–Volkoff (TOV) equation for anisotropic charged fluid distribution. We consider the Reissner–Nordström metric for the exterior geometry defined by

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

where M and Q denote the total mass and total charge in the exterior region, respectively. The smooth matching of exterior and interior spacetimes yields

$$\begin{aligned} e^{\alpha }\overset{\Sigma }{=}1-\frac{2M}{r}+\frac{Q^{2}}{r^{2}}, \quad e^{-\gamma }\overset{\Sigma }{=}1-\frac{2M}{r}+\frac{Q^{2}}{r^{2}},\quad P_{r}\overset{\Sigma }{=}0. \end{aligned}$$
(13)

These equations are the necessary and sufficient conditions for matching of the two metrics (1) and (12) on hypersurface \(\Sigma \).

Now, we evaluate the mass function using two definition namely, Misner-Sharp mass and Tolman mass. The Misner-Sharp formula of mass function [27] yields

$$\begin{aligned} m(r)=\frac{r}{2}(1-e^{-\gamma })+\frac{q^{2}}{2r}. \end{aligned}$$
(14)

Differentiation and then integration of Eq. (14) and using Eq. (8), it follows that

$$\begin{aligned} m(r)=4\pi \int ^{r}_{0} \hat{r}^{2}\mu d\hat{r}+\int ^{r}_{0}\frac{qq'}{\hat{r}}d\hat{r}. \end{aligned}$$
(15)

Using the field equations and Eq. (14), we obtain

$$\begin{aligned} m= & {} \frac{4\pi }{3}r^{3}(\mu -P_{r}+P_{\bot })\nonumber \\&-\,\frac{r^{3}}{3} \left[ \frac{1}{4}e^{-\gamma }\left( \alpha ^{''} +\frac{\alpha ^{'2}}{2}+\frac{\gamma ^{'}}{r} +\frac{2}{r^{2}}-\frac{\gamma ^{'}\alpha ^{'}}{2}\nonumber \right. \right. \\&\left. \left. -\,\frac{\alpha ^{'}}{r}-\frac{2e^{\gamma }}{r^{2}}\right) \right] +\frac{8\pi q^{2}}{3r}. \end{aligned}$$
(16)

We simplify this expression using the Weyl tensor. The Weyl tensor consists of two parts one is the magnetic part which vanishes for spherical system while the other is the electric part defined as

$$\begin{aligned} E_{\alpha \beta } = C_{\alpha \gamma \beta \delta }u^{\gamma }u^{\delta }, \end{aligned}$$
(17)

where

$$\begin{aligned} C_{\nu \mu \kappa \gamma } = (g_{\nu \mu \alpha \beta }g_{\kappa \gamma \rho \delta }-\eta _{\nu \mu \alpha \beta } \eta _{\kappa \gamma \rho \delta })u^{\mu }u^{\rho }E^{\nu \delta }, \end{aligned}$$
(18)

with \(g_{\beta \alpha \mu \nu }=g_{\beta \mu }g_{\alpha \nu }-g_{\beta \nu }g_{\alpha \mu }\) and \(\eta _{\beta \alpha \mu \nu }\) represents the Levi-Civita tensor. \(E_{\alpha \beta }\) is defined as

$$\begin{aligned} E_{\alpha \beta } = \mathcal {E}\left( \frac{1}{3}h_{\alpha \beta }+s_{\alpha }s_{\beta }\right) , \end{aligned}$$
(19)

with

$$\begin{aligned} \mathcal {E}= -\frac{1}{4}e^{-\gamma }\left[ \alpha ^{''}+\frac{\alpha ^{'2}}{2} +\frac{\gamma ^{'}}{r} +\frac{2}{r^{2}} -\frac{\gamma ^{'}\alpha ^{'}}{2} -\frac{\alpha ^{'}}{r}-\frac{2e^{\gamma }}{r^{2}}\right] . \end{aligned}$$
(20)

Using Eq. (20) in (16), we have

$$\begin{aligned} m=\frac{4\pi }{3}r^{3}(\mu -P_{r}+P_{\bot })+\frac{1}{3}r^{3}\mathcal {E} +\frac{8\pi q^{2}}{3r}. \end{aligned}$$
(21)

Comparing Eqs. (15) and (21), it follows that

$$\begin{aligned} \mathcal {E}=4\pi (P_{r}-P_{\bot })-\frac{4\pi }{r^{3}}\int ^{r}_{0} \hat{r}^{3}\mu ^{'}d\hat{r}-8\pi \frac{q^{2}}{r^{4}}+\frac{3}{r^{3}} \int ^{r}_{0}\frac{qq^{'}}{\hat{r}}d\hat{r}. \end{aligned}$$
(22)

Substituting the above equation in (21), we obtain

$$\begin{aligned} m=\frac{4\pi r^{3}}{3}\mu -\frac{4\pi }{3}\int ^{r}_{0}\hat{r}^{3}\mu ^{'}d\hat{r} +\int ^{r}_{0}\frac{qq^{'}}{\hat{r}}d\hat{r}. \end{aligned}$$
(23)

Equation (22) expresses \(\mathcal {E}\) in terms of physical quantities namely, inhomogeneous density, anisotropic pressure as well as total charge and Eq. (23) represents the corresponding expression of mass function. Using Eq. (14) in (9), it follows that

$$\begin{aligned} \alpha ' = 2 \quad \frac{4\pi r^{4} P_{r}+rm-q^{2}}{r(r^{2}+q^{2}-2rm)}. \end{aligned}$$
(24)

Inserting Eq. (24) in (11), we obtain the following form of TOV equation

$$\begin{aligned} P'_{r}=-\frac{4\pi r^{4} P_{r}+rm-q^{2}}{r(r^{2}+q^{2}-2rm)}(\mu +P_{r})+\frac{2}{r} \bigg [(P_{\bot }-P_{r})+\frac{qq'}{8\pi r^{3}}\bigg ]. \end{aligned}$$
(25)

Tolman [28] proposed another definition of energy for static spherical system defined by

$$\begin{aligned} m_{T}=4\pi \int ^{r_{\Sigma }}_{0} r^{2}e^{\frac{\alpha +\gamma }{2}}(\mu +P_{r}+2P_{\bot })dr. \end{aligned}$$
(26)

The total energy of the fluid within the sphere of radius r is

$$\begin{aligned} m_{T}=4\pi \int ^{r}_{0} \hat{r}^{2}e^{\frac{\alpha +\gamma }{2}}(\mu +P_{r}+2P_{\bot })d\hat{r}. \end{aligned}$$
(27)

Using Eqs. (8)–(10) in (27), it follows that [29, 30]

$$\begin{aligned} m_{T}=\frac{r^{2}}{2}e^{\frac{\alpha -\gamma }{2}}\alpha ^{'}-\int ^{r}_{0} e^{\frac{\alpha +\gamma }{2}}\frac{q^{2}}{\hat{r}^{2}}d\hat{r}. \end{aligned}$$
(28)

Putting the value of \(\alpha '\) from Eq. (24) into (28), the Tolman mass becomes

$$\begin{aligned} m_{T}=\frac{e^{\frac{\alpha +\gamma }{2}}(4\pi r^{4}P_{r}+rm-q^{2})}{r}-\int ^{r}_{0} e^{\frac{\alpha +\gamma }{2}}\frac{q^{2}}{\hat{r}^{2}}d\hat{r}. \end{aligned}$$
(29)

Equation (28) can also be interpreted as active gravitational mass of the system. Another expression for \(m_{T}\) [29, 30] is

$$\begin{aligned} m_{T}= & {} \bigg (\frac{r}{r_{\Sigma }}\bigg )^{3}[m_{T}]_{\Sigma }-r^{3} \int ^{r_{\Sigma }}_{r}\frac{e^{\frac{\alpha +\gamma }{2}}}{\hat{r}}[4\pi (P_{\bot }-P_{r})-\mathcal {E}]d\hat{r} \nonumber \\&+\,\,r^{3}\int ^{r_{\Sigma }}_{r}e^{\frac{\alpha +\gamma }{2}}\frac{3q^{2}}{\hat{r}^{5}}d\hat{r} -r^{3}\int ^{r_{\Sigma }}_{r}e^{\frac{\alpha +\gamma }{2}}\frac{8\pi q^{2}}{\hat{r}^{5}}d\hat{r}. \end{aligned}$$
(30)

Using Eq. (22), this equation turns out to be

$$\begin{aligned} m_{T}= & {} \bigg (\frac{r}{r_{\Sigma }}\bigg )^{3}[m_{T}]_{\Sigma }-r^{3} \int ^{r_{\Sigma }}_{r}e^{\frac{\alpha +\gamma }{2}} \bigg [\frac{8\pi }{\hat{r}}(P_{\bot }-P_{r})\nonumber \\&+\,\frac{1}{\hat{r}^{4}}\int ^{\hat{r}}_{0}4\pi \hat{r}^{3}\mu ^{'}d\hat{r}+(8\pi -\frac{3}{2}) \frac{q^{2}}{\hat{r}^{4}}\bigg ]d\hat{r} \nonumber \\&+\,r^{3} \int ^{r_{\Sigma }}_{r}e^{\frac{\alpha +\gamma }{2}} \frac{3q^{2}}{\hat{r}^{5}}d\hat{r}-r^{3}\int ^{r_{\Sigma }}_{r} e^{\frac{\alpha +\gamma }{2}}\frac{8\pi q^{2}}{\hat{r}^{5}}d\hat{r}. \end{aligned}$$
(31)

This represents the contribution of density inhomogeneity, charge and anisotropy of pressure in the Tolman mass.

3 Structure scalars

In this section, we use orthogonal splitting of the Riemann tensor introduced by Bel [31] and obtain scalar structures which help us to find the complexity factor. For the orthogonal splitting of the Riemann tensor, the following tensors are introduced [31,32,33]

$$\begin{aligned} Y_{\alpha \beta }= & {} R_{\alpha \gamma \beta \delta }u^{\gamma }u^{\delta }, \end{aligned}$$
(32)
$$\begin{aligned} X_{\alpha \beta }= & {} ^{*}R^{*}_{\alpha \gamma \beta \delta }u^{\gamma }u^{\delta }=\frac{1}{2}\eta ^{\epsilon \nu }_{\alpha \gamma }R^{*}_{\epsilon \nu \beta \delta }u^{\gamma }u^{\delta }, \end{aligned}$$
(33)

where \(R^{*}_{\mu \nu \gamma \delta }=\frac{1}{2}\eta _{\epsilon \beta \gamma \delta }R^{\epsilon \beta }_{\mu \nu }\). These tensors can be expressed in the trace-free and trace parts as

$$\begin{aligned} Y_{\alpha \beta }= & {} Y_{TF}\bigg (\frac{1}{3}h_{\alpha \beta }+s_{\alpha }s_{\beta }\bigg ) +\frac{1}{3}Y_{T}h_{\alpha \beta }, \end{aligned}$$
(34)
$$\begin{aligned} X_{\alpha \beta }= & {} X_{TF}\bigg (\frac{1}{3}h_{\alpha \beta }+s_{\alpha }s_{\beta }\bigg ) +\frac{1}{3}X_{T}h_{\alpha \beta }. \end{aligned}$$
(35)

Using the Einstein–Maxwell filed equations, we obtain these scalars as [33]

$$\begin{aligned} X_{T}= & {} 8\pi \mu +\frac{q^{2}}{r^{4}}, \end{aligned}$$
(36)
$$\begin{aligned} X_{TF}= & {} 4\pi \Pi +\frac{q^{2}}{r^{4}}-\mathcal {E}. \end{aligned}$$
(37)

Also, using Eq. (22), we have

$$\begin{aligned} X_{TF}=\frac{4\pi }{r^{3}}\int ^{r}_{0}\hat{r}^{3}\mu ^{'}d\hat{r} +\left( 8\pi -\frac{1}{2}\right) \frac{q^{2}}{r^{4}}. \end{aligned}$$
(38)

The expressions for \(Y_{T}\) and \(Y_{TF}\) are

$$\begin{aligned} Y_{T}= & {} 4\pi (\mu -2\Pi +3P_{r})+\frac{q^{2}}{r^{4}}, \end{aligned}$$
(39)
$$\begin{aligned} Y_{TF}= & {} 4\pi \Pi +\frac{q^{2}}{r^{4}}+\mathcal {E}. \end{aligned}$$
(40)

Substitution of Eq. (22) in (40) yields

$$\begin{aligned} Y_{TF}=\left( \frac{5}{2}-8\pi \right) \frac{q^{2}}{r^{4}}-\frac{4\pi }{r^{3}} \int ^{r}_{0}\hat{r}^{3}\mu ^{'}d\hat{r}+8\pi \Pi . \end{aligned}$$
(41)

The scalars \(X_{TF}\) and \(Y_{TF}\) describe anisotropy of the pressure in the presence of charge as

$$\begin{aligned} Y_{TF}+X_{TF}=\frac{2q^{2}}{r^{4}}+8\pi \Pi . \end{aligned}$$
(42)

Replacing Eq. (40) in (30), we obtain

$$\begin{aligned} m_{T}= & {} \left( \frac{r}{r_{\Sigma }}\right) ^{3}[m_{T}]_{\Sigma }+r^{3} \int ^{r_{\Sigma }}_{r}\frac{e^{\frac{\alpha +\gamma }{2}}}{\hat{r}} Y_{TF}d\hat{r} \nonumber \\&-\,r^{3}\int ^{r_{\Sigma }}_{r} e^{\frac{\alpha +\gamma }{2}}8\pi \frac{q^{2}}{\hat{r}^{5}}d\hat{r}+r^{3}\int ^{r_{\Sigma }}_{r}e^{\frac{\alpha +\gamma }{2}}\frac{2q^{2}}{\hat{r}^{5}}d\hat{r}. \end{aligned}$$
(43)

Comparing Eq. (43) with (30), it follows that

$$\begin{aligned}&r^{3}\int ^{r_{\Sigma }}_{r}\frac{e^{\frac{\alpha +\gamma }{2}}}{\hat{r}} Y_{TF}d\hat{r}=-r^{3}\int ^{r_{\Sigma }}_{r}\frac{e^{\frac{\alpha +\gamma }{2}}}{\hat{r}}[4\pi (P_{\bot }-P_{r})-\mathcal {E}]d\hat{r}\\&\quad +r^{3}\int ^{r_{\Sigma }}_{r}e^{\frac{\alpha +\gamma }{2}} \frac{3q^{2}}{\hat{r}^{5}}d\hat{r} -r^{3}\int ^{r_{\Sigma }}_{r}e^{\frac{\alpha +\gamma }{2}}\frac{2q^{2}}{\hat{r}^{5}}d\hat{r}. \end{aligned}$$

This shows that \(Y_{ TF}\) is associated with the effect of the anisotropic pressure, inhomogeneity of the energy density and total charge of the fluid distribution, i.e., \(Y_{TF}\) describes the effect of these two quantities in the Tolman mass defined in Eq. (43). Also, the Tolman mass given in Eq. (26) can be written in terms of structure scalar as

$$\begin{aligned} m_{T}=\int ^{r}_{0}\hat{r}^{2}e^{\frac{\alpha +\gamma }{2}} \left( Y_{T}-\frac{q^{2}}{\hat{r}^{4}}\right) d\hat{r}. \end{aligned}$$
(44)

4 The complexity factor

There are many factors producing complexity in a system for example, density inhomogeneity, pressure anisotropy, electromagnetic field, heat dissipation and viscosity. In general, any system having homogenous energy density as well as isotropic pressure and in the absence of the above mentioned factors is considered as the simplest system with negligible complexity. For our fluid, the causes of complexity are inhomogeneous energy density, anisotropic pressure and electromagnetic field. The structure scalar \(Y_{TF}\) defined in Eq. (41) contains these terms (inhomogeneous energy density, anisotropic pressure and charge) which are responsible for producing the complexity in the system. For this reason, the term complexity factor can be associated with the structure scalar \(Y_{TF}\).

Furthermore, the structure scalar \(Y_{TF}\) appears in the Tolman mass implying that these terms affect Tolman mass. Now, we discuss the vanishing complexity condition. The set of field equations leads to a system of three ordinary differential equations in which there are five unknown functions \(\alpha ,\gamma ,\mu ,P_{r},P_{\bot }\). Using the condition \(Y_{TF}=0\), we are left with four unknowns and need one more condition to have a unique solution. For this purpose, we take Eq. (41) and use \(Y_{TF}=0\). The vanishing complexity condition gives

$$\begin{aligned} \Pi =\left( 1-\frac{5}{16\pi }\right) \frac{q^{2}}{r^{4}} +\frac{1}{2r^{3}}\int ^{r}_{0}\hat{r}^{3}\mu ^{'}d\hat{r}. \end{aligned}$$
(45)

In the following, we discuss some examples.

4.1 The Gokhroo and Mehra Ansatz

Gokhroo and Mehra [34] discussed the internal structure of the spherical configuration with the variable energy density for anisotropic spheres. Physically, these solutions have been used to discuss the behavior of compact objects. Here, we use the assumption proposed by Gokhroo and Mehra to discuss the behavior of stellar structures for vanishing complexity condition. The proposed energy density is

$$\begin{aligned} \mu =\mu _{0}\left( 1-\frac{Kr^{2}}{r^{2}_{\Sigma }}\right) , \end{aligned}$$
(46)

where \(K=(0,1)\). Using this value in Eq. (15), we have

$$\begin{aligned} m(r)=\int ^{r}_{0}\frac{qq^{'}}{\hat{r}}d\hat{r}-\frac{4\pi r^{3}}{3}\mu _{0}\left( \frac{3Kr^{2}}{5r^{2}_{\Sigma }}-1\right) . \end{aligned}$$
(47)

Inserting this value in Eq. (14), we obtain

$$\begin{aligned} e^{-\gamma }=1+\frac{3K\hat{\alpha } r^{4}}{5r^{2}_{\Sigma }}+\frac{q^{2}}{r^{2}}-\hat{\alpha } r^{2}-\frac{2}{r}\int ^{r}_{0}\frac{qq^{'}}{\hat{r}}d\hat{r}, \end{aligned}$$
(48)

where \(\hat{\alpha }=8\pi \mu _{0}/3\). From Eqs. (9) and (10), it follows that

$$\begin{aligned} 8\pi (P_{r}-P_{\bot })= & {} e^{-\gamma }\left[ \frac{\alpha ^{'}}{2r} +\frac{1}{r^{2}}+\frac{\gamma ^{'}\alpha ^{'}}{4} +\frac{\gamma ^{'}}{2r}-\frac{\alpha ^{''}}{2} \right. \nonumber \\&\left. -\,\frac{\alpha ^{'2}}{4}\right] -\frac{1}{r^{2}}+\frac{2q^{2}}{r^{4}}. \end{aligned}$$
(49)

Introducing the new variables [18]

$$\begin{aligned} e^{\alpha (r)}=e^{-\int (\frac{2}{r}-2z(r))dr},\quad 1/e^{\gamma }=y(r). \end{aligned}$$
(50)

Using these variables, we obtain the following form of Eq. (49)

$$\begin{aligned} y^{'}-y\left[ \frac{6}{r}-\frac{2z^{'}}{z}-2z-\frac{4}{r^{2}z}\right] +\frac{4q^{2}}{zr^{4}}=-\left( \frac{1}{r^{2}}+8\pi \Pi \right) \frac{2}{z}. \end{aligned}$$
(51)

Its solution leads to the line element in terms of z and \(\Pi \) [35] as

$$\begin{aligned} ds^{2}= & {} -e^{-\int (\frac{2}{r}-2z(r))dr}dt^{2}+r^{2}d\theta ^{2}+r^{2}\sin ^{2}\theta d\phi ^{2}\nonumber \\&+\,\frac{z^{2}(r)e^{\int (2z(r)+\frac{1}{r^{2}z(r)})dr}}{r^{6}(-2\int \frac{e^{\int (2z(r)+\frac{1}{r^{2}z(r)})dr}z(r)(1+8\pi \Pi r^{2})}{r^{8}}dr -\int \frac{4q^{2}}{zr^{4}}dr +C)}dr^{2},\nonumber \\ \end{aligned}$$
(52)

where C is an integration constant. Using the value of q(r) and Eq. (46), the vanishing complexity condition (45) becomes

$$\begin{aligned} \Pi =\left( 1-\frac{5}{16\pi }\right) \frac{[4\pi \int ^{r}_{0}\xi (\frac{1}{y})^{\frac{1}{2}}\hat{r}^{2}d\hat{r}]^{2}}{r^{4}}-\frac{\mu _{0}K}{r^{3}}\int ^{r}_{0}\frac{\hat{r}^{4}}{\hat{r}^{2}_{\Sigma }}d\hat{r}. \end{aligned}$$
(53)

The physical variables in the presence of charge yield

$$\begin{aligned} P_{r}= & {} \frac{\frac{m}{r}-z(2m-r)-1+\frac{q^{2}}{2r^{2}}}{4\pi r^{2}}, \end{aligned}$$
(54)
$$\begin{aligned} \mu= & {} \frac{m^{'}}{4\pi r^{2}}-\frac{qq^{'}}{4\pi r^{3}}, \end{aligned}$$
(55)
$$\begin{aligned} P_{\bot }= & {} \frac{1}{8\pi }\left[ z\left( \frac{m}{r^{2}}-\frac{m^{'}}{r}\right) \right. \nonumber \\&\left. +\,\left( z^{'}+z^{2}-\frac{z}{r}+\frac{1}{r^{2}}\right) \left( 1-\frac{2m}{r}\right) -\frac{q^{2}}{r^{4}}\right] . \end{aligned}$$
(56)

Equations (54)–(56) indicate the presence of charge in radial pressure, energy density and tangential pressure, respectively.

4.2 Polytropic equations with vanishing complexity factor

For self-gravitating system, the polytropic equation plays a vital role. Polytropes with anisotropic matter distribution have widely been discussed in literature [36,37,38]. Here, we discuss two different cases related to the polytropes. One of them is

$$\begin{aligned} P_{r}=\mathcal {K}\mu ^{\sigma }=\mathcal {K}\mu ^{1+1/n}, \end{aligned}$$
(57)

where \(\mathcal {K}\) is called polytropic constant, \(\sigma \) is called polytropic exponent and n is called polytropic index. We take TOV Eq. (11) and convert it into the dimensionless form. For this purpose, we use dimensionless variables

$$\begin{aligned} \beta= & {} \frac{P_{rc}}{\mu _{c}}, \quad r=\frac{\zeta }{A}, \quad A^{2}=\frac{4\pi \mu _{c}}{\beta (n+1)}, \end{aligned}$$
(58)
$$\begin{aligned} v(\zeta )= & {} \frac{A^{3}m(r)}{4\pi \mu _{c}}, \quad \Psi ^{n}=\frac{\mu }{\mu _{c}}, \end{aligned}$$
(59)

where subscript c shows that the quantity is calculated at the center. At the boundary \(r=r_{\Sigma }\) (\(\zeta =\zeta _{\Sigma }\)), we have \(\Psi (\zeta _{\Sigma })=0\) [36]. Putting the values from Eqs. (24) and (57)–(59) in (11), we obtain

$$\begin{aligned}&\left[ \frac{1-\frac{2v \beta (n+1)}{\zeta }+\frac{4\pi q^{2}\mu _{c}}{\beta (n+1)\zeta ^{2}}}{1+\beta \Psi }\right] \nonumber \\&\quad \times \left( \zeta ^{2}\frac{d\Psi }{d\zeta }+\,2\Psi ^{-n}\frac{\beta ^{4}(n+1)^{2}\zeta ^{3}\Pi -2\pi \beta ^{2}\mu ^{2}_{c}q \frac{dq}{d\zeta }}{\beta ^{5}\mu _{c}\zeta ^{2}(n+1)^{3}}\right) \nonumber \\&\quad +\, \beta \zeta ^{3} \Psi ^{n+1}+v-\frac{4\pi q^{2}\mu _{c}}{\zeta \beta ^{2}(n+1)^{2}}=0. \end{aligned}$$
(60)

We also convert Eq. (15) in dimensionless variables as

$$\begin{aligned} \frac{dv}{d\zeta }=\zeta ^{2}\Psi ^{n}+\frac{dq}{d\zeta }\frac{4\pi q\mu _{c}}{\beta ^{2}\zeta (n+1)^{2}}. \end{aligned}$$
(61)

Equations (60) and (61) are two ordinary differential equations with three unknown functions \(\Pi ,v,\Psi \). We still need one more condition to have a unique solution. For this purpose, we use the vanishing complexity condition (45) in dimensionless form given by

$$\begin{aligned} \frac{2\zeta }{n\mu _{c}}\frac{d\Pi }{d\zeta }+\frac{6\Pi }{n\mu _{c}}= & {} \Psi ^{n-1}\zeta \frac{d\Psi }{d\zeta }+\nonumber \\&-\,\left( 1-\frac{5}{16\pi }\right) \left( \frac{2qq'A^{3}}{\zeta ^{4}}\frac{4q^{2}A^{4}}{\zeta ^{5}}\right) .\nonumber \\ \end{aligned}$$
(62)

Now, we have three differential Eqs. (60)–(62) with three unknown functions \(\Pi ,v,\Psi \). For any of value of n and \(\beta \), this system can be integrated analytically or we can have a numerical solution using appropriate initial conditions. These equations physically describe the structure of stellar objects with the vanishing complexity condition. Any solution of this system gives the pressure, density, mass and radius of a specific stellar object for the chosen values of free parameters. We discuss another case of polytropes with the equation of state \(P_{r}=\mathcal {K}\mu ^{\sigma }_{d}=\mathcal {K}\mu ^{1+\frac{1}{n}}_{d},\) where \(\mu _{d}\) represents the baryonic mass density. Following the above procedure, we obtain

$$\begin{aligned}&\left[ \frac{1-\frac{2v \beta (n+1)}{\zeta }+\frac{4\pi q^{2}\mu _{c}}{\beta (n+1)\zeta ^{2}}}{1+\beta \Psi _{d}}\right] \left( \phantom {\frac{\beta ^{4}(n+1)^{2}\zeta ^{3}\Pi -2\pi \beta ^{2}\mu ^{2}_{c}q \frac{dq}{d\zeta }}{\beta ^{5}\mu _{c}\zeta ^{2}(n+1)^{3}}}\zeta ^{2}\frac{d\Psi _{d}}{d\zeta } \right. \nonumber \\&\left. \quad +\,2\Psi ^{-n}_{d}\frac{\beta ^{4}(n+1)^{2}\zeta ^{3}\Pi -2\pi \beta ^{2}\mu ^{2}_{c}q \frac{dq}{d\zeta }}{\beta ^{5}\mu _{c}\zeta ^{2}(n+1)^{3}}\right) \nonumber \\&\quad +\,\beta \zeta ^{3} \Psi ^{n+1}_{d}+v-\frac{4\pi q^{2}\mu _{c}}{\zeta \beta ^{2}(n+1)^{2}}=0, \end{aligned}$$
(63)
$$\begin{aligned}&\frac{2\zeta }{n\mu _{dc}}\frac{d\Pi }{d\zeta }+\frac{6\Pi }{n\mu _{dc}} =\Psi ^{n-1}_{d}\zeta \frac{d\Psi _{d}}{d\zeta }[\mathcal {K}(n+1) \mu ^{1/n}_{dc}\Psi _{d}+1]\nonumber \\&\quad +\,\left( 1-\frac{5}{16\pi }\right) \left( \frac{2qq'A^{3}}{\zeta ^{4}}-\frac{4q^{2}A^{4}}{\zeta ^{5}}\right) , \end{aligned}$$
(64)

with

$$\begin{aligned} \Psi ^{n}_{d}=\frac{\mu _{d}}{\mu _{dc}}. \end{aligned}$$

However, Eq. (61) remains the same for this equation of state. Again, we have a system of differential Eqs. [(61), (63), (64)] defining the structure of stellar configuration with specific equation of state and zero complexity factor.

5 Conclusions

In astrophysics, the study of stellar objects is an interesting phenomenon due to their physical features which motivate the researchers to explore these objects. Different aspects including mass-radius ratio, luminosity, anisotropy and stability or instability of stellar configurations have widely been studied in literature. However, the term complexity factor is not studied in detail for stellar objects. In this paper, we have studied the complexity factor for charged spherically symmetric stellar objects and the behavior of these objects in the context of vanishing complexity condition. This provides the effects of electromagnetic field on Herrera’s work [18]. We have formulated the Einstein–Maxwell field equations and found the mass function using Misner-Sharp as well as Tolman formalism. We have discussed structure scalars in the presence of electromagnetic field and obtained the complexity factor. The complexity factor \(Y_{TF}\) (41) contains the terms associated with energy density inhomogeneity, charge and anisotropic pressure. This equation indicates that the inclusion of charge decreases the complexity of the system.

Moreover, using the assumption \(Y_{TF}=0\) we have investigated the vanishing complexity condition [defined in Eq. (45)] for two examples of self-gravitating systems studied in the literature. Firstly, the stellar objects discussed by Gokhroo and Mehra [34] are considered in which a specific form of the energy density of the stellar system is assumed. We have observed that in our case the effect of charge appears in Eqs. (54)–(56) that describe the behavior of the system. Secondly, we have considered stellar systems obeying the polytropic equation of state and obtained a system of differential equations including the mass equation, TOV equation and vanishing complexity condition in terms of dimensionless variables. The solution of these equations for some physical conditions provide a better understanding of the charged stellar system with zero complexity factor. It is worthwhile to mention here that all our results reduce to uncharged case (\(q=0\)) [18].