| Author |
Comment/Response |
Bill Simpson
|
02/24/13 7:13pm
In Response To 'Re: Re: mathematica ndsolve - no output' --------- When I
"scrape-n-paste" your code into my notebook, a process that sometimes discard end-of-lines and thus can change the results,
and carefully put a semicolon between every pair of of expressions, which not doing has been a long standing source of very strange and hard to find and understand errors,
and turn my warning levels up high
then I get repeated warnings
Less::nord: Invalid comparison with -15.`+0.`I attempted.
that are from your
barrierV[x_] := Which[x<0, 0, x>a, 0, True, barrierHeight];
Those worry me. That makes me think it might always be returning the default value every time.
Changing that to
barrierV[x_] := (Print[x]; Which[x<0, 0, x>a, 0, True, barrierHeight]);
just prints a single x, not a value for x, and again repeats the multiple warnings. So I am guessing that it may be being called with a symbolic x rather than a numeric value.
If it were my code I would want to track down and make absolutely certain I had that critical function correct.
In spite of all that, the code finishes with
{0.13 Second, {{Ψ[x, t] -> InterpolatingFunction[{{-15., 15.}, {0., 200.}}, <>][x, t]}}}
and
Plot3D[Ψ[x, t] /. Out[24][[2, 1]], {x, -15, 15}, {t, 0, 200}]
displays a function==0 uniformly over the x,t range. Probably not what you were looking for.
If you have one machine it works on and another it doesn't then this is a wonderful opportunity for an experiment, assuming your prof will let you TOUCH his computer. Think what kinds of experiments you can do to test smaller parts of the code to try to sneak up on and catch the exact thing causing the problem.
URL: , |
|