Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

load these values into Matlab create an appropriately annotated graph of positio

ID: 3548442 • Letter: L

Question

load these values into Matlab create an appropriately annotated graph of position vs time points. Plot the data points AND best fit curves for both objects in different colors on the same graph. The graph that you create will be worth 10 points. (We will not actually grade your files for the practice exam. We WILL for the REAL exam!) Note: Since acceleration is constant, its graph is a horizontal line. Since acceleration is the second derivative of position, what order should your position polynomial be? Based on a best-fit polynomial for A's position, determine an approximate value for the velocity of object A at 4.5 seconds, (m/s) Based on a best-fit polynomial for B's position, calculate B's acceleration, (m/s2)

Explanation / Answer

clear all

clc

t=(0:0.5:7.5)'; % time as given in table

Pos_A=[0 0.14 0.53 1.08 2.18 3.03 4.36 5.75 8.81 10.02 12.37 16.35 20.01 22.84 24.99 29.26]'

fit_Pos_A=fit(t,Pos_A,'poly2') % Position A curve fit

Pos_B=[0 0.22 0.95 2.19 3.79 5.43 7.81 11.84 13.17 17.22 21.26 28.97 30.29 39.33 48.24 45.81]';

fit_Pos_B=fit(t,Pos_B,'poly2')% Position V curve fit

Vel_A=diff(Pos_A) % Velocity

t1=(0.5:0.5:7.5)'; % Time for velocity

fit_Vel_A=fit(t1,Vel_A,'poly1')% Velocity A curve fit of linear type

Vel_B=diff(Pos_B)

fit_Vel_B=fit(t1,Vel_B,'poly1')% Velocity B curve fit of linear type

%Plots

figure(1)

plot(fit_Pos_A,t,Pos_A)

figure(2)

plot(fit_Pos_B,t,Pos_B)

% Interpolated Values

Vel_A_45=fit_Vel_A(4.5)

Accl_B=fit_Vel_B(1)-fit_Vel_B(0) % y=mx+c p we have to find m to get the accelaration so we %first put x=1 and then x=0 to get the m