function [u,t]=findif(h,k)

  n=(1/h)+1;
m=(1/k)+1;

u=zeros(n,m);
for i=1:n
	u(i,1)=cos(pi*(i-1)*h);
end

% time stepping

for j=1:m-1
	t(j)=j*(k-1);

	u(1,j+1)=1;
        u(n,j+1)=-1;

for i=2:n-1

	%	u(i,j+1)=(k/h^2)*(u(i+1,j)-2*u(i,j)+u(i-1,j))-k/(2*h)*(u(i+1,j)-u(i-1,j))+u(i,j);
u(i,j+1)=u(i,j)+(0.01)*(k/h^2)*(u(i+1,j)-2*u(i,j)+u(i-1,j));

end
end

