Page 1 of 1

Better conductance input idiom?

Posted: Fri Aug 22, 2008 1:50 pm
by emuller
Is there a better way to play a specified conductance input than what I'm doing below?

Code: Select all

# create an SEClamp object which is accessible in both python and NEURON
h('objref estim')
h('estim = new SEClamp(0.5)')
estim = h.estim

# Create a stimulus Vector
rs_exc = neuron.Vector(1000.0/g_exc)
#This is not possbile:,'rs')
#So I have to do this:

Re: Better conductance input idiom?

Posted: Sat Aug 23, 2008 4:07 am
by csh
The following code worked fine for me:

Code: Select all

#! /usr/bin/python
from neuron import h
import numpy
h.tstop = 10; h.dt = 0.01; h.steps_per_ms = 1.0/h.dt
soma = h.Section()
estim = h.SEClamp( soma(0.5) )
g_exc = numpy.arange( 10, 10+h.tstop, h.dt )
rs_exc = h.Vector()
rs_exc.from_python( 1000.0/g_exc ) estim._ref_rs, h.dt )
The syntax is eplained here: ... #HocObject
I have used the latest development code (rev. 2194) from the svn repository.