0% found this document useful (0 votes)
7 views

vibrations assignment

vibrations assignment

Uploaded by

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

vibrations assignment

vibrations assignment

Uploaded by

robin.frost.ah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

VIBRATIONS ASS

HUZAIFA REHMAN (ME1793)

MAHMOOD AHMAD BANI (ME1808)


ME SVII SECTION B2
QUESTION 1

kg, k = 26519.2 N/m, c = 1000.0 N-s/m, 𝑥𝑜 = 0.539657, 𝑥𝑜 = 1.0 Plot the time variation of
A spring-mass damping system has the following properties and initial conditions: m= 450.0

the mass displacement, velocity, and acceleration using MATLAB.

SOLUTION:
System Parameters:
Mass: m=450kg
Stiffness: k=26519.2 N/m
Damping coefficient: c=1000 N-s/m
Initial displacement: xo = 0.539657m
Initial velocity: vo= 1.0 m/s

Natural Frequency, Damping Ratio, and Damped Frequency:


Natural Frequency ( ): This is the frequency at which the system oscillates without damping.
It is calculated as: Wn=
√ √
m
k
=
26519.2
450
Damping Ratio ( ): The damping ratio determines how oscillations decay over time. It is the
c
ratio of the damping coefficient to the critical damping coefficient: ζ =
2 √ km
Damped Natural Frequency ( ): In a damped system, the oscillation frequency is reduced. It
is given by: Wd=Wn √ 1−ζ 2

MATLAB CODE:
mass=450;
springconstant=26519.2;
dampingconstant=1000;
displacement=0.539657;
velocity=1;
Wn=sqrt(springconstant/mass);
Cc=2*sqrt(springconstant*mass);
zeta=dampingconstant/Cc;
Wd=Wn*sqrt(1-(zeta^2));
A=displacement;
B=(velocity+(displacement*zeta*Wn))/Wd;
X=sqrt((A^2)+(B^2));
phi=atan(B/A);
t=0:(2*pi)/(Wd*100):(20*pi)/Wd;
x=X*(exp(-1*zeta*Wn*t)).*cos((Wd*t)-phi);
v=gradient(x, t);
a=gradient(v, t);

figure;
subplot(3,1,1);
plot(t, x, "Color","b");
xlabel('time (s)')
ylabel('Displacement (m)')
subplot(3,1,2);
plot(t, v, "Color", "r");
xlabel('time (s)')
ylabel('Velocity (m/s)')
subplot(3,1,3);
plot(t, a, "Color", "g");
xlabel('time (s)')

ylabel('Acceleration (m/s^2)')
GRAPH:
QUESTION 2:

1) 𝑥𝑜 = 10 mm, 100 mm; 𝑥𝑜 = 0.0, 𝑤𝑛 = 10 rad/s


Plot the response of the critically damped system for the following data using MATLAB:

2) 𝑥𝑜 = 0; 𝑥𝑜 = 10 mm/s, 100 mm/s, 𝑤𝑛 = 10 rad/s

SOLUTION:
Case 1: Different Initial Displacements (No Initial Velocity):
The system starts with different initial displacements (xo=10 mm , 100 mm) while the initial
velocity is zero (v o=0 mm /s) .
Case 2: Different Initial Velocities (No Initial Displacement):
In this case, the initial displacement is zero (x o=0 mm) but the system has different initial
velocities (v o=10 mm /s , 100 mm /s). The equation for displacement remains the same, but
the initial conditions affect the system's return to equilibrium differently

MATLAB CODE:
Wn = 10;
velocity = 0;
displacement = 10;
% Define t vector outside the loop
t = zeros(1,101);
for i = 1:101
t(i) = 2*(i-1)/100;
end
% Calculation for x1
for i = 1:101
x1(i) = (displacement + ( velocity + Wn*displacement) *t(i) )*exp(-Wn*t(i));
end
%% Calculation for x3
displacement = 100;
for i = 1:101
x3(i) = (displacement +( velocity + Wn*displacement)*t(i) )*exp(-Wn*t(i));
end
%% Calculation for x4
displacement = 0;
velocity = 10;
for i = 1:101
x4(i) = (displacement +(velocity + Wn*displacement)*t(i) )*exp(-Wn*t(i));
end
%% Calculation for x6
velocity = 100;
for i = 1:101
x6(i) =(displacement+(velocity +Wn*displacement)*t(i))*exp(-Wn*t(i));
end
%% Plotting the results
subplot(231);
plot(t,x1);
title('dislpacement=10 velocity=0');
xlabel('t');
ylabel('x(t)');
subplot(233);
plot(t,x3);
title('dislpacement=100 velocity=0');
xlabel('t');
ylabel('x(t)');
subplot(234);
plot(t,x4);
title('dislpacement=0 velocity=10');
xlabel('t');
ylabel('x(t)');
subplot(236);
plot(t,x6);
title('dislpacement=0 velocity=100');
xlabel('t');
ylabel('x(t)');
GRAPH:
QUESTION 3
This question is provided to perform a modal analysis of exhaust valve of a refrigerator
compressor.
The valve can be modeled as a flexible structure. The experimental setup is shown below.

Figure 1: Illustration of the Experimental Setup

In the free vibration, the displacement vs. time should look like the following figure. As
it i s seen, the amplitude is decaying with time due to damping in the structure.
Figure 2: Typical Variation of Displacement with time in a Damped System

The students are asked to write a MATLAB Code to process the displacement file for
determining:
1) Period of vibration.
2) Damped natural frequency.
3) Natural frequency.
4) Damping ratio of the structure.
5) Response of the system using the above parameters.
6) Error between the theoretical response and experimental response.

SOLUTION:
Logarithmic Decrement and Damping Ratio:

Logarithmic Decrement ( ): This describes how much the oscillations decay


1
( x 1 ) where x1 and xi+1 are the amplitude
between peaks and is given by: δ= j ln xi+1

of first and j+1th peaks.


Damping Ratio ( ): Using the logarithmic decrement, the damping ratio is calculated as:

Natural Frequency:

The damped natural frequency is determined from the time between peaks,
and the undamped natural frequency is computed based on the damping

ratio:
Theoretical Response:
A theoretical model of the system’s displacement over time is created using the
following equation:

where is a constant based on initial conditions, and X is the amplitude


envelope.

MATLAB CODE:
% Load experimental displacement and time data load("disp.mat", "disp");
load("time.mat", "time");

% Plot the experimental displacement vs time figure;


plot(time, disp, '-b');
xlabel('Time (s)'); ylabel('Displacement (m)');
title('Experimental Displacement vs Time'); grid on;

% Create a data table for displacement and time


data = table(disp, time, 'VariableNames', ["Displacement", "Time"]); head(data)

% Finding local maxima with MinSeparation = 50 minSeparation = 50;


maxIndices = islocalmax(data, "MinSeparation", minSeparation, ... "DataVariables",
"Displacement", "OutputFormat", "tabular");

% Plot maxima points figure;


plot(data.Displacement, 'DisplayName', 'Displacement'); hold on;
scatter(find(maxIndices.Displacement), data.Displacement(maxIndices.Displacement), ... '^',
'filled', 'DisplayName', 'Local Maxima');
title("Number of Extrema: " + nnz(maxIndices.Displacement)); legend;
xlabel('Time Index'); ylabel('Displacement'); grid on;
hold off;

% Extract peak values and times


peaks = data.Displacement(maxIndices.Displacement); locs =
data.Time(maxIndices.Displacement);

% Calculate periods and damped natural frequency periods = diff(locs);


damped_period = mean(periods) damped_natural_frequency = (2 * pi) / damped_period

% Logarithmic decrement and damping ratio calculation j = 22;


delta = (1/j) * log(peaks(1) / peaks(j+1)) zeta = delta / sqrt((2 * pi)^2 + delta^2)

% Natural frequency calculation


natural_frequency = damped_natural_frequency / sqrt(1 - zeta^2)

%% Velocity calculation dt = diff(data.Time);


dx = diff(data.Displacement); velocity = dx ./ dt;

% Plot the displacement and velocity figure;


subplot(2, 1, 1);
plot(data.Time, data.Displacement, '-k') xlabel('Time');
ylabel('Displacement'); title('Displacement vs. Time');
subplot(2, 1, 2);
plot(data.Time(1:end-1), velocity, '-') xlabel('Time');
ylabel('Velocity'); title('Velocity vs. Time');
% Theoretical Response Calculation x0 = data.Displacement(1)
xdot0 = velocity(1) t = data.Time;
wn = natural_frequency;
C2 = (xdot0 + zeta * wn * x0) / (sqrt(1 - zeta^2) * wn) X = sqrt((x0^2) + (C2^2))

x_t = exp(-zeta * wn .* t) .* (x0 * cos(sqrt(1 - zeta^2) * wn .* t) + ...


C2 * sin(sqrt(1 - zeta^2) * wn .* t)); envelope_fn = X * exp(-zeta * wn .* t);

% Plot experimental vs theoretical response figure;


plot(t, data.Displacement, '-b', 'DisplayName', 'Experimental Data'); hold on;
plot(t, x_t, '-r', 'DisplayName', 'Theoretical Response'); hold on;
plot(t, envelope_fn, '--k', 'DisplayName', 'Logarithmic Envelope'); xlabel('Time (s)');
ylabel('Displacement (m)');

legend;
title('Experimental vs Theoretical Response'); grid on;
% Error Calculation (MAE and RMSE)
absolute_error = abs(data.Displacement - x_t); % Absolute error MAE =
mean(absolute_error) % Mean absolute error
squared_error = (data.Displacement - x_t).^2; % Squared error RMSE =
sqrt(mean(squared_error)) % Root mean squared error
% Plot Normalized error
normalized_error = absolute_error ./ abs(data.Displacement); % Relative error figure;
plot(data.Time, normalized_error, 'm-', 'DisplayName', 'Normalized Error') xlabel('Time (s)');
ylabel('Relative Error'); title('Normalized Error Over Time');
legend;

figure;
% Subplot 1: Theoretical vs Experimental Data subplot(3,1,1);
plot(data.Time, data.Displacement, 'b-', 'DisplayName', 'Experimental Data') hold on;
plot(t, x_t, 'r-', 'DisplayName', 'Theoretical Response'); xlabel('Time (s)');
ylabel('Displacement (m)'); title('Experimental vs Theoretical Response');
legend;

% Subplot 2: Absolute Error subplot(3,1,2);


absolute_error = abs(data.Displacement - x_t);
plot(data.Time, absolute_error, 'k-', 'DisplayName', 'Absolute Error') xlabel('Time (s)');
ylabel('Absolute Error (m)'); title('Absolute Error Over Time'); legend;

% Subplot 3: Squared Error subplot(3,1,3);


squared_error = (data.Displacement - x_t).^2;
plot(data.Time, squared_error, 'g-', 'DisplayName', 'Squared Error') xlabel('Time (s)');
ylabel('Squared Error'); title('Squared Error Over Time');
legend;

GRAPH:

You might also like