2 A projectile is launched from the top of a building. The height of the project
ID: 3283642 • Letter: 2
Question
2 A projectile is launched from the top of a building. The height of the projectile is then recorded at 4 different times. The results are shown in the table below: Time (in seconds) Height (in feet) 836 1720 2280 2564 (a) Find a quadratic model (order 2 polynomial) for the data where z is the time elasped since the launch and y is the height of the projectile. Note: The transpose of a matrix A in MATLAB can be found by typing transpose(A) or A'. (b) Use the model to predict when the projectile will hit the ground.Explanation / Answer
MATLAB code
close all
clear
clc
x = [2 5 8 11];
y = [836 1720 2280 2564];
% y = a*x^2 + b*x + c
A = ones(length(x), 3);
A(:,1) = x.^2;
A(:,2) = x;
B = y';
X = AB;
a = X(1); b = X(2); c = X(3);
fprintf('y = %.4f*x^2 + %.4f*x + %.4f ', a,b,c);
% when the projectile hits the ground, the height will be zero.
% so, we need to find x at which y = 0.
% so, need to solve the quadratic equation a*x^2 + b*x + c = 0
x = (-b-sqrt(b^2 - 4*a*c))/(2*a);
fprintf('Answer for part (b): %.4f seconds ', x);
Output
y = -16.6667*x^2 + 408.1333*x + 88.8000
Answer for part (b): 24.7037 seconds
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.