# Simple Examples¶

How to run these examples

## Create a Leaky Neuron¶

Demonstrates use of Leaky Integrate and Fire (LeakyIaf class) in moose.

lif.setupmodel(modelpath, iaf_Rm, iaf_Cm, pulse_interval)[source]

Create a LeakyIaF neuron under modelpath and a synaptic channel (SynChan) in it. Create a spike generator stimulated by a pulse generator to give input to the synapse.

## Create a Leaky Compartment¶

class lifcomp.LIFComp(*args)[source]

Leaky integrate and fire neuron using regular compartments, spikegen and Func.

Vreset

Reset voltage. The cell's membrane potential is set to this value after spiking.

Vthreshold

Threshold voltage. The cell spikes if its membrane potential goes above this value.

lifcomp.main()[source]

This is an example of how you can create a Leaky Integrate and Fire compartment using regular compartment and Func to check for thresold crossing and resetting the Vm.

lifcomp.setup_two_cells()[source]

Create two cells with leaky integrate and fire compartments. Each cell is a single compartment a1 and b2. a1 is stimulated by a step current injection.

The compartment a1 is connected to the compartment b2 through a synaptic channel.

## Voltage Clamping¶

vclamp.main()[source]

This snippet is to demonstrate modelling of voltage clamping.

vclamp.vclamp_demo(simtime=50.0, dt=0.01)[source]

Demonstration of voltage clamping in a neuron.

## Generate Pulse¶

pulsegen.main()[source]

Demonstrates a pulsegen with multiple levels, delays and widths.

pulsegen2.main()[source]

This example shows the full range of operations of PulseGen objects with a reimplementation of corresponding GENESIS demo.

A PulseGen object can be run in three modes: free running (trigMode=0), triggered (trigMode=1) and gated (trigMode=2).

In the free running mode it keeps repeating the pulse series indefinitely.

In triggered mode, it generates a pulse series on the leading edge of the trigger signal coming to its input field. The trigger can be the output of another PulseGen as in this example.

In gated mode, the PulseGen acts as if it was free-running as long as the input remains high.

## Synapse¶

synapse.main()[source]

This is an example of event messages from multiple SpikeGen objects into a synchan.

Create a SynChan element with 2 elements in synapse field.

Create 5 SpikeGen elements.

Connect alternet SpikeGen elements to synapse[0] and synapse[1]

... This is a minimal example. In real simulations the SpikeGens will be embedded in compartments representing axon terminals and the SynChans will be embedded in somatic/dendritic compartments.

## Message transmission via synapse¶

Demonstrates connection between 2 IntFire neurons to observe spike generation.

intfire.connect_spikegen()[source]

Connect a SpikeGen object to an IntFire neuron such that spike events in spikegen get transmitted to the synapse of the IntFire neuron.

intfire.connect_two_intfires()[source]

Connect two IntFire neurons so that spike events in one gets transmitted to synapse of the other.

intfire.main()[source]

Demonstrates connection between 2 IntFire neurons to observe spike generation.

intfire.setup_synapse()[source]

Create an intfire object and create two synapses on it.

## Gap Junction¶

gapjunction.gapjunction_demo()[source]

Demonstration of medelling gap junction using MOOSE.

gapjunction.main()[source]

This example is to demonstrate, how gap junction can be modeled using MOOSE.

## Insert Spine heads¶

insertSpinesWithoutRdesigneur.main()[source]

This snippet illustrates how the Neuron class does the spine specification, without the rdesigneur intermediate.