NDSolve differences between mathematica 8 and 9

  • Context: Mathematica 
  • Thread starter Thread starter EnSlavingBlair
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary
SUMMARY

The discussion focuses on the differences in behavior between Mathematica 8 and Mathematica 9 when using the NDSolve function for solving differential equations. The user encountered an error in Mathematica 9, specifically the message "NDSolve::ndnum: Encountered non-numerical value for a derivative at n==0," while the same expression worked correctly in Mathematica 8. The issue was identified as related to the incorrect usage of the imaginary unit, where the user mistakenly used lowercase "i" instead of the uppercase "I". This highlights a critical change in how Mathematica 9 handles symbolic computations involving imaginary numbers.

PREREQUISITES
  • Familiarity with Mathematica 9 syntax and functions
  • Understanding of differential equations and the NDSolve function
  • Knowledge of symbolic computation and numerical methods in Mathematica
  • Awareness of the differences between Mathematica 8 and 9
NEXT STEPS
  • Research the differences in NDSolve functionality between Mathematica 8 and 9
  • Learn about handling complex numbers in Mathematica, specifically the use of "I" for imaginary numbers
  • Explore error handling and debugging techniques in Mathematica 9
  • Study advanced features of NDSolve, including boundary conditions and initial value problems
USEFUL FOR

This discussion is beneficial for Mathematica users, particularly those working with differential equations, researchers in computational mathematics, and educators teaching numerical methods using Mathematica.

EnSlavingBlair
Messages
34
Reaction score
2
Hello,

I am using mathematica 9 and having some problems with a particular expression, but when I tried it on mathematica 8 it worked perfectly. My expression is:

NDSolve[{D[T[n,z], n]+i 2 D[T[n,z], {z,2}]+z^2 T[n,z]==0, T[0,z]==1, Derivative[0,1][T][n,5]==0, Derivative[0,1][T][n,0]==0}, T, {n,0,5}, {z,0,5}]

where i is the imaginary number, and on both I had a new window to work on, with nothing having been done previously on it.

Mathematica 8 gave me this:
{{T-> InterpolatingFunction[{{0.,5.},{0.,5.}},<>]}}

and mathematica 9 gave me this:
NDSolve::ndnum : Encountered non-numerical value for a derivative at n==0.`.>>

Does anyone know what is going on here? I cannot use mathematica 8, as I do not have continual access to that machine.

Thank you for your help.
 
Physics news on Phys.org
The imaginary number in my code was entered as :esc: I :esc: not as the lower case i.
 
Don't escape "I" for imaginary. Just use capital "I". :I: is capital Iota.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
8K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K