1 Introduction

Generally in astrophysics compact stars, formed due to gradual gravitational collapse, are considered to fall into three different categories: white dwarfs, neutron stars, and black holes. This classification is based on the internal structure and composition of the stars where the former contain matter in one of the densest forms found in the universe. According to the strange matter hypothesis strange quark matter could be more stable than nuclear matter and thus neutron stars should largely be composed of pure quark matter. Possible observational signatures associated with the theoretically proposed states of matter inside the compact stars therefore have remained an active research arena in astrophysics, different types of mathematical modeling of such compact objects being considered.

The idea that the usual 4-dimensional spacetime is embedded in higher-dimensional flat space was conceived earlier by Eddington [1]. In some recent studies [2, 3] one can notice the revival of this idea in different aspects of the research arena. Randall and Sundrum [2] proposed a new higher-dimensional mechanism for solving the hierarchy problem where an exponential hierarchy arises from the background metric (which is a slice of \(AdS_5\) spacetime). On the other hand, Anchordoqui and Bergliaffa [3] have shown that the 5-dimensional model introduced by Randall and Sundrum [2] is (one-half of) a wormhole and thus present a simple model of brane-world cosmology in which the background is a static anti-de Sitter manifold with two 3-branes.

In this connection we would like to highlight here specific characteristics of n-dimensional manifold through \(V_n\), which can always be embedded in \(m[= n(n+1)/2]\)-dimensional pseudo-Euclidean space. It can easily be shown that the embedding class turns out to be 6 as the relativistic spacetime is 4-dimensional, whereas the class of spherically symmetric and plane symmetric spacetime, respectively, are 2 and 3. Therefore, a classification scheme may be presented as follows: (i) the standard model of modern cosmology, i.e. the Friedmann–Lemaître–Robertson–Walker spacetime [4,5,6,7] is of class 1, (ii) the Schwarzschild [8] exterior and interior solutions are of class 2 and class 1 respectively, and (iii) the Kerr metric is of class 5 [9]. However, in the present investigation our discussion is limited to the static spherically symmetric metric in curvature coordinates which is embeddable in 5D pseudo-Euclidean space and hence is of embedding class 1 metric. A detailed discussion of different aspect of the class 1 metric as well as application can be obtained in some of our previous work [10,11,12,13,14,15,16].

In the present investigation we would like to utilize the aforementioned embedding class 1 metric to construct electromagnetic mass models by obtaining charged perfect fluid distributions. Historically, the concept of electromagnetic mass model (EMMM) with vanishing charge density along with other physical parameters was first proposed by Lorentz [17] and later on by several other authors [18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]. It can be observed that in all these electromagnetic mass models the fluid has a negative pressure and hence we have repulsive gravity in the form of the equation of state (EOS) \(\rho +p=0\), due to vacuum polarization, where \(\rho \) and p represent the density and the pressure, respectively. The experimental evidence that the electron’s diameter is not larger than \(10^{-16}\) cm leads to the conclusion that the classical model of the electron must correspond to a region of negative density [30]. It is argued by Ray et al. [29] that it can also be combined with a Weyl-type character of the field.

However, it is worth to mention here that even without the application of the aforesaid EOS one can construct EMMM by adopting an algorithm developed by Maurya et al. [10]. Maurya et al. [11,12,13,14,15,16] have successfully applied the method along with the EOS having the general form \(p=\omega \rho \), where \(\omega \) is the EOS parameter and which for \(\omega =-1\) provides the above stated EOS. It is very crucial to point out that in applying this EOS in the case of compact stars one has to keep in mind the internal structure of the spherical configuration. We shall later on show that depending on the internal structure of the compact star under consideration the EOS parameter differs from case to case and therefore requires a specific EOS applicable to neutron stars as well as strange stars. This interesting point has been demonstrated in Fig. 8 of our present investigation.

Against the above conceptual background in this work we consider the metric \(\nu =n\ln \left( 1+{{Ar}}^{2} \right) +\ln \left( B \right) \) for \(n \ge 2\). The choice of constraint on n is due to the following reasons: (i) for \(n=0\), \(\nu \) has no meaning here in the present context as the spacetime via \(\nu \) becomes flat, (ii) for \(n=1\), this reduces to the same as the Kohlar–Chao solution [38], and (iii) for \(n < 2\) the term \((1+Ar^2)^{(n-2)}\) in the expression of \(\lambda \) occurs in the denominator. We have calculated the data for \(n=3.3\) to 1000 and wanted to see what would happen in the result for very high values of n. So, one can see in Table 2 that if n is large enough i.e. \(n=100\), 1000, and even more, then nA becomes approximately a constant, say \(nA=C\). This means that, if we take the limit as n tends to infinity, then the metric \(\nu \) will convert to the following form: \(\nu =C{r}^{2}+\ln ~B\), which is the same as the metric considered for the solution of EMMM, \((\nu =2\,A{r}^{2}+\ln ~B)\) [11].

In the present work we shall try to form a model for the charged fluid of class 1 by assuming specific metric potential(s) of the class 1 metric such that they do not form a subset of the metric potentials of the conformally flat Schwarzschild interior metric (considering the de Sitter and Einstein universes as particular cases) [8] and the non-conformally flat Kohler–Chao metric [38]. Now, if the charge can be made zero in the charged fluid so obtained, the metric will turn out to be flat by virtue of the class 1 structure of the metric.

The outline of the present investigation is as follows: in Sect. 2 the field equations and some specific results are provided for the Einstein–Maxwell spacetime, whereas we obtain a new class of solutions in Sect. 3. The matching conditions are discussed in Sect. 4 and physical properties of the model are explored in Sect. 5. We pass some comments in Sect. 6.

2 The field equations and the results

2.1 The Einstein–Maxwell spacetime

Let us consider the static spherically symmetric metric in the form

$$\begin{aligned} \mathrm{d}s^2 = - e^{\lambda (r)} \mathrm{d}r^2 - r^2(\mathrm{d}\theta ^2 + sin^2\theta \mathrm{d}\phi ^2) + e^{\nu (r)} \mathrm{d}t^2. \end{aligned}$$
(1)

The Einstein–Maxwell field equations can be given as

$$\begin{aligned} {G^i}_j = {R^i}_j - \frac{1}{2} R {g^i}_j = \kappa ({T^i}_j + {E^i}_j), \end{aligned}$$
(2)

where \(G=1=c\) in relativistic geometric unit and \(\kappa =8\pi \) is the Einstein constant. The matter in the star is expected to be a locally perfect fluid. However, \({T^i}_j\) and \({E^i}_j\) are the energy-momentum tensor of the fluid distribution and the electromagnetic field, respectively, and they can be defined as

$$\begin{aligned} {T^i}_j = [(\rho + p)v^i\,v_j - p\,{\delta ^i}_j], \end{aligned}$$
(3)
$$\begin{aligned} {E^i}_j = \frac{1}{4\pi }\left( -F^{im}F_{jm} + \frac{1}{4}{\delta ^i}_jF^{mn}F_{mn}\right) , \end{aligned}$$
(4)

where \(\rho \) is the energy density, p is the pressure, and \(v^i\) is the four-velocity defined as \(e^{-\nu (r)/2}v^i={\delta ^i}_4\).

2.2 The embedding class 1 spacetime

The metric (1) may represent a spacetime of embedding class 1, if it satisfies the condition of Karmarkar [39],

$$\begin{aligned} R_{{1414}}\,R_{{2323}}={R_{{1212}}R_{{3434}}+R_{{1224}}R_{{1334}}}, \end{aligned}$$
(5)

where \({{R_{{2323}}\ne 0}}\) [40].

The above condition with reference to (1) yields the following differential equation:

$$\begin{aligned} \frac{\lambda ^{\prime }\,e^{\lambda }}{1-\,e^{\lambda }}=-\frac{2\,\nu ^{\prime \prime }}{\nu ^{\prime }}-\nu ^{\prime }. \end{aligned}$$
(6)

The solution of the differential equation (6)

$$\begin{aligned} \lambda =\ln \left( 4+K{{\nu }^{\prime }}^{2}{\mathrm{e}^{\nu }} \right) -2\,\ln 2, \end{aligned}$$
(7)
$$\begin{aligned} {\nu }^{\prime } \left( r \right) \ne 0, \,\,\,\mathrm{e} ^{\lambda \left( 0 \right) }=1, \end{aligned}$$
(8)

and

$$\begin{aligned} {\nu }^{\prime }\left( 0 \right) =0, \end{aligned}$$
(9)

where K is an arbitrary non-zero integration constant.

Using the spherically symmetric metric (1) and Eq. (7), the Einstein–Maxwell field equations can be written as the following set of equations [11]:

$$\begin{aligned} 8\pi \,p\,=\, \frac{{\nu }^{\prime }}{{r}^{2}}\left[ \frac{4\,r-K{\nu }^{\prime }\,e^{\nu }}{4+K{\nu ^{\prime }}^{2}\,e^{\nu }}\right] \,+\,{\frac{{q}^{2}}{{r}^{4}}}, \end{aligned}$$
(10)
$$\begin{aligned} 8\,\pi \,p={\frac{4\,\left( 2\,{{\nu }^{\prime }}+2\,r{{\nu }^{\prime \prime }}-K{{\nu }^{\prime }}\, {{\nu }^{\prime \prime }}{\mathrm{e}^{\nu }}+r{{\nu }^{\prime }}^{2}\right) }{r \left( 4+K{{\nu }^{\prime }}^{2}{\mathrm{e}^{\nu }} \right) ^{2}}}\frac{-q^{2}}{r^{4}}, \end{aligned}$$
(11)
$$\begin{aligned} 8\,\pi \,\rho ={\frac{8\,rK{{\nu }^{\prime }}\,{{\nu }^{\prime \prime }}{\mathrm{e}^{\nu }}+4\,rK{{\nu }^{\prime }}^{3 }{\mathrm{e}^{\nu }}+4\,K{{\nu }^{\prime }}^{2}{\mathrm{e}^{\nu }}+{K}^{2}{{\nu }^{\prime }}^{4}{\mathrm{e} ^{2\,\nu }}}{r \left( 4+K{{\nu }^{\prime }}^{2}{\mathrm{e}^{\nu }} \right) ^{2}}}\frac{-q^{2}}{r^{4}},\nonumber \\ \end{aligned}$$
(12)

where the differential with respect to r is denoted by a prime.

3 A new class of solutions

To determine the expression for the electric charge, we use the pressure isotropy condition. Therefore, from Eqs. (10) and (11), we get

$$\begin{aligned} {\frac{{{q}^{2}}}{{r}^{4}}}\,=\,\left[ {\frac{K{{\nu }^{\prime }}{\mathrm{e}^{\nu }}}{2r}}-1\right] \,\left[ \,\frac{{\nu }^{\prime }\,(4+K\,{\nu ^{\prime }}^{2}\mathrm{e}^{\nu })-2\,r\,(2\,{\nu }^{\prime \prime }+{\nu ^{\prime }}^{2})}{r\,\left( 4+K{\nu ^{\prime }}^{2}\mathrm{e}^{\nu }\right) ^2 }\right] .\nonumber \\ \end{aligned}$$
(13)

As a consequence of Eq. (13) we conclude that if the charge vanishes in a charged fluid of embedding class 1 then for the Schwarzschild interior solution [8] (or special cases like the de Sitter universe or the Einstein universe) or the Kohler–Chao solution [38] there will only survive a neutral counterpart unless either the surviving spacetime metric is flat or the charge cannot be zero. Obviously, in the absence of charge either of the two factors on the right hand side of (13) has to be zero. It can be verified that the vanishing of the first factor of (13) gives rise to the Kohlar–Chao solution. However, the vanishing of the second factor ultimately provides the Schwarzschild interior solution.

Let us consider m(r) to be the mass function for an electrically charged fluid sphere, given as

$$\begin{aligned} m(r)={\frac{r}{2}}\,\left[ 1-{\mathrm{e}^{-\lambda \left( r \right) }}+{\frac{{q}^{2}}{{r}^{2}}}\right] . \end{aligned}$$
(14)

By plugging Eqs. (7) and (13) into Eq. (14), eventually we get

$$\begin{aligned} m \left( r\right)= & {} \left[ \frac{K\,r\,e^{\nu }\,{\nu ^{\prime }}^{2}}{2\,(4+K{\nu ^{\prime }}^{2}\mathrm{e}^{\nu })}\right. \nonumber \\&\left. +\,\frac{r\,\left( {{K{{\nu }^{\prime }}{\mathrm{e}^{\nu }}-2\,r}}\right) \,[\,{\nu }^{\prime }\,(4+K\,{\nu ^{\prime }}^{2}\mathrm{e}^{\nu })-2\,r\,(2\,{\nu }^{\prime \prime }+{\nu ^{\prime }}^{2})]}{4\,\left( 4+K{\nu ^{\prime }}^{2}\mathrm{e}^{\nu }\right) ^2 }\right] .\nonumber \\ \end{aligned}$$
(15)

We observe that the expressions for the pressure (p), density (\(\rho \)), electric charge (q), and mass (m) are dependent on the metric function \(\nu \). As a consequence we consider the metric function \(\nu \) to find the spherically symmetric charged fluid solutions in the following form:

$$\begin{aligned} \nu (r)=n~ln \left( 1+A{r}^{2} \right) + ln~B, \end{aligned}$$
(16)

where n is a positive number and A is a constant such that \(n \ge 2\) and \(A > 0\).

The above form of the metric potential \(\nu (r)\) represents the same \(2\Phi (r)\) as considered by Lake [41] in his Eq. (9) for \(A=1/\alpha \) and \(B=1\). Therefore, the explanations of Eq. (17) are mostly the same as in Ref. [41]. The function \(\nu (r)\) is monotone increasing with a regular minimum at \(r = 0\). If we look at the mass function m(r) in Eq. (15), then it is clear that by using this source function of Eq. (16), the mass function can easily be evaluated exactly for any n. Thus, the metric function \(\nu \) will generate a ‘class’ of solutions having the physical properties which are expected to be quite distinct for each value of n. It is noted that previously the solutions for either \(n = 1,\ldots ,~5\) [42] or \(n \ge 5\) [43] solutions were known. With \(n = 1,\ldots ,~5\), they constitute half of all the previously known physically interesting solutions in curvature coordinates [42] whereas for \(N \ge 5\) the solutions are acceptable on physical grounds and even exhibit a monotonically decreasing subluminal adiabatic sound speed [43]. It will also be interesting to note that the above form of \(\nu (r)\) is quite different from the function of Schwarzschild or Kohlar–Chao as hinted at by Eq. (13). Thus, in the present study we expect that each source function \(\nu (r)\) which is a monotone increasing function with a regular minimum at \(r = 0\) necessarily provides, via the mass function in Eq. (15), a static spherically symmetric perfect fluid solution of Einstein’s equations which is regular at \(r = 0\).

Fig. 1
figure 1

Variation of the metric potentials \(e^{\nu }\) (left panel) and \(e^{\lambda }\) (right panel) with respect to the fractional radial coordinate r / R for \(n=3.3\). For plotting this figure the values of the arbitrary constants A, B, and K are used from Table 1

Fig. 2
figure 2

Variation of the effective pressure, \(\tilde{p}=(8\pi /A)p\), and the effective energy density, \(\tilde{\rho }=(8\pi /A)\rho \), with respect to the fractional radial coordinate r / R for \(n=3.3\). For plotting this figure the values of the arbitrary constants A, B, and K are used from Table 1

On the other hand, the metric potential \(\lambda (r)\) can be obtained from Eq. (7) as

$$\begin{aligned} \lambda (r)= ln \left[ 1+K\,A\,B\,n^{2}(Ar^{2})(1+Ar^{2})^{n-2}\right] , \end{aligned}$$
(17)

where \(n\ge 2\) and A, B are positive constants. In Fig. 1 the profiles of \(\nu (r)\) and \(\lambda (r)\) are shown, which exhibit regular behavior.

The expressions of the electromagnetic mass and the electric charge are then given by

$$\begin{aligned}&{\frac{2m \left( r \right) }{r}}=A{{r}}^{2}\nonumber \\&\times \,\left[ {\frac{n\,f^{2} \,A{r}^{2}(n - 2) + D f^{n}[-2\,n\, f\,A{r}^{2} + (2+4\,{A}^{2}{r}^{4}+6\,A{r}^{2}+3\, D A{r}^{2}\,f^{n})]}{2{\left( 1+{A}^{2}{r}^{4}+2\,{{Ar}}^{2}+ D A{r}^{2} f^{n}\right) }^{2}}}\right] ,\nonumber \\ \end{aligned}$$
(18)
$$\begin{aligned} {E}^{2}={A}^{2}{r}^{2}\left[ {\frac{n\,f^{2}\,A{r}^{2}(n-2) + D f^{n}[2\,\left( 1-n \right) \,f +3\,D f^{n}]}{2{\left( \,1+{A}^{2}{r}^{4}+2\,{{r}}^{2}+ D A{r}^{2} f^{n}\right) }^{2}}}\right] ,\nonumber \\ \end{aligned}$$
(19)

where \(f=\left( 1+A{r}^{2}\right) \), \(E={\frac{q}{{r}^{2}}}\), and \(D=A\,B\,{n}^{2}K \).

Similarly, the expression for the pressure and the energy density are given by (profiles are shown in Fig. 2)

$$\begin{aligned} 8\,\pi \,p={A\left[ \frac{{n}^{2}A{r}^{2}f^{2}- D\,f^{n} (\,2+2\,A{r}^{2}+D A {r}^{2}f^{n})+2\,n (1+A{r}^{2})\,p_{1}}{2{\left( 1+{A}^{2}{r}^{4}+2\,A{r}^{2}+ D A {{r}^{2}}f^{n}\right) }^{2}}\right] },\nonumber \\ \end{aligned}$$
(20)
$$\begin{aligned} 8\,\pi \,\rho =A \left[ {\frac{-{n}^{2}A{r}^{2}f^{2}+2 n A {{r}^{2}}f^{2}(1+3D\,f^{n-1})+Df^{n}\,\rho _{1}}{2{(1+{A}^{2}{r}^{4}+2\,A{r}^{2}+D A {{r}^{2}}f^{n})}^{2}}}\right] ,\nonumber \\ \end{aligned}$$
(21)

where \(p_{1}=[{{2+{A}^{2}{r}^{4}+3\,A{r}^{2}+ D A{r}^{2}f^{n}}}]\),  \(\rho _{1}=[6-4 {A}^{2}{r}^{4}+2 A {r}^{2}+D A {{r}^{2}}f^{n}]\).

Table 1 Values of the model parameters DAB, and K for different charged compact stars for \(n=3.3\)

The expressions for the pressure gradients (by taking \( x = A {r}^{2}\)) are given by

$$\begin{aligned} {\frac{{\mathrm{d}p}}{{\mathrm{d}r}}}=-{\frac{2{A}^{2}r}{8\pi }}\left[ {\frac{P_{{1}}+P_{{2}}+P_{{3}}}{2{(1+2\,A {r}^{2}+A^{2}{r}^{4}+ D A{r}^{2} f ^{n})}^{3}}}\right] , \end{aligned}$$
(22)
$$\begin{aligned} {\frac{{\mathrm{d}\rho }}{{\mathrm{d}r}}}=-{\frac{2{A}^{2}r}{8\pi }}\left[ {\frac{\rho _{{1}}+\rho _{{2 }}+\rho _{{3}}}{2{(1+2\,A {r}^{2}+A^{2}{r}^{4}+ D A{r}^{2} f ^{n})}^{3}}}\right] , \end{aligned}$$
(23)

where

$$\begin{aligned} P_{{1}}= & {} 2\,D {n}^{3}{x}^{2}f^{n+1}-{n}^{2}(1+2\,x-2\,{x}^{3}-{x}^{4})\nonumber \\&+\,D{n}^{2}x f^{n} (7+8\,x+{x}^{2}+2\,D x f^{n}), \end{aligned}$$
(24)
$$\begin{aligned} P_{{2}}= & {} 2\,n f(3+7\,x+{x}^{3}+5\,{x}^{2})\nonumber \\&+\,2\,n D\,f^{n+1}(4+3\,x+{x}^{2}+ D x\,f^{n}), \end{aligned}$$
(25)
$$\begin{aligned} P_{{3}}= & {} - D f^{n}(6+12\,x+6\,{x}^{2})\nonumber \\&-\,{D}^{2}f^{2\,n}(3+4\,x+3{x}^{2}+D x\,f^{n}), \end{aligned}$$
(26)
$$\begin{aligned} \rho _{{1}}= & {} 2\,D {n}^{3}{x}^{2}f^{n+1}-{n}^{2}(1+2\,x-2\,{x}^{3}-{x}^{4})\nonumber \\&+\,D {n}^{2}x f^{n}[8\,x+{x}^{2}+7-6\,D xf^{n}], \end{aligned}$$
(27)
$$\begin{aligned} \rho _{{2}}= & {} - Df^{n}(22+36\,x+6\,{x}^{2}-8\,{x}^{3})\nonumber \\&-\,{D}^{2}f^{2\,n}(11+4\,x+3\,{x}^{2}+{D}^{2}xf^{n}), \end{aligned}$$
(28)
$$\begin{aligned} \rho _{{3}}= & {} 2\,n({1+2\,x-2\,{x}^{3}-{x}^{4}})\nonumber \\&-\,2\,n Df^{n}[-6-3\,x+10\,{x}^{2}+7\,{x}^{3}+(5-3{x})\,D x\,f^{n}].\nonumber \\ \end{aligned}$$
(29)

4 Matching condition

For any physically acceptable charged solution, the following boundary conditions must be satisfied:

(i) The interior of metric (1) for the charged fluid distribution join smoothly with the exterior of Reissner–Nordström metric

$$\begin{aligned} \mathrm{d}s^{2}= & {} -\left( 1-\frac{2M}{r} +\frac{Q^{2} }{r^{2} } \right) ^{-1} \mathrm{d}r^{2} -r^{2} (\mathrm{d}\theta ^{2} +\sin ^{2} \theta \mathrm{d}\phi ^{2} )\nonumber \\&+\,\left( 1-\frac{2M}{r} +\frac{Q^{2} }{r^{2} } \right) \mathrm{d}t^{2}, \end{aligned}$$
(30)

at the surface of charged compact stars, whose mass is the same as M at \(r=R\).

(ii) The pressure p must be finite and positive at the center \(r=0\) and it must be zero at the surface \(r = R\) of the charged fluid sphere [44].

Table 2 Numerical values of the product of n and A i.e. nA for different charged compact star models

By matching the first and second fundamental forms, the interior of the metric (1) and the exterior of the metric (30) at the boundary \(r = R\) (the Darmois–Israel condition), we can find the constants D, B, and M. These therefore can be obtained as follows:

$$\begin{aligned} D=\frac{-F^n+(n-1)AR^2\,F^n+nA^2R^4\,F^n+\sqrt{\Psi (R)\,F^{2(n+1)}}}{AR^2\,F^{2n}},\nonumber \\ \end{aligned}$$
(31)
$$\begin{aligned} B=(1+AR^2)^{-n}[1+D\,AR^2\,(1+AR^2)^{n-2}]^{-1}, \end{aligned}$$
(32)
$$\begin{aligned}&M=\frac{A{{R}}^{3}}{2}\nonumber \\&\times \,\left[ {\frac{n\,F^{2}\,A{R}^{2}(n-2) + D F^{n}[-2\,n\,\,A{R}^{2}\,F + 2\,F\,(2\,F-1)+3\, D A{R}^{2}\,F^{n}]}{2{\left( F^{2}+ D A{R}^{2} F^n\right) }^{2}}}\right] ,\nonumber \\ \end{aligned}$$
(33)

where \(F=(1+AR^2)\), \(\Psi (R)=1+2n^2A^2R^4+2\,n\,A\,R^2\,F\).

However, the value of the constant A can be determined by using the density at the surface of the star i.e. \(\rho _{s}\) at \(r=R\), so that we get

$$\begin{aligned} A={8\,\pi \,\rho _{s}}\left[ \frac{2{(F^2+2\,A{r}^{2}+D A {{R}^{2}}F^{n})}^{2}}{-{n}^{2}A{R}^{2}F^{2}+2\, n\, A\, {{R}^{2}}F^{2}(1+3D\,F^{n-1})+D\,F^{n}\,\Omega (R)}\right] ,\nonumber \\ \end{aligned}$$
(34)

where \(\Omega (R)=[6-4 {A}^{2}{R}^{4}+2 A {R}^{2}+D A {{R}^{2}}F^{n}]\).

Also the value of the constant K can be determined by using the relation \(D=A\,B\,{n}^{2}\,K\),

$$\begin{aligned} K=\frac{D}{n^2\,A\,B}. \end{aligned}$$
(35)

5 Physical features of the charged compact star models

Let us look at the results so far we have obtained in the previous section. A close observation of the results immediately reveals the following two distinct features:

(i) The metric (1) becomes flat and also the expressions for all the physical parameters, viz. pressure, energy density, electric charge etc., become zero in all the cases if we take \(A=0\). This feature shows that our solutions represent the so-called ‘electromagnetic mass model’ [17].

(ii) In this work we have taken the metric function \(\nu (r)\), with \(n \ge 2\) and have calculated the data of the stellar models for \(n=3.3\) to 1000. We come across a very interesting result: that when we increase the value of n at very large value, say higher than 100, then the product nA becomes approximately a constant C (see Table 2). So for the limit of n tending to infinity, the present metric potential \(\nu (r)\) in Eq. (16) will convert to the following form: \(\nu (r)=C{r}^{2}+ ln~B,\) which is the same as considered by Maurya et al. [11]. However, the nature of the present models, at very large value of n i.e. at infinity, can be found in Ref. [11].

Let us now, besides the above two general features, try to explore some other physical behavior of our models.

5.1 Regularity condition

  1. (i)

    Potentials at the center \(r=0\): From Eqs. (16) and (17), we observe that the metric potentials at the center \(r=0\) becomes \(e^{\lambda (0)}=1\) and \(e^{\nu (0)}=B\). This implies that metric potentials are singularity free and positive at the center. However, both are monotonically increasing function (Fig. 1).

  2. (ii)

    Pressure at the center \(r=0\): From Eq. (20), one can obtain \(p_0=A\,(2n-D)/8\,\pi \), where A and D are positive numbers. Hence, the pressure should be positive at the center and this implies that \(D<2n\).

  3. (iii)

    Density at the center \(r=0\): From Eq. (21), we get the central density \(\rho _{0}=(3\,A\,D/8\,\pi )\), which must be positive at the center. Since A is positive, D is also positive due to the positivity of \(\rho \). We know that \(D=A\,B\,n^{2}\,K\), where A, B, n all are positive. This implies that K is also a positive quantity.

5.2 Causality and well behaved condition

The speed of sound must be less than the speed of light, i.e. \(0\le V=\sqrt{\mathrm{d}p/\mathrm{d}\rho }<1\). However, for a well behaved nature of the charge solution, Canuto [45] argued that the speed of sound should monotonically decrease outward for the equation of state with an ultra-high distribution of matter. Form Fig. 3, one can observe that the speed of sound is monotonically decreasing outwards. This implies that our model for the charged fluid is well behaved.

Fig. 3
figure 3

Variation of the velocity of sound with respect to the fractional radial coordinate r/R for \(n=3.3\). For plotting this figure the values of the arbitrary constants A, B, and K are used from Table 1

It can also be observed from Fig. 3 that the velocity of sound starts decreasing from \(n=3.3\) and this clearly indicates that the solution is physically valid for the values from \(n=3.3\) onwards. However, one thing is then important to know, namely what will happen for increasing n toward a very large value. It seems possible to get a reasonable model even when n tends to infinity. This is because the product of nA becomes approximately constant for large values of n. So if we take n tending to infinity the metric \(\nu \) reduces to the case of Ref. [11] as discussed earlier in the introductory part of this Sect. 5.

5.3 Energy conditions

For physically valid charged fluid sphere, the null energy condition (NEC), the strong energy condition (SEC), and the weak energy condition (WEC) all must be satisfied simultaneously at all the interior points of the star. Therefore, in our model the following inequalities should hold good:

$$\begin{aligned}&\mathrm{NEC:} \rho +\frac{{E}^{2}}{8\pi }\ge 0, \quad \mathrm{WEC:} \rho -p+\frac{{E}^{2}}{4\pi }\ge 0,\\&\mathrm{SEC:} \rho -3p+\frac{{E}^{2}}{2\pi }\ge 0. \end{aligned}$$
Fig. 4
figure 4

Variation of energy conditions with respect to the fractional radial coordinate r/R for \(n=3.3\). For plotting this figure the values of the arbitrary constants A, B, and K are used from Table 1

In Fig. 4 we have shown the energy conditions which are in conformance with physical requirements.

5.4 Generalized TOV equation

The generalized Tolman–Oppenheimer–Volkoff (TOV) is equation [46, 47]

$$\begin{aligned} -\frac{M_G(\rho +p_r)}{r^2}e^{\frac{\lambda -\nu }{2}}-\frac{\mathrm{d}p}{\mathrm{d}r}+ \sigma \frac{q}{r^2}e^{\frac{\lambda }{2}} =0, \end{aligned}$$
(36)

where \(M_G\) is the effective gravitational mass given by

$$\begin{aligned} M_G(r)=\frac{1}{2}r^2 \nu ^{\prime }e^{(\nu - \lambda )/2}. \end{aligned}$$
(37)

Equation (36) describes the equilibrium condition for a charged perfect fluid subject to the sum total interaction between the gravitational \((F_g)\), hydrostatic \((F_h)\), and electric \((F_e)\), so that one should get

$$\begin{aligned} F_g+F_h+F_e=0, \end{aligned}$$
(38)

where

$$\begin{aligned} F_g= & {} -\frac{1}{2}\left( \rho +p\right) {{\nu }^{\prime }}\nonumber \\= & {} -{\frac{n{A}^{2}r}{8\pi }}\left[ {\frac{2\, D f^{n+1} \left( 1-A{r}^{2}+2\,nA{r}^{2} \right) +2\,n f^{3}}{2\, f {(1+2\,A{r}^{2}+{A}^{2}{r}^{4}+ D A{r}^{2} f^{n})}^{2}}}\right] ,\nonumber \\ \end{aligned}$$
(39)
$$\begin{aligned} F_h=-\frac{\mathrm{d}p}{\mathrm{d}r}, \end{aligned}$$
(40)
$$\begin{aligned} F_e={\frac{{A}^{2}r}{4\pi }}\left[ {\frac{F_{{{e1}}}+F_{{{e2}}}+F_{{{e3}}}+F_{{{e4}}}+F_{{{e5}}}}{2\,{(1+2\,A{r}^{2}+{A}^{2}{r}^{4}+ D A{r}^{2} f^{n})}^{3}}}\right] , \end{aligned}$$
(41)
$$\begin{aligned} F_{e1}= & {} -2\, D {n}^{3}{A}^{2}{r}^{4} f^{n+1}\nonumber \\&+\,{n}^{2}(3+10\,A{r}^{2}+12\,{A}^{2}{r}^{4}+6\,{A}^{3}{r}^{6}+{A}^{4}{r}^{8}), \end{aligned}$$
(42)
$$\begin{aligned} F_{e2}= & {} {n}^{2} D A{r}^{2}f^{n}(-1+4\,A{r}^{2}+5\,{A}^{2}{r}^{4}+2\,D A{r}^{2} f^{n}),\nonumber \\ \end{aligned}$$
(43)
$$\begin{aligned} F_{{{e3}}}= & {} Df^{n}[6+12\,A{r}^{2}+6\,{A}^{2}{r}^{2}\nonumber \\&+\, D f^{n} (3+4\,A{r}^{2}+3\,{A}^{2}{r}^{4}+ D A{r}^{2} f^{n})], \end{aligned}$$
(44)
$$\begin{aligned} F_{{{e4}}}= & {} 2\,n[3+10\,A{r}^{2}+12\,{A}^{2}{r}^{4}+6\,{A}^{3}{r}^{6}+{A}^{4}{r}^{8}], \end{aligned}$$
(45)
$$\begin{aligned} F_{{{e5}}}= & {} 2\,n Df^{n}[\,3+2\,{A}^{3}{r}^{6}+6\,A{r}^{2}\nonumber \\&+5\,{A}^{2}{r}^{4}+2\,D{A}^{2}{r}^{4} f^{n}]. \end{aligned}$$
(46)
Fig. 5
figure 5

Variation of different forces with respect to the fractional radial coordinate r / R for \(n=3.3\). (i) Her X-1 (top left), (ii) RXJ 1856-37 (top right), (iii) SAX J1808.4-3658 (SS1) (bottom right). (iv) SAX J1808.4-3658 (SS1) (bottom right). For plotting this figure the values of the arbitrary constants A, B, and K are used from Table 1

From the plot for the TOV equation in Fig. 5 it can be observed that the system is in static equilibrium. The sum of all the forces, like gravitational, hydrostatic, and electric forces, is zero. It is interesting to note from Fig. 5 that the gravitational force is counter balanced by the joint action of hydrostatic and electric forces.

5.5 Effective mass–radius relation

For physically valid models, the ratio of the mass and the radius of a compact star models cannot be arbitrarily large. Buchdahl [48] has imposed the stringent restriction on the mass-to-radius ratio that for the perfect fluid model it should be \(2M/R < 8/9\). However, Böhmer and Harko [49] have given the generalized expression of lower bound for a charged compact object as follows:

$$\begin{aligned} {\frac{{Q}^{4}+18\,{R}^{2}{Q}^{2}}{12\,{R}^{4}+{R}^{2}{Q}^{2}}}\le {\frac{2\,M}{R}}. \end{aligned}$$
(47)

The upper bound of the mass for charged fluid sphere was generalized by Andréasson [50] and one proved that

$$\begin{aligned} {\frac{2\,M}{R}}\le {\frac{2\,\left( 2\,{R}^{2}+3\,{Q}^{2}+2\,R\sqrt{{R}^{2}+3\,{Q}^{2}}\right) }{9\,{R}^{2}}}. \end{aligned}$$
(48)

We, therefore, conclude from the above two conditions that 2M / R must satisfy the following inequality:

$$\begin{aligned} {\frac{{Q}^{4}+18\,{R}^{2}{Q}^{2}}{12\,{R}^{4}+{R}^{2}{Q}^{2}}}\le {\frac{2\,M}{R}}\le {\frac{2\,\left( 2\,{R}^{2}+3\,{Q}^{2}+2\,R\sqrt{{R}^{2}+3\,{Q}^{2}}\right) }{9\,{R}^{2}}}.\nonumber \\ \end{aligned}$$
(49)

In this model, the effective gravitational mass has the following form:

$$\begin{aligned} M_{{\mathrm{eff}}} =4{\pi }\int _{0}^{R}\! \left( \rho +{\frac{{E}^{2}}{8\pi }} \right) {r}^{2}{\mathrm{d}r}=\frac{1}{2}R[1-{\mathrm{e}^{-\lambda \left( R \right) }}], \end{aligned}$$
(50)

which can finally be expressed as

$$\begin{aligned} M_{{\mathrm{eff}}}=\frac{1}{2}R\left[ {{{\frac{ D A{R}^{2} \left( 1+A{R}^{2} \right) ^{n-2}}{1+ D A{R}^{2} \left( 1+A{R}^{2}\right) ^{n-2}}}}}\right] . \end{aligned}$$
(51)

5.6 Surface redshift

We define the compactification factor as

$$\begin{aligned} u=\frac{M_\mathrm{eff}}{R}=\frac{1}{2}[1-{\mathrm{e}^{-\lambda \left( R \right) }}]=\frac{1}{2}\left[ {{{\frac{ D A{R}^{2} \left( 1+A{R}^{2} \right) ^{n-2}}{1+ D A{R}^{2} \left( 1+A{R}^{2}\right) ^{n-2}}}}}\right] .\nonumber \\ \end{aligned}$$
(52)

The surface redshift corresponding to the above compactness factor u is obtained:

$$\begin{aligned} Z \!=\! {\left( 1-2u\right) }^{-1/2}-1=\sqrt{1+DA{{R}^{2}}\left( 1\!+\!A{R}^{2}\right) ^{n-2}}-1.\nonumber \\ \end{aligned}$$
(53)
Fig. 6
figure 6

Variation of redshift with respect to the fractional radial coordinate r / R for \(n=3.3\). For plotting this figure the values of the arbitrary constants A, B, and K are used from Table 1

Table 3 Numerical values of physical parameters \(M\left( M_\odot \right) \), \(R~(\mathrm{km})\) and \(A{R}^{2}\) for different values of n

In Table 3 we have shown \(AR^2\), which are very much required as all the equations are dependent on \(AR^2\), specially Eq. (33). As we know that, for each different star the ratio M / R is fixed, for this purpose we suppose the value of \(AR^2\) to determine the ratio M / R from Eq. (33). The feature of Z is shown in Fig. 6.

Table 4 The energy densities and central pressure for different charged compact star candidates for \(n=3.3\)

5.7 Electric charge

The amount of charge at the center and boundary for different stars are given in Table 5. Also, from Fig. 7 it is clear that the charge profile is minimum at the center and monotonically increasing away from the center, however, it acquires the maximum value at the boundary of the stars. To convert the amount of charge in Coulomb, every value should be multiplied by a factor \(1.1659 \times 10^{20}\) in Table 5.

Table 5 The electric charge for different compact stars in the relativistic unit (km)
Fig. 7
figure 7

Variation of the electric charge (q) with respect to the fractional radial coordinate r / R for \(n=3.3\). For plotting this figure the values of the arbitrary constants A, B, and K are used from Table 1

5.8 Equation of state

In the present work as such we have not directly used any EOS. As a result of the used metric conditions, the algorithm (which is used to calculate the compact star properties) does not require an EOS. Here, in essence, the expression EOS means a function \(p(\rho )\), where p is the fluid pressure and \(\rho \) is the energy density. The resulting pressure and density profiles (see Fig. 2) follow from the solution of the differential equations after adjusting (in order to fit the properties of the known compact star candidates, e.g. Her X-1, RXJ 1856-37, SAX J1808.4-3658 (SS1) and SAX J1808.4-3658 (SS2)) the parameters AB, etc.

Let us now suppose that the pressure of the charged fluid sphere is related with the energy density, respectively, in Eqs. (20) and (21), by a parameter \(\omega \) via the EOS, \(p=\omega \,\rho \), which is given by (see Fig. 8)

$$\begin{aligned} \omega =A\left[ \frac{{n}^{2}A{r}^{2}f^{2}- D f^{n} (2+2 A{r}^{2}+D A {r}^{2}f^{n})+2n (1+A{r}^{2})p_{1}}{-{n}^{2}A{r}^{2}f^{2}+2 n A {{r}^{2}}f^{2}(1+3Df^{n-1})+Df^{n}\rho _{1}}\right] .\nonumber \\ \end{aligned}$$
(54)

In Fig. 8 the variation of the factor \(\omega \) with respect to the fractional radial coordinate (r / R) has been plotted. We note from Fig. 8 that the ratio \(\omega =p/\rho \) is less than unity throughout the interior of stars. This unique result obviously implies that the densities are dominating over the pressures everywhere inside the star and therefore the underlying fluid distribution is non-exotic in its nature [51].

Fig. 8
figure 8

Variation of the parameter \(\omega \) with respect to the fractional radial coordinate (r / R): the upper left, upper right, lower left and lower right panels, respectively, for \(n=3.3\), \(n=10\), \(n=100\), and \(n=1000\). For plotting this figure the values of the arbitrary constants A, B, and K are used from Table 1

Let us consider now another feature of Figs. 2 and 8. If one compares the different curves in these figures it seems that the EOS is different for the four presented compact star candidates. Though initially this seems unphysical as the EOS for elementary matter should be the same for all of the stars, however, it is possible that two compact stars (e.g. two quark stars or two neutron stars) have quite different EOS [52]. The idea emerging from Fig. 8 is that the general EOS must be the same but they can take separate forms for different stars. As a special example, we would like to mention the object SAX J 1808:4-3658 which was actually “by far the fastest-rotating, lowest field accretion-driven pulsar known” [52]. In Ref. [52] several EOS for rotating neutron star models are investigated which did not able to reproduce the fast rotation of the object SAX J. By taking EOS of strange star models one can understand SAX J and eventually there are two different EOS so that one has two models: SS1 and SS2 in connection with which one needs different EOS for different stars.

On the other hand, an interesting point has been demonstrated in Fig. 8 where we have shown four compact stars in four panels for different values of n and observe that variations of the EOS with the radial coordinate are, in general, different for different stars. However, by looking at Fig. 8 one can note that effectively only two different EOSs occur (Her X-1 is quite similar to RXJ 1856-37 and SAX-1 is similar to SAX-2).

6 Conclusion

We have investigated a new stellar model with spherically symmetric matter distribution under the Einstein–Maxwell spacetime. It is observed that the model represents a compact star of embedding class 1. The solutions obtained here are general in their nature having the following two specific features:

  1. (i)

    The metric becomes flat and also the expressions for the pressure, energy density and electric charge become zero in all the cases if we consider constant \(A=0\), which shows that our solutions represent the so-called ‘electromagnetic mass model’ [17].

  2. (ii)

    The metric function \(\nu (r)\), for the limit n tending to infinity, converts to \(\nu (r)=C{r}^{2}+ ln~B\), which is the same as considered by Maurya et al. [11].

We have also studied several physical aspects of the model and find that all the features are acceptable within the expected requirements of the contemporary theoretical works and observational evidence. Some salient features of these physical behaviors of our models are as follows:

  1. (1)

    Regularity condition: We have discussed the following cases:

    1. (i)

      Potentials at the center \(r=0\): From Eqs. (16) and (17), we observe that the metric potentials at the center \(r=0\) becomes \(e^{\lambda (0)}=1\) and \(e^{\nu (0)}=B\). This implies that metric potentials are singularity free and positive at the center. However, both are monotonically increasing functions (Fig. 1).

    2. (ii)

      Pressure at the center \(r=0\): From Eq. (20), one can obtain \(p_0=A\,(2n-D)/8\,\pi \), where A and D are positive. The pressure should be positive at the center and this implies that \(D<2n\).

    3. (iii)

      Density at the center \(r=0\): From Eq. (21), we get the central density \(\rho _{0}=(3\,A\,D/8\,\pi )\), which must be positive at the center. Since A is positive, D is also positive due to the positivity of \(\rho \). We know that \(D=A\,B\,n^{2}\,K\), where A, B, n are all positive. This implies that K is also positive.

  2. (2)

    Causality and well behaved condition: The speed of sound as suggested by Canuto [45] is satisfied in the presented compact star model as is evident from Fig. 3. It can be observed that the velocity of sound starts decreasing from \(n=3.3\) and this clearly indicates that the solution is well behaved from \(n=3.3\) onwards and it seems possible to get a reasonable model even when n tends to infinity.

  3. (3)

    Energy conditions: In our model all the energy conditions, viz. NEC, SEC, and WEC, are satisfied simultaneously at all the interior points of the star.

  4. (4)

    Generalized TOV equation: The generalized Tolman–Oppenheimer–Volkoff (TOV) equation [46, 47] is satisfied here and indicates that the model is in static equilibrium under the interaction between the gravitational, hydrostatic, and electric forces.

  5. (5)

    Effective mass–radius relation: We have verified that the Buchdahl [48] condition \(2M/R < 8/9\) is satisfied in our model within the stipulated range as can be observed from Table 4.

  6. (6)

    Surface redshift: The surface redshift in the present model is found to be satisfactory as can be seen from Fig. 6.

  7. (7)

    Electric charge: The amount of charge at the center and boundary for different stars can be found from Table 5. Figure 7 depicts that the charge is minimum at the center and monotonically increasing away from the center, however, it acquires the maximum value at the boundary of the stars.

  8. (8)

    Equation of state: We can form separate EOS for every star as evident from Figs. 2 and 8 from our model. This means we can predict nature of EOS for each star though initially we do not have any EOS to start with whether it is neutron star or strange star. If we restrict ourselves by choosing a specific EOS our claim of the model for compact stars would not be practically correct. Rather we choose to use metric conditions, the algorithm (which is used to calculate the compact star properties) does not require an EOS. In Fig. 8 the EOS is different for the four presented compact star candidates because there the internal constituent matters of the stars are in different proportions. However, from Fig. 8 we observe that effectively only two different EOS occur (Her-X-1 is quite similar to RXJ 1856-37 and SAX-1 is similar to SAX-2).

As a final comment, however, one may wish to consider several other aspects of the embedding class 1 metric and perform further investigations on the corresponding model for compact stars as far as ultra-modern observational evidence is concerned.