Untitled2

# Untitled2 - 2*R*L.*(2.*theta_dot+gamma_dot).*cos(gamma)); 2...

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

%Rajesh Parikh %AAE 340 %Problem Set 7 Problem 3 % clear all close all clc c %Time Set to = 0.; tf = 8000; tspan = [to,tf]; tt = [to:0.001:tf]; t %Initial Conditions theta0 = 0; %m thetadot0 = 0; %m/s gamma0 = 30 *pi()/180; %rad gammadot0 = -.1 *pi()/180; %rad/s g %Constants NEED TO CHANGE IN fpen3d.m as well L = 5; %m R = 3; %m R %ODE45 u0 = [ theta0 thetadot0 gamma0 gammadot0 ]; dt = [to,tf]; options = odeset('RelTol',1e-10,'AbsTol',[1e-12 1e-12 1e-12 1e-12]); [t,u] = ode45('fpen3d',tspan,u0,options); [ theta = u(:,1); theta_dot = u(:,2); gamma = u(:,3); gamma_dot = u(:,4); g %Energy %E = L^2.*(theta_dot + gamma_dot).^2 + 3/2*R^2.*theta_dot.^2; E = L^2.*(theta_dot + gamma_dot).^2 + 1.5.*R.^2.*theta_dot.^2 + 2.*L.*R.*theta_dot.*(gamma_dot+theta_dot).*cos(gamma); %Ang. Momentum H = abs(3*R^2.*theta_dot + 2*L^2.*(theta_dot+gamma_dot) +

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.

Unformatted text preview: 2*R*L.*(2.*theta_dot+gamma_dot).*cos(gamma)); 2 %Plots subplot(231) plot(t,theta*180/pi()) title({'\theta History - Rajesh Parikh'}) xlabel('Time (sec)') ylabel('\theta (deg)') grid; g subplot(232) plot(t,gamma*180/pi()) title({'\gamma History - Rajesh Parikh'}) xlabel('Time (sec)') ylabel('\gamma (deg)') grid; g subplot(233) plot(theta*180/pi(),gamma*180/pi()) title({'\gamma vs. \theta - Rajesh Parikh'}) xlabel('\theta (deg)') ylabel('\gamma (deg)') grid; g subplot(234) plot(t,E) title({'Energy History - Rajesh Parikh'}) xlabel('Time (sec)') ylabel('Energy (Joules)') y subplot(235) plot(t,H) title({'Angular Momentum History - Rajesh Parikh'}) xlabel('Time (sec)') ylabel('Angular Momentum (Nt*met*sec)')...
View Full Document

## This document was uploaded on 10/24/2010.

### Page1 / 2

Untitled2 - 2*R*L.*(2.*theta_dot+gamma_dot).*cos(gamma)); 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