-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalphafunctioneffect.m
More file actions
24 lines (24 loc) · 1.12 KB
/
alphafunctioneffect.m
File metadata and controls
24 lines (24 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function [Cvoltage, endsample] = alphafunctioneffect(alpha,C,weight,fracleak, timestep, endsample)
%alphafunctioneffect: consider alpha function * weight as charge input, the
%integrate this on capacitor C, while leaking using fracleak.
% The charge incoming is the weight times the alpha function: calculated timestep
% by timestep. This is integrated on C, whilst leaking away through R
% (calculated as fracleak earlier)
% alpha is alphafunction (array)
% weight is the weight at this spine synapse
% endsample is the length of this alphaeffect (which is really a voltage
% trace), necessarily truncated at endsample
% fracleak precomputed from R and C at the synapse in setupnetwork.m
% started LSS 19 11 2024.
Cvoltage = zeros([1 endsample]) ; % preallocate
alphalength = length(alpha) ;
Cvoltage(1) = (alpha(1)*weight*timestep)/C ;
for t = 2:endsample
if (t <= alphalength) % add charge from alphafunction
Cvoltage(t) = Cvoltage(t-1) + (alpha(t)*weight*timestep)/C ; % V=(Q(delta T))/C
else
Cvoltage(t) = Cvoltage(t-1) ;
end
% and let some leak away
Cvoltage(t) = Cvoltage(t)* (1-fracleak);
end