Copyright © 2003 - 2004 Erik Billing. Department of Integrative Medical Biology, Umea University, Sweden. All rights reserved.

This computer program is protected by copyright laws and international treaties. Unauthorized reproduction or distribution of this program, or any part of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.

Model overview

The model consists of ten modules implemented in Matlab, all shortly described below. Three global structs named neurons, synapses and consts contain all model parameters, they are all initiated in the function Init_n, but may be edited by hand for special model behaviour.


To run the model, call cim, the main executing script for the model. This file may be changed to edit the main simulation parameters, see file description below. Currents may be injected to the soma and dendrite by changing the Iapp variable of the neurons.soma and neurons.dend structs.

Synapses are added by editing ones in the boolean matrix named rel of the AMPA and GABA structs in synapses.soma and synapses.dend.


After simulation finished two plot windows will appear, showing the membrane potential in the soma and dendrite of all cells in the simulation, respectively. In simulations with many cells, these plots may be unusable and you may want to call plot_n to reduce the number of plotted cells. (See module description below.)

In large simulations a relation-plot may be more usable. Since the generation of a relation-plot generally takes more time then the simulation itself, no relation-plot is generated by default. You can manually generate one by calling movie_n, se module description below.

A description of how to read these plots are given at the projects website, cim.ekhagen.org.


Main file for running the model. Takes no arguments, but may be changed to control the population size, simulation length, applied potentials and synapse position.


Defining most of the model constants. Takes no arguments, but may be changed to control the behaviour of the neurons.


Initiating the model. Takes two arguments where the first control the number of cells to be simulated and the second sets the simulation length, measured in steps. (Requires that constants have bin defended by set_sim before call.)


Runs a simulation over the number of steps given as the first argument. If no value given, the module executes a single step.


Calculating all time dependent variables for a step number given as the first argument, depending on the frame before.


Calculating synapse activity depending on membrane potentials given as the first argument, for a synapse struct given as the second, for the step given as the third and last argument.


Writing the current buffer to the log at the position given as the first argument. May be changed to alter the log writing.


Printing a standard plot of the cells given as the first argument, starting at the position given as the last argument, and stopping at the position given as the third.


Plotting a relation plot and writing it as bmps to the folder given as the first argument. The bitmaps may be merged to a movie by fore example the free video editor VirtualDub.