I am attempting to solve the differential equation $\ddot\phi + 3H\dot\phi + \dfrac{dV}{d\phi} = 0.$

For $V(\phi) = V_{0}e^{-\lambda\phi}$, where $V_{0} = 0.7$, $\lambda = 0.1$ and $V'(\phi) = \dfrac{dV}{d\phi}$

Attempt to solve second-order ODE.

def DSDX(S,T):
    phi,deri_phi = S

Declaring some important constants required in the program.

omega_r0 = 8.24e-5
omega_m0 = 0.27

lamb = 0.1 

Defining function for $V(\phi)$ and $V'(\phi)$

def V(x,y):
    return 0.7*np.exp(-1*x*y)

def deri_V(x,y):
    return -1*x*V(x,y)

Now, my first task is to make the differential equation dimensionless, thus needed variable $T = \log_{e}(1+z)$ and some calculation will end up getting equation.

Potential used $$V(\phi) = V_{0}e^{-\lambda\phi}$$ Potential derivative $$V'(\phi) = -\lambda V(\phi)$$ Normalised Hubble Parameter defined $$E^2 = \dfrac{\Omega_{m0}.e^{3T} + \Omega_{r0}.e^{-4T} + V(\phi)}{1 - \dfrac{1}{6}\left(\dfrac{d\phi}{dT}\right)^2}$$ Derivative of Normalised Hubble Parameter $$E' = -\dfrac{\Omega_{r}}{2E} - 1.5E\left( 1 + \dfrac{1}{6}\left(\dfrac{d\phi}{dT}\right)^2\right) + 1.5\dfrac{V(\phi)}{E}$$

Factors Required.

E_squared = ((omega_m0)*np.exp(3*T) + (omega_r0)*np.exp(4*T) + V(lamb,phi))/(1-(deri_phi**2)/6)
E = np.sqrt(np.abs(E_squared))
deri_E = (-0.5/E)*omega_r0*np.exp(4*T) - (1.5)*E*(1+((deri_phi**2)/6)) + 1.5*V(lamb,phi)/E

Function Return.

return [deri_phi, 9*deri_phi - 3*deri_E*deri_phi/E - 3*deri_V(lamb,phi)/E_squared]

Initial conditions

phi0 = 0.1
deri_phi0 = 1e-5
s0 = [phi0,deri_phi0]

Time = np.log(1+np.linspace(1e8,0,10000))
sol = odeint(DSDX,s0,Time)

Plotting graph

phi , deri_phi = sol.T
plt.title('Evolution of Scalar Field $\phi$ for $\lambda = 0.1$')
plt.plot(Time,phi,color = 'red')


Please help me to check the correction.

  • 1
    $\begingroup$ We tend not to like questions of the form "Here's a bunch of code, please check it for me" here. What have you already done to assess the correctness of your implementation? Does it match your expectations? If not, what is wrong. If yes, why do you doubt its correctness? $\endgroup$ Mar 19 at 23:23


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.