How do I solve for time?

Started by
25 comments, last by Aj37 22 years, 6 months ago
y=-1/2gt^2+vt+yi How do I solve this for t?
Advertisement
Hi,

here''s my solution:

y = -1/2gt^2 + vt +yi // - y
0 = -1/2gt^2 + vt + yi -y

//abc formula??? (I don''t know the English name)
t1= -v/(2*(-1/2g)) + sqrt( (v/(2*(-1/2g)))^2 -((yi-y)/(-1/2g)) )
t1= v/g + sqrt( v^2/g^2 + (yi-y)/(1/2g) )

t2= -v/(2*(-1/2g)) - sqrt( (v/(2*(-1/2g)))^2 -((yi-y)/(-1/2g)) )
t2= v/g - sqrt( v^2/g^2 + (yi-y)/(1/2g) )


cLE
Yes, we call it the "quadratic" formula:

if At2 + Bt + C = 0

then

t = (-B + sqrt(B2 - 4AC)) / (2A)or  t = (-B - sqrt(B2 - 4AC)) / (2A) 


See, there are two possible values of t.

You would choose the t that is physically consistent. For example, it might not make sense to choose a value of t that is negative.

So in this case just set:

A = -1/2g
B = v
C = yi - y

Something for you to think about...what if B^2 - 4AC is negative?

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
I foregot and had a brain fart. It is just the quadratic equation.
Or you can use Polysolve on a TI-85/86

Free Speech, Free Sklyarov
Fight the unconstitutional DMCA.

Commander M
grhodes_at_work: If b^2 - 4ac is negative, there are no real solutions. Or was that question intended from a programming perspective?
quote:Original post by Beer Hunter
grhodes_at_work: If b^2 - 4ac is negative, there are no real solutions. Or was that question intended from a programming perspective?


Your answer is basically what I was hoping to hear, although I was also wanting to point out that this situation is something to check for, at least during development and debugging.

There is another part to the question, something to think about not necessarily to answer. For the given equation, is there a physical interpretation of a non-real ("imaginary" or "complex") solution? I mean, you could plug in seemingly "legal" values for g, v, yi, and y that would result in an imaginary value for t:

v = 0 (object not currently moving)
g = 9.8 (yes, its gravity)
yi = 0 (object started at yi = 0)
y = 1 (object is currently at y = 1)

yields:

A = -9.8/2 = -4.9
B = 0
C = 0 - 1 = -1

So, b2-4AC = 0*0 - 4*(-4.9)(-1) = -19.6

which requires we deal with sqrt(-19.6)

Is it *possible*, for the given equation, to have a situation that results in an imaginary time value? Are the example values above "legal"?

Please excuse me if that sounds like a math teacher equation. It really *is* one of those.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Edited by - grhodes_at_work on October 3, 2001 2:49:34 PM
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
An object starts from rest at position = 0, and accelerates forwards at 2m/s. At what time will it be at position = -1?
quote:Original post by Beer Hunter
An object starts from rest at position = 0, and accelerates forwards at 2m/s. At what time will it be at position = -1?


Yes, exactly! The values I gave are not "legal" for the equation. They are not compatible with the assumptions used to derive the equation.

But if you''re simulating systems with oscillatory modes, such as systems with springs that have vibration modes, *then* complex/imaginary numbers do appear. They can be used to represent periodic solutions.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Which sort of systems? I''ve only looked at SHM and UCM in my physics class, and I don''t think you can get complex results with those, except for invalid cases. Or am I looking in the wrong place?

This topic is closed to new replies.

Advertisement