function dyv=f_decayseries(kv,cv)

%* function f_decayseries(kv,cv)
%
% input variables:
% kv:		decay constants for elements in series, vector
% cv:		concentrations of elements in series, vector
%
% return value:
% vector containing concentrations of all elements after this decay interval

M=length(cv);
dyv=zeros(1,M);

dyv(1)=-kv(1)*cv(1);

if M>1
  for m=2:M
    dyv(m)= -kv(m)*cv(m) + kv(m-1)*cv(m-1);	%first term is decay of Nth in chain  
  end											%second term is addition from N-1 up the chain
end

