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

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

%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; 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; subplot(223); plot(Beta,r,'k'); axis([0 125 0 3.2]); title({'Radius vs. Beta by Song, Hwan'}); xlabel('Beta in degree'); ylabel('Radius in meter');

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

View Full Document
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
Ask a homework question - tutors are online