1 Introduction

Gravity theories are usually studied on the assumption that the Newton gravity constant G is constant. But some observations hint that G maybe depends on time [1], such as observations from white dwarf stars [2, 3], pulsars [4], supernovae [5] and neutron stars [6]. In addition, cosmic observations predict that about 95 % of the universal matter is invisible, including dark matter (DM) and dark energy (DE). The unified models of two unknown dark sectors (DM and DE) have been studied in several theories, e.g. in the standard cosmology [79], in the Ho\(\check{r}\)ava–Lifshitz gravity [10], in the RS [11] and the KK higher-dimension gravity [12]. In this paper, we study the unified model of dark components in the theory of a varying gravitational constant (VG). The attractive point of this model is that the variation of G could result in the invisible components in universe, by relating the Lagrangian quantity of the generalized Born–Infeld theory to the VG theory. One source of DM and DE is introduced. In addition, cosmic strings have been studied in some fields, such as in emergent universe [13, 14], in modified gravity [15], in inflation theory [16], and so on [1720]. Here we discuss the effect of a cosmic string fluid on the cosmic parameters in VG theory. Using the Markov Chain Monte Carlo (MCMC) method [21], the cosmic constraints on a unified model of DM and DE with (or without) a cosmic string fluid are performed in the framework of a time-varying gravitational constant. The used cosmic data include the lookback time (LT) data [22, 23], the model-independent gamma ray bursts (GRBs) data [24], the growth function (GF) of matter linear perturbations [2532], the type Ia supernovae (SNIa) data with systematic errors [33], the cosmic microwave background (CMB) [34], and the baryon acoustic oscillation (BAO) data including the radial BAO scale measurement [35] and the peak-positions measurement [3638].

2 A time-varying gravitational constant theory with unified dark sectors and a cosmic string fluid

We adopt the Lagrangian quantity of system

$$\begin{aligned} L=\sqrt{g}\left( \frac{R}{G(t)}+16\pi \mathcal {L}_{u}\right) \end{aligned}$$
(1)

with a parameterized time-varying gravitational constant \(G=G_{0}a(t)^{-\beta }\). t is the cosmic time, \(a=(1+z)^{-1}\) is the cosmic scale factor, and z denotes the cosmic redshift. g is the determinant of metric, R is the Ricci scalar, and \(\mathcal {L}_{u}=\mathcal {L}_{b}+\mathcal {L}_{r}+\mathcal {L}_{d}+\mathcal {L}_{s}\) corresponds to the Lagrangian density of universal matter including the visible ingredients: baryon \(\mathcal {L}_{b}\) and radiation \(\mathcal {L}_{r}\) and the invisible ingredients: dark sectors \(\mathcal {L}_{d}\) and cosmic string (CS) fluid \(\mathcal {L}_{s}\). Utilizing the variational principle, the gravitational field equation can be derived [39],

$$\begin{aligned} R_{\mu \nu }-\frac{1}{2}Rg_{\mu \nu }= & {} 8\pi GT_{\mu \nu }\nonumber \\&+\,G\left( \nabla _{\mu }\partial _{\nu }G^{-1}-g_{\mu \nu }\nabla _{\sigma }\partial ^{\sigma }G^{-1}\right) , \end{aligned}$$
(2)

in which \(R_{\mu \nu }\) is the Ricci tensor, \(T_{\mu \nu }\) is the energy-momentum tensor of universal matter that comprises the pressureless baryon \((w_{b}=\frac{p_{b}}{\rho _{b}}=0)\), the positive-pressure photon \((w_{r}=\frac{p_{r}}{\rho _{r}}=\frac{1}{3})\), the CS fluid \((w_{s}=\frac{p_{s}}{\rho _{s}}=-\frac{1}{3})\), and the unknown dark components \((w_{d}=\frac{p_{d}}{\rho _{d}})\). w is for the equation of state (EoS), p is the pressure, and \(\rho \) denotes the energy density, respectively. Taking the covariant divergence for Eq. (2) and utilizing the Bianchi identity result in

$$\begin{aligned} 3H\left( \frac{\dot{G}}{G}\right) ^{2}+3\frac{\ddot{a}}{a}\frac{\dot{G}}{G}+8\pi [\dot{G}\rho +G\dot{\rho }+3HG(\rho +p)]=0\nonumber \\ \end{aligned}$$
(3)

or its equivalent form

$$\begin{aligned} 3H\beta [(\beta -1)H^{2}-\dot{H}]+8\pi G\left[ \dot{\rho }+3H(\rho +p)-\beta H \rho \right] =0. \end{aligned}$$

In the Friedmann–Robertson–Walker geometry, the evolution equations of the universe in VG theory are

$$\begin{aligned} H^{2}=\frac{8\pi G_{0}}{3}a^{-\beta } \rho -\beta H^{2}, \end{aligned}$$
(4)
$$\begin{aligned} 2\frac{\ddot{a}}{a}+H^{2}=-8\pi G_{0}a^{-\beta }p-\beta H^{2}-\beta ^{2} H^{2}-\beta \frac{\ddot{a}}{a}. \end{aligned}$$
(5)

From Eq. (4), we can see that a CS fluid can be equivalent to a curvature term in constant-G theory, while this fluid could not be equivalent to the curvature term in the VG theory due to the term \(a^{-\beta }\) multiplying the density. Combing Eqs. (3), (4), and (5), we have

$$\begin{aligned} \dot{\rho }+3H\left( \rho +\frac{2+2\beta }{2+\beta }p\right) =\frac{\beta -\beta ^{2}}{2+\beta } H\rho . \end{aligned}$$
(6)

A dot represents the derivative with respect to cosmic time t. Integrating Eq. (6) one obtains the energy density of baryon \(\rho _{b}\propto a^{\frac{-\beta ^{2}-2\beta -6}{2+\beta }}\), the energy density of radiation \(\rho _{r} \propto a^{\frac{-\beta ^{2}-4\beta -8}{2+\beta }}\), and the energy density of the cosmic string \(\rho _{s} \propto a^{\frac{-\beta ^{2}-4}{2+\beta }}\). Relative to the constant-G theory, the evolution equations of the energy densities are obviously modified in VG theory as regards the existence of the VG parameter \(\beta \).

Table 1 The 38 data points of galaxy age [22, 23]. The first six data are from Ref. [22]

We concentrate on the Lagrangian density of the dark components in the form \(\mathcal {L}_{d}=-A^{\frac{1}{1+\alpha }} \left[ 1-(V^{'}(\varphi ))^{\frac{1+\alpha }{2\alpha }}\right] ^{\frac{\alpha }{1+\alpha }}\) from the generalized Born–Infeld theory [40], in which \(V(\varphi )\) is the potential. Relating this scalar field \(\varphi \) with the time-varying gravitational constant by \(\varphi (t)=G(t)^{-1}\), it is then found that the dark ingredients can be induced by the variation of G. The energy density of the dark fluid in the VG frame complies with

$$\begin{aligned} \rho _{d}=\rho _{0d}\left[ B_s+(1-B_s)a^{(-3+\frac{\beta -\beta ^{2}}{2+\beta })(1+\alpha )}\right] ^{\frac{1}{1+\alpha }}, \end{aligned}$$
(7)

here the parameter \(\beta \) reflects the variation of G; \(\alpha \) and \(B_s=\frac{6+6\beta }{\beta ^{2}+2\beta +6}\frac{A}{\rho _{0VG-GCG}^{1+\alpha }}\) are model parameters. Equation (7) shows that the behavior of \(\rho _{d}\) is like cold DM at early timeFootnote 1 (for \(a\ll 1\), \(\rho _{d}\approx \rho _{0d}(1-B_{s})^{\frac{1}{1+\alpha }}a^{-3+\frac{\beta -\beta ^{2}}{2+\beta }}\)), and like cosmological-constant type DE at late time (for \(a\gg 1\), \(\rho _{d}\approx \rho _{0d}B_{s}^{\frac{1}{1+\alpha }}\)). Then Eq. (7) introduces a unified model (UM) of dark sectors in VG theory (called VG-UM). The Hubble parameter H in the VG-UM model reads

$$\begin{aligned} H=\sqrt{\frac{H^{2}_{0}}{1+\beta }\left\{ \Omega _{0d}[B_{s}a^{-\beta (1+\alpha )}+(1-B_{s}) a^{-(3+\frac{2\beta ^{2}+\beta }{2+\beta })(1+\alpha )}]^{\frac{1}{1+\alpha }}+\Omega _{b} a^{\frac{-2\beta ^{2}-4\beta -6}{2+\beta }}+\Omega _{r}a^{\frac{-2\beta ^{2}-6\beta -8}{2+\beta }}+\Omega _{s}a^{\frac{-2\beta ^{2}-2\beta -4}{2+\beta }}\right\} }, \end{aligned}$$
(8)

with Hubble constant \(H_0\) and dimensionless energy densities \(\Omega _{b}= \frac{8 \pi G_{0}\rho _{0b}}{3H^{2}_{0}}\), \(\Omega _{r}= \frac{8\pi G_{0}\rho _{0r}}{3H_{0}^{2}}\), \(\Omega _{s}= \frac{8 \pi G_{0}\rho _{0s}}{3H^{2}_{0}}\), and \(\Omega _{0d}+\Omega _{b}+\Omega _{r}+\Omega _{s}=1+\beta \). For \(\beta =0\), the above equations are reduced to the standard forms in the constant-G theory.

3 Data fitting

3.1 Lookback time

References [41, 42] define the LT as the difference between the current age \(t_{0}\) of universe at \(z=0\) and the age \(t_{z}\) of a light ray emitted at z,

$$\begin{aligned} t_{L}(z)=\int _{0}^{z}\frac{\mathrm{d}z^{'}}{(1+z^{'})H(z^{'})}. \end{aligned}$$
(9)

Then the age \(t(z_{i})\) of an object at redshift \(z_{i}\) can be expressed by the difference between the age of universe at \(z_{i}\) and the age of universe at \(z_{F}\) (when the object was born) [22],

$$\begin{aligned} t(z_{i})&=\int _{z_{i}}^{\infty }\frac{\mathrm{d}z^{'}}{(1+z^{'})H(z^{'})}-\int _{z_{F}}^{\infty }\frac{\mathrm{d}z^{'}}{(1+z^{'})H(z^{'})}\nonumber \\&=t_{L}(z_{F})-t_{L}(z_{i}). \end{aligned}$$
(10)

For an object at redshift \(z_{i}\), the observed LT is subject to

$$\begin{aligned} t_{L}^{\mathrm{obs}}=t_{L}(z_{F})-t_{L}(z_{i})&=[t_{0}^{\mathrm{obs}}-t(z_{i})]-[t_{0}^{\mathrm{obs}}-t_{L}(z_{F})]\nonumber \\&=t_{0}^{\mathrm{obs}}-t(z_{i})-\mathrm{d}f. \end{aligned}$$
(11)

One defines

$$\begin{aligned} \chi ^{2}_{\mathrm{age}}=\sum _{i}\frac{\left[ t_{L}(z_{i})-t_{L}^{\mathrm{obs}}(z_{i},\mathrm{d}f)\right] ^{2}}{\sigma _{T}^{2}}+\frac{\left[ t_{0}-t_{0}^{\mathrm{obs}}\right] ^{2}}{\sigma ^{2}_{t_{0}^{\mathrm{obs}}}}, \end{aligned}$$
(12)

with \(\sigma _{t_{0}^{\mathrm{obs}}}^{2}+\sigma _{i}^{2}=\sigma _{T}^{2}\). \(\sigma _{t_{0}^{\mathrm{obs}}}\) is the uncertainty of the total universe age, and \(\sigma _{i}\) is the uncertainty of the LT of galaxy i. Marginalizing the ‘nuisance’ parameter \(\mathrm{df}\) results in [43]

$$\begin{aligned} \chi ^{2}_{LT}(p_{s})&=-2\ln \int _{0}^{\infty }\mathrm{d}(\mathrm{d}f)\exp (-\chi ^{2}_{\mathrm{age}}/2)\nonumber \\&=A-\frac{B^{2}}{C}+\frac{[t_{0}-t_{0}^{\mathrm{obs}}]^{2}}{\sigma ^{2}_{t_{0}^{\mathrm{obs}}}}\nonumber \\ {}&\quad -2\ln \left[ \sqrt{\frac{\pi }{2C}} \mathrm{erfc}\left( \frac{B}{\sqrt{2C}}\right) \right] , \end{aligned}$$
(13)

where \(A=\sum _{i} \frac{\Delta ^{2}}{\sigma _{T}^{2}}, B=\sum _{i} \frac{\Delta }{\sigma _{T}^{2}},C=\sum _{i} \frac{1}{\sigma _{T}^{2}}\) and \(\Delta =t_{L}(z_{i})-[t_{0}^{\mathrm{obs}}-t(z_{i})]\), respectively. \(p_{s}\) denotes the theoretical model parameters. erfc(x) = 1\(-\)erf(x) is the complementary error function of x. The observational universal age at present, \(t_{0}^{\mathrm{obs}}=13.75\pm 0.13\) Gyr [44], is used, and the observational data on the galaxies age are listed in Table 1.

Table 2 Distances calculated by using the 109 GRBs data via Amati’s correlation [24]
Table 3 The observational data of the growth function \(f_{\mathrm{obs}}\)

3.2 Gamma ray bursts

In GRBs observation, the famous Amati’s correlation is \(\log \frac{E_{\mathrm{iso}}}{\mathrm{erg}}=a+b \log \frac{E_{p,i}}{300}\) keV [45, 46], where \(E_{\mathrm{iso}}=4\pi {d}_{L}^{2}S_{\mathrm{solo}}/(1+z)\) and \(E_{p,i} = E_{p,\mathrm{obs}}(1\,+\,z)\) are the isotropic energy and the cosmological rest-frame spectral peak energy, respectively. \(d_{L}\) is the luminosity distance and \(S_{\mathrm{bolo}}\) is the bolometric fluence of GRBs. Reference [47] introduced a model-independent quantity for a distance measurement,

$$\begin{aligned} \overline{r}_{p}(z_{i})= & {} \frac{r_{p}(z)}{r_{p}(z_{0})},\quad r_{p}(z)= \frac{(1+z)^{1/2}}{z}\frac{H_{0}}{c}r(z),\nonumber \\ r(z)= & {} \frac{{d}_{L}(z)}{1+z} \end{aligned}$$
(14)

with \(z_{0}\) being the lowest GRBs redshift. For the GRBs constraint, \(\chi ^{2}_{\mathrm{GRBs}}\) has the form

$$\begin{aligned} \chi ^{2}_{\mathrm{GRBs}}(p_{s})=[\Delta \overline{r}_{p}(z_{i})]\cdot (\mathrm{Cov}^{-1}_{\mathrm{GRBs}})_{ij}\cdot [\Delta \overline{r}_{p}(z_{i})], \end{aligned}$$
(15)

in which \(\Delta \overline{r}_{p}(z_{i})=\overline{r}^{\mathrm{data}}_{p}(z_{i})-\overline{r}_{p}(z_{i})\), and (\(\mathrm{Cov}^{-1}_{\mathrm{GRBs}})_{ij}\) is the covariance matrix. Using 109 GRBs data, Ref. [24] obtained five model-independent datapoints listed in Table 2, where \(\sigma (\overline{r}_{p}(z_{i}))^{+}\) and \(\sigma (\overline{r}_{p}(z_{i}))^{-}\) are the \(1\sigma \) errors. The \(\{\overline{r}_{p}(z_{i})\}\) correlation matrix is [24]

$$\begin{aligned}&(\overline{\mathrm{Cov}}_{\mathrm{GRB}})= \left( \begin{array}{l} 1.0000~~~0.7780~~~0.8095~~~0.6777~~~0.4661\\ 0.7780~~~1.0000~~~0.7260~~~0.6712~~~0.3880\\ 0.8095~~~0.7260~~~1.0000~~~0.6046~~~0.5032\\ 0.6777~~~0.6712~~~0.6046~~~1.0000~~~0.1557\\ 0.4661~~~0.3880~~~0.5032~~~0.1557~~~1.0000 \end{array}\right) ,\nonumber \\ \end{aligned}$$
(16)

with the covariance matrix

$$\begin{aligned} (\mathrm{Cov}_{\mathrm{GRB}})_{ij}=\sigma (\overline{r}_{p}(z_{i}))\sigma (\overline{r}_{p}(z_{j}))(\overline{\mathrm{Cov}}_{\mathrm{GRB}})_{ij}, \end{aligned}$$
(17)

where \(\sigma (\overline{r}_{p}(z_{i}))=\sigma (\overline{r}_{p}(z_{i}))^{+}\), if \(\overline{r}_{p}(z)\ge \overline{r}_{p}(z)^{\mathrm{data}}\); \(\sigma (\overline{r}_{p}(z_{i}))=\sigma (\overline{r}_{p}(z_{i}))^{-}\), if \(\overline{r}_{p}(z)< \overline{r}_{p}(z)^{\mathrm{data}}\).

3.3 Growth function of matter linear perturbations

The \( \chi ^2_{\mathrm{GF}}\) can be constructed by the growth function of matter linear perturbations f

$$\begin{aligned} \chi _{\mathrm{GF}}^2(p_{s})=\sum _{i} \frac{\left[ f_{\mathrm{th}}(p_{s},z_i)-f_{\mathrm{obs}}(z_i)\right] ^2}{\sigma ^2(z_i)}, \end{aligned}$$
(18)

where the used the observational values of \(f_{\mathrm{obs}}\) listed in Table 3. f is defined via \(f(a)=\frac{aD^{'}(a)}{D(a)}\), with \(D=\frac{\frac{\delta \rho }{\rho }(a)}{\frac{\delta \rho }{\rho }(a=1)}\). A prime denotes the derivative with respect to a. So in theory, f can be obtained by solving the following differential equation in VG theory:

$$\begin{aligned}&D^{''}(a)+\left[ \frac{H^{'}(a)}{H(a)}+\frac{1}{a}+\frac{4+2\beta +2\beta ^{2}}{a(2+\beta )}\right] D^{'}(a)\nonumber \\&\quad -\frac{6+2\beta +\beta ^{2}}{(2+\beta )^{2}}\frac{H_{0}^{2}\Omega _{0m}}{H(a)^{2}a^{2}}a^{\frac{-6-2\beta -\beta ^{2}}{2+\beta }}D(a)=0. \end{aligned}$$
(19)

For \(\beta =0\), the above equation reduces to the constant-G theory. The derivation of the evolution equation for D(a) in VG theory is shown in the appendix. Compared with the most popular \(\Lambda \)CDM model, the effective current matter density can be written \(\Omega _{0m}=\Omega _{b}+(1+\beta -\Omega _{s}-\Omega _{b}-\Omega _{r})(1-B_{s})\) for VG-UM. Obviously, for \(\beta =0\) it is consistent with the form of \(\Omega _{0m}\) in UM of constant-G theory [4850].

3.4 Type Ia supernovae

We use the Union2 dataset of SNIa published in Ref. [33]. In VG theory, the theoretical distance modulus \(\mu _{\mathrm{th}}(z)\) is written as \(\mu _{\mathrm{th}}(z)=5\log _{10}[D_{L}(z)]+\frac{15}{4}\log _{10}\frac{G}{G_{0}}+\mu _{0}\), where \(D_{L}(z)=\frac{H_{0}}{c}(1+z)^{2}D_A(z)\) and \(\mu _{0}=5\mathrm{log}_{10}(\frac{H_{0}^{-1}}{Mpc})+25=42.38-5\mathrm{log}_{10}h\). h is a re-normalized quantity defined by \(H_0 =100 h~\mathrm{km ~s}^{-1}~\mathrm{Mpc}^{-1}\). \(D_A(z)=\frac{c}{(1+z)\sqrt{|\Omega _k|}}\mathrm {sinn}[\sqrt{|\Omega _k|}\int _0^z\frac{\mathrm{d}z'}{H(z')}]\) is the proper angular diameter distance; here \(\mathrm {sinn}(\sqrt{|\Omega _k|}x)\) denotes \(\sin (\sqrt{|\Omega _k|}x)\), \(\sqrt{|\Omega _k|}x\) and \(\sinh (\sqrt{|\Omega _k|}x)\) for \(\Omega _k<0\), \(\Omega _k=0\) and \(\Omega _k>0\), respectively. A cosmic constraint from the SNIa observations can be found by a calculation [5160]:

$$\begin{aligned} \chi ^2_{\mathrm{SNIa}}(p_{s})&= \sum _{\mathrm{SNIa}}\frac{\left\{ \mu _{\mathrm{th}}(p_{s},z_i)-\mu _{\mathrm{obs}}(z_i)\right\} ^2}{\sigma _{\mu _{i}}^2}\nonumber \\&=\sum _{\mathrm{SNIa}}\frac{\{5\log _{10}[D_{L}(p_{s},z)]+\frac{15}{4}\log _{10}\frac{G}{G_{0}}-m_{\mathrm{obs}}(z_{i})+M^{'}\}^{2}}{\sigma _{i}^{2}}, \end{aligned}$$
(20)

where \(\mu _{\mathrm{obs}}(z_{i})=m_{\mathrm{obs}}(z_{i})-M\) is the observed distance moduli, with the absolute magnitude M. The nuisance parameter \(M^{'}=\mu _{0}+M\) can be marginalized over analytically, \(\bar{\chi }_{\mathrm{SNIa}}^2(p_s) = -2 \ln \int _{-\infty }^{+\infty }\exp \left[ -\frac{1}{2} \chi _{\mathrm{SNIa}}^2(p_s,M^{\prime }) \right] {d}M^{\prime }\), resulting in [6170]

$$\begin{aligned} \chi ^2_{\mathrm{SNIa}}(p_s)=A-(B^2/C), \end{aligned}$$
(21)

where

$$\begin{aligned} A&=\sum _{\mathrm{SNIa}}\left\{ 5\log _{10}[D_{L}(p_{s},z_{i})]+\frac{15}{4}\log _{10}\frac{G}{G_{0}}-m_{\mathrm{obs}}(z_{j})\right\} \cdot \nonumber \\&\quad C_{ij}^{-1}\cdot \left\{ 5\log _{10}[D_{L}(p_{s},z_{j})]+\frac{15}{4}\log _{10}\frac{G}{G_{0}}-m_{\mathrm{obs}}(z_{j})\right\} \nonumber \\ B&=\sum _{\mathrm{SNIa}}C_{ij}^{-1}\cdot \left\{ 5\log _{10}[D_{L}(p_{s},z_{j})]+\frac{15}{4}\log _{10}\frac{G}{G_{0}}-m_{\mathrm{obs}}(z_{j})\right\} \nonumber \\ C&=\sum _{\mathrm{SNIa}}C_{ii}^{-1}. \end{aligned}$$
(22)

The inverse of the covariance matrix \(C_{ij}^{-1}\) with systematic errors can be found in Refs. [33, 71].

3.5 Cosmic microwave background

\(\chi ^{2}_{\mathrm{CMB}}\) has the form [72, 73]

$$\begin{aligned} \chi ^2_{\mathrm{CMB}}(p_{s})=\bigtriangleup d_i[\mathrm{Cov}^{-1}(d_i(p_{s}),d_j(p_{s}))][\bigtriangleup d_i]^t, \end{aligned}$$
(23)

with \(\bigtriangleup d_{i}(p_{s})=d_{i}^{\mathrm{theory}}(p_{s})-d_{i}^{\mathrm{obs}}\). Nine-year WMAP gives \(d_{i}^{\mathrm{obs}}=[l_{A}(z_{*})=302.04, R(z_{*})=1.7246, z_{*}=1090.88]\), and the corresponding inverse covariance matrix [34]

$$\begin{aligned}&\mathrm{Cov}^{-1}= \left( \begin{array}{l} 3.182\quad ~~~18.253\quad ~~~-1.429\\ 18.253\quad ~~~11887.879\quad ~~~-193.808\\ -1.429\quad ~~~-193.808\quad ~~~4.556 \end{array}\right) . \end{aligned}$$
(24)

\(z_{*}=1048\left[ 1+0.00124(\Omega _bh^2)^{-0.738}\right] \left[ 1+g_1(\Omega _{0m} h^2)^{g_2}\right] \) is the redshift at the decoupling epoch of the photons with \(g_1=0.0783(\Omega _bh^2)^{-0.238}\left( 1+ 39.5(\Omega _bh^2)^{0.763}\right) ^{-1}\) and \(g_2=0.560\left( 1+ 21.1(\Omega _bh^2)^{1.81}\right) ^{-1}\), \(l_A(p_{s};\,z_{*})=(1+z_{*})\frac{\pi D_A(p_{s};\,z_{*})}{r_s(z_{*})}\) is the acoustic scale, and \(R(p_{s};\,z_{*})=\sqrt{\Omega _{0m} H^2_0}(1+z_{*})D_A(p_{s};\,z_{*})/c\) is the CMB shift parameter.

3.6 Baryon acoustic oscillation

The radial (line-of-sight) BAO scale measurement from galaxy power spectra can be described by

$$\begin{aligned} \Delta z_{\mathrm{BAO}}(z)=\frac{H(z)r_{s}(z_{d})}{c}. \end{aligned}$$
(25)

Two observational values are \(\Delta z_{\mathrm{BAO}}(z=0.24)=0.0407\pm 0.0011\) and \(\Delta z_{\mathrm{BAO}}(z=0.43)=0.0442\pm 0.0015\), respectively [35]. Here \(r_s(z)\) is the comoving sound horizon size \(r_s=c\int _0^t\frac{c_s\mathrm{d}t}{a}\). \(c_s\) is the sound speed of the photon–baryon fluid, \(c_s^{-2}=3+\frac{4}{3}\times \left( \frac{\Omega _{b}}{\Omega _{\gamma })}\right) a\). \(z_d\) denotes the drag epoch, \(z_d=\frac{1291(\Omega _{0m}h^2)^{-0.419}}{1+0.659(\Omega _{0m}h^2)^{0.828}}\left[ 1+b_1(\Omega _{b}h^2)^{b_2}\right] \) with \(b_1=0.313(\Omega _{0m}h^2)^{-0.419}\left[ 1+0.607(\Omega _{0m}h^2)^{0.674}\right] \) and \(b_2=0.238(\Omega _{0m}h^2)^{0.223}\).

The measurement of BAO peak positions can be performed by the WiggleZ Dark Energy Survey [36], the Two Degree Field Galaxy Redshift Survey [37], and the Sloan Digitial Sky Survey [38]. Introducing \( D_V(z)=\left[ (1+z)^2 D^{2}_{A}(z) \frac{cz}{H(z;p_{s})}\right] ^{1/3}\), one can exhibit the observational data from BAO peak positions thus:

$$\begin{aligned}&X= \left( \begin{array}{l} \frac{r_s(z_d)}{D_V(0.106)}-0.336 \\ \frac{r_s(z_d)}{D_V(0.2)}-0.1905 \\ \frac{r_s(z_d)}{D_V(0.35)}-0.1097 \\ \frac{r_s(z_d)}{D_V(0.44)}-0.0916 \\ \frac{r_s(z_d)}{D_V(0.6)}-0.0726 \\ \frac{r_s(z_d)}{D_V(0.73)}-0.0592 \end{array} \right) ,\nonumber \\&V^{-1}= \left( \begin{array}{llllll} 4444 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad 30318 &{}\quad -17312 &{}\quad 0 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad -17312 &{}\quad 87046 &{}\quad 0 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad 0 &{}\quad 23857 &{}\quad -22747 &{}\quad 10586 \\ 0 &{}\quad 0 &{}\quad 0 &{}\quad -22747 &{}\quad 128729 &{}\quad -59907 \\ 0 &{}\quad 0 &{}\quad 0 &{}\quad 10586 &{}\quad -59907 &{}\quad 125536 \end{array} \right) \nonumber \\ \end{aligned}$$
(26)

where \(V^{-1}\) is the inverse covariance matrix shown in Ref. [74].

The \(\chi ^{2}_{\mathrm{BAO}}\) can be constructed:

$$\begin{aligned} \chi ^{2}_{\mathrm{BAO}}(p_{s})&=\frac{[\Delta z_{\mathrm{BAO}}(z=0.24)-0.0407]^{2}}{0.0011^{2}}\nonumber \\&\quad +\frac{[\Delta z_{\mathrm{BAO}}(z=0.43)-0.0442]^{2}}{0.0015^{2}}+X^tV^{-1}X. \end{aligned}$$
(27)

\(X^t\) denotes the transpose of X.

4 Cosmic constraints on unified model of dark sectors with (or without) a CS fluid in VG theory

Multiplying the separate likelihoods \(L_{i}\propto e^{-\chi ^{2}_{i}/2}\), one can express the joint analysis of \(\chi ^{2}\)

$$\begin{aligned} \chi ^{2}=\chi ^{2}_{LT}+\chi ^{2}_{\mathrm{GRBs}}+\chi ^{2}_{\mathrm{GF}}+\chi ^{2}_{\mathrm{SNIa}}+\chi ^{2}_{\mathrm{CMB}}+\chi ^{2}_{\mathrm{BAO}}. \end{aligned}$$
(28)
Fig. 1
figure 1

\(1\sigma \) and \(2\sigma \) contours of the parameters for the VG-UM model with a CS fluid (left) and the \(\Lambda \)CDM (right) model

Table 4 The mean values with limits and the best-fit values of the parameters for VG-UM model with a CS fluid

4.1 The case with a CS fluid

In order to obtain a stringent constraint on VG theory, we utilize cosmic data different from Ref. [39] to calculate the joint likelihood. Concretely, the LT data, the GRBs data, the GF data, the SNIa data with systematic error, and the BAO data from radial measurement are not used in Ref. [39]. After calculation, the 1-dimension distribution and the 2-dimension contours of the parameters for the VG-UM model with a CS fluid are illustrated in Fig. 1. From Fig. 1 and Table 4, we can see that the restriction on dimensionless energy density of CS is \(\Omega _{s}=-0.0106^{+0.0312+0.0582}_{-0.0305-0.0509}\) in the varying-G theory containing unified dark sectors. In the constant-G theory, one knows that a CS fluid with \(w_{s}=-1/3\) is usually equivalent to a curvature term. But in the VG theory this equivalence is lost due to the term \(a^{-\beta }\) multiplying the density, as shown in Eq. (4). Comparing the VG theory with the constant-G theory, it can be seen that the uncertainty of \(\Omega _{s}\) in VG theory is larger than some results on \(\Omega _{k}\) in constant-G theory. For example, using the same data to constrain other models we have \(\Omega _{k}=-0.0002^{+0.0024+0.0052}_{-0.0024-0.0048}\) (with model parameter \(\Omega _{0de}=0.7098^{+0.0144+0.0265}_{-0.0140-0.0294}\)) in \(\Lambda \)CDM model, \(\Omega _{k}=-0.0001^{+0.0025+0.0052}_{-0.0025-0.0050}\) (with model parameters \(B_{s}=0.7665^{+0.0101+0.0194}_{-0.0099-0.0205}\) and \(\alpha =0.0209^{+0.0186+0.0401}_{-0.0189-0.0373}\)) in constant-G UM. Taking the \(\Lambda \)CDM model as a reference, we can see that the influence on the fitting value of \(\Omega _{k}\) is small from the added parameter \(B_{s}\) and \(\alpha \) as seen in the constant-G UM model, while the influence on the value of \(\Omega _{s}\) is large by the added VG parameter \(\beta \) as indicated in the VG-UM model. From Table 4, one reads off the VG parameter \(\beta =-0.0128^{+0.0394+0.0756}_{-0.0385-0.0718}\). The other parameters are \(B_{s}=0.7457^{+0.0147+0.0269}_{-0.0145-0.0299}\) and \(\alpha =0.0216^{+0.0757+0.1504}_{-0.0781-0.1466}\). We then find at \(1\sigma \) confidence level, the flat \(\Lambda \)CDM model (\(\Omega _{s}=0\), \(\beta =0\) and \(\alpha =0\)) is included in the VG-UM model with a CS fluid. This result in VG theory is the same as the popular feature that the complicated cosmological model is usually degenerate with the \(\Lambda \)CDM model.

4.2 The case without a CS fluid

For the case without a CS fluid, a stringent constraint on VG parameter is \(\beta =0.0007^{+0.0032+0.0062}_{-0.0033-0.0067}\), where a small uncertainty at \(2\sigma \) regions for \(\beta \) is given. Still, it is shown that the value of \(\beta \) is around zero at \(1\sigma \) confidence level for both cases: including or not including a CS fluid, and the case containing a CS fluid has a larger error for \(\beta \) than that not containing a CS fluid. In VG theory, the constraints on the UM model parameters are \(B_{s}=0.7442^{+0.0137+0.0262}_{-0.0132-0.0292}\), \(\alpha =0.0002^{+0.0206+0.0441}_{-0.0209-0.0422}\), \(h=0.6905^{+0.0098+0.0191}_{-0.0096-0.0203}\), and \(100\Omega _bh^{2}=2.267^{+0.054+0.116}_{-0.051-0.102}\). At \(1\sigma \) confidence level, the value of \(\alpha =0\) is not excluded, which demonstrates that the \(\Lambda \)CDM model cannot be distinguished from VG-UM model by the joint cosmic data. Besides the mean values with limits, the best-fit values of the VG-UM model parameters are determined and exhibited in Table 5 and Fig. 2, too. As a reference, the \(\Lambda \)CDM model is calculated by using the combined observational data appearing in Sect. III, and the best-fit values and the mean values with limits on \(\Lambda \)CDM model are shown in Table 5. In the \(\Lambda \)CDM model, one obtains \(\Omega _{0de}=0.7101^{+0.0126+0.0270}_{-0.0135-0.0282}\), that is, the result is compatible with the effective result of \(\Omega _{0de}\) in the VG-UM model.

In order to agglomerate and form a structure of the universe, one uses that the baryonic (and DM) component must have a near zero pressure. Given that \(w_{b}=\frac{p_{b}}{\rho _{b}}=\frac{-\beta (1-\beta )}{3(2+\beta )} \sim 0\), \(\beta \sim 0\) or \(\beta \sim 1\) could be solved. From the above constraint on the parameter \(\beta \), one can see that the solution \(\beta \sim 0\) is consistent with our fitting result for both cases: including or not including a CS fluid in the universe.

Table 5 The mean values with limits and the best-fit values of model parameters for VG-UM model without a CS fluid
Fig. 2
figure 2

\(1\sigma \) and \(2\sigma \) contours of the parameters for the VG-UM model without a CS fluid (left) and the \(\Lambda \)CDM (right) model

Fig. 3
figure 3

The best-fit evolutions of \(\frac{{G}}{G_{0}}\) and \(\frac{\dot{G}}{G}\) with their confidence level in the VG-UM model containing (or not containing) a CS fluid

5 Behaviors of G with the confidence level in VG-UM theory with or without a CS fluid

In VG-UM theory with or without a CS fluid, the best-fit evolutions of \(\frac{\dot{G}}{G}\) with their confidence level (the shadow region) are illustrated in Fig. 3 (one can also see in Table 6) by using the best-fit values of model parameters with their covariance matrix. A dot denotes the derivative with respect to t. In the VG-UM model with a CS fluid, the limit on the variation of G at present is \(\left( \frac{\dot{G}}{G}\right) _{\mathrm{today}}\simeq -0.3496^{+26.3135}_{-26.3135}\times 10^{-13}~\mathrm{year}^{-1}\), and at \(z= 3.5\) we have \(\left( \frac{G}{G_{0}}\right) _{z=3.5}\simeq 0.9917^{+0.0104}_{-0.0131}\) and \(\left( \frac{\dot{G}}{G}\right) _{z=3.5}\simeq -1.800^{+135.396}_{-135.396} \times 10^{-13}~ \mathrm{year}^{-1}\). For the case without a CS fluid, Fig. 3 shows the prediction that today’s value is \(\left( \frac{\dot{G}}{G}\right) _{\mathrm{today}}\simeq -0.7252^{+2.3645}_{-2.3645}\times 10^{-13} ~\mathrm{year}^{-1}\). This restriction on \(\left( \frac{\dot{G}}{G}\right) _{\mathrm{today}}\) is more stringent than the other results in Table 7. Also, using the best-fit value of the parameter \(\beta \) with error, the shapes of \(\frac{G}{G_{0}}=(1+z)^{\beta }\) are exhibited. Taking the high redshift \(z= 3.5\) as another reference point, we find \(\left( \frac{G}{G_{0}}\right) _{z=3.5}\simeq 1.0015^{+0.0071}_{-0.0075}\) and \(\left( \frac{\dot{G}}{G}\right) _{z=3.5}\simeq -0.3792^{+1.2314}_{-1.2314} \times 10^{-12}~\mathrm{year}^{-1}\) in the VG-UM model without a CS fluid. It is important to rigorously constrain the value of \(\beta \), since the monotonicity of \(\frac{\dot{G}}{G}=-\beta H\) depends on the value of \(\beta \). Figure 3 reveals that the behaviors of G and its derivative are around the constant-G theory for both cases: including or not including a CS fluid in universe.

Table 6 The best-fit values of \(\frac{G}{G_{0}}\) and \(\frac{\dot{G}}{G}\) with their confidence level in the VG-UM model containing (or not containing) a CS fluid
Table 7 Limits on the variation of G

6 Behaviors of EoS with the confidence level in VG-UM theory with or without a CS fluid

The EoS of UM in VG theory is demonstrated by

$$\begin{aligned} w_\mathrm{{\mathrm{{VG-UM}}}}(z)= & {} \frac{p_\mathrm{{\mathrm{{VG-UM}}}}}{\rho _\mathrm{{\mathrm{{VG-UM}}}}}\nonumber \\ {}= & {} \frac{\beta -3}{3}\frac{B_{s}}{B_{s}+(1-B_{s})(1+z)^{(1+\alpha )(3-\beta )}}.\nonumber \\ \end{aligned}$$
(29)
Fig. 4
figure 4

The evolutions of EoS with confidence level in VG-UM model including (lower) or not including (upper) a CS fluid. The evolution of \(w_{\mathrm{{VG-UM}}}(z)\) (left), the evolution of \(w_{\mathrm{de}}(z)\) in the VG-UM model with assuming \(w_{\mathrm{dm}}=0\) at prior (middle), and the evolution of \(w_{\mathrm{dm}}(z)\) in the VG-UM model assuming \(w_{\mathrm{de}}=-1\) a priori (right)

Table 8 The best-fit values of \(w_{0\mathrm{VG-UM}}\), \(w_{0\mathrm{dm}}\), and \(w_{0\mathrm{de}}\) with their confidence level hinted by VG-UM model with or without a CS fluid
Fig. 5
figure 5

The evolutions of f(z), f(a), and D(a). The solid lines correspond to the \(\Lambda \)CDM model, the short-dash lines correspond to the VG-UM model with a CS fluid, and the dot lines correspond to the VG-UM model without a CS fluid

From Fig. 4 (left), we can see that \(w_{\mathrm{{VG-UM}}}\sim 0\) (DM) at early time and \(w_{\mathrm{{VG-UM}}}\sim -1\) (DE) in the future for the VG-UM model with or without a CS fluid. If the dark sectors are thought to be separable, it is interesting to investigate the properties of both dark components in the VG-UM model. Supposing that the behavior of dark matter is known i.e. its EoS \(w_{\mathrm{dm}}=0\) \(\left( \rho _{\mathrm{dm}}=\rho _{0\mathrm{dm}}a^{\frac{-\beta ^{2}-2\beta -6}{2+\beta }}\right) \), the EoS of dark energy in the VG-UM model is subject to

$$\begin{aligned} w_{\mathrm{de}}\,{=}\,\frac{p_{\mathrm{de}}}{\rho _{\mathrm{de}}}\,{=}\,\frac{p_{\mathrm{{VG-UM}}}}{\rho _{\mathrm{{VG-UM}}}-\rho _{\mathrm{dm}}}\,{=}\,\frac{-A}{\rho _{\mathrm{{VG-UM}}}^{1+\alpha }-\rho _{\mathrm{dm}}\rho _{\mathrm{{VG-UM}}}^{\alpha }}.\nonumber \\ \end{aligned}$$
(30)

Using the best-fit values of model parameters and the covariance matrix, the evolutions of \(w_{\mathrm{de}}\) with confidence level in the VG-UM model containing (or not containing) a CS fluid are plotted in Fig. 4 (middle). If one deems the behavior of dark energy is the cosmological constant i.e. \(w_{\Lambda }=-1\) (\(p_{\Lambda }=-\rho _{\Lambda }\)), the EoS of dark matter in VG-UM model obeys

$$\begin{aligned} w_{\mathrm{dm}}\,{=}\,\frac{p_{\mathrm{dm}}}{\rho _{\mathrm{dm}}}\,{=}\,\frac{p_{\mathrm{{VG-UM}}}-p_{\Lambda }}{\rho _{\mathrm{{VG-UM}}}-\rho _{\Lambda }} \,{=}\,\frac{\rho _{\Lambda }\rho _{\mathrm{{VG-UM}}}^{\alpha }-A}{\rho _{\mathrm{{VG-UM}}}^{1+\alpha }-\rho _{\Lambda }\rho _{\mathrm{{VG-UM}}}^{\alpha }},\nonumber \\ \end{aligned}$$
(31)

which is drawn in Fig. 4 (right) with the confidence level for two cases (with or without a CS fluid).

From Fig. 4, we get the current values \(w_{0\mathrm{dm}}=0.0009^{+0.0304}_{-0.0304}\) in the VG-UM model with a CS fluid and \(w_{0\mathrm{dm}}=0.0072^{+0.0170}_{-0.0170}\) in the VG-UM model without a CS fluid, which have the larger uncertainties than \(w_{0\mathrm{dm}}=0.0010^{+0.0016}_{-0.0016}\) calculated by the non-unified model of constant-G theory by Ref. [78]. For the current value \(w_{0\mathrm{de}}\), it approximates \(-1\) with the very small uncertainty for both VG-UM model with a CS fluid (\(w_{0\mathrm{de}}=-0.9998^{+0.0125}_{-0.0125}\)) and VG-UM model without a CS fluid (\(w_{0\mathrm{de}}=-0.9986^{+0.0011}_{-0.0011}\)). From the best-fit evolution in the VG-UM model with a CS fluid, we can see that both \(w_{\mathrm{de}} (\sim -1)\) and \(w_{\mathrm{dm}} (\sim 0)\) tend to be constant, but the uncertainties of them are much larger than that in model without a CS fluid. For the best-fit evolution in the VG-UM model without a CS fluid, \(w_{\mathrm{de}}\) and \(w_{\mathrm{dm}}\) are variable with the time and \(w_{\mathrm{dm}}\) tends to have a small deviation from zero (small-positive pressure) at the recent time. In addition, at high redshift the uncertainty of \(w_{\mathrm{de}}\) (or \(w_{\mathrm{dm}}\)) is enlarged (or narrowed) for both VG-UM model with a CS fluid and VG-UM model without a CS fluid (Table 8).

7 Perturbation behaviors in structure formation for VG-UM theory

The study of the structure formation is necessary for a cosmological theory. We investigate the evolutions of the growth function f and the growth factor D in VG-UM theory. The derivations of the evolutionary equations for f and D are shown in the appendix. Using the definition \(f(a)=\frac{aD^{'}(a)}{D(a)}=\frac{\mathrm{d}\ln \delta }{\mathrm{d}\ln a}\), we obtain the dynamically evolutionary equation of f

$$\begin{aligned}&(1+z)f'-f^{2}+(1+z)f\frac{E'}{E}-\frac{4+2\beta +2\beta ^{2}}{2+\beta }f\nonumber \\&\quad +\frac{6+2\beta +\beta ^{2}}{(2+\beta )^{2}}\frac{\Omega _{0m}}{E^{2}}(1+z)^{\frac{6+2\beta +\beta ^{2}}{2+\beta }}=0 \end{aligned}$$
(32)

where a prime denotes the derivative with respect to redshift z and \(E(z) = H(z)/H_{0}\).

In Fig. 5, we use the best-fit values of cosmological parameters in Tables 4 and 5 to plot the evolutions of the growth function f and the growth factor D for the VG-UM model and the \(\Lambda \)CDM model by numerically solving Eqs. (19) and (32) with the initial conditions \(a_{i} = 0.0001\), \(D(a_{i}) = a_{i}\), \(D^{'}(a_{i}) = 0\), and \(f(a_{i})=1\). We can see that the evolutions of f(a) for the VG-UM model (including or not including a CS fluid) fit well as in the \(\Lambda \)CDM model, and the behavior of f(z) are well consistent with the observational growth data listed in Table 3. In the VG-UM model with or without a CS fluid, D(a) evolves more slowly (slower growth of the perturbations) than that in the \(\Lambda \)CDM model. The current value of \(D(a = 1)\) in the \(\Lambda \)CDM model is approximately 12 % larger than that in the VG-UM model without a CS fluid.

8 Conclusions

Observations anticipate that G may be variable and most of the universal energy density invisible. The attractive properties of this study is that the variation of G naturally results in the invisible components in the universe. The VG could provide a solution to the original problem of DM and DE. We apply recently observed data to constrain the unified model of the dark sectors with or without a CS fluid in the framework of VG theory. Using the LT, the GRBs, the GF, the SNIa with systematic error, the CMB from 9-year WMAP, and the BAO data from measurements of the radial and the peak positions, the uncertainties of the VG-UM parameter space are obtained.

For the case without a cosmic string fluid, the constraint on the mean value of the VG parameter is \(\beta =0.0007^{+0.0032+0.0062}_{-0.0033-0.0067}\) with a small uncertainty around zero, and restrictions on the UM model parameters are \(B_{s}=0.7442^{+0.0137+0.0262}_{-0.0132-0.0292}\) and \(\alpha =0.0002^{+0.0206+0.0441}_{-0.0209-0.0422}\) with \(1\sigma \) and \(2\sigma \) confidence level. For the case with a cosmic string fluid, the restriction on the dimensionless density parameter of the CS fluid is \(\Omega _{s}=-0.0106^{+0.0312+0.0582}_{-0.0305-0.0509}\) in the VG-UM theory. Obviously, the uncertainty of \(\Omega _{s}\) is larger than some results on \(\Omega _{k}\) in the framework of the G-constant theory. At \(1\sigma \) confidence level the flat \(\Lambda \)CDM model (\(\Omega _{s}=0\), \(\beta =0\), and \(\alpha =0\)) is included in the VG-UM model.

Using the best-fit values of VG-UM parameters and their covariance matrix, the limits on today’s value are \(\left( \frac{\dot{G}}{G}\right) _{\mathrm{today}}= -0.7252^{+2.3645}_{-2.3645} \times 10^{-13}\) or \(\left( \frac{\dot{G}}{G}\right) _{\mathrm{today}}\simeq -0.3496^{+26.3135}_{-26.3135}\times 10^{-13}\mathrm{year}^{-1}\) for the universe with or without a CS fluid. Corresponding to these two cases, we find \(\left( \frac{G}{G_{0}}\right) _{z=3.5}\simeq 1.0015^{+0.0071}_{-0.0075}\) and \(\left( \frac{G}{G_{0}}\right) _{z=3.5}\simeq 1.0008^{+0.0620}_{-0.0584}\) at redshift \(z=3.5\). If one considers that the DM and the DE could be separable in the unified model, the EoS of DE and DM are discussed by combing with the fitting results. It is shown that \(w_{0\mathrm{dm}}=0.0072^{+0.0170}_{-0.0170}\) or \(w_{0\mathrm{dm}}=0.0009^{+0.0304}_{-0.0304}\) assuming \(w_{0\mathrm{de}}=-1\) for the VG-UM universe containing or not containing a CS fluid, while we have \(w_{0\mathrm{de}}=-0.9986^{+0.0011}_{-0.0011}\) or \(w_{0\mathrm{de}}=-0.9998^{+0.0125}_{-0.0125}\) assuming \(w_{0\mathrm{dm}}=0\) a priori for the VG-UM model with or without a CS fluid.