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
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
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);
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!