# getting gravity and initial velocity

## Recommended Posts

I've been working on this problem for awhile but couln't get right result. So I hope anybody help me.

Lets say there's a man at height H. And he jumps stright upward and reaches maxH and fall back to ground(zero height) in given time(t).

What would be initial velocity(jump power) and gravity?

The man must reach to maxH(not over it) and fall back to ground in GIVEN TIME!

If he jumps from ground, it's solved by assuming that v=0 at half of given time.

But I can't solve if that man jumps from specific height.

Below is what I want to do.

void jump( float current_height, float max_height, float desired_time )

{

g = ...?

v0 = ...?

}

##### Share on other sites
Taking the equation for displacement with constant acceleration:
y=y0+v0*t+0.5*a*t*t
where y0 is the height, v0 is the initial velocity and a is the acceleration (which should be negative), you can solve for y=0 which gives you a quadratic equation. Solving this equation gives y=(-v0+sqrt(v0*v0-2*a*y0))/a or y=(-v0-sqrt(v0*v0-2*a*y0))/a. The physically relevant solution is obviously the positive one. Does this help?

EDIT: scratch that. If you want to get both gravity and initial velocity, you need another piece of information (probably the time taken to reach the maximum height) unless I am making another mistake here. Edited by RulerOfNothing

##### Share on other sites
No, it's possible.

The time to reach maximum height is v/g and we also know v^2 = 2g(maxH - H). So substituting gives the time in terms of g.

The time to fall is sqrt(2 maxH/g).

Both times added together equal t. So you can solve for g and from that find v.

##### Share on other sites

given the fact that there is only gravity in action once the man is in the air, the time needed to go from altitude H to MaxH is the same as a freefall from altitude MaxH to H.

Let call Hjump the altitude from where the man jump, and Hland the altitude of the man where it lands after reaching Hmax

Thus, compute the time needed for a free fall from altitude MaxH to Hjump = T1 ; the time needed for a free fall from altitude MaxH to Hland = T2 ; total time needed : T = T1+T2

Notice that your "given time" is a time limit only, as there is no way, given Hjump, Hland and MaxH, to influence the time requirred to do the jump

##### Share on other sites

I believe this to be a solution:

First, obtain Initial Velocity:

Initial vertical velocity as a function: Vb(Td, Ha, Hb ) = (-Td - ( Td^2 - Td^2/(Ha-Hb)*Ha )^(1/2)  ) / ( Td^2 / (2*(Ha-Hb) ) )

Or in equation format:

tD = total time

HA = starting height

HB = max height

Once you have that, gravity can be derived:

Gravity as a function: g( Td, Ha, V ) = (-Ha-V*Td)/(Td*Td)
Or in equation format:

tD =  total time
HA = starting height
V = initial velocity, obtained from first equation

Here's my derivation

[url=http://i.imgur.com/FvkK2I6.jpg][/URL]

You can enter the above equation into any standard calculator that supports equations. (win power calc is what I used).

Testing it seems to work. For example:

Vb(1.02, 0, 1.276) = 5.003
Vb(1.328, 2, 3.276) = 5.0008

You can check those values at http://www.had2know.com/academics/trajectory-parabola-equations-calculator.html - entering the corresponding values, and 90 for the "trajectory angle"

Note: Throughout my calculations I assumed the formulas looked like this: h = h0 + v0*t + g*t0^2 - meaning, I was adding gravity, instead of doing -g. Basically you have to realize that I was expecting the value of g to be negative. This will come into account when deriving gravity.

Edit 5: Added derivation work and visual formulas.

Note that there may be simpler solutions, but I couldn't find any
Edited by Milcho

##### Share on other sites

Notice that your "given time" is a time limit only, as there is no way, given Hjump, Hland and MaxH, to influence the time requirred to do the jump

Ooops, I forgot that there can be an angle for the jump... Varying angle and velocity will influence the time of the jump, thus the goal of a given time is right... sorry.

##### Share on other sites

Ooops, I forgot that there can be an angle for the jump

Angle? Angle has nothing to do with it, as far as I understood.

Sanghlee was only asking for vertical velocity (he mentioned a man jumping straight up).

More importantly, the calculations for vertical velocity can be entirely independently done from those for horizontal, because horizontal velocity has no effect on the time it takes an object to fall down.

##### Share on other sites

SUPER THANKS to Milcho! Especially good derivation and super kind explanation!

You're right about the angle. I just needed upward force.

I'm impressed that you've gave excellent explanation to just a online question.

You helped me alot. Thanks again!

I believe this to be a solution:

First, obtain Initial Velocity:

Initial vertical velocity as a function: Vb(Td, Ha, Hb ) = (-Td - ( Td^2 - Td^2/(Ha-Hb)*Ha )^(1/2)  ) / ( Td^2 / (2*(Ha-Hb) ) )

Or in equation format:

tD = total time

HA = starting height

HB = max height

Once you have that, gravity can be derived:

Gravity as a function: g( Td, Ha, V ) = (-Ha-V*Td)/(Td*Td)
Or in equation format:

tD =  total time
HA = starting height
V = initial velocity, obtained from first equation

Here's my derivation

You can enter the above equation into any standard calculator that supports equations. (win power calc is what I used).

Testing it seems to work. For example:

Vb(1.02, 0, 1.276) = 5.003

Vb(1.328, 2, 3.276) = 5.0008

You can check those values at http://www.had2know.com/academics/trajectory-parabola-equations-calculator.html - entering the corresponding values, and 90 for the "trajectory angle"

Note: Throughout my calculations I assumed the formulas looked like this: h = h0 + v0*t + g*t0^2 - meaning, I was adding gravity, instead of doing -g. Basically you have to realize that I was expecting the value of g to be negative. This will come into account when deriving gravity.

Edit 5: Added derivation work and visual formulas.

Note that there may be simpler solutions, but I couldn't find any

##### Share on other sites

Glad to help - but as I said, there are probably simpler ways to calcualate the V0.

And here is one simplification: (to clarify, this is the exact same formula from above, only simplified)

V(Td, Ha, Hb) = 2*( Hb - Ha + (Hb*Hb - Ha*Hb)^(1/2) ) / Td

Same variable name/meanings - and it should run faster, and works just as well.

Edited by Milcho

##### Share on other sites

I solved this problem in the general case a while ago, on this thread, but the LaTeX parsing bug currently plaguing the forum has utterly destroyed it.

The general idea was to define two arbitrary points A and B, and find the correct initial velocity vector such that an object launched at A subject to vertical gravity g will intersect B. This leads to a parametric equation in time t (since there are infinitely many solutions). You can rearrange it and properly define A and B to adapt the result to your situation, rearranging for the required variable.

I will reproduce the important part of the derivation here, out of context, without LaTeX (I honestly cannot be bothered typesetting the equations and uploading them in JPG format, sorry):

Assuming gravity is the only force on the bomb, and is strictly downwards, and that point B does not move while the bomb is in the air (obviously) and that there are no obstacles to consider, then you can in fact work out the exact initial velocity vector needed to hit point B. First, let A be at coordinates (Ax, Ay) and B at coordinates (Bx, By).Then, using some kinematics, the position of the bomb at any time t will be:

(Ax + Vx t, Ay + Vy t + 0.5gt^2)

So for the bomb to hit B somehow, we need the coordinates of the bomb to satisfy:

Ax + Vx t = Bx

Ay + Vy t + 0.5 gt^2 = By

For some t. Rearranging:

Vx = (Bx - Ax) / t

Vy = (By - Ay - 0.5gt^2) / t

Simplifying:

Vx = (Bx - Ax) / t

Vy = (By - Ay) / t - 0.5gt

This is a parametric equation in t, which basically gives a bigger and bigger velocity vector as you decrease the time (the faster you shoot, the less time gravity has to effect the bomb, so at infinite speed you can pretty much just aim towards B and shoot). As you increase the time t, gravity becomes more important (see the gravity term in the equation) and the direction itself matters less, so you get an increasingly large arc.

This is probably overkill for your particular situation, but since this is a vector solution, it lends itself perfectly to higher dimensions and arbitrary gravity vectors (the quoted paragraph is a special case with vertical gravity only, in two dimensions, the full result is in the following post on said thread). You can even make it work with arbitrary gravitational fields using calculus, but that is definitely overkill.

##### Share on other sites

Bacterius, correct me if I'm wrong:

1) fixed starting point,

2) fixed ending point,

3) fixed gravity and

4) no restrictions as to how much time the object needs to take there.

Using that information, you derive the initial necessary velocity to move from point A to point B.

Assumptions 1) and 2) apply here as well, but from the initial post, as I understand, the gravity is an unknown which must be found, and you're given the total time T which the movement takes (or needs to take).

I don't believe that your equations, as you posted them in the current format, will solve these requirements.

Of course, I could be missing something...

##### Share on other sites

Bacterius, correct me if I'm wrong:

1) fixed starting point,

2) fixed ending point,

3) fixed gravity and

4) no restrictions as to how much time the object needs to take there.

Using that information, you derive the initial necessary velocity to move from point A to point B.

Assumptions 1) and 2) apply here as well, but from the initial post, as I understand, the gravity is an unknown which must be found, and you're given the total time T which the movement takes (or needs to take).

I don't believe that your equations, as you posted them in the current format, will solve these requirements.

Of course, I could be missing something...

The parametric equation relates the three variables gravity, time from A to B and initial velocity, and can be rearranged to express any one of those variables in terms of the other two. Restrictions can be placed on any variable, including time. The original post gives a required time which can be plugged in, yielding equation relating g and initial velocity v0. With no restrictions, infinitely many (g, v0) solutions exist, and can be found by simply choosing arbitrary g or v0 and solving for the other.

Unless I made a mistake, which is entirely possible.

Edited by Bacterius

##### Share on other sites

The parametric equation relates the three variables gravity, time from A to B and initial velocity, and can be rearranged to express any one of those variables in terms of the other two.

Referring to this:

Vy = (By - Ay) / t - 0.5gt

You have initial velocity, distance, time and gravity. (referring to y-axis only here)

Two of those are unknown in the problem posted in this thread - the original velocity and the gravity.

Perhaps I'm missing the obvious, but there's no trivial way to expand or rearrange the equation to solve for both gravity and initial velocity  - only a way to give you a relation between them (two unknowns, one equation).  This would usually mean that there might be 0, or more solutions to the equation, however the one piece of information you do not account in those equations is the maximum height that the object needs to reach - which I think removes a degree of freedom and narrows down the solution to only 1.

Edited by Milcho

##### Share on other sites

Two of those are unknown in the problem posted in this thread - the original velocity and the gravity.
Perhaps I'm missing the obvious, but there's no trivial way to expand or rearrange the equation to solve for both gravity and initial velocity  -only a way to give you a relation between them (two unknowns, one equation).  This would usually mean that there might be 0, or more solutions to the equation, however the one piece of information you do not account in those equations is the maximum height that the object needs to reach - which I think removes the last degree of freedom and narrows down the solution to only 1.

Ah, you are correct, I did not see that information. This will indeed be enough. In this case my equation applies twice, once at maximal height at time t, and once at initial height at double the time (2t), and you have to solve a system of two equations in g and v0 which should give the same (unique) solution you obtain. Thanks.

Easiest way is to equate initial velocity, and solve for g, and use that to solve for initial velocity (like you did) which gives the same solution.

Assuming initial height is the ground, this will for instance give solution v0 = 4h / t which is equivalent to your solution assuming Ha = 0.

At this point your solution probably makes more sense to everyone, though :)

Edited by Bacterius

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628334
• Total Posts
2982147

• 9
• 24
• 9
• 9
• 13