ODE solution with Mathematica 8

  • Context: Mathematica 
  • Thread starter Thread starter Dr.BOC
  • Start date Start date
  • Tags Tags
    Mathematica Ode
Click For Summary
SUMMARY

The forum discussion centers on solving a first-order ordinary differential equation (ODE) using Mathematica 8's NDSolve function. The user encounters an error message indicating a non-numerical value for a derivative at x = 0, which arises from not specifying the values of parameters k and r before executing NDSolve. An alternative solution using DSolve is suggested, which successfully provides an analytic solution for the given ODE.

PREREQUISITES
  • Understanding of first-order ordinary differential equations (ODEs)
  • Familiarity with Mathematica 8 syntax and functions
  • Knowledge of numerical methods for solving differential equations
  • Basic concepts of parameter specification in mathematical modeling
NEXT STEPS
  • Review the use of NDSolve in Mathematica 8 for numerical solutions
  • Explore the DSolve function in Mathematica for analytic solutions
  • Learn about parameter specification and its importance in numerical methods
  • Investigate common error messages in Mathematica and their resolutions
USEFUL FOR

Mathematics students, researchers in applied mathematics, and anyone using Mathematica for solving differential equations will benefit from this discussion.

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 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
8K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K