Skip to content

update #63

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions HW1/projectile.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
function [h,t_linear,y] = projectile(v_mag,theta)
% Function that takes the initial velocity magnitude and the angle of
% launch of the projectile and calculates the height at 2.37m away from the
% initial position from an initial height of 1.72m.
% Inputs: v_mag, theta
% Output: h
%
% Also plots the path to a distance of 2.37m.

i = 1;
x0 = 2.37;
y0 = 1.72;
g = -9.81;

t = x0/(v_mag*cos(theta));
t_linear = 0:0.01:t;
y = zeros(1,length(t_linear));
h = y0 + x0/cos(theta) + 0.5*g*(x0/(v_mag*cos(theta)))^2;

for t = t_linear
y(i) = y0 + v_mag*t + 0.5*g*t^2;
i = i + 1;
end

plot(t_linear, y)

end

26 changes: 26 additions & 0 deletions HW1/projectile.m~
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function [h,t_linear,y] = projectile(v_mag,theta)
% Function that takes the initial velocity magnitude and the angle of
% launch of the projectile and calculates the height at 2.37m away from the
% initial position from an initial height of 1.72m.
% Inputs: v_mag, theta
% Output: h
%
% Also plots the path to a distance of 2.37m.

x0 = 2.37;
y0 = 1.72;
g = -9.81;

t = x0/(v_mag*cos(theta));
t_linear = 0:0.1:t;
y = zeros(length(t_linear));
h = y0 + x0/cos(theta) + 0.5*g*(x0/(v_mag*cos(theta)))^2;

for t = t_linear
y() = y0 + v_mag*t + 0.5*g*t^2;
end

plot(t_linear, y)

end

3 changes: 3 additions & 0 deletions HW1/setdefaults.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set(0, 'defaultAxesFontSize', 16)
set(0,'defaultTextFontSize',14)
set(0,'defaultLineLineWidth',3)
6 changes: 6 additions & 0 deletions HW2/projectile.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function h = projectile(v_mag, theta)
% Takes an input velocity magnitude and angle and outputs the height of the projectile 2.37 m away from the initial position.

h = 1.72 + 2.37 * sin(theta)/cos(theta) + 1/2*(-9.81)*(2.37/v_mag/cos(theta))^2;

end
9 changes: 7 additions & 2 deletions extra_credit_1/data.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
this data can be found in the pull request for rcc02007/ME3255S2017 data.csv pull requests, and was added here during class

radius (cm), angle (degrees)
0, 0
2.25, 62
6.3, 39
6.9, 60
6.3, 100
7.8, 249
3.3, 282