brian-team / brian2tools

Tools to use with Brian 2, in particular for visualization
https://brian2tools.readthedocs.io
Other
14 stars 12 forks source link

Change for adaption of equations of spatial neuron except morphology #51

Closed sparsh-989 closed 3 weeks ago

sparsh-989 commented 3 weeks ago

Below is the added functionallity https://gist.github.com/sparsh989/41b4168241a6d8b319a51138b80e8602

sparsh-989 commented 3 weeks ago
Screenshot 2024-08-22 at 6 42 54 PM

for the below test file from brian2 import * import brian2tools.mdexport

set device 'markdown'

set_device('markdown', filename='model1_description') defaultclock.dt = 0.01*ms

Morphology

diameter = 1um length = 300um Cm = 1*uF/cm*2 Ri = 150ohm*cm N = 200 morpho = Cylinder(diameter=diameter, length=length, n=N)

Passive channels

gL = 1e-4*siemens/cm2 EL = -70mV eqs = ''' Im = gL (EL - v) : amp/meter2 I : amp (point current) '''

neuron = SpatialNeuron(morphology=morpho, model=eqs, Cm=Cm, Ri=Ri, method='exponential_euler') neuron.v = EL la = Ri * Cm**(0.5)

print("Electrotonic length: %s" % la)

neuron.I[0] = 0.02nA # injecting at the left end run(100ms, report='text')