Reset during a simulation

0 views
Skip to first unread message

Wei, Jingjin

unread,
Jun 11, 2019, 12:14:13 PM6/11/19
to DynaSim Users
Hi all,

Is there a way to reinitialize, or reset the voltage of all cells every T while the total run time is Ttot. T< Ttot. Thanks!

Best,
Jingjin

Jason Sherfey

unread,
Jun 11, 2019, 5:37:00 PM6/11/19
to Wei, Jingjin, DynaSim Users
Hi Jingjin,

Here's one way to do it. This should work equally well for a population of cells.

Ttot=100; % ms, duration of simulation

eqns = {
  'dV/dt=@current+10; {iNa,iK}' % neuronal dynamics
  'V_IC=-100*ones(1,Npop)' % voltage reset value
  'T=20' % ms, period between resets
  'V(0)=V_IC' % initialize the voltage
  'if(mod(t,T)<dt*ones(1,Npop))(V=V_IC)' % reset V for entire population every T [ms]
  };

data = dsSimulate(eqns,'time_limits',[0 Ttot]);
dsPlot(data);

Hope this helps.

Cheers,
Jason


--
You received this message because you are subscribed to the Google Groups "DynaSim Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynasim-user...@googlegroups.com.
To post to this group, send email to dynasi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dynasim-users/BN7PR03MB3633321A4894B815940A00CFA7ED0%40BN7PR03MB3633.namprd03.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages