Skip to content

Multiple_Simulations.hoc

Joey Kilgore edited this page Jun 8, 2021 · 5 revisions

Taken from the actual code:
// Multiple_Simulations is a compilation of multiple tests each having a specific purpose
// These tests are not meant to be run from a UI but are instead a predefined set of instructions
// that will often run multiple simulations and from this try and show some effect in the simulations
// They could be as simple as finding a block threshold across changing frequencies or changing diameters
// The point is that these procedures are set simulations each having a specific experiment they conduct

This file has a vast array of utilities for users. While these procedures are not directly connected to a gui, they still give a lot of utility if you know how to use them. The best way to get an understanding of each procedure is to go and read the code. Most of them are fairly well documented, and if clarification is needed an issue can be submitted on the Issues page and labeled as a question.

varyGnabar()

Sets the maximum sodium conductance (gnabar) to the standard value within the MRG model (3.0) and then changes it to a higher value for all nodes (3.3) to see the differences.

setGnabarForAllAxnodes(gnabarValue)

Takes the passed gnabarValue and sets all nodes in the model to that value.

setGnabarForSomeAxnodes(range,value)

Sets the center node and a certain number of nodes to the left and right, gnabar value to the passed value. The range is the number of nodes on each side that will be changed, so if 5 is passed the 5 nodes to the left are changed, and the five nodes to the right are changed.

changeGnabarFromCenter()

This is an experiment that looks at block threshold as you increase the number of nodes where you change the value of gnabar.

onsetDCSine()

This is an experiment that looks at the impact in the change in initial firing from high-frequency stimulation when proceeded by a DC pulse. First the DC block threshold and high-frequency block threshold are determined for the current model. Then the duration and amplitude of the proceeding DC pulse are varied. Going from 10 ms to 100 ms in 10 ms intervals for the duration, and 0x to 3x DC block threshold in 0.5x intervals. Then the number of action potentials are recorded and their times for further analysis.

findBlockTime()

This is an experiment that looks at the time until block. Based on observations that there is a period of time after the last initial action potential fires in which block is still not achieved. First the time of the last AP passing node 30 is recorded, then using that as a baseline, using a binary search, the time when the an AP can be fired from each node and still be blocked is found.

findNoBlockTime()

This is an experiment that looks at the block that doesn't block later.

conductionVelocity(testNum)

testNum is either 0 or 1 depending on which test you want to conduct.
0 - Measures the time of each node firing and stops checking between nodes 45 and 55 to allow measuring during high-frequency stimulation.
1 - Measures the time of all nodes firing, and then calculates the average velocity at the end. Does not work when stimulation is on.

stdurationFinder(lowAmp, highAmp, ampRes, pulseWidth)

This will help find the min amplitude to create an action potential. This is meant to be used with multiple different waveform types. A pulse for each waveform is the first half of a cycle, with the peak amplitude between the lowAmp and highAmp values passed. Using a binary search, the min amplitude for generating an action potential is found.

setSquareWaveFreq(freq)

Extremely useful tool, sets the square electrode parameters to match a given frequency.

findMinFreq(resolution)

This test finds the minimum frequency for which block still occurs. This simply does a binary search and tests if (with a very rough resolution) a block threshold can be found.

findMaxGap(dcAmp, hfAmp, freq)

Find the maximum gap between a DC pulse (20ms) and sinusoidal high frequency signal where there is still reduction in high frequency onset. The dcAmp determines the amplitude of the DC pulse. The hfAmp and freq determine the amplitude and frequency of the sinusoidal signal, respectively. It should be noted a shortcut is used knowing that a DC pulse will almost always cause a single action potential. If more are generated than this may not work as expected.
Returns the minimum gap time (ms)

findMaxCarryover()

Find the max gap after high frequency stimulation is turned off and block still occurs.
Returns the max gap time (ms)

findFiringFreq(minFreq, maxFreq, freqInc, teestAmp, waveformType)

Runs simulations with a specified stimulation frequency and amplitude and measures the firing frequency of the axon. Outputs are given to the console to show the firing frequency and the AP firing times to analyze whether the generated pulses are consistent or bursting patterns. See custom electrode configuration docs for what number should be used for the waveformType.

onsetDCSineBipolar()

Similar to onsetDCSine except this uses two electrodes. Set DC and Sine block levels in the method itself before running this.