[Date Index]
[Thread Index]
[Author Index]
Re: Eigenvalue problem in mathematica...
*To*: mathgroup at smc.vnet.net
*Subject*: [mg93767] Re: Eigenvalue problem in mathematica...
*From*: "sjoerd.c.devries at gmail.com" <sjoerd.c.devries at gmail.com>
*Date*: Tue, 25 Nov 2008 07:17:45 -0500 (EST)
*References*: <gg62l4$537$1@smc.vnet.net>
Bulash,
I can see several problems here:
First, what is this ODE package? As far as I know, differential
equations are done in Mathematica using DSolve or NDsolve. Are you
sure you're not using a another system's package or so (they end in .m as well)?
Anyways, I don't see a statement in your program in which you load
this package (Needs[ ] or <<), so don't expect Mathematica to know the
ODE function automatically.
And then there is the use of the set delayed construction ( := ) for
all of your assignments, even involving constants. For constants, :=
is never essential or useful and Set ( = ) usually yields a much
faster program.
The difference between the two is that in an assignment like a=b+5 the
right-hand side is evaluated immediately and the result is used
whenever the righthand side is used. The value of b at the time of the
assignment to a is used.
In a:=b+5 the right-hand side is *not* evaluated until a is actually
used in an evaluation. The value of b at that time is used, *not* the
value at the time of the assignment to a.
Your definition of p ("p[r_] := e^Integrate[B[r]/A[r], r]") has
several problems:
I assume you want e to be the exponential constant. That should be
either entered as E or esc-ee-esc in Mathematica.
The integral itself is a very complicated function and will take for
ages to solve (if a solution can be found at all, of which I'm not
sure). Due to the ':=' it is calculated *every* time p[r] is used.
Furthermore, if you would like to evaluate p[5] this would yield
e^Integrate[B[5]/A[5], 5] which is clearly nonsense (no integration
variable left here). You should really use '=' here. Or perhaps you
meant something like: p[r_] := E^Integrate[B[r1]/A[r1], {r1,0,r}] ?
Cheers -- Sjoerd
Prev by Date:
**Re: Mathematica 7.0 slow on OS X**
Next by Date:
**Re: Primed Symbols in Mathematica**
Previous by thread:
**Eigenvalue problem in mathematica...**
Next by thread:
**DateListPlot in 3D**
| |