Why do I get negative height? A baseball is thrown from the roof $50.1^\circ$ above the horizontal. The initial velocity is $11.5\ \mathrm{m/s}$.
I'm trying to find how high the ball goes.
I choose positive direction upwards. 
$$
H = \frac{1}{2g} v_{0y}^{2}
$$
But I get a negative answer since $g$ is negative. Is $g$ an absolute value when working with energy?
 A: $g$ should always be positive. It is the magnitude of the gravitational field strength. If you choose vertical up as positive $y$, then the gravitational field (a vector) will be $-g\hat{j}$. The gravitational potential energy change within a small vertical range will be 
$$\Delta U_g=mg\Delta y$$
where $g$ is reasonably constant within the $\Delta y$ range.  For example if a 2 kg object is moved near the surface of the earth from $y_a= 2$ m to $y_b= 3$ m,
$$\Delta U_g=mg(y_b-y_a)=19.6~\mathrm{J}.$$
If it is moved from $y_b$ to $y_a$
$$\Delta U_g=mg(y_a-y_b)=-19.6~\mathrm{J}.$$
A: The first issue is that it's thrown at an angle. 
As the question seems to assumes no air friction, the part of the velocity we care about for the answer is its vertical component (11.5 x sin 50.1 = 8.82 m/s). The horizontal component says how far it will travel horizontally, which we aren't being asked about.
So the question is the same as asking about a ball thrown vertically upward at 8.82 m/s. 
Next, we have to make a choice which direction we call "positive". That is a completely free choice.


*

*If we call "up" the + direction , then the ball starts with positive velocity +8.82 (because its initial velocity is in the direction we defined as +), and has an acceleration in the negative direction, with acceleration -9.8 (because gravity acts in the downward direction we defined as -).

*If we call "down" the + direction , then the ball starts with negative velocity -8.82 (because its initial velocity is in the direction we defined as -), and has an acceleration in the positive direction, with acceleration +9.8 (because gravity acts in the upward direction we defined as +).


We can choose either of these, and the answer will be the same.
If we define "up" as the positive direction, which is probably the usual way most people would do it, then the ball starts with a positive velocity, and experiences a constant acceleration (deceleration) in the negative direction. (See how we use positive and negative directions and +/-g?). The ball reaches its highest point when its velocity reaches zero, because after that it starts to move downward again in a negative direction. We want to know how far its travelled in that time. 
We can solve this using equations of motion, or energy - the answer will be the same. I'll show both methods.
Using equations of motion
There are different ways to write the equation when we know start velocity (v1 which is 8.82), end velocity (v2 which is zero), and acceleration (a which is -9.8), and want to know distance (s). One easy way is to work out the time (t) it takes:
v2 = v1 + at
=> 0 = 8.82 + (-9.8) t
=> t = 8.82 / 9.8 = 0.9 seconds
How far did it travel?
s = (v1 + v2) t / 2
s = (8.82 + 0) x 0.9 / 2
s = 8.82 x 0.9 /2 = 3.969 
The ball travelled 3.969 metres upwards at its highest point.
Using energy
Initial K.E. is m.v12/2 = m.8.822/2 = 38.89 m
Final K.E. = 0 (when the ball is at its highest point, all the K.E. has been transformed into P.E., and it has no vertical velocity.)
The gain in P.E. by raising a ball of weight 'm' by height 'h' is mgh. 
But we don't have to consider directions of motion really. We only have to consider energy. It starts with some KE and ends with none. It starts with some PE and ends with a higher gravitational PE because its position is higher within a gravitational field (however it got there)
=> mgh = 38.89m
=> g.h = 38.89
=> 9.8.h = 38.89
=> h = 38.89 / 9.8 = 3.969
Same answer - the ball rises by 3.969 metres at its highest point.
A: I assume you got to this equation by setting the potential energy at the highest point $E_\text{pot}=mgH$ equal to the vertical kinetic energy $E_\text{kin}=\frac{mv_y^2}{2}$. In the formula for the potential energy, $g$ is to be taken positive, as otherwise this would yield a negative potential energy (which is possible, but not correct in this context).

If you want to see that consistent, derive the formula for the potential energy yourself. In that case $F_\text{grav}=mg$ since you take $g$ to be negative, and we are only considering the $z$ component. Then, since for lifting something up we need to apply a force opposite the gravitational force, we have
$$E_\text{pot} = \int_0^h -F_\text{grav} ds = \int_0^h -mg\,ds = \left. -mgs\right|_{s=0}^{h} = -mgh$$
A: The signs work out correctly as long as you are careful.
If an object accelerates at a constant acceleration $a$ over a distance $s$ then the work done on the object is force times distance. But we have $F=ma$, so the work done on the object is $mas$. So if $K_1$ and $K_2$ are the kinetic energy of the object at the start and at the end of the period, then
$K_2-K_1=mas$
In the case of ballistic motion in a vertical direction, $K_1=\frac 1 2 mv^2$ where $v$ is the initial velocity of the object. If the object reaches a maximum height of $h$ then $K_2=0$ when $s=h$, so we have
$-\frac1 2 mv^2 = mah$
Substituting $a=-g$ and we have
$-\frac1 2 mv^2 = -mgh \\ \Rightarrow h = \frac {v^2} {2g} $
A: $g$ is always positive. The negative sign you might usually see comes from defining down as negative, but the value of $g$ is always positive. This is why you don't ever see absolute value signs and why your equation is actually correct.
To add more detail, the value of $g$ is just the magnitude of acceleration due to gravity near Earth's surface. It is given by $$g=\frac{GM}{R^2}$$
where $M$ and $R$ are the mass and radius of the earth respectively, and $G$ is a constant. All of these values are positive, so $g$ is also positive.
