Running the Wilson-Cowan model in Matlab

361 views
Skip to first unread message

Won Hee Lee

unread,
Dec 14, 2016, 1:31:31 PM12/14/16
to TVB Users

Greetings! I am exploring the virtual brain platform, to which I am new. I hope you can help me with. I have started with the Wilson-Cowan model to reproduce Figure 17, first column of Sanz-Leon's paper (NeuroImage, 2015) using "region_deterministic_bnm_wc_a.py", but running it in Matlab. It works well with one variable of interest (e.g., with the default variable of interest "E"). However, when I customized the variables of interest to monitor two different variables together (E and I), it looks like the model does not simulate these two variables. Would I need to simulate independently for each variable? Can I monitor more than 2 variables by running one-time simulation?  

Here is snippet to customize the variables of interest. 

oscilator = py.tvb.simulator.models.WilsonCowan();
oscilator.variables_of_interest = 'I'; % it works for one variable
oscilator.variables_of_interest = py.list( {'E', 'I'} ); % it looks like variables of interest are properly set to monitor two different variables, but the outputs from simulation do not include both "E" and "I". 

Any help will be highly appreciated.

Thanks, 
Won

Lia Domide

unread,
Dec 19, 2016, 3:23:08 PM12/19/16
to TVB Users
Hi Won,

Please find attached a slightly modified file region_deterministic_bnm_wc_a.py
The code should be as you suggest:
oscilator.variables_of_interest=['E', 'I']

In Python this works, variable RAW holds the 2 state variables. See the logs from my run, and notice the value 2 in one of the dimensions:

   INFO  Starting simulation...

   INFO  Finished simulation.

   INFO  (8192, 2, 76, 1)


In Matlab, the result dimensions should be switched (1, 76, 2, 8192).

Best,
Lia.
region_deterministic_bnm_wc_a.py

Won Hee Lee

unread,
Dec 21, 2016, 4:45:46 PM12/21/16
to TVB Users
Hi Lia, Thank you for your kind correction. It makes sense now in both Python and Matlab. Best, Won
Reply all
Reply to author
Forward
0 new messages