如何将参数作为元组传递给odeint?

时间:2015-12-25 03:43:54

标签: python scipy

我想使用带有函数的scipy的odeint

def func(y,t,a=123,b=456)

然后将其用作

odeint(func,y0,t)

如果我想使用args

更改值a和b
odeint(func,y0,t,args=(a=1,b=2))

它抱怨争论不是元组。 这可能是一个非常基本的问题, 如何将关键字参数作为元组传递?

odeint(func,y0,t,args=...?)

1 个答案:

答案 0 :(得分:1)

您只需删除分配即可构成合法元组:

MATCH
  (OI_64cc557459:OI { u:'hello_ry' })<-[:PA]-(VB_dbddd5e6731:VI)
  <-[:INS]-(VBI_ded42b6667f:V { name:'axpl' } )-[:INS]->(VB_3901242e244:VI),

  (VB_dbddd5e6731)-[:AG]->(non_dom:OI)

  (VB_3901242e244)-[:AG]->(p1ou:OI)
  (VB_3901242e244)-[:AG]->(p2ou:OI)
  (VB_3901242e244)-[:PA]->(OI_49067f7680:OI)
  (VB_3901242e244)-[:PA]->(non_dom)

RETURN
  OI_49067f7680,
  VB_dbddd5e6731

There's another answer here with an example of calling odeint with arguments.