Documente Academic
Documente Profesional
Documente Cultură
To:
CP Nozzles
Attachments (4)
Appendix B
Appendix C
%% Rocket Lab 1
% Jose Delgado
% ME 326-05 Lab
%% Clearing of values
clear;
close all;
clc;
%% Givens of the Problem
m=10;
% This is the mass of the rocket in kilograms
% We are assuming there is negligible mass loss
g=9.81;
% This is the value of gravity to be used in our problem
%% Rocket Thrust Data Import
% Using the xlsread command to input the data spread sheet
[num,txt,raw]=xlsread('326_Rocket_Thrust.xlsx');
T = num(:,1);
% Assigned the entire first value to t in seconds
F = num(:,2);
% Assigned the entire first value to F in newtons
%% Converting each force into the acceleration
% The force gets the force of gravity subtracted to find accel SEE
Apen A
% That is then divided by the mass
A=(F-m*g)./m;
%% Removing Nonusable data
a=A(1:length(F)-1,1);
% Little a is the new acceleration vector losing the average
t=T(1:length(F)-1,1);
% Little t is the new time vector without the NaN
%% Making the Acceleration Vs Time plot
figure;
plot(t,a)
title('Acceleration vs Time');
xlabel('t (seconds)');
ylabel('a (meters per second^2)');
%% Using myTrapz to find velocity
% myTraps uses the trapezoidal rule to integrate acceleration
% myTraps outputs a new velocity vector same length as the time
v=myTrapz(t,a);
figure;
plot(t,v)
title('Velocity vs Time');
xlabel('t (seconds)');
ylabel('v (meters per second)');
Appemdix D