0% found this document useful (0 votes)
272 views

Materials Science and Engineering - A First Course - V. Raghavan

This Scilab code document provides programs to solve examples from a Materials Science and Engineering textbook. It contains codes for examples related to topics like equilibrium and kinetics, crystal structure, atomic structure, solid structure, crystal imperfections, phase diagrams, diffusion, phase transformations, mechanical properties, fracture, corrosion and other materials-related topics. The codes are labeled and numbered according to the example and section they correspond to from the textbook for easy reference.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
272 views

Materials Science and Engineering - A First Course - V. Raghavan

This Scilab code document provides programs to solve examples from a Materials Science and Engineering textbook. It contains codes for examples related to topics like equilibrium and kinetics, crystal structure, atomic structure, solid structure, crystal imperfections, phase diagrams, diffusion, phase transformations, mechanical properties, fracture, corrosion and other materials-related topics. The codes are labeled and numbered according to the example and section they correspond to from the textbook for easy reference.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

Scilab Textbook Companion for

Materials Science and Engineering - A First


Course
by V. Raghavan1

Created by
Vareesh Pratap
B.Tech
Mechanical Engineering
Madan Mohan Malaviya University of Technology
College Teacher
None
Cross-Checked by
Aviral Yadav

July 31, 2019

1 Funded by a grant from the National Mission on Education through ICT,


http://spoken-tutorial.org/NMEICT-Intro. This Textbook Companion and Scilab
codes written in it can be downloaded from the ”Textbook Companion Project”
section at the website http://scilab.in
Book Description

Title: Materials Science and Engineering - A First Course

Author: V. Raghavan

Publisher: Prentice Hall, India

Edition: 5

Year: 2007

ISBN: 9788120324558

1
Scilab numbering policy used in this document and the relation to the
above book.

Exa Example (Solved example)

Eqn Equation (Particular equation of the above book)

AP Appendix to Example(Scilab Code that is an Appednix to a particular


Example of the above book)

For example, Exa 3.51 means solved example 3.51 of this book. Sec 2.3 means
a scilab code whose theory is explained in Section 2.3 of the book.

2
Contents

List of Scilab Codes 4

2 Equilibrium and Kinetics 5

3 Crystal Geometry and Structure Determination 7

4 Atomic Structure and Chemical Bonding 11

5 Structure of Solid 13

6 Crystal Imperfection 17

7 Phase Diagram 21

8 Diffusion in Solids 24

9 Phase Transformation 28

10 Elastic Anelastic and Viscoelastic Behaviour 32

11 Plastic Deformation and Creep in Crystalline Materials 34

12 Fracture 38

13 Oxidation and Corrosion 41

3
14 Conductors and Resistors 42

15 Semiconductors 44

16 Magnetic Materials 45

17 Dielectric Materials 48

4
List of Scilab Codes

Exa 2.1 Calculate the entropy increase . . . . . . . . 5


Exa 2.2 Calculation of fraction of atoms with energy
equal to or greater than 1eV at temperatures 5
Exa 3.2 Calculate effective number of lattice point in
three cubic space lattice . . . . . . . . . . . 7
Exa 3.7 Determine interplanar spacing and miller in-
dices . . . . . . . . . . . . . . . . . . . . . . 8
Exa 3.8 Determine structure and lattice parameter of
material . . . . . . . . . . . . . . . . . . . . 9
Exa 4.1 Calculate frequency and wavelength of radia-
tion . . . . . . . . . . . . . . . . . . . . . . 11
Exa 4.3 Reconcile the difference of energy . . . . . . 12
Exa 4.4 Calculation of fraction of hydrogen bonds which
breaks during ice melting . . . . . . . . . . 12
Exa 5.1 Calculate packing efficiency and density of di-
amond . . . . . . . . . . . . . . . . . . . . . 13
Exa 5.3 Calculate the cation to anion ratio for an ide-
ally close packed HCP crystal . . . . . . . . 14
Exa 5.4 find the size of largest sphere that can fit into
a tetrahedral void . . . . . . . . . . . . . . . 14
Exa 5.5 Find critical radius ratio for triangular coor-
dination . . . . . . . . . . . . . . . . . . . . 15
Exa 5.6 Calculate density of MgO . . . . . . . . . . 15
Exa 6.1 Find equilibrium concentration of vacancies
in metals at given temperature . . . . . . . 17
Exa 6.2 Compute the line energy of dislocation . . . 18
Exa 6.4 Calculation of down climb of crystal on heating 18

5
Exa 6.5 Calculate surface energy of copper crystal of
type 111 . . . . . . . . . . . . . . . . . . . . 19
Exa 6.6 Compute the angle at the bottom of groove
of a boundary . . . . . . . . . . . . . . . . . 20
Exa 7.1 Find degrees of freedom of a system of two
components . . . . . . . . . . . . . . . . . . 21
Exa 7.2 Find minimum number of component in sys-
tem . . . . . . . . . . . . . . . . . . . . . . 21
Exa 7.3 Calculate amount of pure water that can be
extracted from sea water . . . . . . . . . . . 22
Exa 7.5 Calculate proeutectoid ferrite and eutectoid
ferrite in 6 tenth percent steel . . . . . . . . 22
Exa 8.1 Calculate the rate at which hydrogen escapes
through the walls of the steel tank . . . . . 24
Exa 8.2 Calculate maximum time till which material
can be kept at 550 degree Celsius . . . . . . 24
Exa 8.3 Calculate minimum depth up to which post
machining is to be done . . . . . . . . . . . 25
Exa 8.4 Calculate time required to get required boron
concentration . . . . . . . . . . . . . . . . . 26
Exa 8.5 Calculate ratio of cross sectional areas . . . 27
Exa 9.1 Calculate the critical free energy of nucleation
of ice from water and critical radius . . . . . 28
Exa 9.2 Calculate the change in delta f required to
increase nucleation rate . . . . . . . . . . . 29
Exa 9.4 Calculate delta f of heterogeneous as a frac-
tion of delta f of homogeneous . . . . . . . . 30
Exa 9.6 Calculate the free energy change during re-
crystallization . . . . . . . . . . . . . . . . . 30
Exa 10.1 Estimate Youngs modulus of material . . . . 32
Exa 10.2 Calculation of stress in fibers . . . . . . . . 32
Exa 10.3 Estimate diffusion coefficient . . . . . . . . . 33
Exa 11.2 Calculate the stress required to move the dis-
location at given temperature . . . . . . . . 34
Exa 11.3 Calculate the dislocation density in copper . 35
Exa 11.4 Find the yield stress for a grain size of ASTM
9 . . . . . . . . . . . . . . . . . . . . . . . . 36
Exa 11.5 Estimate the change in yield strength . . . . 36

6
Exa 12.1 Estimate fracture strength . . . . . . . . . . 38
Exa 12.2 Estimate the brittle fracture strength at low
temperatures . . . . . . . . . . . . . . . . . 38
Exa 12.3 Estimate the temperature at which the ductil-
ity of brittle transition occurs at given strain
rates . . . . . . . . . . . . . . . . . . . . . . 39
Exa 13.2 Calculation of required quantity of magnesium 41
Exa 14.1 Calculate energy difference . . . . . . . . . . 42
Exa 14.2 Calculate conductivity of copper at 300 K . 42
Exa 14.3 Estimation of resistivity due to impurity scat-
tering of 1 percent of Nickel in copper lattice 43
Exa 15.1 Calculate intrinsic carrier density . . . . . . 44
Exa 16.1 Calculate the net magnetic moment per iron
atom in crystal . . . . . . . . . . . . . . . . 45
Exa 16.2 Comparison of saturation temperatures . . . 45
Exa 16.4 Calculation of hysteresis loss . . . . . . . . . 46
Exa 16.5 Calculation of eddy current loss at normal
voltage and frequency . . . . . . . . . . . . 47
Exa 17.1 Calculation of relative dielectric constant . . 48
Exa 17.2 Calculate the polarization of a BaTio3 crystal 48

7
Chapter 2

Equilibrium and Kinetics

Scilab code Exa 2.1 Calculate the entropy increase

1 // C a l c u l a t e t h e e n t r o p y i n c r e a s e
2 clc
3 del_h = 6.02 // Heat added i n kJ / mol
4 t_m = 273.15 // mean t e m p e r a t u r e i n k e l v i n
5 printf ( ” \n Example 2 . 1 ” )
6 del_s = del_h *1 e3 / t_m
7 printf ( ” \n I n c r e a s e i n e n t r o p y i s %. 2 f J molˆ−1 Kˆ−1
” , del_s )

Scilab code Exa 2.2 Calculation of fraction of atoms with energy equal to or great

1 // C a l c u l a t i o n o f f r a c t i o n o f atoms w i t h e n e r g y
e q u a l t o o r g r e a t e r t h a n 1eV a t t e m p e r a t u r e s
2 clc
3 E = 1 // e n e r g y i n e l e c t r o n v o l t
4 e = 1.6 e -19 // c h a r g e on e l e c t r o n
5 k = 1.38 e -23 // c o n s t a n t

8
6 t1 = 300 // t e m p e r a t u r e i n K
7 t2 = 1500 // t e m p e r a t u r e i n K
8 printf ( ” \n Example 2 . 2 ” )
9 printf ( ” \n\n P a r t A : ” )
10 n_N = exp ( -( e /( k * t1 ) ) )
11 printf ( ” \n F r a c t i o n o f atoms w i t h e n e r g y e q u a l t o o r
g r e a t e r t h a n 1eV a t t e m p e r a t u r e %d K i s %. 2 e ” ,
t1 , n_N ) // n u m e r i c a l v a l u e o f a n s w e r i n book i s 2
e −17
12 printf ( ” \n\n P a r t B : ” )
13 n_N = exp ( -( e /( k * t2 ) ) )
14 printf ( ” \n F r a c t i o n o f atoms w i t h e n e r g y e q u a l t o o r
g r e a t e r t h a n 1eV a t t e m p e r a t u r e %d K i s %. 2 e ” ,
t2 , n_N ) // n u m e r i c a l v a l u e o f a n s w e r i n book i s
4 . 3 e4

9
Chapter 3

Crystal Geometry and


Structure Determination

Scilab code Exa 3.2 Calculate effective number of lattice point in three cubic spa

1 // C a l c u l a t e e f f e c t i v e number o f l a t t i c e p o i n t i n
three cubic space l a t t i c e
2 clc
3 sc_n = 1/8 // s h a r i n g o f one l a t t i c e p o i n t i n a u n i t
cell
4 sc_N = 8 // Number o f l a t t i c e p o i n t s i n S i m p l e c u b i c
5 bcc_n_e = 1/4 // s h a r i n g o f one e d g e l a t t i c e p o i n t i n
a BCC
6 bcc_N_e = 4 // Number o f e d g e l a t t i c e p o i n t i n a BCC
7 bcc_n_c = 1 // s h a r i n g o f one body c e n t e r l a t t i c e
p o i n t i n a BCC
8 bcc_N_c = 1 // Number o f body c e n t e r l a t t i c e p o i n t i n
a BCC
9 fcc_n_e = 1/8 // s h a r i n g o f one c o r n e r l a t t i c e p o i n t
i n a FCC
10 fcc_N_e = 8 // Number o f c o r n e r l a t t i c e p o i n t i n a
FCC
11 fcc_n_f = 1/2 // s h a r i n g o f one f a c e c e n t e r l a t t i c e
p o i n t i n a FCC

10
12 fcc_N_f = 6 // Number o f f a c e c e n t e r l a t t i c e p o i n t i n
a FCC
13 printf ( ” \n Example 3 . 2 ” )
14 sc_net = sc_n * sc_N
15 bcc_net = bcc_n_e * bcc_N_e + bcc_n_c * bcc_N_c
16 fcc_net = fcc_n_e * fcc_N_e + fcc_n_f * fcc_N_f
17 printf ( ” \n E f f e c t i v e number o f l a t t i c e p o i n t s a r e a s
: ”)
18 printf ( ” \n\n S p a c e l a t t i c e \ t A b b r e v i a t i o n \ t
E f f e c t i v e number o f l a t t i c e p o i n t i n u n i t c e l l \n
”)
19 printf ( ” \n S i m p l e c u b i c \ t \ tSC \ t \ t \ t \ t %d\n Body
c e n t e r c u b i c \tBCC \ t \ t \ t \ t %d\n Face c e n t e r e d
c u b i c \tFCC \ t \ t \ t \ t %d ” , sc_net , bcc_net , fcc_net )

Scilab code Exa 3.7 Determine interplanar spacing and miller indices

1 // D e t e r m i n e I n t e r p l a n a r s p a c i n g and m i l l e r i n d i c e s
2 clc
3 a = 3.16 // l a t t i c e p a r a m e t e r i n a n g s t r o m
4 l1 = 1 // l i n e number
5 l2 = 2 // l i n e number
6 l3 = 3 // l i n e number
7 l4 = 4 // l i n e number
8 theta1 = 20.3 // a n g l e f o r l i n e 1
9 theta2 = 29.2 // a n g l e f o r l i n e 2
10 theta3 = 36.7 // a n g l e f o r l i n e 3
11 theta4 = 43.6 // a n g l e f o r l i n e 4
12 n = 1 // o r d e r
13 lambda = 1.54 // w a v e l e n g t h i n a n g s t r o m
14 printf ( ” \n Example 3 . 7 ” )
15 d1 = lambda /(2* sin ( theta1 * %pi /180) )
16 d2 = lambda /(2* sin ( theta2 * %pi /180) )

11
17 d3 = lambda /(2* sin ( theta3 * %pi /180) )
18 d4 = lambda /(2* sin ( theta4 * %pi /180) )
19 x1 = a ^2/ d1 ^2
20 x2 = a ^2/ d2 ^2
21 x3 = a ^2/ d3 ^2
22 x4 = a ^2/ d4 ^2 // where x i s f u n c t i o n o f h , k and l
23 printf ( ” \n I n t e r p l a n a r s p a c i n g i s %. 3 f a n g s t r o m ” ,
x1 ) // a n s w e r i n book i s 2 . 2 2 0 a n g s t r o m
24 if floor ( x1 ) == 2 then
25 printf ( ” \n\n For a ˆ2/ d ˆ2 = %d \ t R e f l e c t i o n
p l a n e i s { 1 1 0 } ” , x1 )
26 end
27
28 if floor ( x2 ) == 4 then
29 printf ( ” \n For a ˆ2/ d ˆ2 = %d \ t R e f l e c t i o n
p l a n e i s { 2 0 0 } ” , x2 )
30 end
31
32 if floor ( x3 ) == 6 then
33 printf ( ” \n For a ˆ2/ d ˆ2 = %d \ t R e f l e c t i o n plane
i s { 2 1 1 } ” , x3 )
34 end
35
36 if floor ( x4 ) == 8 then
37 printf ( ” \n For a ˆ2/ d ˆ2 = %d \ t R e f l e c t i o n plane
i s { 2 2 0 } ” , x4 )
38 end

Scilab code Exa 3.8 Determine structure and lattice parameter of material

1 // D e t e r m i n e s t r u c t u r e and l a t t i c e p a r a m e t e r o f
material
2 clc

12
3 d = 114.6 // d i a m e t e r o f power camera i n a n g s t r o m
4 lambda = 1.54 // w a v e l e n g t h i n a n g s t r o m
5 s1 = 86
6 s2 = 100
7 s3 = 148
8 s4 = 180
9 s5 = 188
10 s6 = 232
11 s7 = 272
12 printf ( ” \n Example 3 . 8 ” )
13 R = d /2 // R a d i u s
14 if R ==57.3 then
15 k = 1/4 // Bragg a n g l e f a c t o r
16 end
17 a1 = ( sin ( s1 * k * %pi /180) ) ^2
18 a2 = ( sin ( s2 * k * %pi /180) ) ^2
19 a3 = ( sin ( s3 * k * %pi /180) ) ^2
20 a4 = ( sin ( s4 * k * %pi /180) ) ^2
21 a5 = ( sin ( s5 * k * %pi /180) ) ^2
22 a6 = ( sin ( s6 * k * %pi /180) ) ^2
23 a7 = ( sin ( s7 * k * %pi /180) ) ^2
24 c = 22 // c o n s t a n t t o c o n v e r t i n t o i n t e g r a l number
25
26 printf ( ” \n Within e x p e r i m e n t a l e r r o r , v a l u e s a r e a s
i n i n t e g r a l r a t i o a r e a s : \n %d : %d : %d : %d : %d : %d : %d
” , ceil ( c * a1 ) , ceil ( c * a2 ) , ceil ( c * a3 ) , ceil ( c * a4 ) ,
ceil ( c * a5 ) , ceil ( c * a6 ) , ceil ( c * a7 ) )
27 printf ( ” \n So , t h i s s t r u c t u r e i s FCC and m a t e r i a l i s
copper with 3 . 6 2 angstrom l a t t i c e parameter ”)

13
Chapter 4

Atomic Structure and Chemical


Bonding

Scilab code Exa 4.1 Calculate frequency and wavelength of radiation

1 // C a l c u l a t e f r e q u e n c y and w a v e l e n g t h o f r a d i a t i o n
2 clc
3 E = 1.64 e -18 // e n e r g y d i f f e r e n c e b e t w e e n two s t a t e s
in J
4 h = 6.626 e -34 // p l a n k s c o n s t a n t
5 c = 2.998 e8 // s p e e d o f l i g h t i n m/ s
6 printf ( ” \n Example 4 . 1 ” )
7 nu = E / h
8 lambda = c / nu
9 printf ( ” \n F r e q u e n c y o f e m i t t e d r a d i a t i o n i s %. 2 e Hz
” , nu )
10 printf ( ” \n Wavelength o f e m i t t e d r a d i a t i o n i s %. 2 e m
\n\ t \ t o r \ t \ t %d a n g s t r o m ” , lambda , lambda *1 e10 ) //
a n s w e r i n book i s 1 2 1 0 a n g s t r o m

14
Scilab code Exa 4.3 Reconcile the difference of energy

1 // R e c o n c i l e t h e d i f f e r e n c e o f e n e r g y
2 clc
3 e_a = 713 // e n t h a l p y o f a t o m i z a t i o n i n kJ / mol
4 e_b = 347 // bond e n e r g y i n kJ / mol
5 a = 4 // t o t a l number o f atoms i n s i n g l e c r y s t a l
structure
6 b = 2 // number o f atoms i n a bond
7 printf ( ” \n Example 4 . 3 ” )
8 k = a / b // e f f e c t i v e number o f bond p e r atom
9 e = k * e_b
10 printf ( ” \n %d kJ s h o u l d be t h e e n t h a l p y o f
a t o m i z a t i o n o f diamond ” , e )
11 printf ( ” \n However , %d kJ i s v e r y c l o s e t o %d kJ ” ,e ,
e_a )

Scilab code Exa 4.4 Calculation of fraction of hydrogen bonds which breaks during

1 // C a l c u l a t i o n o f f r a c t i o n o f h y d r o g e n bonds which
breaks during i c e melting
2 clc
3 del_h = 6.02 // e n t h a l p y o f f u s i o n i n kJ / mol
4 n = 2 // number o f h y d r o g e n atom i n 1 w a t e r atom
5 del_b = 20.5 // h y d r o g e n bond e n e r g y i n kJ / mol
6 printf ( ” \n Example 4 . 4 ” )
7 f = del_h /( n * del_b )
8 printf ( ” \n F r a c t i o n o f h y d r o g e n bonds which b r o k e n
i s %. 2 f ” ,f )

15
Chapter 5

Structure of Solid

Scilab code Exa 5.1 Calculate packing efficiency and density of diamond

1 // C a l c u l a t e p a c k i n g e f f i c i e n c y and d e n s i t y o f
diamond
2 clc
3 n_c = 1/8 // s h a r i n g o f c o r n e r atom i n a u n i t c e l l
4 N_c = 8 // Number o f c o r n e r atoms i n u n i t c e l l
5 n_b = 1 // s h a r i n g o f body c e n t e r e d atom i n a u n i t
cell
6 N_b = 4 // Number o f body c e n t e r e d atoms i n u n i t
cell
7 n_f = 0.5 // s h a r i n g o f f a c e c e n t e r e d atom i n a u n i t
cell
8 N_f = 6 // Number o f f a c e c e n t e r e d atoms i n u n i t c e l l
9 a = 1 // l e t l a t t i c e p a r a m e t e r
10 m = 12 // mass o f c a r b o n
11 printf ( ” \n Example 5 . 1 ” )
12 printf ( ” \n P a r t A : ” )
13 N = n_c * N_c + n_b * N_b + n_f * N_f // e f f e c t i v e number o f
atoms
14 r = a * sqrt (3) /8
15 p_e = N *4/3* %pi * r ^3/ a ^3 // p a c k i n g e f f i c i e n c y
16

16
17 printf ( ” \n P a c k i n g e f f i c i e n c y o f diamond i s %. 2 f ” ,
p_e )
18 printf ( ” \n\n P a r t B : ” )
19 a = 3.57 // l a t t i c e p a r a m e t e r i n angstrom
20 d = m *1.66 e -27* N /( a *1 e -10) ^3
21 printf ( ” \n D e n s i t y o f diamond i s %d Kg/mˆ3 ” ,d ) //
n u m e r i c a l a n s w e r i n book i s 3500
22 printf ( ” \n D e n s i t y o f diamond i s %. 1 f g /cmˆ3 ” ,d
/1000)

Scilab code Exa 5.3 Calculate the cation to anion ratio for an ideally close packe

1 // c a l c u l a t e t h e c / a r a t i o f o r an i d e a l l y c l o s e
p a c k e d HCP c r y s t a l
2 clc
3 a = 1 // l e t
4 PR = a
5 printf ( ” \ Example 5 . 3 ” )
6 RT = a / sqrt (3)
7 PT = sqrt ( PR ^2 - RT ^2)
8 c_a = 2* PT / PR
9 // C a l c u l a t i o n s a r e made on t h e c r y s t a l s t r u c t u r e
drawn i n book
10 printf ( ” \n c / a r a t i o f o r an i d e a l l y c l o s e p a c k e d HCP
c r y s t a l i s %0 . 3 f ” , c_a )

Scilab code Exa 5.4 find the size of largest sphere that can fit into a tetrahedra

17
1 // f i n d t h e s i z e o f l a r g e s t s p h e r e t h a t can f i t i n t o
a t e t r a h e d r a l void
2 clc
3 r = 1 // l e t
4 a = 3/4
5 printf ( ” \n Example 5 . 4 ” )
6 pt = 2* sqrt (2/3) * r
7 s = a * pt - r // s i z e o f s p h e r e
8 printf ( ” \n S i z e o f l a r g e s t s p h e r e t h a t can f i t i n t o
a t e t r a h e d r a l v o i d i s %. 3 f r ” ,s )

Scilab code Exa 5.5 Find critical radius ratio for triangular coordination

1 // f i n d c r i t i c a l r a d i u s r a t i o f o r t r i a n g u l a r
coordination
2 clc
3 theta = 60 // a n g l e i n d e g r e e
4 printf ( ” \n Example 5 . 5 ” )
5 r_c_a = (2/3*2* sin ( theta * %pi /180) ) -1 // r a t i o
calculation
6 printf ( ” \n C r i t i c a l r a d i u s r a t i o f o r t r i a n g u l a r
c o o r d i n a t i o n i s %0 . 3 f ” , r_c_a )

Scilab code Exa 5.6 Calculate density of MgO

1 // C a l c u l a t e d e n s i t y o f MgO
2 clc
3 r_mg = 0.78 // r a d i u s o f magnesium c a t i o n in
angstrom

18
4 r_o = 1.32 // r a d i u s o f o x y g e n a n i o n i n a n g s t r o m
5 n = 4 // e f f e c t i v e number o f u n i t c e l l
6 m_o = 16 // mass o f o x y g e n
7 m_mg = 24.3 // mass o f magnesium
8 printf ( ” \n Example 5 . 6 ” )
9 a = 2*( r_mg + r_o ) // l a t t i c e p a r a m e t e r
10 d = ( m_o + m_mg ) *1.66 e -27* n /( a *1 e -10) ^3 // d e n s i t y
11 printf ( ” \n D e n s i t y o f MgO i s %d Kg/mˆ3 ” ,d ) // a n s w e r
i s 3 6 1 0 kg /mˆ3
12 printf ( ” \n D e n s i t y o f MgO i s %0 . 2 f g /cmˆ3 ” ,d /1000)

19
Chapter 6

Crystal Imperfection

Scilab code Exa 6.1 Find equilibrium concentration of vacancies in metals at given

1 // Find e q u i l i b r i u m c o n c e n t r a t i o n o f v a c a n c i e s i n
metals at given temperature
2 clc
3 t1 = 0 // t e m p e r a t u r e i n k e l v i n
4 t2 = 300 // t e m p e r a t u r e i n k e l v i n
5 t3 = 900 // t e m p e r a t u r e i n k e l v i n
6 R = 8.314 // u n i v e r s a l g a s c o n s t a n t
7 del_hf_al = 68 // E n t h a l p y o f f o r m a t i o n o f aluminium
c r y s t a l i n KJ
8 del_hf_ni = 168 // E n t h a l p y o f f o r m a t i o n o f n i c k e l
c r y s t a l i n KJ
9 printf ( ” \n Example 6 . 1 ” )
10
11 printf ( ” \n E q u i l i b r i u m c o n c e n t r a t i o n of vacancies of
aluminium a t %dK i s 0 ” , t1 )
12 n_N = exp ( - del_hf_al *1 e3 /( R * t2 ) )
13 printf ( ” \n E q u i l i b r i u m c o n c e n t r a t i o n of vacancies of
aluminium a t %dK i s %. 2 e ” ,t2 , n_N ) // a n s w e r i n
book i s 1 . 4 5 e −12
14 n_N = exp ( - del_hf_al *1 e3 /( R * t3 ) )
15 printf ( ” \n E q u i l i b r i u m c o n c e n t r a t i o n of vacancies of

20
aluminium a t %dK i s %. 2 e ” ,t3 , n_N ) // a n s w e r i n
book i s 1 . 1 2 e −4
16
17 printf ( ” \n\n E q u i l i b r i u m c o n c e n t r a t i o n o f v a c a n c i e s
o f N i c k e l a t %dK i s 0 ” , t1 )
18 n_N = exp ( - del_hf_ni *1 e3 /( R * t2 ) )
19 printf ( ” \n E q u i l i b r i u m c o n c e n t r a t i o n o f v a c a n c i e s o f
N i c k e l a t %dK i s %. 2 e ” ,t2 , n_N )
20 n_N = exp ( - del_hf_ni *1 e3 /( R * t3 ) )
21 printf ( ” \n E q u i l i b r i u m c o n c e n t r a t i o n o f v a c a n c i e s o f
N i c k e l a t %dK i s %. 2 e ” ,t3 , n_N ) // a n s w e r i n book
i s 1 . 7 8 e −10

Scilab code Exa 6.2 Compute the line energy of dislocation

1 // Compute t h e l i n e e n e r g y o f d i s l o c a t i o n
2 clc
3 a = 2.87 // l a t t i c e p a r a m e t e r i n a n g s t r o m
4 b = 2.49 // m a g n i t u d e o f b u r g e r s v e c t o r i n a n g s t r o m
5 G = 80.2 // s h e a r modulus i n GN
6 printf ( ” \n Example 6 . 2 ” )
7 E = G *1 e9 *( b *1 e -10) ^2*1/2
8 printf ( ” \n L i n e e n e r g y o f d i s l o c a t i o n i s %. 2 e J mˆ−1
” ,E )

Scilab code Exa 6.4 Calculation of down climb of crystal on heating

1 // c a l c u l a t i o n o f down c l i m b o f c r y s t a l on h e a t i n g
2 clc

21
3 a = 1 e10 // t o t a l number o f e d g e d i s l o c a t i o n
4 N = 6.023 e23 // Avogadro number
5 R = 8.314 // U n i v e r s a l g a s c o n s t a n t
6 t1 = 0 // i n i t i a l t e m p e r a t u r e i n K
7 t2 = 1000 // F i n a l t e m p e r a t u r e i n K
8 del_hf = 100 // E n t h a l p y o f v a c a n c y f o r m a t i o n i n KJ
9 d = 2 // l e n g t h o f one s t e p i n a n g s t r o m
10 v = 5.5 e -6 // volume o f one mole c r y s t a l
11 printf ( ” \n Example 6 . 4 ” )
12 n = N * exp ( -( del_hf *1 e3 ) /( R *( t2 - t1 ) ) ) / v
13 k = 1/( d *1 e -10) // atoms r e q u i r e d f o r 1 m c l i m b
14 b = n /( k * a ) // a v e r a g e amount o f c l i m b
15 c = b * d *1 e -10
16
17 printf ( ” \n A v e r a g e down c l i m b o f c r y s t a l i s %. 2 em” ,c
)

Scilab code Exa 6.5 Calculate surface energy of copper crystal of type 111

1 // C a l c u l a t e s u r f a c e e n e r g y o f c o p p e r c r y s t a l o f
type {111}
2 clc
3 E = 56.4 // bond e n e r g y i n KJ
4 N_a = 6.023 e23 // A v o g a d r o s number
5 n = 12 // number o f bonds
6 m = 3 // number o f b r o k e n bonds
7 N = 1.77 e19 // number o f atoms i n c o p p e r c r y s t a l o f
t y p e { 1 1 1 } p e r mˆ2
8 printf ( ” \n Example 6 . 5 ” )
9 b_e = 1/2* E *1 e3 * n / N_a // bond e n e r g y p e r atom
10 e_b = b_e * m / n // e n e r g y o f b r o k e n bond a t s u r f a c e
11 s_e = e_b * N // s u r f a c e e n t h a l p y o f c o p p e r
12 printf ( ” \n S u r f a c e e n t h a l p y o f c o p p e r i s %0 . 2 f J m

22
ˆ−2” , s_e )
13 printf ( ” \n S u r f a c e e n t h a l p y o f c o p p e r i s %d e r g cm
ˆ−2” , s_e *1 e3 )
14 // Answer i n book i s 2 4 9 0 e r g cmˆ−2

Scilab code Exa 6.6 Compute the angle at the bottom of groove of a boundary

1 // Compute t h e a n g l e a t t h e bottom o f g r o o v e o f a
boundary
2 clc
3 Gamma_gb = 1 // l e t , e n e r g y o f g r a i n boundary
4 Gamma_s = 3* Gamma_gb // e n e r g y o f f r e e s u r f a c e
5 printf ( ” \n Example 6 . 6 ” )
6 theta = 2* acos (1/2* Gamma_gb / Gamma_s )
7 printf ( ” \n A n g l e a t t h e bottom o f g r o o v e o f a
boundary i s %d d e g r e e s . ” , ceil ( theta *180/ %pi ) )

23
Chapter 7

Phase Diagram

Scilab code Exa 7.1 Find degrees of freedom of a system of two components

1 // Find d e g r e e s o f f r e e d o m o f a s y s t e m o f two
c o m p o n e n ts
2 clc
3 c = 2 // number o f c o m p o n e n t s
4 printf ( ” \n Example 7 . 1 ” )
5 for n = 1:4
6 p = (c -1) +2 // T o t a l v a r i a b l e s
7 f = c - n +2 // d e g r e e o f f r e e d o m
8 printf ( ” \n\n D e g r e e o f f r e e d o m f o r two
c o m p o n e n ts when \n number o f p h a s e s i s %d i s
%d” ,n , f )
9 end

Scilab code Exa 7.2 Find minimum number of component in system

1 // Find minimum number o f component i n s y s t e m


2 clc

24
3 p = 4 // number o f p h a s e s o f s y s t e m
4 f = 0 // number o f d e g r e e o f s y s t e m
5
6 printf ( ” \n Example 7 . 2 ” )
7 C = f +p -1 // c o m p o n e n ts number
8 printf ( ” \n Minimum number o f c o m p o n e n t s i n s y s t e m is
%d” ,C )

Scilab code Exa 7.3 Calculate amount of pure water that can be extracted from sea

1 // C a l c u l a t e amount o f p u r e w a t e r t h a t can be
e x t r a c t e d from s e a w a t e r
2 clc
3 L = 23.3 // % c o m p o s i t i o n o f L
4 a = 3.5 // c o n c e n t r a t i o n o f N a c l i n s e a w a t e r
5 ice = 0 // % c o m p o s i t i o n o f i c e
6 printf ( ” \n Example 7 . 3 ” )
7 f_ice = (L - a ) /( L - ice )
8 printf ( ” \n F r a c t i o n a l amount o f p u r e w a t e r t h a t can
be e x t r a c t e d from s e a w a t e r i s %0 . 2 f ” , f_ice )

Scilab code Exa 7.5 Calculate proeutectoid ferrite and eutectoid ferrite in 6 tent

1 // C a l c u l a t e p r o e u t e c t o i d f e r r i t e and e u t e c t o i d
f e r r i t e i n 0 . 6% s t e e l
2 clc
3 a = 0 // l i m i t i n g v a l u e
4 b = 0.8 // l i m i t i n g v a l u e
5 c = 0.6 // p e r c e n t a g e c o m p o s i t i o n o f c a r b o n

25
6 f = 0.88 // f r a c t i o n o f f e r r i t e i n a e u t e c t o i d steel
7 printf ( ” \n Example 7 . 5 ” )
8 f_pro_alpha = (b - c ) /( b - a )
9 f_perlite = 1 - f_pro_alpha
10 f_eut = f * f_perlite
11 printf ( ” \n C o m p o s i t i o n o f p r o e u t e c t o i d f e r r i t e i s %0
. 2 f ” , f_pro_alpha )
12 printf ( ” \n C o m p o s i t i o n o f e u t e c t o i d f e r r i t e i s %0 . 2 f
” , f_eut )

26
Chapter 8

Diffusion in Solids

Scilab code Exa 8.1 Calculate the rate at which hydrogen escapes through the walls

1 // c a l c u l a t e t h e r a t e a t which h y d r o g e n e s c a p e s
through the w a l l s o f the s t e e l tank
2 clc
3 t = 5 // t h i c k n e s s i n mm
4 c = 10 // c o n c e n t r a t i o n
5 D = 1e -9 // d i f f u s i o n c o e f f i c i e n t
6 printf ( ” \n Example 8 . 1 ” )
7 j = D * c /( t *1 e -3)
8 printf ( ” \n Outward f l u x i s %. 0 e kg mˆ−2 s ˆ−1” ,j )

Scilab code Exa 8.2 Calculate maximum time till which material can be kept at 550

1 // C a l c u l a t e maximum t i m e t i l l which m a t e r i a l can be


k e p t a t 550 d e g r e e C e l s i u s
2 clc
3 D_0 = 0.24 e -4 // d i f f u s i o n c o e f f i c i e n t
4 Q = 121 e3

27
5 R = 8.314 // U n i v e r s a l g a s c o n s t a n t
6 T = 550 // t e m p e r a t u r e i n C e l s i u s
7 k = 0.2 // t h i c k n e s s o f p u r e Al s h e e t i n mm
8 d = 0.1 // p e n e t r a t i o n d e p t h i n mm
9 c_x = 0.4 // c o n c e n t r a t i o n i n p e r c e n t a g e
10 A = 2 // C o n s t a n t i n p e r c e n t a g e
11 B = 2 // C o n s t a n t i n p e r c e n t a g e
12 printf ( ” \n Example 8 . 2 ” )
13 x = d-k
14 D_cu_al = D_0 * exp ( - Q /( R *( T +273) ) )
15 k = (A - c_x ) / B
16 if k ==0.8 then
17 z = 0.9 // from t a b l e
18 end
19 t = ( x *1 e -3) ^2/( z ^2*4* D_cu_al ) // t i m e i n s e c
20
21 printf ( ” \n M a t e r i a l can be k e p t a t %d d e g r e e C e l s i u s
f o r n e a r l y %d m i n u t e ” ,T , t /60) // a n s w e r i n book
i s 100 min

Scilab code Exa 8.3 Calculate minimum depth up to which post machining is to be do

1 // C a l c u l a t e minimum d e p t h up t o which p o s t
m a c h i n i n g i s t o be done
2 clc
3 D_0 = 0.7 e -4 // d i f f u s i o n c o e f f i c i e n t
4 Q = 157 // Energy i n kJ mol ˆ −1 , c o n s i d e r e d from
table 8.2
5 R = 8.314 // U n i v e r s a l g a s c o n s t a n t
6 T = 950 // t e m p e r a t u r e i n C e l s i u s
7 c2 = 0.8 // c o n c e n t r a t i o n i n p e r c e n t a g e
8 cs = 0 // c o n c e n t r a t i o n i n p e r c e n t a g e
9 c_x = 0.6 // c o n c e n t r a t i o n i n p e r c e n t a g e

28
10 t = 4 // t i m e i n h o u r s
11 a = 1 // l e t
12 printf ( ” \n Example 8 . 3 ” )
13 A = cs
14 B = c2 - cs
15 D = D_0 * exp ( - Q *1 e3 /( R *( T +273) ) )
16 k = erf ((( A - c_x ) / B ) ) * -1
17 if k >0.7 then
18 if k <0.712 then
19 z = 0.81 // from t a b l e
20 end
21
22 end
23 x = z *2* sqrt ( D * t *3600)
24
25 printf ( ” \n Depth up t o which m a c h i n i n g i s r e q u i r e d
i s n e a r l y %. 2 f mm” ,x *1 e3 )
26 // n u m e r i c a l v a l u e o f a n s w e r i n book i s 0 . 7 5

Scilab code Exa 8.4 Calculate time required to get required boron concentration

1 // C a l c u l a t e t i m e r e q u i r e d t o g e t r e q u i r e d b o r o n
concentration
2 clc
3 D = 4e -17 // d i f f u s i o n c o e f f i c i e n t
4 c1 = 0
5 cs = 3 e26
6 c_x = 1 e23 // number o f atoms
7 x = 2e -6 // d e p t h i n m
8 printf ( ” \n Example 8 . 4 ” )
9 A = cs
10 B = cs - c1
11 k = (A - c_x ) / B

29
12 if k >0.99966 then
13 if k < 0.9997 then
14 z = 2.55 // from t a b l e
15 end
16 end
17 t = x ^2/( z ^2*4* D ) // t i m e i n s e c
18
19 printf ( ” \n Time r e q u i r e d t o g e t r e q u i r e d boron
c o n c e n t r a t i o n i s %d s e c ” ,t ) // a n s w e r i n book i s
3845 s e c

Scilab code Exa 8.5 Calculate ratio of cross sectional areas

1 // C a l c u l a t e r a t i o o f c r o s s s e c t i o n a l a r e a s
2 clc
3 r = 10 // r a d i u s i n mm
4 t = 4 // t h i c k n e s s i n a n g s t r o m
5 printf ( ” \n Example 8 . 5 ” )
6 r = 2* %pi * r *1 e -3* t *1 e -10/( %pi *( r *1 e -3) ^2)
7 printf ( ” \n R a t i o o f c r o s s s e c t i o n a l a r e a s i s %. 0 e ” ,
r)

30
Chapter 9

Phase Transformation

Scilab code Exa 9.1 Calculate the critical free energy of nucleation of ice from w

1 // C a l c u l a t e t h e c r i t i c a l f r e e e n e r g y o f n u c l e a t i o n
o f i c e from w a t e r and c r i t i c a l r a d i u s
2 clc
3 del_t1 = 0 // t e m p e r a t u r e d i f f e r e n c e i n d e g r e e
Celsius
4 del_t2 = -5 // t e m p e r a t u r e d i f f e r e n c e i n d e g r e e
Celsius
5 del_t3 = -40 // t e m p e r a t u r e d i f f e r e n c e i n d e g r e e
Celsius
6 del_h = 6.02 // e n t h a l p y o f f u s i o n i n kJ / mol
7 T_m = 273 // mean t e m p e r a t u r e
8 Gamma = 0.076 // e n e r g y o f i c e w a t e r i n t e r f a c e i n J
/mˆ2
9 v = 19 // m o l a r volume o f i c e
10 printf ( ” \n Example 9 . 1 ” )
11 printf ( ” \n P a r t A” )
12 printf ( ” \n At d e l t = %d , t h e r e i s no s u p e r c o o l i n g .
So t h e r e i s no c r i t i c a l r a d i u s ” , del_t1 )
13 printf ( ” \n\n P a r t B” )
14 del_f = 16/3* %pi *( Gamma ) ^3* T_m ^2/(( del_h *1 e3 *1 e6 / v )
^2* del_t2 ^2)

31
15 r = 2* T_m * Gamma /( - del_h *1 e3 *1 e6 / v * del_t2 )
16 printf ( ” \n C r i t i c a l f r e e e n e r g y o f n u c l e a t i o n i s %. 1
eJ ” , del_f )
17 printf ( ” \n C r i t i c a l r a d i u s i s %d a n g s t r o m ” , ceil ( r *1
e10 ) )
18 printf ( ” \n\n P a r t C” )
19 temp_r = del_t3 / del_t2
20 del_f_ = del_f / temp_r ^2
21 r_ = r / temp_r
22
23 printf ( ” \n C r i t i c a l f r e e e n e r g y o f n u c l e a t i o n i s %
. 1 eJ ” , del_f_ )
24 printf ( ” \n C r i t i c a l r a d i u s i s %d a n g s t r o m . ” , ceil ( r_
*1 e10 ) )

Scilab code Exa 9.2 Calculate the change in delta f required to increase nucleatio

1 // C a l c u l a t e t h e c h a n g e i n d e l f r e q u i r e d t o
increase nucleation rate
2 clc
3 T = 300 // t e m p e r a t u r e i n k e l v i n
4 R = 8.314 // u n i v e r s a l g a s c o n s t a n t
5 k = 2.303 // c o n v e r s i o n f a c t o r
6 a1 = 1 e42
7 a2 = 1 e6 // n u c l e a t i o n r a t e
8 a3 = 1 e10 // n u c l e a t i o n r a t e
9 printf ( ” Example 9 . 2 ” )
10 I1 = ( log10 ( a1 ) - log10 ( a2 ) ) * k * R * T // e x p o n e n t f a c t o r
11 I2 = ( log10 ( a1 ) - log10 ( a3 ) ) * k * R * T // e x p o n e n t f a c t o r
12 del_f = I1 - I2 // d i f f e r e n c e
13 a = 10^( log10 ( a3 ) - log10 ( a2 ) )
14
15 printf ( ” \n A c h a n g e o f %d KJ molˆ−1 e n e r g y i s

32
r e q u i r e d t o i n c r e a s e n u c l e a t i o n f a c t o r from \n %
. 0 e mˆ−3 s ˆ−1 t o %. 0 e mˆ−3 s ˆ−1 ” , ceil ( del_f /1
e3 ) ,a , a3 )

Scilab code Exa 9.4 Calculate delta f of heterogeneous as a fraction of delta f of

1 // C a l c u l a t e d e l f h e t a s a f r a c t i o n o f d e l f h o m o
2 clc
3 Gamma_alpha_del = 0.5 // i n J mˆ−2
4 Gamma_alpha_beta = 0.5 // i n J mˆ−2
5 Gamma_beta_del = 0.01 // i n J mˆ−2
6
7 printf ( ” \n Example 9 . 4 ” )
8 theta = acos (( Gamma_alpha_del - Gamma_beta_del ) /
Gamma_alpha_beta )
9 del_f_ratio = 1/4*(2 -3* cos ( theta ) +( cos ( theta ) ) ^3)
10
11
12 printf ( ” \n d e l f h e t i s %0 . 4 f t h f r a c t i o n o f
d e l f h o m o . ” , del_f_ratio )

Scilab code Exa 9.6 Calculate the free energy change during recrystallization

1 // C a l c u l a t e t h e f r e e e n e r g y c h a n g e d u r i n g
recrystallization
2 clc
3 mu = 45.5 e9
4 b = 2.55 e -10
5 n1 = 1 e9 // i n i t i a l d i s l o c a t i o n d e n s i t y

33
6 n2 = 1 e13 // f i n a l d i s l o c a t i o n d e n s i t y
7 printf ( ” \n Example 9 . 6 ” )
8 E = 1/2* mu * b ^2* n2
9 del_g = E // a s d i f f e r e n c e b e t w e e n i n i t i a l and f i n a l
d i s l o c a t i o n energy i s f o u r o r d e r magnitude
10 printf ( ” \n F r e e e n e r g y c h a n g e d u r i n g
r e c r y s t a l l i z a t i o n i s %d J mˆ−3” ,- del_g )
11 // N u m e r i c a l v a l u e o f a n s w e r i n book i s 1 4 8 0 0

34
Chapter 10

Elastic Anelastic and


Viscoelastic Behaviour

Scilab code Exa 10.1 Estimate Youngs modulus of material

1 // E s t i m a t e y o u n g s modulus o f m a t e r i a l
2 clc
3 n = 1
4 m = 9
5 A = 7.68 e -29 // C o n s t a n t h a v i n g u n i t J m
6 r_0 = 2.5 e -10 // b o n d i n g d i s t a n c e i n m
7 printf ( ” \n Example 1 0 . 1 ” )
8 B = A * r_0 ^8/9
9
10 Y = (90* B /( r_0 ) ^11 -2* A /( r_0 ) ^3) / r_0
11
12 printf ( ” \n Y o u n g s modulus o f m a t e r i a l i s %d GN m
ˆ−2” ,Y /1 e9 )

35
Scilab code Exa 10.2 Calculation of stress in fibers

1 // C a l c u l a t i o n o f s t r e s s i n f i b e r s
2 clc
3 Y_f = 440
4 Y_m = 71
5 sigma_total = 100 // t o t a l l o a d
6 printf ( ” \n Example 1 0 . 2 ” )
7 r = Y_f / Y_m
8 sigma_f = r *( sigma_total /0.7) /(1+ r *3/7)
9 printf ( ” \n P a r t A : ” )
10 printf ( ” \n When l o a d i s a p p l i e d p a r a l l e l t o f i b e r
then , s t r e s s i n f i b e r i s %d MN mˆ−2” , sigma_f )
11
12 printf ( ” \n\n P a r t B : ” )
13 printf ( ” \n When l o a d i s a p p l i e d p e r p e n d i c u l a r t o
f i b e r then , s t r e s s i n f i b e r and m a t r i x i s same i .
e . %d MN mˆ−2” , sigma_total )

Scilab code Exa 10.3 Estimate diffusion coefficient

1 // E s t i m a t e d i f f u s i o n c o e f f i c i e n t
2 clc
3 t_r = 100 // r e l a x a t i o n t i m e i n s
4 d = 2.5 // d i s t a n c e i n a n g s t r o m
5 printf ( ” \n Example 1 0 . 3 ” )
6 f = 1/ t_r // jump f r e q u e n c y
7 D = ( d *1 e -10) ^2* f
8 printf ( ” \n D i f f u s i o n c o e f f i c i e n t i s %. 2 e mˆ2 s ˆ−1” ,D
)

36
Chapter 11

Plastic Deformation and Creep


in Crystalline Materials

Scilab code Exa 11.2 Calculate the stress required to move the dislocation at give

1 // C a l c u l a t e t h e s t r e s s r e q u i r e d t o move t h e
d i s l o c a t i o n at given temperature
2 clc
3 b = 2 // b u r g e r v e c t o r i n a n g s t r o m
4 v = 20* b ^3 // a c t i v a t i o n volume
5 tau_pn = 1000 // P−N s t r e s s o f c r y s t a l i n MNmˆ−2
6 k = 1.38 e -23 // p h y s i c a l c o n s t a n t
7 t1 = 0 // t e m p e r a t u r e i n K
8 t2 = 100 // t e m p e r a t u r e i n K
9 t3 = 300 // t e m p e r a t u r e i n K
10 t4 = 500 // t e m p e r a t u r e i n K
11 printf ( ” \n Example 1 1 . 2 ” )
12 printf ( ” \n\n P a r t A : ” )
13 T = t1
14 tau_app = tau_pn - 40* k * T /( v *1 e -30)
15 printf ( ” \n The s t r e s s r e q u i r e d t o move t h e
d i s l o c a t i o n a t t e m p e r a t u r e %dK i s %d MNmˆ−2” ,T ,
tau_app )
16 printf ( ” \n\n P a r t B : ” )

37
17 T = t2
18 tau_app = tau_pn - 40* k * T /( v *1 e -30*1 e6 )
19 printf ( ” \n The s t r e s s r e q u i r e d t o move t h e
d i s l o c a t i o n a t t e m p e r a t u r e %dK i s %d MNmˆ−2” ,T ,
tau_app )
20 printf ( ” \n\n P a r t C : ” )
21 T = t3
22 tau_app = tau_pn - 40* k * T /( v *1 e -30*1 e6 )
23 if tau_app <0 then
24 printf ( ” \n S t r e s s t o be a p p l i e d i s z e r o ” )
25 printf ( ” \n The s t r e s s r e q u i r e d t o move t h e
d i s l o c a t i o n a t t e m p e r a t u r e %dK e n t i r e l y
o v e r c o m e by t h e r m a l f l u c t u a t i o n s ” , T )
26 end
27 printf ( ” \n\n P a r t D : ” )
28 T = t4
29 tau_app = tau_pn - 40* k * T /( v *1 e -30*1 e6 )
30 if tau_app <0 then
31 printf ( ” \n S t r e s s t o be a p p l i e d i s z e r o ” )
32 printf ( ” \n The s t r e s s r e q u i r e d t o move t h e
d i s l o c a t i o n a t t e m p e r a t u r e %dK e n t i r e l y
o v e r c o m e by t h e r m a l f l u c t u a t i o n s ” , T )
33 end

Scilab code Exa 11.3 Calculate the dislocation density in copper

1 // C a l c u l a t e t h e d i s l o c a t i o n d e n s i t y i n c o p p e r
2 clc
3 mu = 44 // s h e a r modulus o f c o p p e r i n GN mˆ−2
4 b = 2.55 // b u r g e r s v e c t o r i n a n g s t r o m
5 tau = 35 // s h e a r s t r e s s i n MN mˆ−2
6 printf ( ” Example 1 1 . 3 ” )
7 l = mu *1 e9 * b *1 e -10/( tau *1 e6 )

38
8 rho = 1/ l ^2
9
10 printf ( ” \n D i s l o c a t i o n d e n s i t y i n c o p p e r i s %. 1 e m
ˆ−2” , rho )
11 // Answer i n book i s 1 e 1 2 mˆ−2

Scilab code Exa 11.4 Find the yield stress for a grain size of ASTM 9

1 // Find t h e y i e l d s t r e s s f o r a g r a i n s i z e o f ASTM 9
2 clc
3 sigma1 = 120 // i n i t i a l y i e l d s t r e n g t h o f m a t e r i a l
i n MNmˆ−2
4 sigma2 = 220 // F i n a l y i e l d s t r e n g t h o f m a t e r i a l i n
MN mˆ−2
5 d1 = 0.04 // i n i t i a l d i a m e t e r i n mm
6 d2 = 0.01 // f i n a l d i a m e t e r i n mm
7 n = 9 // astm number
8 printf ( ” Example 1 1 . 4 ” )
9 k = ( sigma2 - sigma1 ) *1 e6 /(1/ sqrt ( d2 *1 e -3) -1/ sqrt ( d1 *1
e -3) )
10 sigma_i = sigma1 *1 e6 -k / sqrt (( d1 *1 e -3) )
11 d = 1/ sqrt (2^( n -1) *1 e4 /645)
12 sigma_y = sigma_i + k *( d *1 e -3) ^( -0.5)
13
14 printf ( ” \n Y i e l d s t r e s s f o r a g r a i n s i z e o f ASTM 9
i s %d MN mˆ−2” , ceil ( sigma_y /1 e6 ) )

Scilab code Exa 11.5 Estimate the change in yield strength

39
1 // E s t i m a t e t h e c h a n g e i n y i e l d s t r e n g t h
2 clc
3 n1 = 1 e6 // i n i t i a l number o f p a r t i c l e s
4 n2 = 1 e3 // f i n a l number o f p a r t i c l e
5 printf ( ” \n Example 1 1 . 5 ” )
6 k = ( n1 / n2 ) ^(1/3)
7 printf ( ” \n Y i e l d s t r e n g t h would have d e c r e a s e d t o
%d%% o f i t s i n i t i a l v a l u e . ” ,100/ k )

40
Chapter 12

Fracture

Scilab code Exa 12.1 Estimate fracture strength

1 // E s t i m a t e f r a c t u r e s t r e n g t h
2 clc
3 c = 2 // c r a c k o f h a l f l e n g t h i n m i c r o m e t e r
4 Y = 70 // y o u n g s modulus i n GN mˆ−2
5 Gamma = 1 // s p e c i f i c s u r f a c e e n e r g y
6 printf ( ” \n Example 1 2 . 1 ” )
7 sigma_f = sqrt (2* Gamma * Y *1 e9 /( %pi * c *1 e -6) ) /1 e6
8 r = Y *1 e3 / sigma_f
9 printf ( ” \n F r a c t u r e s t r e n g t h o f %d MN mˆ−2 i s 1/ %dth
o f y o u n g s modulus . ” , ceil ( sigma_f ) , ceil ( r
/100) *100)
10 printf ( ” \n Thus G r i f f i t h s c r i t e r i o n b r i d g e s t h e gap
b e t w e e n t h e \n o b s e r v e d and i d e a l s t r e n g t h s o f
b r i t t l e m a t e r i a l ”)

Scilab code Exa 12.2 Estimate the brittle fracture strength at low temperatures

41
1 // E s t i m a t e t h e b r i t t l e f r a c t u r e s t r e n g t h a t low
temperatures
2 clc
3 Gamma = 1.5 // s p e c i f i c s u r f a c e e n e r g y i n J /mˆ2
4 Y = 200 // Y o u n g s modulus i n GN/mˆ2
5 c = 2 // h a l f l e n g t h o f c r a c k
6
7 printf ( ” \n Example 1 2 . 2 ” )
8 sigma_f = sqrt (2* Gamma * Y *1 e9 /( %pi * c *1 e -6) )
9
10 printf ( ” \n B r i t t l e f r a c t u r e s t r e n g t h a t low
t e m p e r a t u r e s i s %d MNmˆ−2 ” , sigma_f /1 e6 ) // a n s w e r
i n book i s 310MNmˆ−2

Scilab code Exa 12.3 Estimate the temperature at which the ductility of brittle tr

1 // E s t i m a t e t h e t e m p e r a t u r e a t which t h e d u c t i l i t y
of b r i t t l e t r a n s i t i o n occurs at given s t r a i n
rates
2 clc
3 Gamma = 2 // s p e c i f i c s u r f a c e e n e r g y i n J /mˆ2
4 Y = 350 // Y o u n g s modulus i n GN/mˆ2
5 c = 2 // h a l f l e n g t h o f c r a c k
6 de_dt1 = 1e -2 // s t r a i n r a t e
7 de_dt2 = 1e -5 // s t r a i n r a t e
8 printf ( ” \n Example 1 2 . 3 ” )
9 printf ( ” \n P a r t A : ” )
10 sigma_f = sqrt (2* Gamma * Y *1 e9 /( %pi * c *1 e -6) )
11 sigma_y = sigma_f /1 e6
12 T = 173600/( sigma_y -20.6 -61.3* log10 ( de_dt1 ) ) //
temperature c a l c u l a t i o n
13
14 printf ( ” \n T r a n s i t i o n t e m p e r a t u r e f o r s t r a i n r a t e %

42
. 0 e s ˆ−1 i s %d K” , de_dt1 , T ) // a n s w e r i n book i s
300 K
15 printf ( ” \n\n P a r t B : ” )
16
17 T = 173600/( sigma_y -20.6 -61.3* log10 ( de_dt2 ) ) //
temperature c a l c u l a t i o n
18
19 printf ( ” \n T r a n s i t i o n t e m p e r a t u r e f o r s t r a i n r a t e %
. 0 e s ˆ−1 i s %d K” , de_dt2 , T ) // a n s w e r i n book i s
230 K
20 // S o l u t i o n i n book f o r two p a r t s i s d i v i d e d i n t o
three parts

43
Chapter 13

Oxidation and Corrosion

Scilab code Exa 13.2 Calculation of required quantity of magnesium

1 // C a l c u l a t i o n o f r e q u i r e d q u a n t i t y o f magnesium
2 clc
3 j = 15 // c u r r e n t d e n s i t y i n mA mˆ−2
4 m = 0.0243 // m o l a r mass o f magnesium
5 F = 96490 // f a r a d c h a r g e
6 n = 2 // c h a r g e on i o n
7 t = 10 // t i m e i n y e a r s
8 printf ( ” \n Example 1 3 . 2 ” )
9 a = m * j *1 e -3*( t *365*24*3600) /( n * F )
10 printf ( ” \n Amount o f magnesium r e q u i r e d i s %0 . 1 f kg
mˆ−2” ,a )

44
Chapter 14

Conductors and Resistors

Scilab code Exa 14.1 Calculate energy difference

1 // C a l c u l a t e e n e r g y d i f f e r e n c e
2 clc
3 n_x1 = 1 // a t o m i c l e v e l
4 n_y1 = 1 // a t o m i c l e v e l
5 n_z1 = 1 // a t o m i c l e v e l
6 n_x2 = 2 // a t o m i c l e v e l
7 L = 10 // l a t t i c e p a r a m e t e r i n mm
8 h = 6.626 e -34 // p l a n k c o n s t a n t
9 m_e = 9.109 e -31 // mass o f e l e c t r o n i n kg
10 printf ( ” \n Example 1 4 . 1 ” )
11 E1 = h ^2*( n_x1 ^2+ n_y1 ^2+ n_z1 ^2) /(8* m_e *( L *1 e -3) ^2)
12 E2 = h ^2*( n_x2 ^2+ n_y1 ^2+ n_z1 ^2) /(8* m_e *( L *1 e -3) ^2)
13 E = E2 - E1 // e n e r g y d i f f e r e n c e
14 printf ( ” \n Energy d i f f e r e n c e i s %. 2 e J ” ,E )

Scilab code Exa 14.2 Calculate conductivity of copper at 300 K

45
1 // C a l c u l a t e c o n d u c t i v i t y o f c o p p e r a t 300 K
2 clc
3 tau = 2e -14 // c o l l i s i o n t i m e o f e l e c t r o n i n s
4 e = 1.602 e -19 // c h a r g e on e l e c t r o n
5 m_e = 9.1 e -31 // mass o f e l e c t r o n i n kg
6
7 printf ( ” \n Example 1 4 . 2 ” )
8 n = 6.023 e23 *8960/0.06354
9
10 sigma = n * e ^2* tau / m_e
11 printf ( ” \n C o n d u c t i v i t y o f c o p p e r a t 300 K i s %. 1 e
ohmˆ−1 mˆ−1 ” , sigma )

Scilab code Exa 14.3 Estimation of resistivity due to impurity scattering of 1 per

1 // E s t i m a t i o n o f r e s i s t i v i t y due t o i m p u r i t y
s c a t t e r i n g o f 1% o f N i c k e l i n c o p p e r l a t t i c e
2 clc
3 r_cu = 1.8 e -8 // r e s i s t i v i t y o f p u r e c o p p e r i n ohm−m
4 r_Ni_cu = 7e -8 // r e s i s t i v i t y o f c o p p e r 4% Ni i n ohm−
m
5 per1 = 4 // i m p u r i t y i n p e r c e n t
6 per2 = 1 // i m p u r i t y i n p e r c e n t
7 printf ( ” \n Example 1 4 . 3 ” )
8 r = ( r_Ni_cu - r_cu ) * per2 / per1 // r e s i s t i v i t y o f
c o p p e r 1% Ni i n ohm−m
9 printf ( ” \n R e s i s t i v i t y due t o i m p u r i t y s c a t t e r i n g o f
1 %% o f N i c k e l i n c o p p e r l a t t i c e i s %. 1 e ohm−m” ,
r)

46
Chapter 15

Semiconductors

Scilab code Exa 15.1 Calculate intrinsic carrier density

1 // C a l c u l a t e i n t r i n s i c c a r r i e r d e n s i t y
2 clc
3 rho = 3000 // r e s i s t i v i t y i n ohm m
4 mu_e = 0.14
5 mu_h = 0.05
6 e = 1.602 e -19 // c h a r g e on e l e c t r o n
7 printf ( ” \n Example 1 5 . 1 ” )
8 sigma = 1/ rho
9 n = sigma /(( mu_e + mu_h ) * e )
10 printf ( ” \n I n t r i n s i c c a r r i e r d e n s i t y i s %. 3 e mˆ−3” ,n
)

47
Chapter 16

Magnetic Materials

Scilab code Exa 16.1 Calculate the net magnetic moment per iron atom in crystal

1 // C a l c u l a t e t h e n e t m a g n e t i c moment p e r i r o n atom
in cr ys t al
2 clc
3 a = 2.87 // l a t t i c e p a r a m e t e r i n a n g s t r o m
4 n = 2 // number o f atoms p e r u n i t c e l l
5 m = 1750 // S a t u r a t i o n m a g n e t i z a t i o n i n kAmˆ−1
6 mu = 9.273 e -24 // b o h r magneton
7 printf ( ” \n Example 1 6 . 1 ” )
8 m_atom = m *1 e3 *( a *1 e -10) ^3 / n
9 mu_b = m_atom / mu
10
11 printf ( ” \n Net m a g n e t i c moment p e r i r o n atom i n
c r y s t a l i s %. 3 e Amˆ2 ” , m_atom )
12 printf ( ” \n I n u n i t o f mu b , Net m a g n e t i c moment p e r
i r o n atom i n c r y s t a l i s %. 1 f ” , mu_b )

Scilab code Exa 16.2 Comparison of saturation temperatures

48
1 // Comparison o f s a t u r a t i o n t e m p e r a t u r e s
2 clc
3 t1 = 0 // t e m p e r a t u r e i n k e l v i n
4 t2 = 300 // t e m p e r a t u r e i n k e l v i n
5 m_net_Gd = 7 // n e t m a g n e t i c moment o f g a d o l i n i u m
6 m_net_Co = 1.7 // n e t m a g n e t i c moment o f c o b a l t
7 t_c_Gd = 289 // c u r i e t e m p e r a t u r e f o r Gd
8 printf ( ” \n Example 1 6 . 2 ” )
9 printf ( ” \n P a r t A : ” )
10 if m_net_Gd > m_net_Co then
11 printf ( ” \n At %d K, Net m a g n e t i c moment o f
g a d o l i n i u m i . e . %d i s g r e a t e r t h a n n e t m a g n e t i c
moment o f c o b a l t i . e . %. 1 f ” ,t1 , m_net_Gd , m_net_Co
)
12 printf ( ” \n So , Gd w i l l have h i g h e r s a t u r a t i o n
magnetization ”)
13 end
14 printf ( ” \n\n P a r t B : ” )
15 if t_c_Gd < t2 then
16 printf ( ” \n At t e m p e r a t u r e %d K, Gd i s a b o v e i t s
c u r i e t e m p e r a t u r e o f %dK” ,t2 , t_c_Gd )
17 printf ( ” \n Gd w i l l be p a r a m a g n e t i c a t %d K and
w i l l have n e g l i g i b l e m a g n e t i z a t i o n \n a s
compared t o Co , which h a s h i g h e r c u r i e
t e m p e r a t u r e ” , t2 )
18 end

Scilab code Exa 16.4 Calculation of hysteresis loss

1 // C a l c u l a t i o n o f h y s t e r e s i s loss
2 clc
3 v = 0.01 // volume i n mˆ3
4 x = 1e -4 // a x i s i n t e r c e p t

49
5 y = 1 e2 // a x i s i n t e r c e p t
6 a = 60000 // H y s t e r e s i s l o o p a r e a
7 f = 50 // f r e q u e n c y i n Hz
8 printf ( ” \n Example 1 6 . 4 ” )
9 e = x * y * a // Energy l o s s i n one l o o p
10 E = e * v // e n e r g y l o s s i n c o r e i n one c y c l e
11 P = E * f // Power l o s s
12 printf ( ” \n Power l o s s due t o h y s t e r e s i s i s %d W” ,P )

Scilab code Exa 16.5 Calculation of eddy current loss at normal voltage and freque

1 // C a l c u l a t i o n o f eddy c u r r e n t l o s s a t n o r m a l
v o l t a g e and f r e q u e n c y
2 clc
3 Total1 = 2300 // t o t a l i r o n l o s s i n W a t 440 V and
50 Hz
4 Total2 = 750 // t o t a l i r o n l o s s i n W a t 220 V and 25
Hz
5 printf ( ” \n Example 1 6 . 5 ” )
6 W_e = 1/2*( Total1 -2* Total2 )
7 printf ( ” \n Eddy c u r r e n t l o s s a t n o r m a l v o l t a g e and
f r e q u e n c y i s %dW” ,4* W_e )

50
Chapter 17

Dielectric Materials

Scilab code Exa 17.1 Calculation of relative dielectric constant

1 // c a l c u l a t i o n o f r e l a t i v e d i e l e c t r i c c o n s t a n t
2 clc
3 l = 10 // l e n g t h o f c a p a c i t o r i n mm
4 b = 10 // w i d t h o f c a p a c i t o r i n mm
5 d = 2 // d i s t a n c e o f s e p a r a t i o n i n mm
6 c = 1e -9 // c a p a c i t a n c e i n f a r a d
7 epsilon_0 = 8.85 e -12 // p e r m i t t i v i t y o f f r e e s p a c e
8 printf ( ” \n Example 1 7 . 1 ” )
9 epsilon_r = c * d *1 e -3/( epsilon_0 * l *1 e -3* b *1 e -3)
10
11 printf ( ” \n R e l a t i v e d i e l e c t r i c c o n s t a n t i s %d” ,
epsilon_r )

Scilab code Exa 17.2 Calculate the polarization of a BaTio3 crystal

1 // c a l c u l a t e t h e p o l a r i z a t i o n o f a BaTio3 c r y s t a l
2 clc

51
3 Ti_shift = 0.06 // s h i f t o f TI i o n i n a n g s t r o m
4 O_shift = 0.06 // s h i f t o f o x y g e n i o n o f s i d e f a c e
i n angstrom
5 o_shift = 0.08 // s h i f t o f o x y g e n i o n o f t o p and
bottom f a c e s i n a n g s t r o m
6 O_charge = 2 // u n i t c h a r g e on o x y g e n i o n o f s i d e
face
7 o_charge = 2 // u n i t c h a r g e on o x y g e n i o n o f t o p
and bottom f a c e s
8 Ti_charge = 4 // u n i t c h a r g e on t i t a n i u m i o n
9 n_O = 2 // number o f o x y g e n i o n o f s i d e f a c e
10 n_o = 1 // number o f o x y g e n i o n o f t o p and bottom
face
11 n_Ti = 1 // number o f t i t a n i u m i o n
12 e = 1.6 e -19 // amount o f one u n i t c h a r g e i n coulomb
13 printf ( ” \n Example 1 7 . 2 ” )
14 p_Ti = n_Ti * Ti_charge * e * Ti_shift *1 e -10
15 p_O = n_O * O_charge * e * O_shift *1 e -10
16 p_o = n_o * o_charge * e * o_shift *1 e -10
17 Total = p_Ti + p_O + p_o
18 P = Total /(4.03*3.98^2*1 e -30)
19 printf ( ” \n P o l a r i z a t i o n o f BaTiO3 c r y s t a l i s %. 2 f Cm
ˆ−2 ” , P )

52

You might also like