Wednesday, March 25, 2015

Blog 2

Part A:
a.     While rafting at a falls, the speed of the boat was measured at 3-s intervals for 30 s.
b.     In the last summer vacation, I with 4 of my friends went for rafting at a falls. At that time, I measured the speed of our boat at a regular interval when it was sliding at the downward slope of the falls. The data was tabulated as follows. Find the acceleration of the boat at exactly 18 sec.
c.     The data of the speed of the boat
Time, t(s)
Velocity, V(cms-1)
0
1
3
1.906
6
3.6328
9
6.9240
12
13.1971
15
25.1536
18
47.9424
21
91.3776
24
174.1645
27
236.96
30
331.70

d.     The graph


The graphs shows the velocity of the boat at specific time. Three secants are drawn for three different intervals. The tangent shows the change of the velocity at the specific time 18 s.

e.     ARC calculation: For ARC calculation at the time 18 s, at least three secants are considered. These are, the slope between (18,21), (18,24) and (18,27).
The slope at (18, 21) = (91.3776 -47.9424) / (21-18) = 14.48
The slope at (18, 24) = (174.1645 -47.9424) / (24-18) = 19.37
The slope at (18, 27) = (236.96 -47.9424) / (27-18) = 21.002
The average change of the velocity is represented by the slope of the secants. In this application, it represents the average change of the velocity of the boat which is defined by the average acceleration of the boat. The unit of the slope is cm/s2
For the shorter time, the slope is highest. The average of the three slope values is 18.28 which is almost equal to the second slope. It means at this time the change of velocity, which is defined by the acceleration, is almost constant.
f.      Tangent line.



The graphs shows the velocity of the boat at specific time. The tangent shows the change of the velocity at the specific time 18 s.
Two points on the tangent line has been considered. These are
P(15, 11.1) and Q(24, 121.62)
The slope of the tangent is: (121.62 – 11.1)/(24-15) = 12.28
From this tangent, it represents the exact acceleration at the specific time 18 s. This is the instantaneous acceleration of the boat.

g.     Since the tangent considers only the smallest time at a specific point, the slope, rate of change of velocity, is the spontaneous acceleration. This is the actual acceleration. The unit is cm/s2

Appendix:
Matlab code to draw secant and tangent.
A.     Secant Draw
clear all; clc; close all;
x=0:3:30;
y=[1,1.9059,3.63278,6.924,13.1971,25.1535,47.9423,91.3775,164.1645,236.96,331.70];


format long;
idx = input('Enter index of X:');
plot(x,y,'.','LineWidth', 8); hold on
n = 10;
[p,~,mu] = polyfit(x,y,n); % degree 10 polynomial fit, centered and scaled
%
% Plot the fit with the data
xfit = linspace(min(x),max(x),100);
yfit = polyval(p,xfit,[],mu);
plot(xfit,yfit,'g','LineWidth', 1.5)
%% Slope at a given point
m=(y(idx+1)-y(idx))/(x(idx+1)-x(idx)) %Equation of forward difference
m1=(y(idx+2)-y(idx))/(x(idx+2)-x(idx)) %Equation of backward difference
m2=(y(idx+3)-y(idx))/(x(idx+3)-x(idx)) %Average of both, also equation of secant
% x(idx)
%%
ave = (m+m1+m2-18)/3;
fprintf('Equation of tangent \n')
fprintf('q = %4.2f*(p-%4.2f)+%4.2f \n',ave,x(idx),y(idx))
p = 12:0.01:30;
q = ave*(p-x(idx))+ y(idx);
hold on;
plot(p,q,'r', 'LineWidth', 2); grid on;
grid on; title('Veocity vs. time for the boat'); hold on;
plot(x,y,'x', 'LineWidth', 4);
xlabel('time, t(s)'); ylabel('Velocity, V (cm/s)');

p = 18:0.01:21;
q = m*(p-x(idx))+ y(idx);
hold on;
plot(p,q,'b', 'LineWidth', 1.5); grid on; hold on;


p = 18:0.01:24;
q = m1*(p-x(idx))+ y(idx);
hold on;
plot(p,q,'k', 'LineWidth', 1.5); grid on; hold on;

p = 18:0.01:27;
q = m2*(p-x(idx))+ y(idx);
hold on;
plot(p,q,'y', 'LineWidth', 2); grid on; hold on;
legend ('Measured Velocity','Poly Fit line','Tangent at Point of Interest', 'Measured Velocity (bold)', 'Secant 1', 'Secant 2', 'Secant 3')

%% Slope at a given point
m=(y(idx+1)-y(idx))/(x(idx+1)-x(idx)) %Equation of forward difference
m1=(y(idx)-y(idx-1))/(x(idx)-x(idx-1)) %Equation of backward difference
m2=(y(idx+1)-y(idx-1))/(x(idx+1)-x(idx-1)) %Average of both, also equation of secant

B.     Tangent Draw
clear all; clc; close all;
x=0:3:30;
y=[1,1.9059,3.63278,6.924,13.1971,25.1535,47.9423,91.3775,164.1645,236.96,331.70];

format long;

idx = input('Enter index of X:');
plot(x,y,'.','LineWidth', 8); hold on
n = 10;
[p,~,mu] = polyfit(x,y,n); % degree 10 polynomial fit, centered and scaled
%
% Plot the fit with the data
xfit = linspace(min(x),max(x),100);
yfit = polyval(p,xfit,[],mu);
plot(xfit,yfit,'g','LineWidth', 1.5)
%% Slope at a given point
m=(y(idx+1)-y(idx))/(x(idx+1)-x(idx)) %Equation of forward difference
m1=(y(idx+2)-y(idx))/(x(idx+2)-x(idx)) %Equation of backward difference
m2=(y(idx+3)-y(idx))/(x(idx+3)-x(idx)) %Average of both, also equation of secant
% x(idx)
%%
ave = (m+m1+m2-18)/3;
fprintf('Equation of tangent \n')
fprintf('q = %4.2f*(p-%4.2f)+%4.2f \n',ave,x(idx),y(idx))
p = 12:0.01:30;
q = ave*(p-x(idx))+ y(idx);
hold on;
plot(p,q,'r', 'LineWidth', 2); grid on;
grid on; title('Veocity vs. time for the boat'); hold on;
plot(x,y,'x', 'LineWidth', 4);
xlabel('time, t(s)'); ylabel('Velocity, V (cm/s)');
idx=6;
p1=15; q1=12.28*(p1-18)+ 47.94; hold on;
plot(p1,q1,'x','LineWidth', 6)
text(p1+2,q1-2,['P(' num2str(p1) ',' num2str(q1) ')']);

idx=9;
p2=x(idx); q2=12.28*(p2-18)+ 47.94; hold on;
plot(p2,q2,'x','LineWidth', 6)
text(p2+2,q2-2,['Q(' num2str(p2) ',' num2str(q2) ')']);





No comments:

Post a Comment