1 Introduction

Einstein’s general relativity (GR) has been fruitful in describing gravitational phenomena on both cosmological and astrophysical scales. The predictions of GR has gone beyond the realms of theory and has been successfully confirmed through a plethora of experiments. With the advancement of technology these predictions have been refined. The perihelion precession of Mercury, one of the first solar system tests of GR has been drastically improved by the collection of data from Mercury MESSENGER which orbited Mercury in 2011 [1]. The joint European-Japanese Mercury spacecraft BepiColombo project which launched in 2018 is expected to reveal more precise measurements of the peculiarities of Mercury’s orbit. The first gravitational wave events were detected in September 2015 by the LIGO and Virgo collaborations thus reinforcing the prediction of classical GR. There is no more greater signalling of the Golden Age of astrophysical observations than the 2019 capturing of the image of the black hole at the center of galaxy M87 by the Event Horizon Telescope [2].

Despite these confirmations of GR there are still many observations that leave Einstein’s classical gravity theory short. In cosmology researchers are still faced with various problems including the late-time acceleration of the Universe, dark matter and dark energy conundrums, baryon symmetry and the horizon problem, just to name a few [3]. On the other hand there are outstanding problems in astrophysics some of which include the origin of large surface redshifts in compact objects, the behaviour of matter at extreme densities such as in the core of neutron stars and the end-states of continued gravitational collapse, amongst others.

To this end researchers in gravitational physics have appealed to modified theories of gravitation in the hope of finding mechanisms that will account for the observations which cannot be resolved by GR. These modified theories must have as their weak field limit Einstein’s general relativity. A simple modification to the standard 4D theory is to accommodate more than just the linear forms of the Riemann tensor, the Ricci tensor and the Ricci scalar in the action principle. It is well-known that incorporation of just linear tensorial quantities produces second order equations of motion which are compatible with the 4D equations [4]. The so-called Einstein–Gauss–Bonnet (EGB) gravity arises from the more general class of theories called the Lovelock polynomial Lagrangians which incorporates tensorial quantities to be of quadratic order. The beauty associated with the EGB Lagrangian is that the equations of motion continue to be second order quasi-linear. There has been widespread interest in modeling compact objects within the framework of EGB gravity. Several exact solutions of the modified pressure isotropy condition have been derived and these models were shown to obey the stability, regularity and causality conditions required for stellar configurations. More ever, it was shown that higher order corrections alter physical properties such as compactness, stability and surface redshifts of stellar models. Recent work by Chakraborty and Dadhich on charged compact objects showed that for a given spacetime dimension, 4D stellar models are more compact than their pure Lovelock counterparts [5]. They further showed that an increase in the intensity of the electromagnetic field results in a greater compactification of the stellar object. They also demonstrated that within the context of 4D EGB gravity an increase in the strength of the Gauss-Bonnet coupling (behaving as an effective electric charge), leads to an increase in the compactness of the stellar object.

Besides the Lovelock gravity and the popular EGB gravity theory there are a wide spectrum of other modified gravity theories which are being frequently utilised within both cosmological and astrophysical contexts. Unimodular gravity which is based on the trace-free Einstein equations was conjured to solve the magnitude of the vacuum energy density conundrum. A hugely popular modified theory of gravitation is the so-called f(RT) theory proposed by Harko et al. [6] in which the action is the Ricci scalar R and the the trace of the energy-momentum tensor T. The Rastall theory is centered on the notion that divergence of the energy-momentum tensor is proportional to the divergence of the Ricci scalar. This has implications for the conservation of energy momentum [7]. Starobinsky in his attempt to explain the accelerated expansion of the universe put forth a theory of gravitation whose action is quadratic in the Ricci scalar. This modified theory has come to be known as the f(R) theory of gravity. Stellar modeling in f(R) gravity has received interest in the recent past which produced models which are compatible with observational data, see [8] and references therein. However, some recent works on the f(RT) theory, Rastall theory and Starobinsky f(RT)-function can be seen in the following Refs. [9,10,11,12,13]. The Brans–Dicke (BD) gravitational theory was the first of many scalar-tensor theories of gravitation in which the non-minimally coupled scalar field represents the spacetime-varying gravitational “constant”. The BD gravity theory successfully incorporated Mach’s principle. The BD gravity theory of gravitation is also called the Jordan–Brans–Dicke gravity theory which is a theoretical framework that can be represented in Jordan–Brans–Dicke gravity as well as Einstein’s frame. It continues to be one of the more popular theories of modified classical GR and has been widely utilised in cosmological models. BD gravity has elegantly explained the inflationary epoch of the universe and the current accelerated phase of the universe without invoking any exotic matter fields or dissipative processes [14]. An emergent universe via quantum tunneling within a Jordan–Brans–Dicke framework has been recently proposed by Labrana and Cossi [15]. The initial static universe is supported by a scalar field contained within a false vacuum. The staticity of the model is broken via quantum tunneling in which the scalar field decays into a true vacuum and the universe begins to evolve dynamically. In a recent study within the Brans–Dicke framework motivated by a \(f(R) = R + \alpha R^n - \delta R^{2-n}\) modified Starobinsky model inflation and a nonzero residual value for the Ricci scalar was obtained. More importantly, it was shown in the high energy limit (BD theory with a Jordan framework) predictions are consistent with data obtained by PLANCK or BICEP2 [16]. On the astrophysical front recent work by several authors using the BD formalism have successfully generated models of anisotropic compact objects [17, 18]. Sharif and Majid [19] obtained models of anisotropic bounded configurations via gravitational decoupling through MGD approach. They show that the stability of the model is affected by the anisotropy parameter which is inherently linked to the decoupling constant.

We have seen a virtual explosion of exact solutions describing compact objects in classical GR and modified gravity theories. The past decade in particular has seen a proliferation of realistic stellar models which have catapulted the search for solutions of the field equations into mainstream astrophysics. Solution-generating methods have been inherently linked to physical viability tests which are backed by observational data. The Karmarkar condition has been extensively utilised to generate compact objects in which the radial and transverse stresses are unequal at each interior point of the stellar fluid [20,21,22]. In classical GR the Karmarkar condition is immediately integrated to give a relation between the two metric potentials. This reduces the problem of finding exact solutions of the field equations to a singe-generating function [23,24,25,26,27,28,29]. In a recent paper, Hansraj and Moodly demonstrated that nonexistence of conformally flat charged isotropic fluid sphere of embedding Class one [30]. The embedding of the generalized Vaidya (GV) solution via the Karmarkar solution shows that embedding does not allow the interpretation of the generalized Vaidya spacetime as a diffusive medium. In other words, the Karmarkar condition prohibits the GV solution to be interpreted as an atmosphere composed of radiation and diffusive strings of a star undergoing dissipative collapse in the form of a radial heat flux [31]. The Karmarkar condition has been extended to incorporate time-dependent systems which include modelling shear-free, dissipative collapse [32,33,34,35]. The Karmarkar condition has been successfully used in modified gravity theories to investigate contributions from the inclusion of quadratic terms of the tensorial quantities and higher dimensional effects on compactness, stability and surface redshifts of compact objects residing in these exotic spacetimes.

The role of an equation of state (EoS) in modeling compact objects has been highlighted in several recent studies. The simple linear EoS which expresses the pressure as a linear function of the fluid density (\(p_r = \alpha \rho \)) where \(\alpha \ge \) is a constant has been extended to include \(\alpha < 0\) used in modeling so-called dark stars and phantom fields. The MIT Bag model EoS has gained popularity amongst researchers and has been successfully utilised to model compact objects in classical GR and modified gravity theories [36, 37]. The quadratic EoS, polytropic EoS and Chaplygin gas EoS have also led to physically reasonable models of static stars [38,39,40]. By appealing to results in quantum chromodynamics and quark interactions within the stellar core, the so-called colour-flavoured-Locked (CFL) EoS has been recently used in obtaining models of compact objects which approximate realistic neutron stars, pulsars and strange stars to a very good degree [41, 42]. The CFL EoS has also been employed to study the surface tension of neutron stars. This study shows that the surface tension is sensitive to the magnitude of the Bag constant [43]. It was observed that larger values of the Bag constant led to stellar models with lower tangential pressures and surface tensions.

The role of the electromagnetic field in the (in)stability of compact objects has occupied the interest of researchers since the discovery of the Schwarzschild solution. The study of charged objects in general relativity has taken a different and refreshing trajectory compared to the early attempts at just finding exact solutions to the Einstein-Maxwell system. The theoretical possibility of celestial models endowed with an electric field has been studied by several researchers [44,45,46,47,48]. As early as 1924 Rosseland [49] (see also Eddington [50]), investigated the possibility that a self-gravitating stellar structure within the framework of Eddington’s theory, where the stellar structure is treated as a ball of hot ionized gases containing a considerable quantity of charge. In such a system, the large number of lighter particles (electrons) as compared to positive heavier particles (ions) escape from its surface due to their higher kinetic energy and this migration of electrons continues resulting in an induced electric field within the core of the compact stellar structure. In this respect, equilibrium is achieved after a certain amount of electrons escape and the net electric charge approaches to about 100 Coulombs per solar mass. As shown by the authors [51], this result applies to any bounded system whose size is smaller than the Debye length of the surrounding media. In his seminal paper addressing hydrostatic equilibrium and the gravitational collapse of charged bodies, Bekenstein argues that the densities within neutron star cores may lead to electric fields whose magnitudes may exceed the critical field required for pair creation, \(10^{16}\) V/cm, and hence annihilate themselves. On the other hand, the possibility of a collapsing charged stellar structure to a point singularity might be avoided by the presence of charge. Ghezzi’s work on charged neutron stars showed that the outcome of gravitational collapse is sensitive to the charge to mass ratio, \({Q}/{\sqrt{G}\mu }\). Simulations based on various values of this ratio predict several possible outcomes of collapse which include the formation of black holes, naked singularities or exploding remnants. An interesting outcome of this study is that extremal black holes cannot form from the collapse of a charged fluid sphere. This huge body of work on static, charged stellar objects has provided us with more questions than answers and has prompted an invigorated interest in studying the effect of charge on the hyrdostatic equilibrium or dynamical collapse of such configurations. Herein lies the motivation for our study of charged compact objects within the BD framework with a massive scalar field. It is important to note that these toy models play an important role in checking numerical results and simulations. In this way, it is clear that stellar objects can be endowed with nonzero charge which can give rise to high intensity electric fields [52,53,54]. The Einstein-Maxwell system can be interpreted as representing an anisotropic fluid with the pressure isotropy condition becoming the definition of the electric field. A recent paper by Maurya and Tello-Ortiz [55] highlighted an interesting interplay between the anisotropy parameter and the electric field intensity which provides a mechanism for maintaining stability of the stellar configuration. They found that the force due to the pressure anisotropy initially dominates the Coulombic repulsion closer to the center of the star with the anisotropic force out-growing the Coulombic repulsion towards the surface layers of the star. A similar phenomenon was discovered in a charged compact star of embedding Class one [56]. The effect of charge on stellar characteristics within the framework of Einstein–Gauss–Bonnet (EGB) gravity has been investigated. It is found that mass-radius relation and surface redshifts are modified by the presence of the EGB coupling constant [57].

This paper is structured as follows: In Sect. 2. we provide the necessary equations within the BD formalism necessary to model a charged compact object. The Class one embedding condition is derived for the BD framework in Sect. 3. The junction conditions required for the smooth matching of the interior spacetime to the Reissner-Nordström-de Sitter (RNdS) exterior is presented in Sect. 4. In Sect. 5 we discuss the regularity of the metric functions and thermodynamical quantities at the center of the stellar configuration and we derive the modified TOV equation in the presence of a massive scalar field. The nonzero charge density and pressure anisotropy together with mass-radius relation and moment of inertia thorough \(M{-}R\) and \(M{-}I\) curves have been discussed in Sect. 5. A detailed discussion of the physical attributes together with the conclusion of our model follows in Sect. 6.

2 The background of Brans–Dicke gravity theory and field equations

The action of scalar-tensor theory in Brans–Dicke frame in relativistic units \(G=c=1\) is defined as,

$$\begin{aligned} S&= \frac{1}{16\pi }\int \bigg [\mathscr {R}\varPhi -\frac{\omega _{BD}}{\varPhi } \nabla ^i\nabla _i \varPhi -\mathscr {L}(\varPhi )\bigg ]\sqrt{-g}~ d^{4}x\nonumber \\&\quad +\int \mathscr {L}_m \sqrt{-g}~ d^{4}x+\int \mathscr {L}_e \sqrt{-g}~ d^{4}x, \end{aligned}$$
(1)

where \(\mathscr {R}\), g, \(\mathscr {L}_m\), and \(\mathscr {L}_e\) describe the Ricci scalar, determinant of metric tensor, matter Lagrangian density, and Lagrangian electromagnetic field respectively, while \(\omega _{BD}\) is a dimensionless Dicke coupling constant and \(\varPhi \) is a Brans–Dicke scalar field. Here the function \(\mathscr {L}(\varPhi )\) depends completely on the scalar field \(\varPhi \). In the present case we define this scalar field function \(\mathscr {L}(\varPhi )\) as,

$$\begin{aligned} \mathscr {L}(\varPhi )=\frac{1}{2} m_{\phi }^2 \varPhi ^2 \end{aligned}$$
(2)

Now by varying of the action (1) with respect to the metric tensor \(g^{ij}\) and scalar field \(\varPhi \) provides the following field equations and evaluation equation, respectively, which can be written as,

$$\begin{aligned} G_{ij}=-\frac{1}{\varPhi }\bigg [8\pi T^{(m)}_{ij}+8\pi E_{ij}+T^{(\varPhi )}_{ij}\bigg ], \end{aligned}$$
(3)

where, \(T^{(m)}_{ij}\) and \(E_{ij}\) denote the energy-momentum tensor for matter distribution and electromagnetic field tensor, respectively while \(T^{(\varPhi )}_{ij}\) represents a scalar tensor appearing in the system due to the scalar field \(\varPhi \). All the field tensors can be written as,

$$\begin{aligned} T^{(m)}_{ij}= & {} (\rho +p_t) u_i u_j-p_t g_{ij}+(p_r-p_t)v_iv_j, \end{aligned}$$
(4)
$$\begin{aligned} E_{ij}= & {} \frac{1}{4 \pi } \left( -F^{n}_{i}F_{j\,n} + \frac{1}{4}{g_{ij}} F_{\gamma \,n}F^{\gamma \,n} \right) , \end{aligned}$$
(5)
$$\begin{aligned} T^{(\varPhi )}_{ij}= & {} \varPhi _{,i;j}-g_{ij} \Box \varPhi +\frac{\omega _{BD}}{\varPhi } \bigg (\varPhi _{,i}\, \varPhi _{,j} -\frac{g_{ij} \varPhi _{,\delta }\,\varPhi ^{,\delta }}{2}\bigg )\nonumber \\&-\frac{\mathscr {L}(\varPhi )\,g_{ij}}{2}.~~~~~~~ \end{aligned}$$
(6)

Here, \(\Box \) denotes the d’Alembert operator, then \(\Box \varPhi \) can be given as,

$$\begin{aligned} \Box \varPhi = \frac{T^{(m)}}{3+2\,\omega _{BD}}+\frac{1}{3+2\, \omega _{BD}} \bigg (\varPhi \frac{d \mathscr {L}(\varPhi )}{d\varPhi }-2 \mathscr {L}(\varPhi ) \bigg ), \end{aligned}$$
(7)

Here, \(\rho \), \(p_r\) and \(p_t\) denote the energy density, radial pressure and transverse pressure, respectively with \(T^{(m)}\) being the trace of the energy tensor \(T^{(m)}_{ij}\). Since we are interested in spherically symmetric stellar structure, then we assume a static spherically symmetric line element which can be cast as,

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

where \(\xi (r)\) and \(\eta (r)\) are metric potentials and rely just upon the radial distance r that ensures the static nature of the space-time. Also, \(u^i=e^{-\xi /2}\delta ^i_0\) and \(v^i=e^{-\eta /2}\delta ^i_1\), given in Eq. (5), are denoting the four-velocity and the unit space like vector respectively, which are specified as, \(u^iu_i=1\) and \(v^iv_i=-1\), and \(\Box \varPhi =\varPhi ^{,i}_{; i}=(-g)^{-1/2} [(-g)^{-1/2}\,\varPhi ^{,i}]_{,i}\).

In addition, the anti-symmetric electromagnetic field tensor \(F_{i j}\) given in Eq. (5) is characterized as

$$\begin{aligned} F_{ij}=\nabla _{i}\,A_{j}-\nabla _{j}\,A_{i} \end{aligned}$$
(9)

for which Maxwell’s equations have been satisfied,

$$\begin{aligned} F_{i j,k} + F_{j k,i}+F_{k i, j}=0 \end{aligned}$$
(10)

with

$$\begin{aligned} F^{ik}\,_{;\,k} = 4\pi \,J^i \end{aligned}$$
(11)

where, \(J^i\) is the electromagnetic 4-current vector. This can be expressed as

$$\begin{aligned} J^{i}=\frac{\sigma }{\sqrt{g_{00}}}\,\frac{dx^i}{dx^0}=\sigma \,u^i, \end{aligned}$$
(12)

where \(\sigma =e^{\xi /2}\,J^{0}(r)\) representing the charge density. It turns out that for a static matter distribution with spherical symmetry, there is only one non-zero component of the electromagnetic 4-current \(J^i\) which is \(J^0\), a function of the radial distance, r. The \(F^{01}\) and \(F^{10}\) components are the only non-zero components of electromagnetic field tensor expressed in (5) and they are connected by the formula \(F^{01}=-F^{10}\), which characterizes the radial constituent of the electric field. The constituent of the electric field is determined through Eqs. (11) and (12) as follows

$$\begin{aligned} F^{01} = - F^{10}=\frac{q}{r^2}\,e^{-(\xi +\eta )/2} \end{aligned}$$
(13)

The quantity q(r) represents the effective charge of a spherical system of radial coordinate, r, subsequently, this electric charge can be characterized by the relativistic Gauss law and corresponding electric field E explicitly as,

$$\begin{aligned} q(r)= & {} 4\,\pi \int ^{r}_{0}{\sigma \,r^2\,e^{\eta /2} dr}=r^2\,\sqrt{-F_{10}\,F^{10}} \end{aligned}$$
(14)
$$\begin{aligned} E^2= & {} -F_{10}\,F^{10}=\frac{q^2}{r^4}. \end{aligned}$$
(15)

It is noted that Doneva et al. [58] and Yazadjiev et al. [59] have already discussed both slowly and rapidly rotating neutron stars by using the above potential function (2). By using Eqs. (2)–(8), we obtain the following field equations,

$$\begin{aligned}&{\mathrm{e}^{-\eta }}\left( {\frac{\eta ^{{\prime }}}{r}}-\frac{1}{r^2}\right) +\frac{1}{r^2}=\frac{1}{\varPhi } \bigg (8\pi \rho +\frac{q^2}{r^4}+T^{0(\varPhi )}_0 \bigg ), \end{aligned}$$
(16)
$$\begin{aligned}&{\mathrm{e}^{-\eta }} \left( {\frac{\xi ^{{\prime }}}{r}}+\frac{1}{r^2}\right) -\frac{1}{r^2}=\frac{1}{\varPhi } \bigg ( 8\pi p_r-\frac{q^2}{r^4}-T^{1(\varPhi )}_1 \bigg ), \end{aligned}$$
(17)
$$\begin{aligned}&\frac{\mathrm{e}^{-\eta }}{2} \left( \xi ^{{\prime \prime }}+\frac{{\xi ^{{\prime }}}^{2}}{2}+{\frac{\xi ^{{\prime }}-\eta ^{{\prime }}}{r}}-\frac{\xi ^{{\prime }}\eta ^{{\prime }}}{2} \right) \nonumber \\&\quad =\frac{1}{\varPhi } \bigg (8\pi p_t +\frac{q^2}{r^4}-T^{2(\varPhi )}_2 \bigg ), \end{aligned}$$
(18)

where prime denotes differentiation with respect to r. On the other hand, the scalar tensor components \(T^{0(\varPhi )}_0\), \(T^{1(\varPhi )}_1\), and \(T^{2(\varPhi )}_2\) in terms of \(\xi \) and \(\eta \) are given as,

$$\begin{aligned} T^{0(\varPhi )}_0= & {} e^{-\eta } \bigg [\varPhi ^{\prime \prime }+\bigg (\frac{2}{r}-\frac{\eta ^{\prime }}{2}\bigg )\varPhi ^{\prime }+\frac{\omega _{BD}}{2\varPhi } \varPhi ^{\prime 2} \nonumber \\&-e^{\eta }\,\frac{\mathscr {L}(\varPhi )}{2} \bigg ],~~~~ \end{aligned}$$
(19)
$$\begin{aligned} T^{1(\varPhi )}_1= & {} e^{-\eta } \bigg [\bigg (\frac{2}{r}+\frac{\xi ^{\prime }}{2}\bigg )\varPhi ^{\prime }-\frac{\omega _{BD}}{2\varPhi } \varPhi ^{\prime 2}-e^{\eta }\,\frac{\mathscr {L}(\varPhi )}{2} \bigg ], \nonumber \\ \end{aligned}$$
(20)
$$\begin{aligned} T^{2(\varPhi )}_2= & {} e^{-\eta } \bigg [\varPhi ^{\prime \prime }+\bigg (\frac{1}{r}-\frac{\eta ^{\prime }}{2} +\frac{\xi ^{\prime }}{2}\bigg )\varPhi ^{\prime }+\frac{\omega _{BD}}{2\varPhi } \varPhi ^{\prime 2}\nonumber \\&-e^{\eta }\,\frac{\mathscr {L}(\varPhi )}{2} \bigg ].~~~~~~ \end{aligned}$$
(21)

However, from Eqs. (7) and (8) we obtain,

$$\begin{aligned} \Box \varPhi= & {} -e^{-\eta } \bigg [\bigg (\frac{2}{r}-\frac{\eta ^{\prime }}{2}+\frac{\xi ^{\prime }}{2}\bigg )\varPhi ^{\prime }(r)+\varPhi ^{\prime \prime }(r)\bigg ]\nonumber \\= & {} \frac{1}{(3+2\,\omega _{BD})}\bigg [T^{(m)}+\varPhi \frac{d \mathscr {L}(\varPhi )}{d\varPhi }-2\,\mathscr {L}(\varPhi )\bigg ]. \end{aligned}$$
(22)

It has been argued that extreme temperatures and pressures at the core of massive neutron stars can transform into quark stars with up (u), down (d) and strange (s) quark flavors. In this regard, we suppose that the MIT Bag model rules the matter variables (density and pressure) in the interior of these relativistic massive stars. In addition, we assume that non-interacting and massless quarks occupy the inside of the stellar structures. According to the MIT Bag model the quark pressure \(p_r\) can be cast as

$$\begin{aligned} p_r=\sum _{f} p^{f}-\mathscr {B},~~~~f=u,~d,~s \end{aligned}$$
(23)

where \(p^{f}\) describes the individual pressures due to each quark flavor which is balanced by the Bag constant (or total external Bag pressure) \(\mathscr {B}\). The deconfined quarks inside the MIT Bag model have the accompanying total energy density

$$\begin{aligned} \rho =\sum _{f} \rho ^{f}+\mathscr {B}, \end{aligned}$$
(24)

where \(\rho ^f\) indicates the matter density due to each flavor which is connected to the corresponding pressure by the formula given as \(\rho ^f=3\,p^f\). Consequently, Eqs. (23) and (24) are consolidated to express the following simplified MIT Bag model,

$$\begin{aligned} p_r=\frac{1}{3}(\rho -4\mathscr {B}), \end{aligned}$$
(25)

It should be mentioned here that this specific linear form of the MIT Bag model EoS has been applied for portraying the stellar systems made of the strange quark matter distribution in pure GR and modified gravity theories.

Now using the Eqs. (16) and (17) along with EoS (25), we obtain the expression for the electric field as,

$$\begin{aligned} \frac{4q^2}{r^4}= & {} \varPhi \,\bigg [{\mathrm{e}^{-\eta }}\left( {\frac{\eta ^{{\prime }}-3\xi ^{{\prime }}}{r}}\right) +\frac{4\,(1-e^{-\eta })}{r^2}\bigg ]\nonumber \\&-\big (3T^{1(\varPhi )}_1+T^{0(\varPhi )}_0\big )-32 \pi \mathscr {B}. \end{aligned}$$
(26)

3 Basic formulation of Class one condition and its solution in Brans–Dicke gravity

It is well-known that the embedding of n-dimensional space \(V^{n}\) in a pseudo-Euclidean space \(E^{n}\) attracted much consideration as inferred by Eisland [60] and Eisenhart [61]. In the case where a n-dimensional space \(V^{n}\) can be isometrically immersed in \((n+m)\)-dimensional space, where m is a minimum number of supplementary dimensions, at this stage \(V^{n}\) is said to be m-Class embedding. Habitually, the metric expressed in (8) provides the four-dimensional spherically symmetric space-time which describes a space-time of Class two i.e, when \(m=2\), which shows that it is embedded in a six-dimensional pseudo-Euclidean space. On the other hand, it should be noted that one can reveal a possible parametrization in order to incorporate the space-time expressed in (8) into a five-dimensional pseudo-Euclidean space which leads to Class \(m=1\) known as embedding Class one [60,61,62]. For a spherically symmetric space-time in both cases static or non-static to be Class-one, the system has to be consistent with the following necessary and suitable conditions:

  • For a stellar system, the symmetric tensor \(b_{ij}\) should be determined under the associated Gauss conditions:

    $$\begin{aligned} \mathscr {R}_{ijhk}=\epsilon \Big (b_{ih}b_{jk}-b_{ik}b_{jh}\Big ), \end{aligned}$$
    (27)

    where \(\epsilon =\pm 1\) is everywhere normal to the manifold is time-like (+1) or space-like (-1).

  • The symmetric tensor \(b_{ij}\) must fulfill the following differential equation, known as Codazzi equation, as:

    $$\begin{aligned} \nabla _{h}b_{ij}-\nabla _{i}b_{hj}=0. \end{aligned}$$
    (28)

Now the non-vanishing Riemann components for the line element (8) can be expressed as follows,

$$\begin{aligned}&\mathscr {R}_{0101}{=}-e^{\xi }\left( \frac{\xi ^{\prime \prime }}{2}{-}\frac{\eta ^{\prime }\xi ^{\prime }}{4}+\frac{\xi ^{\prime 2}}{4}\right) ;\nonumber \\&\qquad \mathscr {R}_{1313}=-\frac{r}{2}\eta ^{\prime }\sin ^2\theta ; ~~ \nonumber \\&\mathscr {R}_{2323}=\frac{r^{2}\sin ^{2}\theta }{e^{\eta }}\Big (1-e^{\eta }\Big );~\mathscr {R}_{0303}=-\frac{r}{2}\xi ^{\prime }e^{\xi -\eta }\sin ^2\theta ~;\nonumber \\&\mathscr {R}_{0202}=-\frac{r}{2}\xi ^{\prime }e^{\xi -\eta }~;~~\mathscr {R}_{1212}=-\frac{r}{2}\eta ^{\prime }. \end{aligned}$$
(29)

Substituting these Riemann components into Gauss’s equation (27) leads to

$$\begin{aligned}&\!\!\! b_{01}b_{33}=\mathscr {R}_{1303}=0;~ b_{01}b_{22}=\mathscr {R}_{1212}=0;\nonumber \\&\qquad ~b_{00}b_{33}=\mathscr {R}_{0303};\nonumber \\&b_{00}b_{22}=\mathscr {R}_{0202}; ~ b_{11}b_{33}=\mathscr {R}_{1313}; ~~~ b_{22}b_{33}=\mathscr {R}_{2323}; \nonumber \\&b_{11}b_{22}=\mathscr {R}_{1212}; ~~ b_{00}b_{11}=\mathscr {R}_{0101}. \end{aligned}$$
(30)

These relations expressed in (30) lead immediately to the following expressions

$$\begin{aligned}&\left( b_{00}\right) ^{2}=\frac{\left( \mathscr {R}_{0202}\right) ^{2}}{\mathscr {R}_{2323}}\sin ^{2}\theta ;~\left( b_{11}\right) ^{2}=\frac{\left( \mathscr {R}_{1212}\right) ^{2}}{\mathscr {R}_{2323}}\sin ^{2}\theta ;\nonumber \\ ~~&\left( b_{22}\right) ^{2}=\frac{\mathscr {R}_{2323}}{\sin ^{2}\theta }; ~~ \left( b_{33}\right) ^{2}=\sin ^{2}\theta ~ \mathscr {R}_{2323}.~~~~~ \end{aligned}$$
(31)

By combining the last term of the relation (30) together with the components of Eq. (31), we found the following relationship in terms of the Riemann components

$$\begin{aligned} \mathscr {R}_{0202}\mathscr {R}_{1313}=\mathscr {R}_{0101}\mathscr {R}_{2323}, \end{aligned}$$
(32)

subject to \(\mathscr {R}_{2323}\ne 0\) (Pandey and Sharma condition [63]). It ought to be noticed that all the components are given in (31) fulfill the Codazzi equation (28). On the other hand, in the case of a general non-static spherically symmetric space-time, the relation between components for symmetric tensor \(b_{ij}\) and Riemann tensor \(R_{ijhk}\) can be given as follows

$$\begin{aligned} b_{01}b_{22}=\mathscr {R}_{1212} \quad \text{ and }\quad b_{00}b_{11}-\left( b_{01}\right) ^{2}=\mathscr {R}_{0101}, \end{aligned}$$
(33)

where \(\left( b_{01}\right) ^{2}=\sin ^{2}\theta \left( \mathscr {R}_{1202}\right) ^{2}/\mathscr {R}_{2323}\). In this situation, the embedding Class-one condition known as Karmarkar condition [60, 62] takes the following form

$$\begin{aligned} \mathscr {R}_{0202}\mathscr {R}_{1313}=\mathscr {R}_{0101}\mathscr {R}_{2323}+\mathscr {R}_{1202}\mathscr {R}_{1303}. \end{aligned}$$
(34)

Although in our circumstance, the relation (32) between Riemann components under the static spherically symmetric line element (8) will be equivalent to relation (34). The condition (34) plays a fundamental role for describing the space-time (8) to be a Class-one, which is also well-known as a necessary and sufficient condition. At this point, by incorporating the Riemann components in expression (34), we obtain the following differential equation,

$$\begin{aligned} ~~~~\frac{2\xi ''}{\xi ^{\prime }}+\xi '=\frac{\eta 'e^{\eta }}{e^{\eta }-1}, \end{aligned}$$
(35)

with \(e^{\eta }\ne 1\). By integrating equation (35), we find the relationship amongst the gravitational potentials in the following form

$$\begin{aligned} ~~~~\xi (r)=2 \ln \left[ A+B\int \sqrt{e^{\eta }-1}\,dr\right] . \end{aligned}$$
(36)

Here A and B are integration constants. Moreover, the solution determined by the relation (36) is called a embedding Class one solution for the line element (8). It is mentioned that the above method has been utilized to model compact stellar objects in various contexts. In order to find the solution of the field Eqs. (16)–(18) in Brans–Dicke gravity under Class I condition (36), we need to find the metric potentials admitting Karmarkar condition with Pandey–Sharma  condition [63] (\(\mathscr {R}_{2323}\ne 0\)). As it is well-known in general, the invariance of the Ricci tensor necessitates that the matter variables viz., energy density \(\rho \), radial pressure \(p_r\) and transverse pressure \(p_t\) ought to be finite at the center. The regularity of the Weyl invariant necessitates that the following two quantities: mass m(r) and electric charge q(r) must satisfy the following conditions: \(m(0)=q(0)=0\) and \(m(0)=0\), \(m^{\prime }(r)> 0\) and \(q(0)=0\), \(q^{\prime }(r) > 0\) i.e., both said quantities reach their minimum and maximum values at the center as well as at the surface of the celestial body, respectively. In this regard, Maurya and collaborators [84] have already demonstrated that the gravitational potential \(\xi (0)\) is equal to a finite constant value, \(q(0) = 0\), \(\xi ^{\prime }(0) = 0\) and \(\xi ^{\prime \prime }(0)>0\) according to the modelling of charged anisotropic compact celestial bodies. Since both physical quantities viz., energy density \(\rho \) and radial pressure \(p_r\) are positive finite and continuous and also pursue the condition \(r>2m(r)\) [85, 86]. From \(p_r(r)\ge 0\) with the help of the condition \(r>2m(r)\), we can obtain \(\xi ^\prime \ne 0\), which implies that the general function \(\xi (r)\) is regular minimum at the center and a monotonic increasing function of the radial coordinate r. Consequently, the general function \(\xi (r)\) should conserve the said physical characteristics. Moreover, the gravitational potential function \(e^{\eta }\) should fulfill the accompanying form \(e^{\eta }=1+O(r^2)\) to ensure the regularity and stability of the compact stellar object. In this way by keeping all the attributes in our mind, we have assumed the \(e^\eta \) as follow:

$$\begin{aligned} e^{\eta (r)} = 1+a r^2 \, e^{b \,r^2}. \end{aligned}$$
(37)

Using (37) in (36), we get

$$\begin{aligned} \xi (r) = 2 \ln \left[ A+C \, e^{\,b r^2/2}\right] . \end{aligned}$$
(38)

where, \(C=\frac{\sqrt{a}\, B}{b}\). Furthermore, the explicit expression for energy density and pressure can be given as,

$$\begin{aligned}&8\pi \rho = \frac{1}{4\varPhi \, (A + C e^{b r^2/2})\, (1 + a e^{b r^2} r^2)^2} \nonumber \\&\quad \times \bigg (C\,e^{b r^2/2}\big [6 a e^{b r^2} \varPhi ^2\nonumber \\&+ 32 \mathscr {B} \varPhi \pi + 3 a \varPhi ^{\prime } e^{b r^2} \varPhi r + \big (2+ar^2e^{b r^2}\big ) a \mathscr {B} e^{b r^2} \varPhi \nonumber \\&\times \pi r^2 -3 \varPhi ^{\prime \prime } \varPhi (1 + a e^{b r^2} r^2)+ 3 b \varPhi (2 \varPhi + \varPhi ^{\prime } r)(1 + 2 a\nonumber \\&\times e^{b r^2} r^2) - 3 \varPhi ^{\prime 2} \omega _{BD} - 3 a \varPhi ^{\prime 2} e^{b r^2} r^2 \omega _{BD}\big ]+ A\, [32 \mathscr {B} \nonumber \\&\times \varPhi \, \pi + 32\, a^2\, \mathscr {B}\, e^{2b r^2}\, \varPhi \, \pi \, r^4 - 3 \varPhi ^{\prime \prime } \varPhi (1 + a e^{b r^2} r^2)\nonumber \\&-3 \varPhi ^{\prime 2} \omega _{BD} + a e^{b r^2} \{6 \varPhi ^2 (1 + b r^2) + \varPhi r (3 \varPhi ^{\prime } + 64 \mathscr {B}\nonumber \\&\times \pi r + 3 b \varPhi ^{\prime } r^2) - 3 \varPhi ^{\prime 2} r^2 \omega _{BD}\}]\bigg ), \end{aligned}$$
(39)
$$\begin{aligned}&8\pi p_r = \frac{8\,\pi }{3} ( \rho -4\,\mathscr {B}), \end{aligned}$$
(40)
$$\begin{aligned}&8\pi p_t =\frac{1}{4\varPhi \,r\, (A + C e^{b r^2/2})\, (1 + a e^{b r^2} r^2)^2}\bigg (C\,e^{b r^2/2} \big [\varPhi ^{\prime }\, \varPhi \nonumber \\&\times (12 + 7\, b\,r^2 + 7\,a\,e^{b r^2}\, r^2 + 2\,a\,b\,e^{b r^2} r^4) + \varPhi \, r \,\big (5 \varPhi ^{\prime \prime }\nonumber \\&+ 14\,b\,\varPhi - 10\,a\,e^{b r^2} \varPhi - 2 m^2_{\phi } \varPhi ^2 + 32 \mathscr {B} \pi + 5 \,a\, \varPhi ^{\prime \prime }\,\nonumber \\&\times e^{b r^2} r^2 + 4 b^2 \varPhi r^2 + 4\, a\, b\, e^{b r^2} \varPhi \, r^2 - 4 \,a^2\, e^{2b r^2} \varPhi \, r^2 \nonumber \\&- 4\, a\, e^{b r^2} m^2_{\phi } \varPhi ^2\, r^2 + 64\, a \, \mathscr {B}\, e^{b r^2} \pi \, r^2 - 2 a^2 \, e^{2b r^2}\, \nonumber \\&\times m^2_{\phi } \varPhi ^2\, r^4 + 32 \,a^2\, \mathscr {B}\, e^{2b r^2}\,\pi \, r^4\big ) + \varPhi ^{\prime 2} r (1 + a e^{b r^2} r^2)\nonumber \\&\times \omega _{BD} \big ] + A \big \{-\varPhi ^{\prime } \varPhi [-12 + a e^{b r^2} r^2 (-7 + 5 b r^2)] + \varPhi \, r\nonumber \\&\times \big \{5 \varPhi ^{\prime \prime } (1 + a e^{b r^2} r^2) - 2 (m^2_{\phi }\varPhi ^2 - 16 \mathscr {B} \pi + a e^{b r^2} (5 \varPhi \nonumber \\&+ 3 b \varPhi r^2 + 2 m^2_{\phi } \varPhi ^2 r^2 - 32 \mathscr {B} \pi r^2) + a^2 e^{2b r^2} r^2 (2 \varPhi \nonumber \\&+ m^2_{\phi } \varPhi ^2 r^2 - 16 \mathscr {B} \pi r^2))\big ] + \varPhi ^{\prime 2} r (1 + a\, e^{b r^2} r^2) \omega _{BD}\big \}\bigg ).\nonumber \\ \end{aligned}$$
(41)

Consequently, the expression for the electric field intensity can be obtained from the Eq. (26) as,

$$\begin{aligned} E^2= & {} \frac{1}{4\varPhi \,r\, (A + C e^{b r^2/2})\, (1 + a e^{b r^2} r^2)^2}\bigg (C\,e^{b r^2/2} \big [-\varPhi \, r\, (\varPhi ^{\prime \prime }\nonumber \\&+ 6 b \varPhi - 6 a e^{b r^2} \varPhi - m^2_{\phi } \varPhi ^2 + 32\, \mathscr {B}\, \pi + a \varPhi ^{\prime \prime } e^{b r^2} r^2 + 4 a b \nonumber \\&\times e^{b r^2} \varPhi r^2 - 4 a^2 e^{2b r^2} \varPhi r^2 - 2 a e^{b r^2} m^2_{\phi } \varPhi ^2 r^2 + 64 a \mathscr {B} e^{b r^2} \nonumber \\&\times \pi \, r^2 - a^2\, e^{2b r^2} m^2_{\phi }\, \varPhi ^2\, r^4 + 32 a^2 \mathscr {B} e^{2b r^2} \pi r^4) - \varPhi ^{\prime } \varPhi (8 + \nonumber \\&\times 7 a e^{b r^2} r^2 + b r^2 (3 + 2 a e^{b r^2} r^2)) + \varPhi ^{\prime 2} r (1 + a e^{b r^2} r^2) \omega _{BD}\big ] \nonumber \\&+ A \big \{\varPhi ^{\prime }\, \varPhi (-8 + a e^{b r^2} r^2 (-7 + b r^2)) + \varPhi \, r\, \big [m^2_{\phi } \varPhi ^2 - 32 \nonumber \\&\times \mathscr {B} \pi - \varPhi ^{\prime \prime } (1 + a e^{b r^2} r^2) + a^2 e^{2b r^2}\, r^2\, (4 \varPhi + m^2_{\phi } \varPhi ^2 r^2 - 32 \nonumber \\&\times \mathscr {B} \pi r^2)+ 2 a e^{b r^2} (3 \varPhi + b \varPhi r^2 + m^2_{\phi } \varPhi ^2 r^2 - 32 Bg \pi r^2)\big ] \nonumber \\&+ \varPhi ^{\prime 2} r (1 +a e^{2b r^2} r^2) \omega _{BD}\big \}\bigg ). \end{aligned}$$
(42)

4 Junction conditions

To describe the complete structure of the self gravitating anisotropic compact object, the interior spacetime must be matched smoothly with the exterior spacetime at the pressure-free boundary \(\Sigma \). The exterior spacetime is considered to be the Reissner–Nordström–de Sitter (RNdS) spacetime given by,

$$\begin{aligned} ds^2_+= & {} - \bigg (1-\frac{2{\mathscr {M}}}{r}+\frac{Q^2}{r^2}-{\Lambda \over 3}~r^2\bigg )^{-1} dr^2-r^2 \Big (d\theta ^2 \nonumber \\&-\sin ^2\theta \,d\phi ^2 \Big )+\bigg (1-\frac{2{\mathscr {M}}}{r}+\frac{Q^2}{r^2}-{\Lambda \over 3}~r^2\bigg )\,dt^2,~\nonumber \\ \end{aligned}$$
(43)

where, \(\mathscr {M}\) is the total mass, Q the total charge and \(\Lambda \) the cosmological constant. In order to satisfy the smoothness and continuity of internal spacetime metric \(ds^2_-\) and the external spacetime \(ds^2_+\) at the boundary surface \(\Sigma \), the following conditions must be fulfilled at the hypersurface \(\Sigma \) (\(f=r-R=0\), where R is a radius).

$$\begin{aligned}& [{ds^2}_{-}]_{\Sigma } = [{ds^2}_{+}]_{\Sigma },~~~~~~~[{K_{ij}}_{-}]_{\Sigma }=[{K_{ij}}_{+}]_{\Sigma }, \end{aligned}$$
(44)
$$\begin{aligned}& [\varPhi (r)_{-}]_{\Sigma } = [\varPhi (r)_{+}]_{\Sigma },~~~~~~[\varPhi ^{\prime }(r)_{-}]_{\Sigma }=[\varPhi ^{\prime }(r)_{+}]_{\Sigma }.\nonumber \\ \end{aligned}$$
(45)

Here, as usual − and \(+\) denote the interior and exterior spacetimes, respectively while \(K_{ij}\) represents the curvature. By using the continuity of the first fundamental form (\([ds^2]_{\Sigma }\)=0), we will always get

$$\begin{aligned}&[F]_{\Sigma } \equiv F (r\longrightarrow R^{+})-F \nonumber \\&(r\longrightarrow R^{-})\equiv F^{+}(R)-F^{-}(R).\nonumber \\ \end{aligned}$$
(46)

for any function F(r). This condition provides us \(g^{-}_{rr}(R)=g^{+}_{rr}(R)\) and \(g^{-}_{tt}(R)=g^{+}_{tt}(R)\). On the other hand, the spacetime (8) must satisfy the second fundamental form (\(K_{ij}\)) at the surface \(\Sigma \) which is equivalent to the O\('\)Brien and Synge [64] junction condition. This condition says that radial pressure must be zero at boundary \(r=r_{\Sigma }\), which leads to

$$\begin{aligned} p_r(R)=0. \end{aligned}$$
(47)

In addition to above, the BD scalar field \(\varPhi \) corresponding to the vacuum Schwarzschild solution is derived using the technique in [72]. We consider \(\tau ^{-}\) and \(\tau ^{+}\) as the inner and outer space, respectively. Then the hypersurface is defined by the following line element

$$\begin{aligned} ds^2=d\gamma ^2-R^2(d\theta ^2+\sin ^2\theta \,d\phi ^2). \end{aligned}$$
(48)

where \(\gamma \) defines the proper time boundary. The extrinsic curvature of this boundary \(\Sigma \) can be written as,

$$\begin{aligned} K^{\pm }_{ij}=-m_k^{\pm }\,\frac{\partial ^2y^k_{\pm }}{\partial n^i\,n^j}-m_k^{\pm }\,\varGamma ^k_{\mu \,l}\frac{\partial y^\mu _{\pm }}{\partial n^i}\frac{\partial y^l_{\pm }}{\partial n^j} \end{aligned}$$
(49)

Here the symbol \(n^i\) defines the coordinates in the boundary \(\Sigma \), while \(m_k^{\pm }\) denotes the four-velocity normal to \(\Sigma \). The components of this four-velocity are given in the coordinates (\( y^\nu _{\pm }\)) of \(\tau ^{\pm }\) as

$$\begin{aligned} m_k^{\pm }=\pm \,\frac{df}{dy^{k}}\,\left| g^{\mu \,l}\frac{df}{dy^{\mu }}\frac{df}{dy^{l}}\right| ^{-1/2} ~~~~~\text {with}~~~m_km^k=1. \end{aligned}$$
(50)

Then the unit normal vectors for inner and outer regions can be cast as

$$\begin{aligned}&m^{-}_k=\bigg [0,e^{\eta /2},0,0\bigg ],~~~\text {and}~~~~\nonumber \\&m^{-}_k=\bigg [0,\bigg (1-\frac{2\mathscr {M}}{r}+\frac{Q^2}{r^2}-{\Lambda \over 3}~r^2\bigg )^{-1/2},0,0\bigg ].\nonumber \\ \end{aligned}$$
(51)

In view of line elements (8) and (48) together with the Reisner–Nordström spacetime (43), we can write

$$\begin{aligned} \bigg [\frac{dt}{d\gamma }\bigg ]_{\Sigma }{=}\big [e^{-\xi /2}\big ]_{\Sigma }{=}\bigg [\bigg (1-\frac{2\mathscr {M}}{r}+\frac{Q^2}{r^2}-{\Lambda \over 3}~r^2\bigg )^{-1/2}\bigg ]_{\Sigma }. \nonumber \\ \end{aligned}$$
(52)

\(\text {where}~[r]_{\Sigma }=R\). The non-zero components of the curvature \((K_{ij})\) can be obtained from Eq. (51) as,

$$\begin{aligned}&K^{-}_{00}=\bigg [-\frac{\xi ^{\prime }}{2\,e^{\eta /2}}\,\bigg ]_{\Sigma },~~~ K^{-}_{22}=\frac{1}{\sin ^2\theta }\,K^{-}_{33}= \big [r\,e^{-\eta /2}\big ]_{\Sigma },\\&K^{+}_{00}=\bigg [\bigg (\frac{\mathscr {M}}{r^2}-\frac{Q^2}{r^3}-{\Lambda \over 3}~r\bigg )\\&\qquad \times \bigg (1-\frac{2\mathscr {M}}{r}+\frac{Q^2}{r^2}-{\Lambda \over 3}~r^2\bigg )^{-1/2}\bigg ]_{\Sigma },\\&K^{+}_{22}=\frac{1}{\sin ^2\theta }\,K^{+}_{33}=\bigg [r\,\bigg (1-\frac{2\mathscr {M}}{r}+\frac{Q^2}{r^2}-{\Lambda \over 3}~r^2\bigg )^{1/2}\bigg ]_{\Sigma }. \end{aligned}$$

Then the junction condition \([K^{-}_{22}]_{\Sigma }=[K^{+}_{22}]_{\Sigma }\) together with \([r]_{\Sigma }\) provides,

$$\begin{aligned} e^{-\eta (R)}=\bigg (1-\frac{2\mathscr {M}}{R}+\frac{Q^2}{R^2}-{\Lambda \over 3}~R^2\bigg ). \end{aligned}$$
(53)

Plugging the above expression into the matching condition \([K^{-}_{00}]_{\Sigma }=[K^{+}_{00}]_{\Sigma }\) yields,

$$\begin{aligned} \xi ^\prime (R)= & {} \bigg (\frac{2\mathscr {M}}{R^2}-\frac{2Q^2}{R^3}-{2\Lambda \over 3}~R\bigg ) \nonumber \\&\times \bigg (1-\frac{2\mathscr {M}}{R}+\frac{Q^2}{R^2}-{\Lambda \over 3}~R^2\bigg )^{-1}.~~~ \end{aligned}$$
(54)

Therefore, the matching conditions given by Eqs. (52)–(54) leads to the following relations at the hypersurface,

$$\begin{aligned} A+C\,e^{bR^2/2}= & {} \bigg (1-\frac{2\mathscr {M}}{R}+\frac{Q^2}{R^2}-{\Lambda \over 3}~R^2\bigg )^{1/2}, \end{aligned}$$
(55)
$$\begin{aligned} {1+aR^2\,e^{bR^2}}= & {} \bigg (1-\frac{2\mathscr {M}}{R}+\frac{Q^2}{R^2}-{\Lambda \over 3}~R^2\bigg )^{-1}, \end{aligned}$$
(56)
$$\begin{aligned} 2C\,bR\,e^{bR^2/2}= & {} \bigg (\frac{\mathscr {M}}{R^2}-\frac{Q^2}{R^3}-{\Lambda \over 3}~R\bigg )\times \nonumber \\&\times \bigg (1-\frac{2\mathscr {M}}{R}+\frac{Q^2}{R^2}-{\Lambda \over 3}~R^2\bigg )^{-1/2} \end{aligned}$$
(57)

After solving the relations (55)–(57), we obtain expressions for the constants,

$$\begin{aligned}& a = -\frac{e^{-b R^2} \left( 6 \mathscr {M} R-3 Q^2+\Lambda R^4\right) }{R^2 \left[ R \left( 6 \mathscr {M}+\Lambda R^3-3 R\right) -3 Q^2\right] }, \end{aligned}$$
(58)
$$\begin{aligned}&A = \frac{1}{3 b}\Bigg [b \sqrt{\frac{9 Q^2}{R^2}-\frac{18 \mathscr {M}}{R}-3 \Lambda R^2+9}-3 \sqrt{a}\, C \,e^{\frac{b R^2}{2}} \Bigg ], \nonumber \\ \end{aligned}$$
(59)
$$\begin{aligned}& C = \nonumber \\&\!\!\! \frac{ \left( 3 Q^2{+}\Lambda R^4-3 \mathscr {M} R\right) \left[ R \left( 6\mathscr {M}{+}\Lambda R^3-3 R\right) -3 Q^2\right] }{18 b\, R^6 e^{b R^2/2}}.~~~~~~\nonumber \\ \end{aligned}$$
(60)

As per the current observational evidences the value of the cosmological constant \(\Lambda _0\approx 10^{-46}/\mathrm{km}^2\) at the present universe. Hence, its effects on the local structures will be negligibly small, and then its numerical value does not affect the numerical solution and it can be ignored.

5 Physical viability of the model

We have adopted the numerical approach to obtain the solution of the wave equation which leads to the expression for the Brans–Dicke scalar field \(\varPhi \). To do this, we chose the initial condition \(\varPhi (0)=\varPhi _0=1.001134\) and \(\varPhi ^{\prime } (0)=0\). Before embarking on a discussion of the physical viability of our model we like to comment on the magnitude of the BD coupling constant, \(\omega _{BD}\). A review of the literature reveals that lower bound on the Brans–Dicke parameter is \(|\omega _{BD}| > 40,000\). This bound arises from the Doppler tracking data of the Cassini spacecraft. However, the shortcoming of such experiments is that they are restricted to “weak-field” limits and cannot reveal spatial or temporal deviations of the gravitational constant on significantly larger scales. First year data from WMAP restricted the BD constant to \(\omega _{BD} > 1000\) with further refinements coming through an array of observational data pinning \(\omega _{BD} > 120\). A more recent attempt in refining the bounds on \(\omega _{BD}\) uses data from CMB (WMAP 5 yr, ACBAR 2007, CBI polarization, the BOOMERANG 2003 ) and the LSS data (galaxy clustering power spectrum from SDSS DR4 LRG data). This puts a restriction of \(\omega _{BD} < - 120.0\) or \(\omega _{BD} > 97.8\) which differs in at least two orders of magnitude from \(|\omega _{BD}| > 40000\) [65, 66]. The range of \(\omega _{BD}\) (5; 20) chosen in this work is in agreement with the solar system constraints of the Brans–Dicke (BD) gravity presented by Perivolaropoulos [67], where \(\omega _{BD} \gtrsim -3/2\) for all \(m_\phi \gtrsim 2 \times 10^{-6} \equiv 2 \times 10^{2} m_{AU}\), where \(m_{AU}=10^{-27}\) GeV. The mass of the scalar particle \(m_\phi \) is taken to be \(0.002 \equiv 2 \times 10^{5}m_{AU}\) and is within the predicted range for neutron stars according to Popchev et al. [68] i.e. \(10^{2} m_{AU} \lesssim m_\phi \lesssim 10^{9} m_{AU}\) or in dimensionless unit \(10^{-6} \lesssim m_\phi \lesssim 10\). Therefore, the range of Brans–Dicke parameter \(\omega _{BD}\) used in this work is physically motivated for the chosen scalar particle mass \(m_\phi =0.002\).

5.1 Central values of the physical parameters

In the interior of the compact star, the central values of all the physical parameters must be finite and non-singular. Firstly, we find the central values for both metric functions at \(r=0\) as: \(e^{\eta (0)}=1\) and \(\xi (r)=2\ln [A+\sqrt{a}B/b]\). Since \(r=0\) is a zeros for the function \(\varPhi ^{\prime }(r)\), then by the factor theorem we can write: \(\varPhi ^{\prime }(r)=r\,\psi (r)\), where \(\psi (r)\) is any function of r. We then obtain values for density and pressures at the centre \(r=0\)

$$\begin{aligned}&\rho (0) = \frac{6\, b \,C\, \varPhi _0 + 6\, a\, (A + C)\, \varPhi _0 -3\, (A + C)\, \psi _0}{32\,\pi \,(A + C)}+\mathscr {B}, \nonumber \\ \end{aligned}$$
(61)
$$\begin{aligned}&p_r(0) =\frac{2\,b\, C \, \varPhi _0 + 2\, a\, (A + C)\, \varPhi _0 - (A + C) \psi _0}{32\,\pi \,(A + C)}-\mathscr {B},\nonumber \\ \end{aligned}$$
(62)
$$\begin{aligned}& p_t(0) \nonumber \\&= \frac{14\, b \,C\, \varPhi _0 - 10\, a\, (A + C) \varPhi _0 - (A + C)\, p_{t10}}{32\,\pi \,(A + C)}+\mathscr {B}.~~~\nonumber \\ \end{aligned}$$
(63)

where, \(\varPhi (0)=\varPhi _0\), \(\Psi (0)=\Psi _0\), and \(p_{t10}=(2\, m^2_0 \,\varPhi ^2_0 - 17 \psi _0)\). Now we observe that \(p_r(0) \ne p_t(0)\) which leads to \(\Delta (0) \ne 0\). This situation may create certain problems in stellar modeling as the TOV will be unable to balance at the center. In order to nullify the anisotropy at \(r=0\), we must have \(p_r(0)=p_t(0)\), which leads to

$$\begin{aligned} b= & {} \frac{(A + C) (6\,a \,\varPhi _0 + m^2_{\phi }\,\varPhi ^2_0 - 32\,\mathscr {B}\, \pi -9\, \psi _0)}{6\,C\,\varPhi _0}.~~~~~~~~~ \end{aligned}$$
(64)

Now the central value of \(E^2\) is given by

$$\begin{aligned} E^2(0)= & {} \frac{-6\, b\, C\,\varPhi _0 + 6\,a\,(A + C)\,\varPhi _0 + (A + C)\,E_{10}}{(A + C)}.~~~~~~~ \nonumber \\ \end{aligned}$$
(65)

where \(E_{10}=(m^2_{\phi }\,\varPhi ^2_0 - 32\,\mathscr {B}\,\pi - 9\,\psi _0)\). As we can see from above Eq. (65) that \(E^2(0)\) is nonvanishing. However, incorporating Eq. (64) into Eq. (65), we obtain \(E^2(0)=0\), as required. We will now discuss the regularity of these physical parameters throughout the stellar interior for particular compact object PSR J1903+327.

5.2 Regularity

(i) Metric functions at the centre, \(r=0\): we observe from Fig. 1 (left panel) that the metric functions at the centre \(r=0\) assume finite values and are smooth and continuous throughout the interior of the stellar configuration. We conclude that the metric functions are free from singularity and positive at the centre.

(ii) The density as a function as the radial coordinate is displayed in Fig. 1 (right panel). We observe that the density assumes a finite value at the centre and decreases monotonically towards the stellar surface. Furthermore, we observe that a higher value for \(\varPhi _0\) leads to a higher density at each point of the stellar interior.

(iii) Pressure at the centre \(r=0\): Figure 2 (left panel) shows us that both the radial and tangential pressure are regular at the centre of the star and decrease smoothly towards the boundary. The vanishing of the radial pressure at some finite value, \(r = r_\Sigma \) defines the boundary of the fluid sphere. It is widely acknowledged that while the radial pressure vanishes at the boundary the tangential pressure need not. A phenomenological explanation is provided in the work by Boonserm et al. [78]. They point out that if the tangential pressure does not vanish at the boundary of the star then matching to the Schwarzschild exterior would imply that the electric field is discontinuous at the stellar surface. This would point to the existence of a nonzero surface charge density. To avoid this peculiarity the interior spacetime can be matched to a Reissner-Nordström-de Sitter (RNdS) exterior implying that the stellar object is electrically charged. The nonzero transverse pressure at the boundary is then balanced by the transverse stress of the electric field in the exterior.

(iv) The anisotropy parameter is presented in Fig. 2 (right panel) and it is clear that \(\Delta > 0\) at each interior point of the stellar configuration. The anisotropy parameter vanishes at the center of the star and increases to a maximum for some finite radius, \(r < r_{\Sigma }\) where \({\Sigma }\) denotes the boundary of the star. A positive value for \(\Delta \) (\(p_t > p_r\)) signifies a repulsive force due to anisotropy. It is clear that the increase in the anisotropy parameter especially towards the surface layers lead to greater stability in these regions. It is interesting to observe that a larger value for \(\varPhi _0\) leads to increased values for the anisotropy parameter thus stabilising the fluid even further.

Fig. 1
figure 1

The metric potentials and matter density for PSR J1903+327 plotted against r/R by taking \(\varPhi _0=1.001134,~\omega = 5,~ m_\phi = 0.002,~ B = 0.0381,~ \beta = -0.0092819,~ b = 0.0035/\mathrm{km}^2,~ \alpha = 0.9951,~ \mathscr {B}=99.54~MeV/fm^3\)

Fig. 2
figure 2

The pressure and \({\hat{\Delta }}=(p_t-p_r)/p_t\) are plotted against r/R by taking the same values as in Fig. 1 for PSR J1903+327

5.3 Equation of state

The role of the equation of state (EoS) has been demonstrated in many models of compact objects within the framework of classical general relativity and modified theories of gravitation. A barotropic EoS of the form \(p = p(\rho )\) points strongly to the type of matter making up the star. Recently, the colour-flavoured locked-in EoS was utilised to model compact objects. This particular EoS is a generalisation of the MIT bag model and attempts to connect the microphysics to macrophysics of the fluid configuration. Figure 3 (left panel) shows the variation of the ratio \(p/\rho \) with r/R. We note that the pressure is less than the density at each interior point of the configuration. This ratio is also positive everywhere inside the star.

5.4 Electric field

The trend in the electric field and the charge density are shown in Fig. 3 (right panel). We observe that the electric field vanishes at the centre of the star and increases monotonically towards the surface. It is well-known that intense electric fields can lead to instabilities within the stellar core. The presence of charge as high as \(10^{20}\) coulombs can generate quasi-static equilibrium states. These high charge densities are linked to very intense electric fields which in turn induce pair production within the star thus leading to an unstable core.

Fig. 3
figure 3

The \(p/\rho \) and electric field intensity (\(E_2\)) with charge density \((\sigma )\) are plotted against r/R by taking the same values as in Fig. 1 for PSR J1903+327

5.5 Energy conditions

In order for physical admissibility of our models the solution should satisfy the following energy conditions, viz., (i) null energy condition (NEC), (ii) weak energy condition (WEC) and (iii) strong energy condition (SEC). In order to satisfy the above energy conditions, the following inequalities must be hold simultaneously at each interior point of the charged fluid sphere:

$$\begin{aligned}&\text {NEC}: \rho +\frac{E^2}{8\pi }\ge 0,~~~\text {WEC}: \rho +p_i +\frac{E^2}{8\pi } \ge 0,~\nonumber \\&\text {SEC}: \rho +\sum _i p_i+\frac{E^2}{4\pi } \ge 0. \end{aligned}$$
(66)

It is clear from Fig. 4. (left panel) that all three energy conditions are satisfied at each interior point of the configuration.

5.6 TOV equation

It is well known that in the absence of any dissipative effects such as heat flow the equilibrium of a gravitationally bounded charged fluid configuration is characterised by the resultant of the gravitational force, \(F_g\), the hydrostatic \(F_h\) force, the force due to anisotropy, \(F_a\) and the electrostatic interaction, \(F_e\) vanishing at each interior point of the star. The modified TOV equation in Brans–Dicke gravity is given by

$$\begin{aligned}&-p_r^{\prime }-\frac{\xi ^{\prime }}{2}(p_r+\rho )+\frac{2}{r}(p_t-p_r)+\big (T^{1(\varPhi )}_1\big )^\prime \nonumber \\&-\frac{\xi ^{\prime }}{2}\big (T^{1\varPhi }_1-T^{0\varPhi }_0\big ) + \frac{2}{r}\big (T^{1\varPhi }_1-T^{2\varPhi }_2\big )+\frac{qq^{\prime }}{4\,\pi r^4}=0,~~ \nonumber \\ \end{aligned}$$
(67)

where,

$$\begin{aligned} F_h^{BD}= & {} -p_r^\prime +\big (T^{1\varPhi }_1\big )^\prime ;~~\nonumber \\ F_g^{BD}= & {} -\frac{\xi '}{2}\,\big (p_r+\rho +T^{1\varPhi }_1-T^{0\varPhi }_0\big );\\ F_a^{BD}= & {} \frac{2}{r}\,\big (p_t-p_r+T^{1\varPhi }_1-T^{2\varPhi }_2\big );~~F_e^{BD} =\frac{qq^{\prime }}{4\,\pi r^4} \end{aligned}$$

We note the contribution of the scalar field to the hydrostatic, gravitational and anisotropic forces respectively. In a recent study, Herrera [79] pointed out an interesting observation regarding the nonappearance of the tangential pressure in the gravitational force term. In the case of \(p_t > p_r\), anisotropic spheres are more compact than their isotropic counterparts. In Fig. 4 (right panel), we can see that the combined forces of electric, hydrostatic and anisotropic counter-balanced the gravity so that the configuration is under equilibrium. It can also be seen that when changing the scalar field contribution (by changing the initial condition of the Brans–Dicke scalar field \(\varPhi _0\)) all the forces also change proportionally. This contribution from the scalar field is a mechanism which enables the system to support a larger mass within each concentric shell i.e. the equation of state will be stiffened.

Fig. 4
figure 4

The energy conditions and TOV-equation are plotted against r/R and r respectively by taking the same values as in Fig. 1 for PSR J1903+327

5.7 Causality

In order to prevent superluminal speeds within the stellar fluid we require that the speed of sound be less than that of light everywhere inside the star. The speed of sound for the charged fluid sphere should be monotonically decreasing from centre to the boundary of the star (\(v=\sqrt{dp/d\rho } < 1\)). It is clear from Fig. 5 (left panel) that the speed of sound is less than 1 throughout the interior of the matter distribution. This implies that our fluid model fulfills causality requirements throughout its interior.

5.8 Stability factor

We observe from Fig. 5 (right panel) that our model satisfies the Herrera cracking condition \(-1<v_t^2-v_r^2<0\). Abreu et al. [80] showed that stable and unstable patches can arise within the stellar fluid and their existence depends on the relative sound speeds in the radial and tangential directions. In particular, potential unstable regions occur when the tangential component of the speed of sound exceeds the radial component.

Fig. 5
figure 5

The speed of sound and stability factor are plotted against r/R by taking the same values as in Fig. 1 for PSR J1903+327

5.9 Stability through adiabatic index

Within the Newtonian formalism of gravitation, it is also well known that there has no upper mass limit if the EoS has an adiabatic index \(\varGamma > 4/3\) where

$$\begin{aligned} \varGamma =\frac{p+\rho }{p}\,\frac{dp}{d\rho }\, \end{aligned}$$
(68)

the definition of which arises from an assumption within the Harrison-Wheeler formalism [81]. A perturbative study of dissipative collapse by Chan et al. [82] in which gravitational collapse proceeds from an initially static configuration Eq. (68) follows from the EoS of the unperturbed, static matter distribution. Equation (68) is modified in the presence anisotropic fluids (radial and transverse stresses are unequal) and we can write

$$\begin{aligned} \varGamma > \frac{4}{3} - \left[ \frac{4}{3}\frac{p_r - p_t}{rp_r'}\right] _{max}\end{aligned}$$
(69)

It is well-known that a bounded charged configuration can be treated as an anisotropic system. In the special case of isotropic pressure (\(p_r = p_t\)) the classical Newtonian result holds from Eq. (69). Observations of Eq. (69) indicate that instability is increased when \(p_r < p_t\) and decreases when \(p_r > p_t\). Figure 6 (left panel) confirms that our model is stable against radial perturbations at each interior point within the stellar fluid.

5.10 Stability through Mass-central density (\(M-\rho _c)\) curve

Now, we focus on the \(M-\rho _c\) function dubbed as static stability criterion which is a noteworthy thermodynamically quantity in order to give more insight into the stability of the compact celestial structure. This static stability criterion has been developed and made more accessible by Harrison and co-workers [88] and Zeldovich and Novikov [89] after suggestions by Chandrashekhar [90, 91] in order to portray the stability of gaseous celestial configuration according to radial pulsations. In this respect, the formula associated between the gravitational mass M and the central density \(\rho _c\) is given as follows,

$$\begin{aligned} \frac{\partial M(\rho _c)}{\partial \rho _c} > 0, \end{aligned}$$
(70)

which must be satisfied in order to describe the solutions of static and stable celestial configurations or otherwise unstable if

$$\begin{aligned} \frac{\partial M(\rho _c)}{\partial \rho _c} < 0, \end{aligned}$$
(71)

under radial perturbation. We present the variation of the gravitational mass M with respect to central density \(\rho _c\) in Fig. 6 (right panel). It shows that in the present study the gravitational mass M is an increasing function with regard to central density for the initial condition values of the BD scalar field \(\varPhi _0\) i.e., \(\varPhi _0=1.001134\), by tuning \(\omega _{BD}\) to 5. This confirms the static stability criterion of the stellar system against radial perturbations. We can see that the solution takes its stability with this specific choice of the initial condition of \(\varPhi _0\) and we also find that the celestial bodies become more massive according to increasing central density.

Fig. 6
figure 6

The adiabatic index and mass-central density curves are plotted against r/R and \(\rho _c\) by taking the same values as in Fig. 1 for PSR J1903+327

5.11 Effective mass and compactness parameter for the charged compact star

As a starting point we recall that the maximal absolute limit of mass-to-radius (M/R) ratio for a static spherically symmetric isotropic fluid model is given by \(2M/R\le 8/9 \) [73]. In the case of charged fluid spheres [74] showed that there exists a lower bound for the mass-radius ratio

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

for the constraint \(Q < M\).

However this upper bound of the mass-radius ratio for charged compact star was generalized by [75] who proved that

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

The Eqs. (72) and (73) imply that

$$\begin{aligned}&\frac{Q^{2}\, (18 R^2+ Q^2) }{2R^{2}\, (12R^2+Q^2)} \nonumber \\&\quad \le \frac{M}{R} \le \left[ \frac{2R^2+3Q^2}{9R^2} +\frac{2}{9R}\,\sqrt{R^2+3Q^2}\right] \end{aligned}$$
(74)

The effective mass of the charged fluid sphere can be determined as:

$$\begin{aligned} m_{eff}=4\pi {\int ^R_0{\left( \rho +\frac{E^2}{8\,\pi }\right) \,r^2\,dr}}=\frac{R}{2} \Big [1-e^{-\eta (R)}\Big ]\, \end{aligned}$$
(75)

where \(e^{-\eta }\) is given by the equation (37) and compactness u(r) is defined as:

$$\begin{aligned} u(R)=\frac{m_{eff}(R)}{R}=\frac{1}{2} \Big [1-e^{-\eta (R)} \Big ]. \end{aligned}$$
(76)
Fig. 7
figure 7

The gravitational redshift profile and scalar field \(\varPhi (r)\) are plotted against r/R by taking the same values as in Fig. 1 for PSR J1903+327

Fig. 8
figure 8

The \(M{-}R\) and \(M{-}I\) curves are plotted by taking the same values as in Fig. 1 for different values of \(\omega _{BD}\)

5.12 Redshift

The maximum possible surface redshift for a bounded configuration with isotropic pressure is \(Z_s = 4.77\). In the work of Bowers and Liang they showed that this upper bound can be exceeded when the radial and transverse pressures are different [76]. In particular, when \(\Delta > 0\) (\(p_t > p_r\)) the surface redshift is greater than its isotropic counterpart. Studies show that for strange quark stars the surface redshift is higher in low mass stars with the difference being as high as 30\(\%\) for a 0.5 solar mass star and 15\(\%\) for a 1.4 solar mass star. It appears that higher redshift predictions in low mass stars appear to be an anomaly. In a recent study Chandra et al. [77] have used gravitational redshift measurements to determine the mass-radius ratio of white dwarfs. Using data of over three thousand catalogued white dwarfs they were able to determine the mass-radius relation over a wide range of stellar masses. Their improved technique entailed the cancelling of random Doppler shifts by averaging out the apparent radial velocities of white dwarfs with similar radii enabling them to measure the associated gravitational redshift.

The gravitational surface red-shift (\(Z_s\)) is given as:

$$\begin{aligned} Z_s= (1-2\,u)^{-1/2} -1, \end{aligned}$$
(77)

From Eq. (77), we note that the surface redshift depends upon the compactness u, which implies that the surface redshift for any star cannot be arbitrarily large because compactness u satisfies the Buchdhal maximal allowable mass-radius ratio. However, the value for the surface redshift for the different compact objects have been calculated when \(\varPhi _0=1.001134\) with \(\omega _{BD}=(5,~50)\) are as follows: (i) 0.466 and 0.467 for PSR J1903+327, (ii) 0.418 and 0.419 for Cen X-3, (iii) 0.384 and 0.384 for EXO 1785-248, (iv) 0.350 and 0.350 for LMC X-4. The graphical behavior for gravitational redshift for PSR J1903+327 is shown by Fig. 7 (left panel). Furthermore, the behavior of the scalar field \(\varPhi (r)\) with respect to r is shown in Fig. 7 (right panel). From this graph, it is clear that the functional form of the scalar field \(\varPhi (r)\) is well-fitted with numerical data which also approves the validity of our new solutions.

5.13 The effect of BD scalar field \(\varPhi \), and BD-parameter \(\omega _{BD}\) on the \(M{-}R\) and \(M{-}I\) curves

In this section, we examine the \(M{-}R\) and \(M{-}I\) diagrams resulted from our stellar model in the background of BD gravity with a massive field via the embedding approach. In this respect, we provide an instructive explanation of the influences included by the choices made on different parameters viz., the initial condition of the BD scalar field \(\varPhi _0\), BD-parameter \(\omega _{BD}\) and the total external bag pressure \(\mathscr {B}\) (or bag constant), in order to give a more achievable scenario and efficient astrophysical stellar system. On the other hand, for determining the stiffness of an EoS, we can analyze the moment of inertia I associated with a static celestial solution which could give a precise instrument via adopting the Bejger and Haensel concept [87], given by,

$$\begin{aligned} I = {2 \over 5} \left( 1+{(M/R)\cdot km \over M_\odot } \right) ~MR^2.~~~~ \end{aligned}$$
(78)
Table 1 Comparative study of lower bound, Mass-radius ratio, upper bound, compactness \((u=M_{\text {eff}}/R)\) and surface red-shift of the star for fixed values of \(\alpha =0.9951,\beta =-0.0092819,\varPhi _0=1.001134,~b=0.0035/\mathrm{km}^2,~B=0.0381/\mathrm{km}\) and \(\omega _{BD}=5\)

Our survey on \(M{-}R\) and \(M{-}I\) curves is highly significant for the stellar systems which clearly show the state (more or less) of compact celestial bodies via the maximum bound of the total mass as well as the efficacy and the sensitivity to the stiffness of an EoS. In this regard, from Fig. 8, we show the variation of the total mass M in [\(M_{\odot }\)] versus the total radial coordinate R in [km] and the maximum moment of inertia I in [\(\times 10^{45}\) g cm\(^2\)], for all chosen values of the parameters \(\varPhi _0\), \(\omega _{BD}\) and \(\mathscr {B}\). In the present BD gravity stellar model via the embedding approach, we observe from \(M{-}R\) curves featured in Fig. 8 (left panel) the contributions due to \(\omega _{BD}\) where we have set \(\varPhi _0\) to 1.001134 and \(\mathscr {B}\) to \(99.54~MeV/fm^3\). We note that as the parameter \(\omega _{BD}\) decreases from 20 to 5, the most extreme value of mass M increases with an increase in the total radial coordinate R, which culminates in more massive compact celestial bodies. We can conclude that as \(\omega _{BD}\) increases the corresponding radius R decreases and the most extreme value of mass M also decreases, which gives us also a celestial system less compact and less massive. This shows that the parameters \(\varPhi _0\), \(\mathscr {B}\) and \(\omega _{BD}\) will affect the maximum mass limit as well as compactness of the objects. On the other hand, the variation of the maximum moment of inertia I with respect to the total mass M due to the impact of \(\varPhi _0\), \(\mathscr {B}\) and \(\omega _{BD}\) has been featured in Fig. 8 (right panel). From these plots, we can see that the maximum moment of inertia I is always increasing with increasing the mass until up to the most extreme value of mass and decreasing rapidly with decreasing the mass. The generated \(M{-}R\) curve in Fig. 8 (left) is in agreement with the recent gravitational waves observation from GW 170817. This neutron stars merger predicted a strong constraint on mass-radius relationship. For a neutron stars of mass 1.4\(M_\odot \) and 1.6\(M_\odot \) must have at least 11.0\(^{+0.9}_{-0.6}\) [92] and 10.68\(^{+0.15}_{-0.04}\) [93]. The radii ranges for 1.4\(M_\odot \) is 10.55–11.29 km and 1.6\(M_\odot \) is 11.07–11.90 km implying that the predicted radii from the solution is in agreement with stringent constraints from GW 170817 observations. Finally, we would like to mention here that we have discovered a good agreement with observational data for four compact celestial objects namely, PSR J1903+327, Cen X-3, EXO 1785-248, LMC X-4 in our resulting \(M{-}R\) and \(M{-}I\) curves. It is clear that all parameters introduced by the BD gravity stellar model with the massive field via the embedding approach have a large effect on the various physical parameters of the celestial configuration.

Fig. 9
figure 9

Matching of \(p_t(r \le R)\) with \(E^2(r>R)\) at the surface of the star

Table 2 Comparative study of lower bound, Mass-radius ratio, upper bound, compactness \((u=M_{\text {eff}}/R)\) and surface red-shift of the star for fixed values of \(\alpha =0.9951,\beta =-0.0092819,\varPhi _0=1.001134,~b=0.0035/\mathrm{km}^2,~B=0.0381/\mathrm{km}\) and \(\omega _{BD}=50\)

6 Discussion and conclusion

It is clear from the graphical analyses of our solution that the model of charged anisotropic strange star within the framework of Brans–Dicke gravity with a massive scalar field describes realistic stellar objects. The stellar model presented here obeys all the conditions required for hydrostatic equilibrium, stability and causality. Of particular interest is the contribution of the scalar field to the thermodynamical and gravitational properties of the stellar model. The graphical analysis of physical attributes of the compact object indicates that radial pressure, tangential pressure, and energy density are finite and maximum at \(r = 0\) leading to a highly concentrated core. Moreover, the monotonic decreasing trend of state variables away from the center describes a compact profile. The anisotropy parameter is also strengthened in the presence of larger scalar fields. Since \(\Delta > 0\) throughout the stellar configuration, the repulsive force due to anisotropy helps stabilise the more compact configurations. An interesting observation is the increase in electric field intensity with an increase in scalar field intensity. Although these fields emanate from totally different sources there appears to be a ‘coupling’ which manifests in the formation of more compact stellar configurations. It can also be seen from Fig. 9 that the tangential pressure at the interior of the stellar system continues as electric field at the exterior. This was also mentioned by Boonserm et al. [78] that for \(p_t > p_r\) the scalar field satisfies \(|\nabla \varPhi |=0\) and the scalar charge density vanishes. This leads to the non-vanishing electric field in such a region which falls off as \(1/r^2\).

Table 3 Predicted radii and MI for some compact stars for different values of \(\omega \) with \(\alpha =0.9951,\beta =-0.0092819,\varPhi _0=1.001134\) correspond to Fig. 8
Table 4 Effects of \(\alpha \) and \(\omega _{BD}\) on mass, radius and moment of inertia corresponds to Fig. 8

It has been shown that higher order gravity theories predict more compact objects compared to their 4D counterparts. The compactification is attributed to higher dimensional effects rather than exotic matter states such as dark matter. Our model provides an alternative mechanism for the existence of more compact objects than their classical relativistic counterparts. Recent studies of observational data obtained via gravitational redshifts have determined the the mass-radius relation of white dwarfs to a higher degree of accuracy. These results help constrain the equation of state of these compact objects thus giving us an handle on the matter composition and microphysics at play within the stellar fluid. Tables 1, 2 and 3 display the upper bound and lower bound limits imposed by the modified Buchdahl limit for charged compact objects in Brans–Dicke theory.

In Tables 1 and 2, we have generated values for the surface charge for well-known compact objects PSR J1903+327; Cen X-3; EXO 1785-248 and LMC X-4 when \(\varPhi _0=1.001134\) with \(\omega _{BD} = 5\) and \(\omega _{BD} = 50\) respectively. To see the effect of the BD parameter we have included calculated values for \(\varPhi _0=1.001134\) corresponding to specific choice of \(\omega _{BD}\), i.e., \(\omega _{BD} = 5\) and 50. It is clear from the data that an increase in \(\omega _{BD}\) is accompanied by an increase in the surface charge as well as surface charge density. The increase in surface charge density is higher in more compact objects. This is expected as the charge contributes to the overall mass of the stellar body. We observe that the upper and lower bounds arising from the Buchdahl limit are modified by a change in \(\omega _{BD}\). Table 1 shows that a decrease in compactness of approximately 15% (from PSR J1903+327 to LMC X-4) is accompanied by a change in the lower bound as high as 40% for \(\varPhi _0=1.001134\) and \(\omega _{BD} = 5\) while the upper bound changes by approximately 1%. In Table 2 we present model characteristics for \(\varPhi _0=1.001134\) and \(\omega _{BD} = 50\). We observe a decrease in 20% in compactness is accompanied by a 60% decrease in the lower bound and a 5% decrease in the upper bound of the stellar configurations. A comparison of Tables 1 and 2 show the contributions attributed to the Brans–Dicke modification to the classical Einstein gravity theory,i.e. a change in \(\omega _{BD}\). It is clear that surface charge density, lower and upper bounds imposed by the Buchdhal limits are all affected by an increase in the Brans–Dicke coupling constant. Let us now turn our attention to the surface redshift for the different parameter sets displayed in Tables 1 and 2. It is clear that the surface redshift decreases as the compactness decreases. We observe that surface redshift values obtained in Tables 1 and 2 for the stellar objects displayed here are consistent with the acceptable upper bound for for relativistic stars (\(Z < 5.211\)) [83]. Another well-known characteristic named as the static stability criterion or \(M-\rho _c\) function plays a crucial role in ensuring the stability of spherically symmetric static celestial systems under radial pulsation has been well-satisfied. We can also notice from the data drawn in \(M-\rho _c\) curve that the celestial configurations become more massive according to increasing central density.

Further, we tested the state of the compact celestial bodies as well as the efficacy and the sensitivity to the stiffness of an EoS by studying the \(M{-}R\) and \(M{-}I\) diagrams generated from our celestial model. The \(M{-}R\) curves that due to \(\varPhi _0\), \(\omega _{BD}\) and \(\mathscr {B}\) have been investigated. From these curves, we can see that when \(\omega _{BD}\) increases from 5 to 20 by setting \(\varPhi _0\) and \(\mathscr {B}\) to 1.001134 and \(99.54~MeV/fm^3\) respectively, the maximum value of mass M and corresponding radius R decreases, which gives us a celestial system more compact and less massive. Moreover, from \(M{-}I\) curves, we can see that the maximum moment of inertia I is always increasing with an increase in the mass until up to the maximum value of mass and decreasing rapidly with decreasing the mass under the effect of \(\varPhi _0\), \(\omega _{BD}\) and \(\mathscr {B}\). In this respect, we can conclude that the stiffness of EoS is better in the case of \(\varPhi _0=1.001134\) and \(\omega _{BD} =5\) while compared to all other cases, i.e., when \(\omega _{BD} =10,15,\) and 20. We also found a good agreement with observational data on \(M{-}R\) and \(M{-}I\) diagrams for four compact celestial bodies viz., PSR J1903+327, Cen X-3, EXO 1785-248, LMC X-4 and many others can be adapted. The Tables 3 and 4 display the values of physical parameters such as maximum mass, predicted radius and momentum of inertia corresponding the Fig. 8 for different values of \(\omega _{BD}\) with \(\varPhi _0=1.001134\) and \(\mathscr {B}=99.54~MeV/fm^3\). With the above rigorous analyses of the gravitational and thermodynamical behaviour of our solution we ascertain that our model meets the necessary requirements for a physically realizable self-gravitating compact object.

In this study we have generated a model of a compact charged stellar object within the Brans–Dicke gravity framework in the presence of a massive scalar field. In addition, the matter composition of the stellar interior obeys the MIT Bag model equation of state. Our model satisfies all the criteria for a genre of compact objects which include strange stars. The highlight of our work is the interplay between the electric and scalar fields which originate from completely different sources combine to affect physical characteristics of the model. The Brans–Dicke coupling constant also affects stellar characteristics such as compactness, redshift and the bounds required by the modified Buchdahl limit for charged stars. In addition, we observed that \(M{-}R\) and \(M{-}I\) curves are sensitive to changes in \(\omega _{BD}\) for fix values of \(\varPhi _0\) and Bag constant which in turn points to a change in stiffness of the stellar fluid. We believe that this is a novel feature in our model which inherently connects the macrophysics (scalar field, electric field and BD coupling constant) to the microphysics (Bag constant). It would be interesting to compare and contrast our findings to phenomenological features derived in other modified gravity theories such as f(R). Motivated by the current achievements for anisotropic compact objects in GR, the extensions of GR can have a substantial impact on the macro-physical properties of a Neutron star (NS) (see e.g. Ref. [94] for a broad review). In spite of that, there is a growing interest not only in restricting the EoS but also in considering viable theories of modified gravity when we study compact stars. Modification of gravity can affect a number of important physical characteristics of NSs which can, in principle, be directly verified by observation. It is obvious that the EoS and the modified gravity framework must be constrained from astronomical observations, as for instance from multi-messenger observations of the merger GW170817 [95,96,97,98]. Since then, f(R) gravity theories have been studied by many researchers who point out the possibility that modified gravity can really be adopted to address the problem of strange stars over a wide span of years. In particular, Nashed and Capozziello [99, 100] have investigated the noteworthy solutions for anisotropic compact stars and charged spherically symmetric black holes within the frame of the f(R) gravity and their stability analysis. In view of the f(R) gravity perspective for the secondary component of the GW190814 event, strange stars possibilities are derived and also discussed in [101, 102]. In our work, we have chosen to work in the Brans–Dicke formalism, since the Brans–Dicke theory [105] is the prototypical alternative to GR and the simplest representative of scalar-tensor gravity [109,110,111]. Also in this formalism, the models are, on the one hand, easily compatible with Solar System tests, and on the other hand the interior star solution can match the exterior solution of the Reissner–Nordström–de Sitter (RNdS). Compared to the results provided in [99,100,101,102], it is evident that the f(R) theories are nothing but scalar-tensor theories in disguise with vanishing Brans–Dicke coupling \(\omega _{BD}\) and equipped with a complicated potential for the scalar degree of freedom \(f^{'}(R)\) [109,110,111]. As a final comment, we say that our work using the Brans–Dicke formalism has extended the space of solutions describing compact stellar objects outside the realm of 4D Einstein gravity. Looking to the future, refined observational techniques and improved gravity probes, particularly in strong gravitational fields, may elucidate the predictions of modified theories.