{
"metadata": {
"name": "",
"signature": "sha256:9a0a38a1ad49042ffadb423caa0f240dc4106abfcf6ac9eb25cdb67cab101f0b"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 4 , DC Resistive Circuits "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.1 , Page Number 53"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"R1 = 220 #Resistance (in ohm)\n",
"R2 = 470 #Resistance (in ohm)\n",
"R3 = 560 #Resistance (in ohm)\n",
"R4 = 910 #Resistance (in ohm)\n",
"\n",
"#Calculation\n",
"\n",
"R = R1 + R2 + R3 + R4 #Net Resistance (in ohm)\n",
"\n",
"#Result\n",
"\n",
"print \"Total resistance of circuit is \",R,\" ohm.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Total resistance of circuit is 2160 ohm.\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.2 , Page Number 53"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"R1 = 4 #Resistance (in kilo-ohm)\n",
"R2 = 6 #Resistance (in kilo-ohm)\n",
"R3 = 2 #Resistance (in kilo-ohm)\n",
"\n",
"#Calculation\n",
"\n",
"R = R1 + R2 + R3 #Equivalent Resistance(in kilo-ohm)\n",
"\n",
"#Result\n",
"\n",
"print \"Equivalent Resistance is \",R,\" kilo-ohm.\" "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Equivalent Resistance is 12 kilo-ohm.\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.3 , Page Number 54"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"R1 = 250 #Resistance (in ohm)\n",
"R3 = 375 #Resistance (in ohm)\n",
"I = 50 * 10**-3 #Current (in Ampere)\n",
"V = 40 #Voltage (in volts)\n",
"\n",
"#Calculation\n",
"\n",
"R = V/I #Equivalent Resistance (in ohm)\n",
"R2 = R - (R1 + R3) #Resistance R2 (in ohm)\n",
"\n",
"#Result\n",
"\n",
"print \"The Total Resistance is \",R,\" ohm.\\nThe value of R2 is \",R2,\" ohm.\" "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The Total Resistance is 800.0 ohm.\n",
"The value of R2 is 175.0 ohm.\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.4 , Page Number 55"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"I = 250 * 10**-3 #Current (in Ampere)\n",
"R = 1.5 * 10**3 #Resistance (in ohm)\n",
"\n",
"#Calculation\n",
"\n",
"Vs = I * R #Source voltage (in volts)\n",
"I1 = 0.75 * I #New current (in Ampere)\n",
"R1 = Vs / I1 #New Resistance (in ohm)\n",
"R2 = R1 - R #Resistance to be added (in ohm)\n",
"\n",
"#Result\n",
"\n",
"print R2,\" ohm Resistance must be added in order to accomplish the reduction in current.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"500.0 ohm Resistance must be added in order to accomplish the reduction in current.\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.5 , Page Number 55"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"R1 = 2.2 #Resistance (in kilo-ohm)\n",
"R2 = 1 #Resistance (in kilo-ohm)\n",
"R3 = 3.3 #Resistance (in kilo-ohm)\n",
"V2 = 6 #Voltage drop across R2 (in volts)\n",
"\n",
"#Calculation\n",
"\n",
"I = V2 / R2 #Current in the circuit (in milli-Ampere) \n",
"V1 = R1 * I #Voltage drop across R1 (in volts)\n",
"V3 = R3 * I #Voltage drop across R3 (in volts)\n",
"\n",
"#Result\n",
"print \"The voltage drop across R1 is \",V1,\"V and the voltage drop across R3 is \",V3,\" V.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The voltage drop across R1 is 13.2 V and the voltage drop across R3 is 19.8 V.\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.6 , Page Number 57"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"V = 30.0 #Source voltage (in volts)\n",
"R1 = 20.0 #Resistance (in kilo-ohm)\n",
"R2 = 10.0 #Resistance (in kilo-ohm)\n",
"R3 = 70.0 #Resistance (in kilo-ohm)\n",
"VD = 0.0 #Voltage at D (in volts)\n",
"\n",
"#Calculation\n",
"\n",
"R = R1 + R2 + R3 #Equivalent Resistance (in kilo-ohm)\n",
"V1 = (R1 / R) * V #Voltage drop across R1 (in volts)\n",
"V2 = (R2 / R) * V #Voltage drop across R2 (in volts)\n",
"V3 = (R3 / R) * V #Voltage drop across R3 (in volts)\n",
"VC = V3 + VD #Voltage at node C (in volts) \n",
"VB = V2 + VC #Voltage at node B (in volts)\n",
"VA = V1 + VB #Voltage at node A (in volts)\n",
"\n",
"#Result\n",
"\n",
"print \"The Voltage drop across R1 is \",V1,\" V.\\nThe Voltage drop across R2 is \",V2,\" V.\\nThe Voltage drop across R3 is \",V3,\" V.\"\n",
"print \"Voltage at node A is \",VA,\" V.\\nVoltage at node B is \",VB,\" V.\\nVoltage at node is \",VC,\" V.\" "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The Voltage drop across R1 is 6.0 V.\n",
"The Voltage drop across R2 is 3.0 V.\n",
"The Voltage drop across R3 is 21.0 V.\n",
"Voltage at node A is 30.0 V.\n",
"Voltage at node B is 24.0 V.\n",
"Voltage at node is 21.0 V.\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.7 , Page Number 58"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"R2 = 100 #Resistance R2 (in ohm)\n",
"I = 0.3 #Current (in Ampere)\n",
"VT = 120 #Voltage (in volts)\n",
"\n",
"#Calculation\n",
"\n",
"RT = VT / I #Total Resistance (in ohm)\n",
"R1 = RT - R2 #Resistance R1 (in ohm)\n",
"P1 = I**2 * R1 #Power dissipated by R1 (in watt)\n",
"P2 = I**2 * R2 #Power dissipated by R2 (in watt)\n",
"\n",
"#Result\n",
"\n",
"print \"The power dissipated by R1 is \",P1,\" W.\\nThe power dissipated by R2 is \",P2,\" W.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The power dissipated by R1 is 27.0 W.\n",
"The power dissipated by R2 is 9.0 W.\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.8 , Page Number 60"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"V = 6 #Voltage (in volts)\n",
"R1 = 1 #Resistance (in ohm)\n",
"R2 = 2 #Resistance (in ohm)\n",
"R3 = 3 #Resistance (in ohm)\n",
"\n",
"#Case (a):\n",
"\n",
"#Calculation\n",
"\n",
"RT = R1 + R2 + R3 #Equivalent Resistance (in ohm)\n",
"I = V / RT #Current (in Ampere)\n",
"P = I**2 * RT #Power dissipated (in watt)\n",
"\n",
"#Result\n",
"\n",
"print \"Power dissipated in the entire circuit is\",P,\" W.\"\n",
"\n",
"#Case (b):\n",
"\n",
"#Calculation\n",
"\n",
"RT = R1 + R2 #Equivalent Resistance (in ohm)\n",
"I = V / RT #Current (in Ampere)\n",
"P = I**2 * RT #Power dissipated (in watt)\n",
"\n",
"#Result\n",
"\n",
"print \"Power dissipated in the circuit when R2 is shortened is\",P,\" W.\"\n",
"\n",
"#Case (c):\n",
"\n",
"#Calculation\n",
"\n",
"R = R1 #Resistance (in ohm)\n",
"I = V / R #Current (in Ampere)\n",
"P = I**2 * R #Power dissipated (in watt)\n",
"\n",
"print \"Power dissipated in the circuit when R3 and R2 is shortened is\",P,\" W.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Power dissipated in the entire circuit is 6 W.\n",
"Power dissipated in the circuit when R2 is shortened is 12 W.\n",
"Power dissipated in the circuit when R3 and R2 is shortened is 36 W.\n"
]
}
],
"prompt_number": 8
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.9 , Page Number 61"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"V = 10.0 #Voltage (in volts)\n",
"R1 = 10**6 #Resistance (in ohm)\n",
"R2 = 10 * 10**3 #Resistance (in ohm)\n",
"\n",
"#Case (a):\n",
"\n",
"#Calculation\n",
"\n",
"RT = R1 + R2 #Total Resistance (in ohm)\n",
"I = V / RT #Current (in Ampere)\n",
"\n",
"#Result\n",
"\n",
"print \"Current through the circuit is \",I,\" A.\"\n",
"\n",
"#Case (b):\n",
"\n",
"#Calculation\n",
"\n",
"RT = R1 #Total Resistance (in ohm)\n",
"I = V / RT #Current (in Ampere)\n",
"\n",
"#Result\n",
"\n",
"print \"Current through circuit when R2 is shortened is \",I,\" A.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Current through the circuit is 9.90099009901e-06 A.\n",
"Current through circuit when R2 is shortened is 1e-05 A.\n"
]
}
],
"prompt_number": 9
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.10 , Page Number 62"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"IT = 750 #Current (in milli-Ampere)\n",
"I1 = 200 #Current (in milli-Ampere)\n",
"I3 = 150 #Current (in milli-Ampere)\n",
"\n",
"#Calculation\n",
"\n",
"I2 = IT - (I1 + I3) #Current through R2 (in milli-Ampere)\n",
"\n",
"#Result\n",
"\n",
"print \"Current drawn by R2 branch is \",I2,\" mA.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Current drawn by R2 branch is 400 mA.\n"
]
}
],
"prompt_number": 10
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.11 , Page Number 63"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"V = 12.0 #Voltage (in volts)\n",
"R1 = 4.0 #Resistance (in ohm)\n",
"R2 = 6.0 #Resistance (in ohm)\n",
"R3 = 12.0 #Resistance (in ohm)\n",
"\n",
"#Calculation\n",
"\n",
"Req = 1/(1/R1 + 1/R2 + 1/R3) #Equivalent resistance (in ohm) \n",
"I1 = V/R1\n",
"I2 = V/R2\n",
"I3 = V/R3\n",
"\n",
"#Result\n",
"\n",
"print \"The Equivalent Resistance is \",Req,\" ohm.\\nThe Current through R1 , R2 , R3 are \",I1,\" A, \",I2,\" A, \",I3,\" A.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The Equivalent Resistance is 2.0 ohm.\n",
"The Current through R1 , R2 , R3 are 3.0 A, 2.0 A, 1.0 A.\n"
]
}
],
"prompt_number": 11
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.12 , Page Number 64"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"R1 = R2 = 10 #Resistances (in kilo-ohm) \n",
"\n",
"#Calculation\n",
"\n",
"Req = R1*R2 / (R1 + R2) #Equivalent Resistance (in kilo-ohm) \n",
"\n",
"#Result\n",
"\n",
"print \"The equivalent resistance is \",Req,\" kilo-ohm.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The equivalent resistance is 5 kilo-ohm.\n"
]
}
],
"prompt_number": 12
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.13 , Page Number 65"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"R1 = 4.0 #Resistance (in ohm)\n",
"R2 = 12.0 #Resistance (in ohm)\n",
"V = 6.0 #Voltage (in volts)\n",
"\n",
"#Calculation\n",
"\n",
"Req = R1*R2/(R1 + R2) #Equivalent Resistance (in ohm)\n",
"IT = V / Req #Total Current (in Ampere)\n",
"I1 = R2 / (R1 + R2) * IT #Current through R1 \n",
"I2 = R1 / (R1 + R2) * IT #Current through R2\n",
"\n",
"#Result\n",
"\n",
"print \"Current through R1 is \",I1,\" A and current through R2 is \",I2,\" A.\" "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Current through R1 is 1.5 A and current through R2 is 0.5 A.\n"
]
}
],
"prompt_number": 13
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.14 , Page Number 66"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"PR1 = 1.0/8 #1/8 watt resistor (in watt)\n",
"PR2 = 1.0/4 #1/4 watt resistor (in watt)\n",
"PR3 = 1.0/2 #1/2 watt resistor (in watt)\n",
"RT = 2400.0 #total resistance (in ohm)\n",
"\n",
"#Calculation\n",
"\n",
"PT = PR1 + PR2 + PR3 #Total power dissipated (in watt)\n",
"I = (PT/RT)**0.5 #Current (in Ampere)\n",
"Vs = I * RT #Applied voltage (in volts)\n",
"R1 = PR1 / I**2 #R1 resistor (in ohm) \n",
"R2 = PR2 / I**2 #R2 resistor (in ohm)\n",
"R3 = PR3 / I**2 #R3 resistor (in ohm) \n",
"\n",
"#Result\n",
"\n",
"print \"Current in the circuit is \",round(I,3),\" A.\\nApplied Voltage is \",round(Vs,3),\" V.\\nValue of R1 is \",round(R1,3),\" ohm.\\nValue of R2 is \",round(R2,3),\" ohm.\\nValue of R3 is \",round(R3,3),\" ohm.\"\n",
"\n",
"#Slight variations due to higher precision."
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Current in the circuit is 0.019 A.\n",
"Applied Voltage is 45.826 V.\n",
"Value of R1 is 342.857 ohm.\n",
"Value of R2 is 685.714 ohm.\n",
"Value of R3 is 1371.429 ohm.\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4.15 , Page Number 68"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variables\n",
"\n",
"V = 6.0 #Applied voltage (in volts)\n",
"R0 = 0.2 #Resistance (in ohm) \n",
"R1 = 2.0 #Resistance (in ohm)\n",
"R2 = 3.0 #Resistance (in ohm)\n",
"R3 = 6.0 #Resistance (in ohm)\n",
"\n",
"#Calculation\n",
"\n",
"Req = 1 / (1/R1 + 1/R2 + 1/R3) #Equivalent Resistance (in ohm) \n",
"R = R0 + Req #Total Resistance (in ohm)\n",
"I = V/R #Current (in Ampere) \n",
"V0 = I * R0 #Voltage drop across R0 (in volts)\n",
"Veq = V - V0 #Voltage drop across Req (in volts)\n",
"I1 = Veq / R1 #Current through R1 (in Ampere)\n",
"I2 = Veq / R2 #Current through R2 (in Ampere) \n",
"I3 = Veq / R3 #Current through R3 (in Ampere)\n",
"P = V * I #Power supplied by the voltage source (in volts)\n",
"I0 = V/R0 #Current in case of 'Short' across DE (in Ampere)\n",
"P0 = V * I0 #Power dissipated in case of 'Short' (in watt)\n",
"\n",
"#Result\n",
"\n",
"print \"Total Resistance is \",R,\" ohm.\"\n",
"print \"Branch Currents :\\nThrough R1 = \",I1,\" A.\\nThrough R2 = \",round(I2,3),\" A.\\nThrough R3 = \",round(I3,3),\" A.\"\n",
"print \"Current supplied by voltage source is \",I,\" A.\"\n",
"print \"Power supplied by the voltage source is \",P,\" W.\"\n",
"print \"Current supplied in case of 'Short' across DE is \",I0,\" A.\"\n",
"print \"Power supplied in case of 'Short' acorss DE is \",P0,\" A.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Total Resistance is 1.2 ohm.\n",
"Branch Currents :\n",
"Through R1 = 2.5 A.\n",
"Through R2 = 1.667 A.\n",
"Through R3 = 0.833 A.\n",
"Current supplied by voltage source is 5.0 A.\n",
"Power supplied by the voltage source is 30.0 W.\n",
"Current supplied in case of 'Short' across DE is 30.0 A.\n",
"Power supplied in case of 'Short' acorss DE is 180.0 A.\n"
]
}
],
"prompt_number": 15
}
],
"metadata": {}
}
]
}