0
我對任何編碼都非常新,並且有很多python問題(python 3)。 我正試圖在一篇有關艾滋病的科學論文中重現數字。他們使用了我必須重新創建的模型的計算機模擬。我不斷變化的方面,並不斷收到不同的錯誤信息 - 目前是 TypeError: odeint() missing 1 required positional argument: 't'使用Odeint圖形使用微分方程
這是我使用的代碼,基於我以前的任務。
#Import necessary programmes
import numpy as np
from scipy.integrate import odeint as od
import matplotlib.pyplot as plt
#define equation for uninfected vs free virus
def free_virus(x,y,v,vm):
x=x=l-(d*x)-(b*x*v)-(bm*x*vm)
v=(k*y)-(u*v)
return np.array(x,v)
l=10
d=0.01
a=0.5
u=3
b=0.01
bm=0.005
e=0.0001
k=km=10
init= [0,0]
t= np.arange(0,40,5)
figure_1=od(free_virus,t,args=(0,40))
plt.plot(figure_1,t)
X和V的是在科學論文給出的公式,我需要對圖表彼此odeint code:
的變量在紙 我很抱歉,如果這似乎很基本的,但會給予非常感謝任何幫助。這已被編輯添加在我的代碼。
我以爲我把它作爲一個圖片添加進來:我是新來的 - 現在已經添加了。謝謝。 –