# Chapter7-Phase Diagram¶

## Ex1-pg149¶

In [2]:
## Find degrees of freedom of a system of two components
c = 2 ## number of components
print("\n Example 7.1")
for n in range (1,4):
p = (c-1.) +2. ## Total variables
f = c-n+2. ## degree of freedom
print'%s %.2f %s  %.2f %s'%("\n\n Degree of freedom for two components when \n number of phases is ",n," is ",f,"")

#it is same for other values

 Example 7.1

Degree of freedom for two components when
number of phases is  1.00  is   3.00

Degree of freedom for two components when
number of phases is  2.00  is   2.00

Degree of freedom for two components when
number of phases is  3.00  is   1.00


## Ex2-pg152¶

In [4]:
## Find minimum number of component in system

p = 4. ## number of phases of system
f = 0. ## number of degree of system

print("\n Example 7.2")
C = f+p-1. ## components number
print'%s %.2f %s '%("\n Minimum number of components in system is ",C,"")

 Example 7.2

Minimum number of components in system is  3.00


## Ex3-pg160¶

In [5]:
## Calculate amount of pure water that can be extracted from sea water

L = 23.3 ## % composition of L
a = 3.5 ## concentration of Nacl in sea water
ice = 0. ## % composition of ice
print("\n Example 7.3")
f_ice = (L-a)/(L-ice)
print'%s %.2f %s '%("\n Fractional amount of pure water that can be extracted from sea water is ",f_ice,"")

 Example 7.3

Fractional amount of pure water that can be extracted from sea water is  0.85


## Ex5-pg167¶

In [7]:
## Calculate proeutectoid ferrite and eutectoid ferrite in 0.6% steel
import math
a = 0 ## limiting value
b = 0.8 ## limiting value
c = 0.6 ## percentage composition of carbon
f = 0.88 ## fraction of ferrite in a eutectoid steel
print("\n Example 7.5")
f_pro_alpha = (b-c)/(b-a)
f_perlite = 1 - f_pro_alpha
f_eut = f*f_perlite
print'%s %.2f %s '%("\n Composition of proeutectoid ferrite is ",f_perlite,"")
print'%s %.2f %s '%("\n Composition of eutectoid ferrite is ",f_eut,"")

 Example 7.5

Composition of proeutectoid ferrite is  0.75

Composition of eutectoid ferrite is  0.66