Re: [問題] odeint 與 複數??

看板Python作者 (shengwey)時間13年前 (2011/04/23 05:21), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
自問自答: def func(y,t): y2=y[:len(y)/2]+y[len(y)/2:]*1j f=... return r_[f.real,f.imag] y0r=r_[y0.real,y0.imag] yr=odeint(func,y0,t) y=yr[:,:len(y0r)/2]+y[:,len(y0r)/2:]*1j ※ 引述《shengwey (shengwey)》之銘言: : 最近剛開始接觸使用python : 請教一下,可以在odeint中使用複數函數嗎? : 另外,有比較方便的方法建立 tridiagonal matrix ? : 例如在 Mathematica 中, DiagonalMatrix 可以指定開始的位置,不一定在對角線上... : 感謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 171.64.57.178
文章代碼(AID): #1DiV5VWd (Python)
討論串 (同標題文章)
文章代碼(AID): #1DiV5VWd (Python)