function dv = burgf(t,v); % BURGF computes the derivative dv/dt in the system of ODEs global NN aa dx c1 c2 % communicate global constants dv = zeros(NN-1,1); % a column vector dv(1)=c1*v(1).*(v(2)-1) + c2*(v(2)-2*v(1)+1); % note Dir. bdry conds for k=2:NN-2 dv(k)=c1*v(k).*(v(k+1)-v(k-1)) + c2*(v(k+1)-2*v(k)+v(k-1)); end; dv(NN-1)=c1*v(NN-1).*(0-v(NN-2)) + c2*(0-2*v(NN-1)+v(NN-2)); % note b.c.s