function [BP,BPno] = Theta(BP,T,deltaT,PreTrain,I_f,TauF,TauS)
%TauSBs = 25;
%IFBf = 0.75;
%TauFBs = 3;
I_s = 1 - I_f;

T= T/10;
deltaT = deltaT/10;

indexs = find(((PreTrain/10) <= T+deltaT)&((PreTrain/10) > T));
% right hand side of * always between 0 and 1, so this decays the previous 
BP = BP*((I_f*exp((-deltaT)/TauF))+ (I_s*exp(-(deltaT)/TauS)));
BPno(1) = BP;
%BP = 0;
for i = 1:length(indexs)

add = ((I_f*exp((-((T+deltaT)-(PreTrain(indexs(i))/10)))/TauF))+ (I_s*exp(-((T+deltaT)-(PreTrain(indexs(i))/10))/TauS)));

BP = BP + add;
BPno(length(BPno)+1) = BP;

end