# Joules to compress air

## Main Question or Discussion Point

So here I am at work, and the go-to people for physics are away. Here is the problem I am trying to figure out:

I'm wondering how much energy it takes to compress a certain amount of
air at a certain temperature, to a certain pressure. For example, lets
say I had a 4-gallon tank of STP air and I wanted to add air until the
pressure inside the tank reached 300 kPa. How much energy, in joules,
would it require to do this?
-Dan

edit: nevermind this thread. Zz gave me a bit of help. If you want, you can still give me some help, but for now, I should be fine, unless I post here again requesting help.

Related Other Physics Topics News on Phys.org
You just do it the opposite way : calculate how much work the tank releases when it vents the gas out.

We have P=nRT/V, so you integrate the function nRT/V dV with 4 galon and 12 galon as the endpoints of the interval. 12 galon is the volume the compressed gas expand when it is released.
I am sorry not to have the numerical results for you.

In this case, consider the atmosphere equals to 100kPa, then the energy needed to compress air into a 4 gallon tank to 300kPa is 5520.035 Joules.

I ve got a question:

The gas is compressed to 300kPa with the volume of 1 gallon. At ambient condition, the pressure is 100kPa, and the absolute value of 300kPa must be 400kPa, so that the volume of gas will be 16 gallons, not just 12 gallons after being expanded to ambient pressure.
I am right?