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

ODE solution with Mathematica 8

  1. Feb 29, 2012 #1
    I'm having issues solving a 1st order ODE.
    Here what happens:

    NDSolve[{y'[x]/y[x] == k *Pi* r^2* Sqrt[1 + y'[x]^2], y[0] == 136/10}, y[x], {x, 0, 30}]
    NDSolve::ndnum: Encountered non-numerical value for a derivative at x == 0.

    Changing the x range is no help... I get the same message for any initial point...

    k and r are given parameters.

    Any idea what's wrong in my code?

  2. jcsd
  3. Feb 29, 2012 #2


    User Avatar
    Science Advisor

    Do you specify the values of k and r before executing the NDSolve? NDSolve is a numerical solution, so it can only work with numbers, not variables.

    Alternatively, you can try using DSolve. Mathematica was able to find an analytic solution.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook