Prob_2 - %Song,Hwan %AAE 340 %Problem Set 6 % %Problem 2...

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

View Full Document Right Arrow Icon
%Song,Hwan %AAE 340 %Problem Set 6 %Problem 2 % clear all close all clc c %Given to = 0.; tf = 10; tspan = [to,tf]; tt = [to:0.001:tf]; t r0 = 3; %in m rdot0 = 0; %in m/s B0 = 0; %in rad Bdot0 = 0.5; %in rad/s B k = 8; %in N/m m = 1; %in kg r_o = 1.5;%in m r %ODE's u0 = [ r0 rdot0 B0 Bdot0 ]; dt = [to,tf]; options = odeset('RelTol',1e-10,'AbsTol',[1e-12 1e-12 1e-12 1e-12]); [t,u] = ode45('fpen3d',tspan,u0,options); [ %Conversion r = u(:,1); Beta = u(:,3)*180/pi(); B %Constants E = 0.5*m.*(u(:,2).^2+u(:,1).^2.*.5.^2)+0.5*k.*(u(:,1)-r_o).^2; H = m.*u(:,1).^2.*.5; H %Plots subplot(221); plot(t,r,'k'); grid on; axis([0 4.5 0 3.2]); title({'RADIUS HISTORY by Song, Hwan'}); xlabel('Time in sec'); ylabel('Radius in meter'); subplot(222); plot(t,Beta,'k'); axis([0 4.5 0 150]); title({'BETA HISTORY by Song, Hwan'}); xlabel('Time in sec'); ylabel('Beta in degree'); grid on; subplot(223); plot(r.*cos(u(:,3)),-1.*r.*sin(u(:,3)),'k'); axis([-3 3 -3 3]); title({'Position on Horizontal Plane';'tf = 10secs by Song, Hwan'}); xlabel('X in meter'); ylabel('Y in meter');
Background image of page 1

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

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

This document was uploaded on 10/24/2010.

Page1 / 2

Prob_2 - %Song,Hwan %AAE 340 %Problem Set 6 % %Problem 2...

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