"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"rv = 200;# in volts\n",
"thetav = 0;# in degrees\n",
"R1 = 5000;# in ohm\n",
"R2 = 20000;# in ohm\n",
"R3 = -1j*120000;# in ohm\n",
"R4 = 150000;# in ohm\n",
"\n",
" #calculation:\n",
" #voltage\n",
"V = rv*math.cos(thetav*math.pi/180) + 1j*rv*math.sin(thetav*math.pi/180)\n",
" #Initially the (150-i120)kohm\u0006 impedance is removed from the circuit as shown in Figure 33.13.\n",
" #Note that, to find the current in the capacitor, \n",
" #only the capacitor need have been initially removed from the circuit. \n",
" #However, removing each of the components from the branch through \n",
" #which the current is required will often result in a simpler solution. \n",
" #From Figure 33.13,\n",
" #current, I1 \n",
"I1 = V/(R1 + R2)\n",
" #The open-circuit e.m.f. E is equal to the p.d. across the 20 k\u0006ohm resistor, i.e.\n",
"E = I1*R2\n",
" #Removing the V1 source gives the network shown in Figure 33.14.\n",
" #The impedance, z, looking in at the open-circuited terminals is given by\n",
"z = R1*R2/(R1 + R2)\n",
" #The Th\u00b4evenin equivalent circuit is shown in Figure 33.15, where current iL is given by\n",
"ZL = R3 + R4\n",
"IL = E/(ZL + z)\n",
"ILmag = abs(IL)\n",
" #current flowing in the capacitor\n",
"Ic = ILmag\n",
" #P.d. across the 150 kohm resistor,\n",
"Vr150 = ILmag*R4\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n(a)the current flowing in the capacitor is \",round(Ic*1000,2),\" mA\"\n",
"print \"\\n(b) the p.d. across the 150 ohm resistance is \",round(Vr150,2),\" V\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
"(a)the current flowing in the capacitor is 0.82 mA\n",
"\n",
"(b) the p.d. across the 150 ohm resistance is 122.93 V\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 2, page no. 579
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"V1 = 20;# in volts\n",
"V2 = 10;# in volts\n",
"R1 = 2;# in ohm\n",
"R2 = 1.5;# in ohm\n",
"L = 235E-6;# in Henry\n",
"R4 = 3;# in ohm\n",
"f = 2000;# in Hz\n",
"\n",
" #calculation:\n",
" #The impedance through which current I is flowing is initially removed from the network, as shown in Figure 33.17.\n",
" #From Figure 33.17,\n",
" #current, I1 \n",
"I1 = (V1 - V2)/(R1 + R4)\n",
" #the open circuit e.m.f. E\n",
"E = V1 - I1*R1\n",
" #When the sources of e.m.f. are removed from the circuit, \n",
" #the impedance, z, \u2018looking in\u2019 at the break is given by\n",
"z = R1*R4/(R1 + R4)\n",
" #The Th\u00b4evenin equivalent circuit is shown in Figure 33.18, where inductive reactance,\n",
"XL = 2*math.pi*f*L\n",
"R3 = 1j*XL\n",
" #Hence current\n",
"I = E/(R2 + R3 + z)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the current I is \",round(I.real,2),\" + (\",round(I.imag,2),\")i A\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the current I is 2.7 + ( -2.95 )i A\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 3, page no. 580
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"rv = 50;# in volts\n",
"thetav = 0;# in degrees\n",
"R1 = -1j*400;# in ohm\n",
"R2 = 300;# in ohm\n",
"R3 = 144j;# in ohm\n",
"R4 = 48;# in ohm\n",
"\n",
" #calculation:\n",
" #voltage\n",
"V = rv*math.cos(thetav*math.pi/180) + 1j*rv*math.sin(thetav*math.pi/180)\n",
" #The R3 and R4 impedance is initially removed from the network as shown in Figure 33.20.\n",
" #From Figure 33.20,\n",
" #current, I\n",
"i = V/(R1 + R2)\n",
" #the open circuit e.m.f. E\n",
"E = i*R2\n",
" #When the V is removed from the circuit, the impedance, z, \u2018looking in\u2019 at the break is given by\n",
"z = R1*R2/(R1 + R2)\n",
" #The Th\u00b4evenin equivalent circuit is shown in Figure 33.21 connected to R# and R4,\n",
" #Hence current\n",
"I = E/(R4 + R3 + z)\n",
"Imag = abs(I)\n",
" #the power dissipated in the 48 ohm resistor\n",
"Pr48 = R4*Imag**2\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the power dissipated in the 48 ohm resistor is \",round(Pr48,2),\" W\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the power dissipated in the 48 ohm resistor is 0.75 W"
]
}
],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 4, page no. 581
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"V = 100;# in volts\n",
"R1 = 5;# in ohm\n",
"R2 = 20;# in ohm\n",
"R3 = 46;# in ohm\n",
"R4 = 50;# in ohm\n",
"R5 = 15;# in ohm\n",
"R6 = 60;# in ohm\n",
"R7 = 16;# in ohm\n",
"R8 = 80;# in ohm\n",
"\n",
"#calculation:\n",
" #One method of analysing a multi-branch network as shown in Figure 33.22 \n",
" #is to use Th\u00b4evenin\u2019s theorem on one part of the network at a time. \n",
" #For example, the part of the circuit to the left of AA may be reduced to a Th\u00b4evenin equivalent circuit.\n",
" #From Figure 33.23,\n",
"E1 = (R2/(R1 + R2))*V\n",
"z1 = R1*R2/(R1 + R2)\n",
" #Thus the network of Figure 33.22 reduces to that of Figure 33.24. \n",
" #The part of the network shown in Figure 33.24 to the left of BB may be reduced \n",
" #to a Th\u00b4evenin equivalent circuit, where\n",
"E2 = (R4/(R3 + R4 + z1))*E1\n",
"z2 = R4*(z1 + R3)/(R4 + z1 + R3)\n",
" #Thus the original network reduces to that shown in Figure 33.25. \n",
" #The part of the network shown in Figure 33.25 to the left of CC may be reduced \n",
" #to a Th\u00b4evenin equivalent circuit, where\n",
"E3 = (R6/(R5 + R6 + z2))*E2\n",
"z3 = R6*(z2 + R5)/(R5 + z2 + R6)\n",
" #Thus the original network reduces to that of Figure 33.26, \n",
" #from which the current in the 80 ohm resistor is given by\n",
"I = E3/(z3 + R7 + R8)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the current flowing in the 80 ohm resistor is \",round(I,2),\" A\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the current flowing in the 80 ohm resistor is 0.2 A"
]
}
],
"prompt_number": 4
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 5, page no. 582
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"rv = 24;# in volts\n",
"thetav = 0;# in degrees\n",
"R1 = -1j*3;# in ohm\n",
"R2 = 4;# in ohm\n",
"R3 = 3j;# in ohm\n",
"\n",
" #calculation:\n",
" #voltage\n",
"V = rv*math.cos(thetav*math.pi/180) + 1j*rv*math.sin(thetav*math.pi/180)\n",
" #Current I1 shown in Figure 33.27 is given by\n",
"I1 = V/(R1 + R2 + R3)\n",
" #The Th\u00b4evenin equivalent voltage, i.e., the open-circuit voltage across terminals AB, is given by\n",
"E = I1*(R2 + R3)\n",
" #When the voltage source is removed, the impedance z \u2018looking in\u2019 at AB is given by\n",
"z = (R2 + R3)*R1/(R1 + R2 + R3)\n",
" #Thus the Th\u00b4evenin equivalent circuit is as shown in Figure 33.28.\n",
" #when (3.75 + i11) ohm impedance connected across terminals AB, \n",
" #the current I flowing in the impedance is given by\n",
"R = 3.75 + 11j;# in ohms\n",
"I = E/(R + z)\n",
"Imag = abs(I)\n",
" #the p.d. across the( 3.75 + i11)ohm impedance.\n",
"VR = I*R\n",
"VRmag = abs(VR)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a) the current I flowing in the (3.75 + i11) impedance is given by is \",round(Imag,2),\" A\"\n",
"print \"\\n (b) the magnitude of the p.d. across the impedance is \",round(VRmag,2),\" V\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a) the current I flowing in the (3.75 + i11) impedance is given by is 3.0 A\n",
"\n",
" (b) the magnitude of the p.d. across the impedance is 34.86 V"
]
}
],
"prompt_number": 5
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 6, page no. 583
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"rv = 16.55;# in volts\n",
"thetav = -22.62;# in degrees\n",
"R1 = 4;# in ohm\n",
"R2 = 1j*2;# in ohm\n",
"R3 = 1j*6;# in ohm\n",
"R4 = 3;# in ohm\n",
"R5 = 5;# in ohm\n",
"R6 = -1*1j*8;# in ohm\n",
"\n",
" #calculation:\n",
" #voltage\n",
"V = rv*math.cos(thetav*math.pi/180) + 1j*rv*math.sin(thetav*math.pi/180)\n",
" #The capacitor is removed from branch AB, as shown in Figure 33.30.\n",
" #Impedance, Z\n",
"Z1 = R3 + R4 + R5\n",
"Z = R1 + (Z1*R2/(R2 + Z1))\n",
"I1 = V/Z\n",
"I2 = (R2/(R2 +Z1))*I1\n",
" #The open-circuit voltage, E\n",
"E = I2*R5\n",
" #If the voltage source is removed from Figure 33.30, the impedance, z, \u2018looking in\u2019 at AB is given by\n",
"z = R5*((R1*R2/(R1 + R2)) + R3 + R4)/(R5 + ((R1*R2/(R1 + R2)) + R3 + R4))\n",
" #The Th\u00b4evenin equivalent circuit is shown in Figure 33.31, \n",
" #where the current flowing in the capacitor, I, is given by\n",
"I = E/(z + R6)\n",
"Imag = abs(I)\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the current flowing in the capacitor of the network is \",round(Imag,2),\" A\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the current flowing in the capacitor of the network is 0.43 A"
]
}
],
"prompt_number": 6
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 7, page no. 584
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"rv1 = 5;# in volts\n",
"rv2 = 10;# in volts\n",
"thetav1 = 45;# in degrees\n",
"thetav2 = 0;# in degrees\n",
"R1 = 8;# in ohm\n",
"R2 = 5;# in ohm\n",
"R3 = 3j;# in ohm\n",
"R4 = 4;# in ohm\n",
"\n",
"#calculation:\n",
" #voltage\n",
"V1 = rv1*math.cos(thetav1*math.pi/180) + 1j*rv1*math.sin(thetav1*math.pi/180)\n",
"V2 = rv2*math.cos(thetav2*math.pi/180) + 1j*rv2*math.sin(thetav2*math.pi/180)\n",
" #Current I1 shown in Figure 33.32 is given by\n",
"I1 = V2/(R2 + R3 + R4)\n",
" #Hence the voltage drop across the 5 ohm\u0006 resistor is given by VX is in the direction shown in Figure 33.32,\n",
"Vx = I1*R2\n",
" #The open-circuit voltage E across PQ is the phasor sum of V1, Vx and V2, as shown in Figure 33.33.\n",
"E = V2 - V1 - Vx\n",
" #The impedance, z, \u2018looking in\u2019 at terminals PQ with the voltage sources removed is given by\n",
"z = R1 + R2*(R3 + R4)/(R2 + R3 + R4)\n",
" #The Th\u00b4evenin equivalent circuit is shown in Figure 33.34 with the 2 ohm resistance connected across terminals PQ.\n",
" #The current flowing in the 2 ohm\u0006 resistance is given by\n",
"R = 2;# in ohms\n",
"I = E/(z + R)\n",
"Imag = abs(I)\n",
" #power P dissipated in the 2 ohm\u0006 resistor is given by\n",
"Pr2 = R*Imag**2\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n power P dissipated in the 2 ohm resistor is \",round(Pr2,2),\" W\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" power P dissipated in the 2 ohm resistor is 0.07 W"
]
}
],
"prompt_number": 7
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 8, page no. 585
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"rv = 30;# in volts\n",
"thetav = 0;# in degrees\n",
"R1 = 15;# in ohm\n",
"R2 = 40;# in ohm\n",
"R3 = 20j;# in ohm\n",
"R4 = 20;# in ohm\n",
"R5 = 5j;# in ohm\n",
"R6 = 5;# in ohm\n",
"R7 = -1j*25;# in ohm\n",
"\n",
" #calculation:\n",
" #voltage\n",
"V = rv*math.cos(thetav*math.pi/180) + 1j*rv*math.sin(thetav*math.pi/180)\n",
" #The R7\u0006 is initially removed from the network, as shown in Figure 33.36\n",
"Z1 = R1\n",
"Z2 = R2\n",
"Z3 = R3 + R4\n",
"Z4 = R5 + R6\n",
" #P.d. between A and C,\n",
"Vac = (Z1/(Z1 + Z4))*V\n",
" #P.d. between B and C,\n",
"Vbc = (Z2/(Z2 + Z3))*V\n",
" #Assuming that point A is at a higher potential than point B, then the p.d. between A and B is\n",
"Vab = Vac - Vbc\n",
" #the open-circuit voltage across AB is given by\n",
"E = Vab\n",
" #Point C is at a potential of V . Between C and A is a volt drop of Vac. Hence the voltage at point A is\n",
"Va = V - Vac\n",
" #Between points C and B is a voltage drop of Vbc. Hence the voltage at point B\n",
"Vb = V - Vbc\n",
" #Replacing the V source with a short-circuit (i.e., zero internal impedance) \n",
" #gives the network shown in Figure 33.37(a). The network is shown redrawn in Figure 33.37(b) \n",
" #and simplified in Figure 33.37(c). Hence the impedance, z, \u2018looking in\u2019 at terminals AB is given by\n",
"z = Z1*Z4/(Z1 + Z4) + Z2*Z3/(Z2 + Z3)\n",
" #The Th\u00b4evenin equivalent circuit is shown in Figure 33.38, where current I is given by\n",
"I = E/(z + R7)\n",
"Imag = abs(I)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the current flowing in the capacitor is \",round(Imag,2),\" A in direction from B to A.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the current flowing in the capacitor is 0.13 A in direction from B to A."
]
}
],
"prompt_number": 8
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 9, page no. 589
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"V = 5;# in volts\n",
"R1 = 2;# in ohm\n",
"R2 = 3;# in ohm\n",
"R3 = -1j*3;# in ohm\n",
"R4 = 2.8;# in ohm\n",
"\n",
" #calculation:\n",
" #The branch containing the R4 is short-circuited, as shown in Figure 33.48.\n",
" #The R2 in parallel with a short-circuit is the same as R2 in parallel with 0 ohm \n",
" #giving an equivalent impedance of\n",
"Z1 = R2*0/(R3 + 0)\n",
" #Hence the network reduces to that shown in Figure 33.49, where\n",
"Isc = V/R1\n",
" #If the Voltage source is removed from the network the input impedance, z, \u2018looking-in\u2019 \n",
" #at a break made in AB of Figure 33.48 gives\n",
"z = R1*R2/(R1 + R2)\n",
" #The Norton equivalent network is shown in Figure 33.51, where current I is given by\n",
"I = (z/(z + R4 + R3))*Isc\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the current flowing in the capacitor is \",round(I.real,2),\" + (\", round(I.imag,2),\")i A\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the current flowing in the capacitor is 0.48 + ( 0.36 )i A"
]
}
],
"prompt_number": 9
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 10, page no. 589
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"V1 = 20;# in volts\n",
"V2 = 10;# in volts\n",
"R1 = 2;# in ohm\n",
"R2 = 1.5;# in ohm\n",
"R3 = 2.95j;# in ohm\n",
"R4 = 3;# in ohm\n",
"\n",
" #calculation:\n",
" #The inductive branch is initially short-circuited, as shown in Figure 33.53.\n",
" #From Figure 33.53,\n",
"I1 = V1/R1\n",
"I2 = V2/R4\n",
"Isc = I1 + I2\n",
" #If the voltage sources are removed, the impedance, z, \u2018looking in\u2019 at a break made in AB is given by\n",
"z = R1*R4/(R1 + R4)\n",
" #The Norton equivalent network is shown in Figure 33.54, where current I is given by\n",
"I = (z/(z + R2 + R3))*Isc\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the current flowing in the inductive branch is \",round(I.real,2),\" + (\",round( I.imag,2),\")i A\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the current flowing in the inductive branch is 2.7 + ( -2.95 )i A"
]
}
],
"prompt_number": 10
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 11, page no. 590
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"V = 10;# in volts\n",
"R1 = 1;# in ohm\n",
"R2 = 4;# in ohm\n",
"R3 = 4;# in ohm\n",
"R4 = -2j;# in ohm\n",
"\n",
"#calculation:\n",
"Isc = V/R3\n",
"z = 1/(1/R2 + 1/R3 + 1/R4)\n",
"I = (z/(R1 + z))*Isc\n",
"pd1 = abs(I)*R1\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the magnitude of the p.d. across the 1 ohm resistor is \",round(pd1, 2),\"V\"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the magnitude of the p.d. across the 1 ohm resistor is 1.58 V"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 12, page no. 591
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"rv = 20;# in volts\n",
"thetav = 0;# in degrees\n",
"R1 = 2;# in ohm\n",
"R2 = 4;# in ohm\n",
"R3 = 3j;# in ohm\n",
"R4 = -1j*3;# in ohm\n",
"\n",
" #calculation:\n",
" #voltage\n",
"V = rv*math.cos(thetav*math.pi/180) + 1j*rv*math.sin(thetav*math.pi/180)\n",
" #Terminals AB are initially short-circuited, as shown in Figure 33.61.\n",
" #The circuit impedance Z presented to the voltage source is given by\n",
"Z = R1 + R4*(R2 + R3)/(R2 + R3 + R4)\n",
" #Thus current I in Figure 33.61 is given by\n",
"I = V/Z\n",
"Isc = ((R2 + R3)/(R2 + R3 + R4))*I\n",
" #Removing the voltage source of Figure 33.60 gives the network Figure 33.62 of Figure 33.62. \n",
" #Impedance, z, \u2018looking in\u2019 at terminals AB is given by\n",
"z = R4 + R1*(R2 + R3)/(R2 + R3 + R1)\n",
" #The Norton equivalent network is shown in Figure 33.63.\n",
"R = 5;# in ohms\n",
" #Current IL\n",
"IL = (z/(z + R))*Isc\n",
"ILmag = abs(IL)\n",
" #the power dissipated in the 5 ohm resistor is\n",
"Pr5 = R*ILmag**2\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the power dissipated in the 5 ohm resistor is \",round(Pr5,2),\" W\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the power dissipated in the 5 ohm resistor is 22.54 W"
]
}
],
"prompt_number": 12
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 13, page no. 592
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import numpy\n",
"import cmath\n",
"#initializing the variables:\n",
"rv1 = 5;# in volts\n",
"rv2 = 10;# in volts\n",
"thetav1 = 45;# in degrees\n",
"thetav2 = 0;# in degrees\n",
"R1 = 8;# in ohm\n",
"R2 = 5;# in ohm\n",
"R3 = 3j;# in ohm\n",
"R4 = 4;# in ohm\n",
"\n",
" #calculation:\n",
" #voltage\n",
"V1 = rv1*math.cos(thetav1*math.pi/180) + 1j*rv1*math.sin(thetav1*math.pi/180)\n",
"V2 = rv2*math.cos(thetav2*math.pi/180) + 1j*rv2*math.sin(thetav2*math.pi/180)\n",
" #Terminals PQ are initially short-circuited, as shown in Figure 33.65.\n",
" #Currents I1 and I2 are shown labelled. Kirchhoff\u2019s laws are used.\n",
" #For loop ABCD, and moving anticlockwise,\n",
" #I1*(R2 + R3 + R4) + I2*(R3 + R4) = V2\n",
" #For loop DPQC, and moving clockwise,\n",
" #R2*I1 - R1*I2 = V2 - V1\n",
" #Solving Equations by using determinants gives\n",
"d1 = [[V2, (R3 + R4)],[(V2 - V1), -1*R1]]\n",
"D1 = numpy.linalg.det(d1)\n",
"d2 = [[(R2 + R3 + R4), V2],[R2, (V2 - V1)]]\n",
"D2 = numpy.linalg.det(d2)\n",
"d = [[(R2 + R3 + R4), (R3 + R4)],[R2, -1*R1]]\n",
"D = numpy.linalg.det(d)\n",
"I1 = D1/D\n",
"I2 = D2/D\n",
" #the short-circuit current Isc\n",
"Isc = I2\n",
" #The impedance, z, \u2018looking in\u2019 at a break made between P and Q is given by\n",
"z = R1 + R2*(R3 + R4)/(R2 + R3 + R4)\n",
" #The Norton equivalent circuit is shown in Figure 33.66, where current I is given by\n",
"R = 2;#in ohm\n",
"I = (z/(z + R))*Isc\n",
"Imag = abs(I)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the magnitude of the current flowing 5 ohm resistor is \",round(Imag,2),\" A\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the magnitude of the current flowing 5 ohm resistor is 0.19 A"
]
}
],
"prompt_number": 13
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 15, page no. 595
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"E1 = 12;# in volts\n",
"E2 = 24;# in volts\n",
"Z1 = 3;# in ohm\n",
"Z2 = 2;# in ohm\n",
"R1 = 4j;# in ohm\n",
"R2 = 1.8;# in ohm\n",
"\n",
"#calculation:\n",
"Z3 = R1 + R2\n",
" #For the branch containing the E1 source, conversion to a Norton equivalent network gives\n",
"Isc1 = E1/Z1\n",
" #For the branch containing the E2 source, conversion to a Norton equivalent circuit gives\n",
"Isc2 = E2/Z2\n",
" #Thus Figure 33.73 shows a network equivalent to Figure 33.72. From Figure 33.73, \n",
" #the total short-circuit current\n",
"Isc = Isc1 + Isc2\n",
" #the total impedance is given by\n",
"z = Z1*Z2/(Z1 + Z2)\n",
" #Thus Figure 33.73 simplifies to Figure 33.74.\n",
" #The open-circuit voltage across AB of Figure 33.74, E\n",
"E = Isc*z\n",
" #the impedance \u2018looking in\u2019 at AB,is z\n",
" #the Th\u00b4evenin equivalent circuit is as shown in Figure 33.75.\n",
"R = 1.8 + 4j;# in ohm\n",
" #when R impedance is connected to terminals AB of Figure 33.75, the current I flowing is given by\n",
"I = E/(z + R)\n",
"Imag = abs(I)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the magnitude of the current flowing (1.8 + i4) ohm resistor is \",round(Imag,2),\" A\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the magnitude of the current flowing (1.8 + i4) ohm resistor is 3.84 A"
]
}
],
"prompt_number": 14
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 16, page no. 596
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"V1 = 5;# in volts\n",
"V2 = 10;# in volts\n",
"i = 0.001;# in Amperes\n",
"R1 = 1000;# in ohm\n",
"R2 = 4000;# in ohm\n",
"R3 = 2000;# in ohm\n",
"R4 = 200;# in ohm\n",
"R5 = -1j*4000;# in ohm\n",
"\n",
" #calculation: \n",
" #For the branch containing the V1 source, conversion to a Norton equivalent network gives\n",
"Isc1 = V1/R1\n",
"z1 = R1\n",
" #For the branch containing the V2 source, conversion to a Norton equivalent circuit gives\n",
"Isc2 = V2/R2\n",
"z2 = R2\n",
" #Thus the circuit of Figure 33.76 converts to that of Figure 33.77.\n",
" #The above two Norton equivalent networks shown in Figure 33.77 may be combined, \n",
" #since the total short-circuit current is\n",
"Isc = Isc1 + Isc2\n",
" #the total impedance is given by\n",
"Z1 = z1*z2/(z1 + z2)\n",
" #Both of the Norton equivalent networks shown in Figure 33.78 may be converted to Th\u00b4evenin equivalent circuits. \n",
" #Open-circuit voltage across CD is\n",
"Ecd = Isc*Z1\n",
" #the impedance \u2018looking in\u2019 at CD is Z1\n",
" #Open-circuit voltage across EF\n",
"Eef = i*R3\n",
" #the impedance \u2018looking in\u2019 Figure 33.79 at EF\n",
"Z2 = R3\n",
" #Thus Figure 33.78 converts to Figure 33.79.\n",
" #Combining the two Th\u00b4evenin circuits gives e.m.f.\n",
"E = Ecd - Eef\n",
" #impedance z\n",
"z = Z1 + Z2\n",
" #the Th\u00b4evenin equivalent circuit for terminals AB of Figure 33.76 is as shown in Figure 33.80.\n",
"Z3 = R4 + R5\n",
" #If an impedance Z3 is connected across terminals AB, then the current I flowing is given by\n",
"I = E/(z + Z3)\n",
"Imag = abs(I)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the current in the capacitive branch is \", Imag*1000,\"mA\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the current in the capacitive branch is 0.8 mA"
]
}
],
"prompt_number": 15
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 17, page no. 597
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"import cmath\n",
"#initializing the variables:\n",
"V = 5;# in volts\n",
"i = 0.004;# in Amperes\n",
"R1 = 2000;# in ohm\n",
"R2 = 1000j;# in ohm\n",
"\n",
"#calculation: \n",
" #Converting the Th\u00b4evenin circuit to a Norton network gives\n",
"Isc1 = V/R2\n",
" #Thus Figure 33.81 converts to that shown in Figure 33.82. \n",
" #The two Norton equivalent networks may be combined, giving\n",
"Isc = Isc1 + i\n",
"z = R1*R2/(R1 + R2)\n",
" #This results in the equivalent network shown in Figure 33.83. \n",
" #Converting to an equivalent Th\u00b4evenin circuit gives open circuit e.m.f. across AB,\n",
"E = Isc*z\n",
" #Thus the The\u00b4venin equivalent circuit is as shown in Figure 33.84.\n",
"R = 600 - 800j;# in ohms\n",
" #When a R impedance is connected across AB, the current I flowing is given by\n",
"I = E/(z + R)\n",
"Imag = abs(I)\n",
" #the power dissipated in the R resistor is\n",
"PR = R.real*Imag**2\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the power dissipated in the (600 - i800) ohm resistor is \",round(PR*1000,2),\"mW\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the power dissipated in the (600 - i800) ohm resistor is 19.68 mW"
]
}
],
"prompt_number": 16
}
],
"metadata": {}
}
]
}