In [9]:
import sys
sys.path.insert(0, '..')
import time
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
%matplotlib notebook
import numpy as np
from Configuration import Configuration
from MotorUnitPool import MotorUnitPool
from AfferentPool import AfferentPool
from SynapsesFactory import SynapsesFactory
In [10]:
conf = Configuration('confmuscleStimulation.rmto')
In [11]:
t = np.arange(0.0, conf.simDuration_ms, conf.timeStep_ms)
pools = dict()
pools[0] = MotorUnitPool(conf, 'SOL')
#pools[1] = AfferentPool(conf,'Ia', 'SOL')
#pools[2]= AfferentPool(conf,'Ia', 'LG')
Syn = SynapsesFactory(conf, pools)
del Syn
In [12]:
plt.figure()
plt.plot(t, pools[0].unit[0].nerveStimulus_mA)
Out[12]:
In [13]:
tic = time.time()
for i in xrange(0, len(t)-1):
pools[0].atualizeMotorUnitPool(t[i])
#pools[1].atualizeAfferentPool(t[i])
#pools[2].atualizeAfferentPool(t[i])
toc = time.time()
print str(toc - tic) + ' seconds'
In [14]:
plt.figure()
plt.plot(t, pools[0].Muscle.force)
Out[14]:
In [15]:
pools[0].listSpikes()
plt.figure()
plt.plot(pools[0].poolTerminalSpikes[:, 0],
pools[0].poolTerminalSpikes[:, 1]+1, '.')
plt.xlim([0,300])
Out[15]:
In [16]:
pools[0].listSpikes()
plt.figure()
plt.plot(pools[0].poolSomaSpikes[:, 0],
pools[0].poolSomaSpikes[:, 1]+1, '.')
plt.xlim([0,300])
plt.show()
In [ ]:
In [ ]:
In [ ]: