# Physics Course/Thermodynamics
## Ideal gas law

$PV\propto T$

### Pressure

Suppose we have a cylinder which contains ideal gas (or ideal gas). The cylinder is sealed with a free to move piston.
Given:
    M - piston's mass
    A - cross-sectional area
    $P_{0}$ - atmospheric pressure
Free-body diagram for the piston includes three forces:
    * a force from the air above the piston
    * a force from the gas
    * the weight of the piston
Remember that the piston is free to move, so the equilibrium of all three forces is established. That is one force (pointing up) equals to the sum of the two others (pointing down). Also note, that if piston were massless (its weight would be zero), then the force of the above air pushing down would exactly equilize the force of the gas, pushing the piston up.
Let's denote the pressure inside the cylinder as $P_{inside}$. As force is pressure times area, we have
    $F_{pg}=F_{pa}+Mg\$
    $P_{inside}A=P_{0}A+Mg\$
    $P_{inside}=P_{0}+Mg/A\$
This formula is quite reasonable: if you sit on the top of the piston you'll effectively increase the mass of the piston, thereby increasing the pressure inside :)
Questions: does the pressure inside depend on
    how high the piston is
    what gas is inside
    the temperature of the gas
Avogadro's law and Avogadro's number

## First law of thermodynamics
### Work

First there is a reminder of how mechanical work defined in physics.
    $dW={\vec {F}}\cdot d{\vec {s}}\,\!$
You need to know interpretation of dot product as well. Note that if force and displacement are perpendicular each other, the work is zero. There is no work by itself, the work is done by force. So for every force there might be work done. The sum of all contributions would give you total work done on system (body). Here we introduce work-kinetic energy theorem, which say the net work done by all the forces equals to the change of kinetic energy of a body.
    $W_{total}=E_{f}-E_{i}\,\!$

### Work and internal energy

Suppose we have a cylinder with ideal gas inside. The cylinder is closed by a piston which can move without friction. If we push the piston, the work done on gas (by hand) is positive and the work done by gas (on hand) is negative.
Now let's place the system in thermally isolated coating. It means there is no exchange of heat between the cylinder and surrounding.
    $\Delta E_{int}=W_{onsystem}\,\!$
Don't confuse the temperature with thermal isolation. Thermal isolation does NOT mean constant temperature. The temperature is rather directly associated with internal energy of the system.

### Heat

If heat flows to some system it is positive, otherwise it is negative. As you could have guessed heat flow is zero in thermally isolated systems.

### Heat, work and internal energy

    $\Delta E_{int}=W_{onsystem}+Q\,\!$
This is the First Law of Thermodynamics.
If we take the same cylinder with the piston and place it in some huge tank with water (usually called thermal bath) and wait for some time. The system will eventually acquire the temperature of the tank and whatever we'll do with the system (cylinder+gas+piston), after waiting for some time there is no way to change its temperature. This is an example of isothermal (constant temperature) process. Since change in temperature is related to the change in internal energy, we'll have
    $0=W_{onsystem}+Q\,\!$
The last special case is to fix the piston in space, therefore the work would be zero.