@2014301020081
2016-10-09T07:22:53.000000Z
字数 2184
阅读 468
未分类
we have
if=1s, =100,=0,we can also set that the time step is 0.05s;
t=0
NA_NB=100
dt=0.05
T=1
t=t+dt
NA_NB=NA_NB-(NA_NB/T)*dt
x=[]
y=[]
x.append(t)
y.append(NA_NB)
plt.figure()
plt.xlabel('t')
plt.ylabel('NA-NB')
plt.title('decay_NANB')
plt.plot(x,y)
plt.text(2,80,'Time Constant=1s' 'Time Step=0.05s')
plt.show()
import matplotlib.pyplot as plt
x=[]
y=[]
t=0
NA_NB=100
dt=0.05
T=1
i=0
while i<=100:
x.append(t)
y.append(NA_NB)
t=t+dt
NA_NB=NA_NB-(NA_NB/T)*dt
i=i+1
plt.figure()
plt.xlabel('t')
plt.ylabel('NA-NB')
plt.title('decay_NANB')
plt.plot(x,y)
plt.text(2,80,'Time Constant=1s' 'Time Step=0.05s')
plt.show()
From the graph,we can see when t=5,NA-NB0,it can be regarded as the steady state.we also think the NA-NB=0 when t is large.so we have NA=NB when in the steady state.so