# Calculate initial velocity to reach height Y

I am working on a program that shoots a projectile straight up into the air. I need to be able to calculate the initial velocity required to reach height Y. Assume there is a gravitational constant of -9.8m/s and we are dealing with real time. What formula can I use to achieve this? Please let me know if more info is needed for this problem.

• Are you considering friction? – user88595 May 7 '14 at 19:32
• No I am not, no friction or anything like that – Shijima May 8 '14 at 1:14

The initial velocity should be set to:

$$v_0 = \sqrt{2 g Y},$$ or

$$v_0 = \sqrt{2*9.8*Y},$$ where $Y$ is provided in units of meters and $v_0$ is in meters/second.

Cheers,

Paul Safier

• Thanks for the post, I tried to upvote you but cannot until I have higher rep. Will be sure to come back :) – Shijima May 8 '14 at 1:16
• Marking your answer as correct since you were first to post. Thanks again. – Shijima May 8 '14 at 1:49

You have received at least two good answers, at least one of which explains itself in terms of energy conservation. Rather than repeating the answer, here are some other ways to think about why it is the correct answer.

It is possible to work this out purely in terms of acceleration, velocity, and position. The motion of your projectile from the launch point to height $Y$ is the same as the motion by which it falls from height $Y$ to the launch point, but exactly in reverse. So the question is, if you drop a projectile (initially at rest) from height $Y$, how fast is it traveling when it reaches height zero? That's how fast you have to shoot the projectile upward to reach height $Y$ above your starting point.

Or you can look at it like this: Suppose it takes time $t$ for your projectile to reach the top of its trajectory at height $Y$. Since the acceleration is $-9.8 \, \mbox{m}/\mbox{s}^2$, and the projectile ended at velocity $0$, it must have started at velocity $v = 9.8 t \, \mbox{m}/\mbox{s}$. During the same period of time, the projectile's mean velocity (averaged over time) was $4.9 t \, \mbox{m}/\mbox{s}$ (half its initial velocity), so you traveled $4.9 t^2 \, \mbox{m}$. Therefore, $Y = 4.9t^2$. Solve for $t$ as a function of $Y$, and plug this into the formula above that gave $v$ as a function of $t$. Now you have $v$ as a function of $Y$.

At the top, the kinetic energy should be zero, and at the bottom the potential energy should be zero, and since the total energy should stay constant, $K_{bottom} = U_{top}$

$K = \frac{mv^2}{2}$ and $U = mgY$

Since both contain mass, we can factor that out, getting: $\frac{v^2}{2} = gY$

Rearranging, we get: $v = \sqrt{2gY}$, with v being your initial vertical velocity.