Problem 1. You recorded the following measurements for a moving object as follow
ID: 3908605 • Letter: P
Question
Problem 1. You recorded the following measurements for a moving object as following. Estimate the velocity of the object at t -1.0 sec,t-2.4 sec and t-3.5 sec. 0.0 0.6 7 2.0 2.5 Time (sec) 3.2 121 132140 105 157 Velocity (m/s) 90 a) Use linear interpolation to estimate the velocity of the object "by hand". If you are unable to interpolate the velocity for any of the t values, explain why. b) Use MATLAB and linear interpolation to estimate the velocities c) Use MATLAB and spline interpolation to estimate the velocities d) Use MATLAB "polyfit" command to find the polynomial function that passes all points. Clearly state the function! e) Use polynomial interpolation function from d) to estimate the velocities f) Plot these three interpolation curves for the domain0.0 3.2] Mark' on these six data points. Label all axes and show legendsExplanation / Answer
a)
By linear interpolation velocity is given by formula
v(t)=a0+a1t
We need velocity at t=1s, t= 2.4s t= 3.5s using above table
For t=1
let us choose closest point of this time in between which t=1 falls so we get
t0=0.6 and t1= 1.7
Therfore, t0=0.6 v( t0) =132
t1= 1.7 v(t1)=140
which gives us equations
v(0.6)=a0 +a1(0.6) = 132
v(1.7)=a0 +a1(1.7) = 140
Let us write equation in matrix
1 0.6 a0 132
1 1.7 a1 = 140
By solving equations we get
a0=-127.63 a1=7.28
hence
v(t) = a0+a1 t
= -127.63 +7.28 x t
for t=1
= -127.63 +7.28 x 1
= -120.35
Similarly we can calculate for t=2.4
let us choose closest point of this time in between which t=1 falls so we get
t0=2.0 and t1= 2.5
Therefore, t0=2.0 v( t0) =105
t1= 2.5 v(t1)=157
which gives us equations
v(2.0)=a0 +a1(2.0) = 105
v(2.5)=a0 +a1(2.5) = 157
Let us write equation in matrix
1 2.0 a0 105
1 2.5 a1 = 157
By solving equations we get
a0=-103 a1=104
hence
v(t) = a0+a1 t
= -103 +(104 x t)
for t=2.4
= -103 + 104x 2.4
= -105
For t=3.5 we cannot interpolate as upper value is not available as last being t=3.2 which is less than 3.5 and any value bigger than 3.5 is not avalaible so interpolation is not possible
b) For t=1 and t=2.4
x=[0.0 0.6 1.7 2.0 2.5 3.2]
y=[121 132 140 105 157 90]
x1=0:1:3.2
y1=interp1(x,y,x1,'linear');
y1
x2=0:2.4:3.2
y2=interp1(x,y,x2,'linear');
y2
c) x3=0:1:3.2
y3=interp1(x,y,x3,'spline');
y3
x4=0:2.4:3.2
y4=interp1(x,y,x4,'spline');
y4
d). a=polyfit(x,y,1) ro get simple 1 degree linear regression
e)
x5=0:1:3.2
y5 = polyval(polyfit(x,y,1),x5);
y5
x6=0:2.4:3.2
y6 = polyval(polyfit(x,y,1),x6);
y6
f)
plot(x1,y1)
hold
plot(x3,y3)
plot(x5,y5)
title('Velocity ','fontsize',20)
ylabel('Meters per sec','fontsize',15)
xlabel('Time(seconds)','fontsize',15)
legend('Linear Interpolation','Spline Interpolation', 'Polynomial Interpolation')
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.