0% found this document useful (0 votes)
112 views7 pages

Plane Rigid Pendulum

Plane Rigid Pendulum

Uploaded by

Aman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views7 pages

Plane Rigid Pendulum

Plane Rigid Pendulum

Uploaded by

Aman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Plane Rigid Pendulum

Exercise 1: Euler-Cromer Model of the Rigid Pendulum


Build a computational model of a plane undamped, unforced rigid pendulum using the Euler-Cromer method.
Assume your pendulum consists of a rigid metallic rod, one meter in length, with a mass of 1kg. Also assume that
one end of the rod is fixed to an immovable support, and that the rod is free to rotate without bound in a plane.
For initial conditions, assume the rod is displaced at some angle, greater than 90∘, relative to its vertical minimum
potential energy configuration, and released from rest. This physical situation has no exact analytical solution
with which you will be able to compare the results of your computational model, so you must carefully determine
a value of Δt that produces an accurate approximation without the benefit of making a comparison. Describe in
detail the procedure you used in arriving at an acceptably small value of Δt, show plots of the angular displacement
and angular velocity as functions of time, and comment on the pendulum’s dynamic behavior. Is the behavior of
your computational model what you expect for a real pendulum?

Answer:
Let us consider a pendulum consisting of a uniform thin rod of length l and mass m rotating about a fixed pivot
located at one of its end. The rod is attached to a uniform disc of mass m’ and radius r centered on the pivot and
damped by a resistant torque TR. A point–like mass M is fixed on the rod at the distance L from the pivot. With
a properly working model, and no exact solution with which to compare, should look for some kind of
convergence behavior in the computational solution as Δt is systematically made smaller. Figure demonstrates
this convergence behavior.

MATLAB CODE:
clear all;clc,close all;
length= 1;
gravity=9.8;
mass=1;
time_steps=90;
step_size=0.01;
av(1:time_steps)=0;
Theta(1:time_steps)=0;
t(1:time_steps)=0;
Theta(1)=0.5; % Initial position
for i=1:time_steps-1
av(i+1)=av(i)-(gravity/length)*Theta(i)*step_size; Theta(i+1)=Theta(i)+av(i+1)*step_size;
X(i)=length*sin(Theta(i)); Y(i)=-length*cos(Theta(i)); t(i+1)=t(i)+step_size;
end
X(time_steps)=length*sin(Theta(time_steps));Y(time_steps)=-length*cos(Theta(time_steps));
kinetic_energy=0.5*mass*(length^2)*(av.^2);
kinetic_energy=kinetic_energy/max(kinetic_energy); % (V)
V=(mass*gravity*Y)+gravity;
V=V/max(V);
E=kinetic_energy+V; % total normalized energy (E)
for i=1:time_steps
figure(1)
subplot(121)
plot(X(i),Y(i),'.','markersize',65);
axis([-0.5 0.5 -1.05 0]);
line([0 X(i)], [0 Y(i)],'Linewidth',2);
xlabel('X ');
ylabel('Y');
title(['pendulum motion at t =',num2str(i*step_size), 'seconds'] ,'fontsize',14);
h=gca;
get(h,'FontSize') ;
set(h,'FontSize',14);
fh = figure(1);
set(fh, 'color', 'white');
subplot(122)
plot(t(i),kinetic_energy(i),'.','markersize',15)
hold on
plot(t(i),V(i),'.','markersize',15,'MarkerEdgeColor','r')
hold on
plot(t(i),kinetic_energy(i)+V(i),'.','markersize',15,'MarkerEdgeColor','k')
line([2.3 2.7], [0.6 0.6],'color','r','Linewidth',2)
text(2.4,0.63,'V','fontSize',12)
line([2.3 2.7], [0.5 0.5],'color','b','Linewidth',2)
text(2.4,0.53,'T','fontSize',12)
line([2.3 2.7], [0.4 0.4],'color','k','Linewidth',2)
text(2.4,0.43,'E','fontSize',12)
title('Euler-Cromer Model of the Rigid Pendulum' ,'fontsize',14);
xlabel('time ','fontsize',14);
ylabel('energy','fontsize',14);
axis([ 0 3 0 1.1])
h=gca;
get(h,'FontSize') ;
set(h,'FontSize',14);
fh = figure(1);
set(fh, 'color', 'white');
Yr=getframe;
end
OUTPUT:
Exercise 2: Comparison with Analytical Small Angle Approximation Solution
Once you have determined a value of Δt that produces an acceptably accurate computational solution, compare
the computational results (angular displacement as a function of time) with the analytically determined function
for the angular displacement

or the rigid pendulum, resulting from the small angle approximation. Comment in detail on your observations.

Answer:
The small-angle approximation is a useful simplification of the basic trigonometric functions which is
approximately true in the limit where the angle approaches zero. or small angle \sin \theta =\theta and hence
acceleration become directly proportional to angular displacement which is the required condition for simple
harmonic motion and once it started SHM then we can calculate its frequency and time period by comparing it
with standard equation of SHM.

MATLAB CODE:
clear all;clc,close all;
Dt=0.0001; T = 10;
N=T/Dt; t(1)=0.0;
theta(1)=0;
v(1)=2.00; a(1)=0;
for n=1:N
theta(n+1)=theta(n)+v(n)*Dt;
a(n)=-9.8*sin(theta(n));
v(n+1)=v(n)+a(n)*Dt;
t(n+1)=t(n)+Dt;
end
xlabel('t','fontsize', 14, 'fontweight', 'b')
ylabel('Angular displacement','fontsize', 14, 'fontweight', 'b')
title(' Comparison with Analytical Small Angle Approximation Solution', 'fontsize', 14, 'fontweight', 'b')
hold on
plot(t,theta)
OUTPUT:
Exercise 3: Phase Space
A very useful plot for analyzing periodic systems is known as a phase space plot, and is simply a graph of velocity
vs. position. The resulting curve is known as a phase space trajectory. In the case of the plane rigid pendulum, the
phase space trajectory is found by graphing angular velocity vs. angular displacement. Produce a phase space plot
for the plane pendulum using the parameters and initial conditions you used (including an accurate value for Δt
!) in Exercise 1. Comment in detail on the resulting phase space trajectory.

Answer:
Figure shows a phase space plot (angular velocity vs. angular displacement) for initial angular displacements. For
the undamped, unforced SHO, the phase space trajectory is a well-defined closed path. It should also be
emphasized that there is a direction of circulation around the closed orbit, the direction of which depends on the
initial conditions.

MATLAB CODE:
clear all;clc,close all;
l= 1;
g=9.8;
m=1;
time_steps=90;
step_size=0.01;
av(1:time_steps)=0;
t(1:time_steps)=0;
x = 0:pi/10:6*pi;
y1 = g*sin(x*m);
y2 = g*cos(x*l);
plot(y1, y2)
hold on
theta = 4;
plot(y2(1:end - theta), y2(1 + theta:end))
xlabel('Angular Displacement'), ylabel('Angular Velocity')
title('Phase Space');

OUTPUT:
Exercise 4: Damped Rigid Pendulum
Now, add a damping term to your pendulum model. Explore, and produce graphs of (time dependent behavior as
well as phase space), the behavior of the model by systematically varying the damping strength b. Use the same
values for the physical parameters and initial conditions as before. Describe the effect of increasing the damping
strength, while keeping the other parameters the same. Can you damp the pendulum to such an extent that it
doesn’t actually oscillate?

Answer:
As expected, the oscillations become damped, and the corresponding phase space trajectory spirals in towards
zero as the energy approaches complete dissipation. For a value of roughly b, there are no longer oscillatory
solutions.

MATLAB CODE:
clear all;clc,close all;
l= 1;
g=9.8;
b=1;
n = 250;
dt = 0.04;
o = zeros(n,1);
theta = zeros(n,1);
t = zeros(n,1);
theta(1)=0.2;
for step = 1:n-1
o(step+1) = o(step) - (g/l)*theta(step)*dt-b*o(step)*dt;
theta(step+1) = theta(step)+o(step+1)*dt;
t(step+1) = t(step) + dt;
end;
plot(t,theta,'r' );
xlabel('time (seconds) ');
ylabel('theta (radians)');
title('Damped Rigid Pendulum');
OUTPUT:
Exercise 5: Damped, Driven Rigid Pendulum
Next add a driving torque to your pendulum model. Once you’re sure that your model is accurately computing
the damped, driven pendulum’s dynamics, systemically explore the behavior of the model by varying the driving
torque amplitude τd . Use the same physical parameters and initial conditions as before, including values of b =
0.2 and ω = 3 rad/s for the damping strength and angular frequency of the driving torque, respectively. Then, vary
the magnitude of the driving torque amplitude from 2 Nm to 10 Nm, in 1 Nm increments, producing time-
dependent and phase space plots for each value of τd. For the time-dependent graphs of angular displacement and
angular velocity, only a few periods (perhaps 5-6) are necessary to plot, but for the phase space trajectories it will
be most interesting if you take the computations out to a few hundred thousand time steps or more. Of particular
interest will be the phase space trajectories. The rigid pendulum is a type of nonlinear system, and therefore the
dynamics actually become chaotic for certain physical parameters and initial conditions. To best observe the
chaotic behavior, restrict the values of the angular displacement to the range - π to +π , by including two if-then
constructions at the very end of the loop in which you implement the Euler-Cromer algorithm. If the angular
displacement θ becomes less than -π then its value is increased by 2π . If θ becomes greater than π then its value
is decreased 2π. Since θ is an angular variable, values that differ by 2π correspond to the same physical position
of the pendulum. This restriction is not necessary, but will be convenient for your analysis. Describe in detail the
dynamical behavior of your model as you vary the driving torque. Can you identify the behavior that corresponds
to chaotic?

Answer:
For the lowest value of the driving torque, after the transient response, the system settles into predictable
oscillatory behavior, and a well-defined elliptical orbit in phase space. But, with higher driving torques, the system
shows an apparently unpredictable non-repeating oscillatory behavior, with the corresponding phase space
characterized by many orbits that can appear, as the case of τd=5 Nm, to be completely random. This behavior is
chaotic.

MATLAB CODE:
clear all;clc,close all;
l= 9.8;
g=9.8;
q=0.5;
b=0.2;
Omeg=3;
Dt=0.0001;
T = 10;
N=T/Dt;
t(1)=0.0;
v(1)=2.00;
npoints =15000;
dt = 0.04;
omga = zeros(npoints,1);
thta = zeros(npoints,1);
t = zeros(npoints,1);
thta(1)=0.2;
omga(1)=0;
for step = 1:npoints-1;
omga(step+1)=omga(step)+(-(g/l)*sin(thta(step))-q*omga(step)+b*sin(Omeg*t(step)))*dt;
t_thta_stp_pls_1 = thta(step)+omga(step+1)*dt;
if (t_thta_stp_pls_1 < -pi)
t_thta_stp_pls_1= t_thta_stp_pls_1+2*pi;
elseif (t_thta_stp_pls_1 > pi)
t_thta_stp_pls_1= t_thta_stp_pls_1-2*pi;
end;
thta(step+1)=t_thta_stp_pls_1;
t(step+1) = t(step) + dt;
end;
plot (thta,omga,'r' );
xlabel('theta (radians)');
ylabel('omega (seconds)');
figure(2)
for n=1:N
thta(n+1)=thta(n)+v(n)*Dt;
a(n)=-9.8*sin(thta(n));
v(n+1)=v(n)+a(n)*Dt;
t(n+1)=t(n)+Dt;
end
plot(t,thta)
xlabel('t','fontsize', 14, 'fontweight', 'b')
ylabel('Angular displacement','fontsize', 14, 'fontweight', 'b')

OUTPUT:

You might also like