the-virtual-brain/tvb-library — pull request #35 by pausz (2014-11-04 17:28:43+00:00)
Title: The local coupling reformulation

@i-Zaak is visiting us for a week and we discussed about removing the sparse matrix multiplication used to compute the local coupling term in the models 'dfun'.

The changes I just commited here to this new branch mainly affect **where** the local coupling term (local_coupling * some_state_variable) is computed.

@maedoc and @timpx:
I added a (dummy) variable in the models called lcvar to define local coupling variables. By default it is the first state variable of each model. It's completely wrong of course because:
a) there could be more than one variable;
b) there are some models that use a locally defiend auxiliary variable (difference of state variables, or a function of a state variable).

I did not update all the models, only where it was straigthforward and until the local coupling is completely functional.The local_coupling variable now represents the dot product of local_connectivity * first_state_variable and computed directly in the simulator.

Some issues to discuss / consider:

* Consistent aming for the coupling variable (eg, global coupling variables --> gcvar and local coupling variables --> lcvar ?)
* Consistent naming for number of state variables, number of modes and coupling variables. Make them model properties?

The local coupling might be best handled in a separate module because it needs to take care of the cases where there is more than one loca coupling variables; there are auxiliary variables; there are functions to be applied to the current state before computing the local coupling term.