I think the shape of the solutions returned by scipy.integrate.odeint is incorrectly documented: the number of rows matches the number of time steps (in the docstring, N_rows = len(y0)) Example:
from scipy import integrate import numpy as np
x0 = np.ones(5) dxdt = lambda x, t: x + 1 times = np.linspace(0, 1, 10) print integrate.odeint(dxdt, x0, times).shape (10, 5)
Cheers, -Tony PS: I know there's some sort of doc editor for scipy. Should I be making the change there instead of emailing the list? Patch: Index: scipy/integrate/odepack.py =================================================================== --- scipy/integrate/odepack.py (revision 6250) +++ scipy/integrate/odepack.py (working copy) @@ -57,7 +57,7 @@ Returns ------- - y : array, shape (len(y0), len(t)) + y : array, shape (len(t), len(y0)) Array containing the value of y for each desired time in t, with the initial value y0 in the first row.
On Thu, Feb 25, 2010 at 13:26, Tony S Yu <tsyu80@gmail.com> wrote:
PS: I know there's some sort of doc editor for scipy. Should I be making the change there instead of emailing the list?
http://docs.scipy.org/scipy/docs/scipy.integrate.odepack.odeint/#scipy-integ... You will need to create an account and post here asking for write permission (giving your chosen account name) in order to edit. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
On Feb 25, 2010, at 2:30 PM, Robert Kern wrote:
On Thu, Feb 25, 2010 at 13:26, Tony S Yu <tsyu80@gmail.com> wrote:
PS: I know there's some sort of doc editor for scipy. Should I be making the change there instead of emailing the list?
http://docs.scipy.org/scipy/docs/scipy.integrate.odepack.odeint/#scipy-integ...
You will need to create an account and post here asking for write permission (giving your chosen account name) in order to edit.
I just registered as tsyu. Could I please have edit permissions? :) Thanks, -Tony
-- Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
On Thu, Feb 25, 2010 at 02:47:15PM -0500, Tony S Yu wrote:
On Feb 25, 2010, at 2:30 PM, Robert Kern wrote:
On Thu, Feb 25, 2010 at 13:26, Tony S Yu <tsyu80@gmail.com> wrote:
PS: I know there's some sort of doc editor for scipy. Should I be making the change there instead of emailing the list?
http://docs.scipy.org/scipy/docs/scipy.integrate.odepack.odeint/#scipy-integ...
You will need to create an account and post here asking for write permission (giving your chosen account name) in order to edit.
I just registered as tsyu. Could I please have edit permissions? :)
Done. Gael
participants (3)
-
Gael Varoquaux
-
Robert Kern
-
Tony S Yu