How to refer to numeric value of crxd.v?
Posted: Wed Nov 17, 2021 6:33 pm
Hello! I am trying to implement voltage-dependent calcium channels using the Hodgkin-Huxley model through the RXD module. The equation that I'm using to define calcium current involves an if-statement:
But it spits out the following error message:
This is the output:
abs((v)/(13.2278975))
Which is not the numeric value that I need to properly process the if statement.
Any suggestions on how I can fix/work around this? Thank you!
Code: Select all
temp1 = 0.0853*T/2
temp2 = v/temp1
temp3 = 0
if abs(temp2) < 1.10e-4:
temp3 = 1-temp2/2
else:
temp3 = temp2/(exp(temp2)-1)
dvf = 0.001/(0.001+cai)*temp1*temp3(1-cai/cao*exp(temp2))
And I have isolated the problem to crxd.v, the purpose of which is "to make HH model work with rxd with have added crxd.v to represent the voltage in Rates and Reactions." https://neuron.yale.edu/neuron/docs/hod ... -using-rxd In the line temp2 = v/temp1, I cannot refer to the numeric value of 'v'. As a result, when I run the following lines of code:---------------------------------------------------------------------------
RxDException Traceback (most recent call last)
/var/folders/g8/zb3mbhcx77jbf0z1yz92s51w0000gn/T/ipykernel_15917/542443844.py in <module>
2 temp2 = v/temp1
3 temp3 = 0
----> 4 if abs(temp2) < 1.10e-4:
5 temp3 = 1-temp2/2
6 else:
/Applications/NEURON/lib/python/neuron/rxd/rxdmath.py in __lt__(self, other)
634 def __lt__(self, other):
635 other = _ensure_arithmeticed(other)
--> 636 _validate_reaction_terms(self, other)
637 return _Reaction(self, other, '<')
638
/Applications/NEURON/lib/python/neuron/rxd/rxdmath.py in _validate_reaction_terms(r1, r2)
123 def _validate_reaction_terms(r1, r2):
124 if not(r1._valid_reaction_term or r2._valid_reaction_term):
--> 125 raise RxDException('lhs=%r and rhs=%r not valid in a reaction' % (r1, r2))
126 elif not r1._valid_reaction_term:
127 raise RxDException('lhs=%r not valid in a reaction' % r1)
RxDException: lhs=abs((v)/(13.2278975)) and rhs=0.00011 not valid in a reaction
Code: Select all
temp1 = 0.0853*T/2
temp2 = v/temp1
print(abs(temp2))
abs((v)/(13.2278975))
Which is not the numeric value that I need to properly process the if statement.
Any suggestions on how I can fix/work around this? Thank you!