Conflict between Mathematica 4.1 and 5.01?
- To: mathgroup at smc.vnet.net
- Subject: [mg46051] Conflict between Mathematica 4.1 and 5.01?
- From: Hugh Walker <hwalker at gvtc.com>
- Date: Tue, 3 Feb 2004 18:20:57 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I run under Mac OS X 10.2.8 on an iMac. The code below was extracted from a package I wrote some time ago using Mathematica 4.1. Recently I upgraded to 5.01. If I execute the last line in 4.1, everything works as intended. However, the identical code executed in 5.01 results in numerous fatal errors. I find nothing in the 5.01 documentation that indicates any such incompatibility. My frustration has boiled over. When pasted in a 4.1 notebook, this code works; but the same code bombs out when pasted in a 5.01 notebook. Can anyone spot the cause of this very strange behavior? Can anyone reproduce these results? The job of the code snippets is to solve an eigenvalue problem by the shooting method. The particular example here ought to produce the ground state energy of the simple oscillator. Any comments would be most welcome. sol[V_, e_, {q_, qLeft_, qRight_}] := First[psi /. NDSolve[{(-(1/2))*Derivative[2][psi][q] + V*psi[q] == e*psi[q], psi[qLeft] == 0, Derivative[1][psi][qLeft] == 1}, psi, {q, qLeft, qRight}]] pistol[V_, e_, {q_, qLeft_, qRight_}] := sol[V, e, {q, qLeft, qRight}][qRight] eigenValue[V_, eStart_, {q_, qLeft_, qRight_}] := e /. FindRoot[pistol[V, e, {q, qLeft, qRight}] == 0, {e, eStart, eStart + 0.01*Abs[eStart]}] eigenValue[0.5*q^2, 0.4, {q, -4., 4.}] ========== Hugh Walker