%
% one mass one spring
%

close all
figure(1)

t = 0:.01:1;

sx = t;
sy = 0.6*sin(4*pi*t);

mx = cos(2*pi*t);
my = sin(2*pi*t);

lx = [0 1];
ly = [0 0];

wx = [0 0];
wy = [-2 2];

plot(wx,wy,'k','linewidth',1.5)
hold
plot(lx,ly,'k','linewidth',1.5)
plot(sx+1,sy,'k','linewidth',1.5)
text(3/2,1.0,'k','fontsize',18)
plot(lx+2,ly,'k','linewidth',1.5)
plot(mx+4,my,'k','linewidth',1.5)
text(3.9,-.05,'m','fontsize',18)
plot([4 4],[1.2 1.8],'k','linewidth',1.5)
plot([4.1 4.5],[1.5 1.5],'k','linewidth',1.5)
plot([4.4 4.5],[1.6 1.5],'k','linewidth',1.5)
plot([4.4 4.5],[1.4 1.5],'k','linewidth',1.5)
text(4.6,1.5,'x','fontsize',18)
text(4.6,-1.5,'f','fontsize',18)

plot([4 4],[-1.2 -1.8],'k','linewidth',1.5)
plot([4.1 4.5],-[1.5 1.5],'k','linewidth',1.5)
plot([4.4 4.5],-[1.6 1.5],'k','linewidth',1.5)
plot([4.4 4.5],-[1.4 1.5],'k','linewidth',1.5)

text(0.5,1.5,'(A)','fontsize',20)
axis equal
axis off
hold

figure(2)
t = 0:.05:40;
a = 0.6;
y=(sin(t)-sin(a*t))/(2*(a-1))+(sin(t)-sin(a*t))/(2*(a+1));
plot(t,y,'b','linewidth',1.5)
hold on
a = 1;
x = sin(t)/2 - t.*cos(t)/2;
plot(t,x,'k','linewidth',1.5)
a = 1.4;
y=(sin(t)-sin(a*t))/(2*(a-1))+(sin(t)-sin(a*t))/(2*(a+1));
plot(t,y,'r','linewidth',1.5)
xlabel('t','fontsize',14)
ylabel('x','fontsize',14)
text(5,15,'(B)','fontsize',20)
legend('a=0.6','a=1','a=1.4','location','SW')
box off
hold off


