Pendulum With Springs' Large Oscillations: Joshua Olowoyeye 2115521164
Pendulum With Springs' Large Oscillations: Joshua Olowoyeye 2115521164
Pendulum With Springs' Large Oscillations: Joshua Olowoyeye 2115521164
oscillations
Joshua Olowoyeye
2115521164
4/3/2023
—
PHYS 2010 Classical Mechanics
—
Prof. Christopher Bergevin
Homework question
Summary
I solved this using MATLAB. For this process I set up the system with
parameters for the mass of the stating positions and innate
characteristics of the pendulum and the springs (mass, spring
constant, length etc.) I make heavy use of trigonometric identities to
determine the deformation and angles of the springs. With that I
create a for loop that iterates every hundredth of a second to
determine the forces working on the rod by the deformed springs and
gravity. From there I use the minute changes in angular acceleration
and angular velocity to determine the minute change of position.
Finally, I graph the angular position and angular acceleration of the
pendulum and deformation of each spring.
The initial angle of the pendulum should be within the hypotenuse
angle (the angle between the spring base and the pendulum base with
respect to gravity), because the code malfunctions when the initial
angle is substantially above it.
Code
% System parameters
g = 9.81; % acceleration due to gravity (m/s^2)
dt = 0.01; % time step (s)
t = 0:dt:10; % time vector
% Preallocate arrays
theta = zeros(size(t)); % angle of the pendulum (radians)
thetaS1i = zeros(size(t)); % angle of the spring 1 (radians)
thetaS2i = zeros(size(t)); % angle of the spring 2 (radians)
omega = zeros(size(t)); % angular velocity of the pendulum (rad/s)
alpha = zeros(size(t)); % angular velocity of the pendulum (rad/s)
x1 = zeros(size(t)); % displacement of the spring 1 vertically (m)
x2 = zeros(size(t)); % displacement of the spring 2 vertically (m)
end
subplot(4,1,2)
plot(t,alpha)
xlabel('Time (s)')
ylabel('Angular acceleration (radians/sec^2)')
title('Angular acceleration of the pendulum over time')
subplot(4,1,3)
plot(t,x1)
xlabel('Time (s)')
ylabel('Displacement x1 (m)')
title('Displacement of the spring 1 over time')
subplot(4,1,4)
plot(t,x2)
xlabel('Time (s)')
Results