Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13280 > unrolled thread

Re: NDSolve differences between mathematica 8 and 9

Started byAlexei Boulbitch <Alexei.Boulbitch@iee.lu>
First post2013-01-26 06:38 +0000
Last post2013-01-26 21:58 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: NDSolve differences between mathematica 8 and 9 Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2013-01-26 06:38 +0000
    Re: NDSolve differences between mathematica 8 and 9 RBaillie <bobbaillie@frii.com> - 2013-01-26 21:58 +0000

#13280 — Re: NDSolve differences between mathematica 8 and 9

FromAlexei Boulbitch <Alexei.Boulbitch@iee.lu>
Date2013-01-26 06:38 +0000
SubjectRe: NDSolve differences between mathematica 8 and 9
Message-ID<kdvtl9$fpf$1@smc.vnet.net>
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.

Hi, Teresa,

It works for me with Mathematica 9:

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}]


{{T -> \!\(\*
TagBox[
RowBox[{"InterpolatingFunction", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0.`", ",", "5.`"}], "}"}], ",",
RowBox[{"{",
RowBox[{"0.`", ",", "5.`"}], "}"}]}], "}"}], ",", "\<\"<>\"\>"}],
       "]"}],
False,
Editable->False]\)}}

The only difference is that I used "I" instead of "i". Indeed "I" in Mathematica is the imaginary unit, while "i" is a variable, like any other letter, say, "a", "b", "c" and so on. As long as you did not give it any value, it is understood as an undefined (i.e. non-numerical) variable by Mathematica, and that's what Mathematica reports you: " Encountered non-numerical value...".

Have fun, Alexei



Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch@iee.lu




[toc] | [next] | [standalone]


#13288

FromRBaillie <bobbaillie@frii.com>
Date2013-01-26 21:58 +0000
Message-ID<ke1ji2$jk9$1@smc.vnet.net>
In reply to#13280
And, if I were you, I would NEVER start any of my variables or
function names with capital letters.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web