def current(loci, ail): cell = nm.NeuronModel(dl=1000, dd=2, sl=40, sd=20,\ hl=10, hd=2, ail=ail, aid=1.2, axl=1000, axd=1.2,\ dna=100, sna=100, hna=300, aina=4000, axna=300, dk=20,\ sk=20, hk=150, aik=1000, axk=150,\ na_type=7, aina12=1000, aina16=1000) stim = nm.attach_current_clamp(cell, amp=1, dur=1) vec = nm.set_recording_vectors(cell) v = h.Vector() v.record(cell.ais(loci)._ref_v) icap = h.Vector() # (mA/cm2) icap.record(cell.ais(loci)._ref_i_cap) ileak = h.Vector() # (mA/cm2) ileak.record(cell.ais(loci)._ref_i_pas) ina = h.Vector() # (mA/cm2) ina.record(cell.ais(loci)._ref_ina) ik = h.Vector() # (mA/cm2) ik.record(cell.ais(loci)._ref_ik) nm.simulate() print(nm.cal_velocity(vec, ["ais"])) iax = -np.array(icap.to_python()) - np.array(ileak.to_python()) - np.array( ina.to_python()) - np.array(ik.to_python()) cell.dend1 = None cell.soma = None cell.hill = None cell.ais = None cell.axon = None for sec in h.allsec(): print(sec) return v, icap, ileak, ina, ik, iax
for j, l in enumerate(len_x): file_name = 'type'+str(na_type)\ +'_aina12_'+str(aina12_x[p])\ +'_aina16_'+str(aina16_x[p])\ +'_aik_'+str(aik_x[p])\ +'_dist_'+str(d)+'_len_'+str(l)+'_v_vec.p' print(na_type, p, d, l) cell = nm.NeuronModel(hl=int(d),\ ail=int(l),\ na_type=na_type,\ aina12=aina12_x[p],\ aina16=aina16_x[p],\ aik=aik_x[p]) stim = nm.attach_current_clamp(cell, amp=.7) vec = nm.set_recording_vectors(cell) nm.simulate() nm.save_vec(vec, save_data_path + file_name) nm.show_output(vec, save_figure_path + file_name) bpv_sum[i, j], fwv_sum[i, j], ___ = nm.cal_velocity(vec, ['ais']) cell.dend1 = None cell.dend2 = None cell.soma = None cell.hill = None cell.ais = None cell.axon = None for sec in h.allsec(): print(sec) with open(save_data_path+'type'+str(na_type)\ +'_aina12_'+str(aina12_x[p])\ +'_aina16_'+str(aina16_x[p])\