help-octave
[Top][All Lists]
Advanced

[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: Thomas Treichl
Subject: Re: ode45 gives solution in the "Dark Side," but not in Octave
Date: Thu, 03 Sep 2009 20:15:26 +0200
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

John B. Thoo schrieb:
Hi, Thomas.  The function "heaviside" is part of SpecFun package:

<http://octave.sourceforge.net/doc/funref_specfun.html>

I will try the other solvers you suggest.  Thanks.

---John.

Ok, I was able to start your script - thanks for the hint. You're using fixed time steps (tspan) with the ode45 solver which is absolutely okay, but the next argument you use (w0) already is complex even before ode45 can do its first step, ie. the initial values already are complex. I don't expect that these values should be complex?! Here is what I see if I remove the semicolon at the end of the line w0=...

octave-3.2.0:1> run_twoway
  w0 =
    -0.537882842739990 + 0.000000000000000i
    -0.537882789290712 + 0.000000000000000i
    -0.537882628942835 + 0.000000000000000i
    -0.537882361696230 + 0.000000000000000i
    -0.537881987550684 - 0.000000000000000i
    -0.537881506505897 - 0.000000000000000i
    -0.537880918561486 + 0.000000000000000i
  <SNIP>

I think that this is the problem you have - ode45 thinks your problem is complex and then tries to solve your complex problem, which it is able to if the complex problem makes sense... So the origin of this problem seems to be somewhere else in your initialization routines. Can you confirm?

Best regards
  Thomas

PS. Just because of interest why you don't have ode5r, did you install OdePkg with the 'pkg' command or did you just unpack the *.tar.gz into some directory? ode5r should be there if you installed OdePkg (it is globally installed on my system but it can also be somewhere in your local home directory)

octave-3.1.55:7> which ode5r
`ode5r' is a function from the file /Users/Thomas/bin/Octave.app.3.2.0/Octave.app/Contents/Resources/libexec/octave/packages/odepkg-0.6.7/i386-apple-darwin8.11.1-api-v37/dldsolver.oct


reply via email to

[Prev in Thread] Current Thread [Next in Thread]