From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 608/CH31/EX31.01/31_01.sce | 36 ++++++++++++++++++++++++++++++++++++ 608/CH31/EX31.02/31_02.sce | 40 ++++++++++++++++++++++++++++++++++++++++ 608/CH31/EX31.03/31_03.sce | 38 ++++++++++++++++++++++++++++++++++++++ 608/CH31/EX31.04/31_04.sce | 21 +++++++++++++++++++++ 608/CH31/EX31.05/31_05.sce | 22 ++++++++++++++++++++++ 608/CH31/EX31.06/31_06.sce | 24 ++++++++++++++++++++++++ 608/CH31/EX31.07/31_07.sce | 44 ++++++++++++++++++++++++++++++++++++++++++++ 608/CH31/EX31.08/31_08.sce | 36 ++++++++++++++++++++++++++++++++++++ 608/CH31/EX31.09/31_09.sce | 41 +++++++++++++++++++++++++++++++++++++++++ 9 files changed, 302 insertions(+) create mode 100755 608/CH31/EX31.01/31_01.sce create mode 100755 608/CH31/EX31.02/31_02.sce create mode 100755 608/CH31/EX31.03/31_03.sce create mode 100755 608/CH31/EX31.04/31_04.sce create mode 100755 608/CH31/EX31.05/31_05.sce create mode 100755 608/CH31/EX31.06/31_06.sce create mode 100755 608/CH31/EX31.07/31_07.sce create mode 100755 608/CH31/EX31.08/31_08.sce create mode 100755 608/CH31/EX31.09/31_09.sce (limited to '608/CH31') diff --git a/608/CH31/EX31.01/31_01.sce b/608/CH31/EX31.01/31_01.sce new file mode 100755 index 000000000..86228e4ec --- /dev/null +++ b/608/CH31/EX31.01/31_01.sce @@ -0,0 +1,36 @@ +//Problem 31.01: Use mesh-current analysis to determine the current flowing in (a) the 5 ohm resistance, and (b) the 1ohm  resistance of the d.c. circuit shown in Figure 31.2. + +//initializing the variables: +V1 = 4; // in volts +V2 = 5; // in volts +R1 = 3; // in ohm +R2 = 5; // in ohm +R3 = 4; // in ohm +R4 = 1; // in ohm +R5 = 6; // in ohm +R6 = 8; // in ohm + +//calculation: +//The mesh currents I1, I2 and I3 are shown in Figure 31.2. Using Kirchhoff’s voltage law in 3 loops +//three eqns obtained +//(R1 + R2)*I1 - R2*I2 = V1 +//-1*R2*I1 + (R2 + R3 + R4 + R5)*I2 - R4*I3 = 0 +// -1*R4*I2 + (R4 + R6)*I3 = -1*V2 +//using determinants +d1 = [V1 -1*R2 0; 0 (R2 + R3 + R4 + R5) -1*R4; -1*V2 -1*R4 (R4 + R6)] +D1 = det(d1) +d2 = [(R1 + R2) V1 0; -1*R2 0 -1*R4; 0 -1*V2 (R4 + R6)] +D2 = det(d2) +d3 = [(R1 + R2) -1*R2 V1; -1*R2 (R2 + R3 + R4 + R5) 0; 0 -1*R4 -1*V2] +D3 = det(d3) +d = [(R1 + R2) -1*R2 0; -1*R2 (R2 + R3 + R4 + R5) -1*R4; 0 -1*R4 (R4 + R6)] +D = det(d) +I1 = D1/D +I2 = D2/D +I3 = D3/D +IR2 = I1 - I2 +IR4 = I2 - I3 + +printf("\n\n Result \n\n") +printf("\n (a)current in the 5 ohm resistance is %.2f A",IR2) +printf("\n (b)current in the 1 ohm resistance is %.2f A",IR4) \ No newline at end of file diff --git a/608/CH31/EX31.02/31_02.sce b/608/CH31/EX31.02/31_02.sce new file mode 100755 index 000000000..16f18b47f --- /dev/null +++ b/608/CH31/EX31.02/31_02.sce @@ -0,0 +1,40 @@ +//Problem 31.02: For the a.c. network shown in Figure 31.3 determine, using mesh-current analysis, (a) the mesh currents I1 and I2 (b) the current flowing in the capacitor, and (c) the active power delivered by the 100/_0° V voltage source. + +//initializing the variables: +rv = 100; // in volts +thetav = 0; // in degrees +R1 = 5; // in ohm +R2 = -1*4*%i; // in ohm +R3 = 4; // in ohm +R4 = %i*3; // in ohm + +//calculation: +//voltages +V = rv*cos(thetav*%pi/180) + %i*rv*sin(thetav*%pi/180) +//Currents I1, I2 with their directions are shown in Figure 31.03. +//Two loops are chosen. The choice of loop directions is arbitrary. +//using kirchoff rule in 2 loops +//two eqns obtained +//(R1 + R2)*I1 - R2*I2 = V +//-1*R2*I1 + (R3 + R2 + R4)*I2 = 0 +//using determinants +d1 = [V -1*R2; 0 (R3 + R2 + R4)] +D1 = det(d1) +d2 = [(R1 + R2) V; -1*R2 0] +D2 = det(d2) +d = [(R1 + R2) -1*R2; -1*R2 (R3 + R2 + R4)] +D = det(d) +I1 = D1/D +I2 = D2/D +I1mag = (real(I1)^2 + imag(I1)^2)^0.5 +//Current flowing in capacitor +Ic = I1 - I2 +//Source power P +phi = atan(imag(I1)/real(I1)) +P = V*I1mag*cos(phi) +Icmag = (real(Ic)^2 + imag(Ic)^2)^0.5 + +printf("\n\n Result \n\n") +printf("\n (a)current, I1 is %.2f + (%.2f)i A, current, I2 is %.2f + (%.2f)i A",real(I1), imag(I1),real(I2), imag(I2)) +printf("\n (b)current in the capacitor is %.2f A",Icmag) +printf("\n (c)Source power P is %.2f W",P) \ No newline at end of file diff --git a/608/CH31/EX31.03/31_03.sce b/608/CH31/EX31.03/31_03.sce new file mode 100755 index 000000000..19cc488b6 --- /dev/null +++ b/608/CH31/EX31.03/31_03.sce @@ -0,0 +1,38 @@ +//Problem 31.03: A balanced star-connected 3-phase load is shown in Figure 31.4. Determine the value of the line currents IR, IY and IB using mesh-current analysis. + +//initializing the variables: +rv1 = 415; // in volts +rv2 = 415; // in volts +thetav1 = 120; // in degrees +thetav2 = 0; // in degrees +R = 3 + %i*4; // in ohm + +//calculation: +//voltages +V1 = rv1*cos(thetav1*%pi/180) + %i*rv1*sin(thetav1*%pi/180) +V2 = rv2*cos(thetav2*%pi/180) + %i*rv2*sin(thetav2*%pi/180) +//Two mesh currents I1 and I2 are chosen as shown in Figure 31.4. +//Two loops are chosen. The choice of loop directions is arbitrary. +//using kirchoff rule in 2 loops +//two eqns obtained +//2*R*I1 - R*I2 = V1 +//-1*R*I1 + 2*R*I2 = V2 +//using determinants +d1 = [V1 -1*R; V2 2*R] +D1 = det(d1) +d2 = [2*R V1; -1*R V2] +D2 = det(d2) +d = [2*R -1*R; -1*R 2*R] +D = det(d) +I1 = D1/D +I2 = D2/D +I1mag = (real(I1)^2 + imag(I1)^2)^0.5 +//line current IR +IR = I1 +//line current IB +IB = -1*I2 +//line current IY +IY = I2 - I1 + +printf("\n\n Result \n\n") +printf("\n current, IR is %.2f + (%.2f)i A, current, IB is %.2f + (%.2f)i A and current, IY is %.2f + (%.2f)i A",real(IR), imag(IR),real(IB), imag(IB),real(IY), imag(IY)) \ No newline at end of file diff --git a/608/CH31/EX31.04/31_04.sce b/608/CH31/EX31.04/31_04.sce new file mode 100755 index 000000000..a5ad7b13c --- /dev/null +++ b/608/CH31/EX31.04/31_04.sce @@ -0,0 +1,21 @@ +//Problem 31.04: For the network shown in Figure 31.8, determine the voltage VAB, by using nodal analysis. + +//initializing the variables: +ri = 20; // in amperes +thetai = 0; // in degrees +R1 = 10; // in ohm +R2 = %i*3; // in ohm +R3 = 4; // in ohm +R4 = 16; // in ohm + +//calculation: +//current +I = ri*cos(thetai*%pi/180) + %i*ri*sin(thetai*%pi/180) +//Figure 31.8 contains two principal nodes (at 1 and B) and thus only one nodal equation is required. B is taken as the reference node and the equation for node 1 is obtained as follows. Applying Kirchhoff’s current law to node 1 gives: +//IX + IY = I +V1 = I/((1/R4) +(1/(R2 +R3))) +IY = V1/(R2 + R3) +VAB = IY*R3 + +printf("\n\n Result \n\n") +printf("\n voltage VAB is %.2f + (%.2f)i V",real(VAB), imag(VAB)) \ No newline at end of file diff --git a/608/CH31/EX31.05/31_05.sce b/608/CH31/EX31.05/31_05.sce new file mode 100755 index 000000000..7a612c1d8 --- /dev/null +++ b/608/CH31/EX31.05/31_05.sce @@ -0,0 +1,22 @@ +//Problem 31.05: Determine the value of voltage VXY shown in the circuit of Figure 31.9. + +//initializing the variables: +rv1 = 8; // in volts +rv2 = 8; // in volts +thetav1 = 0; // in degrees +thetav2 = 90; // in degrees +R1 = 5; // in ohm +R2 = %i*6; // in ohm +R3 = 4; // in ohm +R4 = 3; // in ohm + +//calculation: +//voltages +V1 = rv1*cos(thetav1*%pi/180) + %i*rv1*sin(thetav1*%pi/180) +V2 = rv2*cos(thetav2*%pi/180) + %i*rv2*sin(thetav2*%pi/180) +//The circuit contains no principal nodes. However, if point Y is chosen as the reference node then an equation may be written for node X assuming that current leaves point X by both branches +VX = [(V1/(R1 + R3) + V2/(R2 + R4))/(1/(R1 + R3) + 1/(R2 + R4))] +VXY = VX + +printf("\n\n Result \n\n") +printf("\n voltage VXY is %.2f + (%.2f)i V",real(VXY), imag(VXY)) \ No newline at end of file diff --git a/608/CH31/EX31.06/31_06.sce b/608/CH31/EX31.06/31_06.sce new file mode 100755 index 000000000..9c6f82966 --- /dev/null +++ b/608/CH31/EX31.06/31_06.sce @@ -0,0 +1,24 @@ +//Problem 31.06: Use nodal analysis to determine the current flowing in each branch of the network shown in Figure 31.10. + +//initializing the variables: +rv1 = 100; // in volts +rv2 = 50; // in volts +thetav1 = 0; // in degrees +thetav2 = 90; // in degrees +R1 = 25; // in ohm +R2 = 20; // in ohm +R3 = 10; // in ohm + +//calculation: +//voltages +V1 = rv1*cos(thetav1*%pi/180) + %i*rv1*sin(thetav1*%pi/180) +V2 = rv2*cos(thetav2*%pi/180) + %i*rv2*sin(thetav2*%pi/180) +//There are only two principal nodes in Figure 31.10 so only one nodal equation is required. Node 2 is taken as the reference node. +//The equation at node 1 is I1 + I2 + I3 = 0 +Vn1 = [(V1/R1 + V2/R3)/(1/R1 + 1/R2 + 1/R3)] +I1 = (Vn1 - V1)/R1 +I2 = Vn1/R2 +I3 = (Vn1 - V2)/R3 + +printf("\n\n Result \n\n") +printf("\n current, I1 is %.2f + (%.2f)i A, current, I2 is %.2f + (%.2f)i A and current, I3 is %.2f + (%.2f)i A",real(I1), imag(I1),real(I2), imag(I2),real(I3), imag(I3)) \ No newline at end of file diff --git a/608/CH31/EX31.07/31_07.sce b/608/CH31/EX31.07/31_07.sce new file mode 100755 index 000000000..cd396bd9e --- /dev/null +++ b/608/CH31/EX31.07/31_07.sce @@ -0,0 +1,44 @@ +//Problem 31.07: In the network of Figure 31.11 use nodal analysis to determine (a) the voltage at nodes 1 and 2, (b) the current in the j4 ohm inductance, (c) the current in the 5 ohm resistance, and (d) the magnitude of the active power dissipated in the 2.5 ohm resistance. + +//initializing the variables: +rv1 = 25; // in volts +rv2 = 25; // in volts +thetav1 = 0; // in degrees +thetav2 = 90; // in degrees +R1 = 2; // in ohm +R2 = -1*%i*4; // in ohm +R3 = 5; // in ohm +R4 = %i*4; // in ohm +R5 = 2.5; // in ohm + +//calculation: +//voltages +V1 = rv1*cos(thetav1*%pi/180) + %i*rv1*sin(thetav1*%pi/180) +V2 = rv2*cos(thetav2*%pi/180) + %i*rv2*sin(thetav2*%pi/180) +//The equation at node 1 +//Vn1*(1/R1 + 1/R2 + 1/R3) - Vn2/R3 = V1/R1 +//The equation at node 2 +//Vn1*(-1/R3) + Vn2*(1/R4 + 1/R5 + 1/R3) = V2/R5 +//using determinants +d1 = [V1/R1 -1/R3; V2/R5 (1/R4 + 1/R5 + 1/R3)] +D1 = det(d1) +d2 = [(1/R1 + 1/R2 + 1/R3) V1/R1; -1/R3 V2/R5] +D2 = det(d2) +d = [(1/R1 + 1/R2 + 1/R3) -1/R3; -1/R3 (1/R4 + 1/R5 + 1/R3)] +D = det(d) +Vn1 = D1/D +Vn2 = D2/D +//current in the j4 ohm inductance is given by: +I4 = Vn2/R4 +//current in the 5 ohm resistance is given by: +I3 = (Vn1 - Vn2)/R3 +//active power dissipated in the 2.5 ohm resistor is given by +P5 = R5*((Vn2 - V2)/R5)^2 +//magnitude of the active power dissipated +P5mag = (real(P5)^2 + imag(P5)^2)^0.5 + +printf("\n\n Result \n\n") +printf("\n (a) the voltage at nodes 1 and 2 is %.2f + (%.2f)i V and %.2f + (%.2f)i V",real(Vn1), imag(Vn1),real(Vn2), imag(Vn2)) +printf("\n (b)the current in the j4 ohm inductance is %.2f + (%.2f)i A",real(I4), imag(I4)) +printf("\n (c)the current in the 5 ohm resistance is %.2f + (%.2f)i A",real(I3), imag(I3)) +printf("\n (d) magnitude of the active power dissipated in the 2.5 ohm resistance is %.2f W",P5mag) \ No newline at end of file diff --git a/608/CH31/EX31.08/31_08.sce b/608/CH31/EX31.08/31_08.sce new file mode 100755 index 000000000..a71af8f54 --- /dev/null +++ b/608/CH31/EX31.08/31_08.sce @@ -0,0 +1,36 @@ +//Problem 31.08: In the network shown in Figure 31.12 determine the voltage VXY using nodal analysis + +//initializing the variables: +ri = 25; // in amperes +thetai = 0; // in degrees +R1 = 4; // in ohm +R2 = %i*3; // in ohm +R3 = 5; // in ohm +R4 = %i*10; // in ohm +R5 = %i*20; // in ohm + +//calculation: +//current +I = ri*cos(thetai*%pi/180) + %i*ri*sin(thetai*%pi/180) +//Node 3 is taken as the reference node. +//At node 1, +//V1*(1/(R1 + R2) + 1/R3) - V2/R3 = I +//The equation at node 2 +//V1*(-1/R3) + V2*(1/R4 + 1/R5 + 1/R3) = 0 +//using determinants +d1 = [I -1/R3; 0 (1/R4 + 1/R5 + 1/R3)] +D1 = det(d1) +d2 = [(1/(R1 + R2) + 1/R3) I; -1/R3 0] +D2 = det(d2) +d = [(1/(R1 + R2) + 1/R3) -1/R3; -1/R3 (1/R4 + 1/R5 + 1/R3)] +D = det(d) +V1 = D1/D +V2 = D2/D +//the voltage between point X and node 3 is +VX = V1*R2/(R1 + R2) +//Thus the voltage +VY = V2 +VXY = VX - VY + +printf("\n\n Result \n\n") +printf("\n voltage VXY is %.2f + (%.2f)i V",real(VXY), imag(VXY)) \ No newline at end of file diff --git a/608/CH31/EX31.09/31_09.sce b/608/CH31/EX31.09/31_09.sce new file mode 100755 index 000000000..3d0f14dcd --- /dev/null +++ b/608/CH31/EX31.09/31_09.sce @@ -0,0 +1,41 @@ +//Problem 31.09: Use nodal analysis to determine the voltages at nodes 2 and 3 in Figure 31.13 and hence determine the current flowing in the 2 ohm resistor and the power dissipated in the 3 ohm resistor. + +//initializing the variables: +V = 8; // in volts +R1 = 1; // in ohm +R2 = 2; // in ohm +R3 = 3; // in ohm +R4 = 4; // in ohm +R5 = 5; // in ohm +R6 = 6; // in ohm + +//calculation: +//In Figure 31.13, the reference node is shown at point A. +//At node 1, +//V1*(1/R1 + 1/R6 + 1/R5) - V2/R1 - V3/R5 = V/R5 +//The equation at node 2 +//V1*(-1/R1) + V2*(1/R2 + 1/R1 + 1/R3) - V3/R3 = 0 +//At node 3 +// - V1/R5 - V2/R3 + V3*(1/R4 + 1/R3 + 1/R5) = -1*V/R5 +//using determinants +d1 = [V/R5 -1/R1 -1/R5; 0 (1/R2 + 1/R1 + 1/R3) -1/R3; -1*V/R5 -1/R3 (1/R4 + 1/R3 + 1/R5)] +D1 = det(d1) +d2 = [(1/R1 + 1/R6 + 1/R5) V/R5 -1/R5; -1/R1 0 -1/R3; -1/R5 -1*V/R5 (1/R4 + 1/R3 + 1/R5)] +D2 = det(d2) +d3 = [(1/R1 + 1/R6 + 1/R5) -1/R1 V/R5; -1/R1 (1/R2 + 1/R1 + 1/R3) 0; -1/R5 -1/R3 -1*V/R5] +D3 = det(d3) +d = [(1/R1 + 1/R6 + 1/R5) -1/R1 -1/R5; -1/R1 (1/R2 + 1/R1 + 1/R3) -1/R3; -1/R5 -1/R3 (1/R4 + 1/R3 + 1/R5)] +D = det(d) +Vn1 = D1/D +Vn2 = D2/D +Vn3 = D3/D +//the current in the 2 ohm resistor +I2 = Vn2/R2 +//power dissipated in the 3 ohm resistance +P3 = R3*((Vn2 - Vn3)/R3)^2 + +printf("\n\n Result \n\n") +printf("\n voltage at node 2 is %.2f V",Vn2) +printf("\n voltage at node 3 is %.2f V",Vn3) +printf("\n (a)current through 2 ohm resistor is %.2f A",I2) +printf("\n (b)power dissipated in the 3 ohm resistor is %.2f W",P3) \ No newline at end of file -- cgit