
Student Support Forum: 'Now it works, Now it doesn't. Defined function doesn't work next time I open file.' topicStudent Support Forum > General > "Now it works, Now it doesn't. Defined function doesn't work next time I open file."
| Author |
Comment/Response |
John Barber
|
10/02/99 06:40am
I have defined a function to act as a propogator on the {x,v} phase space for the physical pendulum. The function is as follows:
T[ti_ , tf_ ,{xo,vo}]:=
{x[tf], x'[tf]}/.NDSolve[{x''[t]==-Sin[x[t]], x'[ti]==vo, x[ti]==xo},x,{t,ti,tf},
WorkingPrecision->10];
It worked beautifully, and did just what was intended. Then, without changing the function in any way, I shut down the program. When next I started it up, the function no longer worked. I repeat: I did not change a single letter of it. When I try it now, all it returns is T[0,1,{0,1}] (depending on what numbers I give it). It's like I haven't defined the function at all. This has come up again and again with other functions in Mathematica. What's the problem? By the way, I DID remember to ''re-enter'' the function again when I next opened the file, by placing the cursor on that line and hitting shift-return after the kernel had started. Thanks for any explanation.
URL: , |
|
| | | |
 | |
|