fig=figure;
N=1000;
initPos=[];
initVel=[];
%% IC for delta function position
%% use 4000 steps
for i=1:N
    initPos(i)=2*exp(-.001*(i-N/2)^2);
end
initPos=initPos';
initVel=zeros(N,1);
%% IC for delta function velocity
%% use 4000 steps
%for i=1:N
%    initVel(i)=2000*exp(-.001*(i-N/2)^2);
%end
%initVel=initVel';
%initPos=zeros(N,1);
%% IC for sine wave
%%
%for i=1:N
%    initPos(i)=2*sin(pi/N*i);
%end
%initPos=initPos';
%initVel=zeros(N,1);
%% IC for double sine wave
%%
%for i=1:N
%    initPos(i)=2*sin(2*pi/N*i);
%end
%initPos=initPos';
%initVel=zeros(N,1);
IC=[initPos;initVel];
[t x]=RungeKuttaMethod(@string2,0,.01,4000,IC);
i=(1:N)';
[r c]=size(x);
for j=1:c/10
    plot(i,x(1:N,j*10))
    axis([0,N,-2,2]);
    drawnow;
    %M(j)=getframe(fig);
end
%v=VideoWriter('string.avi');
%open(v)
%writeVideo(v,M)
%close(v)
