All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM: To solve an Ordinary Differential Equation which represents the Equation of Motion of a Simple Pendulum with damping and to simulate the motion of the Pendulum using MATLAB. INITIAL INPUTS: Damping…
Vyshakh Raju
updated on 16 Feb 2020
AIM:
To solve an Ordinary Differential Equation which represents the Equation of Motion of a Simple Pendulum with damping and to simulate the motion of the Pendulum using MATLAB.
INITIAL INPUTS:
Damping Coefficient, b = 0.05
Mass, m = 1kg
Length of pendulum, L = 1m
Acceleration of gravity, g = 9.81 m/s^2
CODE:
Code consists of 2 parts
1) Main Program
% Solving and Simulating an ODE representing motion of a PENDULUM
clear all
close all
clc
%Fixing the inputs
b= 0.05;
L=1;
g=9.81;
m=1;
%initial conditions (angular displacement and angular velocity)
theta_O = [0;3];
%Defining the Time interval
time = linspace(0,20,500);
%Calling the function to get the results
[t,result] = ode45(@(t,theta) ode_function(t,theta,b,g,L,m),time,theta_O);
%f variable used to store the frame at each value of theta
f=1;
%Using for loop to obtain each position of the Pendulum.
for i = 1:length(result)
%Defining the co-ordinates to obtain plot of the Pendulum
x0=0;
y0=0;
x1=(L)*sin(result(i,1));
y1=(-L*cos(result(i,1)));
%Plotting out position of pendulum with change in velocity, displacement and time
plot([x0 x1],[y0 y1],'linewidth',2)
hold on
%Using marker to produce bob of the Pendulum
plot(x1,y1,'o','Markersize',15,'MarkerFaceColor',[1 0.5 0])
hold on
plot([-1 1],[0 0],[-1 1],[0.08,0.08],'color','k','linewidth',3)
hold on
%PLotting the rest position using dashed line
plot([0 0],[0 -1],'color','k','linestyle','- -')
hold off
%Naming the plot using text command
c = {'ODE - SIMULATION','SIMPLE PENDULUM'};
text(-1.75,0.75,c)
%Fixing the plot Axes
axis([-2 2 -2 1])
pause(0.5)
%Defining the variable to store the each frame.
A(f) = getframe(gcf);
f=f+1;
end
%Creating the animation using each frame
movie(A)
Animation=VideoWriter('Pendulum.avi','Uncompressed AVI');
open(Animation)
writeVideo(Animation,A)
close(Animation)
2) Function defining the ODE
function [dtheta_dt] = ode_function(t,theta,b,g,L,m)
theta1 = theta(1)
theta2 = theta(2)
dtheta1_dt = theta2;
dtheta2_dt = (-(b/m)*theta2)-((g/L)*sin(theta1));
dtheta_dt = [dtheta1_dt;dtheta2_dt];
end
RESULT:
The Second Order Differential Equation for motion of Simple Pendulum with damping
was solved and the Simulation depicting the motion of the Pendulum was made using MATLAB. For Simulation video,Please follow the link :
https://youtu.be/KADSku-7jtU
CONCLUSION:
From the motion of Simple pendulum with damping, it can be observed that the energy of the Pendulum dissipates continuously. This may be accounted because of the drag force due to the air resistance on the bob of the Pendulum and the damping produced by the Damper . Normally the air resistance on the string of the Pendulum is assumed to be negligibly small. Hence the pendulum motion can be assumed to be a series of damped oscillation, an oscillation that fades away with time.
The level of dampness of the system have a direct impact on the motion of pendulum. For a high level of damping, the pendulum comes to state of rest at very faster time interval when compared to low level of damping.
Refer the following plots which describes the nature of motion and time taken for the Pendulum to reach state of rest that changes with the level of damping.
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.
Other comments...
Radar Mast & Final Assembly of Yacht
Modelling a Yacht with Solidworks OBJECTIVE: To model different parts of a Yacht To assemble each parts of yacht to create the full model INTRODUCTION: This project is focused in partwise modelling of the Yacht and then assembly of the parts together inorder to obtain the full Yacht model DESIGN METHODOLOGY:…
14 Jun 2021 10:52 AM IST
Photo Realistic Rendering
MODELLING OF AN RT66 AMERICAN CHOPPER OBJECTIVE: To model each parts of an RT66 Chopper Assemble the each parts of Chopper to obtain full Scale model of RT66 Chopper Render the Chopper model to a realistic View INTRODUCTION: This projuct is focused on modelling of an American Chopper model part wise,…
07 Jun 2021 04:07 PM IST
Advanced Sheet Metal Design Using NX Cad Challenge_7_ Metal bracket-II
DESIGNING A METAL BRACKET WITH NX SHEET METAL APPLICATION OBJECTIVE: To create a Metal bracket with respect to the given 2-D Drawing with NX sheet Metal Application. INTRODUCTION: This work focuses on designing a Metal Bracket with NX Sheet metal Application with respect to a given 2-D Drawing for dimensions.…
30 May 2021 01:35 PM IST
Advanced Sheet Metal Design Using NX Cad Challenge_6_Bracket
BRACKET DESIGN USING NX SHEET METAL APPLICATION OBJECTIVE: To design a Bracket with the specified dimensions and contour using NX CAD Sheet Metal Application. INTRODUCTION: This work is focused to design and create a Bracket as per specified dimensions and contour in the 2-D drawing. DESIGN METHODOLOGY: PROCEDURE:…
30 May 2021 06:34 AM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.