Skip to content

Frequently Asked Questions

Erik A. Roberts edited this page Jan 15, 2021 · 13 revisions

Contents

General FAQ

  • How to do voltage clamp mode?

    • Set the capacitance to infinity and control the clamped voltage by adjusting the initial voltage value
  • How to vary population size?

    • vary = {'popName','size',[1 10 100]};
  • How to vary inclusion of mechanisms without changing model qualitatively (e.g., for use with compilation)?

    • To prevent recompiles when using compile_flag=1, include all mechanisms and vary the conductance from 0
  • How to change a parameter midway through a simulation?

    • The way to achieve this is to define the parameter as a function of time.
    • Example: (leak current turns on at t=50ms)
      eqns='dV/dt=10+@current+gl(t)*(V+65); {iNa,iK}; gl(t)=0*(t<50)+.8*(t>50)';
      dsPlot(dsSimulate(eqns));
    • see issue #62
  • How to vary a specific mechanism's parameter when the parameter name is shared by multiple mechanisms?

    • Use {'popX.mechY','param',values} in the vary cell array
  • How to change default figure size?

    • see issue #113 discussion. One way is to add code like this to the startup.m file:
      w = 800;
      h = 600;
      monitors = get(0,'MonitorPositions');
      x = 0.5*(monitors(1,3)-w);
      y = 0.5*(monitors(1,4)-h);
      set(0, 'DefaultFigurePosition',[x y w h]);
  • How to get data from the calculation functions called by the plot functions (e.g. peak frequency from peak power)?

    • All calc functions used in the plot function can be independently called to get results stored in the desired fields
    • Analysis results should be obtained using the calc functions (i.e., not the plot functions)
    • If the calc function is called first and the fields are present in data, then dsPlot() uses the values in the field without re-analyzing the data.
    • see issue #56
  • How to monitor spikes?

    • DynaSim now records the previous 2 spike times whenever the spike monitor is on (e.g., using: monitor V.spikes(thresh)). Spike times can be accessed using the reserved variables "tspike" for the parent population, "tspike_pre" for presynaptic spike times, and "tspike_post" for postsynaptic spike times (equivalent to "tspike" in this case). tspike has dimensions [buffer_size x num_cells]; therefore, operations like summation can be performed on functions of spike times like this: sum(f(t-tspike)) where f is some function that, in this case, has a single argument that is the elapsed time since the previous spike.
    monitor VAR.spikes(#)
    monitor VAR.spikes(threshold)
    monitor VAR.spikes(threshold,#)
    monitor VAR.spikes(#,#)
    monitor VAR.spikes(threshold,buffer_size)
  • How to store user data?

    • Store data in the 'userdata' option in dsSimulate call. The data is stored studyinfo.base_simulator_options.userdata (available on dev branch as of 8/24/18).
  • How to create refractory periods?

    • Refractory periods can be implemented using the reserved variable "tspike" (which is a buffer containing the spike times for the previous two spikes); tspike is recorded any time that spikes are monitored
      LIF={
          'dV/dt=(-70-V+R*I)/10; V(0)=reset'
          'if(any(t<tspike+tabs,1))(V=reset)'   % <-- hold V=reset throughout the absolute refractory period.
          'monitor V.spikes(thresh)'
          'tabs=10; thresh=-55; reset=-75; R=9; I=10'
           };
      data=dsSimulate(LIF);

High Performance Computing (HPC) Linux Cluster FAQ

Clone this wiki locally