I have a problem concerning an NDSolve solution, the code is the following:

κ=Sqrt[8 π G];
D[x1[N1,ϕ],N1]==-3 x1[N1,ϕ]+Sqrt[6]/2 λ[N1] (x2[N1,ϕ])^2+1/2 x1(3+3(x1[N1,ϕ])^2-3(x2[N1,ϕ])^2+(x3[N1,ϕ])^2), 
D[x2[N1,ϕ],N1]==-(Sqrt[6]/2)λ[N1] x1[N1,ϕ] x2[N1,ϕ]+1/2 (x2[N1,ϕ])(3+3(x1[N1,ϕ])^2-3(x2[N1,ϕ])^2+(x3[N1,ϕ])^2),
D[x3[N1,ϕ],N1]==-2(x3[N1,ϕ])+1/2 (x3[N1,ϕ])(3+3(x1[N1,ϕ])^2-3(x2[N1,ϕ])^2+(x3[N1,ϕ])^2),  
D[λ[N1],N1]==-Sqrt[6] (λ[N1])^2 (Γ-1)(x1[N1,ϕ]),

ϕ[Log[1/(1+2*10^7)]]==1/(κ 10^9) 


The module part does nothing in particular, it mostly is there to protect the symbols, but when I evaluate this code by:

NDSolve::ndnco: The number of constraints (1) (initial conditions) is not equal to the total differential order of the system plus the number of discrete variables (4).

Which I don't really understand since it looks like a simple ruleset as expected, but it is clearly heaving issues, any help would be appreciated

  • $\begingroup$ I'm not sure what precisely is going on with NDSolve, but if you just look at the generated equations, there's the use of \[Lambda] as a function (it's just a number, specifically 0) and a division by zero (Indeterminate) in the ODE for \[Lambda], probably since it's just a number. $\endgroup$
    – Pillsy
    Commented Apr 3, 2018 at 13:51
  • $\begingroup$ Thanks for the heads up, lambda was indeed not a function of N1, which it should be, but the problem is that I still get the same error. will update the question $\endgroup$ Commented Apr 3, 2018 at 13:57
  • $\begingroup$ You did not mention the division by zero error. That's the one you have to track down, first. $\endgroup$ Commented Apr 3, 2018 at 13:57
  • $\begingroup$ Thanks for the comments! devision by zero is solved now, but now there are initial condition problems(it say there 1 constraint, and 4 discrete variables), edited the thing again $\endgroup$ Commented Apr 3, 2018 at 14:18
  • $\begingroup$ You don't parameterize x1, x2, and x3 consistently; get rid of the \[Phi] for the xs in the first four equations, and make sure that x1 appears as x1[N1] in that first equation. NDSolve will work (though the equation is badly behaved and it blows up after a few steps). $\endgroup$
    – Pillsy
    Commented Apr 3, 2018 at 14:56


Your Answer

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