diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /671/CH2 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '671/CH2')
38 files changed, 476 insertions, 0 deletions
diff --git a/671/CH2/EX2.1/2_1.sce b/671/CH2/EX2.1/2_1.sce new file mode 100755 index 000000000..03bbb4202 --- /dev/null +++ b/671/CH2/EX2.1/2_1.sce @@ -0,0 +1,20 @@ +function s=series(r1,r2)
+ s=r1+r2
+endfunction
+
+function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+r1=series(12,8)
+r2=parallel(20,r1)
+r3=series(r2,50)
+r4=parallel(30,r3)
+r5=series(10,r4)
+r6=series(r5,20)
+Req_ab=parallel(r5,40)
+disp(Req_ab)
+
+r7=40+20+10 //series
+Req_bc=parallel(r4,r7)
+disp(Req_bc)
\ No newline at end of file diff --git a/671/CH2/EX2.10/2_10.sce b/671/CH2/EX2.10/2_10.sce new file mode 100755 index 000000000..db054fd7e --- /dev/null +++ b/671/CH2/EX2.10/2_10.sce @@ -0,0 +1,9 @@ +//converting 9v voltage source to current source
+I=9/0.45
+I=I-7
+
+//KCLs
+A=[1/0.45+1/10,-1/10 ; 0.2-1/10,1/10-0.2]
+V=inv(A)*[-18;5]
+
+disp(V(2))
\ No newline at end of file diff --git a/671/CH2/EX2.11/2_11.sce b/671/CH2/EX2.11/2_11.sce new file mode 100755 index 000000000..d4937c918 --- /dev/null +++ b/671/CH2/EX2.11/2_11.sce @@ -0,0 +1,15 @@ +//converting voltage source to current source
+
+I=240/3
+
+//KCLs
+
+A=[1/3+1/6,-1/6;-1/6,1/6+1/12+1/30]
+V=inv(A)*[70;5]
+Vx=V(1)
+Vy=V(2)-60
+
+V6=V(2)-V(1)
+P6=V6*V6/6
+
+disp(P6)
\ No newline at end of file diff --git a/671/CH2/EX2.13/2_13.sce b/671/CH2/EX2.13/2_13.sce new file mode 100755 index 000000000..06335a3bf --- /dev/null +++ b/671/CH2/EX2.13/2_13.sce @@ -0,0 +1,6 @@ +// KVLs
+
+A=[24,-6,-8;-6,20,-5;-8,-5,25]
+I=inv(A)*[16;0;0]
+I5=I(2)-I(3)
+disp(I5)
\ No newline at end of file diff --git a/671/CH2/EX2.14/2_14.sce b/671/CH2/EX2.14/2_14.sce new file mode 100755 index 000000000..b946a5c08 --- /dev/null +++ b/671/CH2/EX2.14/2_14.sce @@ -0,0 +1,9 @@ +//convert practical current source to voltage source
+V=10*5
+
+//KVLs
+A=[35,-20;-20,50]
+I=inv(A)*[50;-100]
+
+v=20*(I(1)-I(2))
+disp(v)
\ No newline at end of file diff --git a/671/CH2/EX2.15/2_15.sce b/671/CH2/EX2.15/2_15.sce new file mode 100755 index 000000000..d822bf55c --- /dev/null +++ b/671/CH2/EX2.15/2_15.sce @@ -0,0 +1,8 @@ +i1=0.37 + +//KVL for loop 2 +i2=(-100+20*i1)/50 + +//KVL for loop 1 +R=(50+20*(i2-i1))/i1 +disp(R)
\ No newline at end of file diff --git a/671/CH2/EX2.16/2_16.sce b/671/CH2/EX2.16/2_16.sce new file mode 100755 index 000000000..71064d322 --- /dev/null +++ b/671/CH2/EX2.16/2_16.sce @@ -0,0 +1,7 @@ +//Converting current sources to voltage sources
+// O=[i1;i2;vx]
+
+A=[10,-3,4;-3,7,0;3,-3,-1]
+O=inv(A)*[16;-6;0]
+
+disp(O)
\ No newline at end of file diff --git a/671/CH2/EX2.17/2_17.sce b/671/CH2/EX2.17/2_17.sce new file mode 100755 index 000000000..fdb722ba3 --- /dev/null +++ b/671/CH2/EX2.17/2_17.sce @@ -0,0 +1,16 @@ +//convert current sources to voltage
+
+A=[95,-15;-15,135]
+I=inv(A)*[20;-70]
+
+i3=I(1)-I(2)
+
+I60=0.5-I(1)
+V60=I60*60
+P1= 0.5*V60 //O.5 A source
+
+I80=1+I(2)
+V80=I80*80
+P2=1*V80
+
+disp(P2,P1)
\ No newline at end of file diff --git a/671/CH2/EX2.18/2_18.sce b/671/CH2/EX2.18/2_18.sce new file mode 100755 index 000000000..fbd7b4653 --- /dev/null +++ b/671/CH2/EX2.18/2_18.sce @@ -0,0 +1,6 @@ +//Nodal Equations
+
+A=[0.6,-0.5;2,-1.6]
+V=inv(A)*[4;0]
+V12=V(1)-V(2)
+disp(V12)
\ No newline at end of file diff --git a/671/CH2/EX2.19/2_19.sce b/671/CH2/EX2.19/2_19.sce new file mode 100755 index 000000000..d57dd9fcc --- /dev/null +++ b/671/CH2/EX2.19/2_19.sce @@ -0,0 +1,7 @@ +//convert dependent current source to dependent voltage source
+
+//Mesh Equations
+A=[14,-2,0;-2,18,3;2,-2,-1]
+O=inv(A)*[100;0;0]
+
+disp(O(3))
\ No newline at end of file diff --git a/671/CH2/EX2.2/2_2.sce b/671/CH2/EX2.2/2_2.sce new file mode 100755 index 000000000..b2ba5f34a --- /dev/null +++ b/671/CH2/EX2.2/2_2.sce @@ -0,0 +1,2 @@ +I=(14-4)/(8+5+5+7) //KVL
+disp(I)
\ No newline at end of file diff --git a/671/CH2/EX2.20/2_20.sce b/671/CH2/EX2.20/2_20.sce new file mode 100755 index 000000000..9438d2d3c --- /dev/null +++ b/671/CH2/EX2.20/2_20.sce @@ -0,0 +1,19 @@ +///////////////////Part 1
+
+//Nodal Method
+v1=(8/5+16/10)/(1/5+1/2+1/10)
+disp(v1)
+i5=(8-v1)/5000
+disp(i5)
+
+
+//////////////////Part2
+
+//Mesh Method
+
+A=[7,-2;-2,12]
+I=inv(A)*[8;-16]/1000
+disp(I)
+
+v1=2*1000*(I(1)-I(2))
+disp(v1)
\ No newline at end of file diff --git a/671/CH2/EX2.21/2_21.sce b/671/CH2/EX2.21/2_21.sce new file mode 100755 index 000000000..6c85a0c25 --- /dev/null +++ b/671/CH2/EX2.21/2_21.sce @@ -0,0 +1,21 @@ +function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+//deactivate voltage source
+
+i11=4*6/8
+i21=4*2/8
+v11=i11*2
+v21=1*1
+
+//deactivate current source
+Req=parallel(2,7)
+
+v22=8*Req/(2+Req)
+v12=v22*(2/(2+5))
+
+v1=v11+v12
+v2=v21+v22
+
+disp(v2,v1)
\ No newline at end of file diff --git a/671/CH2/EX2.22/2_22.sce b/671/CH2/EX2.22/2_22.sce new file mode 100755 index 000000000..1137cf227 --- /dev/null +++ b/671/CH2/EX2.22/2_22.sce @@ -0,0 +1,13 @@ +function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+//Thevenin Equivalent
+I=(32-8)/30
+Voc=32-20*I
+Ro=parallel(20,10)
+disp(Ro,Voc)
+
+//Norton Equivalent
+Isc=32/20+8/10
+disp(Ro,Isc)
\ No newline at end of file diff --git a/671/CH2/EX2.23/2_23.sce b/671/CH2/EX2.23/2_23.sce new file mode 100755 index 000000000..53ac9dd82 --- /dev/null +++ b/671/CH2/EX2.23/2_23.sce @@ -0,0 +1,14 @@ +//convert current source to voltage source
+V=3.5*20
+
+//KVL
+I=100/(10+20+V)
+Voc=100-10*I
+
+//Finding Isc
+I=100/10
+Isc=(1+3.5)*I
+
+Ro=Voc/Isc
+
+disp(Ro,Voc)
\ No newline at end of file diff --git a/671/CH2/EX2.24/2_24.sce b/671/CH2/EX2.24/2_24.sce new file mode 100755 index 000000000..8fd5d8f86 --- /dev/null +++ b/671/CH2/EX2.24/2_24.sce @@ -0,0 +1,17 @@ +V=32 +I=1 +R1=20 +R2=8 +R3=2 +Voc1=V/(R1+R2+R3)*(R2+R3) ///a,b open +Isc1=V/R1 ///a,b short + +Voc2=I*R2/(R1+R2+R3)*R1 +Isc2=I*R2/(R2+R3) + +////by superposition +Voc=Voc1+Voc2 +Isc=Isc1+Isc2 + +disp(Voc) +disp(Isc) diff --git a/671/CH2/EX2.25/2_25.sce b/671/CH2/EX2.25/2_25.sce new file mode 100755 index 000000000..45a48b71c --- /dev/null +++ b/671/CH2/EX2.25/2_25.sce @@ -0,0 +1,16 @@ +function [Ra,Rb,Rc]=delta_to_star(Rab,Rbc,Rca)
+ X=Rab+Rbc+Rca
+ Ra=Rab*Rca/X
+ Rb=Rab*Rbc/X
+ Rc=Rca*Rbc/X
+endfunction
+
+function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+[R1,R2,R3]=delta_to_star(4,12,8)
+Req=10+4+parallel(R1+15,R2+16)
+
+I=12/Req
+disp(I)
\ No newline at end of file diff --git a/671/CH2/EX2.26/2_26.sce b/671/CH2/EX2.26/2_26.sce new file mode 100755 index 000000000..83bd9f74d --- /dev/null +++ b/671/CH2/EX2.26/2_26.sce @@ -0,0 +1,12 @@ +//convert current source to voltage source
+
+V1=4*2
+V2=2*2
+
+//Mesh Analysis
+
+A=[7,-3;-15,19]
+I=inv(A)*[6;-14]
+
+Vx=3*(I(1)-I(2))
+disp(Vx)
\ No newline at end of file diff --git a/671/CH2/EX2.27/2_27.sce b/671/CH2/EX2.27/2_27.sce new file mode 100755 index 000000000..d500dc577 --- /dev/null +++ b/671/CH2/EX2.27/2_27.sce @@ -0,0 +1,11 @@ +//Short Circuit AB and convert Curr Source to V source
+
+V=9*5
+Isc=(45-9)/6
+
+function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+Ro=parallel(5+1,3)
+disp(Ro,Isc)
\ No newline at end of file diff --git a/671/CH2/EX2.28/2_28.sce b/671/CH2/EX2.28/2_28.sce new file mode 100755 index 000000000..833b7b84a --- /dev/null +++ b/671/CH2/EX2.28/2_28.sce @@ -0,0 +1,12 @@ +//Mesh Analysis
+
+A=[4,-2;998,24.5]
+I=inv(A)*[1/1000;0]
+
+disp(I)
+
+P1=I(2)^2*2.5*1000
+P2=1/1000*I(1)
+P3=-10^6*I(1)*I(2)
+P=[P1,P2,P3]
+disp(P)
\ No newline at end of file diff --git a/671/CH2/EX2.29/2_29.sce b/671/CH2/EX2.29/2_29.sce new file mode 100755 index 000000000..723a5725c --- /dev/null +++ b/671/CH2/EX2.29/2_29.sce @@ -0,0 +1,16 @@ +function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+//as seen from ab
+Vth1=30*60/(30+60)
+Rth1=parallel(30,60)
+
+//as seen from cd
+Vth2=80*40/(40+60)
+Rth2=parallel(40,60)
+
+Vnet=60+Vth1-Vth2
+Rnet=Rth1+Rth2
+
+disp(Rnet,Vnet)
\ No newline at end of file diff --git a/671/CH2/EX2.3/2_3.sce b/671/CH2/EX2.3/2_3.sce new file mode 100755 index 000000000..098843cd6 --- /dev/null +++ b/671/CH2/EX2.3/2_3.sce @@ -0,0 +1,21 @@ +r1=100
+v=3/4
+
+r2=r1*v/(1-v)
+
+
+function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+//////Part1
+R2_eq=parallel(r2,10000)
+k=R2_eq/(R2_eq+r1)
+change1=(3/4-k)/(3/4)*100
+disp(change1)
+//////Part2
+
+R2_eq=parallel(r2,1000)
+k=R2_eq/(R2_eq+r1)
+change2=(3/4-k)/(3/4)*100
+disp(change2)
\ No newline at end of file diff --git a/671/CH2/EX2.30/2_30.sce b/671/CH2/EX2.30/2_30.sce new file mode 100755 index 000000000..40580acc5 --- /dev/null +++ b/671/CH2/EX2.30/2_30.sce @@ -0,0 +1,14 @@ +function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+R=parallel(60,120)
+
+//Mesh Analysis
+
+A=[6,-4;-4,12]
+I=inv(A)*[2.4;-3.6]
+I3=I(1)-I(2)
+
+I60=I3*120/(120+60)
+disp(I60)
\ No newline at end of file diff --git a/671/CH2/EX2.31/2_31.sce b/671/CH2/EX2.31/2_31.sce new file mode 100755 index 000000000..23662836e --- /dev/null +++ b/671/CH2/EX2.31/2_31.sce @@ -0,0 +1,5 @@ +//Nodal Equation
+
+Vn=198/10.5
+I60=Vn/60
+disp(I60)
\ No newline at end of file diff --git a/671/CH2/EX2.32/2_32.sce b/671/CH2/EX2.32/2_32.sce new file mode 100755 index 000000000..ebb08ac82 --- /dev/null +++ b/671/CH2/EX2.32/2_32.sce @@ -0,0 +1,16 @@ +V8=2*8
+
+//KVL
+I1=(30-16)/10
+
+//KCL at left node
+I2=2-I1
+
+//KVL middle mesh
+I4=(10*I1-2*I2)/4
+Vx=4*I4
+
+//right node
+Ix=I4-I2
+
+disp(Vx)
\ No newline at end of file diff --git a/671/CH2/EX2.33/2_33.sce b/671/CH2/EX2.33/2_33.sce new file mode 100755 index 000000000..98182eeed --- /dev/null +++ b/671/CH2/EX2.33/2_33.sce @@ -0,0 +1,18 @@ +////////////////////////////////investigate the if then else construct
+
+
+
+I=5
+
+//KVL
+R=(-12.5+15)/I-0.02-0.035
+disp(R)
+
+P=poly([-25,12.5,0.035],"I","coeff")
+Z=roots(P)
+Ib=Z(2)
+disp(Ib)
+
+I=(13-12.5)/0.035
+R=(15-13)/I-0.02
+disp(R)
diff --git a/671/CH2/EX2.35/2_35.sce b/671/CH2/EX2.35/2_35.sce new file mode 100755 index 000000000..a09f6901e --- /dev/null +++ b/671/CH2/EX2.35/2_35.sce @@ -0,0 +1,10 @@ +R=12*12/4-25
+disp(R)
+
+I=sqrt(1.6/1000/10000)
+R=12/I-10000-15000
+disp(R)
+
+I=0
+V=12
+disp(V)
\ No newline at end of file diff --git a/671/CH2/EX2.36/2_36.sce b/671/CH2/EX2.36/2_36.sce new file mode 100755 index 000000000..fdc428548 --- /dev/null +++ b/671/CH2/EX2.36/2_36.sce @@ -0,0 +1,7 @@ +function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+Req=1+parallel(parallel(1,1),1)
+
+disp(Req)
\ No newline at end of file diff --git a/671/CH2/EX2.37/2_37.sce b/671/CH2/EX2.37/2_37.sce new file mode 100755 index 000000000..28544b071 --- /dev/null +++ b/671/CH2/EX2.37/2_37.sce @@ -0,0 +1,8 @@ +function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+R1=parallel(parallel(40,60),80+40)
+
+Req=20+parallel(10+R1,30)
+disp(Req)
\ No newline at end of file diff --git a/671/CH2/EX2.38/2_38.sce b/671/CH2/EX2.38/2_38.sce new file mode 100755 index 000000000..f12221376 --- /dev/null +++ b/671/CH2/EX2.38/2_38.sce @@ -0,0 +1,13 @@ +function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+R1=parallel(5,40)+15
+Req=parallel(R1,15)+10
+i=6/(1000*Req)
+
+ix=i*R1/(R1+15)
+disp(ix)
+
+P=i*i*10000 //////wrongly done in the book as ix*ix*10000
+disp(P)
\ No newline at end of file diff --git a/671/CH2/EX2.39/2_39.sce b/671/CH2/EX2.39/2_39.sce new file mode 100755 index 000000000..dfcf4a112 --- /dev/null +++ b/671/CH2/EX2.39/2_39.sce @@ -0,0 +1,12 @@ +function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+R1=parallel(1,3)
+
+//convert current source to voltage
+V=20/1000*2000
+I=(40-8)/(2+0.75)
+
+Pr=8*I
+disp(Pr)
\ No newline at end of file diff --git a/671/CH2/EX2.4/2_4.sce b/671/CH2/EX2.4/2_4.sce new file mode 100755 index 000000000..9217f5ab2 --- /dev/null +++ b/671/CH2/EX2.4/2_4.sce @@ -0,0 +1,15 @@ +function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+
+v=150
+
+Req=1000*parallel(parallel(10,5),4)
+i1=v/(2000+0.2*1000+Req)
+v1=i1*0.2*1000
+VReq=Req*i1
+i2=VReq/4000
+
+disp(v1)
+disp(i2)
diff --git a/671/CH2/EX2.40/2_40.sce b/671/CH2/EX2.40/2_40.sce new file mode 100755 index 000000000..babd7f068 --- /dev/null +++ b/671/CH2/EX2.40/2_40.sce @@ -0,0 +1,25 @@ +function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+I1=12/1000
+Ix=I1*30/(30+60)
+disp(Ix)
+
+I2=20/1000
+V2=I2*(10+5)
+R1=10+parallel(30,60)
+I1=V2/R1
+Ix=I1*30/(30+60)
+disp(Ix) //Wrongly printed in the book as 10
+
+Ix=6/1000
+I1=(30+60)/30*Ix
+V2=I1*R1
+I2=V2/15
+disp(I2)
+
+Is=45
+I1=45*(10+5)/(10+5+R1)
+Ix=I1*30/(30+60)
+disp(Ix) ///Answer is wrong in the book
\ No newline at end of file diff --git a/671/CH2/EX2.5/2_5.sce b/671/CH2/EX2.5/2_5.sce new file mode 100755 index 000000000..91c2413fc --- /dev/null +++ b/671/CH2/EX2.5/2_5.sce @@ -0,0 +1,15 @@ +function [Rab,Rbc,Rca]=star_to_delta(Ra,Rb,Rc)
+ X=Ra*Rb+Rb*Rc+Rc*Ra
+ Rab=X/Rc
+ Rbc=X/Ra
+ Rca=X/Rb
+endfunction
+
+function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+[Rx,Ry,Rz]=star_to_delta(8,4,2)
+
+Req_ad=parallel(parallel(4,Rx)+parallel(12,Rz),parallel(3,Ry))
+disp(Req_ad)
\ No newline at end of file diff --git a/671/CH2/EX2.6/2_6.sce b/671/CH2/EX2.6/2_6.sce new file mode 100755 index 000000000..8d28a3906 --- /dev/null +++ b/671/CH2/EX2.6/2_6.sce @@ -0,0 +1,8 @@ +//Converting Voltage source with series resistance to current source
+I=1/(1/4)
+
+//KCL at nodes 1,2,3 using conductances
+A=[11,-3,-4;-3,6,-2;-4,-2,11]
+V=inv(A)*[5;-7;6]
+
+disp(V)
\ No newline at end of file diff --git a/671/CH2/EX2.7/2_7.sce b/671/CH2/EX2.7/2_7.sce new file mode 100755 index 000000000..17ea12878 --- /dev/null +++ b/671/CH2/EX2.7/2_7.sce @@ -0,0 +1,12 @@ +function p=parallel(r1,r2)
+ p=r1*r2/(r1+r2)
+endfunction
+
+Req=parallel(15,30)
+
+//KCL at nodes 1 and 2
+A=[3,-1;-3,5]
+V=inv(A)*[80;-360]
+
+disp(V(1))
+
diff --git a/671/CH2/EX2.8/2_8.sce b/671/CH2/EX2.8/2_8.sce new file mode 100755 index 000000000..0a05d4239 --- /dev/null +++ b/671/CH2/EX2.8/2_8.sce @@ -0,0 +1,10 @@ +//Converting practical voltage source to current source
+I=12/6
+
+//KCLs
+A=[0.7,-0.5;-0.5,0.767]
+V=inv(A)*[7;2]
+disp(V)
+
+I12=(V(1)-V(2))/2
+disp(I12)
\ No newline at end of file diff --git a/671/CH2/EX2.9/2_9.sce b/671/CH2/EX2.9/2_9.sce new file mode 100755 index 000000000..29df50817 --- /dev/null +++ b/671/CH2/EX2.9/2_9.sce @@ -0,0 +1,11 @@ +//KCLs
+
+A=[2,-1;-4,19]
+V=inv(A)*[10;25]
+
+Pc=1*V(1)
+Iv=(5-V(2))/2 + (5-V(1))/5
+Pv=5*Iv
+
+disp(V)
+disp(Pv,Pc)
\ No newline at end of file |