<< Main Manual 

Tutorial #3. Changing Neuronal Parameters Before and During a Simulation 

This tutorial assumes that you have completed Tutorial #2.

Changing Neuronal Parameters Before a Simulation

It is trivial to change an individual neuron's parameters or initial conditions in the .net file with a text editor. However, when networks contain many neurons this can become tedious. Especially, if you want to change the parameter to a random value from a Gaussian distribution.

In the .setup file, we can add any number of Change directives to alter parameter values of all the neurons with the network. See the .setup file documentation for what operations are allowed here.

zca.setup:
Network zca.net                            
Dt 0.05                                    
Print Step Size 1                         
Output t VVs hhs nns bbs zzs s               
Experiment control 1  
Change gNaP = 0                            # Sets the
gNaP value for each neuron to zero
Change gA *= 2.0                           # Doubles whatever the current gA value is for that neuron
Change gsyn = gauss(1.0, 0.25)             # Changes all the neurons in the network so that gsyn is a value pulled
                                           #    from a Gaussian distribution with mean of 1.0 and standard
                                           #    deviation of 0.25.

These operations are not computed until immediately before running the simulation, so the original values in the .net file are preserved. This means that it is possible to maintain one copy of a .net file and create a series of .setup files that use that .net file but block specific currents. Since the simulation's data goes into a sub-directory mapped to the .setup filename, running each simulation with a different .setup file results in a different set of results.

For example, we might want to block gA, gNaP, and gZ in separate simulations.

gA_0.setup:

Network zca.net                            
Dt 0.05                                    
Print Step Size 1                         
Output t VVs hhs nns bbs zzs s               
Experiment control 1  
Change gA = 0                            

gNaP_0.setup:
Network zca.net                            
Dt 0.05                                    
Print Step Size 1                         
Output t VVs hhs nns bbs zzs s               
Experiment control 1  
Change gNaP = 0                            

gZ_0.setup:
Network zca.net                            
Dt 0.05                                    
Print Step Size 1                         
Output t VVs hhs nns bbs zzs s               
Experiment control 1  
Change gZ = 0                            

Then, running each simulation:


> cd simulations/ca1
> NeuronetExperimenter gA_0.setup
> NeuronetExperimenter gNaP_0.setup
> NeuronetExperimenter gZ_0.setup  


The following three sets of data are generated (in the gA_0/, gNaP_0/, and gZ_0/ directories):
gA0 example



gNaP0


gZ0

We can confirm that the appropriate changes took effect because in each data directory is a file called final.net that contains the network and all the final parameters and state conditions for each neuron for that run.

Much more fine grain control over which neurons are changed can be achieved as indicated in the .setup file documentation.


Changing Neuronal Parameters During a Simulation

Suppose you want to run your simulation for one second with the neurons unconnected and instantaneously connect the neurons to see what effect this might have. This is where the importance of the .exp files come into play.

First, we edit the original zca.setup file to use an additional file in the Experiment directive:

zca.setup:

Network zca.net                            
Dt 0.05                                    
Print Step Size 1                         
Output t VVs hhs nns bbs zzs s               
Experiment unconnected 2 control 2  

Now, we need to create the new file, called unconnected.exp, in the same directory as control.exp with the following contents:

unconnected.exp:
Time: 500                        
Changes
gsyn = 0
 

and edit control.exp to have a comparable time:

control.exp:
Time: 500                        

This sets each neuron's gsyn value to 0 for the first second of the simulation (i.e., 2 iterations of the 500 ms long 'unconnected' experiment) and then switches back to the original gsyn for the rest of the simulation. The results look like this:

gsyn0

Like in the previous set of examples that blocked currents before running separate simulations, we can sequentially block currents during one simulation by defining multiple .exp files.

>> Tutorial #4. Creating Larger Networks and Introducing Parameter Heterogeneity and Variable Connectivity

<< Main Manual