Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

ME 4112 Engineering Mechanics 2

MATLAB® Exercise 3

Prepared by:

Coding and Report writing: Brendan Gleeson 20261128

School of Engineering

University of Limerick

Date: 25/11/2021

“I declare that this is the joint work of the students named above and that all contributions from
other persons have been appropriately identified and acknowledged.

i
1. Introduction

Problem Description
In the mechanism shown in Figure 1, vertical oscillation of the spring-loaded plunger, F,
is controlled by the vertical motion of the hydraulic cylinder, E, located at position B on
arm AD. The mechanism is designed such that arm AD oscillates periodically between
position ± about the vertical.
The displacement of the plunger (h) is zero at t = 0 when  = π/2   and at t = T when
 = π/2   The maximum displacement of the plunger occurs when arm AD is vertical
at t = T/2,  = π/2.

(Figure 1)
The objective of this assignment is to investigate and assess the movement of the
plunger and arm in Figure 1 over a period T using MATLAB. The displacement, velocity
and acceleration of the plunger are to be plotted as a function of time along with the
angular velocity of the arm AB.

2. Results
Figure 2 shows an example of the command window after the MATLAB code that can be
found in the appendix is run. Using the input values described in the Sulis assignment,
(Length of arm AD: Last three digits of your ID number, Initial angle of arm: First two
digits of your ID number, Time period of plunger: Last digit of your ID number), the
following results were discovered.

(Figure 2)
2
Input Values (Table 1)
Description MATLAB Variable Value Units
Length of arm AB lAB 128 mm
Initial angle of arm AB betao 20 degrees
Time period of plunger T 8 s

Output Values (Table 2)


Description MATLAB Variable Value Units
Max plunger sMax 7.7 mm
displacement
Max plunger acceleration aMax 0.002 m/s/s

(Figure 3)

(Figure 4)

3
(Figure 5)

(Figure 6)

3. Summary
It can be seen from the results that MATLAB has been used to accurately solve the
problem given in the introduction, while also precisely graphing all required data. From
the parameters used, MATLAB presented the two required outputs, the max plunger
acceleration, which was found to be 0.002m/s/s and the max plunger displacement
which turned out to be 7.7mm.

4. References
1. MATLAB version 9.8.0.1451342 (R2020a). Natick, Massachusetts: The
MathWorks Inc., 2020.
2. Meriam, J.L., Kraige, L.G. and Bolton, J.N., “Engineering Mechanics-Dynamics“, SI
Version, 9th Edition, Wiley, ISBN :978-1-119-66528-1, 2020.

4
3. O’Dowd, N.P., “Engineering Mechanics 2, ME4112, Dynamics of Particles and
Rigid Bodies“, University of Limerick, Module notes, 2020.

5. Appendix
Equations used:
𝜃(𝑡) = 𝜋 2 + 𝛽0 sin (( 2𝑡 − 𝑇 2𝑇 ) 𝜋)
ℎ(𝑡) = 𝑙(sin(𝜃(𝑡)) − cos 𝛽0)
ℎ𝑚𝑎𝑥 = 𝑙(1 − cos𝛽0 )
𝑣(𝑡) = 𝜔(𝑡)𝑙 cos(𝜃(𝑡))
𝑎(𝑡) = (𝛼(𝑡) cos(𝜃(𝑡)) − 𝜔(𝑡) 2 sin(𝜃(𝑡)))𝑙

% Author:
% Brendan Gleeson 20261128
% November 2021
% MATLAB® Exercise 4: Design of a Spring Loaded Plunger
% This problem is very loosely based on Example 5.7 in [1] and Exercise
% 5/113 from [2].
clear

lAB=input('AB arm length in millimetres:' );


betao=input('Initial beta angle in degrees:' );
betaorads=betao*(pi/180);
T=input('Time period of plunger in seconds:' );

timeArray= 0:T/100:T;
theta = (pi/2) + betaorads*sin((2*timeArray -T)*pi/(2*T));
w=(pi*betaorads/T)*cos((2*timeArray-T)*pi/(2*T));
a=-((pi*pi)/(T*T))*betaorads*sin((2*timeArray-T)*pi/(2*T));

s=lAB*(sin(theta) -cos(betaorads));
sMax=lAB*(1-cos(betaorads));
vPlun=(w*lAB.*cos(theta))/1000;
aPlun=(lAB*((a.*cos(theta)) -(w.*w).*sin(theta)))/1000;
aMax=max(aPlun);

fprintf(' Maximum displacent of plunger is %3.1f mm \n', sMax)


fprintf(' Maximum acceleration of plunger is %4.3f m/s/s \n', aMax)

figure(1)
plot(timeArray,w)
xlabel('Time (s)')
ylabel('Angular Velocity (rad/s)')

figure(2)

5
plot(timeArray,s)
xlabel('Time (s)')
ylabel('Displacement (mm)')

figure(3)
plot(timeArray,vPlun)
xlabel('Time (s)')
ylabel('Plunger Velocity (m/s)')

figure(4)
plot(timeArray,aPlun)
xlabel('Time (s)')
ylabel('Plunger Acceleration (m/s/s)')

You might also like