HW8_2 - subplot(222) plot(t, gamma) title('Gamma vs. Time...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
%Song, Hwan %HW#8, prob #1 %AAE 340 % clear all close all clc c %Given m=1; L = 1; g = 9.81; t0 = 0; tf = 10; tspan = [t0, tf]; u0 = [0 0 80*pi/180 0]; options = odeset('RelTol',1e-10,'AbsTol',[1e-12 1e-12 1e-12 1e-12]); o [t,y] = ode45('numint', tspan, u0, options); x = y(:,1); xdot = y(:,2); gamma = y(:,3); gammadot = y(:,4); g E = 2*(xdot.^2 + L^2*gammadot.^2+ xdot.*L.*gammadot.*cos(gamma)- g*L.*cos(gamma)); p=(2*m*L*gammadot.*cos(gamma)-xdot); p x = y(:,1); xdot = y(:,2); gamma = y(:,3)*180/pi; gammadot = y(:,4)*180/pi; g subplot(221) plot(x, t) title('x vs. Time by Song, Hwan ') ylabel('Time (s)') xlabel('x(m)')
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: subplot(222) plot(t, gamma) title('Gamma vs. Time by Song, Hwan') xlabel('Time (s)') ylabel('Gamma (deg)') subplot(223) plot(t, gammadot) title('gammadot vs. t by Song, Hwan') xlabel('t (s)') ylabel('Gammadot (deg/s)') subplot(224) plot(x, gamma) title('Gamma vs. x by Song, Hwan') xlabel('x (m)') ylabel('Gamma (deg)') y figure(2) plot(t, p) title('Linear Momentum vs. Time by Song, Hwan ') xlabel('Time (s)') ylabel('Momentum') figure(3) plot(t, E) title('Energy vs. Time by Song, Hwan ') xlabel('Time (s)') ylabel('Momentum') y...
View Full Document

Page1 / 2

HW8_2 - subplot(222) plot(t, gamma) title('Gamma vs. Time...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online