In: Mechanical Engineering
PART 1
The company would like to investigate how the actual performance of the suspension system compares to that of theory. Dynamic theory states that the equation of motion of the wheel in the vertical direction can be expressed as,
m d 2 y d t 2 = − c d y d t − k y or d 2 y d t 2 + c m d y d t + k m y = 0
where m is the mass of the wheel, k is the spring stiffness and c is the damping coefficient.
This is a second order differential equation, and if for example, the car hits a hole at t = 0, such that it is displaced from its equilibrium position with y = y0, and dy/dt = 0, it will have a solution of the form,
y ( t ) = e − n t ( y 0 cos ( p t ) + y 0 ( n p ) sin ( p t ) )
where p = k m − c 2 4 m 2 and n = c 2 m provided k m > c 2 4 m 2
To analyse the actual performance of the design, the suspension system was built and tested with the following displacements of the wheel recorded during the time period of 2.6 and 3.1 seconds (this dataset is known to contain experimental error):
Time (s) |
2.6 |
2.65 |
2.7 |
2.75 |
2.8 |
2.85 |
2.9 |
2.95 |
3 |
3.05 |
3.1 |
Displacement (m) |
0.07 | 0.09 | 0.11 | 0.11 | 0.12 | 0.15 | 0.14 | 0.15 | 0.16 | 0.15 | 0.16 |
The design team are interested if the dataset can be characterised by expressions which are less complex than that of the above theory.
PART 2
The design team performed stress analysis on the coil spring, and it was determined that the stress at a specific point could be characterised by:
Similar calculations were performed to calculate the maximum principal stress at 420 locations along a non-linear path through the coil spring. The following frequency distribution of the calculated maximum principal stresses was produced:
Max. Principal Stress (kPa) |
4 | 4.5 | 5 | 5.5 | 6 | 6.5 | 7 | 7.5 | 8 | 8.5 |
Frequency |
2 | 12 | 18 | 30 | 50 | 69 | 80 | 71 | 59 | 29 |
The design team is interested in the significance of these frequencies and therefore need to calculate the area under the graph which displays these results.
The design team believe any further calculations of principal stresses and determining the area under the graph will be time consuming (and potentially error prone), thus would like an automated method for performing this.
Submission
Create two separate MATLAB scripts for Part 1 and Part 2:
PART 1 - Create a MATLAB script which is capable of performing the following:
PART 2 – Create a MATLAB script that is capable for performing the following:
*********Theroritical Ploting and Roots******
m = 3.6*10^3; c = 1.5*10^3; k = 1.5*10^4; y0 = 0.3;
p = sqrt((k/m)-(c^2/(4*m^2)));
n = c/(2*m);
y = @(t) exp(-n*t).*(y0*cos(p*t) + y0*(n/p)*sin(p*t));
t = linspace(0,15);
plot(t,y(t)) % ploting theritical displacement
yline(0); % Ploting zero line to identify root locations
xlabel("Time [s]"); ylabel("Displacement [m]"); title("Theoritical Plot")
% Form figure it's evident that first 3 roots are near 0.5, 2 and 4
% To calculate exact values we will use fzero function
root1 = fzero(y,0.5); % 1st root using initial guess of 0.5
root2 = fzero(y,2); % 2nd root using initial guess of 2
root3 = fzero(y,4); % 3rd root using initial guess of 4
fprintf("\n First 3 roots : [%.4f %.4f %.4f] sec",[root1,root2,root3])
********Experimental Calculations*********
warning off
Time = [2.6 2.65 2.7 2.75 2.8 2.85];
Disp = [0.07 0.09 0.11 0.12 0.13 0.15];
figure(2)
plot(Time,Disp,'*-')
[lin_Fit,gof_LinFit] = fit(Time',Disp','poly1'); % Linear Fit
% defininig fit type for saturation growth
myfittype = fittype('a*x/(b+x)','coefficients',{'a','b'});
[sat_growth_fit,gof_SatFit] = fit(Time',Disp',myfittype);
hold on
time_plot = linspace(2.6,3.1);
plot(time_plot,lin_Fit(time_plot),'LineWidth',1.2); % Ploting Linear Fit
plot(time_plot,sat_growth_fit(time_plot),'LineWidth',1.2); % ploting saturation growth fit
xlabel("Time"); ylabel("Displacement");
legend(["Experimental Data","Linear Fit","Saturation Growth fit"],'Location','NorthWest')
title("Experimental Plot");
% R2 and standard error for both
R2_LinFit = gof_LinFit.rsquare; % Extracting Rsquare from goodness of fit (gof)
Std_err_LinFit = gof_LinFit.rmse; % Extracting Standard error from gof
R2_SatFit = gof_SatFit.rsquare;
Std_err_SatFit = gof_SatFit.rmse;
fprintf("\n\n For Linear Fit : R2 = %.4f , Standard Error = %.4f", R2_LinFit,Std_err_LinFit);
fprintf("\n For Saturation Growth Fit : R2 = %.4f , Standard Error = %.4f\n", R2_SatFit,Std_err_SatFit);
warning on
Output -
The first 3 roots are
0.824
2.371
....... (Data is missing )
For linear fit -
R2= 0.917
Standard error = 0.008
For saturation growth fit -
R2= 0.430
Standard error = 0.023
Theroritical plot-
Experimental plot -
Dear student please rate me postive :)
Please update the question as i found that their are some values are missing while solving soo please update the question i will update the question after you will give me the next values after 2.85/0.15 time displacement table ....
Please upvote for me