You are on page 1of 39

Introduction:

The double pendulum is a classic example of a chaotic system that has fascinated scientists and
engineers for centuries. The motion of a double pendulum is highly sensitive to initial
conditions and can produce unpredictable and complex patterns. The study of double
pendulum motion has applications in a wide range of fields, from robotics and aerospace
engineering to physics and education. In recent years, advances in computational tools have
made it possible to simulate and analyze double pendulum motion with increasing accuracy and
detail. One such tool is MATLAB, a programming environment widely used in engineering,
science, and mathematics. In this context, researchers and students can create MATLAB apps to
explore the behavior of double pendulum motion and gain insights into complex systems. In
this article, we will analyze double pendulum motion using MATLAB, including improving
control systems, understanding complex systems, education and outreach, and artistic
applications.
Name of the Project:
Chaotic System Analysis Through Double Pendulum
Description of the Project:
A double pendulum exhibits rich dynamic behavior with a strong sensitivity to initial conditions.
A system of double pendulum is shown below:

User may set the initial conditions of two bobs (l1,l2,m1,m2,ϴ1,ϴ2 and their initial angular
velocity) according to his preference and see the change in whole motion of the double
pendulum.(upon not choosing default values will be taken)
Objectives:
A user will be able to see output of:
1) X2(t) vs y2(t)
2) Position vs time graph for each of masses
3) See the plot over an integrated time and observe the component’s motion and the
chaotic orbit
4) Energy of the whole system and each component.
All of the plots have to be implemented in GUI.
App Installation Procedure

• At first open the Matlab

• Click apps

• Click ‘Design App’.

• Select the “Double_pendulum_simulator” file

• Click ‘Run’

Overview of the App:


Introduction Tab:
Opening the app, user will see the introduction tab like following:

By clicking on ‘Let’s Start!’ button he will proceed to the Home Tab.


Home Tab:
In Home tab, user will input the initial variables and conditions of the double pendulum.
For this purpose, he can input the masses, length of the strings, initial angular positions, initial
angular velocities, gravitational acceleration and the time period for which he wants to see the
motion analysis. Here user is asked to remind the proper unit of the variables and input them
accordingly. Upon not giving an input, default inputs will be taken for analysis

By clicking on the ‘Strat Analysis’ button he will proceed to the ‘Analysis’ Tab.
Analysis Tab:
In Analysis Tab, user will be able to see the animated plots of the double pendulum motion.

In this tab, by clicking on ‘Show Position’ Button he will be able to see animated plot of position
of the pendulum.
By clicking on ‘Show Angular Velocity’ Button he will be able to see animated plot of angular
velocity of the masses.
By clicking on ‘Show Energy’ Button he will be able to see animated plot of energy of the
masses.
For going to ‘Home’ tab user can use ‘Back’ button at the left bottom corner and for proceeding
to the ‘Analysis2’ Tab he will click on ’Next Tab’ on the right bottom corner.
Analysis2 Tab:
In Analysis2 Tab, user will be able to see more the animated plots of the double pendulum
motion.

By clicking on ‘Show Angular Position’ Button he will be able to see animated plot of angular
position of the masses.
By clicking on ‘Show Complete Trajectory’ Button he will be able to see animated plot of
complete trajectory of the masses.
For going to ‘Analysis’ tab user can use ‘Back’ button at the left bottom corner and for
proceeding to the ‘Compare’ Tab he will click on ’Next Tab’ on the right bottom corner.
Compare Tab:
In this tab, user will give input for comparing two double pendulum system’s motion.
User can duplicate the current system into ‘System-1’ he inputted in the Home Tab by clicking
on the ‘Duplicate Current System in System 1’ button. He can also input his desired initial
conditions according to his preference for the system1 .

For system 2 he can give input according to his preference or he can use the default values for
the system2 just to compare his current double pendulum system with a default one.

For going to Analysis2 tab user can use ‘Back’ button at the left of the left bottom corner and
for proceeding to the ‘Comparison Analysis’ Tab he will click on ’Compare’ button at the right of
the left bottom corner.
Comparison Analysis Tab:
In this tab, user will be able to see animated graphs of the two systems and will be able to
compare between them side by side.

In this tab, by clicking on ‘Compare Position’ Button he will be able to see animated plot of
position of the pendulum for two systems.
By clicking on ‘Compare Angular Velocity’ Button he will be able to see animated plot of angular
velocity of the masses for two systems.
For going to ‘Compare’ tab user can use ‘Back’ button at the left bottom corner and for
proceeding to the ‘Comparison Analysis2’ Tab he will click on ’Next Tab’ on the right bottom
corner.
Comparison Analysis2 Tab:
In this tab, user will be able to see more animated graphs of the two systems and will be able to
compare between them side by side.

In this tab, by clicking on ‘Compare Angular position’ Button he will be able to see animated
plot of position of the pendulum for two systems.
By clicking on ‘Compare Energy’ Button he will be able to see animated plot of energy of the
masses for two systems.
For going to ‘Comparison Analysis’ tab user can use ‘Back’ button at the left bottom corner and
for proceeding to the ‘Comparison Analysis3’ Tab he will click on ’Next Tab’ on the right bottom
corner.
Comparison Analysis3 Tab:
In this tab, user will be able to see complete trajectory graphs of the two systems and will be
able to compare between them side by side.

By clicking on ‘Compare Trajectory’ Button he will be able to see animated plot of trajectory of
the masses for two systems.
For going to ‘Comparison Analysis2’ tab user can use ‘Back’ button at the left bottom corner.

So, this is the full overview of the app.


Solving Strategy and Explanation:
As discussed in the theory section we will get the initial conditions and applying Langrage’s we
are able to find the differential equations of the double pendulum motion.
We have two second order differential equations and four initial conditions. We can reduce the
two second order differential equations into four one order differential equations. It was done
by the function named ‘odefunction’.

all the four equations, initial conditions and timespan was passed into ‘ODE45’ function. The
results were stored into ‘results’ array which has four columns and in those we have angular
position of mass1 , angular position of mass2 , angular velocity of mass1 , angular velocity of
mass1 respectively for different time points.
As we have got the results we can now simply deduce the position of each mass and their
velocity and energy for a time period.

Now we can easily plot the animated graphs using Matlab. Here codes are provided for each
graphs for appdesigner.
Codes For plotting Y-Position Vs X-Position:

Codes For plotting Angular Velocity Vs Time:

Codes For plotting Energy Vs Time:


Codes For plotting Energy Vs Time:

Codes For Complete Trajectory:


Analysis With Default Values:
Input:

As we want to see plots for default input so we simply click ‘Start Analysis’ from Home
Tab.
Graphs From Analysis Tab:

After clicking the buttons here are the animated plots. Red ball is the first mass and
green one is the second mass.
In the graph Y-position vs X-position the red dot and green dot alone are the initial
position of the masses and the dots connected with white string are the final position.
The dotted lines represent the trajectory.
Graphs From Analysis2 Tab:
Let we want to compare the default system1 with the default system 2. So we will
duplicate the current system into system 1 by clicking the ‘Duplicate Current System in
System1’ button. Then we press compare and from ‘Compare Tab’ we will see different
comparison graphs.
After clicking the buttons here are the animated plots. Red ball is the first mass and
green one is the second mass.
In the graph Y-position vs X-position the red dot and green dot alone are the initial
position of the masses and the dots connected with white string are the final position.
The dotted lines represent the trajectory.
clicking next and clicking compare buttons for respective variable will generate the
following graphs:
We can see that there was only one change between two system. Initial angular position
of system 1 was 2.2 (rad) and for system 2 initial angular position was 2 (rad). From
comparison graphs we can how slightest change in the initial conditions have varied the
output of two system. So it is an important demonstration of chaos theory or “The
Butterfly Effect”
Some Random Test Cases:
Test Case 01:
Double pendulum Input and Output:
Comparison Input and Output:
Test Case 2:
Double Pendulum Input And output:
Comparison Input and output:
Test Case 3:
Double Pendulum Input and Output:
Comparison Input and Output:
Test Case 4:
Double pendulum Input and Output:
Comparison Input and Output:
So, we have done some test cases. User is asked to find output according to his reference.

Conclusion:
There are many potential future prospects for analyzing the motion of a double pendulum such as
improving control systems, understanding complex systems, education and outreach, artistic
applications. Double pendulum motion can be difficult to control due to its chaotic nature. By analyzing
the motion of a double pendulum, researchers can gain insights into how to better control complex
systems. This could have applications in fields such as robotics and aerospace engineering. Double
pendulum motion is a classic example of a chaotic system, which means it is highly sensitive to initial
conditions and can produce unpredictable results. By studying the motion of a double pendulum,
researchers can gain a deeper understanding of how complex systems behave and how they can be
modeled. Simulations of double pendulum motion can be used to teach physics concepts to students of
all ages. This MATLAB app could be used in classrooms to help students understand the principles of
motion and how they can be applied to real-world systems. The motion of a double pendulum can
produce beautiful and intricate patterns, which could be used for artistic purposes. This MATLAB app
could be used to generate animations or visualizations of double pendulum motion that could be used in
art installations or other creative projects.

Overall, there are many potential future prospects for analyzing the motion of a double pendulum.
Whether we're interested in engineering, physics, education, or the arts, this MATLAB app could be a
valuable tool for exploring this fascinating system.

You might also like