Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

BRIAN Brain Simulation Tool

BRIAN (specifically Brian 2) is an open-source Python package designed for developing simulations of networks of spiking neurons. Its functionality is primarily aimed at researchers who need a platform that maximizes flexibility, simplicity, and development speed. Unlike many other simulators that provide a fixed library of predefined models, BRIAN allows users to define neuron and synaptic models by providing differential equations in standard mathematical form as strings.

Kinds of Simulations and Analyses

BRIAN supports a wide range of simulations, from simplified phenomenological models to detailed biophysical reconstructions:

Key Concepts for Creating Simulations

To create a simulation in BRIAN, users interact with several core concepts:

Caveats and Limitations

Examples

The Leaky Integrate-and-Fire (LIF) neuron is a common example of a simple spiking neuron model. In the Brian simulator, this model is defined by its membrane potential dynamics and a discontinuous reset mechanism.

Mathematical Formulation

The dynamics of a simple LIF neuron follow a first-order differential equation that describes how the membrane potential (vv) evolves over time:

v(t)=v/τmv'(t) = -v / \tau_m

In this equation, τm\tau_m is the membrane time constant, which determines how quickly the potential “leaks” back to its resting state.

Spiking and Reset Mechanism

A spike is not generated by the differential equation itself but by a threshold condition defined by the user. The process works as follows:

  1. Integration: The neuron integrates synaptic inputs (currents or voltages), causing the membrane potential to rise.

  2. Threshold: When the membrane potential reaches a predefined threshold (VthresholdV_{threshold}), a spike is evoked.

  3. Reset: Immediately after the spike, the membrane potential is reset to a lower value (VresetV_{reset}).

  4. Refractory Period: The neuron may then enter a refractory period (e.g., 5 ms), during which it cannot generate another spike regardless of the input.

Example Parameters

For a standard simulation, such as the PING network described in the sources, the following parameters might be used:

1. Defining Parameters with Physical Units

Brian 2 requires the use of physical units (e.g., ms, mV, Hz) for all constants to ensure dimensional consistency.

from brian2 import *

# Define parameters using units
tau = 10*ms
v_threshold = 1*mV
v_reset = 0*mV

2. Specifying Equations as Strings

The dynamics of the neuron are defined by a string containing the differential equations in standard mathematical form.

# The model follows a first-order differential equation
# Syntax: 'variable_name_derivative : unit'
eqs = '''
dv/dt = -v/tau : volt
'''

3. Creating a NeuronGroup

Neurons are organized into a NeuronGroup, where you specify the number of neurons, the equations, and the discontinuous dynamics (threshold and reset).

# Define a group of 5,000 LIF neurons
# A numerical solver like 'linear' must be explicitly set
G = NeuronGroup(5000, eqs,
				threshold='v > v_threshold',
				reset='v = v_reset',
				method='linear')

4. Running the Simulation

The simulation is executed for a specific duration of “model time”.

# Run for 1 second of simulation time
run(1*second)

Syntax Elements Summary

In addtion to describing neuron spiking, researchers can also describe the fundamental mechanism for simulating intracellular chemical kinetics (such as calcium dynamics or ATP metabolism).

In Brian 2, such a simulation is implemented by treating the concentration of a metabolite as an additional dynamical variable within the neuron’s governing equations.

Implementation Framework

For example, to code a simulation of ATP metabolism you would follow the equation-oriented specification paradigm central to the software.

Conceptual Syntax Example

Based on the general syntax described in the sources for simple neurons and chemical kinetics, the model string would look like this:

# Conceptual example based on BRIAN2's string-based equation logic
metabolic_eqs = '''
dv/dt = (I_leak + I_pump) / Cm : volt
dATP/dt = (ATP_production - ATP_consumption) : mmolar
ATP_consumption = k_pump * f(v) : mmolar/second
'''

Key Considerations and Caveats