9_76 - i 2‘ ms-47- kw «mm mmgm is 3x “ a:r a‘ I g...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: i 2‘ ms» -47-». kw «mm mmgm». ; is 3x “' a; :r a‘ I g : ‘ 1 - {a «59‘ m& an: ‘ % problem 9.76 function question976 %time span tspan = [0,10]; °/ointegrate for 10 sec zO = [0, 0, 0, 0]'; %initial position and velocity %[x0, VXO, y0, vyO] %solves the ODEs [t Z] = ode45(@rhs,tspan,20); %Unpack the variables x1 = z(:,1); V1 = z(:,2); x2 = z(:,3); V2 = z(:,4); %plot the results plot(t,v1) title('Ka Ming Lam”s plot ofvl vs t') xlabel(‘t(s)') ylabel('vl (m/s)') %set grid, xmin, xmax, ymin, ymax end % ______________________________________________________ function zdot = rhs(t,z) x1= z(l); v1 = 2(2); x2 = 2(3); v2 = 2(4); %put in vlaues for mass, C and g below ml : 2; m2 = 20; % masses in kg C = 0.4; % in kg/s F=120; k1=1; k2=1; k3= l; %kin N/m % the linear momentum balance eqns: xldot = v1; Vldot = (-k2-k1)/ml *Xl+k2/ml *x2; x2dot = V2; V2dot = F/m2-C/m2*V2-(k3+k2)/m2*x2+k2/m2*x1; Zdot = [xldotgvl dot ; x2dot;v2dot]; %this is what the function returns (column vector) end \ \ b). Here is the plot Ka Ming Lam"s plot va1 5:31 14 12 10 v1 (mfs) c). In order to have a decaying erratic oscillation we need to increase tspan to [0 100] for this case Ka Ming Lam"s plot of x1 vst 90 8E] 0 1U 2U 30 £10 50 50 FT! EU 90 100 ...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern