def run_loop(params):
    external_field, radii = params
    print 'radii: ', radii
    cort_neuron = MLEF.MorrisLecarElectricField(0.2, soma_current=lambda t: soma_current[t], external_field=lambda t: external_field, p=0.2)
    MLEF.run_neurons([cort_neuron], run_time)
    synapse = S.EventTrace(cort_neuron.datas[:,0], peak=0.2)
    effe_neuron = HH.HodgkinHuxley_passive(radii, I=lambda t: synapse.result_trace[t])
    HH.run_neurons([effe_neuron], run_time)    
    return effe_neuron.datas[:,0]
Exemple #2
0
    3) a muscle unit that twitches for every spike event of the
       alpha moter neuron and can perform twitch summation
"""
import numpy as np
import matplotlib.pyplot as plt
import MorrisLecarElectricField as MLEF
import HodgkinHuxley as HH
import EventTrace as S
import Muscles as M


run_time = 200
input_current = np.abs(30 + 50*np.sin(100 * np.linspace(0, 0.1, run_time / 0.1)))
input_current = 40 * np.ones(run_time / 0.1)
cort_neuron = MLEF.MorrisLecarElectricField(soma_current=lambda t: input_current[t])
MLEF.run_neurons([cort_neuron], run_time)
synapse = S.EventTrace(cort_neuron.datas[:,0], peak=0.2)
effe_neuron = HH.HodgkinHuxley_passive(I=lambda t: synapse.result_trace[t])
HH.run_neurons([effe_neuron], run_time)
muscle_fiber0 = M.MuscleFiber(effe_neuron, 1, 5.0, 7.0)
muscle_fiber1 = M.MuscleFiber(effe_neuron, 5, 40, 80.0)
muscle = M.MotorUnit([muscle_fiber0, muscle_fiber1], 2, )

plt.figure()
plt.subplot(511)
plt.plot(input_current)
plt.subplot(512)
plt.plot(cort_neuron.datas[:,0])
plt.subplot(513)
plt.plot(synapse.result_trace)
plt.subplot(514)
Exemple #3
0
 def run_external(self):
     MLEF.run_neurons(self.cortical_neurons, self.run_time)