Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Applied Physics by M Kumar

Download as pdf or txt
Download as pdf or txt
You are on page 1of 43

Scilab Textbook Companion for A Comprehensive Textbook Of Applied Physics by M.

Kumar1
Created by Ashana Yamunashankar Shukla Electrical Electrical Engineering Sardar Patel College of Engineering College Teacher Cross-Checked by Lavitha Pereira December 2, 2013

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

1 Funded

Book Description
Title: A Comprehensive Textbook Of Applied Physics Author: M. Kumar Publisher: Abhishek Publication, Chandigarh Edition: 1 Year: 2009 ISBN: 978-81-8247-226-6

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.

Contents
List of Scilab Codes 1 Waves and Vibrations 2 Application of Sound Waves 3 Principles of Optics 4 Electrostatics 5 Electricity 4 7 12 17 23 33

List of Scilab Codes


Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 1. 2. 3. 4. 5. 6. 7. 8. 9. 10 11 12 1. 2. 3. 4. 5. 6. 7. 8. 1. 2. 3. 4. 5. 6. 7. 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7 7 8 8 8 9 9 9 10 10 11 12 12 13 13 14 14 15 15 17 17 18 18 18 19 19 19

Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa

3.9 3.10 3.11 3.12 3.13 3.14 3.15 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 4.12 4.13 4.14 4.15 4.16 4.17 4.18 4.19 4.20 4.21 4.22 4.23 4.24 4.25 4.26 4.27 5.1 5.2 5.3 5.4

9. 10 11 12 13 14 15 1. 2. 3. 4. 5. 6. 7. 8. 9. 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1. 2. 3. 4.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

20 20 20 21 21 22 22 23 23 23 24 24 24 25 25 25 26 26 27 27 27 28 28 28 29 29 29 30 30 30 31 31 32 32 33 33 34 34

Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa

5.5 5.6 5.7 5.8 5.9 5.10 5.11 5.12 5.13 5.14 5.15 5.16 5.17 5.18 5.19 5.20 5.21 5.22 5.23 5.24

5. 6. 7. 8. 9. 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . .

34 35 35 35 36 36 36 37 37 38 38 39 39 40 40 41 41 41 42 42

Chapter 1 Waves and Vibrations

Scilab code Exa 1.1 1


1 2 3 4 5

clc ; n =512; // f r e q u e n c y i n Hz l =67; // w a v e l e n g t h i n cm v=n*l; // c a l c u l a t i n g v e l o c i t y disp (v , V e l o c i t y i n cm/ s e c = ) ; result

// d i s p l a y i n g

Scilab code Exa 1.2 2


1 2 3 4 5

clc ; v =340; // v e l o c i t y i n m/ s e c l =0.68; // w a v e l e n g t h i n m n=v/l; // c a l c u l a t i n g f r e q u e n c y disp (n , F r e q u e n c y i n Hz = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 1.3 3 7

1 2 3 4 5

clc ; v =3*10^8; // v e l o c i t y i n m/ s e c n =500*10^3; // f r e q u e n c y i n Hz l=v/n; // c a l c u l a t i n g w a v e l e n g t h disp (l , Wavelength i n m = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 1.4 4


1 2 3 4 5

clc ; v =330; // v e l o c i t y i n m/ s e c n =560; // f r e q u e n c y i n Hz l=v/n; // c a l c u l a t i n g w a v e l e n g t h disp ( l *30 , D i s t a n c e t r a v e l l e d i n 30 v i b r a t i o n s i n m = ); // d i s p l a y i n g r e s u l t

Scilab code Exa 1.5 5 clc ; s =90; // d i s t a n c e i n m u =0; // i n i t i a l v e l o c i t y i n m/ s e c t = sqrt (90/4.9) ; // c a l c u l a t i n g t i m e u s i n g kinematical equation 5 t1 =4.56 - t ; // c a l c u l a t i n g t i m e t a k e n by sound t o travel 6 v = s / t1 ; // c a l c u l a t i n g v e l o c i t y 7 disp (v , V e l o c i t y i n m/ s e c = ) ; // d i s p l a y i n g r e s u l t
1 2 3 4

Scilab code Exa 1.6 6


1 clc ;

2 3 4 5 6 7

l1 =1.5; // w a v e l e n g t h i n m l2 =2; // w a v e l e n g t h i n m v1 =120; // v e l o c i t y i n m/ s e c n = v1 / l1 ; // c a l c u l a t i n g f r e q u e n c y v2 = n * l2 ; // c a l c u l a t i n g v e l o c i t y disp ( v2 , V e l o c i t y i n m/ s e c = ) ; // d i s p l a y i n g result

Scilab code Exa 1.7 7


1 2 3 4 5 6

clc ; l =5641*10^ -10; // w a v e l e n g t h i n m c =3*10^8; // v e l o c i t y i n m/ s e c n=c/l; // c a l c u l a t i n g f r e q u e n c y u =1.58; // r e f r a c t i v e i n d e x o f g l a s s cg = c / u ; // c a l c u l a t i n g v e l o c i t y o f l i g h t i n glass 7 l1 = cg / n ; // c a l c u l a t i n g w a v e l e g t h i n g l a s s 8 disp ( l1 *10^10 , Wavelength i n g l a s s i n Angstrom = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 1.8 8


1 2 3 4 5

clc ; n =12*10^6; // f r e q u e n c y i n Hz v =3*10^8; // v e l o c i t y i n m/ s e c l=v/n; // c a l c u l a t i n g w a v e l e n g t h disp (l , Wavelength i n m = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 1.9 9 9

1 2 3 4 5

clc ; n =400; // f r e q u e n c y i n Hz v =300; // v e l o c i t y i n m/ s e c l=v/n; // c a l c u l a t i n g w a v e l e n g t h disp (l , Wavelength i n m = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 1.10 10


1 2 3 4 5

clc ; a =20; // a m p l i t u d e i n cm n =6; // f r e q u e n c y p e r s e c o n d w =2*( %pi ) * n ; // omega i n r a d i a n s / s e c disp (w , Omega i n r a d i a n s / s e c = ) ; // d i s p l a y i n g result

Scilab code Exa 1.11 11


1 2 3 4 5 6 7 8 9

clc ; a =6; // a m p l i t u d e i n cm n =9; // f r e q u e n c y i n Hz . vmax =2*( %pi ) * n *6; // c a l c u l a t i n g v e l o c i t y i n cm/ s e c acc = -((18*( %pi ) ) ^2) *6; // c a l c u l a t i n g a c c . i n m/ s e c square disp ( vmax , Maximum v e l o c i t y i n cm/ s e c = ) ; // displaying result disp ( V e l o c i t y a t e x t r e m e p o s i t i o n = 0 ) ; // displaying result disp ( A c c e l a r a t i o n a t mean p o s i t i o n = 0 ) ; // displaying result disp ( acc , A c c e l a r a t i o n a t e x t r e m e p o s i t i o n i n m/ s e c s q u a r e = ) ; // d i s p l a y i n g r e s u l t

10

Scilab code Exa 1.12 12 clc ; g =9.8; // g r a v i t a t i o n a l c o n s t a n t m =50; // mass i n kg l =0.2; // l e n g t h i n m T =0.6; // t i m e p e r i o d k =( m * g ) / l ; // c a l c u l a t i n g c o n s t a n t m =2450*(( T /(2*( %pi ) ) ) ^2) ; // c a l c u a l t i n g mass u s i n g given time p e r i o d 8 disp (m , Mass o f body i n kg = ) ; // d i s p l a y i n g result
1 2 3 4 5 6 7

11

Chapter 2 Application of Sound Waves

Scilab code Exa 2.1 1


1 clc ; 2 disp ( Example 2 . 1 ) ; 3 v =3000; // volume i n m e t r e c u b e . 4 theta =0.2; // t h e t a i n owu ( open window u n i t )

.
5 s =1850; 6 as = theta * s ;

// a r e a i n m e t r e c u b e . // c a l c u l a t i n g t o t a l a b s o r b t i o n o f

surface . 7 T =(0.165* v ) / as // c a l c u l a t i n g T u s i n g S a b i n e f o r m u l a 8 disp (T , R e v e r b e r a t i o n t i m e o f Room = ) ; // Displaying Result .

Scilab code Exa 2.2 2


1 clc ; 2 disp ( Example 2 . 2 ) ; 3 v =120000;

// volume i n

metre cube . 12

4 t =1.5;

// t i m e i n s e c o n d // a r e a i n m e t r e // u s i n g S a b i n e //

.
5 s =25000;

cube .
6 a =(0.16* v ) /( t * s ) ;

formula f o r c a l c u l a t i n g a 7 disp (a , A v e r a g e A b s o r b i n g Power o f S u r f a c e = ) ; Displaying Result .

Scilab code Exa 2.3 3


1 clc ; 2 disp ( Example 2 . 3 ) ; 3 v =6000 4 as =20

// Volume i n m e t r e c u b e . // s u r f a c e a b s o r b t i o n i n

owu ( open window u n i t ) . 5 T =(0.165* v ) /( as ) ; // c a l c u l a t i n g T u s i n g S a b i n e Formula . 6 disp (T , R e v e r b e r a t i o n Time = ) ; // D i s p l a y i n g Result .

Scilab code Exa 2.4 4


1 clc ; 2 disp ( Example2 . 4 ) ; 3 v =3500; 4 n1 =370 -300;

// volume i n m e t r e c u b e . // no . o f a u d i e n c e on wooden // no . o f empty wooden s e a t s . // a b s o r p t i o n due t o wooden // a b s o r p t i o n due t o

seats .
5 n2 =300 -70; 6 a1s1 =0.04*60;

doors . 7 a2s2 =0.03*700; plastered walls .

13

8 9 10 11 12 13 14

a3s3 =0.06*50; // a b s o r p t i o n due t o g l a s s work . a4s4 =4.2*370; // a b s o r p t i o n due t o a u d i e n c e on spungy and wooden // s e a t s . a5s5 =2*230; // a b s o r p t i o n due t o empty seats . sum = a1s1 + a2s2 + a3s3 + a4s4 + a5s5 ; // t o t a l a b s o r p t i o n o f cinema h a l l . T =(0.165* v ) / sum ; // c a l c u l a t i n g T u s i n g S a b i n e Formula . disp (T , R e v e r b e r a t i o n Time = ) ; // D i s p l a y i n g Result .

Scilab code Exa 2.5 5


1 clc ; 2 disp ( Example 2 . 5 ) ; 3 l =10;

// l e n g t h i n // Young s Modulus i n

centimetres .
4 Y =20*10^11;

dyne /cm s q u a r e .
5 R =8; // D e n s i t y i n gram / c c 6 n =(1/(2* l ) ) * sqrt ( Y / R ) ; // c a l c u l a t i n g f r e q u e n c y o f 7 8

vibration using // young s modulus . disp (n , F r e q u e n c y o f v i b r a t i o n i n Hz . ) ; Displaying Result .

//

Scilab code Exa 2.6 6


1 clc ; 2 disp ( Example 2 . 7 ) ;

14

3 t =0.1; 4 Y =8.75*10^11;

// t h i c k n e s s i n c e n t i m e t r e . // Young s Modulus i n dyne /cm

square . 5 R =2.654; // D e n s i t y i n gram /cm s q u a r e . 6 n =(1/(2* t ) ) * sqrt ( Y / R ) ; // c a l c u l a t i n g f r e q u e n c y u s i n g Young s modulus . 7 disp (n , F r e q u e n c y o f V i b r a t i o n i n Hz = ) ; // Displaying Result .

Scilab code Exa 2.7 7


1 clc ; 2 disp ( Example 2 . 7 ) ; 3 K =2.026*10^9;

// Bulk Modulus i n N/m

square . 4 R =10^3; // D e n s i t y i n Kg/m c u b e . 5 V = sqrt ( K / R ) ; // C a l c u l a t i n g s p e e d u s i n g Bulk Modulus . 6 disp (V , V e l o c i t y o f sound waves i n w a t e r i n m/ s e c = ); // d i s p l a y i n g r e s u l t .

Scilab code Exa 2.8 8


1 clc ; 2 disp ( Example 2 . 8 ) ; 3 Y =1.41; // Young s Modulus . 4 R =1.293*10^ -3; // D e n s i t y o f a i r i n g / c e n t i m e t r e

cube .
5 P =76*13.6*980;

// a t m o s p h e r i c p r e s s u r e i n dyne /cm // c a l c u l a t i n g s p e e d u s i n g young

square .
6 V = sqrt (( Y * P ) / R ) ;

s modulus . 15

disp (V , Speed o f u l t r a s o n i c wave i n a i r a t n . t . p . i n cm/ s e c = ) ; // d i s p l a y i n g r e s u l t . 8 disp ( V *10^ -2 , Speed i n m/ s e c ) ; // d i s p l a y i n g r e s u l t .


7

16

Chapter 3 Principles of Optics

Scilab code Exa 3.1 1


1 2 3 4 5

clc ; f =15; // f o c a l l e n g t h i n cm v =10; // image d i s t a n c e i n cm u =(150/5) ; // c a l c u l a t i n g u u s i n g ( 1 / f ) =(1/ v ) (1/u ) disp (u , O b j e c t D i s t a n c e i n cm = ) ; // d i s p l a y i n g result

Scilab code Exa 3.2 2


1 2 3 4 5 6 7 8

clc ; f =80; // f o c a l l e n g t h i n cm f1 =20; // f o c a l l e n g t h o f f i r s t l e n s i n cm f2 =(80/3) ; // u s i n g ( 1 / F ) =(1/ f 1 ) +(1/ f 2 ) P =(100/ f ) ; // power i n D P1 =100/20; // power o f f i r s t l e n s P2 = P1 - P ; // power i n D disp ( P2 , Power i n D = ) ; // d i s p l a y i n g r e s u l t

17

Scilab code Exa 3.3 3


1 clc ; 2 P =2.5; // Power i n D 3 f = -(1/ P ) ; // c a l c u l a t i n g f i n m 4 disp (f , F o c a l l e n g t h i n m = ) ;

// d i s p l a y i n g r e s u l t

Scilab code Exa 3.4 4 clc ; m =4; // m a g n i g i c a t i o n f =20; // f o c a l l e n g t h i n cm u =(20*3) /(4) ; // on s i m p l i f y i n g ( 1 / f ) =(1/ v ) (1/u ) v =(4* u ) ; // c a l c u l a t i n g v i n cm disp (u , O b j e c t d i s t a n c e i n cm = ) ; // d i s p l a y i n g result 7 disp (v , Image d i s t a n c e i n cm = ) ; // d i s p l a y i n g result
1 2 3 4 5 6

Scilab code Exa 3.5 5


1 2 3 4 5 6

clc ; u =14; // o b j e c t d i s t a n c e i n cm f = -21; // f o c a l d i s t a n c e i n cm v =( -5/42) ; // s i m p l i f y i n g ( 1 / f ) =(1/ v ) (1/u ) I =(3* -8.4) /( -14) ; // u s i n g m= ( 1 / 0 ) =(v /u ) ; disp (v , Image d i s t a n c e i n cm = ) ; // d i s p l a y i n g result 7 disp (I , I i n cm = ) ; // d i s p l a y i n g r e s u l t 18

Scilab code Exa 3.6 6


1 2 3 4 5

clc ; fe =5; // f o c a l l e n g t h i n cm D =25; // d i s t a n c e od d i s t i n c t v i s i o n i n cm m =1+( D / fe ) ; // c a l c u l a t i n g m a g n i f y i n g power disp (m , m a g n i f y i n g Power = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 3.7 7


1 2 3 4

clc ; fe =5; // f o c a l l e n g t h i n cm D =25; // d i s t a n c e od d i s t i n c t v i s i o n i n cm mo =30/(1+( D / fe ) ) ; // c a l c u l a t i n g m a g n i f i c a t i o n o f objective lens 5 disp ( mo , M a g n i f i c a t i o n p r o d u c e d by o b j e c t i v e l e n s = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 3.8 8


1 2 3 4 5 6 7 8

clc ; u = -6; // o b j e c t d i s t a n c e i n cm fo =4; // f o c a l d i s t a n c e i n cm fe =6; // f o c a l l e n g t h i n cm D =25; // d i s t a n c e o f d i s t i n c t v i s i o n i n cm v =(12) ; // u s i n g ( 1 / f ) =(1/ v ) (1/u ) m =( v / u ) *(1+( D / fe ) ) ; // c a l c u l a t i n g m disp (v , Image d i s t a n c e i n cm = ) ; // d i s p l a y i n g result 19

disp ( -m , M a g n i f y i n g Power = ) ; result

// d i s p l a y i n g

Scilab code Exa 3.9 9 clc ; D =25; // d i s t a n c e o f d i s t i n c t v i s i o n u = -9; // o b j e c t d i s t a n c e i n cm fe =10; // f o c a l l e n g t h i n cm v =( -90/1) ; // u s i n g ( 1 / f ) =(1/ v ) (1/u ) m =( v / u ) ; // c a l c u l a t i n g m M=D/u; // c a l c u l a t i n g M a g n i f y i n g power o f l e n s disp (m , M a g n i f i c a t i o n o f l e n s = ) ; // d i s p l a y i n g result 9 disp ( -M , M a g n i f y i n g Power = ) ; // d i s p l a y i n g result
1 2 3 4 5 6 7 8

Scilab code Exa 3.10 10


1 2 3 4 5 6 7

clc ; fo =0.5; // f o c a l l e n g t h o f e y e l e n s D =25; // d i s t a n c e o f d i s t i n c t v i s i o n L =15; // l e n g t h i n cm m =375; // m a g n i f i c a t i o n fe =( - L * D ) /( fo *(( L / fo ) -m ) ) ; // c a l c u l a t i n g f e disp ( fe , F o c a l l e n g t h o f e y e l e n s i n cm = ) ; displaying result

//

Scilab code Exa 3.11 11

20

1 2 3 4 5 6

clc ; m =5; // m a g n i f y i n g power L =24; // l e n g t h i n cm fe =4; // f o c a l l e n g t h i n cm fo =5* fe ; // c a l c u l a t i n g f o disp ( fo , F o c a l l e n g t h o f l e n s i n cm = ) ; displaying result

//

Scilab code Exa 3.12 12 clc ; D =25; // d i s t a n c e o f d i s t i n c t v i s i o n i n cm fo =140; // f o c a l l e n g t h o f e y e l e n s fe =5; // f o c a l l e n g t h i n cm m = -( fo / fe ) ; // c a l c u l a t i n g m a g n i f y i n g power disp (m , M a g n i f y i n g power a t n o r m a l a d j u s t m e n t = ) ; // d i s p l a y i n g r e s u l t 7 m1 = -( fo / fe ) *(1+( fe / D ) ) ; // c a l c u l a t i n g m a g n i f y i n g power 8 disp ( m1 , M a g n i f y i n g power a t l e a s t d i s t a n c e o f d i s t i n c t v i s i o n = ) ; // d i s p l a y i n g r e s u l t
1 2 3 4 5 6

Scilab code Exa 3.13 13


1 2 3 4 5

clc ; M =5; // M a g n i f y i n g power fo =10; // f o c a l l e n g t h o f e y e l e n s fe = fo / M ; // c a l c u l a t i n g f e disp ( fe , F o c a l l e n g t h o f e y e l e n s i n cm = ) ; displaying result

//

21

Scilab code Exa 3.14 14


1 2 3 4 5 6

clc ; fo =75; // f o c a l l e n g t h o f e y e l e n s D =25; // d i s t a n c e o f d i s t i n c t v i s i o n fe =5; // f o c a l o f e y e l e n s i n cm M = -( fo / fe ) *(1+( fe / D ) ) ; // c a l c u l a t i n g M disp (M , M a g n i f y i n g power = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 3.15 15


1 2 3 4 5 6

clc ; M =7; // m a g n i f y i n g power L =40; // l e n g t h fe =(40/8) ; // f o c a l l e n g t h o f e y e l e n s i n cm fo =(7* fe ) ; // c a l c u l a t i n g f o c a l l e n g t h disp ( fo , F o c a l Length o f l e n s i n cm = ) ; // displaying result

22

Chapter 4 Electrostatics

Scilab code Exa 4.1 1


1 2 3 4 5

clc ; q =1; // no o f coulomb e =1.6*10^ -19; // c h a r g e on an e l e c t r o n n =( q / e ) ; // c a l c u l a t i n g no o f e l e c t r o n s disp (n , No o f e l e c t r o n s = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 4.2 2


1 clc ; 2 F =4.5*9.8; // i n Newton 3 q = sqrt (((0.03^2) *4.5*9.8) /(9*10^9) ) ;

// c a l c u l a t i n g q u s i n g F = ( 1 / 4 3 . 1 4 e o ) ( ( q1 q2 ) / ( r 2 ) ) 4 disp (q , Charge i n coulomb = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 4.3 3

23

1 2 3 4 5 6

clc ; q1 =2*10^ -7; // c h a r g e i n C q2 =3*10^ -7; // c h a r g e i n C r =30*10^ -2; // r i n m F =(9*10^9) *(( q1 * q2 ) / r ^2) ; // c a l c u l a t i n g F disp (F , F o r c e i n Newton = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 4.4 4


1 2 3 4 5 6

clc ; q1 =1; // c h a r g e i n C q2 =1; // c h a r g e i n C r =1; // r i n m F =(9*10^9) *(( q1 * q2 ) / r ^2) ; // c a l c u l a t i n g F disp (F , F o r c e i n Newton = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 4.5 5


1 2 3 4 5 6 7 8

clc ; m =9*10^ -31; // mass o f e l e c t r o n i n kg q = -3.2*10^ -7; // c h a r g e i n C e = -1.6*10^ -19; // c h a r g e on e l e c t r o n i n C n =( q / e ) ; // c a l c u l a t i n g n M=n*m; // c a l c u l a t i n g mass t r a n s f e r e d disp (n , no . o f e l e c t r o n s = ) ; // d i s p l a y i n g r e s u l t disp (M , Mass t r a n s f e r e d t o p o l y t h e n e i n kg = ) ; // displaying result

Scilab code Exa 4.6 6

24

1 2 3 4 5 6

clc ; q1 =1.6*10^ -19; // c h a r g e i n C q2 = -1.6*10^ -19; // c h a r g e i n C r =10^ -9; // r i n m F =(9*10^9) *(( q1 * q2 ) / r ^2) ; // c a l c u l a t i n g F disp (F , F o r c e i n Newton = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 4.7 7


1 2 3 4 5 6

clc ; Va = -10; // v o l t a g e i n v o l t s W =100; // work i n J o u l e q =2; // c h a r g e i n Coulomb v =( Va ) +( W / q ) ; // c a l c u l a t i n g v disp (v , V o l t a g e i n V o l t s = ) ;

// d i s p l a y i n g r e s u l t

Scilab code Exa 4.8 8


1 2 3 4 5 6

clc ; eo =(8.854*10^ -12) ; // c o n s t a n t E =2; // m a g n i t u d e o f e l e c t r i c f i e l d i n N/C r =0.5; // r i n m q = E *4*( %pi ) *( eo ) *( r ^2) ; // c a l c u l a t i n g c h a r g e disp (q , Charge i n Coulomb = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 4.9 9


1 clc ; 2 e = -1.6*10^ -19; // c h a r g e on e l e c t r o n 3 q =20*10^ -6; // c h a r g e i n Coulomb

i n Coulomb

25

4 5 6 7 8 9 10

r1 =0.1; // r 1 i n m r2 =0.05; // r 2 i n m Va =9*10^9*( q / r1 ) ; // c a l c u l a t i n g v o l t a g e a t A Vb =9*10^9*( q / r2 ) ; // c a l c u l a t i n g v o l t a g e a t B V = Va - Vb ; // p o t e n t i a l d i f f e r e n c e W=V*e; // c a l c u l a t i n g work done i n j o u l e disp (W , Work done t o t a k e t h e e l e c t r o n from A t o B i n J o u l e = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 4.10 10


1 2 3 4 5 6 7

clc ; q1 =(2*10^ -8) ; // c h a r g e i n coulomb q2 =( -2*10^ -8) ; // c h a r g e i n coulomb q3 =(3*10^ -8) ; // c h a r g e i n coulomb q4 =(6*10^ -8) ; // c h a r g e i n coulomb s =1; // s i d e i n m V =(9*10^9) *(1/ s ) *( q1 + q2 + q3 + q4 ) ; // c a l c u l a t i n g voltage 8 disp (V , V o l t a g e i n V o l t s = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 4.11 11


1 2 3 4 5 6

clc ; eo =8.85*10^ -12; // c o n s t a n t q =2*10^ -6; // c h a r g e i n coulomb l =9; // l e n g t h i n cm fi =( q / eo ) ; // c a l c u a l t i n g f l u x i n (N m s q u a r e ) / c disp ( fi , Flux t h r o u g h t h e s u r f a c e i n (N m s q u a r e ) / c = ) ; // d i s p l a y i n g r e s u l t

26

Scilab code Exa 4.12 12


1 2 3 4 5 6 7

clc ; eo =8.85*10^ -12; // c o n s t a n t r =1.2; // r i n m t =80*10^ -6; // s u r f a c e s h a r g e d e n s i t y i n c /m s q u a r e q = t *4*( %pi ) *( r ^2) ; // c a l c u l a t i n g c h a r g e fi = q / eo ; // c a l c u l a t i n g f l u x disp ( fi , Flux i n N m s q u a r e / c = ) ; // d i s p l a y i n g result

Scilab code Exa 4.13 13


1 2 3 4 5

clc ; eo =8.85*10^ -12; // c o n s t a n t E =9*10^4; // E l e c t r i c f i e l d i n N/C r =2*10^ -2; // r i n m L =2*( %pi ) * E * eo * r ; // c a l c u l a t i n g l i n e a r c h a r g e density 6 disp (L , L i n e a r c h a r g e d e n s i t y p e r cm = ) ; // displaying result

Scilab code Exa 4.14 14 clc ; o =17*10^ -22; // s u r f a c e c h a r g e d e n s i t y i n cm 2 eo =8.85*10^ -12; // c o n s t a n t E = o / eo ; // c a l c u l a t i n g e l e c t r i c i n t e n s i t y i n r e g i o n III 5 disp ( E l e c t r i c I n t e n s i t y i n r e g i o n s I and I I = 0 ) ; // d i s p l a y i n g r e s u l t 6 disp (E , E l e c t r i c I n t e n s i t y i n r e g i o n I I I i n N/C = ) ; // d i s p l a y i n g r e s u l t 27
1 2 3 4

Scilab code Exa 4.15 15


1 2 3 4 5 6 7 8 9

clc ; r =0.05; // i n m eo =8.85*10^ -12; // c o n s t a n t q =10^ -9; // c h a r g e a t p o i n t P i n Coulomb E = q /(4*( %pi ) * eo *( r ^2) ) ; // c a l c u l a t i n g e l e c t r i c field disp (E , E l e c t r i c f i e l d i n v /m = ) ; // d i s p l a y i n g result r1 =0.2; // i n m V1 = q /(4*( %pi ) * eo * r1 ) ; // c a l c u l a t i n g p o t e n t i a l difference disp ( V1 , 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 two p o i n t s i n V o l t = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 4.16 16


1 2 3 4 5 6 7 8

clc ; eo =8.85*10^ -12; // c o n s t a n t o =80*10^ -6; // s u r f a c e c h a r g e d e n s i t y i n c / s q u a r e r =1.2; // i n m q = o *( %pi ) *( r ^2) ; // c a l c u l a t i n g c h a r g e i n Coulomb fi = q / eo ; // c a l c u l a t i n g e l e c t r i c f l u x disp (q , Charge i n Coulomb = ) ; // d i s p l a y i n g r e s u l t disp ( fi , E l e c t r i c f l u x i n N m s q u a r e / c = ) ; // displaying result

Scilab code Exa 4.17 17 28

1 2 3 4 5

clc ; V =250; // p o t e n t i a l d i f f e r e n c e i n V o l t C =10^ -11; // c a p a c i t a n c e i n f a r a d q = C * V ; // c a l c u l a t i n g c h a r g e disp (q , Charge i n Coulomb = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 4.18 18


1 clc ; 2 r =6.4*10^6; // i n m 3 C = r /(9*10^9) ; // c a l c u l a t i n g c h a r g e 4 disp (C , C a p a c i t a n c e i n Farad = ) ; // d i s p l a y i n g

result

Scilab code Exa 4.19 19


1 2 3 4 5 6

clc ; C =2; // c a p a c i t a n c e i n Farad d =0.5*10^ -2; // d i s t a n c e i n m eo =8.85*10^ -12; // c o n s t a n t A =( C * d ) /( eo ) ; // c a l c u l a t i n g a r e a disp (A , Area i n m s q u a r e = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 4.20 20


1 2 3 4 5

clc ; A =0.02; // a r e a i n m s q u a r e r =0.5; // r i n m d =( A /(4*( %pi ) * r ) ) ; // c a l c u l a t i n g d i s t a n c e disp (d , D i s t a n c e b e t w e e n t h e p l a t e s i n m = ) ; displaying result 29

//

Scilab code Exa 4.21 21


1 2 3 4 5 6 7

clc ; eo =8.85*10^ -12; // c o n s t a n t A =1; // a r e a i n m s q u a r e d =2*10^ -3; // r i n m K =4; // c o n s t a n t C =( K * eo * A ) / d ; // c a l c u l a t i n g c a p a c i t a n c e disp (C , C a p a c i t a n c e i n Farad = = ) ; // d i s p l a y i n g result

Scilab code Exa 4.22 22


1 2 3 4 5

clc ; cm =10*10^ -6; // c a p a c i t a n c e i n Farad K =2; // c o n s t a n t co = cm / K ; // c a l c u l a t i n g c o disp ( co , c a p a c i t y o f c a p a c i t o r w i t h a i r b e t w e e n t h e p l a t e s i n Farad = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 4.23 23


1 2 3 4 5 6 7

clc ; v =100; // v i n v o l t c1 =8*10^ -6; // c a p a c i t a n c e i n Farad c2 =12*10^ -6; // c a p a c i t a n c e i n Farad c3 =24*10^ -6; // c a p a c i t a n c e i n Farad cs =4/(10^6) ; // c a l c u l a t i n g s e r i e s c a p a c i t a n c e cp =( c1 + c2 + c3 ) ; // c a l c u l a t i n g p a r a l l e l c a p a c i t a n c e 30

disp ( cs , E q u i v a l e n t S e r i e s c a p a c i t a n c e i n f a r a d = ) ; // d i s p l a y i n g r e s u l t 9 disp ( cp , E q u i v a l e n t p a r a l l e l c a p a c i t a n c e i n f a r a d = ) ; // d i s p l a y i n g r e s u l t 10 qs = cs * v ; // c a l c u l a t i n g c h a r g e 11 disp ( qs , c h a r g e on p l a t e i n Coulomb = ) ; // displaying result


8

Scilab code Exa 4.24 24


1 2 3 4 5

clc ; C =9*10^ -10; // c a p a c i t a n c e i n f a r a d V =100; // i n v o l t U =(1/2) *( C *( V ^2) ) ; // c a l c u l a t i n g e n e r g y s t o r e d disp (U , Energy s t o r e d i n J o u l e = ) ; // d i s p l a y i n g result

Scilab code Exa 4.25 25


1 2 3 4 5 6 7

clc ; eo =8.85*10^ -12; // c o n s t a n t A =90*10^ -4; // a r e a i n m s q u a r e d =2.5*10^ -3; // d i s t a n c e i n m V =400; // i n v o l t C =( eo * A ) / d ; // c a l c u l a t i n g c a p a c i t a n c e disp (C , C a p a c i t a n c e i n Farad = ) ; // d i s p l a y i n g result 8 W =(1/2) *( C *( V ^2) ) ; // c a l c u l a t i n g e l e c t r i c a l e n e r g y stored 9 disp (W , E l e c t r i c a l Energy s t o r e d i n c a p a c i t o r i n J o u l e = ) ; // d i s p l a y i n g r e s u l t

31

Scilab code Exa 4.26 26 clc ; v =100; // v i n v o l t c1 =1*10^ -6; // c a p a c i t a n c e i n Farad c2 =2*10^ -6; // c a p a c i t a n c e i n Farad c3 =3*10^ -6; // c a p a c i t a n c e i n Farad cs =6/11; // c a l c u l a t i n g s e r i e s c a p a c i t a n c e cp =( c1 + c2 + c3 ) ; // c a l c u l a t i n g p a r a l l e l c a p a c i t a n c e disp ( cs , E q u i v a l e n t S e r i e s c a p a c i t a n c e i n f a r a d = ) ; // d i s p l a y i n g r e s u l t 9 disp ( cp , E q u i v a l e n t p a r a l l e l c a p a c i t a n c e i n f a r a d = ) ; // d i s p l a y i n g r e s u l t 10 disp ( T h e r e f o r e Cp=(11 Cs ) ) ; // d i s p l a y i n g r e s u l t
1 2 3 4 5 6 7 8

Scilab code Exa 4.27 27


1 2 3 4 5 6 7 8

clc ; eo =8.85*10^ -12; // c o n s t a n t V =6; // v i n v o l t A =25*10^ -4; // a r e a i n m s q u a r e d =10^ -3; // d i s t a n c e i n m q =( eo * A * V ) / d ; // c a l c u l a t i n g c h a r g e W=q*V; // c a l c u l a t i n g work done disp (q , Charge t h r o u g h b a t t e r y i n Coulomb = ) ; displaying result 9 disp (W , Work done by B a t t e r y i n J o u l e = ) ; // displaying result

//

32

Chapter 5 Electricity

Scilab code Exa 5.1 1


1 2 3 4 5 6 7

clc ; n =10^6; // no . o f e l e c t r o n s e =1.6*10^ -19; // c h a r g e on an e l e c t r o n i n C q=n*e; // c a l c u l a t i n g t o t a l c h a r g e t =10^ -3; // t i m e i n s e c o n d I=q/t; // c a l c u l a t i n g c u r r e n t disp (I , C u r r e n t f l o w i n g i n Ampere = ) ; // displaying result

Scilab code Exa 5.2 2


1 2 3 4 5 6 7

clc ; I =300*10^ -3; // c u r r e n t n Ampere t =60; // t i m e i n s e c o n d e =1.6*10^ -19; // c h a t g e on e l e c t r o n i n C q = I * t ; // c a l c u l a t i n g c h a r g e n = q / e ; // c a l c u l a t i n g no o f e l e c t r o n s disp (n , No . o f e l e c t r o n s = ) ; // d i s p l a y i n g r e s u l t 33

Scilab code Exa 5.3 3


1 2 3 4 5 6 7 8 9

clc ; V =200; // v o l t a g e i n v o l t R =100; // r e s i s t a n c e i n Ohm e =1.6*10^ -19; // c h a r g e on an e l e c t r o n i n C I=V/R; //Ohm s law t =1; // t i m e i n s e c o n d q = I * t ; // c a l c u l a t i n g c h a r g e n = q / e ; // c a l c u l a t i n g no o f e l e c t r o n s disp (n , No . o f e l e c t r o n s = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 5.4 4


1 2 3 4 5 6

clc ; l =15; // l e n g t h i n m A =6*10^ -7; // a r e a i n m s q u a r e R =5; // r e s i s t a n c e i n Ohm p =( A * R ) / l ; // c a l c u l a t i n g r e s i s t i v i t y disp (p , R e s i s t i v i t y i n Ohm m e t r e = ) ; result

// d i s p l a y i n g

Scilab code Exa 5.5 5


1 2 3 4 5

clc ; l =0.1; // l e n g t h i n m A =10^ -4; // a r e a i n m s q u a r e R =0.01; // r e s i s t a n c e i n Ohm p =( A * R ) / l ; // c a l c u l a t i n g r e s i s t i v i t y 34

disp (p , R e s i s t i v i t y i n Ohm m e t r e = ) ; result

// d i s p l a y i n g

Scilab code Exa 5.6 6


1 2 3 4 5 6 7 8

clc ; L =1; // l e n g t h i n m r =0.2*10^ -3; // r a d i u s i n m A = %pi *( r ) ^2; // c a l c u l a t i n g a r e a disp ( A ) R =2; // r e s i s t a n c e i n Ohm P =( R * A ) / L ; // c a l c u l a t i n g r e s i s t i v i t y disp (P , R e s i s t i v i t y i n Ohm . m e t r e = ) ; displaying result

//

Scilab code Exa 5.7 7


1 clc ; 2 R1 =5; // r e s i s i t a n c e i n Ohm 3 R2 =9*5; // c a l c u l a t i n g u s i n g R2/A1=( l 2 /A2 ) ( A1/ l 1 ) 4 disp ( R2 , R e s i s i t a n c e i n Ohm = ) ; // d i s p l a y i n g

result

Scilab code Exa 5.8 8


1 clc ; 2 R1 =5; // r e s i s i t a n c e i n Ohm 3 R2 =4*5; // c a l c u l a t i n g u s i n g R2/A1=( l 2 /A2 ) ( A1/ l 1 ) 4 disp ( R2 , R e s i s i t a n c e i n Ohm = ) ; // d i s p l a y i n g

result 35

Scilab code Exa 5.9 9 clc ; R1 =2; // r e s i s i t a n c e i n Ohm R2 =4; // r e s i s t a n c e i n Ohm R3 =5; // r e s i s t a n c e i n Ohm R =( R1 ^ -1) +( R2 ^ -1) +( R3 ^ -1) ; // c a l c u l a t i n g p a r a l l e l resistance 6 Rp =(1/ R ) ; 7 disp ( Rp , R e s i s i t a n c e i n Ohm = ) ; // d i s p l a y i n g result
1 2 3 4 5

Scilab code Exa 5.10 10


1 clc ; 2 Rs =40; // r e s i s i t a n c e i n Ohm 3 disp ( R2=8 when R1=32 , R2=32 when R1=8 R e s i s i t a n c e

i n Ohm ) ; R1 ) +(1/R2 )

// d i s p l a y i n g r e s u l t u s i n g ( 1 / Rp ) =(1/

Scilab code Exa 5.11 11


1 2 3 4 5

clc ; V =2; // i n v o l t s R1 =30; // r e s i s i t a n c e i n Ohm R2 =60; // r e s i s t a n c e i n Ohm Rp =(30*60) /(30+60) ; // c a l c u l a t i n g p a r a l l e l resistance

36

disp ( Rp , R e s i s i t a n c e i n Ohm = ) ; // d i s p l a y i n g result 7 I = V / Rp ; //Ohm s law 8 disp (I , C u r r e n t i n Ampere = ) ; // d i s p l a y i n g r e s u l t


6

Scilab code Exa 5.12 12


1 2 3 4 5 6 7 8 9 10 11

clc ; R1 =2; // r e s i s i t a n c e i n Ohm R2 =3; // r e s i s t a n c e i n Ohm R3 =1; // r e s i s t a n c e i n Ohm Rp =( R1 * R2 ) /( R1 + R2 ) ; // c a l c u l a t i n g p a r a l l e l resistance R = Rp +1; // 1 Ohm i n s e r i e s disp (R , ( 1 ) E q u i v a l e n t R e s i s i t a n c e i n Ohm = ) ; // displaying result Rs =( R1 + R2 + R3 ) ; // s e r i e s r e s i s t a n c e s disp ( Rs , ( 2 ) A l l r e s i s t a n c e s i n s e r i e s i n Ohm = ) ; // d i s p l a y i n g r e s u l t Rp =(1/ R1 ) +(1/ R2 ) +(1/ R3 ) ; // c a l c u l a t i n g p a r a l l e l resistance disp ((1/ Rp ) , ( 3 ) A l l i n P a r a l l e l i n Ohm = ) ; // displaying result

Scilab code Exa 5.13 13


1 2 3 4 5 6

clc ; V =20; // v o l t a g e i n V o l t s R1 =2; // r e s i s i t a n c e i n Ohm R2 =4; // r e s i s t a n c e i n Ohm R3 =5; // r e s i s t a n c e i n Ohm Rp =(1/ R1 ) +(1/ R2 ) +(1/ R3 ) ; // c a l c u l a t i n g p a r a l l e l resistance 37

7 R =1/ Rp ; // P a r a l l e l 8 disp (R , ( a ) E q u i v a l e n t R e s i s i t a n c e 9 10 11 12 13 14 15 16

i n Ohm = ) ; // displaying result I1 = V / R1 ; // c a l c u l a t i n g c u r r e n t t h r o u g h R1 I2 = V / R2 ; // c a l c u l a t i n g c u r r e n t t h r o u g h R2 I3 = V / R3 ; // c a l c u l a t i n g c u r r e n t t h r o u g h R3 I=V/R; // c a l c u l a t i n g t o t a l c u r r e n t disp ( I1 , C u r r e n t t h r o u g h R1 i n Ampere = ) ; // displaying result disp ( I2 , C u r r e n t t h r o u g h R2 i n Ampere = ) ; // displaying result disp ( I3 , C u r r e n t t h r o u g h R3 i n Ampere = ) ; // displaying result disp (I , T o t a l c u r r e n t i n Ampere = ) ; // d i s p l a y i n g result

Scilab code Exa 5.14 14


1 clc ; 2 disp ( Rp = 6/ n ) ; // r e s i s t a n c e i n p a r a l l e l 3 disp ( R=7 ) ; // t o t a l r e s i s t a n c e 4 disp ( From 1 and 2 we g e t n=3 ) ; // d i s p l a y i n g

result

Scilab code Exa 5.15 15


1 2 3 4 5 6 7

clc ; R1 =2; // r e s i s t a n c e i n Ohm R2 =6; // r e s i s t a n c e i n Ohm R3 =3; // r e s i s t a n c e i n Ohm V =24; // v o l t a g e i n v o l t s R =8; // r e s i s t a n c e i n Ohm I = V / R ; //Ohm s Law 38

8 disp (I , C u r r e n t i n Ampere = ) ; // d i s p l a y i n g r e s u l t 9 V1 = I * R1 ; //Ohm s Law 10 disp ( V1 , V o l t a g e d r o p a c r o s s R1 i n V o l t s = ) ; //

displaying result
11 V2 = I * R2 ; //Ohm s Law 12 disp ( V2 , V o l t a g e d r o p a c r o s s R2 i n V o l t s = ) ;

//

displaying result
13 V3 = I * R3 ; //Ohm s Law 14 disp ( V3 , V o l t a g e d r o p a c r o s s R3 i n V o l t s = ) ;

//

displaying result

Scilab code Exa 5.16 16


1 2 3 4 5 6 7 8 9

clc ; R =15; // r e s i s t a n c e i n Ohm disp ( KVL : 16 I 1 +15 I 2 =6 ( 1 ) ) ; //KVL e q u a t i o n I1 = -1.66; // from ( 1 ) I2 =2.17; // from ( 1 ) disp ( I1 ) ; // c u r r e n t i n Ampere disp ( I2 ) V =( I1 + I2 ) * R ; // c a l c u l a t i n g p o t e n t i a l d i f f e r e n c e disp (V , P o t e n t i a l d i f f e r e n c e i n V o l t = ) ; // displaying result

Scilab code Exa 5.17 17


1 2 3 4 5 6 7

clc ; disp ( 3 I1 I2 1=0 ( 1 ) ); //KVL e q u a t i o n disp ( 3 I1 I 2 +2 I =2 ( 2 ) ) ; //KVL e q u a t i o n disp ( 3 I1 I 1 +2 I =2 ( 3 ) ) ; //KVL e q u a t i o n I1 =0.2352; // from ( 1 ) ( 2 ) ( 3 ) t h r o u g h AB I2 = -0.11764; // from ( 1 ) ( 2 ) ( 3 ) t h r o u g h BD I =0.58823; // from ( 1 ) ( 2 ) ( 3 ) t h r o u g h main c i r c u i t 39

Ig = -0.117647; // c u r r e n t i n Ampere Ibc = I1 - I2 ; // c a l c u l a t i n g c u r r e n t i n BC Iad =I - I1 ; // c a l c u l a t i n g c u r r e n t i n AD Idc =I - I1 - Ig ; // c a l c u l a t i n g c u r r e n t i n DC disp ( Ibc , C u r r e n t i n b r a n c h BC i n Ampere = ) ; displaying result 13 disp ( Iad , C u r r e n t i n b r a n c h AD i n Ampere = ) ; displaying result 14 disp ( Idc , C u r r e n t i n b r a n c h DC i n Ampere = ) ; displaying result
8 9 10 11 12

// // //

Scilab code Exa 5.18 18


1 2 3 4 5 6 7 8 9 10 11

clc ; P =10; //Ohm Q =3; //Ohm R =12; //Ohm S =6; //Ohm G =20; //Ohm disp ( 12 I +22 I 1+IgG=0 ( 1 ) ) ; //KVL disp ( 6 I 9 I 1 +29 I g =0 ( 2 ) ) ; //KVL disp ( 13 I1 3 I g =2 ( 3 ) ) ; //KVL Ig =7.797*10^ -3; // from ( 1 ) ( 2 ) ( 3 ) disp ( Ig , C u r r e n t t h r o u g h G a l v a n o m e t e r i n Ampere = ) ; // d i s p l a y i n g r e s u l t

Scilab code Exa 5.19 19


1 2 3 4 5

clc ; P =500; // power i n Watts V =200; // v o l t a g e i n V o l t s R =( V ^2) / P ; // u s i n g P=V2 R disp (R , R e s i s t a n c e i n Ohm = ) ; 40

// d i s p l a y i n g r e s u l t

6 7 8 9 10

V1 =160; // v o l t a g e i n V o l t s P1 =( V1 ^2) / R ; // c a l c u l a t i n g power Dp =500 - P1 ; // d r o p i n h e a t D =( Dp *100) /500; // p e r c e n t a g e d r o p disp (D , % Drop i n h e a t p r o d u c t i o n = ) ; displaying result

//

Scilab code Exa 5.20 20


1 2 3 4 5

clc ; P1 =100; // power i n Watts P2 =500; // power i n Watts P = P2 / P1 ; // r a t i o disp ( P>0 T h e r e f o r e I2 > I 1 ) ;

// d i s p l a y i n g r e s u l t

Scilab code Exa 5.21 21


1 2 3 4 5 6 7 8

clc ; t =1200; // t i m e i n s e c o n d P =100; // power i n Watts V =230; // v o l t a g e i n V o l t s R =( V ^2) / P ; // c a l c u l a t i n g r e s i s t a n c e V1 =115; // s u p p l y v o l t a g e i n V o l t s E =(( V1 ^2) * t ) / R ; // c a l c u l a t i n g e n e r g y disp (E , Energy d i s s i p a t e d by b u l b i n J o u l e = ) ; displaying result

//

Scilab code Exa 5.22 22


1 clc ;

41

2 3 4 5 6 7 8

P =10^4; // power i n Watts V =250; // v o l t a g e i n V o l t s R =0.2; // r e s i s t a n c e i n ohm Pl =(( P / V ) *( P / V ) ) * R ; // c a l c u l a t i n g power l o s s disp ( Pl ) E = P /( Pl + P ) ; // c a l c u l a t i n g e f f i c i e n c y disp ( E *100 , P e r c e n t E f f i c i e n c y = ) ; // d i s p l a y i n g result

Scilab code Exa 5.23 23


1 2 3 4 5 6 7

clc ; P =100; // power i n Watts V =220; // v o l t a g e i n V o l t s I = P / V ; // C u r r e n t i n Ampere R = V / I ; // r e s i s t a n c e disp (I , C u r r e n t i n Ampere = ) ; disp (R , R e s i s t a n c e i n Ohm = ) ;

// d i s p l a y i n g r e s u l t // d i s p l a y i n g r e s u l t

Scilab code Exa 5.24 24


1 2 3 4 5 6 7

clc ; V =50; // v o l t a g e i n V o l t s I =12; // C u r r e n t i n Ampere P = V * I ; // power Pd = P *0.7; // power d i s s i p a t e d R =(420/(12) ^2) ; disp (R , R e s i s t a n c e i n Ohm = ) ;

// d i s p l a y i n g r e s u l t

42

You might also like