Mathematica ODE solution with Mathematica 8

  • Thread starter Thread starter Dr.BOC
  • Start date Start date
  • Tags Tags
    Mathematica Ode
AI Thread Summary
The user is experiencing issues with solving a first-order ordinary differential equation (ODE) using Mathematica 8, specifically receiving a non-numerical value error for a derivative at x = 0. The equation involves parameters k and r, which are not specified in the code. It is suggested that the user must define k and r as numerical values before executing NDSolve, as it requires numerical inputs. An alternative solution using DSolve is also recommended, as it can provide an analytic solution for the ODE. Properly defining parameters is crucial for successful numerical computation in Mathematica.
Dr.BOC
Messages
1
Reaction score
0
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?

Thanks
 
Physics news on Phys.org
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.
 

Similar threads

Replies
1
Views
2K
Replies
1
Views
3K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
3
Views
8K
Replies
1
Views
2K
Replies
13
Views
2K
Replies
4
Views
3K
Replies
1
Views
1K
Back
Top