Im having trouble using quadratic formula to solve for time for path or rocket

3 次查看(过去 30 天)
Given the equation for the height of a rocket at given time, calculate the reasonable times at which the rocket will be at the height
h(t)=K1t-K2t^2+h0
H0=3
K1=64 ft/sec
k2=16ft/sec^2
H=enter whatever height you would like
I have used the quadratic formula to solve for t but I somehow keep getting answers that are far off
my equation for solving t:
t1=(-K1+sqrt(K1^2-4(-K2)*(H0-H)))/(2*-K2)
t2=(-K1-sqrt(K1^2-4(-K2)*(H0-H)))/(2*-K2)
  1 个评论
David Hill
David Hill 2019-10-22
H0 would be the height immediately after rocket engine cutout and K1 the velocity immediately after engine cutout. Assuming the ground is the zero reference for the height, the maximum H is limited to (K1^2/4*K2)+H0 and there would be two times above H0 but only one valid time below H0 down to the ground reference.
h0=500;
k1=64;
k2=16;
h1=h0:.1:(k1^2/4/k2+h0);
t1=(k1-sqrt(k1^2+4*k2*(h0-h1)))/2/k2;
h2=0:1:(k1^2/4/k2+h0);
t2=(k1+sqrt(k1^2+4*k2*(h0-h2)))/2/k2;
hold on
plot(t1,h1);
plot(t2,h2);
Looks good to me.

请先登录,再进行评论。

回答(1 个)

Sourav Ghai
Sourav Ghai 2019-10-28
编辑:Sourav Ghai 2019-10-28
Hi,
The equations you are using works fine.
Here is the sample code
K1 = 64;
K2 = 16;
H0 = 3;
H = 3;
t1=(-K1+sqrt(K1^2-4*(-K2)*(H0-H)))/(2*-K2);
t2=(-K1-sqrt(K1^2-4*(-K2)*(H0-H)))/(2*-K2);
disp(t1);
disp(t2);

类别

Help CenterFile Exchange 中查找有关 Physics 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by