Transcript for:
Double Pendulum Dynamics

this my dear friends is a double pendulum two simple pendulums attached to one another via some kind of a massless rod free to oscillate now as you can see the motion is very very interesting now if you remember i did a video on simple pendulum previously and i showed how the motion of a simple pendulum is not that simple but when it comes to the double pendulum the motion is complicated to say the least it's a very chaotic motion as you can see from the transitory right in front of you so what can you expect from today's video well we're going to look at the equation of motion of a double pendulum and to obtain the equation of motion i'm going to use the lagrangian approach so therefore understanding of the lagrangian approach is a prerequisite if you're interested in watching this full video i'm going to look at the energies and from there i'm going to obtain a lagrangian and from the lagrangian i'm going to plug it into the euler lagrange equation and obtain the equations of motion and then i'm going to look at the solutions of the equations of motion via some kind of a computational software where we look at going to look at the solutions and various other parameters associated with time i'm also going to demonstrate how the double pendulum is an example of a chaotic system so chaotic systems are those which are very very sensitive to initial conditions so a very minute difference in the initial condition results in vastly different trajectories later on which is what i'm also going to demonstrate for the double pendulum now this video is part of a two video series in which i'm going to talk about all these things in today's video in the second video which i'm going to publish later on i'm going to talk about what happens to the nature of motion for small angle approximations so i'm going to talk about normal modes and normal frequencies for small angle approximations in the second video in today's video we're going to look at the general motion for this kind of a system so let us [Music] so here we have a system of a double pendulum where as you can see there is some kind of a point mass let's suppose m1 that is attached to some kind of a pivot here via some kind of a massless rod let's suppose having length l one and which is again attached to another point mass let's suppose m two which is attached to the first mass via another massless rod let's suppose l two and this entire system's motion is restricted to a plane we call this a coplanar double pendulum i'm interested in obtaining security motion for that i'm going to have to look at the coordinates associated with it so i'm i have the system where let's suppose this is the x-axis all right and this is the upward is the y-axis and the pivot here represents the origin of the x-y axis if this is the situation what is the coordinates associated with m1 the coordinates associated with m1 is let's suppose x1 and x2 along the x-axis respectively and y1 and y2 in the y-axis negative y-axis respectively in such a scenario i want to look at the nature of its motion not in terms of x and y but in terms of let's suppose it's angular displacement so i'm going to also introduce another quantity here so let's suppose the angular displacement of the first mass m1 from some kind of a vertical axis is given by theta 1 and the angular displacement of let's suppose the mass 2 from the vertical axis is given by theta 2. the degree of freedom of this system is 2. even though there are 4 coordinates because of the constraints involved due to this massless rods the degree of freedom is 2 and therefore i can write x and y in terms of the thetas so the transformation equations are going to be x1 is equal to l1 sine theta 1 as you can see from here this is the l 1 sin theta 1 right similarly the x 2 is going to be equal to l 1 sine theta 1 plus l 2 sine theta 2 which is this distance right and for the components along the y axis y 1 is nothing but minus l 1 cos theta 1 minus because it's in the negative axis right here this is the distance i have and for the case of y 2 i have minus l 1 cos theta 1 minus l 2 cos theta 2 so these are the transformation equations from the x 1 y 1 x 2 y 2 coordinates to theta 1 and theta 2 coordinates now if i want to obtain the lagrangian for this system first of all i will have to obtain the potential energy as well as the kinetic energy first let's obtain the potential energy now for a potential energy we need some kind of a reference for zero potential so let's suppose the reference for zero potential is the y is equal to zero line which is v is equal to zero so if the reference for the zero potential is uh the y is equal to zero line in that kind of a situation ah the potential energy v is simply equal to m g and the vertical displacement of mass m one which is m one g y one plus m2 g y2 from here let's suppose these are equation number 1 2 3 and 4. so from equation number 3 and 4 i can write down that this is nothing but m 1 g l 1 cos theta 1 and this is nothing but m 2 g l 1 cos theta 1 minus m 2 g l 2 cos theta 2 that can be further simplified to minus m 1 plus m 2 g l 1 cos theta 1 minus m 2 g l 2 cos theta this is an expression for the potential energy of the system let's suppose this is point number 5 now i am also interested in finding out what is the kinetic energy right so for kinetic energy what are we going to do the general expression for the kinetic energy for both the masses m1 and m2 can simply be written as half m1 v square right and our v1 square and half m2 v2 square where v1 and v2 are the velocities of both these two masses as it is moving in this plane right however i can write these in terms of x and y so this first can be written as half m1 x1 dot square plus y1 dot square and the second term is half m2 v2 square can be written as x2 dot square plus y2 dot square now you may say what is x1 dot and y1 dot well x1 dot is nothing but the time derivative of x1 which is nothing but what this is just a velocity component along the x axis for the first particle so v x 1 similarly y 1 dot is the velocity component of the first particle along the y axis and the same goes for x 2 dot and y 2 dot all right so i can obtain what is the velocity components of the first particle and the second particle along the x and y axis respectively from the transformation equations that i've written here so let us obtain the time derivative of these quantities so let's suppose the time derivative of x1 is what i am interested in so as you can see from here l1 is a constant so l1 is just here the time derivative of sin theta 1 is nothing but cos theta 1 multiplied by the time derivative of theta 1 which is theta 1 dot second ah the time derivative of x 2 dot is nothing but l 1 cos theta 1 theta 1 dot plus l 2 cos theta 2 theta 2 dot which is also obvious from here and next the time derivative from y 1 is equal to nothing but l one the time derivative of cos is minus sign so this becomes plus so this is sine theta one theta one dot and the time derivative of y two is nothing but l one sine theta 1 theta 1 dot plus l 2 sine theta 2 theta 2 dot okay now let us bring this down a little bit so that it's visible in the screen let us plug all of them into this uh equation for the kinetic energy and then we will obtain what is the kinetic energy in its proper form so this is first term is half m1 x1 dot square is nothing but l1 cos theta 1 theta 1 dot square plus y 1 dot square is l 1 sine theta 1 theta 1 dot square and this is together plus half m2 x2 is l1 cos theta 1 theta 1 dot plus l2 cos theta 2 theta 2 this should be a dot here whole square plus and x y 2 dot square is l 1 sine theta 1 theta 1 dot plus l 2 sine theta 2 theta 2 dot or square let us look at all the terms the following half m1 l1 square theta 1 dot square cos square theta 1 plus half m 1 theta 1 dot square l 1 square sine square theta 1 plus half m 2 l 1 square theta 1 dot square cos square theta 1 plus half m 2 l 2 square theta 2 dot square cos square theta 2 plus so half m2 here you will have multiplied by 2 l1 l2 cos theta 1 cos theta 2 theta 1 dot theta 2 dot right and the last term is so in the last bracket is half m2 l1 square theta 1 dot square sine square theta 1 plus half m2 2 square theta 2 dot square sine square theta 2 plus half m 2 multiplied by 2 l 1 l 2 sine theta 1 sine theta 2 theta 1 dot theta 2 dot now i can sort of uh remove some of the terms as you can see this is a cos square theta 1 and a sine square theta 1 term the coefficients are similar so that i can use the the sine square theta plus cos square theta is equal to one expression i can also apply it here where the cos square theta one coefficients is similar to this particular expression i can also apply it here where the cos square theta two a coefficient is similar to this particular expression so if i do that then the first these two terms is going to give me half m 1 l 1 square theta 1 dot square right and next these two terms are going to give me plus half m 2 l 1 square theta 1 dot square right and then next these two terms are going to give me plus half m 2 l 2 square theta 2 dot square right now the remaining here the 2 gets cancelled all right and i can write this entirely as plus m 2 l 1 l 2 and within brackets cos theta 1 cos theta 2 plus sine theta 1 sine theta 2 outside brackets you have theta 1 dot theta 2 dot here i can further apply the trigonometric expression that cos a cos b plus sine a sine b is nothing but equal to cos a minus b so let's do that to finally obtain the expression for the kinetic energy the first two terms i can combine as half m1 plus m2 1 square theta 1 dot square plus half m 2 l 2 square theta 2 dot square plus m 2 l 1 l 2 theta 1 dot theta 2 dot cos theta 1 minus theta 2 this is finally the expression for the kinetic energy so let's suppose this is point number 6 now at point number 5 i initially obtained the expression for the potential energy so let's write both of them together the potential energy expression and the kinetic energy expression to see how we can obtain the lagrangian so here we have the kinetic energy expression and the potential energy expression for this system of a coplanar double pendulum now to obtain the equation of motion all we need to do is write down the lagrangian and plug it into the euler allegation which we can do how so the lagrangian is quite simple to write down lagrangian here is nothing but the kinetic energy minus the potential energy cos theta 2 so this is the lagrangian of the double pendulum so the lagrangian is a very important quantity when you want to find out that the equation of motion of a system i'm also going to come back to this particular expression in my next video when i'm going to obtain the lagrangian for small oscillations okay now that we have obtained the lagrangian all we need to do is uh plug it into the earlier lagrange equation now if you look at the system here the system has two independent variables one is the theta one and the other is the theta two these are what is known as generalized coordinates therefore since there are two independent variables associated with the two degrees of freedom of the system the lagrangian needs to be plugged in into two separate euler lagrange equation with respect to theta 1 and theta 2 separately so first we're going to apply the euler lagrange equation for theta 1 which has this form d by dt of del l upon del theta 1 dot minus del l upon del theta 1 is equal to 0 these are the quantities that we'll have to obtain from the lagrangian all right so let us do that so what is the first quantity i'm interested in del l upon del theta 1. if you look at the expression of the lagrangian it contains um the generalized coordinates which are theta 1 and theta 2 and it contains the generalized velocities which is theta 1 dot and theta 2 dot now the generalized velocities are independent of the generalized coordinates so keep that in mind while you're performing the partial derivatives so del l upon del theta 1 turns out to be minus m 2 l 1 l 2 theta 1 dot theta 2 dot sine theta 1 minus theta 2 and from the fourth term minus m1 plus m2 gl1 sine theta 1 second expression i'm interested in is del l upon del theta 1 dot which is equal to m 1 from the first term plus m 2 l 1 square theta 1 dot the 2 and a half will cancel out plus m 2 l l1 l2 theta 2 dot cos theta 1 minus theta 2 from here i can obtain the time derivative of del l upon del theta 1 which is nothing but m 1 plus m 2 l 1 square theta 1 double dot and the second term has three variables so i'll have three expressions m 2 l 1 l 2 theta 2 double dot cos theta 1 minus theta 2 1 second is m 2 l 1 l 2 theta 2 dot here i'll end up getting minus sign theta 1 minus theta 2 theta 1 dot minus m 2 l 1 l 2 theta 2 dot sine theta 1 minus theta 2 minus minus plus theta 2 dot so now that i've obtained these expressions i'm going to plug del l upon del theta 1 here and i'm going to plug d by dt of del l upon del theta 1 dot here into the euler lagrange equation to finally write the equation of motion of the system which is nothing but this particular expression so m1 plus m2 l1 square theta 1 double dot plus m 2 l 1 l 2 theta 2 double dot cos theta 1 minus theta 2 minus m 2 l 1 l 2 theta 1 dot theta 2 dot sine theta 1 minus theta 2 plus m 2 l 1 l 2 theta 1 dot theta 2 dot sine theta 1 minus theta 2 minus the first expression so this is nothing but plus m 2 l 1 plus m 2 l 1 l 2 theta 1 dot theta 2 dot sine theta 1 minus theta 2 plus m 1 plus m 2. gl 1 sine theta 1 so this is quite a lengthy expression for an equation of motion but nonetheless this is the equation of motion of the double pendulum one of the equations of motion of the double pendulum okay here i made a small mistake this is supposed to be theta 2 dot and theta 2 dot so in this expression the second last expression here this should be theta 2 dot square okay so now two of the terms will cancel out if you look at the third term m2 l1 l2 theta 1 dot theta 2 dot sine theta 1 minus theta 2 and the fifth term they are exactly equal but opposite in sign so they cancel each other out so let me write down the final expression for the equation of motion one of the equations of motion so finally we have uh one of the two equations of motion of the double pendulum now of course you can simplify this expression by making various assumptions like let's suppose the masses are the same the lengths l1 and l2 are the same and then you can cancel out some of these terms to make it more simple i'm not going to do that but i want to obtain some kind of a solution for any general sort of a system so this is the one of the equations of the [Music] occasions of motion of the double pendulum so i'm going to keep it here and i'm going to move ahead to the next euler lagrange equation okay so now that we have obtained one of the equations and the second job is to find out the next equation and the next equation can be obtained by writing the euler lagrange equation for theta two so this is point number six let's suppose this equation number seven so let us apply the lagrange equation for theta two now so to do that let us first copy the expression for the lagrangian and bring it below for one moment so this is a lagrangian that we had obtained earlier let's copy it and bring it below so that it's on our screen so this is the lagrangian so from here what are we interested in we are interested in obtaining the equation of motion so for that the euler lagrange equation is nothing but d upon a dt of del l upon del theta 2 dot minus del l upon del theta 2 is equal to 0 so here we need to obtain first of all what is del l upon del theta do that we can find out by looking at the expression for the lagrangian so from the third term we find that this is nothing but minus m 2 l 1 l2 theta 1 dot theta 2 dot uh so d by d theta 2 of cos is minus sine theta 1 minus theta 2 so minus minus will become plus here and the next is minus m2 g from the fifth term l2 sine theta next i'm interested in obtaining del l upon del theta 2 dot so this is nothing but from the second term you have m 2 l 2 square theta 2 dot the two and a half cancel out and the next you have minus m 2 l 1 l 2 theta 1 dot cos theta 1 minus theta 2 from the third term this should be a plus term okay now so therefore d by dt of del l upon del theta 2 dot simply comes out to be m 2 l 2 square theta 2 double dot and from here there are three variables so i'll end up getting three terms so this is first of all plus m 2 l 1 l 2 theta 1 double dot cos theta 1 minus theta 2 next i'll have m 2 l 1 l 2 theta 1 dot sine theta 1 minus theta 2 theta 1 dot and next i'll have m 2 l 1 l 2 theta 1 dot sine theta 1 minus theta 2 minus theta 2 dot so this is going to become plus so therefore now i can apply this into the euler lagrange equation to obtain the equation of motion so let us first remove this expression here this expression has served this purpose so let us remove this so i am going to apply this expression here and finally this expression here in the euler lagrange equation to obtain the equation of motion again so let's do that and see how complicated the expression we have again obtained for theta two so even in this expression two of the terms are going to get cancelled out so as you can see here the term that is going to get cancelled out is the fourth term m two l one l two theta one dot theta two dot sine theta one minus two and the fifth term m two l one l two theta theta over sine theta one minus theta two so if i finally write down this expression then it just looks like this so this is the uh final equation of motion the second equation of motion for the system of a double pendulum that we have obtained here of course i have divided the entire expression by m two l two and in that kind of a situation i have obtained this so this is the second equation of motion and this is the first equation of motion both of which contain the solution of the system that we have seen as the double pendulum so as you can see these two equations are uh quite lengthy and uh complicated so equation number seven and let's suppose this is equation number eight are not a very simple straightforward equations they are two second order differential equations uh simultaneous second order uh nonlinear differential equations let me write both of them together so these are the two equations that we have two second order ordinary differential equations that need to be solved simultaneously for us to obtain the solutions the solutions are what the solutions of both these two second order ordinary differential equations will basically give us theta 1 which is the angular displacement of mass m 1 with respect to the vertical axis and theta 2 which is the angular displacement of the mass m 2 with respect to the vertical axis once you obtain theta 1 you can also obtain what is theta 1 dot that is the angular velocity of the mass m 1 at any given point in time and once you obtain theta 2 you can also obtain theta 2 dot which is the angular velocity of the mass m 2 and then you can obtain the momentum about these two masses you can also obtain the energy etc etc but the challenge is to solve these highly complicated looking second order differential equations simultaneously and to do that the best approach is to do it using some kind of numerical methods you if you have studied numerical methods you may have learned if you have some idea about it that there are various methods which can be um applied to solve differential equations that cannot be solved analytically or that are very very difficult to solve analytically so analytically means to solve it using mathematical logic you know using standard expressions for solving differential equations to do it numerically means to apply various numerical methods of trials and errors and certain numerical methods to solve them by plugging in certain kinds of values now you may have heard of various numerical methods like rk method or modified euler method etc etc these are different numerical methods that can be used to solve these kind of second order differential equations simultaneously now if you know some kind of a programming language now let's suppose uh python or c plus plus or something like that you can uh uh solve these differential equations by applying some kind of a numerical method like rk method etc or you can take the help of some kind of a computational software maybe let's suppose mathematica or matlab or scilab i am using scilab and in scilab you can solve first order differential equations so what i'm going to do is i'm going to convert these two second order differential equations into four first order differential equations and then i'm going to solve them using a computation software known as scilab so what i'm going to do is i'm going to assume that there is some kind of a variable y 1 which is nothing but theta 1 and there is another variable y 2 which is nothing but theta 1 dot and there is a variable y 3 which is nothing but theta 2 and there is a variable y 4 which is nothing but theta 2 dot and then i'm going to represent these two second order differential equations into four first order differential equations now i'm not going to go into the details of the scilabic programming scilab programming because then i'll have to explain the programming itself if you know scilab i'll show you the program you may write it down or if you don't know scilab you may employ some other kind of a computation software to solve the same equations and if you do know scilab here are the four first order differential equations that can be converted by using these substitutions so here it is uh if you make these substitutions into of theta 1 theta 1 dot theta 2 and theta 2 dot as y 1 y 2 y 3 y 4 then you can convert these two second order simultaneous differential equations into four first order differential equations i am only writing this here for those of you who know how to solve first order differential equations or simultaneous first order differential equations in scilab otherwise you can ignore this so let us go ahead to my program so here is a program that i have written i have taken the standard values as g is equal to 9.8 the length of both the pendulums are one and one the masses are 500 grams let's suppose i am taking a certain kind of a time period range and as you can see these are the four first order simultaneous differential equations that i'm solving and once i solve i want to look at the displacement i want to look at the velocity i want to look at the trajectory i also want to look at the the least figures the theta one versus theta two graph okay so this is if you are interested in my program in scilab if you do not know scilab you can perform the same thing in any other kind of a computational software so let us run for initial values of let's suppose i give the first mass an initial displacement of 45 degrees and i give the second mass an initial displacement of 0 and let us run this and let us look at the solutions here it is okay so i'm going i'm representing the solutions in four different plots the first plot is the trajectory so the blue line here is the pendulum the mass m one and the red line is the pendulum mass m two now as you can see from the double pendulum the mass m1 is always restricted to some kind of an arc of a circle so it's always going to be an arc of a circle but the mass m2 is going to be it's not restricted to an arc of a circle it can be anything all right so this is just the pendulum here this is the mass m1 and this is the mass m2 the second plot is the angular displacement of mass m1 and the angular displacement of mass m2 with time so the blue line represents the angular displacement of mass m1 as it varies with time and the red line represents the angular displacement of mass m2 as it varies with time now what is the angular displacement the angular displacement is theta 1 right with respect to the vertical axis and theta 2 with respect to the vertical axis and the third plot is theta 1 dot and theta 2 dot that is the angular velocity of mass m 1 and angular velocity of m 2 with respect to time and the fourth plot here simply represents what is theta 1 versus theta 2 okay how theta 1 is there some kind of a correlation between theta 1 and theta 2. now as you can see from the graph i have just taken an angular displacement of 45 degrees initially right and of course the motion is not shm it's not a simple harmonic motion it's not that kind of a period emotion but of course there is some sort of a interesting uh interesting sort of behavior here some patterns that are repeating itself the sharp peaks here in the velocity graph simply represent the velocity suddenly changes all right okay now let us reperform this using a different set of numbers so let's suppose that the initial angle is let's suppose 90 degrees okay the initial angle is 90 degrees and let's suppose this is uh 45 degrees okay for the mass m2 and then let's run this and then we'll see what we get now here we end up getting some sort of a complete motion so as you can see from the first plot the of course the first mass is always restricted to the arc of a circle and the second mass is just going in various different trajectories from the second plot you can see that initially the the the the nature of the trajectories of theta 1 and theta 2 with respect to time had some sort of a oscillatory motion but after some time uh one of the masses the theta 2 rotates so as you can see this line goes below down further down so this simply implies that it rotates once you rotate you go by 2 pi so theta plus 2 pi and then plus 2 pi so there is quite a lot of the nature of motion is quite complicated so is the velocity and and the fourth plot of course is another sort of a demonstration of chaos of the system we can also ah sort of increase the num angle so let's suppose i take 9 i take 120 degrees uh or 120 degrees here and 120 let's suppose again 0 degrees here or 45 degrees here and you can see that the nature of the motion is very unpredictable very chaotic the trajectories are everywhere it's going around everywhere and the theta one and theta twos they are sort of uh going one of them experiences rotation the theta 2 experiences rotation and the velocities are have these sharp sort of variations and the lisa just figure that is c down versus theta 2 also is extremely extremely chaotic in nature so as you can see the even though the nature of the motion is very very a chaotic we can still solve it because it's a deterministic system we can still solve it applying the laws of classical mechanics applying the lagrangian approach we can still predict what is going to happen uh to theta one and theta two at any given point in time uh just by uh writing the entire system in terms of its lagrangian and from there obtaining the equation of motion and it is quite interesting to see even though it's a very complicated motion it is still solvable now coming to the chaos of double pendulum so the double pendulum is a chaotic system in the sense that it is very very sensitive to initial conditions so whenever the initial displacement of the double pendulum is slightly different it leads to vastly different trajectories for the entire system in very short intervals of time so here i have the same program but i'm going to run it for three different scenarios so here i have the theta of mass m1 which is let's suppose 90 degrees and theta of mass m2 and i'm running for three different situations where let's suppose once the initial displacement of mass m2 is let's suppose 91 degrees the initial displacement of mass m2 in the second case is 92 degrees and the initial displacement of mass m3 is 93 degrees if i run this situation i can look at the solutions evolving with time for all the three scenarios so here these lines represent the angular displacement of the second mass mass m2 remember so what does this mean i see of course these vas variations has to do with the fact that the mass m2 undergoes rotations but what i want to bring to your notice is that initially when i was looking at the double pendulum system i only gave a very small difference of one degrees to each of these three systems remember now the y axis here is in terms of radians okay it's not in terms of degrees but they were very close to each other and of course for a very short interval of time the nature of the trajectory was very much similar but at certain point it starts diverging from one another and then you end up getting a very hugely different trajectory for all these three different systems so even though these three different systems started from the same initial displacement albeit a little different from one another but in a very short interval of time they underwent a very completely uh different trajectories so as you can see from the simulation here so all these three pendulums start with initial displacement very very similar to one another but because of this my new difference they end up undergoing vastly different trajectories now this is known as a chaotic system you see you must have heard of the butterfly effect that how the fluttering of a butterfly in one place can lead to tornadoes in some other region uh so this signifies how systems are very very sensitive to very small differences of initial displacement the double pendulum is a very good example of that and i i can show it for even smaller uh displacement so for example if instead of having difference of one degrees in the initial conditions if i make it very very minute so let's suppose i make it this is 90.001 and this is i make it 90.002 and i make this 90.003 so the three pendulum have the second mass has initial displacement which are different from different by 0.001 degrees such a minute difference but even if i run this the trajectories over a period of time are come on come on uh you see this hugely different like it's extremely varied initially here as you can see they are near about superimposing the graphs are very much similar at this particular point but a point comes where because of that minute difference in the initial displacement these lines these solutions start diverging and this difference suddenly becomes huge this difference manifests itself in completely different trajectories for the three systems which were but different about different with respect to each other in very minor initial displacements so that is all in today's video what we have done let me do a recap we looked at the system of a double pendulum we wrote down the coordinates in terms of x 1 x 2 y and y 2 and the transformations in terms of theta 1 and theta 2 then we represented the potential and the kinetic energy expressions in terms of theta 1 and theta 2 then we wrote down the lagrangian we applied the lagrangian in the euler lagrange equation 4 with respect to theta 1 and with respect to theta 2 and we obtained two equations of motion two second order simultaneous differential equations of motion which when you solve via some kind of a numerical method you can find the trajectories associated with it and i also showed the chaos inherent in double pendulum that if you change the initial conditions of two or three double pendulums by a very very tiny amount their final tragedies are going to be fastly different from one another so that is all in the next video i am going to solve the same system but by assuming small angle approximation so what happens if instead of taking these large angles like 45 degrees 90 degrees etcetera i take very small angles theta 1 2 do we can we make some sense out of those systems so when we take small angle approximations we can look at the normal modes and normal frequencies which is a little bit of an interesting behavior which i'm going to do in the next video so that is all for today thank you very much [Music] you