function yprime = nndalay2a(t,y)
%NNDALAY2 Calculates the derivative for layer 2 of the ART1
%
%   NNDALAY2a(t,y)
%     t - Current time
%     y - Current output
%   Returns dy.
 
% First Version, 8-31-95.
 
%==================================================================
 
global p;
global bp;
global bn;
global A;
global i;
 
w = [0.5 0.5;1 0];
e = 0.1;
i=w*p;
 
a = (A*y.^2).* (y>0);
 
yprime = [-y(1) + (bp - y(1))*(a(1)+i(1)) - (y(1) + bn)*a(2);
          -y(2) + (bp - y(2))*(a(2)+i(2)) - (y(2) + bn)*a(1)] /e;
