diff options
Diffstat (limited to '2297/CH2')
-rwxr-xr-x | 2297/CH2/EX2.1/Ex2_1.sce | 27 | ||||
-rwxr-xr-x | 2297/CH2/EX2.10/Ex2_10.sce | 17 | ||||
-rwxr-xr-x | 2297/CH2/EX2.11/Ex2_11.sce | 24 | ||||
-rwxr-xr-x | 2297/CH2/EX2.12/Ex2_12.sce | 32 | ||||
-rwxr-xr-x | 2297/CH2/EX2.13/Ex2_13.sce | 12 | ||||
-rwxr-xr-x | 2297/CH2/EX2.14/Ex2_14.sce | 21 | ||||
-rwxr-xr-x | 2297/CH2/EX2.15/Ex2_15.sce | 35 | ||||
-rwxr-xr-x | 2297/CH2/EX2.2/Ex2_2.sce | 23 | ||||
-rwxr-xr-x | 2297/CH2/EX2.3/Ex2_3.sce | 21 | ||||
-rwxr-xr-x | 2297/CH2/EX2.4/Ex2_4.sce | 23 | ||||
-rwxr-xr-x | 2297/CH2/EX2.5/Ex2_5.sce | 20 | ||||
-rwxr-xr-x | 2297/CH2/EX2.6/Ex2_6.sce | 17 | ||||
-rwxr-xr-x | 2297/CH2/EX2.7/Ex2_7.sce | 19 | ||||
-rwxr-xr-x | 2297/CH2/EX2.8/Ex2_8.sce | 19 | ||||
-rwxr-xr-x | 2297/CH2/EX2.9/Ex2_9.sce | 18 |
15 files changed, 328 insertions, 0 deletions
diff --git a/2297/CH2/EX2.1/Ex2_1.sce b/2297/CH2/EX2.1/Ex2_1.sce new file mode 100755 index 000000000..112f2fd3d --- /dev/null +++ b/2297/CH2/EX2.1/Ex2_1.sce @@ -0,0 +1,27 @@ +// Example 2.1 :current +clc; +close; +clear; +format('v',7) +// given : +//15*I1-5*I2=10 loop 1 equation +//20*I2-5*I1-5*I3=0 loop 2 equation +//10*I3-5*I2=0 loop 3 equation +vs=10;//voltage in volts +R1=10;//resistance in ohm +R2=5;//resistance in ohm +R3=10;//resistance in ohm +R4=5;//resistance in ohm +R5=4;//resistance in ohm +Ra=1;//resistance in ohm +A=[R1+R2 R2-R1 0;R2-R1 R2+R3+R4 -R4;R4-(R5+Ra) -R4 R4+R5+Ra];//making equations +nb=7;//number of branches +nn=5;//number of nodes +nl=nb-(nn-1);//number of loops +nvs=1;//number of voltage sources +nivs=nn-1-nvs;//number of independent voltage variables +B=[vs;0;0];//making equations +X=A\B;//solving equations +I3=X(3,1);//calculating currrent +disp(I3,"current in resistance Ra=1.0 ohm is ,(A)=") +//directions of the current are 2 to 3 and 3 to 4 respectively diff --git a/2297/CH2/EX2.10/Ex2_10.sce b/2297/CH2/EX2.10/Ex2_10.sce new file mode 100755 index 000000000..260b191f8 --- /dev/null +++ b/2297/CH2/EX2.10/Ex2_10.sce @@ -0,0 +1,17 @@ +// Example 2.10 :current equation +clc; +close; +clear; +// given : +format('v',5) +v=100;//volts +r=50;//in ohms +l=0.1;//henry +c=50;//mf +d=poly(0,"d") +p=2*10^5+500*d+d^2; +x=roots(p) +c1=0;//at t=0 i=0 +c2=1000/imag(x(1,1));// +disp("it= "+string(c2)+"*e^"+string(real(x(1,1)))+"t*sin"+string(imag(x(1,1)))+"t A") + diff --git a/2297/CH2/EX2.11/Ex2_11.sce b/2297/CH2/EX2.11/Ex2_11.sce new file mode 100755 index 000000000..5e276dc88 --- /dev/null +++ b/2297/CH2/EX2.11/Ex2_11.sce @@ -0,0 +1,24 @@ +// Example 2.11 :average & rms value +clc; +close; +format('v',6) +clear; +// given : +vm=10;//voltage in volts +e=vm/2;//voltage in volts +t=0:2;//time range +x=intsplin(t,(5*t)^2);//variab;e +rms=sqrt(x/2);//rms value of voltage in volts +av=vm/2;//average value of voltage in volts +disp("parts (a) saw tooth wave") +disp(rms,"rms value of e is ,(V)=") +disp(av,"average value of e is ,(V)=") +t1=0;//initial time in seconds +t2=%pi;//final time in seconds +t3=2*%pi;//time interval +x=integrate('(sin(t))^2','t',t1,t2);//variable +rms=sqrt((1/(2*%pi))*x*vm^2);//rms value of voltage in volts +av=(10/(2*%pi))*integrate('sin(t)','t',t1,t2);//average value of voltage in volts +disp("parts (b) half wave rectified sine wave form") +disp(rms,"rms value of e is ,(V)=") +disp(av,"average value of e is ,(V)=") diff --git a/2297/CH2/EX2.12/Ex2_12.sce b/2297/CH2/EX2.12/Ex2_12.sce new file mode 100755 index 000000000..18908668a --- /dev/null +++ b/2297/CH2/EX2.12/Ex2_12.sce @@ -0,0 +1,32 @@ +// Example 2.12 :Circuit constants +clc; +close; +format('v',6) +clear; +// given : +//v=194*cos(800*t+150)V Voltage equation +//I=11.6*cos(800*t+140)A Current equation +vm=194/sqrt(2);//voltage in volts +va=150;//angle in degree +im=11.6/sqrt(2);//current in amperes +ia=140;//angle in degree +zm=vm/im;//resistance in ohms +za=va-ia;//resistance in ohms +z1=zm*cosd(za);//reactance in ohms +z2=zm*sind(za);//reactance in ohms +z=z1+%i*z2;//resistance in ohms +disp("part (a)") +disp(z,"Impedance is ,(Ohm)=") +disp("part (b)") +//v=6*sin(1000*t+45)V Voltage equation +//I=12*cos(1000t-90)A current equation +vm1=60/sqrt(2);//voltage in volts +va1=45;//angle in degree +im1=12/sqrt(2);//current in amperes +ia1=0;//angle in degree +zm1=vm1/im1;//resistance in ohms +za1=va1-ia1;//resistance in ohms +z11=zm1*cosd(za1);//reactance in ohms +z21=zm1*sind(za1);//reactance in ohms +z22=z11+%i*z21;//impedance in ohms +disp(z22,"Impedance is ,(Ohm)=") diff --git a/2297/CH2/EX2.13/Ex2_13.sce b/2297/CH2/EX2.13/Ex2_13.sce new file mode 100755 index 000000000..2c16a6b17 --- /dev/null +++ b/2297/CH2/EX2.13/Ex2_13.sce @@ -0,0 +1,12 @@ +// Example 2.13 :reading +clc; +close; +format('v',8) +clear; +// given : +v1=230;//voltage in volts +v2=100;//voltage in volts +v2=sqrt(v1^2-v2^2);//voltage in volts +v3=300;//voltage in volts +disp(v2,"reading V2 is,(V)") +disp("reading V4 is "+string(v3+v2)+" V or "+string(v3-v2)+" V") diff --git a/2297/CH2/EX2.14/Ex2_14.sce b/2297/CH2/EX2.14/Ex2_14.sce new file mode 100755 index 000000000..4d9ae88e9 --- /dev/null +++ b/2297/CH2/EX2.14/Ex2_14.sce @@ -0,0 +1,21 @@ +// Example 2.14 :circuit elements +clc; +close; +format('v',6) +// given : +//v=311*sin(2500*t+170) V voltage equation +//I=15.5*sin(2500*t-145)A current equation +vm=311/sqrt(2);//voltage in volts +va=170;//angle in degree +im=15.5/sqrt(2);//current in amperes +ia=-145;//angle in degree +zm=vm/im;//resistance in ohms +za=(va-ia)-360;//resistance ohms +z1=zm*cosd(za);//resistance in ohms +z2=zm*sind(za);//resistance in ohms +z=z1+%i*z2;//resistance in ohms +t=2500;//time in seconds +c=(1/(real(z)*t));//capacitance in farads +disp(z,"Impedance is ,(Ohm)=") +disp(c*10^6,"capacitance is ,(micro-farads)=") + diff --git a/2297/CH2/EX2.15/Ex2_15.sce b/2297/CH2/EX2.15/Ex2_15.sce new file mode 100755 index 000000000..ba9f762b4 --- /dev/null +++ b/2297/CH2/EX2.15/Ex2_15.sce @@ -0,0 +1,35 @@ +// Example 2.15 :parameters +clc; +close; +format('v',6) +// given : +z=40+%i*30;//resistance in ohms +zph=sqrt(real(z)^2+imag(z)^2);//resistance in ohms +pf=real(z)/zph;//power factor +v=400;//voltage in volts +vp=v/(sqrt(3));//voltage in volts +pc=vp/zph;//current in amperes +lv=v;//voltage in volts +lc=pc;//current om amperes +p=sqrt(3)*v*lc*pf;//power in watts +disp("part (a) Star") +disp(round(vp),"phase voltage,(V)=") +disp(round(pc),"phase current,(A)=") +disp(lv,"line voltage ,(V)=") +disp(lc,"line current,(A)=") +disp(p,"power ,(W)=") +z1=40+%i*30;//ohms +zph1=sqrt(real(z1)^2+imag(z1)^2);//ohms +pf1=real(z1)/zph1;//power factor +v1=400;//volts +vp1=v1;//volts +pc1=vp1/zph1;//amperes +lv1=v1;//volts +lc1=pc1*sqrt(3);//amperes +p1=sqrt(3)*v1*lc1*pf1;//watts +disp("part (b) Delta") +disp(round(vp1),"phase voltage,(V)=") +disp(round(pc1),"phase current,(A)=") +disp(lv1,"line voltage ,(V)=") +disp(lc1,"line current,(A)=") +disp(p1,"power ,(W)=") diff --git a/2297/CH2/EX2.2/Ex2_2.sce b/2297/CH2/EX2.2/Ex2_2.sce new file mode 100755 index 000000000..3586610ac --- /dev/null +++ b/2297/CH2/EX2.2/Ex2_2.sce @@ -0,0 +1,23 @@ +// Example 2.2 :current +clc; +close; +clear; +// given : +vs1=72;//voltage in volts +vs2=40;//voltage in volts +R1=36;//resistance in ohm +R2=10;//resistance in ohm +ig=2;//current in amperes +Rx=8;//resistance in ohm +//(va-72)/36+(va-40)/10 -2 +va/8=0 node equation at 1 +va=((R2*Rx*vs1)+(R1*Rx*vs2)+(R1*R2*Rx*ig))/((R2*Rx)+(R1*Rx)+(R1*R2));//voltage in volts +ix1=va/Rx;//current in amperes +//(R1+R2)*I1-R2*I2+vs2=vs1 loop equation 1 +//R2*I2-R2*I1+Ix*Rx=vs2 loop equation 2 +//Ix=I2+2 +A=[R1+R2 -R2;-R2 R2+Rx];//making equations +B=[vs1-vs2;vs2-2*Rx];//making equations +X=A\B;//solving equations +ix2=X(2,1)+ig;//current in amperes +disp(ix1,"current through Rx is(by node voltage method), (A)=") +disp(ix2,"current through Rx is (by loop current method),(A) =") diff --git a/2297/CH2/EX2.3/Ex2_3.sce b/2297/CH2/EX2.3/Ex2_3.sce new file mode 100755 index 000000000..402d0fa9f --- /dev/null +++ b/2297/CH2/EX2.3/Ex2_3.sce @@ -0,0 +1,21 @@ +// Example 2.3 :current +clc; +close; +clear; +format('v',7) +// given : +vs1=10;//voltage in volts +i5=2;//current in amperes +i2=i5;//current +r1=1;//resistance in ohms +r2=5;//resistance in ohms +r3=5;//resistance in ohms +rl=10;//resistance in ohms +r4=5;//resistance ohms +//(r1+r2+r3)*i1-r2*i2-r3*i3=vs1 loop equaion 1 +//-r2*i1-(r1+r2)*i2+(rl+r2+r3)*i3=0 loop equation 2 +A=[4*(r1+r2+r3) -r2*4;-r2 (rl+r2+r3)];//making equations +B=[4*(vs1+r2*i2) ; i2*(r2+r3)];//making equations +X=A\B;//solving equations +il=i2-X(2,1);//calculating current +disp(il,"current through Rl is (from b to a),(A)=") diff --git a/2297/CH2/EX2.4/Ex2_4.sce b/2297/CH2/EX2.4/Ex2_4.sce new file mode 100755 index 000000000..ee916e339 --- /dev/null +++ b/2297/CH2/EX2.4/Ex2_4.sce @@ -0,0 +1,23 @@ +// Example 2.4 :current +clc; +close; +clear; +format('v',7) +// given : +vs1=72;//voltage in volts +vs2=40;//voltage in volts +R1=36;//resistance in ohms +R2=10;//resistance in ohms +ig=2;//current in amperes +Rx=8;//resistance in ohms +disp("Applying Thevenins Theorem ") +//(vs1-voc)/R1+(v40-voc)/R2 +2 =0 node equation at 1 +voc=(R2*vs1+R1*vs2+R1*R2*ig)/(R1+R2);//voltage in volts +req=(R1*R2)/(R1+R2);//resistance in ohms +ix1=(voc)/(req+Rx);//resistance in ohms +disp(ix1,"current through Rx is, (A)") +disp("Applying Nortons Theorem ") +Is=(vs1/R1)+(vs2/R2)+ig;//current in amperes +ix2=(req*(Is/(Rx+req)));//current in amperes +disp(ix2,"current through Rx is, (A) =") + diff --git a/2297/CH2/EX2.5/Ex2_5.sce b/2297/CH2/EX2.5/Ex2_5.sce new file mode 100755 index 000000000..f87c876a5 --- /dev/null +++ b/2297/CH2/EX2.5/Ex2_5.sce @@ -0,0 +1,20 @@ +// Example 2.5 :Thevenin's and Norton's Equivalent +clc; +close; +format('v',7) +clear; +// given : +vs1=10;//voltage in volts +R1=50;//resistance in ohms +R2=50;//resistance in ohms +R3=25;//resistance in ohms +disp("(a) Applying Thevenins Theorem ") +voc=(R1/(R1+R2))*vs1;//voltage in volts +req=((R1*R2)/(R1+R2))+R3;//resistance in ohms +disp(voc,"Thevenin equivalent open circuit voltage is, (V)=") +disp(t=req,"Thevenin equivalent resistance is,(Ohm)=") +disp("(b) Applying Nortons Theorem ") +Isc=((vs1)/(R1+(R1*R3)/(R1+R3)))*(R1/(R1+R3));// +req=((R1*R2)/(R1+R2))+R3;//resistance in ohms +disp(Isc,"Norton short circuit current is,(A)=") +disp(t=req,"Norton equivalent resistance is,(Ohm)=") diff --git a/2297/CH2/EX2.6/Ex2_6.sce b/2297/CH2/EX2.6/Ex2_6.sce new file mode 100755 index 000000000..1122cc2f9 --- /dev/null +++ b/2297/CH2/EX2.6/Ex2_6.sce @@ -0,0 +1,17 @@ +// Example 2.6 :current +clc; +close; +format('v',7) +clear; +// given : +vs1=10;//voltage volts +r1=100;//resistance in ohms +r2=600;//resistance in ohms +r3=150;//resistance in ohms +r4=850;//resistance in ohms +rx=50;//resistance in ohms +voc=vs1*((r3/(r1+r3))-(r4/(r2+r4)));//open circuit voltage in volts +req=((r1*r3)/(r1+r3))+((r2*r4)/(r2+r4));//equivalent resistance in ohms +ix=voc/(req+rx)*10^3;//current in amperes +disp(ix,"current through Rx is (from A to B),(mA)=") + diff --git a/2297/CH2/EX2.7/Ex2_7.sce b/2297/CH2/EX2.7/Ex2_7.sce new file mode 100755 index 000000000..77cdea651 --- /dev/null +++ b/2297/CH2/EX2.7/Ex2_7.sce @@ -0,0 +1,19 @@ +// Example 2.7 :Norton's Equivalent +clc; +close; +clear; +// given : +vs1=40;//volts +vs2=20;//volts +r1=2;//resistance in ohms +r2=6;//resistance in ohms +r3=2;//resistance in ohms +r4=2;//resistance in ohms +iab=((r1*vs1)/(r2+(r1/2))*((r1+(r3/2))/(r1+r3)));//current in amperes +iab1=-vs2/r1;//current amperes +it=iab+iab1;//current amperes +req1=r1+((r1*r2)/(r1+r2));//equivalent resistance in ohms +req=(req1*r3)/(req1+r3);//equivalent resistance in ohms +disp(it,"current is,(A)") +disp(req,"equivalent resistance is,(ohm)=") + diff --git a/2297/CH2/EX2.8/Ex2_8.sce b/2297/CH2/EX2.8/Ex2_8.sce new file mode 100755 index 000000000..e6b47b2a7 --- /dev/null +++ b/2297/CH2/EX2.8/Ex2_8.sce @@ -0,0 +1,19 @@ +// Example 2.8:equation of current and time +clc; +close; +clear; +format('v',6) +// given : +v=100;//voltage in volts +r=100;//resistance in ohms +l=0.2;//inductance in henrty +T=1/(l/r);//calculating time in seconds +t=500;//time in micro seconds +i1=1-exp(-T*t*10^-6);//current in amperes +disp(i1,"current is (when t=500 micro seconds),(A)=") +v2=50;//voltage in volts +x=v2/r;//variab;e +x1=x*((v2/r)+i1);//variable +t1=t+(10^6*(x1/500));//time in seconds +disp(ceil(t1),"time at which current will be zero is,(micro-seconds)=") +//time is caluclated wrong in the textbook as they had not added the values diff --git a/2297/CH2/EX2.9/Ex2_9.sce b/2297/CH2/EX2.9/Ex2_9.sce new file mode 100755 index 000000000..9294e5725 --- /dev/null +++ b/2297/CH2/EX2.9/Ex2_9.sce @@ -0,0 +1,18 @@ +// Example 2.9 :time +clc; +close; +format('v',6) +clear; +// given : +v=10;//voltage in volts +r1=500;//resistance in ohms +is=0;//current in amperes +r=700;//resistance in ohms +c=100;//capacitance in micro farads +x=1/(r*c*10^-6);//variable +i=30;//current in mA +y=(i*10^-3)-(v/r1);//variable +t=-((log(y*(r/v))));//time in seconds +t1=t/x;//time in seconds +disp(t1,"time is ,(seconds)=") + |