opensourcebrain/HodgkinHuxleyTutorial
0
1/*****2 3A file to create info widgets, plots, save variables etc. in OSB4 5*****/6 7G.addWidget(Widgets.POPUP);8Popup1.setMessage("The <b>Hodgkin-Huxley model</b> is a mathematical model that describes how action potentials in neurons are initiated and propagated. It is a set of nonlinear differential equations that approximates the electrical characteristics of excitable cells such as neurons. <br/><br/>You can run your own simulations of this model by signing up to OSB and logging in. <br/><br/>There is also <a target='_blank' href='http://hodgkin-huxley-tutorial.readthedocs.io/en/latest/'>a tutorial for the HH model</a>, which has been developed as part of the <a target='_blank' href='http://www.openworm.org/'>OpenWorm project</a>.");9Popup1.setName("Description");10Popup1.setPosition(1074,142)11Popup1.setSize(391.8,454.8)12 13 14var Plot1 = G.addWidget(Widgets.PLOT);15Plot1.setName("Hodgkin-Huxley Spiking Neuron");16 17Plot1.setPosition(120, 90);18Plot1.setSize(230,465);19Plot1.plotData(HHCellVClamp.hhpop[0].v);20 21var Plot2 = G.addWidget(Widgets.PLOT);22 23Plot2.setName("Gating Variables");24Plot2.setPosition(120,350);25Plot2.setSize(285,465)26Plot2.plotData(HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.naChans.naChan.h.q);27Plot2.plotData(HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.naChans.naChan.m.q);28Plot2.plotData(HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.kChans.kChan.n.q);29 30Plot2.setLegend(HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.naChans.naChan.h.q,"Sodium h.q");31Plot2.setLegend(HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.naChans.naChan.m.q,"Sodium m.q");32Plot2.setLegend(HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.kChans.kChan.n.q,"Potassium n.q");33 34var Plot3 = G.addWidget(Widgets.PLOT);35 36Plot3.setName("Conductances");37Plot3.setPosition(120,350);38Plot3.setSize(285,465)39Plot3.plotData(HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.naChans.naChan.g);40Plot3.setLegend(HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.naChans.naChan.g,"Sodium g");41Plot3.plotData(HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.kChans.kChan.g);42Plot3.setLegend(HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.kChans.kChan.g,"Potassium g");43 44 45 46Instances.getInstance("HHCellVClamp.hhpop[0].v");47HHCellVClamp.hhpop[0].v.setWatched(true);48 49Instances.getInstance("HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.naChans.naChan.m.q");50HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.naChans.naChan.m.q.setWatched(true);51Instances.getInstance("HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.naChans.naChan.h.q");52HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.naChans.naChan.h.q.setWatched(true);53Instances.getInstance("HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.kChans.kChan.n.q");54HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.kChans.kChan.n.q.setWatched(true);55 56Instances.getInstance("HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.naChans.naChan.g");57HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.naChans.naChan.g.setWatched(true);58Instances.getInstance("HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.kChans.kChan.g");59HHCellVClamp.hhpop[0].bioPhys1.membraneProperties.kChans.kChan.g.setWatched(true);