function deltah=simulate2(ip,deltat);

K=1; W=100; l=100; Sy=0.05;

[ig,N]=size(ip);

for i=2:N-1
ll=(ip(i)-ip(i-1))*W*min(ip(i),ip(i-1))*K/l;
rr=(ip(i)-ip(i+1))*W*min(ip(i),ip(i+1))*K/l; 
deltah(1,i)=-(ll+rr)/(W*l*Sy)*deltat;
end;
deltah(1,1)=0;
deltah(1,N)=0;

return;

