Question
Please do this in MATLAB only, some code are provided but I am not sure if this is related. Sample codes (for part (a)): %%
Please do this in MATLAB only, some code are provided but I am not sure if this is related.
Sample codes (for part (a)):
%% Script file project1.m %% Definition of system parameters: global m c k global x0 v0 m = 1e3; k = 81e3; % c x0 = 1; v0 = 0;
%% Part (a) % Plot the time response and total mechanical energy of the SDOF system % for the different cases of damping being considered. % Note: Project asks for only the cases of c = [3 18 25]*1e3 % c = 3e3 N.s/m % under-damped case (zeta = 0.167) % c = 18e3 N.s/m % critically damped case (zeta = 1) % c = 25e3 N.s/m % overdamped case (zeta = 1.389) c_values = [3 18 25]*1e3;
% Plot of the time response figure for j = 1:length(c_values) c = c_values(j); % plot the free response normalized with respect to x0 fplot(@(t) frsp_sdof(t)/x0, [0,2]), hold on end hold off
% Set plot parameters % set(gca,'FontSize',12) ax = gca; ax.YLim = [-0.8,1]; ax.XTick = (0:0.2:2); ax.YTick = (-0.8:0.2:1); ax.FontSize = 11; ax.LineWidth = 1; grid, xlabel('t [sec]'), ylabel('x/x_0 (normalized response)') title({'Time history of the free response of a suspension system', ... 'modeled by a single-degree-of-freedom system'}) LEG = legend('c = 3e3 N-s/m','c = 18e3 N-s/m','c = 25e3 N-s/m'); set(LEG, 'FontSize', 12)
% Plot of the mechanical energy versus time figure E0 = 0.5*k*x0^2 + 0.5*m*v0^2; % calculate the initial mechanical energy in [J] for j = 1:length(c_values) c = c_values(j); vel = derivative(@(t) frsp_sdof(t)); % define the velocity function % Define the energy function (E), which is the sum of the potential % and kinectic energies. Normalize E w.r.t. the initial energy E0. E=@(t) (0.5*k*frsp_sdof(t).^2 + 0.5*m*vel(t).^2)/E0; fplot(E, [0,2]), hold on end hold off
% Set plot parameters ax = gca; ax.YLim = [0,1]; ax.XTick = (0:0.2:2); ax.YTick = (0:0.1:1); ax.FontSize = 11; ax.LineWidth = 1; grid, xlabel('t [sec]'), ylabel('E/E_0 (normalized energy)') title({'Time history of the total mechanical energy', ... 'of a suspension system modeled by a SDOF system'}) LEG = legend('c = 3e3 N-s/m','c = 18e3 N-s/m','c = 25e3 N-s/m'); set(LEG, 'FontSize', 12)
%% Part (b)
function x = frsp_sdof(t) % Free response function of a SDOF system global m c k global x0 v0
wn = sqrt(k/m); % natural frequency ("omega_n") zeta = c/2/sqrt(k*m); % damping ratio wd = wn*sqrt(1-zeta^2); % damped natural frequency ("omega_d")
if zeta == 1; x = x0*exp(-wn*t) + (v0+wn*x0)*t.*exp(-wn*t); % critically damped case else x = exp(-zeta*wn*t).*(x0*cos(wd*t)+(v0+zeta*wn*x0)/wd*sin(wd*t)); end
function df = derivative(f) sym_f = sym(f); df = matlabFunction(simplify(diff(sym_f))); % simplify command is optional end
Alternate codes (for part (a)) not using global command when invoking the built-in function "plot":
%% Script file project1.m %% Definition of system parameters: global m k global x0 v0 m = 1e3; k = 81e3; % c x0 = 1; v0 = 0; % initial velocity in [m/s]
%% Part (a) % Plot the time response and total mechanical energy of the SDOF system % for the different cases of damping being considered. % Note: Project asks for only the cases of c = [3 18 25]*1e3 % c = 3e3 N.s/m % under-damped case (zeta = 0.167) % c = 18e3 N.s/m % critically damped case (zeta = 1) % c = 25e3 N.s/m % overdamped case (zeta = 1.389) c_values = [3 18 25]*1e3;
% Plot of the time response figure hold for j = 1:length(c_values) c = c_values(j); % plot the free response normalized with respect to x0 fplot(@(t) frsp_sdof(t,c)/x0, [0,2]), end hold off
% Set plot parameters % set(gca,'FontSize',12) ax = gca; ax.YLim = [-0.8,1]; ax.XTick = (0:0.2:2); ax.YTick = (-0.8:0.2:1); ax.FontSize = 11; ax.LineWidth = 1; grid, xlabel('t [sec]'), ylabel('x/x_0 (normalized response)') title({'Time history of the free response of a suspension system', ... 'modeled by a single-degree-of-freedom system'}) LEG = legend('c = 3e3 N-s/m','c = 18e3 N-s/m','c = 25e3 N-s/m'); set(LEG, 'FontSize', 12)
% Plot of the mechanical energy versus time figure E0 = 0.5*k*x0^2 + 0.5*m*v0^2; % calculate the initial mechanical energy in [J] for j = 1:length(c_values) c = c_values(j); vel = derivative(@(t) frsp_sdof(t,c)); % define the velocity function % Define the energy function (E), which is the sum of the potential % and kinectic energies. Normalize E w.r.t. the initial energy E0. E=@(t) (0.5*k*frsp_sdof(t,c).^2 + 0.5*m*vel(t).^2)/E0; fplot(E, [0,2]), hold on end hold off
% Set plot parameters ax = gca; ax.YLim = [0,1]; ax.XTick = (0:0.2:2); ax.YTick = (0:0.1:1); ax.FontSize = 11; ax.LineWidth = 1; grid, xlabel('t [sec]'), ylabel('E/E_0 (normalized energy)') title({'Time history of the total mechanical energy', ... 'of a suspension system modeled by a SDOF system'}) LEG = legend('c = 3e3 N-s/m','c = 18e3 N-s/m','c = 25e3 N-s/m'); set(LEG, 'FontSize', 12)
%% Part (b)
function x = frsp_sdof(t,c) % Free response function of a SDOF system global m k x0 v0
wn = sqrt(k/m); % natural frequency ("omega_n") zeta = c/2/sqrt(k*m); % damping ratio wd = wn*sqrt(1-zeta^2); % damped natural frequency ("omega_d")
if zeta == 1; x = x0*exp(-wn*t) + (v0+wn*x0)*t.*exp(-wn*t); % critically damped case else x = exp(-zeta*wn*t).*(x0*cos(wd*t)+(v0+zeta*wn*x0)/wd*sin(wd*t)); end
3. Design Problem (open-ended problem): The design objective may be to determine the values of the spring constant and/or damping coefficient in order for the response (displacement) or total energy to dissipate to a certain level of its initial value the fastest (within a constraint). How quickly should the response or energy be dissipated in order to achieve optimal designs for passenger comfort? Assume motion starts from rest, vo0. Unless otherwise stated, the nominal values of the mass and the spring stiffness used in all numerical simulations are: m- 1,000 kg, k - 81,000 N/m. System response and energy: (ME 4410 Lab #1 pre-lab) Consider a disturbance Xo applied to the system initially at rest. Plot the response (normalized to xo) of the system for three values of the damping coefficient, c - 3,000,18,000, and 25,000 N- s/m on a single graph. a) Properly label your graph with axis labels, title, legend, etc. Obtain a similar plot for the mechanical energy (normalized to the initial energy). What can you learn from the plots? Note that the mechanical energy of the system is: E - potential energy stored in the spring kinetic energy of the mass b) Understanding the dissipation time characteristics: Report from the literature on what you understand about the factors that are important to vehicle suspension design for passenger comfort. Provide examples of under-damped and over-damped systems in daily life. Define: i) tr as the time instant when the response of the mass is first dissipated to a specified level of the initial displacement (for this project, it is set at 5%) specified level of the initial energy (for this project, it is set at 5%) You may obtain result by using the built-in function fminsearch (see homework) ii) te as the time instant when the total mechanical energy of the system is dissipated to a iii) xm as the minimum of the normalized response (the most negative value in Figure 2) Note that the displacement could reach 5% of the initial value at more than one instant (see Fig. 2). Obtain graphs of tr, te, and x as functions of c from 2,000 to 30,000 N-s/m. What can you conclude from the results of parts (a) and (b) regarding designs of suspension systems to minimize the vibration or maximize the rate of energy dissipation? What kind of design strategies should be employed?The graphical results in parts (a) and (b)will provide important guidelines for search of optimal solutions using root finding methods. c) Design optimization: From part (b), you should notice that, for the fixed value of k, there is a minimum value of te for the range of c values. You can then determine the specific value of c that corresponds to this minimum using the MATLAB function min (we have used max before). Now consider a different value of k, the value of c that corresponds to a minimum of te would be different. In this way, with the mass m fixed at 1,000 kg, we can determine and plot the pairs of values of (c, k) that would give minimum te. Compare this curve to the curve of critical damping values in the damping-stiffness design space (this forms the basis of a two-parameter design optimization problem). What can you conclude from your results? d) Design: With the mass fixed at 1,000 kg, determine the combination of ranges of values of k and c such that l&m 0.3. Recall that&m is normalized with respect to Xo. Note that the suspension system must be underdamped for this design problem to be meaningful The above (a) to (d) have guided you to understand a typical design problem. Thus, your report should NOT appear as answering questions, but rather a complete report describing how you approach/solve this design problem with the aid of MATLAB and the numerical methods that have learned. Be creative! In this design problem, describe your results and observations with the aid of plots and tables, as needed. Obtain some of your results by at least one bracketing method and one iteration method of your choice (for example, choose from the bisection method, false position method, fixed- point iteration method, Newton-Raphson method, and secant method, etc.). Compare results from these methods in terms of accuracy, convergence and efficiency. Note that you only need to write a structured code to call the respective MATLAB function codes which are already available, Check your root-finding results with the built-in function fzero. 3. Design Problem (open-ended problem): The design objective may be to determine the values of the spring constant and/or damping coefficient in order for the response (displacement) or total energy to dissipate to a certain level of its initial value the fastest (within a constraint). How quickly should the response or energy be dissipated in order to achieve optimal designs for passenger comfort? Assume motion starts from rest, vo0. Unless otherwise stated, the nominal values of the mass and the spring stiffness used in all numerical simulations are: m- 1,000 kg, k - 81,000 N/m. System response and energy: (ME 4410 Lab #1 pre-lab) Consider a disturbance Xo applied to the system initially at rest. Plot the response (normalized to xo) of the system for three values of the damping coefficient, c - 3,000,18,000, and 25,000 N- s/m on a single graph. a) Properly label your graph with axis labels, title, legend, etc. Obtain a similar plot for the mechanical energy (normalized to the initial energy). What can you learn from the plots? Note that the mechanical energy of the system is: E - potential energy stored in the spring kinetic energy of the mass b) Understanding the dissipation time characteristics: Report from the literature on what you understand about the factors that are important to vehicle suspension design for passenger comfort. Provide examples of under-damped and over-damped systems in daily life. Define: i) tr as the time instant when the response of the mass is first dissipated to a specified level of the initial displacement (for this project, it is set at 5%) specified level of the initial energy (for this project, it is set at 5%) You may obtain result by using the built-in function fminsearch (see homework) ii) te as the time instant when the total mechanical energy of the system is dissipated to a iii) xm as the minimum of the normalized response (the most negative value in Figure 2) Note that the displacement could reach 5% of the initial value at more than one instant (see Fig. 2). Obtain graphs of tr, te, and x as functions of c from 2,000 to 30,000 N-s/m. What can you conclude from the results of parts (a) and (b) regarding designs of suspension systems to minimize the vibration or maximize the rate of energy dissipation? What kind of design strategies should be employed?The graphical results in parts (a) and (b)will provide important guidelines for search of optimal solutions using root finding methods. c) Design optimization: From part (b), you should notice that, for the fixed value of k, there is a minimum value of te for the range of c values. You can then determine the specific value of c that corresponds to this minimum using the MATLAB function min (we have used max before). Now consider a different value of k, the value of c that corresponds to a minimum of te would be different. In this way, with the mass m fixed at 1,000 kg, we can determine and plot the pairs of values of (c, k) that would give minimum te. Compare this curve to the curve of critical damping values in the damping-stiffness design space (this forms the basis of a two-parameter design optimization problem). What can you conclude from your results? d) Design: With the mass fixed at 1,000 kg, determine the combination of ranges of values of k and c such that l&m 0.3. Recall that&m is normalized with respect to Xo. Note that the suspension system must be underdamped for this design problem to be meaningful The above (a) to (d) have guided you to understand a typical design problem. Thus, your report should NOT appear as answering questions, but rather a complete report describing how you approach/solve this design problem with the aid of MATLAB and the numerical methods that have learned. Be creative! In this design problem, describe your results and observations with the aid of plots and tables, as needed. Obtain some of your results by at least one bracketing method and one iteration method of your choice (for example, choose from the bisection method, false position method, fixed- point iteration method, Newton-Raphson method, and secant method, etc.). Compare results from these methods in terms of accuracy, convergence and efficiency. Note that you only need to write a structured code to call the respective MATLAB function codes which are already available, Check your root-finding results with the built-in function fzeroStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started