Data Types and Program Execution in C++


Data Types in C++

Data types are used to identify the type of data and associated operation on it. C++ provides 3 types of data type such as:




a) Fundamental data type, b) Derived data type, c) User defined data type

a) Fundamental data type:

They are otherwise called primitive data type. Data type that is basically used in our program is called fundamental data types. These data types are not composed of other data types. C++ provides different fundamental data types as: int, float, char, double, void etc.

b) Derived data type:

Data types that are derived from fundamental data types are called derived data types. Commonly used derived data types are array, pointer, reference, etc.

c) User defined data type:

A user can create his own data type. Such data type is called user defined data type. The most commonly used user defined data types are class, structure, union etc.

Program Execution

A sequence of statements that are enclosed in open and close curely brace is called compound statement. In C++ a program code can be executed in different ways such as:

a) Sequence Execution:

A program execution in which each statement can be executed in a sequence manner(one by one) is called sequence execution.

b) Selective execution:

An execution of program code according to a condition is called selective execution. In case of selective execution, some part of the program code will be executed and at the same time some part will not be executed. There are different statements that are used for this purpose. They are named selective statements. Commonly used selective statements in C++ are ‘if’ statement and ‘switch’ statement.

c) Iterative Execution:

An execution of program code, that executes in a number of time, is called iterative execution. In case of iterative execution, same program code can be executed repeatedly according to a condition. The statement that is used for this purpose is called iterative statement.

Selective Statement:

To execute a program code selectively we can use different types of statements called selective statement. Commonly used selective statements are ‘’if’’ statement and ‘’switch’’ statements.

If statement:

It is a selective statement used to execute certain part of the programme code. In case of ‘if’ statement, it executes only certain part of the programme code according to the condition. If the condition is true, ‘if’ body will be executed, otherwise it executes the ‘else’ body.

Syntax:

if(condition)
{
if body
}
else
{
else body
}
Nested if:

An ‘if’ statement contains another ‘if’ statement inside it is called nested if.

Syntax:
if(condition)
{
if(condition)
{
if body
}
else
{
else body
}
}
else
{
else body
}

Switch statement:

Switch statement is also a selective statement used to execute a part of a program code. ‘Switch’ statement is a multiple branch selection statement. In case of ‘switch’ statement, it first evaluates the expression according to the value of expression, each case part will be executed. If no match is found, the default part will be executed. A switch statement contains another switch inside it, is called nested switch.

Syntax:

switch(expression)
{
case value 1:
......................
.....................
break;
case value 2:
....................
....................
default:
.........................
......................
}


Heat engines and Refrigerators


Heat Engines and Refrigerators

Heat Engines:

The heat engine is a device which converts heat energy into mechanical energy. The main parts of a heat engine are:




(i) a hot body called source,
(ii) a working substance
(iii) an insulating stand and
(iv) a cold body called sink.

The working substance absorbs heat from the source, converts a part of it into useful work and rejects the rest to the sink. The working substance then returns to the original state. This series of processes is called a cycle. By repeating the cycle work can be continuously obtained.

Practical heat engine can be classified into

(i) external combustion engine and
(ii) internal combustion engine.

In an external combustion engine combustion takes place outside the cylinder of the engine. For example, steam engine is an external combustion engine. Its efficiency is very low; about 30%.
In an internal combustion engine, the combustion takes place inside the cylinder of the engine. Petrol engine and diesel engine are internal combustion engines. Efficiency of these engines is nearly 50%.

Canines heat engine:

Carrot realized a theoretical engine which is free from all defects of practical engines. Its efficiency is maximum it is an ideal heat engine which cannot be realized in practice.

Different parts of a Carnot’s engine

The essential parts of a Carnot's engine are
(1) Working substance
(2) Source
(3) Insulating stand
(4) Sink

1. Working Substance is an ideal gas contained in a cylinder with perfectly insulating wall and perfectly conducting base. It is closed with a tight fitting perfectly insulated an frictionless piston.

2. A hot body of infinite thermal capacity at higher temperature T1 serving as source.

3. A cold body of infinite thermal capacity at a lower temperature T2 serving as sink.

4. A perfectly insulating stand.

Carnot's cycle: The cycle of a Carnot's engine is completed in four operations.

1. Isothermal expansion:

The cylinder is placed on the source so that it acquires the same temperature T1 as that of the source. Let P1 and V1 be the pressure and volume of the ideal gas taken in the cylinder. Now the piston is slowly raised so that the working substance expands isothermally at constant temperature T1 till the pressure changes P2 and volume to V2. This process is represented by the curve AB on the indicator diagram. Let Q1 be the heat absorbed by the working substance during this isothermal expansion.

2. Adiabatic expansion

The cylinder is now transferred on to the insulating stand and the working substance is further allowed to expand adiabatically by raising the piston. Since no heat is supplied to the substance, its temperature falls. The expansion is continued till the temperature falls to T2. The adiabatic expansion is represented by the curve BC, where P3 and V3 are the final pressure and volume.

3. Isothermal compression

The cylinder is placed on the sink and the piston is pressed so that the gas gets compressed. Heat produced during compression is rejected to the sink and the temperature remains constant at T2. This isothermal compression is represented by the curve CD where the final pressure and volume are P4 and V4. Let Q2 be the heat rejected to the sink.

4. Adiabatic compression

The cylinder is again placed on the insulating stand and the gas is further compressed. This compression is adiabatic since no heat enters or leaves the working substance. The temperature rises to T1 and the point A is reached again, where the pressure and volume of the gas are P1 and V1 respectively. This compression is represented by the curve DA.

The external work done by the substance during the processes AB and BC are represented by areas ABB'A' and BCC'B' respectively.

Similarly the work done on the substance during the processes C D and DA are represented by areas CDD'C' and DAA'D' respectively.

Therefore, Net work done by the gas.

W = the difference between these two pairs of areas
     = area (ABB'A' + BCC'B') – area (CDD'C' + DAA'D') = area ABCD

Thus the area ABCD represents the net external work W done by the working substance in one complete cycle.

The net amount of heat absorbed by the working substance in one cycle = Q1 — Q2. Since the initial and final states are the same, there is no change in its internal energy. Hence from first law of thermodynamics,

W = Q1 — Q2 = Area of ABCD

Thermal efficiency

Thermal efficiency of a heat engine is the ratio of the net work done by the engine to the heat taken from the source during one complete cycle. If Q1 is the heat taken from the source and Q2 the heat rejected to the sink, work done in one complete cycle is given by,

W = Q1 — Q2

Efficiency , η = W/Q1 = (Q1 — Q2)/ Q1

For an ideal Carnot's engine it can be shown that, η = (T1 – T2)/ T1

where T1 and T2, are the temperatures of the source and the sink respectively.

From the above equation, it is clear that η always less than unity. As T1 > T2 the smaller the value of T2 greater is the efficiency. If T2= 0, then only the efficiency would be 100%. Since it is impossible to obtain a sink at absolute zero, an engine with 100% efficiency is a practical impossibility.

The Refrigerator—Reversibility of Carnot's cycle

Since Carnot's cycle is performed through steps which are perfectly reversible, it can he performed in the reverse order ADCBA. When the process is carried out this way we have a Carnots refrigerator. Here the working substance absorbs an amount of heat Q2 from the sink, the freezer compartment. An amount of work W is done by some external agency (generally an electric compressor). Then the working substance gives a large amount of heat Q1 to the source (generally the atmosphere). The working substance is called 'refrigerant'.

Therefore, Q1= Q2 + W

Coefficient of performance of a refrigerator (β)

It is defined as the ratio of the quantity of removed from the freezer compartment per cycle to the energy spent by the external agency per cycle to remove this heat.

β = Q2/W = T2/(T1 - T2)


Introduction to C++ Lecture Notes


Introduction to C++ Lecture Notes

C++ is an object oriented programming language developed by Bjarne Stroustrup in 1980. The language is developed in Bell laboratories. The main characters of object oriented programming language are encapsulation, abstraction, inheritance and polymorphism.




Tokens:

The smallest individual unit in a program is called token. Tokens are classified into different types such as: Keyword, identifiers, literal, punctuator, and operator.

Keyword:

Keywords implement specific C++ features. They are explicitly reserved word. The reserved word used in a program is called keyword. Keywords are not used for declaring normal identifier. Example: if, else, int, void, throw.

Identifier:

Identifier refers to the names of variable, function, array, class etc. They are the fundamental requirement of any language. Each language has its own rules for declaring an identifier. The fundamental building block of a program is called identifier. ie, Identifiers are used for declaring variable, object etc.

Literal:

The data item that never changes their value, is called literal or constant. Literals are classified into three types such as:

a) Numeric Constant:

A constant or literal which contains only digit (with or without fractional part) is called numeric constant. The numeric constants are classified into two-integer constant and floating point constant.

b) Character Constant:

A single character enclosed in single quotes is called charcter constant. Example ‘A’.

c) String Constant:

A single character or a number of characters enclosed in double quotes is called string constant. Example “Compter”. In the case of string constant, there is an escape character, which is automatically added to the end of the string for representing the end of the string.

Punctuator:

The special symbols used for special purpose is called a punctuator. The following are commonly used punctuator in C++.

a) Open and closed round brackets () , indicates the function and function call.
b) Semicolan ; is used to indicate the end of a statement
c) Open and closed curly brackets {} , indicates the compound bracket
d) Hash # , is used for Pre-processor directive.
e) Square brackets [] is used to specify an array.

Operator:

Operators are symbols that are used to indicate specified operation. They are classified into two different categories such as

a) Unary operator- The operator that acts on only one operand is called unary operator. Commonly used unary operators are unary plus and unary minus. Example: +a, -a.

b) Binary operator- The operator that acts an two operands is called binary operator. Commonly used binary operators are   Relational operator, arithmetic operator and logical operator.

a) Arithmetic Operator:

The operator that is used to indicate some arithmetical operation is called arithmetic operator. The operator that is used to indicate arithmetical sum is called addition operator. The addition operator is used to indicate the symbol +. The subtraction operator is used to indicate the difference of two operands. It is represented with the use of (-) . The operator that indicates the division of two operands is called division operator. It is symbolically represented by /. An operator that is used to find the product of two operands is called multiplication operator. The symbol used to indicate multiplication operator is *. The operator that is used to find modulus of the first operand relative to the second operand is called modulus operator. It is indicated as %.

b) Relational operator:

The operator that is used to indicate the relationship among several operands is called relational operator. It is used for comparing different operands. C++ provides 5 major relational operators. They are: >, <, <=, >=, == 

c) Logical Operator:

The operator that is used to connect different relational operators is called logical operator. C++ provides three different types of logical operators such as AND operator, OR operator and NOT operator. Logical AND operator is represented with the use of the symbol (&&). The logical AND operator produces true output, when all the inputs are true otherwise it produces false output. Logical OR operator is represented using the symbol II. Logical OR operator produces true outputs when one of the conditions id True. Otherwise it produces false output. Logical NOT operator is represented with the use of the symbol ! . It is a unary operator, that is, it acts as only one operand.

d) Increment and Decrement operator:

Instead of the above operators, C++ provides two operators named increment and decrement operators. The increment operator (++) adds one to the variable and decrement operator (--) subtracts one from the variable. Eg: A++, A--

e) Conditional Operators:

C++ also offers an operator named conditional operator (?:) that stores a value depending upon the condition. The conditional operators are ternary operators that require 3 operands.
Syntax: Expression ? expression : expression

Eg: (a>b)? large=a:large=b, where the condition is true the variable large will hold the value a and otherwise it will hold the value b.

Van der Waal’s equation of state derivation


Van der Waal’s equation of state derivation

Experiments have shown that actual gases do not obey the ideal gas equation PV = RT. Even the so called permanent gases show marked departure when they approach critical conditions. While deriving the ideal gas equation, it has been assumed that the volume occupied by a molecule is negligible when compared to the volume of the gas and that the molecules exert no force on one another. van der Waal, argued that that these assumptions are not true for an actual gas and modified the ideal gas equation by making allowance for (1) the finite site of the molecule and (2) intermolecular force of attraction.




(1) Correction of the finite size of the molecule:

Assuming that each molecule of a gas has finite size, the molecule will occupy some space. Hence the volume actually available for the molecules to move freely will be less than the volume of the container. If V is the volume of the container, the effective volume available for the molecule to move about is (V — b); where b is the correction for the finite size of the molecule.

(2) Correction for intermolecular force of attraction:

A molecule like A well within the body of the gas is attracted equally in all directions by the surrounding molecules. Hence the resultant force on it is zero. A molecule like B near the wall of the container experiences an inward pull due to attraction of the molecules behind it. Hence the molecules strike the wall with reduced momentum and so the effective pressure of the gas is reduced. The true pressure inside the gas is obtained by adding a correction dp to the observed pressure P. The correction dp depends on (1) the number of molecules striking the wall and (2) the number of molecules attracting them backwards. Each of these factors depends on the number of molecules per unit volume of the gas; i.e., the density ρ of the gas.

The correction dp α ρ2 α 1/ V2; where V is the volume of the gas.
Therefore, dp = a/ V2; where a is a constant.

Corrected pressure = P + dp = P + (a/ V2)

Substituting the corrected values of P and V in the gas equation we get,

(P + (a/V2)) (V - b) = RT

This is known as van der Waal's equation of state for real gases. The constants a and b are called van der Waal's constants.

Andrew's Experiment on Carbon Dioxide


Andrew's experiment on carbon dioxide

Andrews made a systematic study of the effect of pressure on the volume of gases at different temperatures. He measured the volume of a given mass of the gas at various pressures at a constant temperature and then plotted graphs connecting pressure and volume at different temperatures. These graphs are called isothermals. Obtaining isothermals for different fixed temperatures, it is possible to see when and how the gas deviates from Boyle’s law.




Procedure

The experiment is performed by maintaining a given mass of carbon dioxide at any desired temperature. Pressure of CO2 is gradually increased from a small value to a very high value and the corresponding volumes of carbon dioxide are noted. A graph is plotted with pressure P along the Y-axis and the volume V along the X-axis. The experiment is done maintaining carbon dioxide at different constant temperature, 13° C, 21°C, 31.1°C, 35.5°C, 48°C... etc.
The isothermals of carbon dioxide at various temperatures are shown in the figure.


Explanation of the Isothermals

Consider the isothermal ABCD at 13°C.

At 13°C, the portion A B represents the gaseous state of carbon dioxide. The curve AB is a parabola. So up to the point B the gas obeys Boyle's law. From B to C it shows an, enormous decrease in volume with a slight increase in pressure. The portion BC represents the-change of state of carbon dioxide from gaseous state to the liquid state.  At C, the whole of the gas has been liquefied. The portion CD represents the liquid state of carbon dioxide because there is no appreciable decrease in volume with increase in pressure.

At 21°C, the curve is similar to that at 13°C; but the horizontal portion has decreased. As the temperature is further raised the horizontal portion of the graph becomes smaller and smaller and finally becomes a point O at 31.1°C. Above this temperature the horizontal part is absent from all isothermals. It shows that the gas cannot be liquefied any more.

Andrews found that the liquefaction of carbon dioxide occurred only below 31.1°C. This temperature is called the critical temperature (Tc) of carbon dioxide. The isothermal corresponding to 31.1°C, the critical temperature is called the critical isothermal. The point of inflexion O, where the horizontal portion of the isothermal is reduced to a point is called the critical point.

Isothermals for water vapour at different temperature are given below.

The pressure-volume relation for a mole of H20 is plotted as a set of curves, one for each temperature. At 350°C the portion A B represents the gaseous state. Upto B it more or less obeys Boyles law. The portion BC represents the change of state from gas to liquid. At C it is completely converted into liquid. The molar volumes of liquid and vapour at C and B are very different. At higher temperature, the horizontal portion of the curve has decreased. At 374°C the horizontal portion has vanished and the gas cannot be liquefied by applying pressure. The temperature corresponding to this curve is called critical temperature TC.

Results:

Andrews summarized the experimental results as follows:

(i)For every gas, there is a particular temperature below which alone the gas can be liquefied by the mere application of pressure. This temperature is called the critical temperature of the gas. Critical temperature of CO2 is 31.1°C, O2 is —118.8°C, nitrogen is —147.1°C, hydrogen is —240°C and helium is —268°C.

(ii) There is no essential difference between easily liquefiable and permanent gases. All gases can be liquefied below their critical temperatures by the mere application of pressure.

(iii) There exists a continuity of the liquid and gaseous states. This means that there is no physical distinction between the liquid and gaseous state of a substance. In other words, the two states are only two stages in a series of physical operations.

(iv) All gases equally remote from the critical temperature behave similarly to Boyle's law.

(v) At critical point (a) the densities of the liquid and the vapour gradually merge into one, (b) the boundary between liquid and gas disappears, and (c) compressibility of vapour becomes infinite.

Critical temperature (Tc)

Critical temperature of a substance is that particular temperature below which alone the gas can be liquefied by the mere application of pressure.

Critical pressure (Pc)

Critical pressure of a gas is the pressure that should be applied to the gas at its critical temperature in order to liquefy it.

Critical volume (Vc)

Critical volume of a gas is the specific volume ( i.e the volume of the gas per unit mass) of the gas at critical temperature and pressure. The critical temperature (Tc), the critical pressure (Pc) and the critical volume (Vc) of a gas are called the critical constants of the gas.


Reversible and Irreversible process in Thermodynamics


Reversible process in Thermodynamics

From thermodynamical point of view, a process is said to be reversible, if it can be retraced in the opposite direction at any stage of the operation in such a manner that the system and the surroundings pass through exactly the same state, at each stage, as in the direct process. After the end of the process, the system and the surroundings taking part in the process are restored to their initial state without producing change in either of them.




Conditions for a process to be reversible

1. All steps involved in the process must occur infinitely slowly.
2. Dissipative forces such as friction, viscosity, electrical resistance etc must be completely absent.
3. The pressure and temperature of the system must never differ appreciably from surroundings at any stage of the process. 

No actual process is fully reversible; but many processes when carried out slowly are practically reversible. For example, the slow compression of a spring is practically reversible, because if the force is slowly decreased it expands and performs the work, equal to the work done in compressing it. The slow evaporation of a substance in an insulated container is practically reversible.

Melting and boiling processes are reversible. In ideal case isothermal and adiabatic processes are reversible.

Electrolysis is a reversible process if the electrical resistance of the electrolyte is zero. On reversing the direction of current, the direction of motion of ions is reversed.

The Peltier effect is a reversible process.

Irreversible process in Thermodynamics

Any process which cannot be retraced in the opposite direction by reversing the controlling factors is called irreversible process. It is obvious that in such a process, changes occur suddenly and it will be accompanied by dissipative forces. 

For example, motion of a body on the ground is irreversible because energy spent in overcoming friction is not recoverable. Passage of electric current through a resistor is irreversible because heat is evolved whether current passes in one direction or in the opposite. All chemical reactions are irreversible because they involve change in the internal structure of the constituents.

Water fall is an unreversible process. The rusting of iron is an irreversible process.


Thermodynamic Processes are indicated in the following diagram

1 Isobaric Process (Isobaric change)

It is a physical change of a system where the pressure of the system remains constant.
If the working substance (gas) is taken in an expanding chamber in which the pressure is kept constant, the process is isobaric process.The Thermodynamic Processes are indicated in the following diagram (Isobaric Process)

In this process the gas either expands or contracts to maintain the pressure constant and a net amount of work is done by or on the system.




The graph A B is the indicator diagram of an isobaric process. The work done by the gas when its volume increases from V1 to V2,

W = P (V2 - V1) = Area of the graph A B B' A'

2 Isochoric Process (Isochoric change)

It is a physical change of a system where the volume of the system remains constant.
Since there is no change in the volume, the work done during the isochoric change is zero.
A B is an indicator diagram for an isochoric change. The graph A B is a straight line parallel to the pressure axis.The Thermodynamic Processes are indicated in the following diagram (Isochoric Process).




3 Isothermal process (Isothermal change)

When a system suffers a physical change under the condition that its temperature remains constant throughout the process, it is called an isothermal process.'

The essential condition for an isothermal process is that the system must be contained in a perfectly conducting chamber and the changes should be slow enough to ensure free exchange of heat with the surroundings. This ensures constancy of temperature. Since there is no change in internal energy, ΔU = 0. 
From first law,

ΔU = ΔQ — ΔW
0= ΔQ — ΔW
ΔQ = ΔW

Thus in an isothermal process heat absorbed by the system is equal to the work done

Examples:

(a) Melting

(b) Boiling.

(c) Consider a gas inside a conducting cylinder fitted with a smooth conducting piston, expanding very slowly. Then the temperature of the gas remains constant. When the gas expands, work is done by the gas at the expense of its internal energy and hence its temperature falls. But, since the expansion is very slow and the cylinder and the piston are conducting, the gas absorbs heat from the surrounding to keep its temperature constant. So the expansion of the gas is an isothermal change, an isothermal expansion.

Similarly when the gas is compressed slowly, work is done on the gas. Its internal energy increases. But heat is transmitted to surrounding, and hence the temperature of the gas remains constant. The compression of the gas is an isothermal change, isothermal compression.

4 Adiabatic process (Adiabatic change)

When a system undergoes a physical change under a condition that no heat enters or leaves the system, the change is said to be adiabatic.
For an adiabatic process, the system must be perfectly insulated from the surroundings and the change must be rapid. When work is done on the system the temperature increases and when work is done by the system, the temperature decreases.

Since no heat enters or leaves the system, ΔQ = 0. Applying first law,
ΔU = ΔQΔW
Therefore, ΔU = - ΔW

Thus in an adiabatic process the external work is done at the expense of internal energy. Hence when a gas expands adiabatically, its internal energy decreases. Consequently the temperature falls.

Examples:

(a) When a motor car tyre bursts, the sudden expansion of air into the atmosphere is adiabatic and hence the air is cooled.

 (b) Consider a gas enclosed inside a perfectly non-conducting cylinder fitted with a perfectly non-conducting piston. When the gas expands, the gas does work at the expense of its internal energy. Since the gas is perfectly insulated from the surrounding, if the expansion is quick, the temperature of the gas falls. The expansion of the gas is adiabatic, an adiabatic expansion because no heat is absorbed from the surroundings or transmitted to the surroundings.
Similarly, when the gas is compressed quickly, as no heat is transmitted to or absorbed from the surroundings, the compression is an adiabatic compression.

Note:

(a) When water vapour from the surfaces of river, sea etc rises up, if it reach a low pressure region in the atmosphere it expands adiabatically. This produces cooling and vapour condensed into small droplets causing the rain fall.

(b) When sun shines, the denser air over the valley of a mountain gets heated up. The hot air rises up. When it reaches the higher altitude, the top of the mountain, it expands adiabatically because the pressure of air is very low at higher altitude. Due to adiabatic expansion cooling is produced. Hence the mountain tops are cooler.

Celsius to Fahrenheit, Kelvin Example Problems

Relation connecting the scales of temperature:

If C is the temperature of a body on the Celsius scale, F is the temperature on the Fahrenheit scale and Kis the temperature on Kelvin’s scale, then,

C/100 = (F - 32)/180 = (K - 273)/100
Or C/5 = (F - 32)/9 = (K - 273)/5
Intervals of 9° on Fahrenheit scale is equal to intervals of 5° on Celsius scale,
That is, 9 F° = 5 C° (Difference in readings are given in F° or C°)
1F ° = (5/9) C°




Celsius to Fahrenheit, Kelvin Example Problems:

1. Temperature of the human body is 98.4°F. Find the corresponding temperatures on the Celsius scale and Kelvin scale.

Answer: C/5 = (F – 32)/9 ; C/5 = (98.4 – 32)/9 = 66.4/9
C = (5 X 66.4)/9 = 36.9° C
On the Kelvin scale = (273 + t°C) = 273 + 36.9 = 309.9 K

2. At what temperature do Celsius and Fahrenheit scales coincide?

Answer: Let X be the temperature at which Celsius and Fahrenheit scales are equal.
C/5 = (F - 32)/9; X/5 = (X – 32)/9 :
Cross multiplying;
9X = 5(X - 32) = 5X -160
Therefore, X = -40

3. At what temperature do the Kelvin and Fahrenheit scales coincide

Answer: Let X be the temperature at which the Kelvin and Fahrenheit scales coincide.
(K – 273)/5 = (F - 32)/9; (X - 273)/5 = (X – 32)/9;
Cross multiplying, 9X – 2457 = 5X – 160
4X = 2297;
Therefore, X = 2297/4 = 574.25

4. If the change of temperature of a body is 20°C, find the change of temperature of the body in Fahrenheit scale.

Answer: 100C° = 180 F° ; 1C° = (9/5) in F° (C° or F° means a change of :)
Change of 20°C = (9/5) x 20 = a change of 36°F

5. A constant volume gas thermometer using helium records a pressure of 20 kPa at the triple point of water and a pressure of 14.3 kPa at the temperature of ‘dry ice’ (solid CO2). What is the temperature of ‘dry ice’?

Answer: P1 = 20 kPa;  T1 = T1r = 273 K:  P2 = 14.3 kPa, T2 = ?;
According to Charle’s law, at constant volume,
P1/T1 = P2/T2;
T2 = P2/P1 x T1 = (14.3/20) x 273 = 195 K


Specific Heat of Gases


When a gas is heated, both the volume and pressure change appreciably. Heat may be supplied to the gas keeping either its volume constant or its pressure constant. The amount of heat required will be different in these two cases for the same rise of temperature. Hence a gas has two specific heat capacities (specific heats).




The specific heat of a gas at constant volume (cv)

It is the amount of heat required to raise the temperature of unit mass of the gas through one kelvin keeping its volume constant.

Molar specific heat at constant volume (Cv)

It is the amount of heat required to raise the temperature of 1 mole of the gas through one kelvin at constant volume.

The specific heat of a gas at constant pressure (cp)

 It is the amount of hem required to raise the temperature of unit mass of the gas through one kelvin keeping pressure constant.

Molar specific heat at constant pressure (Cp)

 It is the amount of heat required to raise the temperature of 1 mole of the gas through one kelvin at constant pressure.

Unit of specific heat: Jkg- 1 K-1 or J-1 mol-1 K-1

Why Cp is greater than Cv?

When unit mass, one mole, of a gas is heated at constant volume, the heat supplied is utilized only to increase the internal energy of the gas. When it is heated at constant pressure, the heat supplied is used not only for increasing the internal energy but also for doing external work during expansion. For the same rise of temperature, the increase in internal energy is the same in both cases. Hence Cp is greater than Cv.

To show that Cp - Cv = R (Mayer's relation)

Consider one mole of an ideal gas enclosed inside a non-conducting cylinder fitted with a light smooth piston. Let P he its pressure, V its volume and T its temperature.

Keeping the volume constant let the gas be heated so as to raise its temperature by one kelvin. The quantity of heat supplied,

Q = Cv

The amount of heat is used only to raise, the internal energy of the gas.

Now, let us imagine the gas be heated at constant pressure so as to raise the temperature by 1 K. The quantity of heat supplied,

Q’ = Cp

This amount of heat is partly used to raise the internal energy of the gas as the temperature rises by 1 K and also used to do external work as the gas expands to keep the pressure constant.

Therefore, Cp = Cv+ External work

When the gas expands keeping pressure constant, let the piston be moved through a distance dx. Hence external work done by the gas, 

W = F x S = PA x dx =PdV;

where A is the area of cross-section of the piston and A x dx = dV, the increase in volume of the gas. Hence equation (iii) becomes, 

Cp = Cv + PdV

For an ideal gas,

PV = RT                                                                    (a)
After expansion, P(V + dV) = R(T + 1)                (b)
Eqn: (b) - Eqn: (a) PdV = R

Substituting in Eqn,

Cp = Cv + R;

Therefore, Cp - Cv =R

This is Mayer's equation.

Ratio of specific heats ( γ)

The ratio of specific of a gas is the ratio of its specific heat at constant pressure to the specific heat at constant volume of the gas.

γ =Cp1C,

It is a constant for a gas. γ = 1.4 for diatomic molecule.

Experimental results

Type of gas
Gas
Cp/R
Cv/R
(Cp - Cv)/R
1
Mono-atomic
He
A
2.5
2.5
1.5
1.5
1.00
1.00
2
Diatomic
H2
O2
3.45
3.53
2.45
2.53
1.00
1.00
3
Polyatomic
CO2
SO2
4.43
4.85
3.42
3.11
1.01
1.08

The experimental results show that the result Cp - Cv = R is true for all gases. But the values CP = 2.5R and Cv = 1.5 R is true only for monoatomic gases. Cp and Cv are considerably higher than theoretical values for diatomic and polyatomic gases. This means that these molecules have internal motions with associated energy.

Degrees of freedom

The degrees of freedom of a dynamical system are defined as the total number of independent quantities required to describe the position or motion of the system completely. To understand the concept of degrees of freedom consider the following example.

1. If we consider an ant moving along the straight edge of a table, we can specify its position by knowing the displacement along the line from one end of the table. We say that the ant has only one degree of freedom.

2. If consider the ant moving over a table, to locate its position completely at any instant we must specify the displacements along X and Y axes. Thus, in this case, we say the ant has two degrees of freedom.

3. If we consider a bee flying in space, its position at any instant can be determined by knowing the displacements along the three principal directions i.e., X, Y and Z. Hence the bee has three degrees of freedom.

Degrees of freedom of a gas molecule

1. Monoatomic molecule

The molecule of a mono-atomic gas such as helium, neon, argon etc has only one atom. It is capable of only translatory motion in free space. Hence it has three degrees of freedom.

2. Diatomic molecule

The molecule of a diatomic gas like H2, O2 etc are made up of two atoms joined rigidly through a bond. The molecule can have three translational motions as usual; but in addition, it can rotate about any one of the co-ordinate axes. However; its moment of inertia about the axis joining the two atoms is negligible. So it can have practically two rotational motions. Hence, a diatomic molecule has five degrees of freedom.

3. Triatomic molecule

A molecule such as CO2, NH2, SO2 etc can rotate about any of the three co-ordinate axes. Hence it has six degrees of freedom; three translational and three rotational.

Law of equipartition of energy

For a dynamical system in thermal equilibrium, the total energy of the system is equally divided among the various degrees of freedom.

The share of energy for each degree of freedom = 1/2 kT; where k is the Boltzmann constant and T the temperature.

Specific heats and degrees of freedom

1. Monoatomic gas

A mono-atomic gas molecule has three degrees of freedom
Energy per degree of freedom = (1 /2) k T
Therefore, Energy associated with a molecule = 3 x ½kT
Energy associated with a mole of the gas, E = 3 x (1/2) kT x N = (3/2)RT
Cv= (dE/dT)= (3/2) R; Cp = Cv + R = (3/2)R + R = (5/2)R
 γ = Cp/Cv = (5/2)R/(3/2)R = 5/3 = 1.67

2. Diatomic gas

A diatomic molecule has five degrees of freedom.
Energy associated with a molecule = 5 x ½ kT
Energy associated with a mole of the gas = 5 x ½ kT x N = (5/2) RT
Cv = (dE/dT)= (5/2)R;  Cp = Cv + R = (5/2)R + R = (7/2) R
γ = cp/cv = (7/2) R (1) (5/2) R = 7/5 = 1.4

3. Triatomic gas

A triatomic molecule has 6 degrees of freedom.
Energy associated with a molecule = 6 x ½ kT
Energy associated with a mole of the gas = 6 x ½ kT x N= 3RT
Cv = (dE /dT) = 3R;
Cp = Cv + R = 3R + R = 4R
γ = Cp/Cv = 4R /3R = 4/3 = 1.33
Note: In general if n is the number of degrees of freedom,
γ = 1 + (2/n)