Menu

Executive Programs

Workshops

Projects

Blogs

Careers

Placements

Student Reviews


For Business


More

Academic Training

Informative Articles

Find Jobs

We are Hiring!


All Courses

Choose a category

Loading...

All Courses

All Courses

logo

Loading...
Executive Programs
Workshops
For Business

Success Stories

Placements

Student Reviews

More

Projects

Blogs

Academic Training

Find Jobs

Informative Articles

We're Hiring!

phone+91 9342691281Log in
  1. Home/
  2. Ramkumar Venkatachalam/
  3. SIMULATING THE MOTION OF SIMPLE PENDULUM BY SOLVING ORDINARY DIFFERENTIAL EQUATION

SIMULATING THE MOTION OF SIMPLE PENDULUM BY SOLVING ORDINARY DIFFERENTIAL EQUATION

DETAILED REPORT ON SIMPLE PENDULUM AIM To write a program for solving the ODE representing the motion of a simple pendulum with damping and simulate the motion between 0 to 20 seconds EQUATIONS/ FORMULAEUSED Simple Pendulum – It is usually a bob of mass m suspended from a hinge (fixed point) in a way that it oscillates…

    • Ramkumar Venkatachalam

      updated on 29 Jan 2022

    DETAILED REPORT ON SIMPLE PENDULUM

    1. AIM

    To write a program for solving the ODE representing the motion of a simple pendulum with damping and simulate the motion between 0 to 20 seconds

    1. EQUATIONS/ FORMULAEUSED

    Simple Pendulum – It is usually a bob of mass m suspended from a hinge (fixed point) in a way that it oscillates (to and fro motion) when displaced from its original rest position (equilibrium point). These oscillations gradually die down over a period of time.

    The way the pendulum moves depends on the Newton’s second law. When this law is written down, we get a second order Ordinary Differential Equation that describes the position of the "ball" w.r.t time. 

    ODE representing simple pendulum,

    Simple pendulum

    Given Inputs,

    Length of the pendulum, L=1 m,

    Mass of the bob, m=1 kg,

    Damping Coefficient, b=0.05.

    Gravity, g=9.81 m/s2.

         3. OBJECTIVES & PROCEDURE

    1. The main objective of the challenge is to solve the 2nd order ODE representing motion of a simple pendulum and create an animation of a pendulum between 0 to 20 seconds for angular displacement equal to 0 and angular velocity equal to 3 rad/sec2 at time t=0.
    2. In the process, firstly the 2nd order ODE is spilt into two 1st order ODE so that it can be solved using the ODE 45 solver.
    3. The angular displacement and angular velocity equation is defined in the function program and called using the main program.
    4. The value of angular displacement (theta) is calculated at each point of time by using ‘for’ loops. Markers are used to plot hinge (fixed support) and Bob.
    5. For creating animation of oscillating pendulum, each of the plots obtained at every point of time is stitched together.
    6. Both animation & graph is plotted using the values obtained from angular displacement and velocity in .gif and .jpeg format respectively. 

        4. PROGRAM

    Programming language used – Octave 5.1.1

    Program

    ---------------------------------------------------------------------------------------
    MAIN PROGRAM
    ---------------------------------------------------------------------------------------
    % Solving Simple Pendulum motion 
    
    % time
    t = [0 20];
    
    % Initial Conditions (angular displacement, angular velocity)
    theta0 = [0 3];
    
    [t, y] = ode45(‘pendulum_function’,t,theta0);
    
    Angular_Displacement = y(:,1);
    
    for i = 1:length(Angular_Displacement)
    
    T = Angular_Displacement(i);
    
    x0 = 0;
    y0 = 0;
    
    L = 1;
    
    x1 = L*sin(T);
    y1 = -L*cos(T);
    
    figure(1)
    plot(x0,y0,’square’,’markers’,20,’markerfacecolor’,’b’)
    hold on 
    plot ([x0 x1],[y0 y1],’linewidth’,7)
    hold on
    plot(x1,y1,’o’,’markers’,30,’markerfacecolor’,’r’)
    hold off
    
    axis([-1 1 -1 0]);
    
    %Simulate the pendulum motion by stiching ech plot together
    printf(‘Creating GIF- Progress... %d/%dn’, i, length(Angular_Displacement));
    
    img = print (‘-RGBImage’);
    
    imwrite(img, ‘animation.gif’, ‘DelayTime’, .005, ‘Compression’, ‘bzip’, ‘WriteMode’, ‘Append’);
    
    end
    
    -------------------------------------------------------------------------------------
    FUNCTION PROGRAM
    function [ydot] = pendulum_function(t,y)
    
      % Gravity (m/s2)
      g = 9.81;
    
      % Length of the pendulum (m)
      L = 1;
    
      % Mass of the ball (kg)
      m = 1;
    
      % Damping Coefficient
      b = 0.05;
    
    ydot = zeros(2,1);
    
      % Rate of change of angular displacement = Angular Velocity
    ydot(1) = y(2);
    
      % Angular Acceleration = ((-b/m)theta(2))-((g/L)sin(theta1))
    ydot(2) = ((-b/m)*y(2))-((g/L)*sin(y(1)));
    
    
    end
    ---------------------------------------------------------------------------------------

       5. RESULTS

    Graph

    Pendulum motion

    Youtube Link: https://youtu.be/Rxs1syz3n_I

       6. CONCLUSION

    The above graph shows the angular displacement and angular velocity versus time of a simple pendulum. Also the same values are used to animate the pendulum motion.

    The program can be used to solve the ODE representing the transient behavior to simulate the system.

    Leave a comment

    Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.

    Please  login to add a comment

    Other comments...

    No comments yet!
    Be the first to add a comment

    Read more Projects by Ramkumar Venkatachalam (29)

    Week 3 Challenge : CFD meshing on Turbocharger

    Objective:

                                                                                                                      VOLUME MESHING ON A TURBOCHARGER USING ANSA                                                                                                                                          (WEEK-3 CHALLENGE) AIM Our…

    calendar

    24 Jul 2022 06:35 PM IST

    • ANSA
    • CAE
    • CFD
    Read more

    Week 2 Challenge : Surface meshing on a Pressure valve

    Objective:

                                                                                               …

    calendar

    10 Jul 2022 04:29 AM IST

    • ANSA
    • CAE
    • CFD
    Read more

    Week 9: Project 1 - Surface preparation and Boundary Flagging (PFI)

    Objective:

         SURFACE PREPARATION AND BOUNDARY FLAGGING OF IC ENGINE MODEL AND SETTING NO HYDRO SIMULATION USING CONVERGE CFD                                                      …

    calendar

    18 Jun 2022 05:56 PM IST

    • CFD
    Read more

    Week 8: Literature review - RANS derivation and analysis

    Objective:

                                                                    LITERATURE REVIEW – REYNOLDS AVERAGED NAVIER STOKES DERIVATION AND ANALYSIS    …

    calendar

    12 Jun 2022 04:58 PM IST

      Read more

      Schedule a counselling session

      Please enter your name
      Please enter a valid email
      Please enter a valid number

      Related Courses

      coursecardcoursetype

      Accelerated Career Program in Embedded Systems (On-Campus) - Powered by NASSCOM

      Recently launched

      0 Hours of Content

      coursecard

      5G Protocol and Testing

      Recently launched

      4 Hours of Content

      coursecard

      Automotive Cybersecurity

      Recently launched

      9 Hours of Content

      coursecardcoursetype

      Pre-Graduate Program in Bioengineering and Medical Devices

      Recently launched

      90 Hours of Content

      coursecardcoursetype

      Pre-Graduate Program in 5G Design and Development

      Recently launched

      49 Hours of Content

      Schedule a counselling session

      Please enter your name
      Please enter a valid email
      Please enter a valid number

                  Do You Want To Showcase Your Technical Skills?
                  Sign-Up for our projects.