function Adot = dotA(n,AA,dA,tau)  % computes backward discretisation of A(t)'s derivative



if dA < 3                  % no ZNN with j + s = dA < 3  !!
  error('\n dA = j + s = %g here; j and s must each be at least 3 ! \n \n',dA), 
end

if dA == 3                 % use derivative approximations of order j + 2
  Adotv = AA * [3;-4;1]/(2*tau); end                   % for j_s = 1_2

if dA == 4                 
  Adotv = AA * [11;-18;9;-2]/(6*tau); end               % for j_s = 2_2

if dA == 5
  Adotv = AA * [25;-48;36;-16;3]/(12*tau); end          % for j_s = 2_3

if dA == 6
  Adotv = AA * [137;-300;300;-200;75;-12]/(60*tau); end % for j_s = 2_4
                                                        % and j_s = 3_3
                                                              
if dA >= 7
  Adotv = AA * [147;-360;450;-400;225;-72;10]/(60*tau); end % for j_s = 3_4
                                                            % and beyond
                                                              
Adot = reshape(Adotv,n,n);          % create derivative matrix \dot A(t_i)