Skip to content Skip to sidebar Skip to footer

Odepack.error: Extra Arguments Must Be In A Tuple

I'm having some issues with my ode solver, I am trying to solve an SEIR problem and I keep getting the same errors dispite the code that i have based my code on being very similar.

Solution 1:

For a single argument do not forget to add the comma in the tuple e.g.

ret = odeint(deriv, y0, t, args=(singleArg,))

See here https://www.tutorialspoint.com/python/python_tuples.htm for single valued tuples.

Unfortunately I do not have enough reputation for a comment.

Solution 2:

Try replacing:

ret = odeint(deriv, y0, t, args=[N1, B, a, d, g, z, M],)

with this:

ret = odeint(deriv, y0, t, args=(N1, B, a, d, g, z, M))

From the scipy documentation:

args : tuple, optional

Extra arguments to pass to function.

Also, google differences b/w list and tuple.

Post a Comment for "Odepack.error: Extra Arguments Must Be In A Tuple"