Exponential integrate and fire model from LIF model

Hello!
How can I create a simple synapse model between 2 neurons? So far I have the code of the LIF model, and I'm supposed to connect two of these neurons to create a synapse and have a version of facilitation and one of depression (short-term plasticity).
I really have no idea how to start from there. I'm supposed to used the equations in here 3.1 Synapses | Neuronal Dynamics online book (epfl.ch) part 3.1.3 to obtain the graphs of fig. 3.3. I'm getting really frustraded cause I'm not very good at matlab and don't even know where to start. The LIF model itself took me a whole bunch of time. Any help would be very appreciated.
My code of the LIF model is as follows:
%Parameters
Cm = 200; % [nF] membrane capacitance
Rm = 10*1e-3; % [MOhm] resistance
tau = Cm * Rm; %[ms] time constant
Erest = - 70; % [mV] resting potential
current = 3*1e3; %[nA] injected current
time_len = 10; % [ms] time duration for plotting
dt = 0.001; % [ms] time step
timevec = 0:dt:time_len; % time vector with original time step
Istim = zeros(1,length(timevec)); % Istim vector with 1ms time step
Istim(1:end) = current;
Vth = -50; %[mV]
%% stimulating
Vm = Erest;
vecVm = zeros(1,length(timevec)+1); % vector of membrane potential
vecVm(1) = Erest;
i = 1;
for t = 1:(length(timevec)-1) % loop through time vector
dVm = (1/Cm * Istim(t) + 1/tau * (Erest-Vm))*dt;
% calculate derivative of each time
% step
Vm = Vm + dVm; % adding differential to update Vm
if Vm >= Vth % elicite spikes
Vm = Erest;
tsp(i) = t;
i = i+1;
end
vecVm(t+1) = Vm;
end
Plot Vm(t):
%% plotting
num_sp = length(tsp);
figure
plot(timevec,vecVm(1:end-1),'k','linewidth',1.4)
hold on
for k = 1:num_sp
xline(tsp(k)*dt,'k','linewidth',1.4)
end
title('simulated membrane voltage','fontsize',16)
ylabel('membrane voltage [mV]')
xlabel('time [ms]')
set(gca,'ylim',[-70 0])

Answers (0)

Categories

Find more on Neural Simulation in Help Center and File Exchange

Products

Release

R2021a

Asked:

on 21 Nov 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!