Is Euler in Dynasim forward or backward?

6 views
Skip to first unread message

thomas....@ugent.be

unread,
Aug 11, 2020, 1:53:34 PM8/11/20
to DynaSim Users
Hi all,

I was wondering if the 'Euler' solver in Dynasim (dsSimulate(spec,'solver','euler')) is forward (i.e., x_(n+1)=x_n+dt*F(x_n,t)) or backward (x_(n+t)=x_n+dt*F(x_(n+1),t+dt).

I always assumed that the Euler-solver was forward/explicit, based on a look in the dynasim source code and the Dynasim wiki.
However, this question arises again from implementing short term synaptic plasiticity: here I believe this question becomes important. 
For instance, the facilitation factor F in a Tsodyks-Markram type model of synaptic plasiticity is incremented after a presynaptic spike. So, this could be implemented by adding to the differential equation of F a term: "dF/dt=....+(sf/dt)*sum(((t-tspike_pre)<=1.1*dt),1)". The correct behaviour should be that F is incremented by sf, after a presynaptic spike. 

Here, if Euler is explicit/forward, I would expect that this implementation is not correct, because the increment is counted twice (at t=tspike_pre, and at t=tspike_pre+dt). So, my thought would be that in this case we should use: "dF/dt=....+(sf/dt)*sum(((t-tspike_pre)<=0.9*dt),1)". However, simulating this shows that the correct result is obtained with the former expression ("dF/dt=....+(sf/dt)*sum(((t-tspike_pre)<=1.1*dt),1)"), which seems to imply that the implemented Euler algorithm is backward/implicit. 

So, the question that I'm struggling with: is this correct that Euler is implicit in Dynasim (because my interpretation of the dynasim source code seems to suggest otherwise), and if not (Euler is explicit), how can I understand this result on synaptic plasticity ("dF/dt=....+(sf/dt)*sum(((t-tspike_pre)<=0.9*dt),1)" results in F=0 for all t, while "dF/dt=....+(sf/dt)*sum(((t-tspike_pre)<=1.1*dt),1)" results in incremented values of F at each presynaptic spike)?

Thank you and with kind regards,
Thomas

(As a side note: I also tested this for rk4: this gives results that look logical from the runge-kutta formula: 
- For "dF/dt=....+(sf/dt)*sum(((t-tspike_pre)<=1.1*dt),1)": F is incremented correctly at t=tspike_pre, but an incorrect increment of sf/6 is also seen at t=tspike_pre+dt (first term in the RK-formula).
- For "dF/dt=....+(sf/dt)*sum(((t-tspike_pre)<=0.9*dt),1)": F is incremented incorrectly at t=tspike_pre with sf-sf/6 (in the RK-formula, this is the last term that is missing in this implementation).
)
Reply all
Reply to author
Forward
0 new messages