| 1 |
Multicompartmental models (Brian 1 --> 2 conversion) |
| 2 |
==================================================== |
| 3 |
.. sidebar:: Brian 2 documentation |
| 4 |
|
| 5 |
Support for multicompartmental models is now an integral part of Brian 2 |
| 6 |
(an early version of it was included as an experimental module in Brian 1). |
| 7 |
See the document :doc:`../../user/multicompartmental`. |
| 8 |
|
| 9 |
Brian 1 offered support for simple multi-compartmental models in the |
| 10 |
``compartments`` module. This module allowed you to combine the equations for |
| 11 |
several compartments into a single `Equations` object. This is only a suitable |
| 12 |
solution for simple morphologies (e.g. "ball-and-stick" models) but has the |
| 13 |
advantage over using `SpatialNeuron` that you can have several of such neurons |
| 14 |
in a `NeuronGroup`. |
| 15 |
|
| 16 |
If you already have a definition of a model using Brian 1's ``compartments`` |
| 17 |
module, then you can simply print out the equations and use them directly in |
| 18 |
Brian 2. For simple models, writing the equations without that help is rather |
| 19 |
straightforward anyway: |
| 20 |
|
| 21 |
+---------------------------------------------------+---------------------------------------------------+ |
| 22 |
| Brian 1 | Brian 2 | |
| 23 |
+===================================================+===================================================+ |
| 24 |
| .. code:: | .. code:: | |
| 25 |
| | | |
| 26 |
| V0 = 10*mV | V0 = 10*mV | |
| 27 |
| C = 200*pF | C = 200*pF | |
| 28 |
| Ra = 150*kohm | Ra = 150*kohm | |
| 29 |
| R = 50*Mohm | R = 50*Mohm | |
| 30 |
| soma_eqs = (MembraneEquation(C) + | neuron_eqs = ''' | |
| 31 |
| IonicCurrent('I=(vm-V0)/R : amp')) | dvm_soma/dt = (I_soma + I_soma_dend)/C : volt | |
| 32 |
| dend_eqs = MembraneEquation(C) | I_soma = (V0 - vm_soma)/R : amp | |
| 33 |
| neuron_eqs = Compartments({'soma': soma_eqs, | I_soma_dend = (vm_dend - vm_soma)/Ra : amp | |
| 34 |
| 'dend': dend_eqs}) | dvm_dend/dt = -I_soma_dend/C : volt''' | |
| 35 |
| | | |
| 36 |
| neuron = NeuronGroup(N, neuron_eqs) | neuron = NeuronGroup(N, neuron_eqs) | |
| 37 |
| | | |
| 38 |
+---------------------------------------------------+---------------------------------------------------+ |