%% Coupled oscillators: close all; clear all; clc T = linspace(0,1000,10000); alpha=-1; wo=1; w1=sqrt(3/4)*wo; w2=sqrt(3/2)*wo; for i = 1:length(T) t=T(i) phi1=alpha/6*(cos(w1*t))-cos(w2*t); phi2=alpha/6*(3*cos(w1*t))+3*cos(w2*t); x1=sin(phi1); y1=cos(phi1); x2=x1+sin(phi2); y2=y1+cos(phi2); %% pendula hands x=linspace(0,1,100); hand1= (y1)/(x1)*x; hold on plot(x1,-y1, x2, -y2); hold off plot(0,0,'o','MarkerSize',20); hold on plot(x1,-y1,'o', x2, -y2,'o','MarkerSize',12); axis([-2,2,-2,1]); line([0,x1],[0,-y1],'Color','r','LineWidth',3); line([x1,x2],[-y1,-y2],'Color','r','LineWidth',3); pause(1E-20) line end