6. (22 Points) Consider the two-mass oscillator excited by the specified displac
ID: 1867434 • Letter: 6
Question
6. (22 Points) Consider the two-mass oscillator excited by the specified displaceren??The spring between masses m and ma is known asa "hardening" spring. The force F, of the hardening spring on mnss mi is As where k2 is the linear spring coefficient, ind i: is the hardening coefficient. such, the model for the two-mass system is You have been required to simulate this system, and plot the displacement ?? and z2 of the masses for a given input. The simulation will occur over a time range of 0srs10 see in 1000 increments. Aftet the simulation, it is desired to plot n() and 200 versus timc. As a first step in the simulation, you have made the state variable assignments x:"5-s,?1.x,?.x.-?A Matlab script, and a Matlab function (with omissions) used to simulate the systetn are given below Piease answer the questions that follow the code modules Matlab seript: main.m xo- 1 01 Matlab function: m2-1: m2 2: k1-1025 eps 0.5 y2 sin(6 t) wdot (2, 1)-at.wentnA wdot (3, 1) w(4) wdot (4, 1)-(1/m2) (-2* (w (3) - (1)-eps (w(3)-(1))3):Explanation / Answer
main.m:
x0 = [ 1 ; 0 ; -1 ; 0];
t = linspace(0, 10, 1000);
[t,v] = ode45('doff', t, x0);
plot(t, v(:,1), t, v(:,2));
Matlab function:
function wdot = doff(t, w)
m1 = 1; m2 = 2; k1 = 10; k2 = 5; eps = 0.5;
y = 2*sin(6*t);
wdot(1,1) = w(2);
wdot(2,1) = (1/m1)*(-k1*(w(1)-y)-k2*(w(1)-w(3))-eps*(w(1)-w(3))^3);
wdot(3,1) = w(4);
wdot(4,1) = (1/m2)*(-k2*(w(3)-w(1))-eps*(w(3)-w(1))^3);
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.