Skip to content

Commit 87a883e

Browse files
committed
Adding VClamp to new tut model
1 parent 0431bbb commit 87a883e

3 files changed

Lines changed: 70 additions & 3 deletions

File tree

Tutorial2/NeuroML2/HHTutorial.net.nml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2"
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.githubusercontent.com/NeuroML/NeuroML2/master/Schemas/NeuroML2/NeuroML_v2beta3.xsd"
5+
xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.githubusercontent.com/NeuroML/NeuroML2/master/Schemas/NeuroML2/NeuroML_v2beta4.xsd"
66
id="HHTutorial">
77

88
<include href="hhneuron.cell.nml"/> <!-- Include the cell definition -->
9+
10+
<include href="vclamp.xml"/>
911

1012
<!-- Short small current pulse input & short larger current pulse input -->
1113
<pulseGenerator id="IClamp" delay="5ms" duration="25ms" amplitude="0.002nA"/>
14+
1215

1316
<network id="HHTutorial">
1417

@@ -23,7 +26,11 @@
2326
</instance>
2427
</population>
2528

26-
<inputList id="Input_0" component="IClamp" population="hhpop">
29+
<inputList id="IClampInput" component="IClamp" population="hhpop">
30+
<input id="0" target="../hhpop/0/hhneuron" destination="synapses"/>
31+
</inputList>
32+
33+
<inputList id="VClampInput" component="vClamp" population="hhpop">
2734
<input id="0" target="../hhpop/0/hhneuron" destination="synapses"/>
2835
</inputList>
2936

Tutorial2/NeuroML2/LEMS_HHTutorial.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<Include file="Networks.xml"/>
1515
<Include file="Simulation.xml"/>
1616

17-
1817
<Include file="HHTutorial.net.nml"/>
1918

2019
<Simulation id="sim1" length="50ms" step="0.001ms" target="HHTutorial">
@@ -43,6 +42,10 @@
4342
<Display id="d5" title="Hodgkin-Huxley Neuron: I_inj (nA)" timeScale="1ms" xmin="-5" xmax="55" ymin="-0.0005" ymax="0.0025">
4443
<Line id="I_inj (nA)" quantity="hhpop/0/hhneuron/IClamp/i" scale="1nA" color="#ffffff" timeScale="1ms"/>
4544
</Display>
45+
46+
<Display id="d6" title="Hodgkin-Huxley Neuron: VClamp i (nA)" timeScale="1ms" xmin="-5" xmax="55" ymin="-0.0005" ymax="0.0025">
47+
<Line id="VClamp i (nA)" quantity="hhpop/0/hhneuron/vClamp/i" scale="1nA" color="#ffffff" timeScale="1ms"/>
48+
</Display>
4649

4750
<OutputFile id="of0" fileName="hh_tut_v.dat">
4851
<OutputColumn id="v" quantity="hhpop/0/hhneuron/v"/>

Tutorial2/NeuroML2/vclamp.xml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<Lems xmlns="http://www.neuroml.org/lems/0.7.4"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://www.neuroml.org/lems/0.7.4 ../../LEMS/Schemas/LEMS/LEMS_v0.7.4.xsd"
4+
description="New voltage clamp">
5+
6+
7+
<ComponentType name="voltageClampTriple" extends="baseVoltageDepPointCurrent"
8+
description="Voltage clamp. Applies a variable current _i to try to keep parent at _targetVoltage. ">
9+
10+
<Parameter name="active" dimension="none" description="Whether the voltage clamp is active (1) or inactive (0)."/>
11+
12+
<Parameter name="delay" dimension="time" description="Delay before switching from conditioningVoltage to testingVoltage."/>
13+
<Parameter name="duration" dimension="time" description="Duration to hold at testingVoltage."/>
14+
<Parameter name="conditioningVoltage" dimension="voltage" description="Target voltage before time delay"/>
15+
<Parameter name="testingVoltage" dimension="voltage" description="Target voltage between times delay and delay + duration"/>
16+
<Parameter name="returnVoltage" dimension="voltage" description="Target voltage after time duration"/>
17+
18+
<!-- seriesResistance renamed to simpleSeriesResistance & factor of 1e-5 removed from calculation of current. Still being tested... -->
19+
<Parameter name="simpleSeriesResistance" dimension="resistance" description="Current will be calculated by the difference in voltage between the target and parent, divided by this value"/>
20+
21+
<!--TODO: remove! Only required as EventConnection is used in explicitInput to
22+
connect inputs to cells. Events aren't passed! ... -->
23+
<EventPort name="in" direction="in" description="Note this is not used here. Will be removed in future"/>
24+
25+
<Dynamics>
26+
27+
<StateVariable name="i" exposure="i" dimension="current"/>
28+
29+
<OnEvent port="in"><!--TODO: remove, see above...
30+
<StateAssignment variable="i" value="0"/>-->
31+
</OnEvent>
32+
33+
<OnCondition test="active .eq. 1 .and. t .lt. delay">
34+
<StateAssignment variable="i" value="(conditioningVoltage - v) / simpleSeriesResistance"/>
35+
</OnCondition>
36+
37+
<OnCondition test="active .eq. 1 .and. t .geq. delay">
38+
<StateAssignment variable="i" value="(testingVoltage - v) / simpleSeriesResistance"/>
39+
</OnCondition>
40+
41+
<OnCondition test="active .eq. 1 .and. t .gt. duration + delay">
42+
<StateAssignment variable="i" value="(returnVoltage - v) / simpleSeriesResistance"/>
43+
</OnCondition>
44+
45+
</Dynamics>
46+
47+
</ComponentType>
48+
49+
<voltageClampTriple id="vClamp"
50+
active = "0"
51+
delay="10ms" duration="30ms"
52+
conditioningVoltage="-63.77mV"
53+
testingVoltage="10mV"
54+
returnVoltage="-63.77mV"
55+
simpleSeriesResistance="1e4ohm"/>
56+
57+
</Lems>

0 commit comments

Comments
 (0)