function dHRF= abs_sim_f(t, dt, n, HRF, e_, Ts, Tf, Eo, Go, b, Tw, Tmtt, Alpha, Beta, tauI, Ra0, Rw0, RI)

tindex = round(t/dt+1,0);
    
% State variables
fa = HRF(1:2,1);   % Relative cerebral blood flow in the arteriole
r = HRF(3:4,1);   % Relative arteriole resistance
v = HRF(5:6,1);     % Relative cerebral blood volume 
s = HRF(7:8,1);     % Vasoactive signal
s(2) = 0;
a = HRF(9:10,1);   % Relative pressure to volume relation constant
q = HRF(11:12,1);

% Parametes
Rw0 = Rw0*eye(2);
Ra0 = Ra0*eye(2);
M = ones(2);
Ra = Ra0*diag(r);
iA = diag(1./a);

% --------------------------------------------------------------
dHRF=zeros(12,1);

fw = iA*v.^(Alpha+Beta);
dv = (fa - fw)./Tmtt;

dHRF(1:2,1) = (ones(2,1)-(Ra+RI*M)*fa-Rw0*iA*v.^(Beta))/(RI*tauI);

dHRF(3:4,1) = -r.^2 .* s;

dHRF(5:6,1) = (fa - fw)./Tmtt;

dHRF(7:8,1) = e_*(n(:,tindex)-1) - s/Ts - (fa - 1)/Tf;
dHRF(8,1) = 0 ;

E = (1-Go)*(1-(1-Eo/(1-Go)).^(1./fa));

dHRF(9:10,1) = (- a + exp (-b*dv))/Tw;
dHRF(11:12,1) = (E/Eo .* fa - fw.*q./v)/Tmtt; 

end