--> Pendules Pendule simple C = [0,0] t = 0 a = 0.5 f = 0 w0 = 1 theta = a*cos(w0*t+f) r = 6 D = [r*sin(theta),-r*cos(theta)] point(C) point(D) segment(C,D) setInterval(rotation, 50) function rotation(){ peinture = blanc transparence = 1 rectangle([-11,11],25,25) t = t+0.1 theta = a*cos(w0*t+f) D = [r*sin(theta),-r*cos(theta)] point(C) point(D) segment(C,D) } Pendule double Un seul pendule double Xmin = 0 Xmax = 700 Ymin = 0 Ymax = 700 var d2Theta1 = 0; var d2Theta2 = 0; var dTheta1 = 0; var dTheta2 = 0; var Theta1 = 0*(Math.PI)/2; var Theta2 = 2.3*(Math.PI)/2; var m1 = 10; var m2 = 10; var l1 = 150; var l2 = 150; var X0 = 350; var Y0 = 60; var g = 9.8; var time = 0.05; setInterval(animate, 10) function animate() { mu = 1+m1/m2; d2Theta1 = (g*(sin(Theta2)*cos(Theta1-Theta2)-mu*sin(Theta1))-(l2*dTheta2*dTheta2+l1*dTheta1*dTheta1*cos(Theta1-Theta2))*sin(Theta1-Theta2))/(l1*(mu-cos(Theta1-Theta2)*cos(Theta1-Theta2))); d2Theta2 = (mu*g*(sin(Theta1)*cos(Theta1-Theta2)-sin(Theta2))+(mu*l1*dTheta1*dTheta1+l2*dTheta2*dTheta2*cos(Theta1-Theta2))*sin(Theta1-Theta2))/(l2*(mu-cos(Theta1-Theta2)*cos(Theta1-Theta2))); dTheta1 += d2Theta1*time; dTheta2 += d2Theta2*time; Theta1 += dTheta1*time; Theta2 += dTheta2*time; A = [X0+l1*sin(Theta1), 500-(Y0+l1*cos(Theta1))]; B = [ X0+l1*sin(Theta1)+l2*sin(Theta2), 500-(Y0+l1*cos(Theta1)+l2*cos(Theta2))]; transparence = 1 peinture = blanc rectangle([-10,800],800,900) point([350,440]) segment(A,B) segment([350,440],A) point(A) point(B) }

Xmin = 0 Xmax = 700 Ymin = 0 Ymax = 700 var d2Theta1 = 0; var d2Theta2 = 0; var dTheta1 = 0; var dTheta2 = 0; var Theta1 = 0*(Math.PI)/2; var Theta2 = 2.3*(Math.PI)/2; var m1 = 10; var m2 = 20; var l1 = 150; var l2 = 50; var X0 = 350; var Y0 = 60; var g = 9.8; var time = 0.05; setInterval(animate, 10) function animate() { mu = 1+m1/m2; d2Theta1 = (g*(sin(Theta2)*cos(Theta1-Theta2)-mu*sin(Theta1))-(l2*dTheta2*dTheta2+l1*dTheta1*dTheta1*cos(Theta1-Theta2))*sin(Theta1-Theta2))/(l1*(mu-cos(Theta1-Theta2)*cos(Theta1-Theta2))); d2Theta2 = (mu*g*(sin(Theta1)*cos(Theta1-Theta2)-sin(Theta2))+(mu*l1*dTheta1*dTheta1+l2*dTheta2*dTheta2*cos(Theta1-Theta2))*sin(Theta1-Theta2))/(l2*(mu-cos(Theta1-Theta2)*cos(Theta1-Theta2))); dTheta1 += d2Theta1*time; dTheta2 += d2Theta2*time; Theta1 += dTheta1*time; Theta2 += dTheta2*time; A3 = [X0+l1*sin(Theta1), 500-(Y0+l1*cos(Theta1))]; B3 = [ X0+l1*sin(Theta1)+l2*sin(Theta2), 500-(Y0+l1*cos(Theta1)+l2*cos(Theta2))]; transparence = 1 peinture = blanc rectangle([-10,800],800,900) point([350,440]) segment(A3,B3) segment([350,440],A3) point(A3) point(B3) } Deux pendules doubles avec des conditions initiales proches Xmin = 0 Xmax = 700 Ymin = 0 Ymax = 700 var d2Theta1 = 0; var d2Theta2 = 0; var dTheta1 = 0; var dTheta2 = 0; var Theta1 = 0*(Math.PI)/2; var Theta2 = 2.3*(Math.PI)/2; var m1 = 10; var m2 = 10; var l1 = 150; var l2 = 150; var X0 = 350; var Y0 = 60; var g = 9.8; var time = 0.05; var d2Theta1b = 0; var d2Theta2b = 0; var dTheta1b = 0; var dTheta2b = 0; var Theta1b = 0*(Math.PI)/2; var Theta2b = 2.3*(Math.PI)/2; var m1b = 10; var m2b = 10.01; var l1b = 150; var l2b = 150; setInterval(animate, 10) function animate() { mu = 1+m1/m2; d2Theta1 = (g*(sin(Theta2)*cos(Theta1-Theta2)-mu*sin(Theta1))-(l2*dTheta2*dTheta2+l1*dTheta1*dTheta1*cos(Theta1-Theta2))*sin(Theta1-Theta2))/(l1*(mu-cos(Theta1-Theta2)*cos(Theta1-Theta2))); d2Theta2 = (mu*g*(sin(Theta1)*cos(Theta1-Theta2)-sin(Theta2))+(mu*l1*dTheta1*dTheta1+l2*dTheta2*dTheta2*cos(Theta1-Theta2))*sin(Theta1-Theta2))/(l2*(mu-cos(Theta1-Theta2)*cos(Theta1-Theta2))); dTheta1 += d2Theta1*time; dTheta2 += d2Theta2*time; Theta1 += dTheta1*time; Theta2 += dTheta2*time; A1 = [X0+l1*sin(Theta1), 500-(Y0+l1*cos(Theta1))]; B1 = [ X0+l1*sin(Theta1)+l2*sin(Theta2), 500-(Y0+l1*cos(Theta1)+l2*cos(Theta2))]; transparence = 1 peinture = blanc rectangle([-10,800],800,900) couleur = noir point([350,440]) segment(A1,B1) segment([350,440],A1) point(A1) point(B1) mub = 1+m1b/m2b; d2Theta1b = (g*(sin(Theta2b)*cos(Theta1b-Theta2b)-mub*sin(Theta1b))-(l2b*dTheta2b*dTheta2b+l1b*dTheta1b*dTheta1b*cos(Theta1b-Theta2b))*sin(Theta1b-Theta2b))/(l1b*(mub-cos(Theta1b-Theta2b)*cos(Theta1b-Theta2b))); d2Theta2b = (mub*g*(sin(Theta1b)*cos(Theta1b-Theta2b)-sin(Theta2b))+(mub*l1b*dTheta1b*dTheta1b+l2b*dTheta2b*dTheta2b*cos(Theta1b-Theta2b))*sin(Theta1b-Theta2b))/(l2b*(mub-cos(Theta1b-Theta2b)*cos(Theta1b-Theta2b))); dTheta1b += d2Theta1b*time; dTheta2b += d2Theta2b*time; Theta1b += dTheta1b*time; Theta2b += dTheta2b*time; A1b = [X0+l1b*sin(Theta1b), 500-(Y0+l1b*cos(Theta1b))]; B1b = [ X0+l1b*sin(Theta1b)+l2b*sin(Theta2b), 500-(Y0+l1b*cos(Theta1b)+l2b*cos(Theta2b))]; couleur = rouge point([350,440]) segment(A1b,B1b) segment([350,440],A1b) point(A1b) point(B1b) }