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

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 Comment

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.

Sign in to comment.

Answers (1)

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);

Categories

Find more on Mathematics and Optimization in Help Center and File Exchange

Tags

Asked:

on 22 Oct 2019

Edited:

on 28 Oct 2019

Community Treasure Hunt

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

Start Hunting!