vibrations assignment
vibrations assignment
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
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
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:
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.
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:
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:
MATLAB CODE:
% Load experimental displacement and time data load("disp.mat", "disp");
load("time.mat", "time");
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;
GRAPH: