Variable Capacitance

11 views
Skip to first unread message

AD

unread,
Mar 5, 2020, 1:37:27 PM3/5/20
to Brian Development
Hello,

I am trying to create a model with a variable capacitance.

I was able to formulate the equations to calculate the capacitance, but I need to implement a max(C, Cmin) function in the equations. How can we do that?

I tried, 
C = C * int(C>Cmin) + Cmin * (Cmin>C) : farad

But it is not compiling. Any suggestions?

Thanks!
AD

Marcel Stimberg

unread,
Mar 6, 2020, 11:36:57 AM3/6/20
to brian-de...@googlegroups.com
Hi,

your equation is indeed invalid because it is circular: C is calculated
as a function of C. When you say the capacitance is "variable" in your
model, what do you mean by that exactly – is it variable over time? If
yes, how does it change, e.g. is it defined by a differential equation?
Finally, is this about a single-compartment (NeuronGroup) or
multi-compartment (SpatialNeuron) model?

Best,

  Marcel


AD

unread,
Mar 7, 2020, 7:51:46 PM3/7/20
to Brian Development
Hi Marcel,

Thanks! You gave me the answer I have been searching for. Modified the equation to the following and it started working:

C = C_calc*int(C_calc>C_min) + C_min*int(C_min>C_calc) : farad

I am using this with NeuronGroup.

Thanks!
AD

Marcel Stimberg

unread,
Mar 9, 2020, 6:01:29 AM3/9/20
to brian-de...@googlegroups.com
Hi,

great that it works for you. Just to mention it, an alternative (maybe a
bit more readable) is to use the clip function:

C = clip(C_calc, C_min, inf*farad) : farad

Best,

  Marcel


Reply all
Reply to author
Forward
0 new messages