def main(argv): if len(argv) == 1: i0 = 0.0 else: i0 = float(argv[1]) i = lambda v: i0 ylim = (-100, 100) model = INapIKModel.getHighThresholdInstance(i=i) vs = np.arange(start=-100, stop=50, step=.1) f = model.getFuncVDotAtNInf(i0=i0) plt.plot(vs, f(vs)) plt.ylim(ylim) plt.xlabel('membrane potential, V (mV)') plt.ylabel('current (pA)') plt.grid() plt.show() pdb.set_trace() vEq1 = findZeroByBisection(f, xMin=-60.9, xMax=-60.7) vEq2 = findZeroByBisection(f, xMin=-60.0, xMax=-40.0) vEq3 = findZeroByBisection(f, xMin=-40.0, xMax=-20.0) nEq1 = model._nInf(v=vEq1) nEq2 = model._nInf(v=vEq2) nEq3 = model._nInf(v=vEq3) print('fAtVEq1=%.04f, fAtVEq2=%.04f, fAtVEq3=%.04f)' % \ (f(vEq1), f(vEq2), f(vEq3))) print('Eq1=(%.04f, %.04f), Eq2=(%.04f, %.04f), Eq3=(%.04f, %.04f)' % \ (vEq1, nEq1, vEq2, nEq2, vEq3, nEq3)) pdb.set_trace()
def main(argv): i0 = 3.0 i = lambda v: i0 c = 1.0 eL = -80 gL = 8.0 gNa = 20.0 gK = 10.0 VoneHalf_m = -20.0 k_m = 15.0 VoneHalf_n = -25.0 k_n = 5.0 eNa = 60.0 eK = -90 tau = lambda v: 0.152 ylim = (-100, 50) model = INapIKModel(i=i, c=c, gL=gL, eL=eL, gNa=gNa, eNa=eNa, gK=gK, eK=eK, mVOneHalf=VoneHalf_m, mK=k_m, nVOneHalf=VoneHalf_n, nK=k_n, tau=tau) vs = np.arange(start=-100, stop=50, step=.1) f = model.getFuncVDotAtNInf(i0=i0) plt.plot(vs, f(vs)) plt.ylim(ylim) plt.xlabel('membrane potential, V (mV)') plt.ylabel('current (pA)') plt.grid() plt.show() vEq1 = findZeroByBisection(f, xMin=-70.0, xMax=-60.0) vEq2 = findZeroByBisection(f, xMin=-59.0, xMax=-55.0) vEq3 = findZeroByBisection(f, xMin=-40.0, xMax=-20.0) nEq1 = model._nInf(v=vEq1) nEq2 = model._nInf(v=vEq2) nEq3 = model._nInf(v=vEq3) print('fAtVEq1=%.04f, fAtVEq2=%.04f, fAtVEq3=%.04f)' % \ (f(vEq1), f(vEq2), f(vEq3))) print('Eq1=(%.04f, %.04f), Eq2=(%.04f, %.04f), Eq3=(%.04f, %.04f)' % \ (vEq1, nEq1, vEq2, nEq2, vEq3, nEq3)) pdb.set_trace()
def main(argv): if len(argv) == 1: i0 = 4.512865 else: i0 = float(argv[1]) i = lambda v: i0 ylim = (-100, 100) model = INapIKModel.getHighThresholdInstance(i=i) # vs = np.arange(start=-100, stop=50, step=.1) vs = np.arange(start=-60.935, stop=-60.925, step=.0001) f = model.getFuncVDotAtNInf(i0=i0) plt.plot(vs, f(vs)) # plt.ylim(ylim) plt.xlabel('membrane potential, V (mV)') plt.ylabel(r'$\dot{v}$') plt.axhline(y=0, color="black") plt.grid() plt.show() pdb.set_trace() vEq1 = findZeroByBisection(f, xMin=-61.10, xMax=-61.00) nEq1 = model._nInf(v=vEq1) print('fAtVEq1=%.04f)' % (f(vEq1))) print('Eq1=(%.04f, %.04f)' % (vEq1, nEq1)) pdb.set_trace()
def main(argv): ylim = (-100, 50) model = INapIKModel.getLowThresholdInstance(i=None) vs = np.arange(start=-100, stop=50, step=.1) f = model.getFuncVDotAtNInf(i0=0.0) plt.plot(vs, f(vs)) plt.ylim(ylim) plt.xlabel('membrane potential, V (mV)') plt.ylabel('current (pA)') plt.grid() plt.show() pdb.set_trace() vEq1 = findZeroByBisection(f, xMin=-70.0, xMax=-50.0) nEq1 = model._nInf(v=vEq1) print('Eq1=(%.02f, %.02f)' % (vEq1, nEq1))
def main(argv): if len(argv) == 1: i0 = 0.0 else: i0 = float(argv[1]) i = lambda v: i0 c = 1.0 gL = 1.0 eL = -80.0 gK = 1.0 eK = -90.0 mVOneHalf = -53.0 mK = 15.0 tau = lambda v: 1.0 ylim = (-100, 100) model = IKModel(i=i, c=c, gL=gL, eL=eL, gK=gK, eK=eK, mVOneHalf=mVOneHalf, mK=mK, tau=tau) vs = np.arange(start=-100, stop=50, step=.1) f = model.getFuncVDotAtMInf(i0=i0) plt.plot(vs, f(vs)) plt.ylim(ylim) plt.xlabel('membrane potential, V (mV)') plt.ylabel('current (pA)') plt.grid() plt.show() vEq = findZeroByBisection(f, xMin=-100.0, xMax=-60.0) mEq = model._mInf(v=vEq) print('fAtVEq=%.04f' % (f(vEq))) print('vEq=%.04f, mEq=%.04f' % (vEq, mEq)) pdb.set_trace()
def main(argv): f = lambda x: -(x**2 - 1) zero = findZeroByBisection(f=f, xMin=-10.0, xMax=-.1) print('zero=%f' % zero)