Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Problem with NDSOLVE in Mathematica

  1. May 16, 2012 #1
    Mathematica says:

    "NDSolve::alliv: "The function x[t] was specified without dependence on all the independent variables. Each function must depend on all the independent variables.""

    But function x depends only on t, there is no other variable specified in the code.

    What could be the problem? I attach .nb file below.
     

    Attached Files:

  2. jcsd
  3. May 16, 2012 #2
    Hi

    Try this:

    Code (Text):

    NDSolve[{
      y'[t] == -y[t],
      x'[t] == x[t] + y[t],
      x[0] == 0, y[0] == 1},
     {x, y}, {t, 0, 1},
     Method -> "ExplicitMidpoint", "StartingStepSize" -> 1/10]
     
     
  4. May 16, 2012 #3
    It works. Thank you very much :)
     
  5. May 16, 2012 #4
    But for similar system with four variables Mathematica says this:

    "NDSolve has computed initial values that give a zero residual for the \
    differential-algebraic system, but some components are different from \
    those specified. If you need them to be satisfied, it is recommended \
    that you give initial conditions for all dependent variables and \
    their derivatives."

    What could be the cause of this and how to avoid it?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Problem with NDSOLVE in Mathematica
  1. Mathematica NDSolve (Replies: 1)

  2. NDSolve in Mathematica (Replies: 3)

  3. Mathematica NDSolve (Replies: 3)

  4. Mathematica NDSolve (Replies: 27)

Loading...