Concepts of Physics (Volume - 2)_H. C. Verma (1)
Concepts of Physics (Volume - 2)_H. C. Verma (1)
Created by
Ganesh Prasad Mishra
Bachelor Of Technology.
Electronics Engineering
Amity University
College Teacher
None
Cross-Checked by
None
Author: H. C. Verma
Edition: 2
Year: 2011
ISBN: 8177092324
1
Scilab numbering policy used in this document and the relation to 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
25 Calorimetry 13
26 Laws of Thermodynamics 17
28 Heat Transfer 25
30 Gauss Law 34
31 Capacitors 36
34 Magnetic Field 56
3
35 Magnetic Field Due to a Current 59
36 Permanent Magnets 64
38 Electromagnetic Induction 75
39 Alternating Current 79
40 Electromagnetic Waves 85
4
List of Scilab Codes
5
Exa 28.3 To Calculate the Temperature at Sun Surface 27
Exa 28.4 To Calculate the Net Rate of Heat Loss . . 27
Exa 28.5 To Calculate the time for cooling . . . . . . 28
Exa 29.1 To Find the Electric Field at a point . . . . 30
Exa 29.3 To Calculate the amount of Work . . . . . . 31
Exa 29.4 To Find the Electric Potential . . . . . . . . 32
Exa 30.1 To Calculate the Flux of Electric Field . . . 34
Exa 31.1 To Calculate the Capacitance . . . . . . . . 36
Exa 31.3 To Calculate the Capacitance . . . . . . . . 37
Exa 31.4 To Calculate the Charge on each Capacitor 37
Exa 31.5 To Find the Equivalent Capacitance of the
combination . . . . . . . . . . . . . . . . . . 38
Exa 31.7 To Calculate the Energy stored in Capacitor 39
Exa 31.8 To Calculate the Equivalent Capacitance . . 40
Exa 32.1 To Calculate the Current and Current Density 42
Exa 32.2 To Calculate the Drift Speed . . . . . . . . 43
Exa 32.3 To Calculate the Resistance of an aluminium
wire . . . . . . . . . . . . . . . . . . . . . . 44
Exa 32.4 To Calculate the Resistance and Energy . . 44
Exa 32.5 To Calculate the Potential Difference and Ther-
mal Energy . . . . . . . . . . . . . . . . . . 45
Exa 32.7 find the value of resistance . . . . . . . . . . 46
Exa 32.8 To Find the Reading of Ammeter . . . . . . 47
Exa 32.9 To Find the Time Constant and Time taken
for Charge Storage . . . . . . . . . . . . . . 48
Exa 32.10 To Find the Charge Remaining on the Capac-
itor . . . . . . . . . . . . . . . . . . . . . . . 49
Exa 33.1 To Calculate the Heat Developed in each re-
sistor . . . . . . . . . . . . . . . . . . . . . . 51
Exa 33.2 To Calculate the Neutral Temperature . . . 52
Exa 33.3 To Find Thermal Coefficients a and b . . . . 53
Exa 33.4 To Calculate the Electric Current . . . . . . 54
Exa 34.1 To Find the Force and Acceleration . . . . . 56
Exa 34.2 To calculate the Time Period . . . . . . . . 57
Exa 34.4 To Find the Magnetic Dipole Moment of the
Current Loop . . . . . . . . . . . . . . . . . 58
Exa 35.1 To Calculate Magnetic Field due to a piece of
Wire . . . . . . . . . . . . . . . . . . . . . . 59
6
Exa 35.2 To Find Magnetic Field between two wires . 60
Exa 35.3 To Find the Magnitude of Magnetic Force . 61
Exa 35.4 To Calculate the Magnetic Field at the centre
of Coil . . . . . . . . . . . . . . . . . . . . . 62
Exa 35.5 To Calculate the Amount of Current . . . . 62
Exa 36.1 To Find the Magnetic Field on Axis of Solenoid 64
Exa 36.2 To Calculate the Work Done in Rotating the
Magnet . . . . . . . . . . . . . . . . . . . . 65
Exa 36.3 To Calculate the magnitude of the Magnetic
Field at a point on its Axis at a distance of
20 cm from it . . . . . . . . . . . . . . . . . 66
Exa 36.4 To Find the Magnetic Field due to Magnetic
Dipole . . . . . . . . . . . . . . . . . . . . . 67
Exa 36.5 To Calculate the Magnitude of Earth Mag-
netic Field . . . . . . . . . . . . . . . . . . . 68
Exa 36.6 To Calculate the True Dip . . . . . . . . . . 69
Exa 36.7 To Calculate the Value of Horizontal Compo-
nent of Earth Magnetic Field . . . . . . . . 70
Exa 36.8 To Calculate the Shunt Resistance for Gal-
vanometer . . . . . . . . . . . . . . . . . . . 71
Exa 36.9 To Compare the total Magnetic Field due to
earth at the two places . . . . . . . . . . . . 71
Exa 37.1 To Calculate the Intensity of Magnetization
of Bar Magnet . . . . . . . . . . . . . . . . 73
Exa 37.3 To Calculate the percentage increase in Mag-
netic Field . . . . . . . . . . . . . . . . . . . 74
Exa 38.3 To Calculate the Self Inductance of the Coil 75
Exa 38.5 To find the Time Constant Maximum Current
and Time . . . . . . . . . . . . . . . . . . . 76
Exa 38.6 To Calculate the Current in Circuit . . . . . 77
Exa 38.7 To Calculate the Energy Stored in the Induc-
tor . . . . . . . . . . . . . . . . . . . . . . . 78
Exa 39.1 To Calculate the rms value of Current and
time required to reach the Peak Value . . . 79
Exa 39.2 To Calculate the Reactance of Capacitor for
different frequencies of Alternating Currents 80
7
Exa 39.3 To Find the Peak Value of Current and the
Instantaneous Voltage at Peak Value of Cur-
rent . . . . . . . . . . . . . . . . . . . . . . 81
Exa 39.4 To find the Impedance the Peak Current and
the Resonant Frequency of LCR Series Circuit 82
Exa 39.5 To Calculate the Number of Turns in the Pri-
mary Coil . . . . . . . . . . . . . . . . . . . 83
Exa 40.2 To Find the Maximum Magnetic Field in the
wave and its Direction . . . . . . . . . . . . 85
Exa 40.3 To Find the Energy due to an Electromag-
netic Wave . . . . . . . . . . . . . . . . . . 86
Exa 40.4 To Find the Intensity of the Wave . . . . . . 87
Exa 41.1 To Calculate the Factor Increase in the Value
of Thermionic Current . . . . . . . . . . . . 88
Exa 41.2 To Calculate the Dynamic Plate Resistance
at the operating condition . . . . . . . . . . 89
Exa 42.1 To Calculate the Energy and linear Momen-
tum and number of photons . . . . . . . . . 91
Exa 42.2 To Find the Maximum Wavelength of Light
that can cause Photoelectric Effect in Lithium 92
Exa 42.3 To Calculate the Time required by the Elec-
tron to receive sufficient energy to come out
of the metal . . . . . . . . . . . . . . . . . . 93
Exa 43.1 Calculate the Energy of Helium ion its first
excited state . . . . . . . . . . . . . . . . . . 95
Exa 43.2 To Calculate the Wavelength of Radiation for
Helium Ion . . . . . . . . . . . . . . . . . . 96
Exa 43.3 To Calculate the Energy needed to remove
the electron from the ion . . . . . . . . . . . 97
Exa 45.1 To Find the Electric Field which gives 1eV
average energy to a conduction electron . . 99
Exa 45.2 To Calculate the Resistivity of n type semi-
conductor . . . . . . . . . . . . . . . . . . . 100
Exa 45.3 To calculate the Approximate value of Dy-
namic Resistance of P N Junction under For-
ward Bias . . . . . . . . . . . . . . . . . . . 101
Exa 46.1 To Calculate the radius of Nucleus of Germa-
nium atom . . . . . . . . . . . . . . . . . . 103
8
Exa 46.2 To Calculate the Binding Energy of an Alpha
Particle . . . . . . . . . . . . . . . . . . . . 104
Exa 46.3 To calculate the mass excess of Hydrogen . . 105
Exa 46.4 To calculate the Activity of Copper . . . . . 105
Exa 46.5 To Calculate the fraction of Orignal Activity
remaining after 40 hours . . . . . . . . . . . 106
Exa 46.6 To calculate the energy released when a Nu-
cleus breaks . . . . . . . . . . . . . . . . . . 107
Exa 46.7 To Calculate the Temperature of Deutrons for
a specific Average Kinetic Energy . . . . . . 108
Exa 47.1 To Calculate the time for which the Person
slept according to clocks . . . . . . . . . . . 110
Exa 47.2 To Calculate the height of Passenger in the
Ground Frame . . . . . . . . . . . . . . . . 111
Exa 47.3 To Calculate the Time Elapsed between Door
Openings . . . . . . . . . . . . . . . . . . . 112
Exa 47.5 To Calculate the amount of Electrical Energy
obtained in kilowatt hour . . . . . . . . . . 113
9
Chapter 23
1
2 //To c a l c u l a t e t h e room t e m p e r a t u r e i n c e n t i g r a d e s
3
4 // e x a m p l e 2 3 . 1
5
6 clear ;
7
8 clc ;
9
10 p0 =73; // p r e s s u r e ( i n c e n t i m e t e r ) a t 0 d e g r e e c e l s i u s
11
12 p =77.8; // p r e s s u r e ( i n c e n t i m e t e r ) a t room
temperature
13
14 p100 =100.3; // p r e s s u r e ( i n c e n t i m e t e r ) a t 100 d e g r e e
celsius
15
16 t =( p - p0 ) /( p100 - p0 ) *100; // f o r m u l a f o r f i n d i n g the
room t e m p e r a t u r e i n c e n t i g r a d e s
17
18 printf ( ” room t e m p e r a t u r e=%. d d e g r e e c e l s i u s ” ,t ) ;
10
11
Chapter 24
1
2 //To c a l c u l a t e t h e rms s p e e d o f N i t r o g e n
3
4 // Example 2 4 . 1
5
6 clear ;
7
8 clc ;
9
10 p =1.0*10^5; // P r e s s u r e ( i n N/mˆ 2 ) a t STP
11
12 rho =1.25; // D e n s i t y ( i n kg /mˆ 3 ) o f N i t r o g e n
13
14 Vrms = sqrt (3* p / rho ) ; // rms s p e e d o f n i t r o g e n a t STP
15
16 printf ( ” The rms s p e e d o f N i t r o g e n=%. f m/ s ” , Vrms ) ;
12
Scilab code Exa 24.2 To find the rms speed of hydrogen
1
2 //To c a l c u l a t e t h e rms s p e e d o f h y d r o g e n m o l e c u l e s
a t t h e same t e m p e r a t u r e
3
4 // Example 2 4 . 2
5
6 clear ;
7
8 clc ;
9
10 v1 =490; // rms s p e e d o f n i t r o g e n a t 273 K e l v i n
11
12 m1 =28; // m o l e c u l a r w e i g h t o f n i t r o g e n
13
14 m2 =2; // m o l e c u l a r w e i g h t o f h y d r o g e n
15
16 v2 = v1 * sqrt ( m1 / m2 ) ; // rms s p e e d o f h y d r o g e n a t 273
Kelvin
17
18 printf ( ” rms s p e e d o f h y d r o g e n=%d m/ s ( wrong a n s w e r
g i v e n i n t h e book ) ” , v2 ) ;
Scilab code Exa 24.3 To calculate the number of molecules in each cubic metre
1
2 //To c a l c u l a t e t h e number o f m o l e c u l e s i n e a c h c u b i c
metre
3
4 // Example 2 4 . 3
5
6 clear ;
13
7
8 clc ;
9
10 p =1.0*10^5; // p r e s s u r e i n N/mˆ2
11
12 v =1; // volume i n c u b i c m e t r e
13
14 t =300; // t e m p e r a t u r e i n K e l v i n
15
16 k =1.38*10^ -23; // b o l t z m a n n c o n s t a n t ( J /K)
17
18 n = p * v /( k * t ) ; // f o r m u l a f o r f i n d i n g number o f
molecules
19
20 printf ( ” number o f m o l e c u l e=%f ∗ 1 0 ˆ 2 5 ” ,n /(10^25) ) ;
Scilab code Exa 24.4 To calculate the rms speed of Oxygen molecules
1
2 //To c a l c u l a t e t h e rms s p e e d o f o x y g e n m o l e c u l e s
3
4 // Example 2 4 . 4
5
6 clear ;
7
8 clc ;
9
10 R =8.3; // u n i v e r s a l g a s c o n s t a n t i n J / mol−K
11
12 T =300; // t e m p e r a t u r e i n K e l v i n
13
14 M0 =0.032; // m o l e c u l a r w e i g h t i n kg / mol
15
14
16 V = sqrt (3* R * T / M0 ) ; // f o r m u l a f o r f i n d i n g t h e rms s p e e d
17
18 printf ( ” t h e rms s p e e d o f o x y g e n m o l e c u l e=%d m/ s ” ,V ) ;
1
2 //To c a l c u l a t e t h e e x t e r n a l p r e s s u r e
3
4 // Example 2 4 . 5
5
6 clear ;
7
8 clc ;
9
10 Psat =2710; // s a t u r a t e d p r e s s u r e i n m i l l i m e t r e o f Hg
a t 140 d e g r e e c e l s i u s
11
12 Pvap =760; // v a p o u r p r e s s u r e i n m i l l i m e t r e o f Hg ( 1 atm
=760 mm o f Hg )
13
14 Pext = Psat / Pvap ; // e x t e r n a l v a p o u r p r e s s u r e a t 140
degree c e l s i u s
15
16 printf ( ” e x t e r n a l v a p o u r p r e s s u r e a t 140 d e g r e e
c e l s i u s =%2f atm ” , Pext ) ;
15
1
2 //To c a l c u l a t e t h e r e l a t i v e h u m i d i t y
3
4 // Example 2 4 . 6
5
6 clear ;
7
8 clc ;
9
10 Pvap =12; // v a p o u r p r e s s u r e o f a i r a t 20 d e g r e e
celsius
11
12 SVP =17.5; // s a t u r a t i o n v a p o u r p r e s s u r e a t 20 d e g r e e
celsius
13
14 RH = Pvap / SVP ; // r e l a t i v e h u m i d i t y
15
16 printf ( ” R e l a t i v e Humidity=%. 2 f ” , RH ) ;
1
2 //To c a l c u l a t e t h e r e l a t i v e h u m i d i t y
3
4 // Example 2 4 . 7
5
6 clear ;
7
8 clc ;
9
10 Pvap =8.94; // v a p o u r p r e s s u r e a t t h e dew p o i n t i n (mm
o f Hg )
11
16
12 SVP =55.1; // s a t u r a t i o n v a p o u r p r e s s u r e a t t h e air
t e m p e r a t u r e i n (mm o f Hg )
13
14 RH =( Pvap / SVP ) *100; // f i n d i n g t h e r e l a t i v e h u m i d i t y
15
16 printf ( ” R e l a t i v e Humidity=%. 1 f p e r c e n t ” , RH ) ;
17
Chapter 25
Calorimetry
1
2 //To c a l c u l a t e t h e k i n e t i c e n e r g y
3
4 // Example 2 5 . 1
5
6 clear ;
7
8 clc ;
9
10 m =10; // mass i n kg
11
12 v =36; // s p e e d i n kmph
13
14 E =[1/2* m *( v *10^3/3600) ^2]/4.186; // f o r m u l a f o r
f i n d i n g k i n e t i c energy
15
16 printf ( ” k i n e t i c e n e r g y=%f c a l ” ,E ) ;
18
Scilab code Exa 25.2 Calculate the heat supplied to the block
1
2 //To c a l c u l a t e t h e h e a t s u p p l i e d t o t h e b l o c k
3
4 // Example 2 5 . 2
5
6 clear ;
7
8 clc ;
9
10 m =60; // mass o f a c o p p e r b l o c k i n grams
11
12 s =0.09; // s p e c i f i c h e a t c a p a c i t y o f c o p p e r i n ( c a l / g−
degree c e l s i u s )
13
14 t =20; // t e m p e r a t u r e i n c r e a s e d by d e g r e e c e l c i u s
15
16 Q = m * s * t ; // f o r m u l a f o r f i n d i n g t h e h e a t s u p p l i e d t o
the block
17
18 printf ( ” Heat=%f c a l ” ,Q ) ;
1 //To c a l c u l a t e t h e mass o f m e l t e d I c e
19
2 // Example 2 5 . 3
3
4 clear ;
5
6 clc ;
7
8 m =0.2; // mass o f a p i e c e o f i c e i n kg a t 25 d e g r e e
Celsius
9
10 s =4200; // s p e c i f i c h e a t c a p a c i t y o f w a t e r i n J / kg−k
11
12 t1 =25; // I n i t i a l T e m p e r a t u r e i n C e l s i u s
13
14 t2 =0; // F i n a l T e m p e r a t u r e i n C e l s i u s
15
16 Q = m * s *( t1 - t2 ) ; // f o r m u l a f o r f i n d i n g t h e h e a t
17
18 L =3.4*10^5; // s p e c i f i c l a t e n t h e a t o f f u s i o n o f i c e
i n J / kg
19
20 M = Q / L ; // The amount o f i c e m e l t e d
21
22 printf ( ” Mass o f t h e I c e M e l t e d=%f gram ” ,M *1000) ;
Scilab code Exa 25.4 To Calculate the Specific Latent Heat Capacity
1
2 //To c a l c u l a t e t h e S p e c i f i c L a t e n t Heat o f
v a p o r i z a t i o n of water
3
4 // Example 2 5 . 4
5
6 clear ;
7
8 clc ;
20
9
10 m =1.5; // Mass o f steam c o n d e n s e d i n grams
11
12 s =1; // S p e c i f i c Heat C a p a c i t y i n c a l / g−C
13
14 t1 =100; // I n i t i a l T e m p e r a t u r e i n d e g r e e C e l s i u s
15
16 t2 =30; // F i n a l T e m p e r a t u r e i n d e g r e e C e l s i u s
17
18 t = t1 - t2 ; // Change i n T e m p e r a t u r e i n d e g r e e C e l s i u s
19
20 Q2 = m * s * t ; // Heat l o s t i n t h e p r o c e s s o f c o o l i n g from
100 d e g r e e C e l s i u s t o 30 d e g r e e C e l s i u s i n
calories
21
22 We =15; // Wateer E q u i v a l e n t o f C a l o r i m e t e r i n grams
23
24 Mw =165; // Mass o f w a t e r i n grams
25
26 t3 =25; // I n i t i a l T e m p e r a t u r e i n d e g r e e C e l s i u s
27
28 t4 =30; // F i n a l T e m p e r a t u r e i n d e g r e e C e l s i u s
29
30 T = t4 - t3 ; // Change i n t e m p e r a t u r e i n d e g r e e C e l s i u s
31
32 Q3 =( We + Mw ) * s * T ; // Heat s u p p l i e d t o r a i s e t h e
t e m p e r a t u r e from 25 d e g r e e C e l s i u s t o 30 d e g r e e
Celsius in Calories
33
34 L =( Q3 - Q2 ) / m ; // S p e c i f i c L a t e n t Heat o f V a p o u r i z a t i o n
of water
35
36 printf ( ” S p e c i f i c L a t e n t Heat o f V a p o u r i z a t i o n o f
w a t e r=%f c a l / g ” ,L ) ;
21
Chapter 26
Laws of Thermodynamics
1
2 //To c a l c u l a t e t h e i n c r e a s e i n I n t e r n a l Energy i n
the process
3
4 // Example 2 6 . 1
5
6 clear ;
7
8 clc ;
9
10 delQ =418; // Heat g i v e n t o t h e g a s i n J o u l e s
11
12 delW =40; // Work done by t h e g a s i n J o u l e s
13
14 delU = delQ - delW ; // f o r m u l a f o r f i n d i n g i n c r e a s e the
i n t e r n a l energy
15
16 printf ( ” I n c r e a s e i n I n t e r n a l Energy=%. f j o u l e ” , delU )
;
22
Scilab code Exa 26.2 To Calculate the amount of Work
1
2 //To C a l c u l a t e t h e Work Done by t h e Gas
3
4 // Example 2 6 . 2
5
6 clear ;
7
8 clc ;
9
10 pA =120*10^3; // p r e s s u r e ( i n Pa ) o f t h e g a s a t P o i n t A
11
12 pB =120*10^3; // p r e s s u r e ( i n Pa ) o f t h e g a s a t P o i n t B
13
14 pC =200*10^3; // p r e s s u r e ( i n Pa ) o f t h e g a s a t P o i n t C
15
16 VA =200*10^ -6; // Volume a t p o i n t A i n mˆ3
17
18 VB =450*10^ -6; // Volume a t p o i n t B i n mˆ3
19
20 VC =450*10^ -6; // Volume a t p o i n t C i n mˆ3
21
22 delVab = VB - VA ; // c h a n g e i n t h e volume o f t h e g a s from
point A to B
23
24 Wab = pA * delVab ; // f o r m u l a
f o r f i n d i n g t h e work done by
the gas in the p r o c e s s A to B
25
26 printf ( ” The Work done by t h e g a s i n t h e p r o c e s s A t o
B=%d j o u l e ” , Wab ) ;
27
23
28 delVbc = VC - VB ; // c h a n g e i n t h e volume o f t h e g a s from
point B to C
29
30 Wbc =( pC - pB ) * delVbc ; // f o r m u l a
f o r f i n d i n g t h e work
done by t h e g a s i n t h e p r o c e s s B t o C
31
32 printf ( ” \ nThe Work done by t h e g a s i n t h e p r o c e s s B
t o C=%d j o u l e ” , Wbc ) ;
33
34 delVca = VC - VA ; // c h a n g e i n t h e volume o f t h e g a s from
point C to A
35
36 Wca =(0.5*( pC - pA ) * delVca ) + Wab ; // f o r m u l a
for finding
t h e work done by t h e g a s i n t h e p r o c e s s C t o A
37
38 printf ( ” \ nThe Work done by t h e g a s i n t h e p r o c e s s C
t o A=%d j o u l e ” ,- Wca ) ;
24
Chapter 27
Scilab code Exa 27.1 To find the amount of Heat needed to raise the temperature fr
1
2 // Find t h e Amount o f Heat n e e d e d t o r a i s e t h e
t e m p e r a t u r e from 25 d e g r e e c e l s i u s t o 35 d e g r e e
celsius .
3
4 // Example 2 7 . 1
5
6 clear ;
7
8 clc ;
9
10 Ao =0.32; // Mass o f Oxygen k e p t i n gram
11
12 W =32; // M o l e c u l a r w e i g h t o f Oxygen i n g / mol
13
14 n = Ao / W ; // Number o f m o l e s o f o x y g e n
15
16 Cv =20; // Molar Heat C a p a c i t y o f Oxygen a t c o n s t a n t
volume
25
17
18 T1 =25; // I n i t i a l T e m p e r a t u r e
19
20 T2 =35; // F i n a l T e m p e r a t u r e
21
22 delT = T2 - T1 ; // Change i n T e m p e r a t u r e
23
24 Q = n * Cv * delT ; // Amount o f Heat n e e d e d
25
26 printf ( ”Amount o f Heat r e q u i r e d=%d j o u l e ” ,Q ) ;
Scilab code Exa 27.2 To calculate the amount of Heat required to raise the tempera
1
2 // Find t h e Amount o f Heat r e q u i r e d t o r a i s e t h e
t e m p e r a t u r e t o 400 K e l v i n
3
4 // Example 2 7 . 2
5
6 clc ;
7
8 clear ;
9
10 V =0.2; // Volume o f t a n k i n mˆ3
11
12 p =1*10^5; // P r e s s u r e o f Helium Gas i n N/Mˆ2
13
14 T1 =300; // I n i t i a l T e m p e r a t u r e o f Helium Gas i n K e l v i n
15
16 T2 =400; // F i n a l T e m p e r a t u r e o f Helium Gas i n K e l v i n
17
18 R =8.31; // U n i v e r s a l Gas C o n s t a n t i n J / mol−K
19
26
20 n = int (( p * V ) /( R * T1 ) ) ; // Amount o f m o l e s o f Helium Gas
21
22 Cv =3; // Molar Heat C a p a c i t y a t C o n s t a n t Volume
23
24 Q = n * Cv *( T2 - T1 ) ; // Amount o f Heat R e q u i r e d i n c a l o r i e s
25
26 printf ( ” The amount o f Heat r e q u i r e d=%d c a l ” ,Q ) ;
1
2 //To Find t h e r a t i o o f Cp/Cv
3
4 // Example 2 7 . 3
5
6 clc ;
7
8 clear ;
9
10 Cv =5; // Molar Heat C a p a c i t y o f Gas a t c o n s t a n t volume
11
12 R =2; // U n i v e r s a l Gas c o n s t a n t i n c a l / mol−K
13
14 Cp = Cv + R ; // Molar Heat C a p a c i t y o f Gas a t c o n s t a n t
pressure
15
16 gama = Cp / Cv ; // The r a t i o Cp/Cv
17
18 printf ( ”Cp/Cv=%f ” , gama ) ;
27
Scilab code Exa 27.4 To Calculate the Final Temperature of the air
1
2 //To c a l c u l a t e t h e F i n a l T e m p e r a t u r e o f t h e a i r
3
4 // Example 2 7 . 4
5
6 clc ;
7
8 clear ;
9
10 T1 =288; // I n i t i a l T e m p e r a t u r e o f Dry A i r i n K e l v i n
11
12 p1 =10; // I n i t i a l p r e s s u r e o f Dry A i r i n atm
13
14 p2 =1; // F i n a l p r e s s u r e o f Dry A i r i n atm
15
16 gama =1.41; // The r a t i o Cp/Cv
17
18 T2 = T1 *( p2 / p1 ) ^(( gama -1) / gama ) ; // F i n a l T e m p e r a t u r e o f
Gas
19
20 printf ( ” The f i n a l t e m p e r a t u r e o f g a s=%f K” , T2 ) ;
Scilab code Exa 27.5 To calculate the Internal Energy of 1 gram of oxygen at STP
28
2 //To C a l c u l a t e t h e I n t e r n a l Energy o f 1 gram o f
o x y g e n a t STP .
3
4 // Example 2 7 . 5
5
6 clc ;
7
8 clear ;
9
10 m =1; // Mass o f Oxygen t a k e n i n grams
11
12 M =32; // M o l e c u l a r Weight o f Oxygen i n g / mol
13
14 n = m / M ; // Number o f m o l e s o f Oxygen
15
16 R =8.31; // U n i v e r s a l Gas C o n s t a n t i n J / mol−K
17
18 T =273; // T e m p e r a t u r e i n K e l v i n a t STP
19
20 U = int ( n *((5/2) * R * T ) ) ; // I n t e r n a l Energy o f Oxygen
21
22 printf ( ” I n t e r n a l Energy o f Oxygen=%d J ” ,U ) ;
29
Chapter 28
Heat Transfer
1
2 //To C a l c u l a t e t h e Amount o f Heat f l o w i n g p e r s e c o n d
through the cube .
3
4 // Example 2 8 . 1
5
6 clear ;
7
8 clc ;
9
10 x =0.1; // Edge Length o f t h e Copper Cube i n cm
11
12 A = x ^2; // Area o f c r o s s s e c t i o n i n cmˆ2
13
14 K =385; // Thermal C o n d u c t i v i t y o f Copper i n W/m−deg
Celsius
15
16 T1 =100; // T e m p e r a t u r e o f t h e f i r s t f a c e
17
18 T2 =0; // T e m p e r a t u r e a t t h e s e c o n d f a c e
19
30
20 Rf = K * A *( T1 - T2 ) / x ; // Amount o f Heat f l o w i n g p e r s e c o n d
( d e l (Q) / d e l ( t ) )
21
22 printf ( ” The amount o f h e a t f l o w i n g p e r s e c=%d W” , Rf )
;
Scilab code Exa 28.2 To Find the Thermal Resistance of Aluminium Rod
1
2 //To C a l c u l a t e t h e Thermal R e s i s t a n c e o f an
aluminium r o d
3
4 // Example 2 8 . 2
5
6 clear ;
7
8 clc ;
9
10 x =0.2; // Length o f Aluminium Rod i n m e t r e s
11
12 K =200; // Thermal C o n d u c t i v i t y o f Aluminium i n W/m−K
13
14 A =1*10^ -4; // Area o f C r o s s S e c t i o n i n m e t r e ˆ2
15
16 R = x /( K * A ) ; // Thermal R e s i s t a n c e i n K/W
17
18 printf ( ” The Thermal R e s i s t a n c e i s o f Aluminium Rod=%
d K/W” ,R ) ;
31
Scilab code Exa 28.3 To Calculate the Temperature at Sun Surface
1 //To C a l c u l a t e t h e T e m p e r a t u r e o f Sun
2 // Example 2 8 . 3
3
4 clear ;
5
6 clc ;
7
8 b =0.288; // Wein C o n s t a n t i n cm−K
9
10 Lambda =470*10^( -7) ; // Wavelength c o r r e s p o n d i n g t o
maximum i n t e n s i t y i n c e n t i m e t r e s
11
12 T = b / Lambda ; // T e m p e r a t u r e a t t h e S u r f a c e o f Sun
13
14 printf ( ” T e m p e r a t u r e a t t h e sun s u r f a c e = %f K” ,T ) ; //
The a n s w e r p r o v i d e d i n t h e t e x t b o o k i s wrong
Scilab code Exa 28.4 To Calculate the Net Rate of Heat Loss
1
2 //To c a l c u l a t e t h e Net Rate o f Heat L o s s
3
4 // Example 2 8 . 4
5
6 clear ;
7
8 clc ;
9
10 A =10*10^ -4; // S u r f a c e Area o f B l a c k b o d y i n mˆ2
11
12 T =400; // I n i t i a l T e m p e r a t u r e i n K e l v i n
32
13
14 T0 =300; // F i n a l T e m p e r a t u r e i n K e l v i n
15
16 Sigma =5.67*10^ -8; // S t e f a n C o n s t a n t
17
18 delU = Sigma * A *( T ^4 - T0 ^4) ; // Net Rate o f Heat L o s s
19
20 printf ( ” The n e t r a t e o f l o s s o f h e a t i s =%2f W” , delU )
;
1
2 //To C a l c u l a t e t h e Amount o f Time f o r C o o l i n g
3
4 // Example 2 8 . 5
5
6 clear ;
7
8 clc ;
9
10 T1 =70; // I n i t i a l T e m p e r a t u r e i n d e g r e e C e l s i u s i n
F i r s t Case
11
12 T2 =60; // F i n a l T e m p e r a t u r e i n d e g r e e Celsius in First
Case
13
14 Tav =( T1 + T2 ) /2; // A v e r a g e T e m p e r a t u r e i n F i r s t Case
15
16 Ts =30; // T e m p e r a t u r e o f S u r r o u n d i n g i n d e g r e e C e l s i u s
17
18 Tdif1 = Tav - Ts ; // A v e r a g e T e m p e r a t u r e D i f f e r e n c e from
Surrounding in f i r s t case
33
19
20 t =5; // Time t a k e n f o r c o o l i n g from 70 deg C e l s i u s t o
60 deg C e l s i u s
21
22 Rt =( T1 - T2 ) / t ; // Rate o f f a l l o f T e m p e r a t u r e
23
24 bA = Rt / Tdif1 ; // P r o d u c t o f Wein C o n s t a n n t and Area
25
26 T3 =60; // I n i t i a l T e m p e r a t u r e i n d e g r e e C e l s i u s i n
second case
27
28 T4 =50; // F i n a l T e m p e r a t u r e i n d e g r e e Celsius in
second case
29
30 Tdif2 = T3 - T4 ; // Change i n T e m p e r a t u r e i n s e c o n d c a s e
31
32 Tav1 =( T3 + T4 ) /2; // A v e r a g e T e m p e r a t u r e i n s e c o n d c a s e
33
34 Tdif3 = Tav1 - Ts ; // A v e r a g e T e m p e r a t u r e D i f f e r e n c e from
Surrounding in second case
35
36 t1 = Tdif2 /( bA * Tdif3 ) ; // Time t a k e n by t h e l i q u i d to
cool
37
38 printf ( ” Time t a k e n by t h e l i q u i d t o c o o l=%d min ” , t1 )
;
34
Chapter 29
1
2 //To C a l c u l a t e t h e E l e c t r i c F i e l d a t a p o i n t
3
4 // Example 2 9 . 1
5
6 clear ;
7
8 clc ;
9
10 AC =5*10^ -2; // The l e n g t h o f AC i n m e t r e s
11
12 PC =12*10^ -2; // The l e n g t h o f PC i n m e t r e s
13
14 AP = sqrt ( AC ^2+ PC ^2) ; // Length o f AP by P y t h a g o r a s
Theorem
15
16 Theta = acos ( AC / AP ) ; // Measure o f a n g l e PAC
17
18 Q1 =10*10^ -6; // F i r s t Charge i n Coloumbs
19
20 Q2 = -10*10^ -6; // S e c o n d Charge i n Coloumbs
35
21
22 K =9*10^9; // V a l u e o f c o n s t a n t ( 1 / ( 4 ∗ p i ∗ 0 ) )
23
24 EA = Q1 * K / AP ^2; // E l e c t r i c F i e l d a t P due t o F i r s t
Charge
25
26 EB = - Q2 * K / AP ^2; // E l e c t r i c F i e l d a t P due t o F i r s t
Charge
27
28 E =( EA + EB ) * cos ( Theta ) ; // Magnitude o f resultant
Electric Field
29
30 printf ( ” e l c t r i c f i e l d a t p o i n t P=%. 1 f ∗ 1 0 ˆ 6 N/C” ,E
/10^6) ;
1
2 //To C a l c u l a t e t h e Work Done by a p e r s o n i n p u l l i n g
them a p a r t t o i n f i n i t e s e p a r a t i o n s
3
4 // Example 2 9 . 3
5
6 clear ;
7
8 clc ;
9
10 Q1 =10*10^ -6; // F i r s t Charge i n Coloumbs
11
12 Q2 =10*10^ -6; // S e c o n d Charge i n Coloumbs
13
14 Q3 =10*10^ -6; // T h i r d Charge i n Coloumbs
15
36
16 K =9*10^9; // V a l u e o f c o n s t a n t ( 1 / ( 4 ∗ p i ∗ 0 ) )
17
18 x =0.1; // Length o f s i d e o f t h e E q u i l a t e r a l T r i a n g l e
in metres
19
20 U =3* Q1 * Q2 * K / x ; // P o t e n t i a l Energy o f t h e System
21
22 printf ( ” The amount o f work done t o p u l l t h e c h a r g e s
a p a r t=%f J ” ,U ) ;
1
2 //To f i n d t h e E l e c t r i c P o t e n t i a l
3
4 // Example 2 9 . 4
5
6 clear ;
7
8 clc ;
9
10 Q1 =10*10^ -6; // F i r s t Charge i n Coloumbs
11
12 Q2 = 20*10^ -6; // S e c o n d Charge i n Coloumbs
13
14 r =0.02; // D i s t a n c e b e t w e e n t h e c h a r g e s i n m e t r e s
15
16 K =9*10^9; // V a l u e o f c o n s t a n t ( 1 / ( 4 ∗ p i ∗ 0 ) )
17
18 V1 = Q1 * K *2/ r ; // E l e c t r i c P o t e n t i a l due t o F i r s t Charge
19
20 V2 = Q2 * K *2/ r ; // E l e c t r i c P o t e n t i a l due t o S e c o n d
Charge
37
21
22 V = V1 + V2 ; // Net P o t e n t i a l
23
24 printf ( ” n e t p o t e n t i a l =%f MV” ,V /10^6) ;
38
Chapter 30
Gauss Law
1
2 //To Find t h e Flux o f E l e c t r i c F i e l d t h r o u g h t h e
s u r f a c e bounded by t h e f r a m e
3
4 // Example 3 0 . 1
5
6 clear ;
7
8 clc ;
9
10 delS =0.01; // Length o f Edge o f t h e S q u a r e f r a m e i n
metres
11
12 E =20; // E l e c t r i c F i e l d i n V/m
13
14 Theta = %pi /3; // A n g l e b e t w e e n Normal and E l e c t r i c
Field
15
16 Flux = E * delS * cos ( Theta ) ; // E l e c t r i c Flux t h r o u g h t h e
Surface
17
39
18 printf ( ” Net f l u x o f E l e c t r i c F i e l d=%f V/m” , Flux ) ;
40
Chapter 31
Capacitors
1
2 //To C a l c u l a t e t h e C a p a c i t a n c e o f t h e c a p a c i t o r
3
4 // Example 31 1
5
6 clear ;
7
8 clc ;
9
10 Q =60*10^ -6; // Charge on t h e c a p a c i t o r
11
12 V =12; // P o t e n t i a l d i f f e r e n c e b e t w e e n t h e p l a t e s
13
14 C = Q / V ; // Formula f o r f i n d i n g t h e c a p a c i t a n c e o f t h e
capacitor
15
16 printf ( ” C a p a c i t a n c e o f t h e c a p a c i t o r=%f ∗10ˆ −6 F” ,C
*10^6) ;
41
Scilab code Exa 31.3 To Calculate the Capacitance
1
2 //To C a l c u l a t e t h e C a p a c i t a n c e o f a p a r a l l e l p l a t e
capacitor
3
4 // Example 3 1 . 3
5
6 clear ;
7
8 clc ;
9
10 a =20*10^ -2; // Length o f S i d e o f P a r a l l e l Plate
Capacitor
11
12 A = a ^2; // Area o f t h e C a p a c i t o r P l a t e
13
14 d =1*10^ -3; // S e p a r a t i o n b e t w e e n t h e two p l a t e s
15
16 e0 =8.85*10^ -12; // P e r m i t i v i t y i n f a r a d / m e t e r
17
18 C = e0 * A / d ; // Formula f o r f i n d i n g c a p a c i t a n c e o f
parallel plate capacitor
19
20 printf ( ” c a p a c i t a n c e o f t h e p a r a l l e l p l a t e c a p a c i t o r=
%f pF” ,C *10^12) ;
42
1
2 //To C a l c u l a t e t h e Charge on e a c h C a p a c i t o r
3
4 // Example 3 1 . 4
5
6 clear ;
7
8 clc ;
9
10 C1 =10*10^ -6; // C a p a c i t a n c e o f F i r s t C a p a c i t o r
11
12 C2 =20*10^ -6; // C a p a c i t a n c e o f S e c o n d C a p a c i t o r
13
14 C = C1 * C2 /( C1 + C2 ) ; // E q u i v a l e n t c a p a c i t a n c e o f C1 and
C2 i n s e r i e s
15
16 V =30; // A p l l i e d V o l t a g e
17
18 Q = C * V ; // Formula f o r f i n d i n g t h e c h a r g e on e a c h
capacitor
19
20 printf ( ” The c h a r g e on e a c h c a p a c i t o r=%f uC” ,Q *10^6) ;
Scilab code Exa 31.5 To Find the Equivalent Capacitance of the combination
1
2 //To Find t h e E q u i v a l e n t C a p a c i t a n c e o f t h e
combination
3
4 // Example 3 1 . 5
5
6 clear ;
7
43
8 clc ;
9
10 C1 =10*10^ -6; // C a p a c i t a n c e o f t h e F i r s t C a p a c i t o r
11
12 C2 =20*10^ -6; // C a p a c i t a n c e o f t h e S e c o n d C a p a c i t o r
13
14 C = C1 + C2 ; // E q u i v a l e n t c a p a c i t a n c e o f p a r a l l e l
c o m b i n a t i o n o f C1 and C2
15
16 C3 =30*10^ -6; // C a p a c i t a n c e o f t h e t h i r d C a p a c i t o r
17
18 Ceq = C * C3 /( C + C3 ) ; // E q u i v a l e n t c a p a c i t a n c e o f S e r i e s
c o m b i n a t i o n o f C and C3
19
20 printf ( ” The e q u i v a l e n t C a p a c i t a n c e o f t h e
c o m b i n a t i o n= %f uF” , Ceq *10^6) ;
1
2 //To C a l c u l a t e t h e Energy s t o r e d i n C a p a c i t o r
3
4 // Example 3 1 . 7
5
6 clear ;
7
8 clc ;
9
10 C =100*10^ -6; // C a p a c i t a n c e o f t h e c a p a c i t o r i n
Faraday
11
12 V =20; // P o t e n t i a l Difference in Volts
13
44
14 U =1/2* C * V ^2; // Formula f o r f i n d i n g the energy stored
in a capacitor
15
16 printf ( ” The e n e r g y s t o r e d i n t h e c a p a c i t o r= %f J ” ,U )
;
1
2 //To C a l c u l a t e t h e E q u i v a l e n t C a p a c i t a n c e
3
4 // Example 3 1 . 8
5
6 clear ;
7
8 clc ;
9
10 C0 =40*10^ -6; // C a p a c i t a n c e o f t h e f i r s t C a p a c i t o r
11
12 K =4; // D i e l e c t r i c C o n s t a n t
13
14 C1 = K * C0 ; // C a p a c i t a n c e o f t h e c a p a c i t o r C0 w i t h t h e
dielectric
15
16 C2 =40*10^ -6; // C a p a c i t a n c e o f t h e s e c o n d C a p a c i t o r
17
18 C = C1 * C2 /( C1 + C2 ) ; // f o r m u l a f o r f i n d i n g t h e e q u i v a l e n t
capacitor connected in s e r i e s
19
20 printf ( ” E q u i v a l e n t c a p a c i t a n c e o f t h e s y s t e m= %f uF”
,C *10^6) ;
45
46
Chapter 32
Scilab code Exa 32.1 To Calculate the Current and Current Density
1
2 //To C a l c u l a t e t h e C u r r e n t and C u r r e n t D e n s i t y
3
4 // Example 3 2 . 1
5
6 clear ;
7
8 clc ;
9
10 n =6.0*10^16; // T o t a l number o f e l e c t r o n s
11
12 e =1.6*10^ -19; // Charge o f an e l e c t r o n
13
14 q = n * e ; // T o t a l c h a r g e c r o s s i n g a p r e p e n d i c u l a r c r o s s
s e c t i o n i n one s e c
15
16 t =1; // Time i n s e c o n d s
17
18 i = q / t ; // C u r r e n t
19
20 printf ( ” ( a ) C u r r e n t ( i )= % f ∗10ˆ −3 A” ,i *10^3) ;
47
21
22 s =1.0*10^ -3; // e l e c t r o n beam h a s an a p p e r t u r e
23
24 J = i / s ; // c u r r e n t d e n s i t y
25
26 printf ( ” \n ( b ) C u r r e n t d e n s i t y i n t h e beam ( j )= %. 1 f
∗ 1 0 ˆ 3 A/mˆ2 ” ,J ) ;
1
2 //To C a l c u l a t e t h e D r i f t Speed
3
4 // Example 3 2 . 2
5
6 clear ;
7
8 clc ;
9
10 i =1; // C u r r e n t e x i s t i n a c o p p e r w i r e i n Amperes
11
12 e =1.6*10^ -19; // Charge o f an e l e c t r o n
13
14 n =8.5*10^28; // Number o f f r e e e l e c t r o n s
15
16 A =2*10^ -6; // C r o s s S e c t i o n Area o f c o p p e r w i r e
17
18 Vd = i /( A * n * e ) ; // Formula f o r f i n d i n g t h e d r i f t s p e e d
of the e l e c t r o n
19
20 printf ( ” D r i f t s p e e d o f e l e c t r o n s = %f mm/ s ” , Vd *10^3) ;
48
Scilab code Exa 32.3 To Calculate the Resistance of an aluminium wire
1
2 //To C a l c u l a t e t h e R e s i s t a n c e o f an aluminium w i r e
3
4 // Example 3 2 . 3
5
6 clear ;
7
8 clc ;
9
10 rho =2.6*10^ -8; // R e s i s t i v i t y o f Aluminium i n ohm−
metre
11
12 l =0.50; // Length o f Aluminium w i r e i n m e t r e s
13
14 A =2*10^ -6; // C r o s s s e c t i o n a l a r e a o f aluminium w i r e
i n m e t r e ˆ2
15
16 R = rho * l / A ; // Formula f o r f i n d i n g t h e r e s i s t a n c e o f an
aluminium w i r e
17
18 printf ( ” R e s i s t a n c e o f t h e aluminium w i r e= %f ohm” ,R )
;
49
2 //To C a l c u l a t e t h e R e s i s t a n c e and Energy
3
4 // Example 3 2 . 4
5
6 clear ;
7
8 clc ;
9
10 U1 =400; // Thermal e n e r g y d e v e l o p e d i n r e s i s t o r in
Joules
11
12 i1 =2; // C u r r e n t i n Amperes
13
14 t =10; // Time i n s e c o n d s
15
16 R = U1 /( i1 ^2* t ) ; // Formula f o r f i n d i n g t h e r e s i s t a n c e
17
18 printf ( ” ( a ) R e s i s t a n c e o f r e s i s t o r = %f ohm” ,R ) ;
19
20 i2 =4; //New V a l u e o f C u r r e n t i n Amperes
21
22 U =( i2 ) ^2* R * t ; // Formula f o r f i n d i n g t h e t h e r m a l
e n e r g y d e v e l o p e d when t h e c u r r e n t i s 4A
23
24 printf ( ” \n ( b ) Thermal e n e r g y d e v e l o p e d i n t h e
R e s i s t o r= %d J ” ,U ) ;
Scilab code Exa 32.5 To Calculate the Potential Difference and Thermal Energy
1
2 //To C a l c u l a t e t h e P o t e n t i a l D i f f e r e n c e and Thermal
Energy
3
50
4 // Example 3 2 . 5
5
6 clear ;
7
8 clc ;
9
10 V =2.0; // Emf o f b a t t e r y i n V o l t s
11
12 i =0.100; // C u r r e n t i n Amperes
13
14 r =0.50; // R e s i s t a n c e i n ohms
15
16 Vab =V - i * r ; // P o t e n t i a l d i f f e r e n c e a c r o s s t h e
terminals
17
18 printf ( ” ( a ) P o t e n t i a l d i f f e r e n c e a c r o s s t h e
t e r m i n a l s= %f V” , Vab ) ;
19
20 t =10; // Time i n s e c o n d s
21
22 U = i ^2* r * t ; // Formula f o r
f i n d i n g the thermal energy
developed in the battery
23
24 printf ( ” \n ( b ) Thermal e n e r g y d e v e l o p e d i n t h e
b a t t e r y i s = %. 2 f J ” ,U ) ;
1
2 // Find t h e v a l u e o f R e s i s t a n c e
3
4 // Example 3 2 . 7
5
51
6 clear ;
7
8 clc ;
9
10 R1 =10; // R e s i s t a n c e ( R1 ) o f Wheatstone B r i d g e C i r c u i t
11
12 R2 =20; // R e s i s t a n c e ( R2 ) o f Wheatstone B r i d g e C i r c u i t
13
14 R4 =40; // R e s i s t a n c e ( R4 ) o f Wheatstone B r i d g e C i r c u i t
15
16 R3 = R1 * R4 / R2 ; // f o r m u l a f o r f i n d i n g t h e w h e a t s t o n e
b r i d g e r e s i s t a n c e ( R3 )
17
18 printf ( ” R e s i s t a n c e (R) = %d ohms f o r z e r o c u r r e n t i n
t h e 50 ohms r e s i s t o r ” , R3 ) ;
1
2 // Find t h e R e a d i n g o f t h e Ammeter
3
4 // Example 3 2 . 8
5
6 clear ;
7
8 clc ;
9
10 R1 =140.8; // Given r e s i s t a n c e
11
12 RA =480; // R e a c t a n c e o f t h e C o i l
13
14 Rsh =20; // Shunt r e s i s t a n c e
15
52
16 Req = RA * Rsh /( RA + Rsh ) ; // E q u i v a l e n t r e s i s t a n c e of the
ammeter
17
18 Reqc = R1 + Req ; // E q u i v a l e n t r e s i s t a n c e o f t h e c i r c u i t
19
20 I = Rsh / Reqc ; // c u r r e n t g o e s t h r o u g h t h e ammeter
21
22 printf ( ” R e a d i n g o f t h e Ammeter i s = %f A” ,I ) ;
Scilab code Exa 32.9 To Find the Time Constant and Time taken for Charge Storage
1
2 //To Find t h e Time C o n s t a n t and Time t a k e n f o r
Charge S t o r a g e
3
4 // Example 3 2 . 9
5
6 clear ;
7
8 clc ;
9
10 C =100*10^ -6; // C a p a c i t a n c e o f t h e C a p a c i t o r i n
Faraday
11
12 R =2; // I n t e r n a l r e s i s t a n c e o f b a t t e r y i n Ohms
13
14 T0 = R * C ; // Time c o n s t a n t i n s e c o n d s
15
16 printf ( ” ( a ) Time c o n s t a n t = %f u s ” , T0 *10^6) ;
17
18 E =12; //EMF o f t h e b e t t e r y
19
20 q =0.99* E * C ; // Charge a t t i m e ( t )
53
21
22 t = - log (1 -( q /( E * C ) ) ) * T0 ; // Time t a k e n b e f o r e 99% o f
t h e Maximum Charge i s s t o r e d on t h e C a p a c i t o r
23
24 printf ( ” \n ( b ) Time t a k e n b e f o r e 99 p e r c e n t o f t h e
Maximum Charge i s s t o r e d on t h e C a p a c i t o r = %. 2 f
ms” ,t *10^3) ;
Scilab code Exa 32.10 To Find the Charge Remaining on the Capacitor
1
2 //To Find t h e Charge Remaining on t h e C a p a c i t o r 1 s
a f t e r t h e c o n n e c t i o n i s made
3
4 // Example 3 2 . 1 0
5
6 clear ;
7
8 clc ;
9
10 C =50*10^ -6; // C a p a c i t a n c e o f P a r a l l e l P l a t e C a p a c i t o r
11
12 R =1.0*10^3; // R e s i s t a n c e o f t h e c o n n e c t e d R e s i s t o r
13
14 T0 = C * R ; // Time c o n s t a n t o f RC C i r c u i t
15
16 t =1; // D u r a t i o n o f D i s c h a r g e o f C a p a c i t o r
17
18 Q =400*10^ -6; // I n i t i a l Charge on t h e C a p a c i t o r
19
20 q = Q * exp ( - t / T0 ) ; // Charge r e m a i n i n g on t h e C p a c i t o r
54
21
22 printf ( ” Charge r e m a i n i n g on t h e c a p a c i t o r a f t e r 1 s =
%. 2 f ∗10ˆ −7 uC” ,q *10^13) ;
55
Chapter 33
Scilab code Exa 33.1 To Calculate the Heat Developed in each resistor
1
2 //To C a l c u l a t e t h e Heat D e v e l o p e d i n e a c h o f t h e
three r e s i s t o r
3
4 // Example 3 3 . 1
5
6 clear ;
7
8 clc ;
9
10 R1 =6; // R e s i s t a n c e o f t h e f i r s t resistor
11
12 R2 =3; // R e s i s t a n c e o f t h e s e c o n d r e s i s t o r
13
14 Req = R1 * R2 /( R1 + R2 ) ; // E q u i v a l e n t r e s i s t a n c e o f R1 and
R2
15
16 R3 =1; // R e s i s t a n c e of the t h i r d r e s i s t o r
17
56
18 R = Req + R3 ; // E q u i v a l e n t r e s i s t a n c e o f t h e c i r c u i t
19
20 V =9; // V o l t a g e a c r o s s t h e b a t t e r y
21
22 i = V / R ; // C u r r e n t t h r o u g h t h e C i r c u i t
23
24 t =60; // Time i n s e c o n d s
25
26 H3 = i ^2* R3 * t ; // Heat d e v e l o p e d i n t h i r d r e s i s t o r
27
28 i1 = i * R /( R1 + R2 ) ; // C u r r e n t t h r o u g h t h e 6 ohm r e s i s t o r
29
30 H1 = i1 ^2* R1 * t ; // Heat d e v e l o p e d i n f i r s t resistor
31
32 i2 =i - i1 ; // c u r r e n t t h r o u g h t h e 3 ohm r e s i s t o r
33
34 H2 = i2 ^2* R2 * t ; // h e a t d e v e l o p e d i n S e c o n d R e s i s t o r
35
36 printf ( ” Heat d e v e l o p e d i n t h e f i r s t r e s i s t o r =%d J ” ,
H1 ) ;
37
38 printf ( ” \ nHeat d e v e l o p e d i n t h e s e c o n d r e s i s t o r =%d J
” , H2 ) ;
39
40 printf ( ” \ nHeat d e v e l o p e d i n t h e t h i r d r e s i s t o r =%d J ”
, H3 ) ;
1
2 //To C a l c u l a t e t h e N e u t r a l T e m p e r a t u r e
3
4 // Example 3 3 . 2
57
5
6 clear ;
7
8 clc ;
9
10 ThetaI =530; // I n v e r s i o n t e m p e r a t u r e i n d e g r e e C e l s i u s
11
12 ThetaC =10; // T e m p e r a t u r e o f t h e c o l d j u n c t i o n i n
degree Celsius
13
14 ThetaN =( ThetaI + ThetaC ) /2; // N e u t r a l t e m p e r a t u r e i n
degree Celsius
15
16 printf ( ” N e u t r a l T e m p e r a t u r e = %d d e g r e e c e l s i u s ” ,
ThetaN ) ;
1
2 //To Find Thermal C o e f f i c i e n t s a and b
3
4 // Example 3 3 . 3
5
6 clear ;
7
8 clc ;
9
10 acupb =2.76*10^ -6; // C o e f f i c i e n t ( a ) f o r Copper−Lead
Thermocouple
11
12 afepb =16.6*10^ -6; // C o e f f i c i e n t ( a ) f o r I r o n −Lead
Thermocouple
13
58
14 acufe = acupb - afepb ; // C o e f f i c i e n t ( a ) f o r Copper−I r o n
Thermocouple
15
16 bcupb =0.012*10^ -6; // C o e f f i c i e n t ( b ) f o r Copper−Lead
Thermocouple
17
18 bfepb = -0.030*10^ -6; // C o e f f i c i e n t ( b ) f o r I r o n −Lead
Thermocouple
19
20 bcufe = bcupb - bfepb ; // C o e f f i c i e n t ( b ) f o r Copper−I r o n
Thermocouple
21
22 printf ( ” Thermal C o e f f i c i e n t ( a ) f o r Copper−I r o n
T h e r m o c o u p l e = %f uV/ deg C” , acufe *10^6) ;
23
24 printf ( ” \ nThermal C o e f f i c i e n t ( b ) f o r Copper−I r o n
T h e r m o c o u p l e =%f uV/ deg Cˆ2 ” , bcufe *10^6) ;
1
2 //To C a l c u l a t e t h e E l e c t r i c C u r r e n t
3
4 // Example 3 3 . 4
5
6 clear ;
7
8 clc ;
9
10 m =0.972; // Mass o f Chromium d e p o s i t e d i n grams
11
12 Z =0.00018; // E l e c t r o c h e m i c a l E q u i v a l e n t o f Chromium
13
59
14 t =3*3600; // Time i s i n s e c o n d s
15
16 I = m /( Z * t ) ; // E l e c t r i c C u r r e n t r e q u i r e d t o d e p o s i t t h e
Chromium i n t h r e e h o u r s
17
18 printf ( ” E l e c t r i c C u r r e n t r e q u i r e d t o d e p o s i t 0 . 9 7 2 g
o f Chromium i n t h r e e h o u r s = %f A” ,I ) ;
60
Chapter 34
Magnetic Field
1
2 //To Find t h e F o r c e and A c c e l e r a t i o n
3
4 // Example 3 4 . 1
5
6 clear ;
7
8 clc ;
9
10 q =1.6*10^ -19; // Charge on a p r o t o n i n Coloumbs
11
12 v =3.0*10^6; // P r o j e c t e d Speed o f t h e P r o t o n i n m/ s
13
14 B =2.0*10^ -3; // Uniform m a g n e t i c f i e l d s t r e n g t h i n
Tesla
15
16 theta = %pi /2; // A n g l e b e t w e e n M a g n e t i c F i e l d and
Velocity
17
18 F = q * v * B * sin ( theta ) ; // F o r c e on t h e p r o t o n due t o
Magnetic F i e l d
61
19
20 printf ( ” F o r c e on t h e p r o t o n = %f ∗10ˆ −16 N” ,F *10^16) ;
21
22 m =1.67*10^ -27; // Mass o f a p r o t o n i n kg
23
24 a = F / m ; // A c c e l e r a t i o n o f t h e p r o t o n i n m/ s ˆ2
25
26 printf ( ” \n A c c e l e r a t i o n o f t h e p r o t o n=%f ∗ 1 0 ˆ 1 1 m/ s ˆ2
” ,a *10^ -11) ;
1
2 //To c a l c u l a t e t h e Time P e r i o d
3
4 // Example 3 4 . 2
5
6 clear ;
7
8 clc ;
9
10 m =10*10^ -6; // Mass o f t h e p a r t i c l e i n kg
11
12 q =100*10^ -6; // Charge o f t h e p a r t i c l e i n Coloumbs
13
14 B =25*10^ -3; // M a g n e t i c F i e l d S t r e n g t h i n T e s l a
15
16 T =2* %pi * m /( q * B ) ; // Time P e r i o d i n s e c o n d s
17
18 printf ( ” Time P e r i o d o f t h e c h a r g e = %d s e c o n d s ” ,T ) ;
62
Scilab code Exa 34.4 To Find the Magnetic Dipole Moment of the Current Loop
1
2 //To Find t h e M a g n e t i c D i p o l e Moment o f t h e C u r r e n t
Loop
3
4 // Example 3 4 . 4
5
6 clear ;
7
8 clc ;
9
10 i =10.0*10^ -9; // C u r r e n t i n t h e C i r c u l a r Loop i n
Amperes
11
12 r =5.0*10^ -2; // R a d i u s o f t h e C i r c u l a r Loop in metres
13
14 A = %pi * r ^2; // Area o f C i r c u l a r Loop
15
16 u = i * A ; // M a g n e t i c D i p o l e Moment i n A−mˆ2
17
18 printf ( ” M a g n e t i c D i p o l e Moment = %f ∗10ˆ −11 A−mˆ2 ” ,u
*10^11) ;
63
Chapter 35
Scilab code Exa 35.1 To Calculate Magnetic Field due to a piece of Wire
1
2 //To C a l c u l a t e M a g n e t i c F i e l d due t o a 1cm p i e c e o f
Wire
3
4 // Example 3 5 . 1
5
6 clear ;
7
8 clc ;
9
10 i =10; // C u r r e n t i n t h e Wire i n Amperes
11
12 dl =10^ -2; // Length o f t h e w i r e i n m e t r e s
13
14 r =2; // D i s t a n c e o f p o i n t P from w i r e i n m e t r e s
15
16 theta = %pi /4; // A n g l e made by p o i n t P w i t h t h e w i r e
17
18 k =1*10^ -7; // C o n s t a n t ( u0 / ( 4 ∗ p i ) )
64
19
20 dB =( k * i * dl * sin ( theta ) ) / r ^2; // Formula f o r f i n d i n g the
magnetic f i e l d
21
22 printf ( ” M a g n e t i c F i e l d due t o a p i e c e o f Wire = %. 1 f
∗10ˆ −9 T” , dB *10^9) ;
Scilab code Exa 35.2 To Find Magnetic Field between two wires
1
2 //To Find M a g n e t i c F i e l d b e t w e e n t h e w i r e s
3
4 // Example 3 5 . 2
5
6 clear ;
7
8 clc ;
9
10 i =10; // C u r r e n t f l o w i n g t h r o u g h w i r e s i n Amperes
11
12 l =5*10^ -2; // S e p e r a t i o n b e t w e e n two w i r e s i n m e t r e s
13
14 d = l /2; // D i s t a n c e o f P o i n t P from b o t h w i r e s i n
metres
15
16 k =2*10^ -7; // C o n s t a n t k=(u0 / ( 2 ∗ %pi ) )
17
18 B = k * i / d ; // M a g n e t i c F i e l d a t p o i n t P due t o e a c h w i r e
19
20 Bnet =2* B ; // Net M a g n e t i c F i e l d a t P o i n t P due t o b o t h
wires
21
22 printf ( ” M a g n e t i c F i e l d a t p o i n t P b e t w e e n t h e two
65
w i r e s = %. 0 f uT” , Bnet *10^6) ;
1
2 //To Find t h e Magnitude o f M a g n e t i c F o r c e
e x p e r i e n c e d by 10 cm o f a w i r e
3
4 // Example 3 5 . 3
5
6 clear ;
7
8 clc ;
9
10 i =5; // C u r r e n t i n Amperes
11
12 d =2.5*10^ -2; // S e p a r a t i o n b e t w e e n t h e w i r e s i n m e t r e s
13
14 k =2*10^ -7; // C o n s t a n t k=(u0 / ( 2 ∗ %pi ) )
15
16 B = k * i / d ; // M a g n e t i c F i e l d a t t h e s i t e o f one w i r e due
to other in T
17
18 l =10*10^ -2; // l e n g t h o f t h e w i r e i n m e t r e s
19
20 F = i * l * B ; // M a g n e t i c f o r c e e x p e r i e n c e d by t h e 10 cm o f
t h e w i r e due t o t h e o t h e r
21
22 printf ( ” M a g n e t i c f o r c e e x p e r i e n c e d by t h e 10 cm o f
t h e w i r e due t o t h e o t h e r = %. 1 f ∗10ˆ −5 N” ,F *10^5)
;
66
Scilab code Exa 35.4 To Calculate the Magnetic Field at the centre of Coil
1
2 //To C a l c u l a t e t h e M a g n e t i c F i e l d a t t h e C e n t r e o f
Coil
3
4 // Example 3 5 . 4
5
6 clear ;
7
8 clc ;
9
10 i =1.5; // C u r r e n t C a r r i e d by t h e C i r c u l a r Coil in
Amperes
11
12 n =25; // Number o f t u r n s i n t h e c o i l
13
14 a =1.5*10^ -2; // R a d i u s o f t h e C i r c u l a r c o i l i n m e t r e s
15
16 u0 =4* %pi *10^ -7; // P e r m e a b i l i t y o f Vaccum
17
18 B = u0 * i * n /(2* a ) ; // f o r m u l a f o r f i n d i n g t h e m a g n e t i c
f i e l d at the centre
19
20 printf ( ” M a g n e t i c F i e l d a t t h e C e n t r e o f C o i l = %. 2 f
∗10ˆ −3 T” ,B *10^3) ;
67
1
2 //To C a l c u l a t e t h e Amount o f C u r r e n t
3
4 // Example 3 5 . 5
5
6 clear ;
7
8 clc ;
9
10 B =20*10^ -3; // M a g n e t i c f i e l d i n s i d e t h e s o l e n o i d in
Tesla
11
12 n =20*10^2; // Number o f t u r n s p e r u n i t m e t r e
13
14 u0 =4* %pi *10^ -7; // P e r m i a b i l i t y o f Vaccum
15
16 i = B /( u0 * n ) ; // C u r r e n t f l o w i n g t h r o u g h t h e s o l e n o i d in
Amperes
17
18 printf ( ” C u r r e n t f l o w i n g t h r o u g h t h e s o l e n o i d = %. 1 f
A” ,i ) ;
68
Chapter 36
Permanent Magnets
Scilab code Exa 36.1 To Find the Magnetic Field on Axis of Solenoid
1
2 //To Find t h e M a g n e t i c F i e l d on A x i s o f S o l e n o i d
3
4 // Example 3 6 . 1
5
6 clear ;
7
8 clc ;
9
10 i =10; // C u r r e n t c a r r i e d by S o l e n o i d i n Amperes
11
12 r =1*10^ -2; // R a d i u s o f S o l e n o i d i n m e t r e s
13
14 A = %pi * r ^2; // Area o f C r o s s S e c t i o n o f S o l e n o i d i n
m e t r e ˆ2
15
16 u = i * A ; // D i p o l e Moment o f e a c h t u r n
17
18 l =10*10^ -2; // Length o f S o l e n o i d i n m e t r e s
19
20 R =10*10^ -2; // D i s t a n c e o f p o i n t P from t h e c e n t r e of
69
solenoid
21
22 n =200; // Number o f t u r n s i n S o l e n o i d
23
24 d = l / n ; // S e p e r a t i o n b e t w e e n two c o n s e c u t i v e t u r n s
25
26 m = u / d ; // P o l e S t r e n g t h f o r e a c h C u r r e n t Loop
27
28 k =1*10^ -7; // C o n s t a n t ( u0 / ( 4 ∗ p i ) )
29
30 Rn =R -( l /2) ; // D i s t a n c e o f p o i n t P from North P o l e
31
32 Bn = k * m / Rn ^2; // M a g n e t i c F i e l d a t P due t o North P o l e
33
34 Rs = R +( l /2) ; // D i s t a n c e o f p o i n t P from South P o l e
35
36 Bs = k * m /( Rs ) ^2; // M a g n e t i c F i e l d a t P due t o South
Pole
37
38 B = Bn - Bs ; // R e s u l t a n t M a g n e t i c F i e l d a t p o i n t P
39
40 printf ( ” M a g n e t i c f i e l d a t a p o i n t on t h e a x i s o f
S o l e n o i d a t a d i s t a n c e o f 10cm from c e n t r e = %. 1 f
∗10ˆ −4 T away from t h e s o l e n o i d ” ,B *10^4) ;
Scilab code Exa 36.2 To Calculate the Work Done in Rotating the Magnet
1
2 //To C a l c u l a t e t h e Work Done i n R o t a t i n g t h e Magnet
3
4 // Example 3 6 . 2
5
6 clear ;
70
7
8 clc ;
9
10 M =1.0*10^4; // M a g n e t i c Moment o f t h e Bar Magnet i n J /
T
11
12 B =4*10^ -5; // H o r i z o n t a l M a g n e t i c F i e l d i n T e s l a
13
14 theta1 =0; // I n i t i a l A n g u l a r p o s i t i o n o f t h e Magnet
15
16 theta2 = %pi /3; // F i n a l A n g u l a r p o s i t i o n o f t h e Magnet
17
18 W = - M * B *( cos ( theta2 ) - cos ( theta1 ) ) ; // Work Done i n
R o t a t i n g t h e Magnet
19
20 printf ( ”Work Done i n R o t a t i n g t h e Magnet = %. 1 f J ” ,W
);
Scilab code Exa 36.3 To Calculate the magnitude of the Magnetic Field at a point o
1
2 //To C a l c u l a t e t h e Magnitude o f t h e M a g n e t i c F i e l d
a t a p o i n t on i t s A x i s a t a d i s t a n c e o f 20cm from
it .
3
4 // Example 3 6 . 3
5
6 clear ;
7
8 clc ;
9
10 m =12; // P o l e S t r e n g t h o f Magnet i n A−m
11
71
12 l =0.05; // M a g n e t i c Length o f Magnet i n m e t r e s
13
14 d =0.2; // D i s t a n c e o f t h e g i v e n p o i n t from c e n t e r of
magnet i n m e t r e s
15
16 k =1*10^ -7; // C o n s t a n t ( u0 / ( 4 ∗ p i ) )
17
18 M =2* m * l ; // M a g n e t i c Moment o f t h e Magnet
19
20 B = k *2* M * d /(( d ) ^2 -( l ) ^2) ^2; // M a g n e t i c F i e l d a t t h e
P o i n t 20 cm from t h e c e n t r e
21
22 printf ( ” Magnitude o f t h e M a g n e t i c F i e l d a t a p o i n t
o f 20 cm from t h e c e n t e r o f magnet = %. 1 f ∗10ˆ −5 T
” ,B *10^5) ;
Scilab code Exa 36.4 To Find the Magnetic Field due to Magnetic Dipole
1
2 //To Find t h e M a g n e t i c F i e l d due t o M a g n e t i c D i p o l e
3
4 // Example 3 6 . 4
5
6 clear ;
7
8 clc ;
9
10 M =1.2; // M a g n e t i c Moment o f t h e D i p o l e i n A−mˆ2
11
12 r =1; // D i s t a n c e o f p o i n t P from M a g n e t i c P o l e i n
metres
13
14 theta = %pi /3; // A n g l e made by g i v e n p o i n t w i t h t h e
72
Dipole Axis in r a d i a n s
15
16 k =1*10^ -7; // C o n s t a n t ( u0 / ( 4 ∗ p i ) )
17
18 B = k * M * sqrt (1+3*( cos ( theta ) ) ^2) /( r ) ^3; // Magnitude o f
M a g n e t i c F i e l d a t t h e Given P o i n t i n T e s l a
19
20 printf ( ” Magnitude o f M a g n e t i c f i e l d a t a p o i n t 1
m e t r e from t h e M a g n e t i c D i p o l e = %. 1 f ∗10ˆ −7 T” ,B
*10^7) ;
21
22 alpha = atan ( tan ( theta ) /2) *180/ %pi ; // A n g l e made by
magnetic f i e l d with the r a d i a l l i n e
23
24 printf ( ” \n M a g n e t i c f i e l d makes an a n g l e %. 2 f
d e g r e e s w i t h t h e r a d i a l l i n e ” , alpha ) ;
Scilab code Exa 36.5 To Calculate the Magnitude of Earth Magnetic Field
1
2 //To C a l c u l a t e t h e Magnitude o f t h e Earth ’ s M a g n e t i c
Field
3
4 // Example 3 6 . 5
5
6 clear ;
7
8 clc ;
9
10 Bh =3.6*10^ -5; // H o r i z o n t a l component o f Earth ’ s
Magnetic F i e l d in Tesla
11
12 theta = %pi /3; // Dip A n g l e i n r a d i a n s
73
13
14 B = Bh / cos ( theta ) ; // R e s u l t a n t M a g n e t i c F i e l d
15
16 printf ( ” Magnitude o f t h e E a r t h m a g n e t i c f i e l d = %. 1 f
∗10ˆ −5 T” ,B *10^5) ;
1
2
3 //To C a l c u l a t e t h e True Dip
4
5 // Example 3 6 . 6
6
7 clear ;
8
9 clc ;
10
11 alpha = %pi /4; // A n g l e made by Dip C i r c l e t o t h e
Meridian in radians
12
13 del1 = %pi /6; // Apparent Dip i n r a d i a n s
14
15 del = atan ( tan ( del1 ) * cos ( alpha ) ) *180/ %pi ; // True Dip i n
degrees
16
17 printf ( ” True d i p = %f d e g r e e s ” , del ) ; // Answer
mentioned as atan (1/ s q r t ( 6 ) ) in the textbook
which i s same a s 2 2 . 2 0 7 d e g r e e s
74
Scilab code Exa 36.7 To Calculate the Value of Horizontal Component of Earth Magne
1
2 //To C a l c u l a t e t h e V a l u e o f H o r i z o n t a l Component o f
Earth ’ s M a g n e t i c F i e l d
3
4 // Example 3 6 . 7
5
6 clear ;
7
8 clc ;
9
10 n =66; // Number o f t u r n s i n Tangent G a l v a n o m e t e r
11
12 i =0.1; // C u r r e n t p a s s i n g t h r o u g h G a l v a n o m e t e r i n
Amperes
13
14 d =22*10^ -2; // D i a m e t e r o f c o i l i n m e t r e s
15
16 theta = %pi /4; // D e f e l c t i o n i n G a l v a n o m e t e r i n r a d i a n s
17
18 u0 =4* %pi *10^ -7; // p e r m e a b i l i t y o f vaccum
19
20 Bh =( u0 * n * i ) /( d * tan ( theta ) ) ; // H o r i z o n t a l component o f
Earths Magnetic F i e l d
21
22 printf ( ” H o r i z o n t a l component o f E a r t h M a g n e t i c F i e l d
= %. 1 f ∗10ˆ −5 T” , Bh *10^5) ;
75
Scilab code Exa 36.8 To Calculate the Shunt Resistance for Galvanometer
1
2 //To C a l c u l a t e t h e Shunt R e s i s t a n c e f o r G a l v a n o m e t e r
3
4 // Example 3 6 . 8
5
6 clear ;
7
8 clc ;
9
10 i =2; //Maximumm C u r r e n t i n Amperes
11
12 ig =20*10^ -3; // Minimum c u r r e n t r e q u i r e d f o r one f u l l
s c a l e d e f l e c t i o n i n G a l v a n o m e t e r i n Amperes
13
14 Rg =20; // R e s i s t a n c e o f G a l v a n o m e t e r C o i l i n ohms
15
16 Rs =( ig * Rg ) /( i - ig ) ; // Shunt R e s i s t a n c e f o r
G a l v a n o m e t e r i n o r d e r t o p a s s a maximum c u r r e n t
o f 2A
17
18 printf ( ” Shunt R e s i s t a n c e f o r G a l v a n o m e t e r i n o r d e r
t o p a s s a maximum c u r r e n t o f 2A = %. 1 f ohms ” , Rs ) ;
Scilab code Exa 36.9 To Compare the total Magnetic Field due to earth at the two p
76
2
3 //To Compare t h e t o t a l M a g n e t i c F i e l d due t o e a r t h
a t t h e two p l a c e s
4
5 // Example 3 6 . 9
6
7 clear ;
8
9 clc ;
10
11 T1 =3; // Time p e r i o d f o r f i r s t place in seconds
12
13 T2 =2; // Time P e r i o d f o r s e c o n d p l a c e i n s e c o n d s
14
15 theta1 = %pi /4; // Dip i n r a d i a n s a t f i r s t p l a c e
16
17 theta2 = %pi /6; // Dip i n r a d i a n s a t s e c o n d p l a c e
18
19 Br =( T1 ^2/ T2 ^2) * cos ( theta1 ) / cos ( theta2 ) ; // R a t i o o f
M a g n e t i c F i e l d due t o e a r t h a t two p l a c e s
20
21 printf ( ” The r a t i o o f M a g n e t i c F i e l d due t o e a r t h a t
t h e two p l a c e s = %. 3 f ” , Br ) ;
77
Chapter 37
Scilab code Exa 37.1 To Calculate the Intensity of Magnetization of Bar Magnet
1
2 //To C a l c u l a t e t h e I n t e n s i t y o f M a g n e t i z a t i o n o f Bar
Magnet
3
4 // Example 3 7 . 1
5
6 clear ;
7
8 clc ;
9
10 m =6.6*10^ -3; // Mass o f b a r magnet ( made o f s t e e l ) in
kg
11
12 rho =7.9*10^3; // D e n s i t y o f s t e e l i n kg /mˆ3
13
14 M =2.5; // M a g n e t i c Moment o f Bar Magnet i n A−mˆ2
15
16 V = m / rho ; // Volume o f b a r magnet i n mˆ3
17
18 I = M / V ; // I n t e n s i t y o f M a g n e t i z a t i o n i n A/m
19
78
20 printf ( ” I n t e n s i t y o f m a g n e t i z a t i o n o f b a r magnet = %
. 1 f ∗ 1 0 ˆ 6 A/m” ,I *10^ -6) ;
Scilab code Exa 37.3 To Calculate the percentage increase in Magnetic Field
1
2 //To C a l c u l a t e t h e p e r c e n t a g e i n c r e a s e i n M a g n e t i c
Field
3
4 // Example 3 7 . 3
5
6 clear ;
7
8 clc ;
9
10 X =2.1*10^ -5; // S u s c e p t i b i l i t y o f Aluminium
11
12 Bin = X *100; // P e r c e n t a g e i n c r e a s e i n M a g n e t i c F i e l d
13
14 printf ( ” P e r c e n t a g e i n c r e a s e i n t h e M a g n e t i c F i e l d =
%. 1 f ∗10ˆ −3 ” , Bin *10^3) ;
79
Chapter 38
Electromagnetic Induction
Scilab code Exa 38.3 To Calculate the Self Inductance of the Coil
1
2 //To C a l c u l a t e t h e S e l f I n d u c t a n c e o f C o i l
3
4 // Example 3 8 . 3
5
6 clear ;
7
8 clc ;
9
10 If = -5.0; // F i n a l C u r r e n t f l o w i n g t h r o u g h c o i l in
o p p o s i t e d i r e c t i o n i n Amperes
11
12 Ii =5.0; // I n i t i a l Current f l o w i n g through c o i l in
Amperes
13
14 t =0.20; // Time R e q u i r e d f o r c u r r e n t t o Change from −5
A to 5 A in seconds
15
16 di =( If - Ii ) / t ; // Change i n C u r r e n t t h r o u g h t h e c o i l in
Amperes
17
80
18 E =0.2; // A v e r a g e I n d u c e d EMF i n V o l t s
19
20 L = - E / di ; // S e l f I n d u c t a n c e o f t h e C o i l
21
22 printf ( ” S e l f I n d u c t a n c e o f t h e c o i l ( L ) = %. 1 f mH” ,L
*10^3) ;
Scilab code Exa 38.5 To find the Time Constant Maximum Current and Time
1
2 //To f i n d t h e Time C o n s t a n t Maximum C u r r e n t and Time
3
4 // Example 3 8 . 5
5
6 clear ;
7
8 clc ;
9
10 L =20*10^ -3; // S e l d I n d u c t a n c e o f I n d u c t o r
11
12 R =100; // R e s i s t a n c e o f t h e R e s i s t o r i n ohms
13
14 tau = L / R ; // Time C o n s t a n t o f L−R c i r c u i t
15
16 printf ( ” ( a ) Time C o n s t a n t =%. 2 f ms” , tau *10^3) ;
17
18 E =10; //EMF o f B a t t e r y i n V o l t s
19
20 I = E / R ; //Maximum C u r r e n t i n Amperes
21
22 printf ( ” \n ( b ) Maximum c u r r e n t = %. 2 f A” ,I ) ;
23
24 iper =0.99; // C u r r e n t r e a c h e s 99% o f t h e Maximum V a l u e
81
25
26 t = tau * - log (1 - iper ) ; // Time e l a p s e d befor the current
r e a c h e s 99% o f t h e maxium v a l u e
27
28 printf ( ” \n ( c ) Time e l a p s e d b e f o r e t h e c u r r e n t
r e a c h e s 99 p e r c e n t o f t h e maximum v a l u e = %. 2 f ms
” ,t *10^3) ;
1
2 //To C a l c u l a t e t h e C u r r e n t i n C i r c u i t
3
4 // Example 3 8 . 6
5
6 clear ;
7
8 clc ;
9
10 E =10; //EMF o f B a t t e r y i n V o l t s
11
12 R =100; // R e s i s t a n c e i n ohms
13
14 i0 = E / R ; // I n i t i a l C u r r e n t i n Amperes
15
16 L =20*10^ -3; // S e l f I n d u c t a n c e o f I n d u c t o r i n Henry
17
18 tau = L / R ; // Time C o n s t a n t o f L−R C i r c u i t
19
20 t =1*10^ -3; // Time a f t e r S h o r t −C i r c u i t i n g i n s e c o n d s
21
22 i = i0 * exp ( - t / tau ) ; // C u r r e n t i n t h e c i r c u i t 1 ms a f t e r
short circuiting
82
23
24 printf ( ” C u r r e n t i n t h e c i r c u i t 1 ms a f t e r S h o r t
C i r c u i t i n g = %. 1 f ∗10ˆ −4 A” ,i *10^4) ;
Scilab code Exa 38.7 To Calculate the Energy Stored in the Inductor
1
2 //To C a l c u l a t e t h e Energy S t o r e d i n t h e I n d u c t o r
3
4 // Example 3 8 . 7
5
6 clear ;
7
8 clc ;
9
10 L =50*10^ -3; // S e l f I n d u c t a n c e o f I n d u c t o r i n Henry
11
12 i =2; // Cuurent p a s s e d t h r o u g h i n d u c t o r i n Amperes
13
14 U =0.5* L * i ^2; // Energy s t o r e d i n t h e I n d u c t o r
15
16 printf ( ” Energy s t o r e d i n t h e i n d u c t o r = %. 2 f J ” ,U ) ;
83
Chapter 39
Alternating Current
Scilab code Exa 39.1 To Calculate the rms value of Current and time required to re
1
2 //To C a l c u l a t e t h e rms v a l u e o f C u r r e n t and t i m e
r e q u i r e d t o r e a c h t h e Peak V a l u e
3
4 // Example 3 9 . 1
5
6 clear ;
7
8 clc ;
9
10 i0 =5; // Peak V a l u e o f A l t e r n a t i n g C u r r e n t i n Amperes
11
12 Irms = i0 / sqrt (2) ; //RMS V a l u e o f A l t e r n a t i n g C u r r e n t
i n Amperes
13
14 f =60; // F r e q u e n c y o f A l t e r n a t i n g C u r r e n t i n Hz
15
16 T =1/ f ; // Time p e r i o d of A l t e r n a t i n g Current in
seconds
17
18 t = T /4; // Time r e q u i r e d t o r e a c h t h e Peak V a l u e o f
84
Current in seconds
19
20 printf ( ”RMS V a l u e o f t h e A l t e r n a t i n g C u r r e n t = %. 1 f
A” , Irms ) ;
21
22 printf ( ” \n Time r e q u i r e d t o r e a c h t h e Peak V a l u e o f
C u r r e n t = %f s ” ,t ) ;
Scilab code Exa 39.2 To Calculate the Reactance of Capacitor for different frequen
1
2 //To C a l c u l a t e t h e R e a c t a n c e o f C a p a c i t o r f o r
d i f f e r e n t f r e q u e n c i e s of Alternating Currents
3
4 // Example 3 9 . 2
5
6 clear ;
7
8 clc ;
9
10 C =200*10^ -6; // C a p a c i t a n c e o f t h e C a p a c i t o r i n
Faraday
11
12 f1 =10; // F r e q u e n c y o f f i r s t AC s o u r c e i n Hz
13
14 f2 =50; // F r e q u e n c y o f S e c o n d AC S o u r c e i n Hz
15
16 f3 =500; // F r e q u e n c y o f T h i r d AC S o u r c e i n Hz
17
18 Xc1 =1/(2* %pi * f1 * C ) ; // R e a c t a n c e o f t h e C a p a c i t o r when
c o n n e c t e d t o 10 Hz AC s o u r c e
19
20 printf ( ” ( a ) R e a c t a n c e o f c a p a c i t o r f o r 10 hz s o u r c e
85
= %. 0 f ohms ” , Xc1 ) ;
21
22 Xc2 =1/(2* %pi * f2 * C ) ; // R e a c t a n c e o f t h e C a p a c i t o r when
c o n n e c t e d t o 50 Hz AC s o u r c e
23
24 printf ( ” \n ( b ) R e a c t a n c e o f c a p a c i t o r f o r 15 hz
s o u r c e= %. 0 f ohms ” , Xc2 ) ;
25
26 Xc3 =1/(2* %pi * f3 * C ) ; // R e a c t a n c e o f t h e C a p a c i t o r when
c o n n e c t e d t o 500 Hz AC s o u r c e
27
28 printf ( ” \n ( c ) R e a c t a n c e o f c a p a c i t o r f o r 500 hz
s o u r c e = %. 1 f ohms ” , Xc3 ) ;
Scilab code Exa 39.3 To Find the Peak Value of Current and the Instantaneous Volta
1
2 //To Find t h e Peak V a l u e o f C u r r e n t and t h e
I n s t a n t a n e o u s V o l t a g e o f t h e s o u r c e when t h e
c u r r e n t i s a t i t s peak v a l u e
3
4 // Example 3 9 . 3
5
6 clear ;
7
8 clc ;
9
10 f =50; // F r e q u e n c y o f AC s o u r c e i n Hz
11
12 L =200*10^ -3; // S e l f I n d u c t a n c e o f I n d u c t o r i n Henry
13
14 Xl =2* %pi * f * L ; // R e a c t a n c e o f t h e I n d u c t o r i n ohms
15
86
16 E0 =210; // Peak EMF V a l u e o f AC s o u r c e i n V o l t s
17
18 i0 = E0 / Xl ; // Peak V a l u e o f C u r r e n t i n Amperes
19
20 printf ( ” Peak V a l u e o f c u r r e n t = %. 1 f A” , i0 ) ;
21
22 i = i0 ; // I n s t a n t a n e o u s V a l u e o f C u r r e n t when c u r r e n t
a t t a i n s i t s peak v a l u e
23
24 phi = - %pi /2; // Phase D i f f e r e n c e in Radians f o r a
purely Inductive Circuit
25
26 t =( asin ( i / i0 ) - phi ) /(2* %pi * f ) ; // Time a t which c u r r e n t
a t t a i n s i t s peak v a l u e
27
28 E = E0 * sin (2* %pi * f * t ) ; // I n s t a n t a n e o u s V o l t a g e for a
purely inductive c i r c u i t
29
30 printf ( ” \n I n s t a n t a n e o u s v o l t a g e a t peak v a l u e o f
C u r r e n t = %. 0 f V” ,E ) ;
Scilab code Exa 39.4 To find the Impedance the Peak Current and the Resonant Frequ
1
2 //To f i n d t h e Impedance t h e Peak C u r r e n t and
R e s o n a n t F r e q u e n c y o f t h e LCR S e r i e s C i r c u i t
3
4 // Example 3 9 . 4
5
6 clear ;
7
8 clc ;
9
87
10 L =100*10^ -3; // S e l f I n d u c t a n c e o f I n d u c t o r i n H e n r y
11
12 C =100*10^ -6; // C a p a c i t a n c e o f C a p a c i t o r i n F a r a d s
13
14 R =120; // R e s i t a n c e o f R e s i s t o r i n ohms
15
16 E0 =30; // Peak V a l u e o f EMF o f AC s o u r c e i n V o l t s
17
18 w =100; // A n g u l a r F r e q u e n c y o f t h e AC s o u r c e
19
20 X =(1/( w * C ) ) -( w * L ) ; // R e a c t a n c e o f t h e C i r c u i t i n ohms
21
22 Z = sqrt ( R ^2+ X ^2) ; // T o t a l Impedance o f t h e C i r c u i t
23
24 printf ( ” Impedance o f t h e LCR S e r i e s C i r c u i t = %. 0 f
ohms ” ,Z ) ;
25
26 i0 = E0 / Z ; // Peak V a l u e o f C u r r e n t i n Amperes
27
28 printf ( ” \n Peak c u r r e n t V a l u e o f t h e LCR S e r i e s
C i r c u i t = %. 1 f A” , i0 ) ;
29
30 f =(1/(2* %pi ) ) * sqrt (1/( L * C ) ) ; // R e s o n a n t F r e q u e n c y o f
the C i r c u i t
31
32 printf ( ” \n R e s o n a n t F r e q u e n c y o f t h e LCR S e r i e s
C i r c u i t = %. 0 f Hz” ,f ) ;
Scilab code Exa 39.5 To Calculate the Number of Turns in the Primary Coil
1
2 //To C a l c u l a t e t h e Number o f Turns i n t h e Prima ry
Coil
88
3
4 // Example 3 9 . 5
5
6 clear ;
7
8 clc ;
9
10 E1 =220; // I n p u t V o l t a g e t o t h e T r a n s f o r m e r i n V o l t s
11
12 E2 =6; // Output V o l t a g e by t h e T r a n s f o r m e r i n V o l t s
13
14 N2 =18; // Number o f Turns i n t h e S e c o n d a r y C o i l
15
16 N1 =( E1 / E2 ) * N2 ; // Number o f Turns i n t h e Primary C o i l
17
18 printf ( ”Number o f t u r n s i n t h e p r i m a r y c o i l = %. 0 f ” ,
N1 ) ;
89
Chapter 40
Electromagnetic Waves
Scilab code Exa 40.2 To Find the Maximum Magnetic Field in the wave and its Direct
1
2 //To Find t h e Maximum M a g n e t i c F i e l d i n t h e wave and
its Direction
3
4 // Example 4 0 . 2
5
6 clear ;
7
8 clc ;
9
10 E0 =600; //Maximum E l e c t r i c Field in a plane
e l e c t r o m a g n e t i c wave i n N/C
11
12 c =3*10^8; // Speed o f l i g h t i n m/ s
13
14 B0 = E0 / c ; //Maximum M a g n e t i c F i e l d i n T e s l a
15
16 printf ( ” The maximum M a g n e t i c F i e l d = %. 0 f ∗10ˆ −6 T i n
t h e z d i r e c t i o n ” , B0 *10^6) ;
90
Scilab code Exa 40.3 To Find the Energy due to an Electromagnetic Wave
1
2
3 //To Find t h e Energy due t o an E l e c t r o m a g n e t i c Wave
4
5 // Example 4 0 . 3
6
7 clear ;
8
9 clc ;
10
11 E0 =50; //Maximum E l e c t r i c F i e l d i n N/C
12
13 x =50*10^ -2; // Length o f C y l i n d e r i n m e t r e s
14
15 A =10*10^ -4; // C r o s s −S e c t i o n a l Area o f C y l i n d e r i n mˆ2
16
17 e0 =8.85*10^ -12; // P e r m i t t i v i t y o f f r e e s p a c e
18
19 Uav =0.5* e0 * E0 ^2; // A v e r a g e Energy D e n s i t y
20
21 V = A * x ; // Volume o f C y l i n d e r
22
23 U = Uav * V ; // Energy c o n t a i n e d i n t h e Volume o f C y l i n d e r
24
25 printf ( ” Energy c o n t a i n e d i n t h e volume o f t h e
c y l i n d e r = %. 1 f ∗10ˆ −12 J ” ,U *10^12) ;
91
Scilab code Exa 40.4 To Find the Intensity of the Wave
1
2 //To Find t h e I n t e n s i t y o f Wave d i s c u s s e d i n e x a m p l e
40.3
3
4 // Example 4 0 . 4
5
6 clear ;
7
8 clc ;
9
10 Uav =1.1*10^ -8; // A v e r a g e Energy D e n s i t y i n J /mˆ3
11
12 c =3*10^8; // Speed o f L i g h t i n m/ s
13
14 I = Uav * c ; // I n t e n s i t y o f t h e Wave i n W/mˆ2
15
16 printf ( ” I n t e n s i t y o f t h e wave = %. 1 f W/mˆ2 ” ,I ) ;
92
Chapter 41
Scilab code Exa 41.1 To Calculate the Factor Increase in the Value of Thermionic C
1
2 //To C a l c u l a t e t h e F a c t o r I n c r e a s e i n t h e V a l u e o f
Thermionic Current
3
4 // Example 4 1 . 1
5
6 clear ;
7
8 clc ;
9
10 T1 =1500; // I n i t i a l T e m p e r a t u r e i n K e l v i n
11
12 T2 =2000; // F i n a l T e m p e r a t u r e i n K e l v i n
13
14 k =1.38*10^ -23; // Boltzmann C o n s t a n t
15
16 phi =4.5*1.6*10^ -19; // Work F u n c t i o n i n e l e c t r o n −v o l t s
17
18 Ir =( T2 / T1 ) ^2* exp (( - phi / k ) *((1/ T2 ) -(1/ T1 ) ) ) ; // F a c t o r
I n c r e a s e i n the Value o f Thermionic Current
19
93
20 printf ( ” T h e r m i o n i c c u r r e n t i n c r e a s e s %. d t i m e s when
t e m p e r a t u r e i s i n c r e a s e d from 1 5 0 0 K t o 2 0 0 0 K” ,
Ir ) ;
Scilab code Exa 41.2 To Calculate the Dynamic Plate Resistance at the operating co
1
2 //To C a l c u l a t e t h e Dynamic P l a t e R e s i s t a n c e a t t h e
operating condition
3
4 // Example 4 1 . 2
5
6 clear ;
7
8 clc ;
9
10 V1 =40; // I n i t i a l P l a t e V o l t a g e i n V o l t s
11
12 V2 =42; // F i n a l P l a t e V o l t a g e i n V o l t s
13
14 delVp = V2 - V1 ; // Change i n P l a t e V o l t a g e i n V o l t s
15
16 I1 =50*10^ -3; // I n i t i a l P l a t e C u r r e n t i n Amperes
17
18 I2 =60*10^ -3; // F i n a l P l a t e C u r r e n t i n Amperes
19
20 delIp = I2 - I1 ; // Change i n P l a t e C u r r e n t i n Amperes
21
22 Rp = delVp / delIp ; // Dynamic P l a t e R e s i s t a n c e i n ohms
23
24 printf ( ” Dynamic P l a t e R e s i s t a n c e = %d ohm” , Rp ) ;
94
95
Chapter 42
Scilab code Exa 42.1 To Calculate the Energy and linear Momentum and number of pho
1
2 //To C a l c u l a t e t h e Energy and l i n e a r Momentum and
number o f p h o t o n s
3
4 // Example 4 2 . 1
5
6 clear ;
7
8 clc ;
9
10 h =4.14*10^ -15; // Plank ’ s C o n s t a n t i n eV−s
11
12 c =3*10^8; // Speed o f L i g h t i n m/ s
13
14 l =600*10^ -9; // Wavelength o f L i g h t i n m e t r e s
15
16 E = h * c / l ; // Energy o f e a c h p h o t o n i n eV
17
18 printf ( ” ( a ) Energy o f e a c h p h o t o n = %. 2 f eV” ,E ) ;
96
19
20 p = E / c ; // L i n e a r Momentum o f e a c h p h o t o n i n eV−s /m
21
22 printf ( ” \n L i n e a r Momentum o f e a c h p h o t o n = %. 2 f
∗10ˆ −8 eV−s /m” ,p *10^8) ;
23
24 A =1*10^ -4; // Area o f c r o s s s e c t i o n i n mˆ2
25
26 e =1.6*10^ -19; // Charge on an e l e c t r o n
27
28 I =100; // I n t e n s i t y o f l i g h t i n W/mˆ2
29
30 t =1; // D u r a t i o n f o r which beam p a s s e s i n s e c o n d s
31
32 E1 = I * A * t ; // Energy c r o s s i n g 1 cmˆ2 i n 1 s e c o n d
33
34 n = E1 /( E * e ) ; // Number o f p h o t o n s c r o s s i n g 1 cmˆ2 i n 1
second
35
36 printf ( ” \n ( b ) Number o f p h o t o n s c r o s s i n g 1 cmˆ2 i n
1 s e c o n d = %. 1 f ∗ 1 0 ˆ 1 6 ” ,n *10^ -16) ;
Scilab code Exa 42.2 To Find the Maximum Wavelength of Light that can cause Photoe
1
2 //To Find t h e Maximum Wavelength o f L i g h t t h a t can
cause P h o t o o e l e c t r i c E f f e c t in Lithium
3
4 // Example 4 2 . 2
5
6 clear ;
7
8 clc ;
97
9
10 h =4.14*10^ -15; // Plank ’ s C o n s t a n t i n eV−s
11
12 c =3*10^8; // Speed o f L i g h t i n m/ s
13
14 phi =2.5; // Work F u n c t i o n o f L i t h i u m i n eV
15
16 l = h * c / phi ; // T h r e s h o l d Wavelength i n m e t r e s
17
18 printf ( ”Maximum Wavelength o f L i g h t t o c a u s e
P h o t o e l e c t r i c E f f e c t i n L i t h i u m = %. 0 f nm” ,l
*10^9) ;
Scilab code Exa 42.3 To Calculate the Time required by the Electron to receive suf
1
2 //To C a l c u l a t e t h e Time r e q u i r e d by t h e E l e c t r o n t o
r e c e i v e s u f f i c e n t e n e r g y t o come o u t o f t h e m e t a l
3
4 // Example 4 2 . 3
5
6 clear ;
7
8 clc ;
9
10 r =1.0*10^ -9; // R a d i u s o f C i r c l e i n m e t r e s on t h e
s u r f a c e o c c u p i e d by a s i n g l e e l e c t r o n
11
12 d =5.0; // D i s t a n c e b e t w e e n Monochromatic L i g h t s o u r c e
and M e t a l S u r f a c e i n m e t r e s
13
14 std = %pi * r ^2/ d ^2; // S o l i d A n g l e s u b t e n d e d a t t h e
s o u r c e by t h e C i r c u l a r Area i n s t e r d i a n
98
15
16 P =1*10^ -3; // Power o f m o n o c h r o m a t i c l i g h t source in
Watts
17
18 E = std * P /(4* %pi ) ; // Energy h e a d i n g t o w a r d s t h e
C i r c u l a r Area p e r s e c o n d
19
20 phi =2*1.6*10^ -19; // Work F u n c t i o n o f M e t a l i n J o u l e s
21
22 t = phi /( E *3600) ; // Time r e q u i r e d by t h e e l e c t r o n t o
r e c i e v e s u f f i c i e n t e n e r g y t o cmome o u t o f t h e
metal in hours
23
24 printf ( ” Time r e q u i r e d by t h e e l e c t r o n t o r e c i e v e
s u f f i c i e n t e n e r g y t o come o u t o f t h e m e t a l =%. 2 f
h o u r s ” ,t ) ;
99
Chapter 43
Scilab code Exa 43.1 Calculate the Energy of Helium ion its first excited state
100
17 printf ( ” Energy o f Helium I o n i n t h e f i r s t excited
s t a t e = %. 1 f eV” ,E ) ;
Scilab code Exa 43.2 To Calculate the Wavelength of Radiation for Helium Ion
1 //To C a l c u l a t e t h e Wavelength o f R a d i a t i o n f o r
Helium I o n
2
3 // Example 4 3 . 2
4
5 clear ;
6
7 clc ;
8
9 n =2; // F i n a l S t a t e o f t h e e l e c t r o n
10
11 m =3; // I n i t i a l S t a t e o f t h e E l e c t r o n
12
13 R =1.0973*10^7; // Rydberg ’ s C o n s t a n t
14
15 Z =2; // Atomic Number f o r Helium I o n
16
17 L =1/( R * Z ^2*((1/ n ^2) -(1/ m ^2) ) ) ; // Wavelength o f
r a d i a t i o n e m i t t e d when Helium i o n make a
t r a n s i t i o n from t h e s t a t e n=3 t o n=2
18
19 printf ( ” Wavelength o f r a d i a t i o n e m i t t e d when Helium
i o n makes a t r a n s i t i o n from t h e s t a t e n=3 t o n=2
i s = %. 0 f nm” ,L *10^9) ;
101
Scilab code Exa 43.3 To Calculate the Energy needed to remove the electron from th
1
2
3 //To C a l c u l a t e t h e Energy n e e d e d t o remove t h e
e l e c t r o n from t h e i o n
4
5 // Example 4 3 . 3
6
7 clear ;
8
9 clc ;
10
11 E1 =40.8; // E x c i t a t i o n Energy o f Hydroen l i k e ion
inits first e x c i t e d s t a t e i n eV
12
13 K =13.6; // V a l u e o f c o n s t a n t Rhc = 1 3 . 6 eV
14
15 n1 =1; // n=1 f o r t h e f i r s t orbit
16
17 n2 =2; // n=2 f o r t h e s e c o n d o r b i t
18
19 Z = sqrt ( E1 /( K *((1/ n1 ^2) -(1/ n2 ^2) ) ) ) ; // Atomic Number
o f Hydrogen l i k e i o n
20
21 E = - K * Z ^2; // Energy n e e d e d t o remove t h e e l e c t r o n from
t h e i o n i n eV
22
23 printf ( ” Energy r e q u i r e d t o remove t h e e l e c t r o n from
t h e i o n = %. 1 f eV” ,E ) ;
102
103
Chapter 45
Semiconductors and
Semiconductor Devices
Scilab code Exa 45.1 To Find the Electric Field which gives 1eV average energy to
1
2 //To Find t h e E l e c t r i c F i e l d which g i v e s 1eV a v e r a g e
energy to a conduction e l e c t r o n
3
4 // Example 4 5 . 1
5
6 clear ;
7
8 clc ;
9
10 e =1.6*10^ -19; // Charge on an e l e c t r o n i n Coloumbs
11
12 Eav =1* e ; // Energy t o t h e C o n d u c t i o n E l e c t r o n i n
Joules
13
14 l =4*10^ -8; // Mean F r e e Path o f C o n d u c t i o n E l e c t r o n s
i n Copper
15
16 E = Eav /( e * l ) ; // E l e c t r i c f i e l d which can g i v e , on an
104
a v e r a g e , 1eV t o a c o n d u c t i o n e l e c t r o n
17
18 printf ( ” E l e c t r i c f i e l d which can g i v e , on an a v e r a g e
, 1eV t o a c o n d u c t i o n e l e c t r o n = %. 1 f ∗ 1 0 ˆ 7 V/m” ,E
*10^ -7) ;
1
2
3 //To C a l c u l a t e t h e R e s i s t i v i t y o f n t y p e
semiconductor
4
5 // Example 4 5 . 2
6
7 clear ;
8
9 clc ;
10
11 e =1.6*10^ -19; // c h a r g e on an e l e c t r o n i n Coloumbs
12
13 ne =8*10^19; // D e n s i t y o f C o n d u c t i o n E l e c t r o n p e r
m e t r e ˆ3
14
15 ue =2.3; // M o b i l i t y o f C o n d u c t i o n E l e c t r o n i n mˆ2/V−s
16
17 nh =5*10^18; // D e n s i t y o f h o l e s p e r m e t r e ˆ3
18
19 uh =10^ -2; // M o b i l i t y o f h o l e s p e r mˆ2/V−s
20
21 c = e *(( ne * ue ) +( nh * uh ) ) ; // C o n d u c t i v i t y o f t h e
S e m i c o n d u c t o r i n C/ (m−V−s )
22
105
23 rho =1/ c ; // R e s i s t i v i t y o f S e m i c o n d u c t o r i n ohm−m e t r e
24
25 printf ( ” R e s i s t i v i t y o f t h e n−t y p e s e m i c o n d u c t o r = %
. 3 f ohm−m” , rho ) ; // The a n s w e r p r o v i d e d i n t h e
t e x t b o o k i s wrong
Scilab code Exa 45.3 To calculate the Approximate value of Dynamic Resistance of P
1
2 //To c a l c u l a t e t h e Approximate v a l u e o f Dynamic
R e s i s t a n c e o f P N J u n c t i o n u n d e r Forward B i a s
3
4 // Example 4 5 . 3
5
6 clear ;
7
8 clc ;
9
10 // ( a ) Case−I : Forward B i a s o f 1 V i s applied
11 //
//////////////////////////////////////////////////////////////////
12
13 i1 =10*10^ -3; // C u r r e n t i n Amperes a t 1 V o l t
14
15 i2 =15*10^ -3; // C u r r e n t i n Amperes a t 1 . 2 V o l t s
16
17 delI = i2 - i1 ; // Net Change i n C u r r e n t i n Amperes
18
19 v1 =1; // V o l t a g e a t t h e I n i t i a l P o i n t
20
21 v2 =1.2; // V o l t a g e a t t h e F i n a l p o i n t
22
106
23 delV = v2 - v1 ; // Net Change i n V o l t a g e
24
25 R = delV / delI ; // Dynamic R e s i t a n c e i n ohms
26
27 printf ( ” ( a ) Dynamic R e s i s t a n c e when a f o r w a r d b i a s
o f 1 V i s a p p l i e d a t t h e p−n j u n c t i o n = %. 0 f ohms
” ,R ) ;
28
29
30 // ( b ) Case−I I : Forward B i a s o f 2 V i s a p p l i e d
31 //
//////////////////////////////////////////////////////////////////
32
33 v3 =2; // V o l t a g e a t t h e I n i t i a l P o i n t
34
35 v4 =2.1; // V o l t a g e a t t h e F i n a l p o i n t
36
37 delV1 = v4 - v3 ; // Net Change i n V o l t a g e
38
39 i3 =400*10^ -3; // C u r r e n t i n Amperes a t 2 V o l t
40
41 i4 =800*10^ -3; // C u r r e n t i n Amperes a t 2 . 1 V o l t
42
43 delI1 = i4 - i3 ; // Net Change i n C u r r e n t i n Amperes
44
45 R1 = delV1 / delI1 ; // Dynamic R e s i t a n c e i n ohms
46
47 printf ( ” \n ( b ) Dynamic R e s i s t a n c e when a f o r w a r d
b i a s o f 2 V i s a p p l i e d a t t h e p−n j u n c t i o n = %. 2 f
ohms ” , R1 ) ;
107
Chapter 46
The Nucleus
Scilab code Exa 46.1 To Calculate the radius of Nucleus of Germanium atom
1
2
3 //To C a l c u l a t e t h e r a d i u s o f N u c l e u s o f Germanium
atom
4
5 // Example 4 6 . 1
6
7 clear ;
8
9 clc ;
10
11 A =70; // Mass Number o f Germanium Atom
12
13 R0 =1.1; // C o n s t a n t R0 i n f e t o m e t e r s
14
15 R = R0 * A ^(1/3) ; // R a d i u s o f N u c l e u s o f Germanium atom
16
17 printf ( ” R a d i u s o f N u c l e u s o f Germanium atom = %. 2 f
fm ” ,R ) ;
108
Scilab code Exa 46.2 To Calculate the Binding Energy of an Alpha Particle
1
2 //To C a l c u l a t e t h e B i n d i n g Energy o f an Alpha
Particle
3 // Example 4 6 . 2
4
5 clear ;
6
7 clc ;
8
9 u =931; // 1 Atomic Mass U n i t i n MeV/ c ˆ2
10
11 mH =1.007825* u ; // Mass o f Hydrogen atom i n MeV/ c ˆ2
12
13 mn =1.008665* u ; // Mass o f N e u t r o n i n MeV/ c ˆ2
14
15 mHe =4.00260* u ; // Mass o f Helium atom i n MeV/ c ˆ2
16
17 np =2; // Number o f p r o t o n s i n Alpha P a r t i c l e
18
19 nn =2; // Number o f N e u t r o n s i n Alpha P a r t i c l e
20
21 B =( np * mH + nn * mn - mHe ) ; // B i n d i n g Energy o f an Alpha
P a r t i c l e i n MeV
22
23 printf ( ” B i n d i n g e n e r g y o f an Alpha p a r t i c l e = %. 1 f
MeV” ,B ) ;
109
Scilab code Exa 46.3 To calculate the mass excess of Hydrogen
1
2 //To c a l c u l a t e t h e mass e x c e s s o f Hydrogen
3 // Example 4 6 . 3
4
5 clear ;
6
7 clc ;
8
9 u =931; // 1 Atomic Mass U n i t i n MeV/ c ˆ2
10
11 m =1.00783; // Mass o f Hydrogen atom i n a t o m i c mass
unit
12
13 A =1.0; // Atomic Mass o f Hydrogen atom i n a t o m i c mass
unit
14
15 Me = u *( m - A ) ; // Mass e x c e s s o f Hydrogen
16
17 printf ( ” The mass e x c e s s o f Hydrogen = %. 2 f MeV” , Me ) ;
1
2 //To c a l c u l a t e t h e A c t i v i t y o f Copper
3 // Example 4 6 . 4
4
110
5 clear ;
6
7 clc ;
8
9 Na =6*10^23; // Avagadro ’ s Number
10
11 m =1*10^ -6; // Mass o f t h e Copper Sample i n grams
12
13 M =63.5; // Atomic Weight o f Copper
14
15 N = Na * m / M ; // Number o f Atoms i n i microgram o f Copper
16
17 l =1.516*10^ -5; // Decay C o n s t a n t f o r Copper
18
19 Act = l * N ; // A c t i v i t y o f t h e Copper Sample i n
disintegrations /s
20
21 printf ( ” A c t i v i t y o f 1 microgram o f Copper Sample = %
. 3 f Ci ” , Act /(3.7*10^10) ) ; // 1 Ci = 3 . 7 ∗ 1 0 ˆ 1 0
disintegrations /s
Scilab code Exa 46.5 To Calculate the fraction of Orignal Activity remaining after
1
2 //To C a l c u l a t e t h e f r a c t i o n o f O r i g n a l A c t i v i t y
r e m a i n i n g a f t e r 40 h o u r s
3 // Example 4 6 . 5
4
5 clear ;
6
7 clc ;
8
9 t =40; // D u r a t i o n o f R a d i o a c t i v e Decay i n h o u r s
111
10
11 thalf =20; // H a l f L i f e o f R a d i o a c t i v e N u c l i d e i n h o u r s
12
13 Ar =1/2^( t / thalf ) ; // F r a c t i o n o f O r i g n a l A c t i v i t y
r e m a i n i n g a f t e r 40 h o u r s
14
15 printf ( ” F r a c t i o n o f O r i g n a l A c t i v i t y r e m a i n i n g a f t e r
40 h o u r s = %. 2 f ” , Ar ) ;
Scilab code Exa 46.6 To calculate the energy released when a Nucleus breaks
1
2 //To c a l c u l a t e t h e e n e r g y r e l e a s e d i n t h e p r o c e s s
when a N u c l e u s b r e a k s
3
4 // Example 4 6 . 6
5
6 clear ;
7
8 clc ;
9
10 A =240; // Mass Number f o r F i r s t N u c l e u s
11
12 Be1 =7.6; // B i n d i n g Energy i n MeV p e r n u c l e o n for A
=120
13
14 Be2 =8.5; // B i n d i n g Energy i n MeV p e r n u c l e o n for A
=240
15
16 E = A *( Be2 - Be1 ) ; // / Energy r e l e a s e d when a n u c l e u s o f A
=240 b r e a k s i n t o two n u c l e i o f n e a r l e e q u a l mass
112
numbers
17
18 printf ( ” Energy r e l e a s e d when a n u c l e u s o f A=240
b r e a k s i n t o two n u c l e i o f n e a r l y e q u a l mass
numbers = %. 0 f MeV” ,E ) ;
Scilab code Exa 46.7 To Calculate the Temperature of Deutrons for a specific Avera
1
2 //To C a l c u l a t e t h e T e m p e r a t u r e o f D e u t r o n s f o r a
s p e c i f i c A v e r a g e K i n e t i c Energy
3 // Example 4 6 . 7
4
5 clear ;
6
7 clc ;
8
9 e =1.6*10^ -19; // Charge on an e l e c t r o n i n Coloumbs
10
11 E =9*10^9; // V a l u e o f C o n s t a n t ( 1 / ( 4 ∗ %pi ∗ e 0 ) ) i n N−m
ˆ2/Cˆ2
12
13 d =2*10^ -15; // C l o s e s t S e p e r a t i o n between 2 d e u t r o n s
in metres
14
15 K = e ^2* E /(2* d ) ; // I n i t i a l K i n e t i c Energy o f e a c h
deuteron
16
17 printf ( ” K i n e t i c Energy o f e a c h d e u t e r o n s o t h a t t h e
c l o s e s t s e p r a t i o n s b e t w e e n them becomes 2 fm = %
. 1 f ∗10ˆ −14 J ” ,K *10^14) ;
18
19 k =1.38*10^ -23; // Boltzmann C o n s t a n t
20
21 T = K /( k *1.5) ; // T e m p e r a t u r e n e e d e d f o r t h e d e u t r o n s t o
113
have t h e A v e r a g e K i n e t i c Energy
22
23 printf ( ” \n T e m p e r a t u r e n e e d e d f o r t h e d e u t r o n s t o
have t h e A v e r a g e K i n e t i c Energy = %. 1 f ∗ 1 0 ˆ 9 K” ,T
*10^ -9) ;
114
Chapter 47
Scilab code Exa 47.1 To Calculate the time for which the Person slept according to
1
2 //To C a l c u l a t e t h e t i m e f o r which t h e P e r s o n s l e p t
according to c l o c k s
3
4 // Example 4 7 . 1
5
6 clear ;
7
8 clc ;
9
10 delt =6; // D u r a t i o n o f S l e e p a c c o r d i n g t o p e r s o n ’ s
watch
11
12 v =3*10^7; // Speed o f t h e t r a i n ( i n which t h e p e r s o n is
s i t t i n g ) i n m/ s
13
14 c =3*10^8; // Speed o f l i g h t i n m/ s
15
16 delt1 = delt / sqrt (1 -( v / c ) ^2) ; // D u r a t i o n o f sleep in
115
the ground frame
17
18 delt1h = int ( delt / sqrt (1 -( v / c ) ^2) ) ; // D u r a t i o n o f s l e e p
( i n w h o l e number o f h o u r s ) i n t h e g r o u n d f r a m e
19
20 printf ( ” D u r a t i o n o f s l e e p a c c o r d i n g t o t h e c l o c k s =
%. 0 f h o u r s ” , delt1h ) ;
21
22 delt1m =( delt1 - delt1h ) *60; // D u r a t i o n o f s l e e p ( i n
re ma in ing ) i n the ground frame
23
24 printf ( ”%. 1 f m i n u t e s ” , delt1m ) ;
Scilab code Exa 47.2 To Calculate the height of Passenger in the Ground Frame
1
2 //To C a l c u l a t e t h e h e i g h t o f P a s s e n g e r i n t h e Ground
Frame
3
4 // Example 4 7 . 2
5
6 clear ;
7
8 clc ;
9
10 L =6; // H e i g h t o f P a s s e n g e r i n t h e t r a i n f r a m e
11
12 v =3*10^7; // Speed o f t h e t r a i n ( i n which t h e p e r s o n is
s i t t i n g ) i n m/ s
13
14 c =3*10^8; // Speed o f l i g h t i n m/ s
15
16 L1 = L * sqrt (1 -( v / c ) ^2) ; // H e i g h t o f P a s s e n g e r i n t h e
116
Ground Frame
17
18 L1f = int ( L1 ) ; // H e i g h t o f P a s s e n g e r ( i n w h o l e number
o f f e e t s ) i n t h e Ground Frame
19
20 printf ( ” H e i g h t o f t h e p a s s e n g e r i n t h e Ground Frame
= %. 0 f f e e t ” , L1f ) ;
21
22 L1i =( L1 - L1f ) *12; // H e i g h t o f P a s s e n g e r ( i n r e m a i n i n g
i n c h e s ) i n t h e Ground Frame
23
24 printf ( ”%. 1 f i n c h e s ” , L1i ) ;
Scilab code Exa 47.3 To Calculate the Time Elapsed between Door Openings
1
2 //To C a l c u l a t e t h e Time E l a p s e d b e t w e e n Door
Openings
3
4 // Example 4 7 . 3
5
6 clear ;
7
8 clc ;
9
10 c =3*10^8; // Speed o f L i g h t i n m/ s
11
12 v =0.8* c ; // Speed o f T r a i n T1 i n m/ s
13
14 y =1/ sqrt (1 -( v / c ) ^2) ; // Speed o f Box i n t h e f r a m e o f
T1 i n m/ s
15
16 rl =30* c ; // R e s t Length o f t h e box i n m e t r e s
117
17
18 t =( rl * v * y ) /( c ^2) ; // Time e l a p s e d b e t w e e n t h e o p e n i n g s
o f t h e Door i n s e c o n d s
19
20 printf ( ” Time e l a p s e d b e t w e e n t h e o p e n i n g s o f t h e
Door = %. 0 f s ” ,t ) ;
Scilab code Exa 47.5 To Calculate the amount of Electrical Energy obtained in kilo
1
2 //To C a l c u l a t e t h e amount o f E l e c t r i c a l Energy
o b t a i n e d i n k i l o w a t t −h o u r
3
4 // Example 4 7 . 5
5
6 clear ;
7
8 clc ;
9
10 c =3*10^8; // Speed o f l i g h t i n m/ s
11
12 m =3.6*10^ -3; // Mass o f t h e o b j e c t i n k i l o g r a m s
13
14 E = m * c ^2/(3.6*10^6) ; // Amount o f E l e c t r i c a l Energy
o b t a i n e d i n kWh
15
16 printf ( ” E l e c t r i c a l Energy o b t a i n e d when a mass o f
3 . 6 g i s f u l l y c o n v e r t e d i n t o e n e r g y = %. 0 f ∗ 1 0 ˆ 7
kWh” ,E *10^ -7) ;
118