1 Introduction

The modelling of highly dense matter configurations in a general relativistic setting is an important research problem. Recent attempts in this direction include the effects of anisotropy and the electromagnetic field. Some recent results are those of Mafa Takisa and Maharaj (2013b), Mafa Takisa et al. (2014b, 2014a), Maharaj et al. (2014) and Sunzu et al. (2014a, 2014b). However these treatments and others have been completed in the context of Schwarzschild coordinates. There have been fewer investigations involving isotropic coordinates. Pant et al. (2014a) analysed a family of exact solutions of the Einstein-Maxwell field equations in isotropic coordinates. An application to neutron star and quark star with Einstein-Maxwell field equations in isotropic coordinates was performed by Pradhan and Pant (2014). An investigation of a class of super dense stars models using charged analogues of Hajj-Boutros type relativistic fluid solutions has recently been completed by Pant et al. (2014b). In a recent analysis Ngubelanga et al. (2015) found exact models for a compact stellar object which could be charged and anisotropic with a linear equation of state. Other recent investigations that include the effects of anisotropy and the electromagnetic field are contained in the treatments of Malaver (2014a), Feroze and Siddiqui (2014) and Newton Singh et al. (2015).

A simple generalisation of the linear relation between the energy density and radial pressure is a quadratic equation of state. This allows for more general behaviour in the matter distribution and greater complexity in the model. There is still a debate over the structure of a star as to its composition in terms of nuclear matter, or quark matter, or a hybrid mix of both distributions. It is difficult to find a single equation of state for a matter distribution matching the stellar core (softer quark matter) to the outer regions (stiffer nuclear matter). These issues are highlighted in the treatments of Cottam et al. (2002), Özel (2006) and Rodrigues et al. (2011). A quadratic equation of state which is softer at low densities and stiffer at high densities may be appropriate for describing a hybrid star. This would make it possible to explain the stability of compact stars with masses ∼2 M. In a general relativistic context models which are charged and anisotropic were found by Feroze and Siddiqui (2011). A class of models, generalising the results of Feroze and Siddiqui (2011) and containing models with linear equations of state, was found by Maharaj and Mafa Takisa (2012). These solutions have the desirable property of regularity at the stellar centre. Mafa Takisa et al. (2014a) modelled a charged general relativistic star with a quadratic equation of state. They showed their results were consistent with several masses of stellar objects, in particular with the star PSR J1614-2230. Malaver (2014b) found exact solutions to the field equations for a strange quark model. Analytic and regular models, extending earlier investigations for polytropic distributions, for quark stars and compact objects with a modified van der Waals equation of state were generated by Malaver (2013a, 2013b). Sharma and Ratanpal (2013) presented a class of new models using the metric ansatz of Finch and Skea (1989) without assuming any equations of state. Their approach has the remarkable feature of yielding a quadratic equation of state when appropriate physical bounds are applied. Thirukkanesh and Ragel (2012) and Mafa Takisa and Maharaj (2013a) generated exact anisotropic spheres which are uncharged and charged, respectively. These models have a polytropic equation of state in general; however for particular parameter values quadratic equations of state arise.

The aim of this paper is to obtain new exact solutions to the Einstein-Maxwell system of equations. We model charged anisotropic matter distributions in isotropic coordinates by imposing a quadratic equation of state which relates the radial pressure to the energy density. The Einstein-Maxwell field equations in the presence of electric field with anisotropic pressures are presented in Sect. 2. The transformation that has been utilized by Kustaanheimo and Qvist (1948), Ngubelanga and Maharaj (2013) and Ngubelanga et al. (2015) is applied to write the field equations in new equivalent forms. In Sect. 3, we present new classes of exact solutions to the system of equations. We show that the new solution with a quadratic barotropic equation of state contains a known solution by Ngubelanga et al. (2015) in Sect. 4. In Sect. 5, we regain the masses for the observed objects and study the physical properties of the new exact solutions. We analyse the physical features for the stellar model associated with the star PSR J1903+0327 in Sect. 6. Some concluding remarks are made in Sect. 7.

2 The model

We intend to model the interior of a dense star. The line element in isotropic coordinates has the form

$$ d s^{2} = -A^{2}(r)dt^{2} + B^{2}(r)\bigl[dr^{2} + r^{2} \bigl(d \theta^{2} + \sin^{2} \theta d \phi^2\bigr)\bigr], $$
(1)

in coordinates (x a)=(t,r,θ,ϕ). The gravitational field is represented by the metric quantities A(r) and B(r) in the metric (1). An anisotropic charged matter distribution has energy momentum of the form

$$ T_{ij} = \mbox{diag} \biggl(-\rho- \frac{1}{2}E^2, p_{r}-\frac{1}{2}E^2, p_{t}+\frac{1}{2}E^2, p_{t} +\frac{1}{2}E^2 \biggr), $$
(2)

where ρ is the energy density, p r is the radial pressure, p t is the tangential pressure and E is the electric field intensity. A timelike unit four-velocity u where u i = \(\frac {1}{A}\delta^{i}_{0}\) measures the quantities in Eq. (2) above.

If we introduce the transformation

$$ x \equiv r^{2}, \qquad L \equiv B^{-1},\qquad G \equiv LA, $$
(3)

then the line element can be written in the new form

$$\begin{aligned} ds^{2} =& - \biggl(\frac{G}{L} \biggr)^{2}dt^{2}\,{+}\,L^{-2} \biggl[ \frac{1}{4x}dx^{2} \,{+}\, x \bigl(d \theta^{2}\,{+}\,\sin^{2} \theta d \phi^2\bigr) \biggr], \end{aligned}$$
(4)

in new variables of x. The system of the Einstein-Maxwell field equations can be expressed as

$$\begin{aligned} & 8\pi\rho+ \frac{1}{2} E^{2} = 4 \bigl[2xLL_{xx}-3(xL_{x}-L)L_{x}\bigr], \end{aligned}$$
(5)
$$\begin{aligned} & \begin{aligned}[b] 8\pi p_{r} -\frac{1}{2} E^{2} &= 4L(L-2xL_{x})\frac {G_{x}}{G} -4(2L-3xL_{x})L_{x}, \end{aligned} \end{aligned}$$
(6)
$$\begin{aligned} & \begin{aligned}[b] 8\pi p_{t} + \frac{1}{2} E^{2} &= 4xL^{2}\frac {G_{xx}}{G}+4L(L-2xL_{x}) \frac{G_{x}}{G} \\ &\quad -4(2L-3xL_{x})L_{x}-8xLL_{xx},\end{aligned} \end{aligned}$$
(7)
$$\begin{aligned} & \sigma^2 = \frac{1}{4\pi x} L^2 (E+xE_{x})^2, \end{aligned}$$
(8)

in terms of new variables by utilizing transformation (3). The subscript “x” denotes a derivative with respect to the new variable x. In terms of new variables in (3) the condition of pressure anisotropy has the form

$$ \frac{G_{xx}}{G}-2\frac{L_{xx}}{L} = \frac{(8\pi \varDelta + E^2)}{4xL^2}, $$
(9)

where the quantity Δ=p t p r is the measure of anisotropy. The mass function has the form

$$ m(x) = 2\pi \int^x_{0}{ \biggl[ \sqrt{\omega} \rho(\omega) +\frac{E^2}{8\pi} \biggr]d\omega}, $$
(10)

in new coordinates. The mass function represents the mass within the radius x of the sphere.

We assume the quadratic equation of state of the form

$$ p_{r} = \eta\rho^2+\alpha\rho- \beta, $$
(11)

relating the radial pressure p r to the energy density ρ, and where η, α and β are arbitrary constants. This is a simple generalisation of a linear equation of state which is regained when η=0. With the inclusion of the quadratic equation of state, the Einstein-Maxwell system of Eqs. (5)–(8) with the charged anisotropic fluid spheres can be expressed as

$$\begin{aligned} & 8\pi\rho = 4\bigl[2xLL_{xx}-3(xL_{x}-L)L_{x} \bigr]- \frac {1}{2} E^{2}, \end{aligned}$$
(12)
$$\begin{aligned} & p_{r} = \eta\rho^2+\alpha\rho- \beta, \end{aligned}$$
(13)
$$\begin{aligned} & p_{t} = p_{r} + \varDelta , \end{aligned}$$
(14)
$$\begin{aligned} & \begin{aligned}[b] 8\pi \varDelta &= 4xL^2\frac {G_{xx}}{G}+4L(L-2xL_{x}) \frac{G_{x}}{G}\\ &\quad -\frac{\eta}{32\pi} \bigl[16xLL_{xx}-24(xL_{x}-L)L_{x}-E^2 \bigr]^2\\ & \quad -8(1+\alpha)xLL_{xx}+12(1+\alpha)xL^2_{x}\\ & \quad -4(2+3\alpha)LL_{x} -\frac{(1-\alpha)E^2}{2}+8 \pi\beta,\end{aligned} \end{aligned}$$
(15)
$$\begin{aligned} & \begin{aligned}[b] \frac{G_{x}}{G}&= \frac{\eta [16xLL_{xx}-24(xL_{x}-L)L_{x}-E^2 ]^2}{128\pi L(L-2xL_{x})}\\ &\quad +\frac{2\alpha x L_{xx}}{(L-2xL_{x})} -\frac{3(1+\alpha) x L^2_{x}}{L(L-2xL_{x})}\\ &\quad +\frac{(2+3\alpha) L_{x}}{(L-2xL_{x})}-\frac{(1+\alpha)E^2}{8 L(L-2xL_{x})}\\ & \quad -\frac{2\pi\beta}{L(L-2xL_{x})},\end{aligned} \end{aligned}$$
(16)
$$\begin{aligned} & \sigma^2 = \frac{1}{4\pi x} L^2 (E+x E_{x})^2. \end{aligned}$$
(17)

It is crucial to note the non-linearity in both the functions L and G in the system (12)–(17) which is increased because of the appearance of terms containing the parameter η. This system of equations contains six variables involving the matter and the electromagnetic quantities (ρ, p r , p t , Δ, E and σ) and two gravitational potentials (L and G). It should also be highlighted that there are only six independent equations in this system of equations. Integration of such systems is not easy to perform due to nonlinearity and the fact that there are more unknown functions than the independent field equations. In order to integrate and obtain some exact solutions, the above mentioned facts suggest that we need to choose the form for two of the quantities mentioned above. The system of Eqs. (12)–(17) is similar to the field equations of Ngubelanga et al. (2015); however in our case the equation of state is quadratic. In their treatment they utilized the linear equation of state, i.e., η=0 so that p r =αρβ.

The interior metric (1) with the charged matter distribution should match the exterior spacetime which is given by

$$\begin{aligned} ds^2 =& - \biggl( 1-\frac{2M}{R}+ \frac{q^2}{R^2} \biggr)dt^2+ \biggl(1-\frac{2M}{R} +\frac{q^2}{R^2} \biggr)^{-1}dR^2 \\ &{}+R^2\bigl(d\theta^{2} + \sin ^{2}\theta d \phi^2\bigr), \end{aligned}$$
(18)

in coordinates (x a)=(t,R,θ,ϕ). In (18) the total mass and the total charge of the sphere are denoted by M and q 2, respectively. The exterior spacetime (18) is referred to as the Reissner-Nordström metric. The junction conditions at the stellar surface are obtained by matching the first and the second fundamental forms for the interior metric (1) and the exterior metric (18). The conditions are as follows

$$\begin{aligned} & A_{s} = \biggl(1-\frac{2M}{R}+ \frac{q^2}{R^2} \biggr)^{\frac{1}{2}}, \end{aligned}$$
(19)
$$\begin{aligned} & R_{s} = r_{s} B_{s}, \end{aligned}$$
(20)
$$\begin{aligned} & \biggl(\frac{B'}{B}+\frac{1}{r} \biggr)_{s}r_{s}= \biggl(1-\frac{2M}{R}+ \frac{q^2}{R^2} \biggr)^{\frac{1}{2}}, \end{aligned}$$
(21)
$$\begin{aligned} & r_{s}\bigl(A'\bigr)_{s} = \frac{M}{R}-\frac{q^2}{R^2}, \end{aligned}$$
(22)

evaluated at the boundary of the star r=s. In isotropic coordinates the boundary conditions are given by Eqs. (19)–(22).

3 Exact models

Our purpose is to generate new exact solutions to the Einstein-Maxwell system of Eqs. (12)–(17). The integration is achieved by choosing physical reasonable forms for the electric field E and the gravitational potential L. We make the particular choice

$$\begin{aligned} & L = a+bx, \end{aligned}$$
(23)
$$\begin{aligned} & E^2 = x(c+dx), \end{aligned}$$
(24)

where a, b, c and d are real constants. The potential L and the electric field intensity E 2, respectively, are selected to be a linear function and a quadratic function in the variable x. Similar choices for L and E were made by Ngubelanga et al. (2015) for a linear equation of state leading to acceptable stellar configurations; we expect this to also carry through with the addition of a quadratic term in the equation of state. On applying (23) and (24), Eq. (16) becomes

$$\begin{aligned} \frac{G_{x}}{G} =&\frac{\eta [24ab-(c+dx)x ]^2}{128 \pi(a-bx)(a+bx)}+\frac{b(2+3\alpha)}{(a-bx)} \\ &{} -\frac{[16\pi\beta+(1+\alpha)(24b^2+c+dx)x]}{8(a-bx)(a+bx)}, \end{aligned}$$
(25)

which is a first order equation in potential G. We integrate (25) to obtain

$$ G(x) = K(a-bx)^{\varPsi}(a+bx)^{\varPhi} e^{N(x)}, $$
(26)

where K is the constant of integration. The function N(x) and the constants Ψ and Φ are given explicitly by

$$\begin{aligned} & \begin{aligned}[b] N(x) &= \frac{x}{384 \pi b^4} \bigl\{ 48\pi b^2d(1+ \alpha )\\ & \quad -3 \eta \bigl[b^2 c^2+ad \bigl(ad-48b^3\bigr) \bigr]\\ &\quad -b^2d\eta(3c+dx)x \bigr\} ,\end{aligned} \end{aligned}$$
(27)
$$\begin{aligned} & \begin{aligned}[b] \varPsi &=\frac{1}{256\pi ab^5 } \bigl\{ 16\pi ab^2(1+ \alpha ) (bc+ad)\\ &\quad -128\pi b^4 \bigl[ab(1+3\alpha)-2\pi\beta \bigr]\\ &\quad -a^2 \eta \bigl[a^2d^2+b \bigl(c-24b^2\bigr)\\ &\quad \times\bigl(2ad+bc-24b^3\bigr) \bigr] \bigr\} ,\end{aligned} \end{aligned}$$
(28)
$$\begin{aligned} & \begin{aligned}[b] \varPhi &=\frac{1}{256\pi ab^5} \bigl\{ 16\pi ab^2(1+ \alpha ) \bigl[b\bigl(24b^2+c\bigr)-ad \bigr]\\ & \quad -256 \pi^2 b^4 \beta+a^2\eta \bigl[a^2d^2\\ &\quad -b\bigl(24b^2+c\bigr) \bigl(2ad-bc-24b^3 \bigr) \bigr] \bigr\} ,\end{aligned} \end{aligned}$$
(29)

where the constants a≠0 and b≠0 to avoid singularity. An exact solution can then be found to the Einstein-Maxwell system. The metric (1) has the form

$$\begin{aligned} ds^2 =& - K \bigl(a-br^2 \bigr)^{2\varPsi}\bigl(a+br^2\bigr)^{2(\varPhi -1)}e^{2N(r)}dt^2 \\ &{} + \bigl(a+br^2\bigr)^{-2}\bigl[dr^2+r^2 \bigl(d\theta^2+\sin^2\theta d\phi^2\bigr) \bigr], \end{aligned}$$
(30)

where K is the constant of integration. The function N(r) and the constants Ψ and Φ are given explicitly by (27)–(29).

Since Eq. (25) has been integrated, then we can generate an exact model for the system of Eqs. (12)–(17) in terms of the radial coordinate “r” which has the form

$$\begin{aligned} & 8\pi \rho = 12ab- \biggl(\frac{1}{2}c+ \frac {1}{2}dr^2 \biggr)r^2, \end{aligned}$$
(31)
$$\begin{aligned} & p_{r} = \eta\rho^2+\alpha\rho-\beta, \end{aligned}$$
(32)
$$\begin{aligned} & p_{t} = p_{r}+\varDelta , \end{aligned}$$
(33)
$$\begin{aligned} & \begin{aligned}[b] 8\pi \varDelta &= \frac{4b\varPsi (a+br^2)r^2}{(a-br^2)^2} \bigl[b(\varPsi-1) \bigl(a+br^2\bigr)\\ &\quad -2\bigl(a-br^2\bigr) \bigl(b\varPhi+N' \bigl(a+br^2\bigr) \bigr) \bigr]\\ &\quad -\frac{\eta}{32\pi} \bigl[24ab-r^2\bigl(c+dr^2\bigr) \bigr]^2\\ &\quad +4\bigl(a+br^2\bigr) \bigl[a-br^2(1-2\varPhi) \bigr]N'\\ & \quad +4r^2\bigl(a+br^2\bigr)^2 \bigl(N'^2+N''\bigr) \\ &\quad +4b \bigl[\varPhi\bigl(a-br^2\bigr)-\bigl(a+br^2 \bigr) (2+3\alpha+\varPsi) \bigr] \\ &\quad +4b^2 \bigl[3(1+\alpha)+\varPhi(\varPhi-1) \bigr]r^2 \\ &\quad -\frac{1}{2}(1-\alpha) \bigl(c+dr^2\bigr)r^2+8 \pi\beta,\end{aligned} \end{aligned}$$
(34)
$$\begin{aligned} & \sigma^2 = \frac{(a+br^2)^2}{16 \pi^2 (c+dr^2)} \bigl[3c+4dr^2 \bigr]^2, \end{aligned}$$
(35)
$$\begin{aligned} & E^2 = r^2\bigl(c+dr^2 \bigr). \end{aligned}$$
(36)

It is interesting to note that our model is of a simple form and all physical quantities are expressed in terms of elementary functions where the function N(r) and the constants Ψ and Φ are given in (27)–(29), respectively. For this model the mass function is given by

$$ m(r) = \frac{1}{2} r^3 \biggl[ \frac{(12ab+c)}{3}-\frac {(c-2d)r^2}{10}-\frac{dr^4}{14} \biggr]. $$
(37)

A charged anisotropic star with quadratic equation of state may be modeled by the above solution (31)–(36).

4 The linear case

When η=0 then the equation of state becomes

$$ p_{r} = \alpha\rho- \beta, $$
(38)

which is linear. We observe that the case (38) reduces to the Ngubelanga et al. (2015) model. Our result is a generalisation with a quadratic equation of state. All the results in Ngubelanga et al. (2015) can be regained as a special case from the exact solution (31)–(36). The relationship (38) is consistent with the stars PSR J1614-2230, Vela X-1, PSR J1903+0327, 4U 1820-30 and SAX J1808.4-3658 as demonstrated in their analysis. In particular for the parameter values a=1.96819, b=0.5, c=0.01, d=0.01 and α=0.931 we can produce the mass 1.97 M. This stellar mass corresponds to the astronomical object PSR J1614-2230.

5 The quadratic case

From the exact solution (31)–(36) we observe that the quantities associated with the matter field and the electromagnetic field are well behaved. The electric field vanishes at the stellar centre r=0. The matter density ρ and the proper charge density σ remain finite at the centre. At the centre of the star we can write

$$\begin{aligned} & \rho_{0} = \frac{3ab}{2\pi}, \end{aligned}$$
(39)
$$\begin{aligned} & p_{r0} = \eta \biggl(\frac{3ab}{2\pi} \biggr)^2+\alpha \biggl(\frac{3ab}{2\pi} \biggr)-\beta, \end{aligned}$$
(40)

which are finite values. For the electromagnetic quantities we have

$$\begin{aligned} & \sigma^2_{0} = \frac{1}{c} \biggl(\frac{3ac}{4\pi }^2 \biggr), \end{aligned}$$
(41)
$$\begin{aligned} & E^2_{0} = 0, \end{aligned}$$
(42)

which are nonsingular at the centre. For the pressure anisotropy we have

$$\begin{aligned} \varDelta _{0} =& -\frac{3ab\eta}{32\pi^{2}} + \frac {a^2}{2\pi}N'(0) \\ &{}+\frac{ab}{2\pi}\bigl[\varPhi-(2+3 \alpha+ \varPsi)\bigr] + \beta, \end{aligned}$$
(43)

at r=0. The metric functions A and B are regular at r=0. Therefore all physical and gravitational quantities are well behaved in the core regions of the star. For the star to remain stable it is required that Δ=0 at r=0; we demonstrate that this happens in the next section using a graphical treatment. The mass remains finite and also depends on the parameters c and d which are associated with charge.

The speed of sound is defined by

$$ v^2 = \frac{dp_{r}}{d\rho}, $$
(44)

where we must have v<1 to maintain causality. Also we must have zero radial pressure at the boundary for a stable configuration of the compact object. This will ensure consistency of the matching conditions (19)–(22) at the surface and continuity of the metrics (1) and (18) at the surface. For a finite value of the density at the surface along with the zero pressure, we require

$$ \rho_{s} = \frac{3ab}{2\pi} -\frac{1}{16\pi}(c+d), $$
(45)

in geometric units by fixing the radius of the star at r=1. Then (32) restricts the parameter β by

$$ \beta_{s} = \eta\rho^2_{s}+ \alpha\rho_{s}. $$
(46)

When η=0 then (46) reduces to the corresponding expression of Ngubelanga et al. (2015). In our subsequent analysis throughout we choose the parameter values α=0.931 and η=3.185 since they produce relativistic compact stars with desirable physical features.

It is to be noted that the relation for the mass in (37) is free from the equation of state parameters η, α and β. Hence the value of the mass will be indistinguishable from that of the results in the linear case as per Ngubelanga et al. (2015) if we select the same parameter values. To tackle this issue, we have matched the values of the gravitational potentials (A 2) at the stellar surface (r=1) for both the linear and the quadratic cases, showing that for an exterior observer, the gravitational potential should be the same. Thus the effect of the parameters in the quadratic equation of state comes into the system through the Φ and the Ψ terms in the gravitational potentials.

It is possible to give numerical values to quantities in our exact solutions. We have considered values for five compact objects for which reliable data exists. The objects selected are PSR J1614-2230 studied by Demorest et al. (2010), 4U 1608-52 investigated by Güver et al. (2010), PSR J1903+0327 analysed by Freire et al. (2011), EXO 1745-248 studied by Özel et al. (2009) and SAX J1808.4-3658 considered by Elebert et al. (2009). We vary the parameter a in (37) and assign fixed values for b=0.504167, c=0.01 and d=0.01. This permits us to generate numerical values for the stellar masses for the five astronomical objects listed in Table 1. We have used small values for the parameters c and d which introduce charge into the system to ensure that the electromagnetic contribution is small. We find that the observed masses vary between 0.9 M to 1.97 M. Values for the central density ρ 0, central radial pressure p r0 and surface density ρ s lie in the expected range.

Table 1 Mass m, central density ρ 0, central radial pressure p r0 and surface density ρ s of different stars corresponding to the parameters b=0.504167, c=0.01, d=0.01, α=0.931 and η=3.185

6 The star PSR J1903+0327

The parameter value a=1.65143 generates the mass 1.667 M which corresponds to the star PSR J1903+0327. We use this parameter value for a to analyse the variation of the physical features associated with the matter, charge and gravity field within the star.

Table 2 represents the variation of density ρ, radial pressure p r , tangential pressure p t and anisotropy Δ within the star. The quantities ρ and p r are decreasing functions. The radial pressure p r vanishes at r=1 determining the boundary which is the requirement for a compact star. The tangential pressure p t has finite values. The anisotropy Δ remains finite and has the value Δ=0 at r=0 which is required for stability. Table 3 presents the behaviour of the mass m, electric field E and charge density σ. The mass increases as r grows larger. The electric field E and charge density σ are finite and nonsingular throughout the star with E=0 at r=0. The effect of the charge is incorporated through the parameters c and d. Tables 4 and 5 represent the total charge in the star with r=1 fixed at the stellar surface. It is clear that the parameter d has a greater effect than that of the parameter c which makes the star more charged. The metric functions A 2 and B 2 are evaluated in Table 6 for the set of parameter values corresponding to PSR J1903+0327 through the interior of the star. The values obtained for the metric functions indicate that the potentials are regular and positive.

Table 2 Variation of energy density ρ, radial pressure p r , tangential pressure p t and measure of anisotropy Δ from the centre to the surface with parameters a=1.65143, b=0.504167, c=0.01, d=0.01, α=0.931 and η=3.185
Table 3 Variation of mass m, electric field intensity E 2 and charge density σ 2 for charged bodies from centre to the surface with parameters a=1.65143, b=0.504167, c=0.01 and d=0.01
Table 4 Electric field intensity E 2 and charge density σ 2 (r=1) with parameters r=1, a=1.65143, b=0.504167 and c=0.01
Table 5 Electric field intensity E 2 and charge density σ 2 with parameters r=1, a=1.65143, b=0.504167 and d=0.01
Table 6 Potentials A 2 and B 2 with varying radius with parameters a=1.65143, b=0.504167, c=0.01, d=0.01, α=0.931 and η=3.185

A graphical analysis provides deeper insight into the behaviour of the physical features. We have presented plots for the density (Fig. 1), radial pressure (Fig. 2), tangential pressure (Fig. 3), pressure anisotropy (Fig. 4), mass (Fig. 5), electric field intensity (Fig. 6), charge density (Fig. 7) and metric functions (Figs. 8 and 9). It is clear that all the quantities have regular profiles from the various plots that have been generated. Ngubelanga et al. (2015) using a linear equation of state also studied particular observed stars in general relativity. Our results in this paper with a quadratic equation of state are broadly consistent with their results.

Fig. 1
figure 1

Variation of density (y-axis) with the radius

Fig. 2
figure 2

Variation of pressure (y-axis) with the radius

Fig. 3
figure 3

Variation of tangential pressure (y-axis) with the radius

Fig. 4
figure 4

Variation of measure of anisotropy (y-axis) with the radius

Fig. 5
figure 5

Variation of mass (y-axis) with the radius

Fig. 6
figure 6

Square of Electric field intensity with the radius

Fig. 7
figure 7

Charge density against the radius

Fig. 8
figure 8

Variation of the gravitational potential A 2 (y-axis) with the radius

Fig. 9
figure 9

Variation of the gravitational potential B 2 (y-axis) with the radius

7 Discussion

Our objective in this paper was to find new exact solutions to the Einstein-Maxwell field equations for matter configurations with anisotropy and charge in isotropic coordinates. We selected the barotropic equation of state to be quadratic which relates the radial pressure p r to the energy density ρ. The classes of exact solutions (31)–(36) to the Einstein-Maxwell field equations were shown to be physically acceptable. The tables for charge and matter variables suggest that they represent physically reasonable configurations. By choosing to fix the parameters b=0.504167, c=0.01, d=0.01, α=0.931 and η=3.185 and varying the parameter a in Table 1, we regained the masses for the stellar objects PSR J1614-2230, 4U 1608-52, PSR J1903+0327, EXO 1745-248 and SAX J1808.4-3658. We fixed the parameter a and used the star PSR J1903+0327 which has the mass 1.667 M, to produce tables and graphical plots for relevant quantities related to the metric, matter and charge. We made the particular choices a=1.65143, b=0.504167, c=0.01, d=0.01, α=0.931 and η=3.185 to perform graphical plots using the software package Mathematica. Our graphical approach suggests that the model for the star PSR J1903+0327 is well behaved. The introduction of the quadratic parameter η in the equation of state p r =ηρ 2+αρβ does produce a new exact solution of the Einstein-Maxwell system which is qualitatively different from the linear case p r =αρβ. However the quadratic equation of state shall produce models which can be related to observed stellar objects.