From bug-request at octave dot org Fri Apr 14 11:22:34 2006 Subject: Ode with Negative Delta t From: Brad Bell To: bug at octave dot org Date: Fri, 14 Apr 2006 11:16:20 -0500 I am having some trouble with Odes in Octave when tspan(2) < tspan(1); i.e., when integrating back in time (this is often useful when reversing a process). The Ode corresponding to the code below is: y'(t) = 1 y(0) = 0 This function has final value y(-1) = -1 (requested by tspan = [0, -1]). Unfortunately, Octave returns "ans = 0", on the other hand, Matlab returns ans = -1. ode_negative_dt.m: ---------------------------------------------------- tspan = [0, -1]; y0 = 0; [t, y] = ode45( at ode_negative_dt_fun, tspan, y0); y(end) ---------------------------------------------------- ode_negative_dt_fun.m ---------------------------------------------------- function dydt = ode_negative_dt_fun(t, y) dydt = 1; return ---------------------------------------------------- octave results: --------------------------------------------------- octave:1> version ans = 2.1.73 octave:2> ode_negative_dt ans = 0 octave:3> ---------------------------------------------------- ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------