[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ode45 gives solution in the "Dark Side," but not in Octave
From: |
John B. Thoo |
Subject: |
Re: ode45 gives solution in the "Dark Side," but not in Octave |
Date: |
Thu, 3 Sep 2009 05:18:35 -0700 |
On Sep 2, 2009, at 11:28 AM, Thomas Treichl wrote:
John B. Thoo schrieb:
Hi. I have a question about using ode45 in Octave 3.2.2 (and
OdePkg on Mac OS X 10.4.11) vs. in the "Dark Side" 7.4.0 (R2007a)
(on a server ... Linux?). My code can be found here at the moment:
<http://ms.yccd.edu/~jb2/PickUp/twoway.zip>
"run_twoway.m" executes the code.
Both Octave and the Dark Side solve the problem (i.e., do not
return an error) to produce a solution u, and both give
> size (u)
ans =
8192 102
However, while I can plot the solution in the Dark Side, in Octave
I can plot only the first four frames. In fact, in Octave I get
NaN + 0.00000i from u(:,5) on. Why is that?
I would appreciate any hints. Thanks.
---John.
Good question, I would say that you have a tricky problem and the
solver gets into trouble ;) For a quick workaround: what happens if
you use another solver like ode78? What about ode5r? I tried your
example but get
octave-3.2.0:10> run_twoway
error: `heaviside' undefined near line 4 column 18
error: called from:
error: /Users/Thomas/tmp/thoo/TwoWay/make_k.m at line 4, column 14
error: /Users/Thomas/tmp/thoo/TwoWay/run_twoway.m at line 20,
column 3
Best regards
Thomas
Hi, Thomas.
With ode78, I can plot up to three frames. ode5r gives an error:
octave-3.2.2:11> run_twoway
error: `ode5r' undefined near line 36 column 11
error: called from:
error: /Users/jbthoo/Desktop/NumMethPractice/MHD/TwoWay/
run_twoway.m at line 36, column 9
octave-3.2.2:11>
But you've given me an idea: I look in ~/octave/odepkg-0.6.7/, and
see I also have ode23 and ode54. Unfortunately,
With ode23, I can plot up to seven frames.
With ode54, I can plot up to four frames.
Thanks.
---John.