Scilab Textbook Companion for Materials Science by R. S. Khurmi and R. S. Sedha 1 Created by Vijay Kant Kala B.tech Electronics Engineering KIET College Teacher Ms. Swati Cross-Checked by Lavitha Pereira And Mukul R. Kulkarni February 14, 2014
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 Author: R. S. Khurmi and R. S. Sedha Publisher: S. Chand & company, New Delhi Edition: 1 Year: 2012 ISBN: 81-219-0146-4
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 structure of atoms
7
3 crystal structure
12
5 Electron Theory of Metals
32
7 Mechanical Tests of Metals
41
8 Mechanical Tests of Metals
52
9 Fracture of Metals
55
15 Composite Materials and Ceramics
58
16 Semiconductors
59
17 Insulating Materials
63
18 Magnetic Materials
64
3
List of Scilab Codes Exa 2.1 Exa 2.2 Exa 2.3 Exa 2.4 Exa 2.5 Exa 2.6.a Exa 2.6.b Exa 2.6.c Exa 3.1 Exa 3.2 Exa 3.3 Exa 3.4 Exa 3.5 Exa 3.9 Exa 3.10 Exa 3.11 Exa 3.12 Exa 3.13 Exa 3.14 Exa 3.15 Exa 3.16 Exa 3.17 Exa 3.18 Exa 3.19 Exa 3.20 Exa 3.21 Exa 3.22
radius . . . . . . . . . . . . . . . . . . . . . . . . . . . radius . . . . . . . . . . . . . . . . . . . . . . . . . . . ratio of energy . . . . . . . . . . . . . . . . . . . . . . velocity . . . . . . . . . . . . . . . . . . . . . . . . . . orbital frequency . . . . . . . . . . . . . . . . . . . . . energy of photon emitted . . . . . . . . . . . . . . . . frequency . . . . . . . . . . . . . . . . . . . . . . . . . wavelength . . . . . . . . . . . . . . . . . . . . . . . . miller indices . . . . . . . . . . . . . . . . . . . . . . . miller indices . . . . . . . . . . . . . . . . . . . . . . . miller indices . . . . . . . . . . . . . . . . . . . . . . . miller indices . . . . . . . . . . . . . . . . . . . . . . . miller indices . . . . . . . . . . . . . . . . . . . . . . . atoms per unit cell . . . . . . . . . . . . . . . . . . . . diameter . . . . . . . . . . . . . . . . . . . . . . . . . volume change . . . . . . . . . . . . . . . . . . . . . . number of atoms . . . . . . . . . . . . . . . . . . . . . number of atoms . . . . . . . . . . . . . . . . . . . . . number of atoms . . . . . . . . . . . . . . . . . . . . . planar density . . . . . . . . . . . . . . . . . . . . . . volume . . . . . . . . . . . . . . . . . . . . . . . . . . packing efficiency and lattice parameter . . . . . . . . interplanar distance . . . . . . . . . . . . . . . . . . . interplanar spacing . . . . . . . . . . . . . . . . . . . . interplanar spacing . . . . . . . . . . . . . . . . . . . . ratio of cubic lattice sepration between the successive lattice planes . . . . . . . . . . . . . . . . . . . . . . . perpendicular distance . . . . . . . . . . . . . . . . . . 4
7 7 8 9 9 10 10 11 12 13 14 14 15 16 16 16 17 17 18 18 19 19 20 20 21 21 22
Exa 3.23 angle . . . . . . . . . . . . . . . . . . . . . . . . . . . Exa 3.24 concentration of iron atoms . . . . . . . . . . . . . . . Exa 3.25 lattice constants . . . . . . . . . . . . . . . . . . . . . Exa 3.26 density . . . . . . . . . . . . . . . . . . . . . . . . . . Exa 3.27 number of atoms . . . . . . . . . . . . . . . . . . . . . Exa 3.28 lattice constants . . . . . . . . . . . . . . . . . . . . . Exa 3.29 number of atoms . . . . . . . . . . . . . . . . . . . . . Exa 3.30 number of vacancies in copper . . . . . . . . . . . . . Exa 3.31 interplanar spacing . . . . . . . . . . . . . . . . . . . . Exa 3.32 interatomic spacing . . . . . . . . . . . . . . . . . . . Exa 3.33 order of Braggs reflection . . . . . . . . . . . . . . . . Exa 3.34 size of unit cell . . . . . . . . . . . . . . . . . . . . . . Exa 3.35 Bragg angle . . . . . . . . . . . . . . . . . . . . . . . . Exa 3.36 interplanar spacing and Miller Indices . . . . . . . . . Exa 3.37 interplanar spacing and diffraction angke . . . . . . . Exa 5.1.a probability . . . . . . . . . . . . . . . . . . . . . . . . Exa 5.1.b probability . . . . . . . . . . . . . . . . . . . . . . . . Exa 5.2 resistance . . . . . . . . . . . . . . . . . . . . . . . . . Exa 5.3 resistance . . . . . . . . . . . . . . . . . . . . . . . . . Exa 5.4 conductivity . . . . . . . . . . . . . . . . . . . . . . . Exa 5.5 drift velocity . . . . . . . . . . . . . . . . . . . . . . . Exa 5.6 conductivity . . . . . . . . . . . . . . . . . . . . . . . Exa 5.7 mobility of electrons . . . . . . . . . . . . . . . . . . . Exa 5.8 mobility of electrons . . . . . . . . . . . . . . . . . . . Exa 5.9 mobility of electrons and drift velocity . . . . . . . . . Exa 5.10 density and drift velocity . . . . . . . . . . . . . . . . Exa 5.11 velocity . . . . . . . . . . . . . . . . . . . . . . . . . . Exa 5.12.a velocity . . . . . . . . . . . . . . . . . . . . . . . . . . Exa 5.12.b mobility of electrons . . . . . . . . . . . . . . . . . . . Exa 5.13 mean free path . . . . . . . . . . . . . . . . . . . . . . Exa 5.14 mobility and average time . . . . . . . . . . . . . . . Exa 5.15 electrical resistivity . . . . . . . . . . . . . . . . . . . Exa 7.1 shear modulus . . . . . . . . . . . . . . . . . . . . . . Exa 7.2 young modulus of elasticity yield point uttimate stress and percentage elongation . . . . . . . . . . . . . . . . Exa 7.3.a yield point stress . . . . . . . . . . . . . . . . . . . . . Exa 7.3.b ultimate tensile strength . . . . . . . . . . . . . . . . . Exa 7.3.c percentage elongation . . . . . . . . . . . . . . . . . . 5
23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 32 32 33 33 34 34 34 35 35 36 36 37 37 38 38 39 39 41 41 42 43 43
Exa 7.3.d modulus of elasticity . . . . . . . . . . . . . Exa 7.3.e modulus of resilience . . . . . . . . . . . . . Exa 7.3.f fracture stress . . . . . . . . . . . . . . . . Exa 7.3.g modulus of toughness . . . . . . . . . . . . Exa 7.4 true breaking and nominal breaking stress . Exa 7.5.a yield stress . . . . . . . . . . . . . . . . . . Exa 7.5.b ultimate tesnile stress . . . . . . . . . . . . Exa 7.5.c percentage reduction . . . . . . . . . . . . . Exa 7.5.d percentage elongation . . . . . . . . . . . . Exa 7.6 strain . . . . . . . . . . . . . . . . . . . . . Exa 7.7 true stress and true strain . . . . . . . . . . Exa 7.8 greater stress . . . . . . . . . . . . . . . . . Exa 8.1 critical resolved shear stress . . . . . . . . . Exa 8.2 yield strength . . . . . . . . . . . . . . . . . Exa 8.3 yield stress . . . . . . . . . . . . . . . . . . Exa 8.4 grain diameter . . . . . . . . . . . . . . . . Exa 9.1 fracture strength . . . . . . . . . . . . . . . Exa 9.2 fracture strength . . . . . . . . . . . . . . . Exa 9.3 maximum length . . . . . . . . . . . . . . . Exa 9.4.a temperture . . . . . . . . . . . . . . . . . . Exa 9.4.b temperature . . . . . . . . . . . . . . . . . Exa 15.1 volume ratio of aluminium and boron . . . Exa 16.1 concentration of conductive electrons . . . . Exa 16.2 intrinsic carrier density . . . . . . . . . . . Exa 16.3 concentration of N type impurity . . . . . . Exa 16.4 concentration number of electrons carrier . Exa 16.5 concentration of impurity . . . . . . . . . . Exa 16.6 intrinsic carrier density . . . . . . . . . . . Exa 16.7 conductivity . . . . . . . . . . . . . . . . . Exa 17.1 greater charge . . . . . . . . . . . . . . . . Exa 18.1 magnetization and flux density . . . . . . . Exa 18.2.a saturation magnetisation . . . . . . . . . . Exa 18.2.b saturation flux density . . . . . . . . . . . . Exa 18.3 magnetic moments . . . . . . . . . . . . . . Exa 18.4 power loss . . . . . . . . . . . . . . . . . . . Exa 18.5 loss of energy . . . . . . . . . . . . . . . . .
6
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
44 45 45 46 47 48 48 49 49 50 50 51 52 53 53 54 55 55 56 56 57 58 59 59 60 60 61 61 62 63 64 64 65 65 66 66
Chapter 2 structure of atoms
Scilab code Exa 2.1 radius
1 2 3 4 5 6 7 8 9 10 11 12
// Example 2 . 1 : r a d i u s o f t he f i r s t b oh r ” s o r b i t clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,5)
e p = 8 . 8 5 4 * 1 0 ^ - 1 2 ; // h = 6 . 6 2 6 * 1 0 ^ - 3 4 ; // m = 9 . 1 * 1 0 ^ - 3 1 ; / / i n Kg e = 1 . 6 0 2 * 1 0 ^ - 1 9 ; // r 1 = ( ( e p * ( h ^ 2 ) ) / ( ( % p i * m * ( e ^ 2 ) ) ) ) ;// disp ( r 1 * 1 0 ^ 1 0 , ” r a d i u s , r 1 ( i n a n gs tr o m )
= ”)
Scilab code Exa 2.2 radius
1 2 / / Example 2 . 2 : 3 clc ;
r a d i u s o f t he s ec on d b o h r ” s o r b i t
7
4 5 6 7 8 9
clear ; close ;
10 11 12 13 14 15
/ / g i v e n d at a : format ( ’ v ’ ,6) r 1 _ h = 0 . 5 2 9 ; // r a d i u s f o r h yd ro ze n atom i n Angstrum n 1 = 1 ; // f o r t he f i r s t bohr ’ s o r b i t o f e l e c t r o n i n h y d r o z e n a to m Z 1 = 1 ; / / f o r t he f i r s t bohr ’ s o r b i t o f e l e c t r o n i n h y d r o z e n a to m k = ( r 1 _ h * Z 1 ) / n 1 ^ 2 ; // wh ere k i s c o ns t an t n 2 = 2 ; // f o r t h e s ec o nd b o h r o r b i t Z 2 = 2 ; / / f o r t he s ec on d b o h r o r b i t
r2_he=k*(n2^2/Z2); disp ( r 2 _ h e , ” r a d i u s o f t he s ec on d b oh r o r b i t , r 2 ( Angstrom) = ”)
Scilab code Exa 2.3 ratio of energy
1 2 3 4 5 6 7 8 9 10 11 12
/ / E xample 2 . 3 : t o p ro ve
clc ; clear ; close ; Z=1; //assume n 1 = 1 ; // o r b i t 1 n 2 = 2 ; // o r b i t 2 n 3 = 3 ; // o r b i t 3 e 1 = ( ( - 1 3 . 6 * Z ) / ( n 1 ^ 2 ) ) ; // e n er g y f o r t h e f i r s t o r b i t e 2 = ( ( - 1 3 . 6 * Z ) / ( n 2 ^ 2 ) ) ; // e ne rg y f o r t he s ec on d o r b i t e 3 = ( ( - 1 3 . 6 * Z ) / ( n 3 ^ 2 ) ) ; // e ne rg y f o r t he t h i r d o r b i t e 3 1 = e 3 - e 1 ; / / e n er g y e m i tt e d by an e l e c t r o n j um pi ng
from o r b i t n u be r 3 t o o r b i t n i m b er 1 13 e 2 1 = e 2 - e 1 ; / / e n er g y e m i tt e d by an e l e c t r o n j um pi ng from o r b i t n u be r 2 t o o r b i t n i m b er 1 14 r e = e 3 1 / e 2 1 ; // r a t i o o f e ne rg y 15 disp ( r e , ” r a t i o o f e ne rg y f o r an e l e c t r o n t o jump 8
from o r b i t 3 t o o r b i 1 a nd from o r b i t 2 t o o r b i t 1 i s 3 2 / 2 7 ”)
Scilab code Exa 2.4 velocity
1 2 3 4 5 6 7 8 9 10 11 12 13
// Example 2 . 4 : v e l o c i t y clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,8)
h=6.626*10^-34; e=1.6*10^-19; epsilon_o=8.825*10^-12; n=1; Z=1; vn=(Z*e^2)/(2*epsilon_o*n*h); disp ( v n , ” v e l o c i t y , vn (m/ s ) = ” )
Scilab code Exa 2.5 orbital frequency
1 2 3 4 5 6 7 8 9 10
// Example 2 . 5 : v e l o c i t y clc ; clear ; close ;
/ / g i v e n d at a :
n=1; Z=1; k = 6 . 5 6 * 1 0 ^ 1 5 ; // k i s c o n s t a n t fn=k*(Z^2/n^3); disp ( f n , ” o r b i t a l f r e q u e nc y , f n ( Hz ) = ” )
9
Scilab code Exa 2.6.a energy of photon emitted
1 2 3 4 5 6 7 8 9 10 11 12 13
/ / Example 2 . 6 . a : t he e ne rg y o f t he p ho to n e m it te d clc ; clear ; close ; format ( ’ v ’ ,5);
/ / g i v e n d at a : Z = 1 ; / / f o r h y dr o ze n
n1=3; n2=2; E3=-(13.6*Z^2)/n1^2; E2=-(13.6*Z^2)/n2^2; del_E=E3-E2; disp ( d e l _ E , ” t h e e n er g y o f p ho to n e mi tt ed , d e l E ( eV ) = ”)
Scilab code Exa 2.6.b frequency
1 2 3 4 5 6 7 8 9 10 11 12 13
/ / Example 2 . 6 . b : f r e q u e n c y clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,9) Z = 1 ; / / f o r h y dr o ze n
n1=3; n2=2; m = 6 . 6 2 6 * 1 0 ^ - 3 4 ; // m ass o f e l e c t r o n i n k g E3=-(13.6*Z^2)/n1^2; E2=-(13.6*Z^2)/n2^2; del_E=E3-E2;
10
14 E = d e l _ E * 1 . 6 * 1 0 ^ - 1 9 ; // i n j o u l e s 15 v = ( E / m ) ; 16 disp (v , ” f r e q u e n c y o f t h e p ho to n e mi tt ed , v ( Hz ) = ” )
Scilab code Exa 2.6.c wavelength
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// Example 2 . 6 . c : wave l e n g th o f t he p ho to n e mi t te d clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,9) Z = 1 ; / / f o r h y dr o ze n
n1=3; n2=2; m = 6 . 6 2 6 * 1 0 ^ - 3 4 ; // m ass o f e l e c t r o n i n k g C=3*10^8; E3=-(13.6*Z^2)/n1^2; E2=-(13.6*Z^2)/n2^2; del_E=E3-E2; E=del_E*1.6*10^-19; v=E/m; lamda=C/v; disp ( l a m d a , ” w a v el e ng t h o f t h e p ho to n e mi tt ed , ( m) = ” )
11
Chapter 3 crystal structure
Scilab code Exa 3.1 miller indices
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// Example 3 . 1 :
miller indices
clc ; clear ; close ;
/ / g i v e n d a ta x 1 = 1 ; // x 2 = 1 ; // x 3 = 2 ; // h 1 = 1 / x 1 ; // h 2 = 1 / x 2 ; // h 3 = 1 / x 3 ; // disp ( ” M i l l e r i n d i c e s o f t h e p la ne ( 1 1 2 ) a re : ” + string ( h 1 ) + ” , ” + string ( h 2 ) + ” , ” + string ( h 3 ) ) x 1 1 = 0 ; // x 2 1 = 0 ; // x 3 1 = 1 ; // h 1 1 = % i n f ; // h 2 1 = % i n f ; // h 3 1 = 1 / x 3 1 ; // disp ( ” M i l l e r i n d i c e s o f t h e p la ne ( 00 1) a re : ” + string ( h 1 1 ) + ” , ” + string ( h 2 1 ) + ” , ” + string ( h 3 1 ) ) 12
20 21 22 23 24 25 26
x 1 1 1 = 1 ; // x 2 1 1 = 0 ; // x 3 1 1 = 1 ; // h 1 1 1 = 1 / x 1 1 1 ; // h 2 1 1 = % i n f ; // h 3 1 1 = 1 / x 3 1 1 ; // disp ( ” M i l l e r i n d i c e s o f t h e p la ne ( 10 1) a re : ” + string ( h 1 1 1 ) + ” , ” + string ( h 2 1 1 ) + ” , ” + string ( h 3 1 1 ) )
Scilab code Exa 3.2 miller indices
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
// Example 3 . 2 :
miller indices
clc ; clear ; close ;
/ / g i v e n d a ta x 1 = 0 ; // x 2 = 2 ; // x 3 = 0 ; // h 1 = % i n f ; // h 2 = 1 / x 2 ; // h 3 = % i n f ; // disp ( ” M i l l e r i n d i c e s o f t h e p la ne ( 0 2 0 ) a re : ” + string ( h 1 ) + ” , ” + string ( h 2 ) + ” , ” + string ( h 3 ) ) x 1 1 = 1 ; // x 2 1 = 2 ; // x 3 1 = 0 ; // h 1 1 = 1 / x 1 1 ; // h 2 1 = 1 / x 2 1 ; // h 3 1 = % i n f ; // disp ( ” M i l l e r i n d i c e s o f t h e p la ne ( 12 0) a re : ” + string ( h 1 1 ) + ” , ” + string ( h 2 1 ) + ” , ” + string ( h 3 1 ) ) x 1 1 1 = 2 ; // x 2 1 1 = 2 ; // x 3 1 1 = 0 ; // 13
23 24 25 26
h 1 1 1 = 1 / x 1 1 1 ; // h 2 1 1 = 1 / x 2 1 1 ; // h 3 1 1 = % i n f ; // disp ( ” M i l l e r i n d i c e s o f t h e p la ne ( 22 0) a re : ” + string ( h 1 1 1 ) + ” , ” + string ( h 2 1 1 ) + ” , ” + string ( h 3 1 1 ) )
27 / / m i l l e r
i n d i c e s f o r p la ne ( 1 2 0 ) i s c a l c u l a t e d wrong i n t he book
Scilab code Exa 3.3 miller indices
1 2 3 4 5 6 7 8 9 10 11 12 13
/ / Example 3 . 3 : m i l l e r i n d i c e s
14
clc ; clear ; close ; x = 1 / 2 ; // x 1 = 1 / x ; // r 2 = 0 ; // r 3 = 0 ; // x 1 0 = - 1 ; // x 2 = 1 / - x 1 0 ; // r 4 = 0 ; // r 5 = 0 ; // disp ( ” m i l l e r i n d i c e s ” + string ( x 1 ) + ” : ”) disp ( ” m i l l e r i n d i c e s ” + string ( x 2 ) + ” : ”)
( Ca se 1 ) o f t h e g iv en p la ne a re ” + string ( r 2 ) + ” : ” + string ( r 3 ) + ” ( Ca se 2 ) o f t h e g iv en p la ne a re ” + string ( r 3 ) + ” : ” + string ( r 4 ) + ”
Scilab code Exa 3.4 miller indices
1 / / Example 3 . 4 : 2 clc ;
miller indices
14
3 4 5 6 7 8 9 10 11 12 13 14
clear ; close ; a = 0 . 5 2 9 ; // b = 1 ; // c = 0 . 4 7 7 ; // a 1 = 0 . 2 6 4 ; // b 1 = 1 ; // c 1 = 0 . 2 3 8 ; // r1 = round ( a / a 1 ) ; // r 2 = b / b 1 ; // r3 = round ( c / c 1 ) ; // disp ( ” m i l l e r i n d i c e s o f t h e g iv en p la ne a re ” + string ( r 1 ) + ” : ” + string ( r 2 ) + ” : ” + string ( r 3 ) + ” ” )
Scilab code Exa 3.5 miller indices
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// Example 3 . 5 :
miller indices
clc ; clear ; close ;
/ / g i v e n d a ta x 1 = 1 ; // x 2 = 1 ; // x 3 = 0 ; // h 1 = 1 / x 1 // h 2 = 1 / x 2 ; // h 3 = % i n f ; // disp ( ” M i l l e r i n d i c e s o f t h e p la ne ( 1 1 0 ) a re : ” + string ( h 1 ) + ” , ” + string ( h 2 ) + ” , ” + string ( h 3 ) ) x 1 1 = 1 ; // x 2 1 = 1 ; // x 3 1 = 1 ; // h 1 1 = 1 / x 1 1 ; // h 2 1 = 1 / x 2 1 ; // h 3 1 = 1 / x 3 1 ; // 15
19 disp ( ” M i l l e r i n d i c e s o f t h e p la ne ( 11 1) a re : ” + string ( h 1 1 ) + ” , ” + string ( h 2 1 ) + ” , ” + string ( h 3 1 ) )
Scilab code Exa 3.9 atoms per unit cell
1 2 3 4 5 6 7 8 9 10
/ / Example 3 . 9 : at oms p e r u n i t c e l l
clc ; clear ; close ; c=8; // cor ner s f=6; / / f a c e s n f = ( 1 / 2 ) * f ; // no . o f atoms i n a l l s i x f a c e s n c = ( 1 / 8 ) * c ; // no . o f atoms i n a l l c o r n e rs t a = n f + n c ; // disp ( t a , ” t o t a l number o f a to ms a r e ” )
Scilab code Exa 3.10 diameter
1 2 3 4 5 6 7 8 9 10
// Example 3 . 1 0 : l a r g e s t d i am et e r clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,6) a = 3 . 6 1 ; // e dg e l e n g th i n a ng stru m r = ( a * sqrt ( 2 ) ) / 4 ; d=2*r; disp (d , ” l a r g e s t d i a m e t e r , d ( a n g st r om ) = ” )
Scilab code Exa 3.11 volume change
16
1 2 3 4 5 6 7 8 9 10 11 12 13
/ / Example 3 . 1 1 : v ol ume c ha ng e i n p e r c e n t a g e clc ; clear ; close ;
/ / g i v e n d at a : r _ b c c = 0 . 1 2 5 8 ; // i n nm r _ f c c = 0 . 1 2 9 2 ; // i n nm
a _ b c c = ( r _ b c c * 4 ) /sqrt ( 3 ) ; a _ f c c = ( r _ f c c * 4 ) /sqrt ( 2 ) ; v _ f c c = ( a _ f c c ) ^ 3 ; / / i n nmn ˆ3 v _ b c c = ( a _ b c c ) ^ 3 ; / / i n nmˆ 3 V=((v_fcc-v_bcc)/v_bcc)*100; disp (V , ” v ol um e c h an g e i n p e r c e n t a g e , V(%) = ” )
Scilab code Exa 3.12 number of atoms
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/ / E xa mp le 3 . 1 2 : n um be r o f a to m /mmˆ 2 clc ; clear ; close ; format ( ’ v ’ ,8)
/ / g i v e n d at a :
a = 3 . 0 3 * 1 0 ^ - 7 ; / / l a t t i c e c o n s t a n t i n mm A = 1 / a ^ 2 ; // f o r 10 0 p l a n e s B = 0 . 7 0 7 / a ^ 2 ; // f o r ( 1 1 0 ) p l a n e s C = 0 . 5 8 / a ^ 2 ; // f o r ( 1 1 1) p l a n es disp (A , ” number o f atom f o r ( 1 0 0 ) p la ne , = ” ) disp (B , ” number o f atoms f o r ( 1 1 0 ) p la n , = ” ) disp (C , ” number o f atoms f o r ( 1 1 1 ) p la n , = ” )
Scilab code Exa 3.13 number of atoms
17
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/ / E xa mp le 3 . 1 3 : nu mb er o f atom /mmˆ 2 o f p l a n e s clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,9)
a = 2 . 8 7 * 1 0 ^ - 7 ; / / l a t t i c e c o n s t a n t i n mm A = 1 / a ^ 2 ; // f o r 10 0 p l a n e s B = 1 . 4 1 4 / a ^ 2 ; // f o r ( 1 1 0 ) p l a n e s C = 1 . 7 3 2 / a ^ 2 ; // f o r ( 1 1 1 ) p l a n es disp (A , ” number o f atom f o r ( 1 0 0 ) p la ne , = ” ) disp (B , ” number o f atoms f o r ( 1 1 0 ) p la n , = ” ) disp (C , ” number o f atoms f o r ( 1 1 1 ) p la n , = ” )
Scilab code Exa 3.14 number of atoms
1 2 3 4 5 6 7 8 9 10 11 12 13
/ / E xam ple 3 . 1 4 : number o f atom /mmˆ 2 s u r f a c e a r e a clc ; clear ; close ;
/ / g i v e n d at a :
a=4.93*10^-7; // l a t t i c e cons tant A = 2 / a ^ 2 ; // f o r 10 0 p l a n e s B = 1 . 4 1 4 / a ^ 2 ; // f o r ( 1 1 0 ) p l a n e s C = 2 . 3 1 / a ^ 2 ; // f o r ( 1 1 1) p l a n es disp (A , ” number o f atoms f o r ( 1 0 0 ) disp (B , ” number o f atoms f o r ( 1 1 0 ) disp (C , ” number o f atoms f o r ( 1 1 1 )
Scilab code Exa 3.15 planar density
18
i n mm
p l an e ) = ” ) p la n = ” ) p la n = ” )
1 2 3 4 5 6 7 8 9 10
/ / Example 3 . 1 5 : p l a na r d e n s i t y clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,9) a = 0 . 1 4 3 * 1 0 ^ - 6 ; / / a to mi c r a d i u s i n mm A = 2 . 3 1 / ( a ^ 2 ) ; // f o r ( 1 1 1 ) p l a ne s disp (A , ”atom ,A( atoms /mmˆ2 ) = ” )
/ / a ns we r i s wrong i n book
Scilab code Exa 3.16 volume
1 2 3 4 5 6 7 8 9 10
/ / Exam ple 3 . 1 6 : v ol um e clc ; clear ; close ; format ( ’ v ’ ,7)
/ / g i v e n d at a : a = 0 . 2 6 6 5 ; / / i n mm c = 0 . 4 9 4 7 ; / / i n mm V = ( 3 * sqrt ( 3 ) * a ^ 2 * c ) / 2 ; disp (V , ” volume ,V(mmˆ3 ) = ” )
Scilab code Exa 3.17 packing efficiency and lattice parameter
1 2 // Example 3 . 1 7
: f i n d t he p ac ki ng e f f i c i e n c y and l a t t i c e para meter
3 4 5 6
clc ; clear ; close ; format ( ’ v ’ ,5)
19
7 8 9 10 11 12
/ / g i v e n d at a : r = 1 . 2 2 / / i n a ng st ru m
a = ( 4 * r ) / sqrt ( 3 ) ; e f f i c i e n c y = ( % p i *sqrt ( 3 ) ) / 8 ; disp (efficiency , ” e f f i c i e n c y = ” ) disp (a , ” l a t t i c e p a r a m e t e r , a ( a n g s t r o m ) = ” )
Scilab code Exa 3.18 interplanar distance
1 2 3 4 5 6 7 8 9 10 11
/ / Example 3 . 1 8 : i n t e r p l a n a r d i s t a n c e clc ; clear ; close ;
/ / g i v e n d at a : h=1; k=1; l=1;
//d=a/ s q r t ( hˆ2+kˆ2+ l ˆ2 ) d B Y a = 1 / sqrt ( h ^ 2 + k ^ 2 + l ^ 2 ) ; disp ( ” I n t e r p l a n o r d i s t a n c e ( A ngstrom ) dBYa));
Scilab code Exa 3.19 interplanar spacing
1 2 3 4 5 6 7 8 9
// Example 3 . 1 9 : s p a c i n g clc ; clear ; close ;
/ / g i v e n d at a :
h1=2; k1=0; l1=0; h2=2;
20
i s a ∗ ” + string (
10 11 12 13 14 15 16 17 18 19 20 21 22 23
k2=2; l2=0; h3=1; k3=1; l3=1; r=1.246; a = ( 4 * r ) / sqrt ( 2 ) ; / / i n a ng st ru m
//d=a/ s q r t ( hˆ2+kˆ2+ l ˆ2 )
d 1 = a / sqrt ( h 1 ^ 2 + k 1 ^ 2 + l 1 ^ 2 ) ; d 2 = a / sqrt ( h 2 ^ 2 + k 2 ^ 2 + l 2 ^ 2 ) ; d 3 = a / sqrt ( h 3 ^ 2 + k 3 ^ 2 + l 3 ^ 2 ) ; disp ( d 1 , ” d 2 0 0 s p a c i n d , d1 ( a n g st r o m ) = ” ) disp ( d 2 , ” d 2 2 0 s p a c i n d , d2 ( a n g st r o m ) = ” ) disp ( d 3 , ” d 1 1 1 s p a c i n d , d3 ( a n g st r o m ) = ” )
Scilab code Exa 3.20 interplanar spacing
1 2 3 4 5 6 7 8 9 10 11 12 13
/ / Example 3 . 2 0 : i n t e r p l a n e r s p ac i ng d 2 20 clc ; clear ; close ; format ( ’ v ’ ,6)
/ / g i v e n d at a : a = 0 . 3 1 6 ; // i n nm
h=2; k=2; l=0; d = a / sqrt ( h ^ 2 + k ^ 2 + l ^ 2 ) ; disp (d , ” i n t e r p l a n e r s p a c i n g d 2 20 , d (nm) = ” )
/ / a ns we r i s wrong i n book
Scilab code Exa 3.21 ratio of cubic lattice sepration between the succes-
sive lattice planes 21
1 2 3 4 5 6 7 8 9 10
/ / E xample 3 . 2 1 : i n t e r p l a n a r s p ac i ng d2 20
clc ; clear ; close ; format ( ’ v ’ ,5) a = 1 ; / / c o n s t a n t a ss um e a1=[1;0;0]; // l a t t i c e pl an es a2=[1;1;0]; // l a t t i c e pl an es a3=[1;1;1]; // l a t t i c e pl an es d 1 0 0 = a / ( sqrt ( a 1 ( 1 , 1 ) ^ 2 + a 1 ( 2 , 1 ) ^ 2 + a 1 ( 3 , 1 ) ^ 2 ) ) ; //
i n t e r p l a n a r d i s t a n c e b et we en ( 1 0 0 ) p l a n es 11 d 1 1 0 = a / ( sqrt ( a 2 ( 1 , 1 ) ^ 2 + a 2 ( 2 , 1 ) ^ 2 + a 2 ( 3 , 1 ) ^ 2 ) ) ; //
i n t e r p l a n a r d i s t a n c e b et we en ( 1 1 0 ) p l a n es 12 d 1 1 1 = a / ( sqrt ( a 3 ( 1 , 1 ) ^ 2 + a 3 ( 2 , 1 ) ^ 2 + a 3 ( 3 , 1 ) ^ 2 ) ) ; //
i n t e r p l a n a r d i s t a n c e b et we en ( 1 1 1 ) p l a n es 13 disp ( ” r a t i o o f i n t e r p l a n a r d i s t a n c e s i s ” + string ( d 1 0 0 ) + ” : ” + string ( d 1 1 0 ) + ” : ” + string ( d 1 1 1 ) + ” ” )
Scilab code Exa 3.22 perpendicular distance
1 2 3 4 5 6 7 8
// E xample 3 . 2 2 : p e r p e n d i c u l a r d i s t a n c e
clc ; clear ; close ; a = 1 ; / / c o n s t a n t a ss um e a1=[1;1;1]; // l a t t i c e pl an es a2=[2;2;2]; // l a t t i c e pl an es d 1 = a / ( sqrt ( a 1 ( 1 , 1 ) ^ 2 + a 1 ( 2 , 1 ) ^ 2 + a 1 ( 3 , 1 ) ^ 2 ) ) ; //
p e r p e n d i cu l a r d i s t a n c e b e tw e en o r i g i n and ( 1 11 ) planes 9 d 2 = a / ( sqrt ( a 2 ( 1 , 1 ) ^ 2 + a 2 ( 2 , 1 ) ^ 2 + a 2 ( 3 , 1 ) ^ 2 ) ) ; // p e r p e n d i cu l a r d i s t a n c e b e tw e en o r i g i n and ( 2 22 ) planes 10 d 2 2 = d1 - d 2; // p e r p e n d i c u l a r d i s t a n c e b et wee n t he p l a n e s ( 1 1 1 ) and ( 2 22 ) 22
11 disp ( d 2 2 , ” p e r p e n d i c u l a r d i s t a n c e b et we en t he p l a n es ( 1 1 1 ) and ( 2 2 2 ) ” )
Scilab code Exa 3.23 angle
1 / / E xample 3 . 2 3 :
a n g le b et we en p l a n es ( 1 2 2 ) and
(111) 2 3 4 5 6 7 8
clc ; clear ; close ; a = 1 ; / / a s su me a1=[1;2;2]; // l a t t i c e pl an es a2=[1;1;1]; // l a t t i c e pl an es d 1 = a / ( sqrt ( a 1 ( 1 , 1 ) ^ 2 + a 1 ( 2 , 1 ) ^ 2 + a 1 ( 3 , 1 ) ^ 2 ) ) ; //
p e r p e n d i cu l a r d i s t a n c e b e tw e en o r i g i n and ( 1 11 ) planes 9 d 2 = a / ( sqrt ( a 2 ( 1 , 1 ) ^ 2 + a 2 ( 2 , 1 ) ^ 2 + a 2 ( 3 , 1 ) ^ 2 ) ) ; // p e r p e n d i cu l a r d i s t a n c e b e tw e en o r i g i n and ( 2 22 ) planes 10 c p hi = ( ( a 1 ( 1 , 1) * a 2 ( 1 , 1 ) ) +( a 1 ( 2 , 1 ) * a 2 (2 , 1 ) ) + ( a 1 (3 , 1 ) * a 2 ( 3 , 1 ) ) ) * ( d 1 * d 2 ) ; // 11 d = a c o s d ( c p h i ) ; // i n d e g r e e 12 d1 = floor ( d ) ; // 13 d 2 = d - d 1 ; // 14 disp ( ” a n g l e b et w ee n p l a n e s ( 1 22 ) and ( 1 11 ) i s ” + string ( d 1 ) + ” d e g r e e ” + string ( round ( 6 0 * d 2 ) ) + ” minutes”)
Scilab code Exa 3.24 concentration of iron atoms
1 / / Example 3 . 2 4 2 clc ; 3 clear ;
: c o n ce n t ra t i o n o f i r o n
23
4 5 6 7 8 9 10 11 12
close ; format ( ’ v ’ ,9)
/ / g i v e n d at a :
d=7.87; N = 6 . 0 2 3 * 1 0 ^ 2 3 ; / / a v o g a d ro ’ s n um ber A = 5 5 . 8 5 ; / / a t om i c w ei g ht I = A / N ; // mass o f i r o n atom atom=d/I; disp ( a t o m , ” number o f a to ms ( a to ms /cm ˆ 3 ) =
”)
Scilab code Exa 3.25 lattice constants
1 2 3 4 5 6 7 8 9 10 11 12
/ / Exam ple 3 . 2 5 : l a t t i c e c o n s t a n t clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,6)
n=2; A=55.8; N = 6 . 0 2 3 * 1 0 ^ 2 6 ; / / a v og a d ro ’ s nu mb er i n / kg−mole b = 7 . 8 7 * 1 0 ^ 3 ; / / i n k g /mˆ 3 a=((A*n)/(N*b))^(1/3); disp ( a * 1 0 ^ 1 0 , ” l a t t i c e c o n s t a n t , a ( a n g s t r o m ) ” )
Scilab code Exa 3.26 density
1 2 3 4 5 6
/ / Example 3 . 2 6 : d e n s i t y clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,5) 24
7 8 9 10 11 12 13
n=4; N = 6 . 0 2 3 * 1 0 ^ 2 3 ; / / a v o g a d ro ’ s n um ber r = 1 . 2 7 8 * 1 0 ^ - 8 ; // i n cm A=63.5; a = ( r * 4 ) / sqrt ( 2 ) ; // i n cm b=(A*n)/(a^3*N); disp (b , ” d e n s i t y o f c op pe r , b ( g / c c ) = ” )
Scilab code Exa 3.27 number of atoms
1 2 3 4 5 6 7 8 9 10 11 12 13
/ / Exam ple 3 . 2 7 : number o f a to ms clc ; clear ; close ;
/ / g i v e n d at a :
n=4; N = 6 . 0 2 3 * 1 0 ^ 2 3 ; / / a v o g a d ro ’ s n um ber A=55.85; a=2.9*10^-8; b = 7 . 8 7 ; // d e n s i t y i n g / c c
//aˆ3=(A∗ n ) /(N∗ b ) n = round ( ( a ^ 3 * N * b ) / A ) ; disp (n , ” n um be r o f a to ms , n = ” )
Scilab code Exa 3.28 lattice constants
1 2 3 4 5 6 7
/ / Exam ple 3 . 2 8 : l a t t i c e c o n s t a n t clc ; clear ; close ;
/ / g i v e n d at a : d=6250; // den sit y N = 6 . 0 2 * 1 0 ^ 2 3 ; / / a v o g a d r o ’ s n um be r 25
8 9 10 11 12 13 14
n=4; m = 6 0 . 2 * 1 0 ^ - 3 ; / / a t o mi c ma ss M=(n*m)/N; V=M/d; a=V^(1/3)*10^9; disp (a , ” t h e l a t t i c e c o n s t a n t , a ( nm ) = ” )
//ANSWER I S WRONG IN THE TEXT BOOK
Scilab code Exa 3.29 number of atoms
1 2 3 4 5 6 7 8 9 10 11
/ / Exam ple 3 . 2 9 : t h e number o f a to ms clc ; clear ; close ;
/ / g i v e n d at a : d = 7 . 8 7 ; / / i n g / cm ˆ 3
A=55.85; a = 2 . 9 * 1 0 ^ - 8 ; // i n cm N = 6 . 0 2 * 1 0 ^ 2 3 ; / / a v o g a d r o ’ s n um be r n=(d*a^3*N)/A; disp ( round ( n ) , ” t h e nu mber o f atom , n = ” )
Scilab code Exa 3.30 number of vacancies in copper
1 // E xample 3 . 3 0 :
c a l c u l a t e t he number o f v a c a n c i e s
i n t he c op pe r 2 3 4 5 6 7 8
clc ; clear ; close ; B = 1 . 3 8 * 1 0 ^ - 2 3 ; / / b o lt zm a n c o n s t a n t i n J / atom−K B 1 = 8 . 6 2 * 1 0 ^ - 5 ; // b ol zm an c o n s t a n t i n ev / atom−K Q v = 0 . 9 ; // eV/atom t = 2 7 ; // room t em pe ra t y re i n d e g r ee c e l s i u s
26
9 10 11 12 13 14 15 16
p c u = 8 . 4 ; / / i n g / cm ˆ 3 A c v = 6 3 . 5 ; // i n g / mol T = t + 2 7 3 ; / / t e mp e r tu r e i n k e l v i n N v = 6 . 0 2 3 * 1 0 ^ 2 3 ; // P = 8 . 4 ; // N s = ( N v * P ) / A c v ; // number o f r e g u l a r l a t t i c e s i t e s N v 1 = N s * exp ( - Q v / ( B 1 * T ) ) ; // disp ( N v 1 , ” number o f v a c a n c i es i n c op pe r i n v a c a n c i e s /cmˆ3” )
17 / / a ns we r i s wrong i n t he t ex t bo o k
Scilab code Exa 3.31 interplanar spacing
1 2 3 4 5 6 7 8 9 10 11 12
/ / Example 3 . 3 1 : i n t e r p l a n a r s p ac i ng clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,5) theta=20.3;/ / i n d e g r e e l a m d a = 1 . 5 4 ; / / i n a ng st ru m
n=1; a=sind(theta) d=lamda/(2*a); disp (d , ” i n t e r p l a n a r
s p a c i n g , d ( a n gs t ro m ) = ” )
Scilab code Exa 3.32 interatomic spacing
1 2 3 4 5
// Example 3 . 3 2 : i n t e r a t o m i c s p a c in g clc ; clear ; close ;
/ / g i v e n d at a : 27
6 7 8 9 10 11 12
format ( ’ v ’ ,9) theta=30; / / i n d e g r e e l a m d a = 1 . 5 4 ; / / i n a ng st ru m n=1; a=sind(theta) d=lamda/(2*a); disp (d , ” i n t e r a t o m i c s p a c i n g , d ( a n g st r om ) = ” )
Scilab code Exa 3.33 order of Braggs reflection
1 2 3 4 5 6 7 8 9 10 11 12
/ / Example 3 . 3 3 : number o f p e r o r d e r clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,5) theta=90; / / i n d e g r e e l a m d a = 1 . 5 4 ; / / i n a ng st ru m
a=sind(theta) d=1.181; n=(2*d*a)/lamda; disp (n , ” n um ber o f o r d e r , n = ” )
Scilab code Exa 3.34 size of unit cell
1 2 3 4 5 6 7 8
// Example 3 . 3 4 :
s i z e o f u n it c e l l
clc ; clear ; close ; n = 1 ; // a=1; //assume h = 0 . 5 8 ; / / w a v el n e g th i n a r m st r o ng t h = 9 . 5 ; // r e f l e c t i o n a n g l e i n d e g re e
28
9 a 1 = [ 2 ; 0 ; 0 ] ; // m i l l e r i n d i c e s 10 d 2 0 0 = a / ( sqrt ( a 1 ( 1 , 1 ) ^ 2 + a 1 ( 2 , 1 ) ^ 2 + a 1 ( 3 , 1 ) ^ 2 ) ) ; //
i n t e r p l a n a r d i s t a n c e b et we en ( 2 0 0 ) p l a n es 11 a = ( ( n * h ) / ( 2 * d 2 0 0 * s i n d ( t h ) ) ) ;// z s i z e o f u n i t c e l l 12 disp (a , ” s i z e o f u n i t c e l l i n ”) 13 / / amswer i s wrong i n t h e t e xt b o o k
Scilab code Exa 3.35 Bragg angle
1 2 3 4 5 6 7 8 9 10 11 12 13 14
15
/ / Example 3 . 3 5 : b ra gg a n g l e
clc ; clear ; close ; n = 1 ; // a = 3 . 5 7 ; // i n h=0.54; // wavelnegth in a 1 = [ 1 ; 1 ; 1 ] ; // m i l l e r i n d i c e s d 1 1 1 = a / ( sqrt ( a 1 ( 1 , 1 ) ^ 2 + a 1 ( 2 , 1 ) ^ 2 + a 1 ( 3 , 1 ) ^ 2 ) ) ; //
i n t e r p l a n a r d i s t a n c e b et we en ( 1 1 1 ) p l a n es s n d = ( ( n * h ) / ( 2 * d 1 1 1 ) ) ; // t h = a s i n d ( s n d ) ; // b ra gg a n gl e i n d e g r e e d1 = floor ( t h ) ; // d 2 = t h - floor ( d 1 ) ; // disp ( ” a n g l e b et w ee n p l a n e s ( 1 22 ) and ( 1 11 ) i s ” + string ( d 1 ) + ” d e g r e e ” + string ( round ( 6 0 * d 2 ) ) + ” minutes”) / / w av el en gt h i s g i ve n wrong i n ex a m pl e i t i s 0 . 5 4 and i t i s t a k e n a s 1 . 5 4
Scilab code Exa 3.36 interplanar spacing and Miller Indices
1 / / Example 3 . 3 6 :
i n t e r p l a n n e r s p a c i ng and m i l l e r
indices 29
2 3 4 5 6 7 8 9 10 11 12 13
clc ; clear ; close ; a = 3 . 1 6 ; // i n h = 1 . 5 4 ; // i n n = 1 ; // t h = 2 0 . 3 ; // i n d e g re e d = ( ( n * h ) / ( 2 * s i n d ( t h ) ) ) ; // i n t e r p l a n n e r s p a c i n g i n x = a / d ; // y = x ^ 2 ; // i s ”) disp (d , ” i n t e r p l a n n e r s p a c i n g i n disp ( ” m i l l e r i n d i c e s a re ( 11 0) , ( 01 1 ) o r ( 10 1) ” )
Scilab code Exa 3.37 interplanar spacing and diffraction angke
1 // E xample 3 . 3 6 :
i n t e r p l a n n e r s p a c in g and d i f f r a c t i o n a ng le
2 3 4 5 6 7 8 9 10 11 12 13 14
15 16
clc ; clear ; close ; a = . 2 8 6 6 ; // i n h = 0 . 1 5 4 2 ; // i n nm n = 1 ; // a 1 = [ 2 ; 1 ; 1 ] ; // m i l l e r i n d i c e s d 2 1 1 = a / ( sqrt ( a 1 ( 1 , 1 ) ^ 2 + a 1 ( 2 , 1 ) ^ 2 + a 1 ( 3 , 1 ) ^ 2 ) ) ; //
i n t e r p l a n a r d i s t a n c e b et we en ( 2 1 1 ) p l a n es s n d = ( ( n * h ) / ( 2 * d 2 1 1 ) ) ; // t h = a s i n d ( s n d ) ; // b ra gg a n gl e i n d e g r e e d1 = floor ( t h ) ; // d 2 = t h - floor ( d 1 ) ; // disp ( ” a n g l e b et w ee n p l a n e s ( 1 22 ) and ( 1 11 ) i s ” + string ( d 1 ) + ” d e g r e e ” + string ( round ( 6 0 * d 2 ) ) + ” minutes”) i s ”) disp ( d 2 1 1 , ” i n t e r p l a n n e r s p a c i n g i n / / a ns we r i s wrong i n t he t ex t bo o k 30
31
Chapter 5 Electron Theory of Metals
Scilab code Exa 5.1.a probability
1 2 3 4 5 6 7 8 9 10
/ / Example 5 . 1 . a : p r o b a b i l i t y f o r diamond clc , clear
/ / g iv en : format ( ’ v ’ ,9) E g = 5 . 6 ; // i n eV k = 8 6 . 2 * 1 0 ^ - 6 ; // i n eVkˆ −1 T=273+25; // i n K E_Ef=Eg/2; f _ E = 1 / ( 1 + exp ( E _ E f / ( k * T ) ) ) ; disp ( f _ E , ” p r o b a b i l i t y f o r diamond , f E = ” )
Scilab code Exa 5.1.b probability
1 2 3 4 5
// Example 5 . 1 . b : p r o b a b i l i t y f o r s i l i c o n clc , clear
/ / g iv en : E g = 1 . 0 7 ; // i n eV k = 8 6 . 2 * 1 0 ^ - 6 ; // i n eVkˆ −1 32
6 7 8 9 10
T=273+25; // i n K E_Ef=Eg/2; f _ E = 1 / ( 1 + exp ( E _ E f / ( k * T ) ) ) ; disp ( f _ E , ” p r o b a b i l i t y f o r diamond , f E = ” )
/ / a ns we r i s wrong i n book
Scilab code Exa 5.2 resistance
1 2 3 4 5 6 7 8
/ / Example 5 . 2 :
resist ance
clc , clear
/ / g iv en : l = 1 ; // l e n g t h i n m A = 4 * 1 0 ^ - 4 ; // a re a o f c r o s s s e c t i o n i n mˆ2 p = 0 . 0 1 * 1 0 ^ - 2 ; // r e s i s t i v i t y i n ohm−m R=p*(l/A); disp (R , ” r e s i s t a n c e
o f w ir e , R( ohm ) = ” )
Scilab code Exa 5.3 resistance
1 2 3 4 5 6 7 8 9 10
/ / Example 5 . 3 :
resist ance
clc , clear
/ / g iv en : format ( ’ v ’ ,5)
p = 1 . 7 * 1 0 ^ - 8 ; // r e s i s t i v i t y i ohm−m d = 0 . 0 0 0 5 ; // d ia me te r o f t he w ir e i n m l = 3 1 . 4 ; // l e n g th i n m A=(%pi*d^2)/4; R=p*(l/A); disp (R , ” r e s i s t a n c e o f w ir e , R( ohm ) = ” )
33
Scilab code Exa 5.4 conductivity
1 2 3 4 5 6 7 8 9 10 11 12 13
/ / E xample 5 . 4 : c o n d u c t i v i t y clc , clear
/ / g iv en : format ( ’ v ’ ,8) V = . 4 3 2 ; // v o lt a g e d r o p a c r o s s t h e w ir e i n v o l t s I = 1 0 ; // c u r r e n t t hr ou gh t he w ir e i n A l = 1 ; // l e n g t h i n m d = 1 * 1 0 ^ - 3 ; // d ia me te r i n m
R=V/I; A=(%pi*d^2)/4; p=(R*A)/l; b=1/p; disp (b , ” c o n d u c t i v i t t y , b ( ohm ˆ − 1.mˆ − 1 ) = ” )
Scilab code Exa 5.5 drift velocity
1 2 3 4 5 6 7 8 9 10 11 12 13
// E xample 5 . 5 :
drif t velocity
clc , clear
/ / g iv en : format ( ’ v ’ ,5) n = 1 0 ^ 1 9 ; / / i n mˆ 3 b = 0 . 0 1 ; // c o n d u c t i v i t y i n ohmˆ − 1. mˆ−1 V = 0 . 1 7 ; // i n v o l t s d=.27*10^-3; // i n m e=1.602*10^-19; // i n C m = 9 . 1 * 1 0 ^ - 3 1 ; // i n kg E = V / d ; / / i n v o l t /m v=((b*E)/(n*e)); disp (v , ” d r i f t v e l o c i t y
o f e l e c t r o n , v (m/ s e c ) = ” )
Scilab code Exa 5.6 conductivity
34
1 2 3 4 5 6 7 8 9
/ / E xample 5 . 6 : c o n d u c t i v i t y clc , clear
/ / g iv en :
e = 1 . 6 * 1 0 ^ - 1 9 ; // i n C T = 3 0 0 ; / / t em er a t u r e i n K t = 2 * 1 0 ^ - 1 4 ; // t i m e i n s e c c = 6 3 . 5 4 ; // a to mi c w ei gh t o f c op pe r i n a .m. u m = 9 . 1 * 1 0 ^ - 3 1 ; // mass i n kg
/ / we know t h at 6 3 . 4 5 grams o f c op pe r c o n t a i n s 6 . 0 2 3 ∗ 1 0ˆ 23 f r e e e l e c t r o n s s i n c e o ne a tom c o n t r i b u t e s on e e l e c t r o n . t he volume o f 6 3 . 54 gram o f c o pp e r i s 8 . 9 c u b i c c e n t i m e t r e ( c . c ) . 10 n = 6 . 0 2 3 * 1 0 ^ 2 3 / ( c / 8 . 9 ) ; // number o f e l e c t r o n s p er un it volume ( c . c ) 11 n 1 = n * 1 0 ^ 6 ; // t he number o f e l e c t r o n s p er mˆ3 12 b = ( e ^ 2 * n 1 * t ) / m ; 13 disp (b , ” c o n d u c t i v i t y , b ( mho /m) = ” )
Scilab code Exa 5.7 mobility of electrons
1 2 3 4 5 6 7 8 9
// E xample 5 . 7 : m o b i l i t y o f e l e c t r o n s clc , clear
/ / g iv en : format ( ’ v ’ ,8)
e=1.602*10^-19; // i n C m = 9 . 1 * 1 0 ^ - 3 1 ; // i n kg t = 1 0 ^ - 1 4 ; // t i m e i n s e c mu=(e*t)/m; disp ( m u , ” m o b i l i t y o f e l e c t r o n s , mu (mˆ 2/ v o l t s . s e c ) = ” )
Scilab code Exa 5.8 mobility of electrons
35
1 2 3 4 5 6 7 8 9 10 11 12
/ / E xample 5 . 8 : m o b i l i t y clc , clear
/ / g iv en : format ( ’ v ’ ,6) d = 1 0 . 5 ; / / d e n s i t y o f s i l v e r i n gm/ c . c w = 1 0 7 . 9 ; // a to m ic w e ig h t b = 6 . 8 * 1 0 ^ 5 ; // c o n d u c t i v i t y i n mhos /cm e=1.602*10^-19; // i n C
N=6.023*10^23; n=(N*d)/w; mu=b/(e*n); disp ( m u , ” m o b i l i t y
o f e l e c t r o n , mu (mˆ 2/ v o l t − s e c ) = ” )
Scilab code Exa 5.9 mobility of electrons and drift velocity
1 2 3 4 5 6 7 8 9 10 11 12
/ / Example 5 . 9 : m o b i l it y and d r i f t v e l o c i t y clc , clear ;
/ / g iv en :
b = 6 . 5 * 1 0 ^ 7 ; // c o n d u c t i v i t y i n ohmˆ − 1.mˆ−1 e=1.602*10^-19; // i n C n = 6 * 1 0 ^ 2 3 ; // E = 1 ; / / i n V/m mu=b/(e*n); v=mu*E; disp ( m u , ” m o b i l i t y , mu (mˆ 2 / v o l t − s e c ) = ” ) disp (v , ” d r i f t v e l o c i t y , v (m/ s e c ) = ” )
/ / m o bi l i t y and d r i f t i s c a l c u l a t e d wrong i n book
Scilab code Exa 5.10 density and drift velocity
1 // Example 5 . 1 0 2 clc ; 3 clear ;
: d e n s i t y a nd d r i f t v e l o c i t y
36
4 5 6 7 8 9 10 11 12 13 14
close ;
/ / g i v e n d at a : format ( ’ v ’ ,9)
e = 1 . 6 0 2 * 1 0^ - 1 9 ; b = 5 8 * 1 0 ^ 6 ; / / i n ohmˆ−1 mˆ−1 m u _ n = 3 . 5 * 1 0 ^ - 3 ; / / i n mˆ 2/V s E = 0 . 5 ; / / i n V/m n=b/(e*mu_n); disp (n , ” d e n s i t y , n ( mˆ − 3 ) = ” ) v=mu_n*E; disp (v , ” d r i f t v e l o c i t y , v (m/ s ) = ” )
Scilab code Exa 5.11 velocity
1 2 3 4 5 6 7 8 9 10 11
// Example 5 . 1 1 : v e l o c i t y clc ; clear ; close ;
/ / g i v e n d at a : m = 9 . 1 0 9 * 1 0 ^ - 3 1 ; // i n kg e = 1 . 6 0 2 * 1 0^ - 1 9 ; Ef=2.1 / / i n e v W f = e * E f ; // i n J vf = sqrt ( ( 2 * W f ) / m ) ; disp ( v f , ” v e l o c i t y , v f (m/ s ) = ” )
Scilab code Exa 5.12.a velocity
1 2 3 4 5
// Example 5 . 1 2 . a : v e l o c i t y clc ; clear ; close ;
/ / g i v e n d at a : 37
6 7 8 9 10 11 12
m = 9 . 1 * 1 0 ^ - 3 1 ; // i n kg e = 1 . 6 0 2 * 1 0^ - 1 9 ; E f = 3 . 7 5 ; // i n ev W f = ( e * E f ) ; // i n J vf = sqrt ( ( ( 2 * W f ) / m ) ) ; disp ( v f , ” v e l o c i t y , v f (m/ s ) = ” )
/ / a ns we r i s wrong i n book
Scilab code Exa 5.12.b mobility of electrons
1 2 3 4 5 6 7 8 9 10 11 12
// Example 5 . 1 2 . b : m o b il i t y o f e l e c t r o n clc ; clear ; close ;
/ / g i v e n d at a : m = 9 . 1 * 1 0 ^ - 3 1 ; // i n kg
e = 1 . 6 0 2 * 1 0^ - 1 9 ; E f = 3 . 7 5 ; // i n ev t = 1 0 ^ - 1 4 ; // i n s ec mu=(e*t)/m; disp ( m u , ” m o b i l i t y , mu (mˆ 2 / V− s e c ) = ” )
Scilab code Exa 5.13 mean free path
1 2 3 4 5 6 7 8
/ / Example 5 . 1 3 : t h e mean f r e e p at h clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,5) t = 1 0 ^ - 9 ; // i n s ec m = 9 . 1 0 9 * 1 0 ^ - 3 1 ; // i n kg 38
9 10 11 12 13 14
e = 1 . 6 0 2 * 1 0^ - 1 9 ; E f = 7 // i n ev W f = e * E f ; // i n J vf = sqrt ( ( 2 * W f ) / m ) ; lamda=vf*t*10^3; disp ( l a m d a , ” t h e mean f r e e p a th , l am da (mm) = ” )
Scilab code Exa 5.14 mobility and average time
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/ / Example 5 . 1 4 : m o b i l i t y and a v er a ge t im e clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,6)
m = 9 . 1 0 9 * 1 0 ^ - 3 1 ; // i n kg e = 1 . 6 0 2 * 1 0^ - 1 9 ; d = 8 . 9 2 * 1 0 ^ 3 ; / / i n k g /mˆ 3 p = 1 . 7 3 * 1 0 ^ - 8 ; // ohm−m A = 6 3 . 5 ; / / a t o m ic w e i g ht N = 6 . 0 2 3 * 1 0 ^ 2 2 ; / / a v o g a d ro ’ s n um ber n=(N*d)/A; b = 1 / p ; // c o n d u ct i v i t y mu=b/(n*e); disp ( m u , ” m o b i l i t y , mu (mˆ 2 / V−s ) = ” ) t=(mu*m)/e; disp ( t * 1 0 ^ 9 , ” a v e r a g e t i m e , t ( n s ) = ” )
Scilab code Exa 5.15 electrical resistivity
1 // Example 5 . 1 5 2 clc ; 3 clear ;
: electrical
39
resistivity
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
close ;
/ / g i v e n d at a : format ( ’ v ’ ,8)
r = 1 . 8 6 * 1 0 ^ - 1 0 ; // i n m t = 3 * 1 0 ^ - 1 4 ; // i n s ec a=2; m = 9 . 1 * 1 0 ^ - 3 1 ; // i n kg e = 1 . 6 0 2 * 10 ^ - 9 ; A = 2 3 * 1 0 ^ - 3 ; / / i n k g /m N = 6 . 0 2 3 * 1 0 ^ 2 3 ; / / a v o g a d ro ’ s n um ber M=(a*A)/N; V = ( ( 4 / sqrt ( 3 ) ) * r ) ^ 3 ; d=M/V; mu=((e*t)/m); n=(N*d)/A; b = 1 . 6 0 2 * 1 0^ - 1 9 * n * m u ; p=(1/b); disp (p , ” r e s i s t i v i t y , p ( ohm−m ) = ” )
40
Chapter 7 Mechanical Tests of Metals
Scilab code Exa 7.1 shear modulus
1 2 3 4 5 6 7 8 9 10
/ / Example 7 . 1 : s h e ar modulus o f t he m a t e r i a l clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,6) E = 2 1 0 ; / / y o u n g s ’ s m o d u l us i n GN/mˆ 2 v = 0 . 3 ; // p o i s s o n r a t i o G=E/(2*(1+v)); disp (G , ” s h e a r m o du l u s , G(GN/mˆ 2 ) = ” )
Scilab code Exa 7.2 young modulus of elasticity yield point uttimate stress
and percentage elongation 1 // Example 7 . 2 : young ’ s modulus o f
ela st ic it y , yield p o i n t s t r e s s , u l t i m a te s t r e s s and p e r ce n t a g e elongation
2 clc ;
41
clear ; close ; format ( ’ v ’ ,9)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
22 23 24 25
/ / g i v e n d at a : d=40*10^-3;// in m W = 4 0 * 1 0 ^ 3 ; // l o ad i n N d e l _ l = 3 . 0 4 * 1 0 ^ - 5 ; // i n m L = 2 0 0 * 1 0 ^ - 3 ; // i n m load_max=242*10^3;// in N l = 2 4 9 * 1 0 ^ - 3 ; // l e n g t h o f s pe ci me n i n m l 0 = ( d + L ) ; // i n m A=(%pi*d^2)/4; b=W/A; epsilon=del_l/L; E=(b/epsilon); disp (E , ” y o u n g m o du l u s , E ( N/mˆ 2 ) = ” ) Y_load=161*10^3; Y_stress=Y_load/A; disp (Y_ stress , ” y i e l d p o i n t s t r e s s , Y s t r e s s (N/mˆ 2 ) = ”) U_stress=load_max/A; disp (U_ stress , ” u l t i m a t e s t r e s s , U s t r e s s (N/mˆ 2 ) = ” ) p_elongation=((l-l0)/l0)*100; disp (p_elongation , ” p e r c e n t a g e e l o n g a t i o n , p e l o n g a t i o n (%) = ” )
26 / / p e rc e nt a ge e l o n g a t i o n
i s c a l c u l a t e d wrong i n
textbook
Scilab code Exa 7.3.a yield point stress
1 2 3 4 5
// Example 7 . 3 . a : y i e l d p o in t s t r e s s clc ; clear ; close ; format ( ’ v ’ ,10)
42
6 7 8 9 10 11 12 13 14 15
y l = 4 0 ; // y e i l d l o a d i n kN m l = 7 1 . 5 ; / / maximum l o a d i n kN f l = 5 0 . 5 ; // f r a c t u r e l o a d i n kN g l f = 7 9 . 5 ; // g au ge l e n g t h o f f r a t t u r e i n mm s t = 7 . 7 5 * 1 0 ^ - 4 ; // s t r a i n a t l o a d o f 20kN d = 1 2 . 5 ; / / s p e ci m e n d i a m t e r e i n mm s l = 6 2 . 5 ; / / s p ec im en l e n g t h i n mm A = ( % p i * ( d * 1 0 ^ - 3 ) ^ 2 ) / 4 ; // i n m et er s q ua r e y l p = ( ( y l * 1 0 ^ 3 ) / ( A ) ) ; // y e i l d p o i n t s t r e s s i n N/mˆ2 disp ( y l p , ” y e i l d p o i n t s t r e s s i n N/mˆ2 ” )
Scilab code Exa 7.3.b ultimate tensile strength
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Example 7 . 3 . b : u l t i m a te t e n s i l e s t r en g t h
clc ; clear ; close ; format ( ’ v ’ ,10) y l = 4 0 ; // y e i l d l o a d i n kN m l = 7 1 . 5 ; / / maximum l o a d i n kN f l = 5 0 . 5 ; // f r a c t u r e l o a d i n kN g l f = 7 9 . 5 ; // g au ge l e n g t h o f f r a t t u r e i n mm s t = 7 . 7 5 * 1 0 ^ - 4 ; // s t r a i n a t l o a d o f 20kN d = 1 2 . 5 ; / / s p e ci m e n d i a m t e r e i n mm s l = 6 2 . 5 ; / / s p ec im en l e n g t h i n mm A = ( % p i * ( d * 1 0 ^ - 3 ) ^ 2 ) / 4 ; // i n m et er s q ua r e y l p = ( ( y l * 1 0 ^ 3 ) / ( A ) ) ; // y e i l d p o i n t s t r e s s i n N/mˆ2 u t s = ( ( m l * 1 0 ^ 3 ) / ( A ) ) ; // u l ti m a t e t e n s i l e s t r a n g th i n N
/mˆ2 16 disp ( u t s , ” u l t i m at e
t e n s i l e s t r a n g th i n N/mˆ2 ” )
Scilab code Exa 7.3.c percentage elongation
43
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Example 7 . 3 . c : p e r ce n t a ge e l o n g a t i o n
clc ; clear ; close ; format ( ’ v ’ ,10) y l = 4 0 ; // y e i l d l o a d i n kN m l = 7 1 . 5 ; / / maximum l o a d i n kN f l = 5 0 . 5 ; // f r a c t u r e l o a d i n kN g l f = 7 9 . 5 ; // g au ge l e n g t h o f f r a t t u r e i n mm s t = 7 . 7 5 * 1 0 ^ - 4 ; // s t r a i n a t l o a d o f 20kN d = 1 2 . 5 ; / / s p e ci m e n d i a m t e r e i n mm s l = 6 2 . 5 ; / / s p ec im en l e n g t h i n mm a = ( % p i * d * 1 0 ^ - 3 ) ^ 2 / 4 ; // i n m et er s q ua r e p e l = ( ( g l f - s l ) / s l ) * 1 0 0 ; // p e r c e n t a g e e l o n g a t i o n disp ( p e l , ” p e r ce n t ag e e l o n g a t i o n i s ” )
Scilab code Exa 7.3.d modulus of elasticity
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Example 7 . 3 . d : modulus of
elasticity
clc ; clear ; close ; format ( ’ v ’ ,8) y l = 4 0 ; // y e i l d l o a d i n kN m l = 7 1 . 5 ; / / maximum l o a d i n kN f l = 5 0 . 5 ; // f r a c t u r e l o a d i n kN g l f = 7 9 . 5 ; // g au ge l e n g t h o f f r a t t u r e i n mm s t = 7 . 7 5 * 1 0 ^ - 4 ; // s t r a i n a t l o a d o f 20kN d = 1 2 . 5 ; / / s p e ci m e n d i a m t e r e i n mm s l = 6 2 . 5 ; / / s p ec im en l e n g t h i n mm A = ( % p i * ( d * 1 0 ^ - 3 ) ^ 2 ) / 4 ; // i n m et er s q ua r e y l p = ( ( y l * 1 0 ^ 3 ) / ( A ) ) ; // y e i l d p o i n t s t r e s s i n N/mˆ2 u t s = ( ( m l * 1 0 ^ 3 ) / ( A ) ) ; // u l ti m a t e t e n s i l e s t r a n g th i n N
/mˆ2 16 p e l = ( ( g l f - s l ) / s l ) * 1 0 0 ; // p e r c e n t a g e e l o n g a t i o n
44
17 s t r s s = ( ( 2 0 * 1 0 ^ 3 ) / A ) ; / / s t r e s s a t 2 0kN i n N/mˆ 2 18 m e l = s t r s s / s t ; // modulus of e l a s t i c i t y in N/mˆ2 19 disp ( m e l , ”modulus of e l a s t i c i t y in N/mˆ2” )
Scilab code Exa 7.3.e modulus of resilience
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Example 7 . 3 . e : y i e l d p o in t s t r e s s
clc ; clear ; close ; format ( ’ v ’ ,6) y l = 4 0 ; // y e i l d l o a d i n kN m l = 7 1 . 5 ; / / maximum l o a d i n kN f l = 5 0 . 5 ; // f r a c t u r e l o a d i n kN g l f = 7 9 . 5 ; // g au ge l e n g t h o f f r a t t u r e i n mm s t = 7 . 7 5 * 1 0 ^ - 4 ; // s t r a i n a t l o a d o f 20kN d = 1 2 . 5 ; / / s p e ci m e n d i a m t e r e i n mm s l = 6 2 . 5 ; / / s p ec im en l e n g t h i n mm A = ( % p i * ( d * 1 0 ^ - 3 ) ^ 2 ) / 4 ; // i n m et er s q ua r e y l p = ( ( y l * 1 0 ^ 3 ) / ( A ) ) ; // y e i l d p o i n t s t r e s s i n N/mˆ2 u t s = ( ( m l * 1 0 ^ 3 ) / ( A ) ) ; // u l ti m a t e t e n s i l e s t r a n g th i n N
/mˆ2 16 17 18 19 20
p e l = ( ( g l f - s l ) / s l ) * 1 0 0 ; // p e r c e n t a g e e l o n g a t i o n s t r s s = ( ( 2 0 * 1 0 ^ 3 ) / A ) ; / / s t r e s s a t 2 0kN i n N/mˆ 2 m e l = s t r s s / s t ; // modulus of e l a s t i c i t y in N/mˆ2 m r s = ( ( y l p * 1 0 ^ - 3 ) ^ 2 / ( 2 * m e l ) ) ;// modulu s o f r e s i l i e n c e disp ( m r s , ” m o d u l u s o f r e s i l i e n c e i s ” )
Scilab code Exa 7.3.f fracture stress
1 // Example 7 . 3 . f : 2 clc ; 3 clear ;
fracture stre ss
45
4 5 6 7 8 9 10 11 12 13 14 15
close ; format ( ’ v ’ ,10) y l = 4 0 ; // y e i l d l o a d i n kN m l = 7 1 . 5 ; / / maximum l o a d i n kN f l = 5 0 . 5 ; // f r a c t u r e l o a d i n kN g l f = 7 9 . 5 ; // g au ge l e n g t h o f f r a t t u r e i n mm s t = 7 . 7 5 * 1 0 ^ - 4 ; // s t r a i n a t l o a d o f 20kN d = 1 2 . 5 ; / / s p e ci m e n d i a m t e r e i n mm s l = 6 2 . 5 ; / / s p ec im en l e n g t h i n mm A = ( % p i * ( d * 1 0 ^ - 3 ) ^ 2 ) / 4 ; // i n m et er s q ua r e y l p = ( ( y l * 1 0 ^ 3 ) / ( A ) ) ; // y e i l d p o i n t s t r e s s i n N/mˆ2 u t s = ( ( m l * 1 0 ^ 3 ) / ( A ) ) ; // u l ti m a t e t e n s i l e s t r a n g th i n N
/mˆ2 16 17 18 19 20 21
p e l = ( ( g l f - s l ) / s l ) * 1 0 0 ; // p e r c e n t a g e e l o n g a t i o n s t r s s = ( ( 2 0 * 1 0 ^ 3 ) / A ) ; / / s t r e s s a t 2 0kN i n N/mˆ 2 m e l = s t r s s / s t ; // modulus of e l a s t i c i t y in N/mˆ2 m r s = ( ( y l p * 1 0 ^ - 3 ) ^ 2 / ( 2 * m e l ) ) ;// modulu s o f r e s i l i e n c e f s = ( ( f l * 1 0 ^ 3 ) / ( A ) ) ; // f r a c t u r e s t r e s s i n N/mˆ2 disp ( f s , ” f r a c t u r e s t r e s s i n N/mˆ2 ” )
Scilab code Exa 7.3.g modulus of toughness
1 2 3 4 5 6 7 8 9 10 11 12 13
/ / Exa mpl e 7 . 3 . g : m od ul us o f t o u g h n e s s
clc ; clear ; close ; format ( ’ v ’ ,10) y l = 4 0 ; // y e i l d l o a d i n kN m l = 7 1 . 5 ; / / maximum l o a d i n kN f l = 5 0 . 5 ; // f r a c t u r e l o a d i n kN g l f = 7 9 . 5 ; // g au ge l e n g t h o f f r a t t u r e i n mm s t = 7 . 7 5 * 1 0 ^ - 4 ; // s t r a i n a t l o a d o f 20kN d = 1 2 . 5 ; / / s p e ci m e n d i a m t e r e i n mm s l = 6 2 . 5 ; / / s p ec im en l e n g t h i n mm
46
14 A = ( % p i * ( d * 1 0 ^ - 3 ) ^ 2 ) / 4 ; // i n m et er s q ua r e 15 y l p = ( ( y l * 1 0 ^ 3 ) / ( A ) ) ; // y e i l d p o i n t s t r e s s i n N/mˆ2 16 u t s = ( ( m l * 1 0 ^ 3 ) / ( A ) ) ; // u l t i m a t e t e n s i l e s t r a n g th i n N
/mˆ2 17 18 19 20 21 22
p e l = ( ( g l f - s l ) / s l ) * 1 0 0 ; // p e r c e n t a g e e l o n g a t i o n s t r s s = ( ( 2 0 * 1 0 ^ 3 ) / A ) ; / / s t r e s s a t 2 0kN i n N/mˆ 2 m e l = s t r s s / s t ; // modulus of e l a s t i c i t y in N/mˆ2 m r s = ( ( y l p * 1 0 ^ - 3 ) ^ 2 / ( 2 * m e l ) ) ;// modulu s o f r e s i l i e n c e f s = ( ( f l * 1 0 ^ 3 ) / ( A ) ) ; // f r a c t u r e s t r e s s i n N/mˆ2 m t h = ( ( y l p + u t s ) * ( p e l / 1 0 0 ) ) / 2 ; / / mo du lu s o f t o u g hn e s s
i n N/mˆ2 23 disp ( m t h , ” m od ul us o f t o u g h n e s s i n N/mˆ 2 ”) 24 / / p e r c e n t a g e r e d u ct i o n i n a re a i s n o t c a l u l a t e d i n t h e t e xt b o ok
Scilab code Exa 7.4 true breaking and nominal breaking stress
1 2 // Example 7 . 4 :
t r u e b r ea k i ng s t r e s s and n om in al b r e a k i ng s t r e s s
3 4 5 6 7 8 9 10 11 12 13 14
clc ; clear ; close ; format ( ’ v ’ ,4)
/ / g i v e n d at a : d 1 = 1 2 . 7 ; / / i n mm B _ l o a d = 1 4 ; // i n K−N A 1 = ( % p i * d 1 ^ 2 ) / 4 ; // o r i g i n a l c r o s s s e c t i o n a r e a d 2 = 7 . 8 7 ; / / i n mm A 2 = ( % p i * d 2 ^ 2 ) / 4 ; // f i n a l c r o s s s c t i o n a r e a
T_stress=B_load/A2; disp ( T _ s t r e s s * 1 0 0 0 , ” t r u e b r e a k i ng s t r e s s , T s t r e s s (N/ mmˆ2 ) = ” ) 15 N _ s t r e s s = B _ l o a d / A 1 ; 16 disp ( N _ s t r e s s * 1 0 0 0 , ” n om in al b r ea k i ng s t r e s s , N s t r e s s
47
(N/mmˆ 2 ) = ” ) 17 / / t r ue b r e a k i ng s t r e s s u n it i s wrong i n t he t ex tb oo k
Scilab code Exa 7.5.a yield stress
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Example 7 . 5 . a : y i e l d p o in t s t r e s s
clc ; clear ; close ; format ( ’ v ’ ,10) y l = 3 4 ; // y e i l d l o a d i n kN u l = 6 1 ; // u l t i m a te l o ad i n kN f l = 7 8 ; // f i n a l l e n g t h i n mm g l f = 6 0 ; // g au ge l e ng t h o f f r a t t u r e i n mm f d = 7 ; // f i n a l d i am t er e i n mm d = 1 2 ; / / s p e ci m e n d i a m t e r e i n mm s l = 6 2 . 5 ; / / s p ec im en l e n g t h i n mm A = ( % p i * ( d ) ^ 2 ) / 4 ; // i n m et er s q ua r e y l p = ( ( y l * 1 0 ^ 3 ) / ( A ) ) ; / / y e i l d p o i n t s t r e s s i n N/mmˆ 2 disp ( floor ( y l p ) , ” y e i l d p o i n t s t r e s s i n N/mmˆ 2 ” )
Scilab code Exa 7.5.b ultimate tesnile stress
1 2 3 4 5 6 7 8 9 10
// Example 7 . 5 . b : u l t i m a te t e n s i l e
clc ; clear ; close ; format ( ’ v ’ ,6) y l = 3 4 ; // y e i l d l o a d i n kN u l = 6 1 ; // u l t i m a te l o ad i n kN f l = 7 8 ; // f i n a l l e n g t h i n mm g l f = 6 0 ; // g au ge l e ng t h o f f r a t t u r e f d = 7 ; // f i n a l d i am t er e i n mm
48
str ess
i n mm
11 12 13 14
d = 1 2 ; / / s p e ci m e n d i a m t e r e i n mm s l = 6 2 . 5 ; / / s p ec im en l e n g t h i n mm A = ( % p i * ( d ) ^ 2 ) / 4 ; // i n m et er s q ua r e u t s = ( ( u l * 1 0 ^ 3 ) / ( A ) ) ; // u l ti m a t e t e n s i l e
s t r a n g th i n N
/mmˆ2 15 disp ( u t s , ” u l t i m a t e
t e n s i l e s t r a n g t h i n N/mmˆ 2 ”)
Scilab code Exa 7.5.c percentage reduction
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/ / Example 7 . 5 . c : p e r c e n t a g e r e d u c t i o n
clc ; clear ; close ; format ( ’ v ’ ,4) y l = 3 4 ; // y e i l d l o a d i n kN u l = 6 1 ; // u l t i m a te l o ad i n kN f l = 7 8 ; // f i n a l l e n g t h i n mm g l f = 6 0 ; // g au ge l e ng t h o f f r a t t u r e i n mm f d = 7 ; // f i n a l d i am t er e i n mm d = 1 2 ; / / s p e ci m e n d i a m t e r e i n mm s l = 6 2 . 5 ; / / s p ec im en l e n g t h i n mm A = ( % p i * ( d ) ^ 2 ) / 4 ; / / i n mm s q u a r e A 1 = ( % p i * ( f d ) ^ 2 ) / 4 ; / / i n mm s q u a r e p r = ( A - A 1 ) / A ; // disp ( p r * 1 0 0 , ” p e r ce n t ag e r e d u c ti o n i s ” )
Scilab code Exa 7.5.d percentage elongation
1 2 3 4 5
/ / Example 7 . 5 . d : p e r c e n t a g e e l o n a g t i o n clc ; clear ; close ; format ( ’ v ’ ,4)
49
6 7 8 9 10 11 12 13 14 15 16
y l = 3 4 ; // y e i l d l o a d i n kN u l = 6 1 ; // u l t i m a te l o ad i n kN f l = 7 8 ; // f i n a l l e n g t h i n mm g l f = 6 0 ; // g au ge l e ng t h o f f r a t t u r e i n mm f d = 7 ; // f i n a l d i am t er e i n mm d = 1 2 ; / / s p e ci m e n d i a m t e r e i n mm s l = 6 2 . 5 ; / / s p ec im en l e n g t h i n mm A = ( % p i * ( d ) ^ 2 ) / 4 ; / / i n mm s q u a r e A 1 = ( % p i * ( f d ) ^ 2 ) / 4 ; / / i n mm s q u a r e p r = ( f l - g l f ) / g l f ; // disp ( p r * 1 0 0 , ” p e r ce n t ag e e l o n a g t i o n i s ” )
Scilab code Exa 7.6 strain
1 2 3 4 5 6 7 8 9 10 11
// Example 7 . 6 : s t r a i n clc ; clear ; close ; format ( ’ v ’ ,10)
/ / g i v e n d at a : b=44.5*10^3;/ / f o r c e E = 1 . 1 * 1 0 ^ 5 ; // i n N/mmˆ2 A = 1 5 . 2 * 1 9 . 1 // in mmˆ2 epsilon=b/(A*E); disp (eps ilon , ” s t r a i n , e p s i l o n (mm) = ” )
Scilab code Exa 7.7 true stress and true strain
1 2 3 4 5
/ / Example 7 . 7 : s t r e s s and s t r a i n clc ; clear ; close ; format ( ’ v ’ ,6)
50
6 7 8 9 10 11 12
/ / g i v e n d at a : s i g m a = 4 5 0 ; // i n MPa
epsilon=0.63; sigma_t=sigma*(1+epsilon); disp (sig ma_t , ” t r u e s t r e s s , s i g m a t ( MPa ) = ” ) e p s i l o n _ t =log ( 1 + e p s i l o n ) ; disp (epsilon_t , ” t r u e s t r a i n , e p s i l o n t = ” )
Scilab code Exa 7.8 greater stress
1 2 3 4 5 6 7 8 9 10 11 12 13
/ / E xample 7 . 8 : wh ich p a r t h a s a g r e a t e r s t r e s s
clc ; clear ; close ; l = 2 4 ; / / l e n g t h i n mm b = 3 0 ; / / b r e a d t h i n mm l d = 7 0 0 0 ; // l o ad i n kg s d = 1 0 ; // s t e e l b ar d i am t er e i n mm s l = 5 0 0 0 ; // l o ad i n kg a l = l d / ( l * b ) ; / / s t r e s s o n a l um i ni u m b a r i n k g /mmˆ 2 a = ( ( % p i * s d ^ 2 ) / 4 ) ; / / a r e a i n mmˆ 2 s l b = s l / a ; // s t r e s s on s t e e l b ar i n kg /mmˆ2 disp ( ” s t r e s s on al u mi n iu m b a r i s ” + string ( a l ) + ” k g / mmˆ2 i s l e s s t h a n s t r e s s on s t e e l b a r ” + string ( s l b ) + ” kg/mmˆ2 ” )
51
Chapter 8 Mechanical Tests of Metals
Scilab code Exa 8.1 critical resolved shear stress
1 // Example 8 . 1 :
c r i t i c a l r e s o l v e d s h ea r s t r e s s o f
silver 2 3 4 5 6 7 8 9
10 11
12
clc ; clear ; close ; format ( ’ v ’ ,5) T s = 1 5 ; // t e n s i l e s t r e s s i n Mpa d=[1;1;0]; d1=[1;1;1]; csda=((d(1,1)*d1(1,1))+(d(2,1)*d1(2,1))+(d(3,1)*d1 ( 3 , 1 ) ) ) / ( ( sqrt ( d ( 1 , 1 ) ^ 2 + d ( 2 , 1 ) ^ 2 + d ( 3 , 1 ) ^ 2 ) ) * sqrt ( d 1 ( 1 , 1 ) ^ 2 + d 1 ( 2 , 1 ) ^ 2 + d 1 ( 3 , 1 ) ^ 2 ) ) ; // a n g l e d e g r e e d2=[0;1;1]; csdb=((d(1,1)*d2(1,1))+(d(2,1)*d2(2,1))+(d(3,1)*d2 ( 3 , 1 ) ) ) / ( ( sqrt ( d ( 1 , 1 ) ^ 2 + d ( 2 , 1 ) ^ 2 + d ( 3 , 1 ) ^ 2 ) ) * sqrt ( d 2 ( 1 , 1 ) ^ 2 + d 2 ( 2 , 1 ) ^ 2 + d 2 ( 3 , 1 ) ^ 2 ) ) ; // a n g l e d e g r e e t = T s * c s d a * c s d b ;/ / c r i t i c a l r e s o l v e d s h e a r s t r e s s i n
MPa 13 disp (t , ” c r i t i c a l
r e s o l v e d s h e a r s t r e s s i n MPa” )
52
Scilab code Exa 8.2 yield strength
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// / / Ex E xample 8 . 2 :
y i e l d s t r en en g t h o f m a t er i a l
clc ; clear ; close ; format ( ’ v ’ ,6 , 6 ) MN N/mmˆ 2 ys1=115; // ye il d str eng th in M y s 2 = 2 1 5 ; / / y e i l d s t r e n g t h i n MN MN/mmˆ 2 d 1 = 0 . 0 4 ; / / d i a m t e r e i n mm d 2 = 0 . 0 1 ; / / d i a m t e r e i n mm A = [2 [ 2 1 0 ; 1 1 0] 0] ; B=[230;215]; x=A\B; s i = x ( 1 , 1 ) ; // i n MN/mmˆ2 k=x(2,1); // d 3 = 0 . 0 1 6 ; // i n mm s y = s i + ( k/ k / sqrt ( d 3 ) ) ; / / y e i l d s t re r e n ggtt h f o r a g r ai ai n
s i z e in MN/mmˆ2 17 disp ( s y , ” y e i l d s t r e n g t h f o r a g r a i n s i z e i n MN MN/mmˆ 2 ” )
Scilab code Exa 8.3 yield stress
1 2 3 4 5 6 7 8
// / / Ex E xample 8 . 3 :
y i e l d s t r en en g t h o f m a t er i a l
clc ; clear ; close ; MN N/mmˆ 2 ys1=120; // ye il d str eng th in M MN/mmˆ 2 y s 2 = 2 2 0 ; / / y e i l d s t r e n g t h i n MN d 1 = 0 . 0 4 ; / / d i a m t e r e i n mm d 2 = 0 . 0 1 ; / / d i a m t e r e i n mm
53
9 10 11 12 13 14 15
A = [2 [ 2 1 0 ; 1 1 0] 0] ; B=[240;220]; x=A\B; s i = x ( 1 , 1 ) ; // i n MN/mmˆ2 k=x(2,1); // d 3 = 0 . 0 2 5 ; // i n mm r e n gt g t h f o r a g r ai ai n s y = s i + ( k/ k / sqrt ( d 3 ) ) ; / / y e i l d s t re
s i z e in MN/mmˆ2 16 disp ( s y , ” y e i l d s t r e n g t h f o r a g r a i n s i z e i n MN MN/mmˆ 2 ” )
Scilab code Exa 8.4 grain diameter
1 2 3 4 5 6 7 8 9 10
/ / Ex Ex a m p l e 8 . 4 : g r a i n d i am a m et e t er er clc ; clear ; close ; format ( ’ v ’ ,6 , 6 )
/ / g i v e n d at at a :
N=9; m=8*2^N; g r a i n = 1 / sqrt ( m ) ; disp ( g r a i n , ” t h e g r a i n d i a m e t e r (mm) = ” )
54
Chapter 9 Fracture of Metals
Scilab code Exa 9.1 fracture strength
1 2 3 4 5 6 7 8 9 10
/ / Ex Exam ple 9 . 1 : d i f f e r e n c e clc ; clear ; close ;
/ / g i v e n d at at a : E = 2 0 0 * 1 0 ^ 9 ; / / i n N/mˆ 2 C=(4*10^-6)/2; // i n m /mˆ 2 g a m a = 1 . 4 8 ; / / i n J /m s i g m a = sqrt ( ( 2 * E * g a m a ) / ( % p i * C ) ) ; disp ( s i g m a * 1 0 ^ - 6 , ” f r a c t u r e s t r e n g t h , s i g m a (MN/mˆ 2 ) = ”)
Scilab code Exa 9.2 fracture strength
1 2 3 4
/ / Ex Ex a m p l e 9 . 2 : t he he f r a c t u r e s t r e n g t h and c o m p a r e clc ; clear ; close ;
55
5 6 7 8 9 10 11
format ( ’ v ’ ,10)
/ / g i v e n d at a : E = 7 0 * 1 0 ^ 9 ; / / i n N/mˆ 2 C = ( 4 . 2 * 1 0 ^ - 6 ) / 2 ; // i n m g a m a = 1 . 1 ; / / i n J /mˆ 2 s i g m a = sqrt ( ( 2 * E * g a m a ) / ( % p i * C ) ) ; disp ( s i g m a , ” f r a c t u r e s t r e n g t h , s i g ma (N/mˆ 2 ) = ” )
Scilab code Exa 9.3 maximum length
1 2 3 4 5 6 7 8 9 10 11 12
/ / Example 9 . 3 : maximum l e n g t h o f s u r f a c e f clc ; clear ; close ; format ( ’ v ’ ,7)
/ / g i v e n d at a : s i g m a = 3 6 ; // in MN/mˆ2 g a m a = 0 . 2 7 ; / / i n J /mˆ 2 E = 7 0 * 1 0 ^ 9 ; // i n N/mˆ2 C=((2*E*gama)/(sigma^2*%pi))*10^-6; C2=2*C; disp ( C 2 , ” maximum l e n g t h o f s u r f a c e f l o w , C2 ( m i cr o −m) = ”)
Scilab code Exa 9.4.a temperture
1 2 3 4 5 6 7
/ / E xa mp le 9 . 4 . a : T e mp e ra t ur e
clc ; clear ; close ; format ( ’ v ’ ,6) E = 3 5 0 ; // i n GN/mˆ2 Y = 2 ; / / i n J /mˆ 2
56
8 9 10 11
C = 2 ; // i n m ic ro m et er sg = sqrt ( ( 2 * E * 1 0 ^ 9 * Y ) / ( % p i * C * 1 0 ^ - 6 ) ) ; // IN mn/Mˆ2 e = 1 0 ^ - 2 ; // p er s ec on d T = 1 7 3 6 0 0 / ( round (sg*10^-6) -20.6-61.3*(log10 ( e ) ) ) ; //
i n k e lv i n 12 disp (T , ” t e m pe rt u re i n k e l v i n f o r d u c t i l e t o b r i t t l e t r a n s i t i o n a t a s t r a i n r a t e o f 10ˆ − 2 p er s ec on d ” )
Scilab code Exa 9.4.b temperature
1 2 3 4 5 6 7 8 9 10 11
/ / E xa mp le 9 . 4 . b : T e mp e ra t ur e
clc ; clear ; close ; format ( ’ v ’ ,5) E = 3 5 0 ; // i n GN/mˆ2 Y = 2 ; / / i n J /mˆ 2 C = 2 ; // i n m ic ro m et er sg = sqrt ( ( 2 * E * 1 0 ^ 9 * Y ) / ( % p i * C * 1 0 ^ - 6 ) ) ; // IN mn/Mˆ2 e = 1 0 ^ - 5 ; // p er s ec on d T = 1 7 3 6 0 0 / ( round (sg*10^-6) -20.6-61.3*(log10 ( e ) ) ) ; //
i n k e lv i n 12 disp (T , ” t e m pe rt u re i n k e l v i n f o r d u c t i l e t o b r i t t l e t r a n s i t i o n a t a s t r a i n r a t e o f 10ˆ − 5 p er s ec on d ” )
57
Chapter 15 Composite Materials and Ceramics
Scilab code Exa 15.1 volume ratio of aluminium and boron
1 2 3 4 5 6 7 8 9 10 11 12 13
/ / Example 1 5 . 1 : c ol um e r a t i o o f a lu mi ni um and b or on
clc ; clear ; close ; format ( ’ v ’ ,6) y a l = 7 1 5 ; / / i n GN/ , ˆ 2 y f e = 2 1 0 ; / / i n GN/ , ˆ 2 y b = 4 4 0 ; / / i n GN/ , ˆ 2 A = [ 7 1 7 1; 71 4 40 ]; // B = [ 7 1 ; 2 1 0 ] ; // X = A \ B ; // disp ( X ( 1 , 1 ) , ” volume r a t i o disp ( X ( 2 , 1 ) , ” volume r a t i o
o f a lu min iu m i s ” ) o f b or o n i s ” )
58
Chapter 16 Semiconductors
Scilab code Exa 16.1 concentration of conductive electrons
1 2 3 4 5 6 7 8 9 10 11 12
/ / Example 1 6 . 1 : c o n c e n t r a t i o n clc ; clear ; close ; format ( ’ v ’ ,9)
/ / g i v e n d at a :
e=1.602*10^-19; s i g m a _ i = 5 * 1 0 ^ - 4 ; / / i n ohm /m m u _ n = 0 . 1 4 ; / / i n mˆ 2 /V− s e c m u _ p = 0 . 0 5 ; / / i n mˆ 2 /V− s e c n_i=sigma_i/(e*(mu_n+mu_p)); disp ( n _ i * 1 0 ^ 6 , ” t h e c o n c e n t r a t i o n , n i ( /cm ˆ 3) = ” )
Scilab code Exa 16.2 intrinsic carrier density
1 / / E xa mp le 1 6 . 2 2 clc ; 3 clear ;
: i n t r i n s i c c a r ri e r
59
4 5 6 7 8 9 10 11 12
close ; format ( ’ v ’ ,9)
/ / g i v e n d at a :
e=1.602*10^-19; p _ i = 2 * 1 0 ^ - 4 ; / / i n ohm−m m u _ n = 6 ; / / i n mˆ 2 /V− s e c m u _ p = 0 . 2 ; / / i n mˆ 2 /V− s e c n_i=1/(e*(mu_n+mu_p)*p_i); disp ( n _ i , ” t h e i n t r i n s i c c a r r i e r , n i ( /mˆ 3 ) = ” )
Scilab code Exa 16.3 concentration of N type impurity
1 2 3 4 5 6 7 8 9 10 11 12
/ / Example 1 6 . 3 : n e g l e c t t h e i n t r i n s i c c o n d u c t i v i t y clc ; clear ; close ; format ( ’ v ’ ,9)
/ / g i v e n d at a :
e=1.6*10^-19; s i g m a = 1 0 ^ - 1 2 ; / / i n mho s/m m u _ n = 0 . 1 8 ; / / i n mˆ 2 /V− s e c n=sigma/(e*mu_n); N=n; disp (N , ” i n ( /mˆ 3 ) = ” )
Scilab code Exa 16.4 concentration number of electrons carrier
1 2 3 4 5 6
/ / Example 1 6 . 4 : number o f e l e c t r o n c a r r i e r s clc ; clear ; close ; format ( ’ v ’ ,9)
/ / g i v e n d at a : 60
7 8 9 10 11
e=1.6*10^-19; p = 2 0 * 1 0 ^ - 2 ; / / i n ohm−m m u _ n = 1 0 0 * 1 0 ^ - 4 ; / / i n mˆ 2 /V− s e c n=1/(e*mu_n*p); disp (n , ” number o f e l e c t r o n s c a r r i e r , n ( /mˆ 3 ) = ” )
Scilab code Exa 16.5 concentration of impurity
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// Example 1 6 . 5 : c o n c e n t r a t i o n o f i m pu r it y
clc ; clear ; close ; format ( ’ v ’ ,9) e = 1 . 6 * 1 0 ^ - 1 9 ; // l = 1 0 ; // i n mm d = 1 ; // i n mm r = 1 0 0 ; / / i n o hm s u p = 0 . 1 9 ; // m ob il ty o f e l e c t r o n s i n V− s e c a = ( % p i * ( ( d * 1 0 ^ - 3 ) ^ 2 ) ) / 4 ; / / a r e a i n mˆ 2 p = ( ( r * a ) ) / ( l * 1 0 ^ - 3 ) ; // r e s i s t i v i t y i n Ohm−cm n = ( ( 1 / ( p * e * u p ) ) ) ; // c o n c e n t r a t i o n i n p e r mˆ 3 disp (n , ” i m pu ri ty c o n c e n t r a t i o n i s i n p er mˆ3 ” )
Scilab code Exa 16.6 intrinsic carrier density
1 2 3 4 5 6 7 8
/ / Exam ple 1 6 . 6 : i n t r i n s i c c a r r i e r d e n s i t y clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,10) e=1.602*10^-19; p = 3 0 0 0 ; / / i n ohm /m
61
9 10 11 12 13
s i g m a = 1 / p ; / / i n ohm /m m u _ n = 0 . 1 4 ; / / i n mˆ 2 /V− s e c m u _ p = 0 . 0 5 ; / / i n mˆ 2 /V− s e c n_i=sigma/(e*(mu_n+mu_p)); disp ( n _ i , ” t h e c o n c e n t r a t i o n , n i ( /mˆ 3 ) = ” )
Scilab code Exa 16.7 conductivity
1 2 3 4 5 6 7 8 9 10 11
/ / Example 1 6 . 7 : c o n d u c t i v i t y clc ; clear ; close ;
/ / g i v e n d at a :
e=1.602*10^-19; n _ i = 5 . 0 2 1 * 1 0 ^ 1 5 ; / / i n mˆ−3 m u _ n = 0 . 4 8 ; / / i n mˆ 2 /V− s e c m u _ p = 0 . 0 1 3 ; / / i n mˆ 2 /V− s e c sigma=n_i*(e*(mu_n+mu_p)); disp ( s i g m a , ” t h e c o n d u c t i v i t y , s i g ma ( ohmˆ −1 mˆ − 1 ) = ” )
62
Chapter 17 Insulating Materials
Scilab code Exa 17.1 greater charge
1 2 3 4 5 6 7 8 9 10 11 12 13
/ / Example 1 7 . 1 : g r e a t e r c ha nr ge
clc ; clear ; close ; format ( ’ v ’ ,10) e r 1 = 6 ; // d 1 = 0 . 2 5 ; / / i n mm a = 1 ; / / a s su me e r 2 = 2 . 6 ; // d 2 = 0 . 1 ; / / i n mm c 1 = ( e r 1 / d 1 ) ; // i n a mpere c 2 = ( e r 2 / d 2 ) ; // i n a mp er es disp ( ” C 1 ” + string ( c 1 ) + ”A w i l l t h a n C 2 ” + string ( c 2 ) + ”A ” )
63
h ol d t he more c h ar g e
Chapter 18 Magnetic Materials
Scilab code Exa 18.1 magnetization and flux density
1 2 3 4 5 6 7 8 9 10 11 12 13
/ / Example 1 8 . 1 : m a g ne t iz a t io n and f l u x d e n s i t y clc ; clear ; close ;
/ / g i v e n d at a :
mu0=4*%pi*10^-7; H = 1 0 ^ 4 ; / / i n A/m X m = 3 . 7 * 1 0 ^ - 3 ; / / room t e m p e r a tu r e mu_r=1+Xm; B=mu0*mu_r*H; M=Xm*H; disp (B , ” t h e f l u x d e n s i t y , B (Wb/mˆ 2 ) = ” ) disp (M , ” m a g n e t i z a t i o n , M ( A / m ) = ” )
Scilab code Exa 18.2.a saturation magnetisation
1 // Example 1 8 . 2 . a : 2 clc ;
s a t u r a t i o n m a g ne t i za t i on
64
3 4 5 6 7 8 9 10 11 12
clear ; close ;
/ / g i v e n d at a :
m u _ b = 9 . 2 7 * 1 0 ^ - 2 4 ; // A.mˆ2 p = 8 . 9 ; / / i n g /cm ˆ3 N a = 6 . 0 2 3 * 1 0 ^ 2 3 ; / / a v o g a d ro ’ s n um ber A = 5 8 . 7 1 ; // i n g / mol n=((p*Na)/A)*10^6; Ms=0.60*mu_b*n; disp ( M s , ” s a t u r a t i o n m a g n e t i z a t i o n , Ms (A/m) = ” )
Scilab code Exa 18.2.b saturation flux density
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Example 1 8 . 2 . b : s a t u r a t i o n f l u x d e n s i t y clc ; clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,5)
mu0=4*%pi*10^-7; m u _ b = 9 . 2 7 * 1 0 ^ - 2 4 ; // A.mˆ2 p = 8 . 9 ; / / i n g /cm ˆ3 N a = 6 . 0 2 3 * 1 0 ^ 2 3 ; / / a v o g a d ro ’ s n um ber A = 5 8 . 7 1 ; // i n g / mol n=((p*Na)/A)*10^6; Ms=0.60*mu_b*n; Bs=mu0*Ms; disp ( B s , ” s a t u r a t i o n f l u x d e ns i ty , Bs ( t e s l a ) = ” )
Scilab code Exa 18.3 magnetic moments
1 / / E xa mp le 1 8 . 3 2 clc ;
: m a g n e t i c m oment
65
3 4 5 6 7 8 9 10 11 12 13 14 15 16
clear ; close ;
/ / g i v e n d at a : format ( ’ v ’ ,9)
mu0=4*%pi*10^-7; m u _ b = 9 . 2 7 * 1 0 ^ - 2 4 ; // A.mˆ2 p = 8 . 9 ; / / i n g /cm ˆ3 N a = 6 . 0 2 3 * 1 0 ^ 2 3 ; / / a v o g a d ro ’ s n um ber A = 5 8 . 7 1 ; // i n g / mol n=((p*Na)/A)*10^6; B s = 0 . 6 5 ; // i n Wb/mˆ2 Ms=Bs/mu0; m_mu_b=Ms/n; disp ( m _ m u _ b , ” s a t u r a t i o n m a g n e t i s a t i o n , m mu b (A . mˆ 2 ) = ”)
Scilab code Exa 18.4 power loss
1 2 3 4 5 6 7 8 9 10
/ / Example 1 8 . 4 : power l o s s clc ; clear ; close ;
/ / g i v e n d at a : V = 0 . 0 1 ; // in mˆ3 f = 5 0 ; // i n Hz a r e a = 6 0 0 ; / / i n jm ˆ−1 Wh=area*V*f; disp ( W h , ” p o w er l o s s , Wh( w a t t s ) = ” )
Scilab code Exa 18.5 loss of energy
1 / / Example 1 8 . 4 2 clc ;
: l o s o f e ne rg y
66