5
は私が実行したときに、現在、ただし、結合されたODEシステムを計算するためにscipyのダウンロードのodeint
を使用して、Pythonの初心者です、Pythonシェルは常にodeintを成功させるには?
>>>
Excess work done on this call (perhaps wrong Dfun type).
Run with full_output = 1 to get quantitative information.
>>>
だから、私は私の時間ステップと最終の時間を変更する必要があることを教えてくださいそれを統合可能にするために。これを行うには、私はかなりの痛みである別の組み合わせを試す必要があります。誰も私にどのようにodeint
に自動的にこのodeシステムを正常に統合するために時間ステップと最終時間を変更するように依頼できますか? wrapped_bloch3が関数計算のDy/dtのある
def main(t, init_pop_a, init_pop_b, *args, **kwargs):
"""
solve the obe for a given set of parameters
"""
# construct initial condition
# initially, rho_ee = 0
rho_init = zeros((16,16))*1j ########
rho_init[1,1] = init_pop_a
rho_init[2,2] = init_pop_b
rho_init[0,0] = 1 - (init_pop_a + init_pop_b)########
rho_init_ravel, params = to_1d(rho_init)
# perform the integration
result = odeint(wrapped_bloch3, rho_init_ravel, t, args=args)
# BUG: need to pass kwargs
# rewrap the result
return from_1d(result, params, prepend=(len(t),))
things = [2*pi, 20*pi, 0,0, 0,0, 0.1,100]
Omega_a, Omega_b, Delta_a, Delta_b, \
init_pop_a, init_pop_b, tstep, tfinal = things
args = (Delta_a, Delta_b, Omega_a, Omega_b)
t = arange(0, tfinal + tstep, tstep)
data = main(t, init_pop_a, init_pop_b, *args)
plt.plot(t,abs(data[:,4,4]))
:ここで
とはodeint呼び出したコードの一部です。
あなたのコード、odeintする特にコールの多くを提供してもらえますか? –
あなたは、助けを得るために提供したよりもかなり多くの詳細を追加しなければならないでしょう:あなたはどのタイプのODEを扱っていますか?彼らは堅いのですか? 'odeint'にヤコビの関数を提供していますか?それは合理的ですか? – talonmies
リプレイのおかげで、私は質問を更新しました:) – user1233157