diff options
author | Thomas Stephen Lee | 2015-08-28 16:53:23 +0530 |
---|---|---|
committer | Thomas Stephen Lee | 2015-08-28 16:53:23 +0530 |
commit | db0855dbeb41ecb8a51dde8587d43e5d7e83620f (patch) | |
tree | b95975d958cba9af36cb1680e3f77205354f6512 /Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil | |
parent | 5a86a20b9de487553d4ef88719fb0fd76a5dd6a7 (diff) | |
download | Python-Textbook-Companions-db0855dbeb41ecb8a51dde8587d43e5d7e83620f.tar.gz Python-Textbook-Companions-db0855dbeb41ecb8a51dde8587d43e5d7e83620f.tar.bz2 Python-Textbook-Companions-db0855dbeb41ecb8a51dde8587d43e5d7e83620f.zip |
add books
Diffstat (limited to 'Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil')
-rw-r--r-- | Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter1.ipynb | 2820 | ||||
-rw-r--r-- | Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter2.ipynb | 2884 | ||||
-rw-r--r-- | Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter3.ipynb | 798 | ||||
-rw-r--r-- | Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter4.ipynb | 1093 | ||||
-rw-r--r-- | Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/screenshots/ch1.png | bin | 0 -> 89082 bytes | |||
-rw-r--r-- | Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/screenshots/ch2.png | bin | 0 -> 78975 bytes | |||
-rw-r--r-- | Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/screenshots/ch4.png | bin | 0 -> 63958 bytes |
7 files changed, 7595 insertions, 0 deletions
diff --git a/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter1.ipynb b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter1.ipynb new file mode 100644 index 00000000..492493b8 --- /dev/null +++ b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter1.ipynb @@ -0,0 +1,2820 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:98c010c55a73fcd7194a8654c95e19400d08da7a39526cc08cd5ba710fb56d16"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter1:DC CIRCUITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.1:pg-06"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "alpha0=0.0043; #Assigning values to the parameters\n",
+ "t=50;\n",
+ "R0=40;\n",
+ "R50=R0*(1+0.0043*50); # Calculating the risistance at 50 deg \n",
+ "print\"Resistance at 50 deg C is R50=\",round(R50,2),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance at 50 deg C is R50= 48.6 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.2:pg-06"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R18=12.7; #Assigning values to the parameters\n",
+ "R50=14.3;\n",
+ "t1=18;\n",
+ "t2=50;\n",
+ "alpha0=(R50-R18)/(t2*R18-t1*R50);\n",
+ "alpha18=alpha0/(1+t1*alpha0);\n",
+ "R0=R18/(1+t1*alpha0); # Calculating resistance at 0 deg C\n",
+ "print\"Temperature coefficient at 0 deg C is alpha0=\",\"{:.2e}\".format(alpha0),\"/deg C\"\n",
+ "print\"temperature coefficient at 18 deg C is alpha18=\",\"{:.2e}\".format(alpha18),\"/deg C\"\n",
+ "print\"Resistance at 0 deg C is R0=\",round(R0,2),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature coefficient at 0 deg C is alpha0= 4.24e-03 /deg C\n",
+ "temperature coefficient at 18 deg C is alpha18= 3.94e-03 /deg C\n",
+ "Resistance at 0 deg C is R0= 11.8 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.3:pg-07"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "alpha20=0.00403; #Assigning values to the parameters\n",
+ "t1=20;\n",
+ "t2=60;\n",
+ "R20=28.3;\n",
+ "R60=R20*(1+alpha20*(t2-t1)); # Calculating value of resistance at 60 deg C\n",
+ "print\"Resistance at 60 deg C is R60=\",round(R60,2),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance at 60 deg C is R60= 32.86 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.4:pg-07"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R15=80; #Assigning values to the parameters\n",
+ "alpha0=0.004;\n",
+ "t1=15;\n",
+ "t2=50;\n",
+ "R0=R15/(1+alpha0*t1); # Calculating resistance at 0 deg C\n",
+ "R50=R0*(1+alpha0*t2); # Calculating resistance at 50 deg C\n",
+ "print\"Resistance value at 0 deg C\",round(R0,2),\"ohms\"\n",
+ "print\"Resistance value at 50 deg C\",round(R50,2),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance value at 0 deg C 75.47 ohms\n",
+ "Resistance value at 50 deg C 90.57 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.5:pg-08"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R10=80; #Assigning values to the parameters\n",
+ "R60=96.6;\n",
+ "t1=10;\n",
+ "t2=60;\n",
+ "alpha0=(R60-R10)/(t2*R10-t1*R60);\n",
+ "print\"temperature coefficient at 0 deg C is alpha0=\",\"{:.2e}\".format(alpha0),\"/deg C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "temperature coefficient at 0 deg C is alpha0= 4.33e-03 /deg C\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.6:pg-08"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "t1=20; #Assigning values to the parameters\n",
+ "R1=45;\n",
+ "R2=48.5;\n",
+ "alpha0=0.004;\n",
+ "t2=((R2*(1+alpha0*t1))-45)/(alpha0*R1); #calculating average temperature\n",
+ "print\"Average temperature of winding at the end of the run when the resistance increases is t2=\",round(t2,2),\"deg C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average temperature of winding at the end of the run when the resistance increases is t2= 41.0 deg C\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.7:pg-08"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "t1=20.0; #Assigning values to the parameters\n",
+ "R1=18.0;\n",
+ "t2=50.0;\n",
+ "R2=20.0;\n",
+ "R3=21.0;\n",
+ "ts=15.0;\n",
+ "alpha0=(R2-R1)/(t2*R1-t1*R2);\n",
+ "t=((R3*(1+alpha0*20))-(R1))/(alpha0*R1);\n",
+ "print\" Temperature Coefficient at 0 deg C is t=\",round(t,2),\"deg C\"\n",
+ "trise=t-ts;\n",
+ "print\"mean temperature rise is trise=\",round(trise,2),\"deg C\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Temperature Coefficient at 0 deg C is t= 65.0 deg C\n",
+ "mean temperature rise is trise= 50.0 deg C\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.8:pg-15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=5; #Assigning values to the parameters\n",
+ "R2=7;\n",
+ "R3=8;\n",
+ "Req=R1+R2+R3; # Calculating equivalent resistance\n",
+ "V=100;\n",
+ "I=V/Req;\n",
+ "V1=I*R1;\n",
+ "V2=I*R2;\n",
+ "V3=I*R3;\n",
+ "print\"Voltage across 5 Ohm resistor is V1\",round(V1,2),\"Volts\"\n",
+ "print\"Voltage across 7 Ohm resistor is V2\",round(V2,2),\"Volts\"\n",
+ "print\"Voltage across 8 Ohm resistor is V3\",round(V3,2),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage across 5 Ohm resistor is V1 25.0 Volts\n",
+ "Voltage across 7 Ohm resistor is V2 35.0 Volts\n",
+ "Voltage across 8 Ohm resistor is V3 40.0 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.9:pg-16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V=100; #Assigning values to the parameters\n",
+ "R1=5;\n",
+ "R2=10;\n",
+ "R3=20;\n",
+ "I1=V/R1;\n",
+ "I2=V/R2;\n",
+ "I3=V/R3;\n",
+ "Itot=I1+I2+I3; #Calculating total current\n",
+ "print\"Current through 5 Ohm resistor is I1=\",round(I1,2),\"Amperes\"\n",
+ "print\"Current through 10 Ohm resistor is I2=\",round(I2,2),\"Amperes\"\n",
+ "print\"Current through 20 Ohm resistor is I3=\",round(I3,2),\"Amperes\"\n",
+ "print\"Total current is Itot=\",round(Itot,2),\"Amperes\"\n",
+ "P=Itot*V;\n",
+ "print\"Power drawn from the source is P=\",round(P,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 5 Ohm resistor is I1= 20.0 Amperes\n",
+ "Current through 10 Ohm resistor is I2= 10.0 Amperes\n",
+ "Current through 20 Ohm resistor is I3= 5.0 Amperes\n",
+ "Total current is Itot= 35.0 Amperes\n",
+ "Power drawn from the source is P= 3500.0 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.10:pg-16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V=100; # Assigning values to the parameters\n",
+ "R1=5;\n",
+ "R2=10;\n",
+ "R3=15;\n",
+ "R4=20;\n",
+ "Req=R1+R2+R3+R4; #Equivalent resistance\n",
+ "V1=R1*V/Req;\n",
+ "V2=R2*V/Req;\n",
+ "V3=R3*V/Req;\n",
+ "V4=R4*V/Req;\n",
+ "print\"Voltage across 5 Ohms resistor is V1=\",round(V1,2),\"Volts\"\n",
+ "print\"Voltage across 10 Ohms resistor is V2\",round(V2,2),\"Volts\"\n",
+ "print\"Voltage across 15 Ohms resistor is V3=\",round(V3,2),\"Volts\"\n",
+ "print\"Voltage across 20 Ohms resistor is V4\",round(V4,2),\"Volts\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage across 5 Ohms resistor is V1= 10.0 Volts\n",
+ "Voltage across 10 Ohms resistor is V2 20.0 Volts\n",
+ "Voltage across 15 Ohms resistor is V3= 30.0 Volts\n",
+ "Voltage across 20 Ohms resistor is V4 40.0 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.11:pg-17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "Itot=12.0; #Assigning values to parameters\n",
+ "R1=4.0;\n",
+ "R2=12.0;\n",
+ "R3=6.0;\n",
+ "Req=1.0/((1/R1)+(1/R2)+(1/R3)); #Equivalent resistance\n",
+ "V=Itot*Req;\n",
+ "I1=V/R1;\n",
+ "I2=V/R2;\n",
+ "I3=V/R3;\n",
+ "print\"Potential Difference across the parallel circuit is V=\",round(V,2),\"Volts\"\n",
+ "print\"Current through 4 Ohm resistor is I1=\",round(I1),\"A\"\n",
+ "print\"Current through 12 Ohm resistor is I2=\",round(I2),\"A\"\n",
+ "print\"Current through 6 Ohm resistor is I3=\",round(I3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Potential Difference across the parallel circuit is V= 24.0 Volts\n",
+ "Current through 4 Ohm resistor is I1= 6.0 A\n",
+ "Current through 12 Ohm resistor is I2= 2.0 A\n",
+ "Current through 6 Ohm resistor is I3= 4.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.12:pg-17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "I=5; #Assigning values to the parameters\n",
+ "I1=2;\n",
+ "R2=6;\n",
+ "I2=I-I1;\n",
+ "V=R2*I2;\n",
+ "R1=V/I1;\n",
+ "P=I1*I1*R1+I2*I2*R2;\n",
+ "print\"Value of R1=\",round(R1,2),\"ohms\"\n",
+ "print\"Power absorbed by the circuit is P=\",round(P,2),\"Watts\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of R1= 9.0 ohms\n",
+ "Power absorbed by the circuit is P= 90.0 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.13:pg-18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=8.0; # Assigning values to resistors\n",
+ "R2=6.0;\n",
+ "R3=3.0;\n",
+ "R4=18.0;\n",
+ "R5=5.0;\n",
+ "R=1/((1/R2)+(1/R3)); #simplifying the network\n",
+ "Rs1=R+R4;\n",
+ "Rs2=1/((1/Rs1)+(1/R5));\n",
+ "Rs3=R1+Rs2;\n",
+ "V=60;\n",
+ "I=V/Rs3; # Current through the simplified network\n",
+ "print\"Current through 8 Ohm resistor is I=\",round(I,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 8 Ohm resistor is I= 5.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.14:pg-19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=1.0; # Assigning values to resistors\n",
+ "R2=2.0;\n",
+ "R3=1.0;\n",
+ "R4=1.0;\n",
+ "R=R3+R4; # Simplifying the network\n",
+ "Req=1+(1/((1/R2)+(1/R)));\n",
+ "V=100;\n",
+ "I=V/Req;\n",
+ "I2=I*(R/(R+R2));\n",
+ "print\"Ammeter reading is=\",round(I2,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ammeter reading is= 25.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.15:pg-20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=1.0; # Assigning values to the parameters\n",
+ "R2=5.0;\n",
+ "R3=4.0;\n",
+ "R4=8.0;\n",
+ "R5=6.0;\n",
+ "R6=2.0;\n",
+ "R=R1+R2; #series connection\n",
+ "Ra=R5+R6;\n",
+ "Rb=1/((1/R4)+(1/Ra)) ;\n",
+ "Rc=R3+Rb;\n",
+ "Req=1/((1/R)+(1/Rc));\n",
+ "print\"Effective resistance is Req=\",round(Req,2),\"ohms\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Effective resistance is Req= 3.43 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.16:pg-21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V=24.0; #Assigning values to parameters\n",
+ "R1=4.0;\n",
+ "R2=8.0;\n",
+ "R3=6.0;\n",
+ "R4=12.0;\n",
+ "Ra=1/((1/R1)+(1/R4)); # Simplifying the network\n",
+ "Rb=1/((1/R2)+(1/R3));\n",
+ "Rc=1/((1/Ra)+(1/Rb));\n",
+ "I=V/Rc;\n",
+ "print\"Battery current is I=\",round(I,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Battery current is I= 15.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.17:pg-22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=15.0; #Assigning values to parameters\n",
+ "R2=6.0;\n",
+ "R3=30.0;\n",
+ "R4=3.0;\n",
+ "R5=4.0;\n",
+ "V=10.0;\n",
+ "Ra=R1+R2; # Simplifying the circuit\n",
+ "Rb=R3+R4;\n",
+ "Rc=1/((1/Ra)+(1/Rb));\n",
+ "Req=Rc+R5;\n",
+ "I=V/Req;\n",
+ "print\"Battery current is I=\",round(I,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Battery current is I= 0.59 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.18:pg-23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=15.0; #Assigning parameters\n",
+ "R2=6.0;\n",
+ "R3=4.0;\n",
+ "R4=30.0;\n",
+ "R5=3.0;\n",
+ "Ra=1/((1/R2)+(1/R5)); # Simplifying the circuit\n",
+ "Rb=R3+Ra;\n",
+ "Rc=1/((1/R1)+(1/R4));\n",
+ "Req=Rb+Rc;\n",
+ "print\"Effective resistance is Req=\",round(Req,2),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Effective resistance is Req= 16.0 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.19:pg-24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V=30.0; #Assignign values to parameters\n",
+ "Rcf=2.0;\n",
+ "Ref=2.0;\n",
+ "Rec=2.4;\n",
+ "Rbc=2.0;\n",
+ "Rac=4.0;\n",
+ "Rae=2.0;\n",
+ "Rab=2.0;\n",
+ "Rad=2.0;\n",
+ "Red=1.0;\n",
+ "Rc=Rab+Rbc; # Simplifying the network\n",
+ "Re=Rcf+Ref;\n",
+ "Ra=1.0/((1.0/Rac)+(1.0/Rc));\n",
+ "Re1=1.0/((1.0/Re)+(1.0/Rec));\n",
+ "Ra1=Ra+Re1;\n",
+ "Re2=1.0/((1.0/Rae)+(1.0/Ra1));\n",
+ "Rd=Red+Re2;\n",
+ "Req=1.0/((1.0/Rd)+(1.0/Rad));\n",
+ "I=V/Req; # Calculation of battery current\n",
+ "print\"Effective resistance is Req=\",round(Req,2),\"ohms\"\n",
+ "print\"Battery current is I=\",round(I,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Effective resistance is Req= 1.06 ohms\n",
+ "Battery current is I= 28.2 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.20:pg-25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=4.0; #Assigning values to parameters\n",
+ "R2=6.0;\n",
+ "R3=8.0;\n",
+ "R4=2.0;\n",
+ "Ra=1/((1/R1)+(1/R2)); # Simplifying the network\n",
+ "Rb=1/((1/R3)+(1/R4));\n",
+ "Req=Ra+Rb;\n",
+ "print\"Effective resistance is Req=\",round(Req,2),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Effective resistance is Req= 4.0 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.21:pg-26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=5.0; #Assigning values to resistors\n",
+ "R2=15.0;\n",
+ "R3=10.0;\n",
+ "R4=10.0;\n",
+ "R5=40.0;\n",
+ "R6=30.0;\n",
+ "R7=20.0;\n",
+ "R8=8.0;\n",
+ "Rc=R2+R3; #Simplifying the network\n",
+ "Re=R4+R5;\n",
+ "Rf=R6+R7;\n",
+ "R=1/((1/Re)+(1/Rf));\n",
+ "Rd=1/((1/R)+(1/Rc));\n",
+ "Req=Rd+R1+R8;\n",
+ "print\"Effective resistance=\",round(Req,2),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Effective resistance= 25.5 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.22:pg-27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V=20; #Assigning values to different parameters\n",
+ "I=1.5;\n",
+ "R1=10;\n",
+ "R2=15;\n",
+ "R3=15;\n",
+ "V10=R1*I;\n",
+ "Vab=V-V10;\n",
+ "I1=Vab/R2;\n",
+ "I2=Vab/R3;\n",
+ "I3=I-I1-I2;\n",
+ "R=Vab/I3;\n",
+ "print\"Value of unknown resistance=\",round(R,2),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of unknown resistance= 6.0 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.23:pg-28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "P=36; #Assigning values to different parameters\n",
+ "V=60;\n",
+ "R1=12;\n",
+ "R2=18;\n",
+ "R3=36;\n",
+ "I1=sqrt(P/R1);\n",
+ "V12=I1*R1;\n",
+ "Vr=V-V12;\n",
+ "I2=V12/R2;\n",
+ "I3=V12/R3;\n",
+ "I=I1+I2+I3;\n",
+ "R=Vr/I;\n",
+ "print\"Value of unknown resistance=\",round(R,3),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of unknown resistance= 11.321 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.24:pg-28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=4.0; #Assigning values to parameters\n",
+ "R2=9.0;\n",
+ "R3=18.0;\n",
+ "R4=2.0;\n",
+ "R5=7.0;\n",
+ "R6=15.0;\n",
+ "V=125.0;\n",
+ "R7=(R2*R3)/(R2+R3);\n",
+ "Ra=R7+R1;\n",
+ "Rb=R5+R4;\n",
+ "R=(1/((1/Ra)+(1/Rb)))+R6;\n",
+ "I=V/R;\n",
+ "I1=(Rb/(Ra+Rb))*I;\n",
+ "IR3=I1*Rb/(Rb+R3);\n",
+ "VR3=IR3*R3;\n",
+ "I2=I-I1;\n",
+ "P4=I2*I2*R5;\n",
+ "print\"current I=\",round(I,2),\"A\"\n",
+ "print\"Current in 15 Ohm resistor=\",round(I1,2),\"A\"\n",
+ "print\"Current in 18 Ohm resistor=\",round(IR3,2),\"A\"\n",
+ "print\"current in 7 ohm resistor=\",round(I2,2),\"A\"\n",
+ "print\"Voltage across 18 Ohm resistor=\",round(VR3,2),\"Volts\"\n",
+ "print\"Power dissipated in 7 Ohm resistor=\",round(P4,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "current I= 6.33 A\n",
+ "Current in 15 Ohm resistor= 3.0 A\n",
+ "Current in 18 Ohm resistor= 1.0 A\n",
+ "current in 7 ohm resistor= 3.33 A\n",
+ "Voltage across 18 Ohm resistor= 18.0 Volts\n",
+ "Power dissipated in 7 Ohm resistor= 77.78 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.26:pg-32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "I1=5.0; #Assigning values to parameters\n",
+ "R1=2.0;\n",
+ "V1=6.0;\n",
+ "I2=2.0;\n",
+ "R2=4.0;\n",
+ "V2=I1*R1; #Performing source transformation\n",
+ "V=V2-V1;\n",
+ "I3=V/R1;\n",
+ "I=I3+I2;\n",
+ "IR2=I*R1/(R1+R2);\n",
+ "print\"Current in 4 ohm resistor using source transformation\",round(IR2,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 4 ohm resistor using source transformation 1.33 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.27:pg-33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V1=6.0; #Assigning values to parameters\n",
+ "R1=2.0;\n",
+ "R2=6.0;\n",
+ "R3=2.0;\n",
+ "I1=3.0;\n",
+ "R4=1.0;\n",
+ "R5=3.0;\n",
+ "I2=V1/R1; #Performing source transformation\n",
+ "R6=(R2*R3)/(R2+R3);\n",
+ "V2=I2*R6;\n",
+ "R7=R6+R1;\n",
+ "I3=V2/R7;\n",
+ "I4=I1+I3;\n",
+ "IR5=I4*R7/(R7+R4+R5);\n",
+ "print\"Current in 3 Ohm resistor using source transformation=\",round(IR5,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 3 Ohm resistor using source transformation= 2.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.28:pg-35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=4.0; #Assigning values to parameters\n",
+ "V1=7.0;\n",
+ "R2=2.0;\n",
+ "R3=4.0;\n",
+ "I1=8.0;\n",
+ "R4=6.0;\n",
+ "R5=9.0;\n",
+ "V2=12.0;\n",
+ "R6=10.0;\n",
+ "I2=V1/R1; #Performing source transformation\n",
+ "V3=I1*R2;\n",
+ "I3=V2/R5;\n",
+ "R7=R2+R3;\n",
+ "I4=V3/R7;\n",
+ "R=1/((1/R1)+(1/R7)+(1/R4)+(1/R5));\n",
+ "I=I2+I3-I4;\n",
+ "V=I*R;\n",
+ "IR6=V/(R+R6)\n",
+ "print\"Current in 10 Ohm resistor using source transformation\",round(IR6,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 10 Ohm resistor using source transformation 0.052 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.29:pg-39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "R1=3; #Assigning values to parameters\n",
+ "R2=2;\n",
+ "R3=4;\n",
+ "V1=35;\n",
+ "V2=40;\n",
+ "A=[5,2],[3,-4] #Matrix of I1,I2 by KVL equations\n",
+ "B=[35],[-5]\n",
+ "a=inv(A)\n",
+ "I=np.dot(a,B)# I matrix has I1 and I2 values\n",
+ "I1=I[0][0]\n",
+ "I2=I[1][0]\n",
+ "print\"Current in 3 ohm resistor=\",round(I1,2),\"A\"\n",
+ "print\"Current in 4 ohm resistor\",round(I2,2),\"A\"\n",
+ "I3=I1+I2\n",
+ "print\"Current in 2 ohm resistor\",round(I3,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 3 ohm resistor= 5.0 A\n",
+ "Current in 4 ohm resistor 5.0 A\n",
+ "Current in 2 ohm resistor 10.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 89
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.30:pg-40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "R1=2.0; #Assigning values to parameters\n",
+ "R2=3.0;\n",
+ "R3=4.0;\n",
+ "R4=5.0;\n",
+ "R5=1.0;\n",
+ "A=[3,-3],[9,12] #Matrix of I1,I2 by KVL equations\n",
+ "B=[2],[4]\n",
+ "I=np.dot(inv(A),B)# I matrix has I1 and I2 values\n",
+ "I1=I[0][0]\n",
+ "I2=I[1][0]\n",
+ "print\"Current in 1 Ohm resistor is I1\",round(I1,2),\"A\"\n",
+ "print\"Current in 3 Ohm resistor is I2\",round(I2,3),\"A\"\n",
+ "IR2=1-I1\n",
+ "IR4=1-I1-I2\n",
+ "IR5=I1+I2\n",
+ "print\"Current in 2 Ohm resistor is IR2\",round(IR2,3),\"A\"\n",
+ "print\"Current in 4 Ohm resistor is IR4\",round(IR4,3),\"A\"\n",
+ "print\"Current in 5 Ohm resistor is IR5 \",round(IR5,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 1 Ohm resistor is I1 0.57 A\n",
+ "Current in 3 Ohm resistor is I2 -0.095 A\n",
+ "Current in 2 Ohm resistor is IR2 0.429 A\n",
+ "Current in 4 Ohm resistor is IR4 0.524 A\n",
+ "Current in 5 Ohm resistor is IR5 0.476 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 92
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.31:pg-40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy.linalg import inv\n",
+ "A=[1,-5,3],[5,-1,-9],[7,1,-5] #Matrix of I1,I2,I3 Coeffecients by KVL equations\n",
+ "B=[0],[0],[1];\n",
+ "a=inv(A)\n",
+ "I=np.dot(a,B)\n",
+ "I1=I[0][0]+I[1][0]\n",
+ "print\"Current supplied by the battery is I1=\",round(I1,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current supplied by the battery is I1= 0.3 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 88
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.32:pg-42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "A=[0,6,-2],[3,4,1],[1,2,-4] #Matrix of I1,I2,I3 Coeffecients by KVL equations\n",
+ "B=[9],[24],[-4]\n",
+ "a=inv(A)\n",
+ "I=np.dot(a,B)\n",
+ "I1=I[1][0]\n",
+ "print\"Current in 20 Ohm resistor=\",round(I1,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 20 Ohm resistor= 2.554 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 87
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.38:pg-49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=2.0; #Assigning values to parameters\n",
+ "R2=2.0;\n",
+ "R3=4.0;\n",
+ "R4=6.0;\n",
+ "R5=6.0;\n",
+ "R6=2.0;\n",
+ "R7=7.0;\n",
+ "Ra=R6*R3/(R3+R5+R6); #Converting Delta to Star\n",
+ "Rb=R5*R6/(R3+R5+R6);\n",
+ "Rc=R3*R5/(R3+R5+R6);\n",
+ "R8=Rc+R4;\n",
+ "R9=Rb+R7;\n",
+ "R10=(R8*R9)/(R8+R9);\n",
+ "R=R1+R2+Ra+R10;\n",
+ "print\"Equivalent resistor of the network using Star-Delta transformation=\",round(R,2),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent resistor of the network using Star-Delta transformation= 8.67 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.40:pg-53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=6.0; #Assigning values to parameters\n",
+ "R2=8.0;\n",
+ "R3=5.0;\n",
+ "R4=10.0;\n",
+ "R5=5.0;\n",
+ "R6=10.0;\n",
+ "R7=15.0;\n",
+ "V=100.0;\n",
+ "Rx=R3+R6+(R3*R6)/R4; #Converting Star to Delta\n",
+ "Ry=R4+R6+(R4*R6)/R3;\n",
+ "Rz=R3+R4+(R3*R4)/R6;\n",
+ "Ra=(R5*Rx)/(Rx+R5);\n",
+ "Rb=(Ry*R7)/(Ry+R7);\n",
+ "Rl=(R1*R2)/(R1+R2+Rz); #Converting Delta to Star\n",
+ "Rm=(R1*Rz)/(R1+R2+Rz);\n",
+ "Rn=(R2*Rz)/(R1+R2+Rz);\n",
+ "R8=Ra+Rm;\n",
+ "R9=Rb+Rn;\n",
+ "R10=(R8*R9)/(R8+R9);\n",
+ "R=R10+Rl;\n",
+ "I=V/R;\n",
+ "print\"Current in the circuit=\",round(I,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in the circuit= 15.4 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.41:pg-55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=8.0; #Assigning values to parameters\n",
+ "R2=4.0;\n",
+ "R3=12.0;\n",
+ "R4=12.0;\n",
+ "R5=34.0;\n",
+ "R6=30.0;\n",
+ "R7=30.0;\n",
+ "R8=17.0;\n",
+ "R9=13.0;\n",
+ "R10=R1+R2;\n",
+ "R11=R8+R9;\n",
+ "Ra=(R10*R3)/(R3+R4+R10); #Converting Delta to Star\n",
+ "Rb=(R3*R4)/(R3+R4+R10);\n",
+ "Rc=(R10*R4)/(R3+R4+R10);\n",
+ "Rx=(R6*R7)/(R6+R7+R11); #Converting Delta to Star\n",
+ "Ry=(R7*R11)/(R6+R7+R11);\n",
+ "Rz=(R6*R11)/(R6+R7+R11);\n",
+ "Rl=R5+Ra+Rx;\n",
+ "Rm=Rc+Ry;\n",
+ "Rn=(Rl*Rm)/(Rl+Rm);\n",
+ "Req=Rb+Rz+Rn;\n",
+ "print\"Equivalent resistance of the network=\",round(Req,2),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent resistance of the network= 24.84 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.42:pg-57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=6.0; #Assigning values to parameters\n",
+ "R2=6.0;\n",
+ "R3=3.0;\n",
+ "R4=12.0;\n",
+ "R5=12.0;\n",
+ "R6=12.0;\n",
+ "R7=3.0;\n",
+ "Ra=(R4*R5)/(R4+R5+R6); #Converting Delta to Star\n",
+ "Rb=(R4*R6)/(R4+R5+R6);\n",
+ "Rc=(R5*R6)/(R4+R5+R6);\n",
+ "Rd=R3+Rb;\n",
+ "Re=R7+Rc;\n",
+ "Rf=(R1*R2)/(R1+R2);\n",
+ "Rh=(Rd*Re)/(Rd+Re);\n",
+ "Req=Ra+Rf+Rh;\n",
+ "print\"Equivalent resistance of the network is Req=\",round(Req,2),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent resistance of the network is Req= 10.5 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 80
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.43:pg-58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=6.0; #Assigning values to parameters\n",
+ "R2=4.0;\n",
+ "R3=3.0;\n",
+ "R4=5.0;\n",
+ "R5=5.0;\n",
+ "R6=2.0;\n",
+ "R7=4.0;\n",
+ "Rx=R3+R4+(R3*R4)/R6; #Converting Star to Delta\n",
+ "Ry=R4+R6+(R4*R6)/R3;\n",
+ "Rz=R3+R6+(R3*R6)/R4;\n",
+ "Ra=(R5*Rz)/(R5+Rz);\n",
+ "Rb=(R7*Ry)/(R7+Ry);\n",
+ "Rl=(R1*R2)/(R1+R2+Rx); #Converting Delta to Star\n",
+ "Rm=(R2*Rx)/(R1+R2+Rx);\n",
+ "Rn=(R1*Rx)/(R1+R2+Rx);\n",
+ "Rp=Ra+Rn;\n",
+ "Rq=Rb+Rm;\n",
+ "Rr=(Rp*Rq)/(Rp+Rq);\n",
+ "Req=Rl+Rr;\n",
+ "print\"Eqivalent resistance of the network=\",round(Req,2),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Eqivalent resistance of the network= 3.85 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.44:pg-61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "A=np.matrix([[-6,3],[3,-10.5]]) #Matrix of I1,I2 Coeffecients by Mesh analysis\n",
+ "B=np.matrix([[-12.5],[0]])\n",
+ "a=inv(A)\n",
+ "I=np.dot(a,B)\n",
+ "I1=I[0][0]\n",
+ "print\"current in 1 ohm resistor I1=\",round(I1,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " current in 1 ohm resistor I1= 2.43 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 77
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.45:pg-62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "A=np.matrix([[7,-1,0],[1,-6,3],[0,3,-4]]) #Matrix of I1,I2,I3 Coeffecients by Mesh analysis\n",
+ "B=np.matrix([[17],[-25],[19]])\n",
+ "a=inv(A)\n",
+ "I=np.dot(a,B)\n",
+ "I1=I[0][0]\n",
+ "I2=I[1][0]\n",
+ "I3=I[2][0]\n",
+ "print\"I1=\",round(I1,2),\"A\"\n",
+ "print\"I2=\",round(I2,2),\"A\"\n",
+ "print\"I3=\",round(I3,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I1= 2.95 A\n",
+ "I2= 3.65 A\n",
+ "I3= -2.01 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 79
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.47:pg-64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "I1=6.0;\n",
+ "R1=1.0;\n",
+ "R2=2.0;\n",
+ "R3=5.0;\n",
+ "V=10.0;\n",
+ "I2=(2*I1-10)/7;\n",
+ "IR2=(I1-I2);\n",
+ "print\"Current in 2 Ohm resistor=\",round(IR2,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 2 Ohm resistor= 5.71 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.48:pg-65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "V1=60;\n",
+ "R1=20;\n",
+ "I=1.0;\n",
+ "R2=30;\n",
+ "R3=50;\n",
+ "V2=40;\n",
+ "R4=100;\n",
+ "A=[-1,1,0],[-20,-80,50],[0,50,-150] #Matrix of I1,I2,I3 Coeffecients by Mesh analysis\n",
+ "B=[1],[-20],[-40]\n",
+ "I1=np.dot(inv(A),B);\n",
+ "IR100=I1[1][0]\n",
+ "print\"Current in 100 Ohm resistor is IR100=\",round(IR100,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 100 Ohm resistor is IR100= 0.64 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 96
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.49:pg-67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "V=50.0;\n",
+ "R1=10.0;\n",
+ "R2=5.0;\n",
+ "R3=3.0;\n",
+ "R4=2.0;\n",
+ "R5=1.0;\n",
+ "I=2.0;\n",
+ "A=[0,1,-1],[15,-12,-6],[-15,10,5] #Matrix of I1,I2,I3 Coeffecients by Mesh analysis\n",
+ "B=[2],[0],[-50]\n",
+ "I1=np.dot(inv(A),B)\n",
+ "I2=I1[0][0]\n",
+ "I3=I1[2][0]\n",
+ "IR5=I2-I3\n",
+ "print\"Current in 5 Ohm resistor is IR5=\",round(IR5,2),\"A\"\n",
+ "#the answer in the book is 14.67,which is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 5 Ohm resistor is IR5= 4.67 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 104
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.50:pg-69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "R1=20;\n",
+ "R2=10;\n",
+ "R3=15;\n",
+ "R4=10;\n",
+ "R5=10;\n",
+ "V1=100;\n",
+ "V2=80;\n",
+ "A=[13,-4],[1,-4] #Applying KCL at the two nodes\n",
+ "B=[300],[120]\n",
+ "V=np.dot(inv(A),B)\n",
+ "IR3=(V[0][0]-V[1][0])/R3;\n",
+ "print\"Current in 15 Ohm resistor is IR3\",round(IR3,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 15 Ohm resistor is IR3 2.75 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 109
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.51:pg-70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "R1=0.2;\n",
+ "R2=0.3;\n",
+ "R3=0.1;\n",
+ "V1=120;\n",
+ "V2=110;\n",
+ "A=[5,-2],[1,-4] #Applying KCL at the two nodes\n",
+ "B=[358.2],[-324]\n",
+ "V=np.dot(inv(A),B)\n",
+ "I1=(120-V[0][0])/R1;\n",
+ "I2=(V[0][0]-V[1][0])/R2;\n",
+ "I3=(110-V[1][0])/R3;\n",
+ "print\"Current I1\",round(I1,2),\"A\"\n",
+ "print\"Current I1\",round(I2,2),\"A\"\n",
+ "print\"Current I1\",round(I3,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current I1 22.0 A\n",
+ "Current I1 19.0 A\n",
+ "Current I1 1.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 110
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.52:pg-71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "R1=2;\n",
+ "R2=4;\n",
+ "R3=4;\n",
+ "R4=2;\n",
+ "I1=2;\n",
+ "I2=4;\n",
+ "A=[2,-1],[1,-3]; #Applying KCL at the two nodes\n",
+ "B=[8],[-16];\n",
+ "V=np.dot(inv(A),B)\n",
+ "print\"Voltage at node A is V[0][0]=\",round(V[0][0],2),\"Volts\"\n",
+ "print\"Voltage at node B is V[1][0]=\",round(V[1][0],2),\"Volts\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage at node A is V[0][0]= 8.0 Volts\n",
+ "Voltage at node B is V[1][0]= 8.0 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 111
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.53:pg-72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "R1=2;\n",
+ "R2=10;\n",
+ "R3=5;\n",
+ "R4=15;\n",
+ "I1=1/3;\n",
+ "R5=3;\n",
+ "V1=10;\n",
+ "V2=18;\n",
+ "A=[8,-2],[3,-9]; #Applying KCL at the two nodes\n",
+ "B=[50],[-85];\n",
+ "V=np.dot(inv(A),B)\n",
+ "I1=(V1-V[0][0])/R1;\n",
+ "I5=(V[1][0]-V2)/R5;\n",
+ "print\"Current in 2 Ohm resistor is I1=\",round(I1,3),\"A\"\n",
+ "print\"Current in 3 Ohm resistor is I1=\",round(I5,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 2 Ohm resistor is I1= 0.303 A\n",
+ "Current in 3 Ohm resistor is I1= -1.81 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 114
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.54:pg-73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "R1=2; #Assigning values to parameters\n",
+ "R2=10;\n",
+ "R3=2;\n",
+ "R4=5;\n",
+ "R5=1;\n",
+ "R6=4;\n",
+ "I1=28;\n",
+ "I2=2;\n",
+ "A=[11,-5,-1],[5,-17,10],[1,10,-13.5]; #Applying KCL at the two nodes\n",
+ "B=[280],[0],[20];\n",
+ "V=np.dot(inv(A),B)\n",
+ "I1=V[0][0]/R1;\n",
+ "I2=(V[0][0]-V[1][0])/R3;\n",
+ "I3=(V[0][0]-V[2][0])/R2;\n",
+ "I4=(V[1][0]-V[2][0])/R5;\n",
+ "I5=V[1][0]/R4;\n",
+ "I6=V[2][0]/R6;\n",
+ "print\"Current I1\",round(I1,2),\"A\"\n",
+ "print\"Current I2\",round(I2,2),\"A\"\n",
+ "print\"Current I3\",round(I3,2),\"A\"\n",
+ "print\"Current I4\",round(I4,2),\"A\"\n",
+ "print\"Current I5\",round(I5,2),\"A\"\n",
+ "print\"Current I6\",round(I6,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current I1 18.0 A\n",
+ "Current I2 8.0 A\n",
+ "Current I3 2.0 A\n",
+ "Current I4 4.0 A\n",
+ "Current I5 4.0 A\n",
+ "Current I6 4.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 118
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.55:pg-76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V1=35.0; #Assigning values to parameters\n",
+ "R1=3.0;\n",
+ "R2=2.0;\n",
+ "R3=4.0;\n",
+ "V2=40.0;\n",
+ "Ra=((R2*R3)/(R2+R3))+R1; # Considering only 35V source\n",
+ "I=V1/Ra;\n",
+ "IR1=I;\n",
+ "IR3=I*(R2)/(R2+R3);\n",
+ "IR2=I-IR3;\n",
+ "Rb=((R1*R2)/(R1+R2))+R3; #Considering only 40V source\n",
+ "I1=V2/Rb;\n",
+ "I1R3=I1;\n",
+ "I1R1=I1*(R2)/(R2+R3);\n",
+ "I1R2=I1-I1R1;\n",
+ "Ires3=IR1-I1R1; # Adding the currents algebraically\n",
+ "Ires2=IR2+I1R2;\n",
+ "Ires4=I1R3-IR3;\n",
+ "print\"Current in 3 Ohm resistor using Superposition Theorem\",round(Ires3,2),\"A\"\n",
+ "print\"Current in 2 Ohm resistor using Superposition Theorem\",round(Ires2,2),\"A\"\n",
+ "print\"Current in 4 Ohm resistor using Superposition Theorem\",round(Ires4,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 3 Ohm resistor using Superposition Theorem 5.51 A\n",
+ "Current in 2 Ohm resistor using Superposition Theorem 10.51 A\n",
+ "Current in 4 Ohm resistor using Superposition Theorem 5.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 120
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.56:pg-77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "I1=1; #Assigning values to parameters\n",
+ "R1=3;\n",
+ "R2=2;\n",
+ "R3=2;\n",
+ "R4=2;\n",
+ "R5=1;\n",
+ "Ra=(R1*R2)/(R1+R2);\n",
+ "Rb=(R3*R4)/(R3+R4);\n",
+ "Iab=(I1*Ra)/(Ra+Rb+R5);\n",
+ "A=[5,0,-2],[0,4,-2],[2,2,-5]; #Current coeffecients by applying KVL\n",
+ "B=[-1],[1],[0];\n",
+ "I=np.dot(inv(A),B)\n",
+ "IR5=I[2][0]+Iab;\n",
+ "print\"Current in 1 Ohm resistor\",round(IR5,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 1 Ohm resistor 0.031 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 121
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.57:pg-79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V1=10.0; #Assigning values to parameters\n",
+ "R1=10.0;\n",
+ "R2=1.0;\n",
+ "V2=8.0;\n",
+ "R3=8.0;\n",
+ "V3=12.0;\n",
+ "R4=20.0;\n",
+ "I20=V1/(R2+R4); # Considering only 10V source\n",
+ "Ia20=V3/(R2+R4); # Considering only 12V source\n",
+ "Ib20=V2/(R2+R4); # Considering only 8V source\n",
+ "I=Ia20+Ib20-I20; # Adding the currents algebraically\n",
+ "print\"Current through 20 Ohm resistor using Superposition principle\",round(I,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 20 Ohm resistor using Superposition principle 0.476 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 125
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.58:pg-82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V1=4.0; #Assigning values to parameters\n",
+ "R1=2.0;\n",
+ "I1=1.0;\n",
+ "R2=1.0;\n",
+ "R3=3.0;\n",
+ "I2=3.0;\n",
+ "I1a=V1/(R1+R2); #Considering the current flow due to 4V voltage source\n",
+ "I1b=(I2*R1)/(R1+R2); #Considering the current flow due to 3A current source\n",
+ "I1c=(I1*R1)/(R2+R1); #Considering the current flow due to 1A current source\n",
+ "I=I1a+I1b+I1c;\n",
+ "print\"Current in 1 Ohm resistor using Superposition principle\",round(I,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 1 Ohm resistor using Superposition principle 4.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 126
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.59:pg-83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V1=50.0; #Assigning values to parameters\n",
+ "V2=36.0;\n",
+ "R1=5.0;\n",
+ "R2=20.0;\n",
+ "R3=10.0;\n",
+ "I1=4.0;\n",
+ "R4=(R2*R3)/(R2+R3);\n",
+ "R5=R4+R1;\n",
+ "I5a=V1/R5; #Considering only 50V source\n",
+ "I5b=I1*(R4/(R4+R1)); #Considering only 4A current source\n",
+ "I2=V2/R3; #Converting 36V voltage source to 3.6A current source using source transformation\n",
+ "I5c=I2*(R4/(R4+R1)); #Considering only 3.6A current source\n",
+ "I=(I5b+I5c)-I5a; #Adding the currents algebraically\n",
+ "print\"Current through 5 Ohm resistor using Superposition principle\",round(I,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 5 Ohm resistor using Superposition principle 0.06 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 132
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.60:pg-85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V1=80.0; #Assigning values to parametrs\n",
+ "V2=20.0;\n",
+ "I1=20.0;\n",
+ "R1=5.0;\n",
+ "R2=10.0;\n",
+ "R3=50.0;\n",
+ "R4=20.0;\n",
+ "R5=(R3*R4)/(R3+R4);\n",
+ "I10a=V1/(R1+R2+R5); #Considering only 80V voltage source\n",
+ "I2=V2/R4; #Converting 20V voltage source to 1A current source\n",
+ "I10b=(I2*R5)/(R1+R2+R5); #Considering only 1A current source\n",
+ "I10c=(I1*R1)/(R1+R2+R5); #Considering only 20A current source\n",
+ "I=I10b+I10c-I10a; #Adding the currents algebraically\n",
+ "print\"Current through 5 Ohm resistor using Superposition principle\",round(I,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 5 Ohm resistor using Superposition principle 1.17 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 131
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.61:pg-90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V1=10.0; #Assigning values to parameters\n",
+ "V2=20.0;\n",
+ "R1=6.0;\n",
+ "R2=1.0;\n",
+ "R3=2.0;\n",
+ "R4=3.0;\n",
+ "R5=5.0;\n",
+ "A=[7,-1],[1,-6] #Mesh current coeffecients\n",
+ "B=[10],[0]\n",
+ "I=np.dot(inv(A),B)\n",
+ "Vth=V2+R4*I[1][0]; #Calculation of Thevenin vlotage\n",
+ "Ra=(R1*R2)/(R1+R2);\n",
+ "Rb=Ra+R3;\n",
+ "Rth=(R4*Rb)/(R4+Rb); #Calculation of Thevenin current\n",
+ "I1=Vth/(Rth+R5)\n",
+ "print\"Current in 5 Ohm resistor using Thevenin theorem\",round(I1,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 5 Ohm resistor using Thevenin theorem 3.21 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.62:pg-92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=1.5; #Assignig values to parameters\n",
+ "R2=6;\n",
+ "R3=5;\n",
+ "R4=7.5;\n",
+ "R5=9;\n",
+ "V1=6;\n",
+ "V2=30;\n",
+ "A=[-22.5,7.5],[7.5,-12.5]; #Current coeffecients\n",
+ "B=[0],[30];\n",
+ "I=np.dot(inv(A),B)\n",
+ "Vth=(V1+R3*I[1][0]+R2*I[0][0])*-1; #Thevenin voltage\n",
+ "Ra=(R3*R4)/(R4+R3);\n",
+ "Rb=Ra+R2;\n",
+ "Rth=(Rb*R5)/(R5+Rb); #Thevenin resistance\n",
+ "I1=Vth/(Rth+R1)\n",
+ "print\"Current in 1.5 Ohm resistor\",round(I1,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 1.5 Ohm resistor 2.5 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.63:pg-94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V1=2.0;\n",
+ "V2=4.0;\n",
+ "R1=5.0;\n",
+ "R2=10.0;\n",
+ "R3=10.0;\n",
+ "R4=8.0;\n",
+ "R5=5.0;\n",
+ "A=[-15,10],[10,-25];\n",
+ "B=[-2],[4];\n",
+ "I=np.dot(inv(A),B)\n",
+ "Vth=V2+R1*I[1][0];\n",
+ "Ra=(R1*R2)/(R1+R2);\n",
+ "Rb=Ra+R3;\n",
+ "Rth=(Rb*R5)/(Rb+R5);\n",
+ "I1=Vth/(Rth+R4)\n",
+ "print\"Current in 8 Ohm resistor\",round(I1,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 8 Ohm resistor 0.281 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.64:pg-96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=8; #Assigning values to parameters\n",
+ "R2=4;\n",
+ "R3=12;\n",
+ "R4=12;\n",
+ "R5=34;\n",
+ "R6=30;\n",
+ "R7=30;\n",
+ "R8=17;\n",
+ "R9=13;\n",
+ "V=180;\n",
+ "R10=R1+R2;\n",
+ "R11=R8+R9;\n",
+ "Ra=(R10*R3)/(R3+R4+R10); #Converting Delta to Star\n",
+ "Rb=(R3*R4)/(R3+R4+R10);\n",
+ "Rc=(R10*R4)/(R3+R4+R10);\n",
+ "Rx=(R6*R7)/(R6+R7+R11); #Converting Delta to Star\n",
+ "Ry=(R7*R11)/(R6+R7+R11);\n",
+ "Rz=(R6*R11)/(R6+R7+R11);\n",
+ "Rp=R5+Ra+Rx;\n",
+ "Rm=Rc+Ry;\n",
+ "Rn=(Rp*Rm)/(Rp+Rm);\n",
+ "Rth=Rb+Rz+Rn;\n",
+ "I=V/(Rp+Rc+Rz);\n",
+ "Vth=Rp*I\n",
+ "Rl=10;\n",
+ "Il=Vth/(Rl+Rth);\n",
+ "print\"Current in 10 Ohm load using Thevenin theorem is\",round(I1,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 10 Ohm load using Thevenin theorem is 4.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.65:pg-101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V1=12.0; #Assigning values to parameters\n",
+ "V2=8.0;\n",
+ "I1=4.0;\n",
+ "R1=2.0;\n",
+ "R2=10.0;\n",
+ "R3=20.0;\n",
+ "R4=5.0;\n",
+ "R5=15.0;\n",
+ "R6=25.0;\n",
+ "R7=5.0;\n",
+ "A=[1,-1,0],[-12,-20,15],[0,15,-45]; #Current coeffecients\n",
+ "B=[4],[-12],[8];\n",
+ "I=np.dot(inv(A),B)\n",
+ "Vth=V1-R1*I[0][0]-R2*I[0][0]; #Thevenin voltage\n",
+ "Ra=R1+R2;\n",
+ "Rb=R6+R7;\n",
+ "Rc=(R5*Rb)/(R5+Rb);\n",
+ "Rd=R4+Rc;\n",
+ "Rth=(Ra*Rd)/(Ra+Rd); #Thevenin resistance\n",
+ "Il=Vth/(R3+Rth);\n",
+ "P=Il*Il*R3;\n",
+ "print\"Power drawn by 20 Ohm resistor\",round(P,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power drawn by 20 Ohm resistor 9.96 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.66:pg-103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "V1=150.0; #Assigning values to parameters\n",
+ "V2=50.0;\n",
+ "I1=13.0;\n",
+ "R1=15.0;\n",
+ "R2=60.0;\n",
+ "R3=40.0;\n",
+ "R4=30.0;\n",
+ "A=[-1,1],[-15,-100]; #Current coeffecients\n",
+ "B=[13],[-150];\n",
+ "I=np.dot(inv(A),B)\n",
+ "Vth=-V2+R3*I[1][0];#Thevenin voltage\n",
+ "Ra=R1+R2;\n",
+ "Rth=(R3*Ra)/(R3+Ra);#Thevenin resistance\n",
+ "I1=Vth/(R4+Rth)\n",
+ "print\" Current flowing in 20 Ohm resistor\",round(I1,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Current flowing in 20 Ohm resistor 1.248 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.67:pg-105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V=100.0; #Assigning values to parameters\n",
+ "R1=20.0;\n",
+ "R2=80.0;\n",
+ "R3=40.0;\n",
+ "R4=50.0;\n",
+ "I1=V/(R1+R2);\n",
+ "I2=V/(R3+R4);\n",
+ "Vth=R3*I2-R1*I1; #Calculating Thevenin voltage\n",
+ "Rth=((R1*R2)/(R1+R2))+((R3*R4)/(R3+R4)); # Calculating Thevenin resistance\n",
+ "Rl=5.0;\n",
+ "I1=Vth/(Rth+R1); #Calculating Thevenin current\n",
+ "Rla=10.0;\n",
+ "Ila=Vth/(Rth+Rla);\n",
+ "Rlb=20.0;\n",
+ "Ilb=Vth/(Rth+Rlb);\n",
+ "print\"Current in 5 Ohm load\",round(Il,4),\"A\"\n",
+ "print\"Current in 10 Ohm load\",round(Ila,3),\"A\"\n",
+ "print\"Current in 20 Ohm load\",round(Ilb,4),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 5 Ohm load 0.5656 A\n",
+ "Current in 10 Ohm load 0.507 A\n",
+ "Current in 20 Ohm load 0.4198 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 80
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.68:pg-108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=10.0; #Assigning values to parameters\n",
+ "R2=20.0;\n",
+ "R3=40.0;\n",
+ "R4=30.0;\n",
+ "R5=15.0;\n",
+ "V=2.0;\n",
+ "I1=V/(R1+R4);\n",
+ "I2=V/(R2+R5);\n",
+ "Vth=R2*I2-R1*I1; #Calculation of Thevenin voltage\n",
+ "Rth=((R1*R4)/(R1+R4))+((R2*R5)/(R2+R5)); #Calculation of Thevenin resistance\n",
+ "Il=Vth/(Rth+R3);\n",
+ "print\"Load current\",round(Il*1000,3),\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Load current 11.465 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 93
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.69:pg-110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=10.0; #Assigning values to parameters\n",
+ "R2=10.0;\n",
+ "R3=15.0;\n",
+ "R4=20.0;\n",
+ "V=100.0;\n",
+ "A=[-20,10],[10,-25] #Current coeffecients by KVL equations\n",
+ "B=[-100],[0];\n",
+ "I=np.dot(inv(A),B);\n",
+ "IN=I[1][0]; #Norton's current\n",
+ "RN=(R1*R2)/(R1+R2)+R3; #Norton's resistance\n",
+ "I1=(IN*RN)/(RN+RN);\n",
+ "print\"Current in load of 20 Ohm resistor using Norton theorem \",round(I1,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in load of 20 Ohm resistor using Norton theorem 1.25 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.70:pg-112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "I1=5.0; #Assigning values to parameters\n",
+ "I2=2.0;\n",
+ "V1=6.0;\n",
+ "R1=2.0;\n",
+ "R2=4.0;\n",
+ "I1=5.0;\n",
+ "I2=(R1*I1-6)/R1;\n",
+ "I3=I2+2;\n",
+ "IN=I3; #Calculation of Norton current\n",
+ "RN=R1; #Calculation of Norton resistance\n",
+ "I1=(IN*RN)/(RN+R2); #Calculation of load current using Norton theorem\n",
+ "print\"Current in 4 Ohm resistor by Norton theorem\",round(I1,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 4 Ohm resistor by Norton theorem 1.33 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 67
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.71:pg-114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "I1=6.0; #Assigning values to parameters\n",
+ "V1=10.0;\n",
+ "V2=24.0;\n",
+ "R1=2.0;\n",
+ "R2=1.0;\n",
+ "R3=10.0;\n",
+ "R4=3.0;\n",
+ "R5=2.0;\n",
+ "R6=4.0;\n",
+ "A=[-13,10,1],[10,-15,3],[1,3,-4]; #Current coefficients using KVL equations\n",
+ "B=[-12],[10],[-24];\n",
+ "I=np.dot(inv(A),B);\n",
+ "IN=I[2][0]; #Norton current\n",
+ "Rx=R2+R3+(R2*R3)/R4; #Converting Star to Delta\n",
+ "Ry=R3+R4+(R3*R4)/R2;\n",
+ "Rz=R2+R4+(R2*R4)/R3;\n",
+ "Ra=(R1*Rx)/(R1+Rx);\n",
+ "Rb=(Ry*R5)/(Ry+R5);\n",
+ "Rc=Ra+Rb;\n",
+ "RN=(Rz*Rc)/(Rz+Rc); #Norton resistance\n",
+ "I1=(IN*RN)/(RN+R6);\n",
+ "print\"Current in 4 Ohm resistor using Nortonn Theorem\",round(I1,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 4 Ohm resistor using Nortonn Theorem 4.1 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 64
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.72:pg-117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "I1=6.0; #Assigning values to parameters\n",
+ "I2=2.0;\n",
+ "V=10.0;\n",
+ "V2=24.0;\n",
+ "R1=3.0;\n",
+ "R2=5.0;\n",
+ "R3=6.0;\n",
+ "R4=2.0;\n",
+ "R5=10.0;\n",
+ "R6=6.0;\n",
+ "R7=4.0;\n",
+ "R8=3.0;\n",
+ "A=[1,0,0],[0,-18,10],[0,10,-23]; #Current coefficients using KVL equations\n",
+ "B=[6],[-10],[12];\n",
+ "I=np.dot(inv(A),B)\n",
+ "IN=I[0][0]-I[1][0]; #Norton current\n",
+ "RN=((R5*(R6+R7+R8))/(R5+R6+R7+R8))+R3+R4; #Norton resistance\n",
+ "I1=(IN*RN)/(RN+R2)\n",
+ "print\"Current in 4 Ohm resistor using Nortonn Theorem\",round(I1,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 4 Ohm resistor using Nortonn Theorem 4.14 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 116
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.73:pg-121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V=120.0; #Assigning values to parameters\n",
+ "R1=40.0;\n",
+ "R2=20.0;\n",
+ "R3=60.0;\n",
+ "Rth=((R1*R2)/(R1+R2))+R3; #Calculation of Thevenin Resistance\n",
+ "Rl=Rth; #For maximum power,load resistance should be equal to Thevenin resistance\n",
+ "I=V/(R1+R2); #Calculation of Circuit Current\n",
+ "Vth=R2*I; #Calculation of Thevenin Voltage\n",
+ "Pmax=(Vth*Vth)/(4*Rth); #Calculation of Maximum Power\n",
+ "print\"Maximum power by Maximum Power transfer theorem\",round(Pmax,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum power by Maximum Power transfer theorem 5.45 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 114
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.74:pg-122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V=10.0;\n",
+ "I=6.0;\n",
+ "R1=5.0;\n",
+ "R2=2.0;\n",
+ "R3=3.0;\n",
+ "R4=4.0;\n",
+ "Rth=((R1*R2)/(R1+R2))+R3+R4;\n",
+ "A=[-1,1],[-5,-2]; #Current coefficients using KVL equations\n",
+ "B=[6],[-10];\n",
+ "I=np.dot(inv(A),B);\n",
+ "Vth=R2*I[1][0];\n",
+ "Pmax=(Vth*Vth)/(4*Rth)\n",
+ "print\"Maximum Power\",round(Pmax,2),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Power 3.87 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 109
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.75:pg-124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V=30.0; #Assigning values to parameters\n",
+ "I1=25.0;\n",
+ "I2=10.0;\n",
+ "R1=5.0;\n",
+ "R2=10.0;\n",
+ "R3=2.0;\n",
+ "R4=10.0;\n",
+ "Rth=((R3*(R1+R2))/(R3+R1+R2))\n",
+ "Rth=round(Rth,2)\n",
+ "A=[-1,1,0],[-15,-12,10],[0,10,-10]; #Current coefficients using KVL equations\n",
+ "B=[10],[-125],[30];\n",
+ "I=np.dot(inv(A),B);\n",
+ "Vth=V+R3*I[1][0];\n",
+ "Vth=round(Vth,2)\n",
+ "Pmax=(Vth*Vth)/(4*Rth)\n",
+ "print\"Maximum Power\",round(Pmax,2),\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Power 491.45 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 106
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex1.76:pg-126"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "R1=2.0; #Assigning values to parameters\n",
+ "R2=4.0;\n",
+ "R3=1.0;\n",
+ "R4=5.0;\n",
+ "R5=8.0;\n",
+ "V=50.0;\n",
+ "Ra=(R1*R2)/(R1+R2+R4); #Converting Delta to Star\n",
+ "Rb=(R1*R4)/(R1+R2+R4);\n",
+ "Rc=(R2*R4)/(R1+R2+R4);\n",
+ "Rm=R3+Ra;\n",
+ "Rn=Rb+R5;\n",
+ "Rth=Rc+((Rm*Rn)/(Rm+Rn)); #Calculating Thevenin resistance\n",
+ "Rl=Rth;\n",
+ "Rp=R2+R4;\n",
+ "Rq=R3+R5;\n",
+ "Rr=(Rp*Rq)/(Rp+Rq);\n",
+ "I=V/(R1+Rr);\n",
+ "I1=I*Rp/(Rp+Rq);\n",
+ "I2=I*Rq/(Rp+Rq);\n",
+ "Vth=R3*I2-R2*I1; #Calculating Thevenin voltage\n",
+ "Pmax=(Vth*Vth)/(4*Rth); #Calculating Maximum Power\n",
+ "print\"Maximum Power\",round(Pmax,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Power 10.19 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 97
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter2.ipynb b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter2.ipynb new file mode 100644 index 00000000..c85407d0 --- /dev/null +++ b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter2.ipynb @@ -0,0 +1,2884 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f329daee8a85c43f59ee158b80238cd1ac536d329140648e381213663f0c2c1c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter2:AC CIRCUITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.1:pg-147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "t=3*10**-3; #Assigning values to parameters\n",
+ "w=314;\n",
+ "Im=141.4*sin(math.pi/2);\n",
+ "f=w/(2*math.pi);\n",
+ "T=1/f;\n",
+ "t=3*(10**-3);\n",
+ "i=141.4*sin(w*t);\n",
+ "print\"Maximum value of current\",round(Im,2),\"A\"\n",
+ "print\"Frequency\",round(f,1),\"HZ\"\n",
+ "print\"Time period\",round(T,2),\"sec\"\n",
+ "print\"Instantaneous value of current at t=3 msec\",round(i,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum value of current 141.4 A\n",
+ "Frequency 50.0 HZ\n",
+ "Time period 0.02 sec\n",
+ "Instantaneous value of current at t=3 msec 114.36 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.2:pg-147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "f=60.0; #Assigning values to parameters\n",
+ "Im=12.0;\n",
+ "i=Im*sin(377/360)\n",
+ "print\"Current at t=1/360 sec\",round(i,2),\"A\"\n",
+ "i1=9.6;\n",
+ "t=math.asin(i1/Im)/377;\n",
+ "print\"Time taken to reach i1\",round(t,5),\"sec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current at t=1/360 sec 10.1 A\n",
+ "Time taken to reach i1 0.00246 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.3:pg-148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "w=942.0; #Assigning values to parameters\n",
+ "Vm=10.0;\n",
+ "V=6.0;\n",
+ "t=math.asin(V/Vm)/w;\n",
+ "f=w/(2*math.pi);\n",
+ "T=1.0/f;\n",
+ "t2=t+T;\n",
+ "print\"Time taken to reach 6V second time=\",round(t2*1000,2),\"msec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken to reach 6V second time= 7.35 msec\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.4:pg-150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy import integrate\n",
+ "import math\n",
+ "V=integrate.quad(lambda t:20*sin(t),0,math.pi)\n",
+ "V1=V[0]\n",
+ "Vavg=V1/(2*math.pi)\n",
+ "print\"the average value of voltage is Vavg=\",round(Vavg,3),\"volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the average value of voltage is Vavg= 6.366 volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.5:pg-152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy import integrate \n",
+ "#y=10*t,the current equation\n",
+ "T=4;\n",
+ "Res=integrate.quad(lambda t:10*t,0,2,)\n",
+ "Res=Res[0]/T\n",
+ "print\"Average current value\",round(Res,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average current value 5.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.6:pg-153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy import integrate\n",
+ "#y=6*t,the voltage equation\n",
+ "T=3;\n",
+ "Res=integrate.quad(lambda t:6*t,0,3)\n",
+ "Res=Res[0]/T\n",
+ "print\"Average voltage value is Res=\",round(Res,2),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average voltage value is Res= 9.0 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.7:pg-153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy import integrate\n",
+ "Vm=1; #Assuming Vm=1\n",
+ "#y=Vm*sin(t),the voltage Equation\n",
+ "#y1=0.866*Vm*sin(t)\n",
+ "T=math.pi;\n",
+ "Res1=integrate.quad(lambda t:Vm*sin(t),0,math.pi/3)\n",
+ "Res1=Res1[0] \n",
+ "Res2= integrate.quad(lambda t:0.866*Vm*sin(t),math.pi/3,math.pi/2)\n",
+ "Res2=Res2[0]\n",
+ "Res3=integrate.quad(lambda t:Vm*sin(t),math.pi/2,math.pi)\n",
+ "Res3=Res3[0]\n",
+ "Res=(Res1+Res2+Res3)/T\n",
+ "print\"Average voltage value\",round(Res,2),\"volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average voltage value 0.62 volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.8:pg-155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy import integrate\n",
+ "Vm=1; #Assuming Vm=1;\n",
+ "#y=Vm*sin(t) #Defining voltage equation\n",
+ "T=math.pi;\n",
+ "Res=integrate.quad(lambda t:Vm*sin(t),math.pi/6,math.pi)\n",
+ "Res=Res[0]/T\n",
+ "print\"Average voltage value\",round(Res,3),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average voltage value 0.594 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.10:pg-159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy import integrate\n",
+ "Vm=1; #Assuming Vm=1\n",
+ "#y=Vm*Vm*sin(t)*sin(t), #Defining Voltage Equation\n",
+ "T=2*math.pi;\n",
+ "Res=(integrate.quad(lambda t:Vm*Vm*sin(t),0,math.pi))\n",
+ "Res=sqrt(Res[0]/T) \n",
+ "print\"Rms value of voltage\",round(Res,2),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rms value of voltage 0.56 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.11:pg-160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy import integrate\n",
+ "Vm=1; #Assuming Vm=1\n",
+ "#y=Vm*Vm*sin(t)*sin(t) #Defining Voltage Equation\n",
+ "T=2*math.pi;\n",
+ "Res=(integrate.quad(lambda t: Vm*Vm*sin(t)*sin(t),math.pi/4,math.pi))\n",
+ "Res=sqrt(Res[0]/T)\n",
+ "print\"Rms value of voltage\",round(Res,3),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rms value of voltage 0.477 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.12:pg-161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy import integrate\n",
+ "Vm=1; #Assuming Vm=1\n",
+ "#y=Vm*Vm*sin(t)*sin(t),Defining Voltage Equation\n",
+ "#y1=0.866*0.866*Vm*Vm*sin(t)*sin(t)\n",
+ "T=math.pi;\n",
+ "Res1=(integrate.quad(lambda t:Vm*Vm*sin(t)*sin(t),0,math.pi/3))\n",
+ "Res2=(integrate.quad(lambda t:0.866*0.866*Vm*Vm*sin(t)*sin(t),math.pi/3,math.pi/2))\n",
+ "Res3=(integrate.quad(lambda t:Vm*Vm*sin(t)*sin(t),math.pi/2,math.pi))\n",
+ "VRms=sqrt((Res1[0]+Res2[0]+Res3[0])/T)\n",
+ "print\"Rms voltage value is=\",round(VRms,3),\"Volts\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rms voltage value is= 0.68 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.13:pg-163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy import integrate\n",
+ "Vm=1; #Assuming Vm=1\n",
+ "#y=10*t*10*t, Defining Current Equation\n",
+ "T=4;\n",
+ "Res=(integrate.quad(lambda t:10*t*10*t,0,2))\n",
+ "Irms=sqrt(Res[0]/T)\n",
+ "print\"Rms current value is Irms=\",round(Irms,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rms current value is Irms= 8.16 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.14:pg-164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy import integrate\n",
+ "Vm=1; #Assuming Vm=1\n",
+ "#y=sin(t)*sin(t),Defining Voltage Equation\n",
+ "T=math.pi;\n",
+ "Res=integrate.quad(lambda t:sin(t)*sin(t),math.pi/6,math.pi)\n",
+ "Res=sqrt(Res[0]/T)\n",
+ "print\"Rms voltage value\",round(Res,3),\"volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rms voltage value 0.697 volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.15:pg-165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy import integrate\n",
+ "Vm=1; #Assuming Vm=1\n",
+ "#y=sin(t+(math.pi/3))*sin(t+(math.pi/3)),Defining Voltage Equation\n",
+ "T=2*(math.pi/3);\n",
+ "Res=integrate.quad(lambda t:sin(t+(math.pi/3))*sin(t+(math.pi/3)),0,T)\n",
+ "Res=sqrt(Res[0]/T)\n",
+ "print\"Rms voltage value\",round(Res,4),\"volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rms voltage value 0.7768 volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.16:pg-167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from scipy import integrate\n",
+ "#y=(10+10*sin(t))*(10+10*sin(t)),Defining Current Equation\n",
+ "T=2*math.pi;\n",
+ "Res=integrate.quad(lambda t:(10+10*sin(t))*(10+10*sin(t)),0,2*math.pi)\n",
+ "Res=sqrt(Res[0]/T)\n",
+ "print\"Rms current value\",round(Res,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rms current value 12.25 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.17:pg-168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "Im=62.35;\n",
+ "w=323;\n",
+ "#y=Im*sin(w*t), Defining Voltage Equation\n",
+ "fr=w/(2*math.pi);\n",
+ "Irms=Im/sqrt(2);\n",
+ "Iavg=0.637*Im;\n",
+ "formfac=Irms/Iavg;\n",
+ "print\"Maximum value of current\",round(Im,2),\"A\"\n",
+ "print\"Frequency\",round(fr,2),\"Hertz\"\n",
+ "print\"Rms value of current\",round(Irms,1),\"A\"\n",
+ "print\"Average value of current\",round(Iavg,1),\"A\"\n",
+ "print\"Form factor\",round(formfac,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum value of current 62.35 A\n",
+ "Frequency 51.41 Hertz\n",
+ "Rms value of current 44.1 A\n",
+ "Average value of current 39.7 A\n",
+ "Form factor 1.11\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.19:pg-175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "V1=42.43+1j*0; #Defining voltage equations in rectangular form\n",
+ "V2=14.14+1j*24.49;\n",
+ "Va=V1+V2;\n",
+ "[Ro,Theta]=cmath.polar(Va);\n",
+ "Vm=Ro*sqrt(2);\n",
+ "print\"Maximum value of voltage considering addition of voltages\",round(Vm,2),\"Volts\"\n",
+ "#function, y=Ro*sin(t+Theta),Defining voltage equation\n",
+ "Vb=V1-V2;\n",
+ "[Ro1,Theta1]=cmath.polar(Vb);\n",
+ "Vm1=Ro1*sqrt(2);\n",
+ "#function y1=f(t),y1=Ro*sin(t+Theta1),Defining voltage equation\n",
+ "print\"Maximum value of voltage considering difference of voltages\",round(Vm1,2),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum value of voltage considering addition of voltages 87.18 Volts\n",
+ "Maximum value of voltage considering difference of voltages 52.92 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.21:pg-177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "V1=17.68 #Defining voltage equations in rectangular form\n",
+ "V2=6.12+1j*3.54\n",
+ "V3=1j*21.21\n",
+ "V4=10-1j*10;\n",
+ "V=V1+V2+V3+V4;\n",
+ "[Ro,Theta]=cmath.polar(V);\n",
+ "Vm=Ro*sqrt(2)\n",
+ "t1=math.degrees(Theta)\n",
+ "#function y=f(t), y=Ro*sqrt(2)*sin(t+Theta), endfunction\n",
+ "print\"Maximum Voltage value\",round(Vm,2),\"Volts\"\n",
+ "print\"the value of Theta is=\",round(t1,2),\"degrees\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Voltage value 52.15 Volts\n",
+ "the value of Theta is= 23.58 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 54
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.22:pg-178"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "V1=36.75+1j*21.22 #Defining voltage equations in rectangular form\n",
+ "V2=-45.93-1j*26.52\n",
+ "V3=-50+1j*50;\n",
+ "V=-30.59+1j*94.15;\n",
+ "V4=V-(V1+V2+V3);\n",
+ "[Ro,Theta]=cmath.polar(V4);\n",
+ "t=math.degrees(Theta)\n",
+ "#function y=f(t), y=Ro*sqrt(2)*sin(t+Theta), endfunction\n",
+ "V=Ro*sqrt(2)\n",
+ "print\"Maximum Voltage value is=\",round(V,2),\"Volts\"\n",
+ "print\"the vlaue of Theta is=\",round(t,2),\"degrees\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Voltage value is= 80.78 Volts\n",
+ "the vlaue of Theta is= 59.97 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.23:pg-179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "I1=2.12+1j*3.67 #Defining current equations in rectangular form\n",
+ "I2=-3.07+1j*1.77\n",
+ "I3=-1.84+1j*1.06;\n",
+ "I4=-(I1+I2+I3);\n",
+ "[Ro,Theta]=cmath.polar(I4);\n",
+ "#function y=f(t), y=Ro*sqrt(2)*sin(t+Theta), endfunction\n",
+ "I=Ro*sqrt(2)\n",
+ "t=math.degrees(Theta)\n",
+ "print\"Maximum current value is I=\",round(I,2),\"A\"\n",
+ "print\"the value of Theta is t=\",round(t,2),\"degrees\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum current value is I= 10.0 A\n",
+ "the value of Theta is t= -66.77 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.24:pg-181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V1=230 #Defining voltage equations in rectangular form\n",
+ "V2=-115+1j*200;\n",
+ "V3=-115-1j*200;\n",
+ "V=V1+V2+V3;\n",
+ "[Ro,Theta]=cmath.polar(V);\n",
+ "#function y=f(t), y=Ro*sqrt(2)*sin(t+Theta), endfunction\n",
+ "ER=Ro*sqrt(2)\n",
+ "\n",
+ "print\"Maximum Voltage value is ER=\",round(ER,2),\"Volts\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Voltage value is ER= 0.0 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 59
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.25:pg-181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "V1=70.71 #Defining voltage equations in rectangular form\n",
+ "V2=1j*176.78\n",
+ "V3=91.86+1j*53.04\n",
+ "V4=100-1j*100;\n",
+ "V=V1+V2+V3+V4;\n",
+ "[Ro,Theta]=cmath.polar(V);\n",
+ "#function y=f(t), y=Ro*sqrt(2)*sin(t+Theta), endfunction\n",
+ "V=Ro*sqrt(2)\n",
+ "print\"Maximum Voltage value with V2 polarity as it is\",round(V,2),\"Volts\"\n",
+ "V=V1-V2+V3+V4;\n",
+ "[Ro1,Theta1]=cmath.polar(V);\n",
+ "#function y1=f(t), y1=Ro1*sqrt(2)*sin(t+Theta), endfunction\n",
+ "V=Ro1*sqrt(2)\n",
+ "print\"Maximum Voltage value with polarity of V2 reversed\",round(V,2),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Voltage value with V2 polarity as it is 414.24 Volts\n",
+ "Maximum Voltage value with polarity of V2 reversed 487.86 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.26:pg-190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "C=318*10**-6; #Assignig values to parameters\n",
+ "V=230.0;\n",
+ "f=50.0;\n",
+ "Xc=1.0/(2*math.pi*f*C);\n",
+ "I=V/Xc;\n",
+ "Vm=sqrt(2)*V;\n",
+ "Im=sqrt(2)*I;\n",
+ "#function y=f(t), y=Vm*sin(2*%pi*f*t),endfunction\n",
+ "#function y1=f(t), y1=Im*sin(2*%pi*f*t+%pi/2),endfunction\n",
+ "print\"Peak voltage value\",round(Vm,2),\"Volts\"\n",
+ "print\"Peak currnet value\",round(Im,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Peak voltage value 325.27 Volts\n",
+ "Peak currnet value 32.5 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.27:pg-190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "L=10*10**-3; #ASssigning values to parameters\n",
+ "Im=5; \n",
+ "w=2000;\n",
+ "#function y=f(t), y=Im*sin(w*t+%pi/2),endfunction\n",
+ "I=Im/sqrt(2);\n",
+ "Xl=2*math.pi*L;\n",
+ "Vm=L*Im*w;\n",
+ "Vl=Vm/sqrt(2);\n",
+ "print\"Voltage Vl\",round(Vl,2),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage Vl 70.71 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.28:pg-191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "V=150; #Assigning values to parameters\n",
+ "f=50;\n",
+ "L=0.2;\n",
+ "Xl=2*math.pi*f*L;\n",
+ "Vm=V*sqrt(2);\n",
+ "I=V/Xl;\n",
+ "Im=sqrt(2)*I;\n",
+ "#function y=f(t), y=Vm*sin(2*%pi*f*t),endfunction\n",
+ "#function y1=f(t), y1=Im*sin(2*%pi*f*t-(%pi/2)) endfunction\n",
+ "print\"Maximum voltage value\",round(Vm,2),\"Volts\"\n",
+ "print\"Maximum current value\",round(Im,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum voltage value 212.13 Volts\n",
+ "Maximum current value 3.38 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.29:pg-202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "R=7.0; #Assigning values to parametrs\n",
+ "L=31.8*10**-3;\n",
+ "V=230.0;\n",
+ "f=50.0;\n",
+ "Xl=2*math.pi*f*L;\n",
+ "Xl=round(Xl);\n",
+ "Zcoil=sqrt(R*R+Xl*Xl);\n",
+ "I=V/Zcoil;\n",
+ "Phi=math.atan(Xl/R);\n",
+ "Phi1=math.degrees(Phi)\n",
+ "PF=cos(Phi)\n",
+ "I=round(I,2);\n",
+ "P=V*I*0.574;\n",
+ "print\"Circuit Current=\",round(I,2),\"A\"\n",
+ "print\"Phase angle=\",round(Phi1),\"degrees\"\n",
+ "print\"Power factor=\",round(PF,2)\n",
+ "print\"Power consumed=\",round(P,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Circuit Current= 18.84 A\n",
+ "Phase angle= 55.0 degrees\n",
+ "Power factor= 0.57\n",
+ "Power consumed= 2487.26 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.30:pg-203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "V=200.0; #Assigning values to parameters\n",
+ "R=20.0;\n",
+ "f=50.0;\n",
+ "L=0.1;\n",
+ "Xl=2*math.pi*f*L;\n",
+ "C=50*10**-6;\n",
+ "Xc=1.0/(2*math.pi*f*C);\n",
+ "X=Xc-Xl;\n",
+ "Z=R-1j*X;\n",
+ "[Ro,theta]=cmath.polar(Z)\n",
+ "I=V/Ro;\n",
+ "PF=cos(theta);\n",
+ "PF=round(PF,3);\n",
+ "I=round(I,2);\n",
+ "PA=V*I*PF;\n",
+ "PR=V*I*sin(theta);\n",
+ "P=V*I;\n",
+ "print\"Circuit Current=\",round(I,2),\"A\"\n",
+ "print\"Circuit Impedance=\",round(Ro,2),\"ohms\"\n",
+ "print\"Power Factor=\",round(PF,3)\n",
+ "print\"Active Power=\",round(PA,2),\"Watts\"\n",
+ "print\"Reactive Power=\",round(PR,1),\"VAR\"\n",
+ "print\"Apparen Power=\",round(P),\"VA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Circuit Current= 5.27 A\n",
+ "Circuit Impedance= 37.94 ohms\n",
+ "Power Factor= 0.527\n",
+ "Active Power= 555.46 Watts\n",
+ "Reactive Power= -895.7 VAR\n",
+ "Apparen Power= 1054.0 VA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.31:pg-204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "V=200+1j*0; #Assigning values to parameters\n",
+ "R1=10;\n",
+ "R2=20;\n",
+ "R=R1+R2;\n",
+ "L1=0.05;\n",
+ "L2=0.1;\n",
+ "f=50;\n",
+ "Xl1=2*math.pi*f*L1;\n",
+ "Xl2=2*math.pi*f*L2;\n",
+ "Xl=Xl1+Xl2;\n",
+ "C=50*10**-6;\n",
+ "Xc=1/(2*math.pi*f*C);\n",
+ "X=Xc-Xl;\n",
+ "Z=R-1j*X;\n",
+ "[Ro,theta]=cmath.polar(Z);\n",
+ "I=V/Z;\n",
+ "Z1=R1+1j*Xl1;\n",
+ "Z2=R2-1j*(Xc-Xl2)\n",
+ "[Ro1,Theta1]=cmath.polar(Z1);\n",
+ "[Ro2,Theta2]=cmath.polar(Z2);\n",
+ "[ro,th]=cmath.polar(I);\n",
+ "V1=ro*Ro1;\n",
+ "V2=ro*Ro2;\n",
+ "print\"Circuit Current\",round(ro,2),\"A\"\n",
+ "print\"Voltage V1\",round(V1,1),\"Volts\"\n",
+ "print\"Voltage V2\",round(V2,1),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Circuit Current 5.84 A\n",
+ "Voltage V1 108.7 Volts\n",
+ "Voltage V2 221.5 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.32:pg-205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "V=100+0*1j; #Assignig values to parametrs\n",
+ "Z1=17.32+10*1j;\n",
+ "V1=34.64-20*1j;\n",
+ "V2=V-V1;\n",
+ "[Ro,Theta]=cmath.polar(V2);\n",
+ "[ro,theta]=cmath.polar(Z1);\n",
+ "[r,t]=cmath.polar(V1);\n",
+ "I=Ro/r;\n",
+ "[ro1,t1]=cmath.polar(I);\n",
+ "I=round(I);\n",
+ "Z2=V2/I;\n",
+ "[r1,t1]=cmath.polar(Z2);\n",
+ "print\"Impedance Z2\",\"=\",Z2,\"=\",cmath.polar(Z2),\"=\",round(r1,3),\"ohms\"\n",
+ "# The answer in the book is wrong ,The value of I is wrong in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Impedance Z2 = (32.68+10j) = (34.17575748977629, 0.2969500127663617) = 34.176 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.33:pg-206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "V=150+180*1j; #Assigning values to parameters\n",
+ "I=5-4*1j;\n",
+ "Z=V/I;\n",
+ "print\"Impedance =\",Z,\"=\",round(Z.imag,1),\"ohms\"\n",
+ "[Ro,Theta]=cmath.polar(Z);\n",
+ "P=V*I*cos(Theta);\n",
+ "[r,t]=cmath.polar(P);\n",
+ "print\"Power consumed =\",round(r,4),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Impedance = (0.731707317073+36.5853658537j) = 36.6 ohms\n",
+ "Power consumed = 30.0 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 82
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.34:pg-206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "V=127.28+1j*0; #Assigning values to parameters\n",
+ "I=1.251-1j*1.251\n",
+ "Z=V/I\n",
+ "[r1,t1]=cmath.polar(Z);\n",
+ "[Ro,Theta]=cmath.polar(I)\n",
+ "P=V*I*cos(Theta)\n",
+ "[r,t]=cmath.polar(P)\n",
+ "print\"Resistive and reactive part of impedance =\",Z,\"=\",cmath.polar(Z),\"=\",round(r1,3),\"ohms\"\n",
+ "print\"Average Power taken=\",round(r,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistive and reactive part of impedance = (50.8713029576+50.8713029576j) = (71.9428865782764, 0.7853981633974483) = 71.943 ohms\n",
+ "Average Power taken= 159.23 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.35:pg-207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "Z1=12.5+1j*21; #Assigning values to parameters\n",
+ "V=50+1j*0;\n",
+ "I1=V.real/Z1.real;\n",
+ "I2=0.722-0.723*1j;\n",
+ "Z=V/I2;\n",
+ "Z2=Z-Z1;\n",
+ "[r,t]=cmath.polar(Z2);\n",
+ "print\"Impedance Z2 =\",Z2,\"=\",cmath.polar(Z2),\"=\",round(r,3),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Impedance Z2 = (22.0781134909+13.6260056149j) = (25.944385217897505, 0.5529507762186462) = 25.944 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.40:pg-212"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#function v=f(t), v=200*sin(377*t), endfunction #Defining functions\n",
+ "#function i=f1(t), i=8*sin(377*t-%pi/6), endfunction\n",
+ "V=200.0/sqrt(2);#Assigning values to parameters\n",
+ "V=round(V,2);\n",
+ "I=8.0/sqrt(2);\n",
+ "I=round(I,2);\n",
+ "P=V*I*cos(math.pi/6)\n",
+ "print\"Active Power=\",round(P,3),\"Watts\"\n",
+ "Q=V*I*sin(math.pi/6);\n",
+ "print\"Reactive Power=\",round(Q,2),\"VAR\"\n",
+ "S=V*I;\n",
+ "print\"Apparent Power=\",round(S,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Active Power= 693.199 Watts\n",
+ "Reactive Power= 400.22 VAR\n",
+ "Apparent Power= 800.44 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.43:pg-215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "#function i=f(t), i=5*sin(314*t+2*%pi/3), endfunction; #Defining functions\n",
+ "#function v=f1(t), v=20*sin(314*t+5*%pi/6), endfunction;\n",
+ "I=-1.77+3.065*1j;\n",
+ "V=-12.24+7.07*1j;\n",
+ "Z=V/I;\n",
+ "[r,t]=cmath.polar(Z);\n",
+ "P=V*I*cos(t);\n",
+ "[ro,theta]=cmath.polar(P);\n",
+ "print\"Impedance =\",Z,\"=\",round(Z.real,3),\"ohms\"\n",
+ "print\"Average Power =\",round(ro,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Impedance = (3.45924144606+1.99580510293j) = 3.459 ohms\n",
+ "Average Power = 43.33 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.45:pg-216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "import numpy as np\n",
+ "from numpy.linalg import inv\n",
+ "f=50.0;\n",
+ "I=5.0;\n",
+ "V=250.0;\n",
+ "I1=5.8\n",
+ "Z=V/I;\n",
+ "A=[1, (1/(2*math.pi*50))**2],[1, (1/(2*math.pi*60))**2]\n",
+ "B=[50**2],[43.1**2];\n",
+ "res=np.dot(inv(A),B);\n",
+ "r=res[0][0];\n",
+ "P=I1**2*(sqrt(r));\n",
+ "print\"Power absorbed =\",round(P,1),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power absorbed = 670.8 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.46:pg-218"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#function vl=f(t), vl=300*sin(1000*t), endfunction; #Defining functions\n",
+ "R=20.0; #Assigning values to parameters\n",
+ "w=1000;\n",
+ "Z=R/cos(math.pi/4);\n",
+ "Xc=sqrt(Z*Z-R*R);\n",
+ "Xl=2*Xc;\n",
+ "L=Xl/w;\n",
+ "C=1.0/(w*Xc);\n",
+ "print\"Inductance Value=\",round(L,2),\"Henery\"\n",
+ "print\"Capacitance Value=\",round(C,6),\"farad\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inductance Value= 0.04 Henery\n",
+ "Capacitance Value= 5e-05 farad\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.47:pg-219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "Vr=10; #Assigning values to parameters\n",
+ "Vl=15;\n",
+ "Vc=10;\n",
+ "V=sqrt(Vr^2+(Vl-Vc)^2);\n",
+ "V=10+1j*0+0+1j*15+0-1j*10;\n",
+ "[r,t]=cmath.polar(V);\n",
+ "print\"Voltage=\",round(r,2),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage= 11.18 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.48:pg-219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "L=0.01; #Assigning value sto parameters\n",
+ "fr=50;\n",
+ "#function v=f(t), y=400*sin(3000*t-10),endfunction; #Defining functions\n",
+ "#function i=f1(t),i=10*sqrt(2)*cos(3000*t-55), endfunction;\n",
+ "V=278.54-1j*49.11;\n",
+ "I=8.191+5.7*1j;\n",
+ "Z=V/I;\n",
+ "[r,t]=cmath.polar(Z);\n",
+ "Xl=3000*L;\n",
+ "Xc=50;\n",
+ "C=1.0/(2*math.pi*fr*Xc);\n",
+ "print\"impedence Z=\",Z,\"=\",cmath.polar(Z),\"=\",round(r,2),\"ohms\"\n",
+ "print\"Capacitance C=\",round(C,5),\"farad\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "impedence Z= (20.0998621434-19.9828121374j) = (28.342851640290757, -0.7824779572137082) = 28.34 ohms\n",
+ "Capacitance C= 6e-05 farad\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.49:pg-221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "Vr=25; #Assigning values to parameters\n",
+ "Vcoil=40;\n",
+ "Vc=55;\n",
+ "Vrcoil=50;\n",
+ "I=0.345;\n",
+ "C=20*10**-6;\n",
+ "Xc=Vc/I;\n",
+ "f=1/(2*math.pi*C*Xc);\n",
+ "R=Vr/I;\n",
+ "Zcoil=Vcoil/I;\n",
+ "Zrcoil=Vrcoil/I;\n",
+ "r=(Zrcoil**2-(R**2+Zcoil**2))/(2*R);\n",
+ "Xl=sqrt(Zcoil**2-r**2);\n",
+ "Z=sqrt((R+r)**2+(Xc-Xl)**2);\n",
+ "I=round(I,3);\n",
+ "Z=round(Z);\n",
+ "V=I*Z;\n",
+ "print\"Voltage=\",round(V,3),\"Volts\"\n",
+ "#The answer in the book is wrong,which is 35.046"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage= 34.155 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.50:pg-227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "R=10.0; #Assigning values to parameters\n",
+ "L=0.014;\n",
+ "C=100*10**-6;\n",
+ "wr=1.0/sqrt(L*C);\n",
+ "Q=(1.0/R)*(sqrt(L/C));\n",
+ "BW=R/L;\n",
+ "w1=wr-BW/2;\n",
+ "w2=wr+BW/2;\n",
+ "Vm=1;\n",
+ "V=1/sqrt(2);\n",
+ "Vc=(V/R)*sqrt(L/C);\n",
+ "print\"Resonant frequency=\",round(wr,2),\"rad/sec\"\n",
+ "print\"Quality factor=\",round(Q,3)\n",
+ "print\"Bandwidth=\",round(BW,2),\"rad/sec\"\n",
+ "print\"Lower frequency=\",round(w1),\"rad/sec\"\n",
+ "print\"Upper frequency=\",round(w2,2),\"rad/sec\"\n",
+ "print\"Maximum value of voltage across capacitor=\",round(Vc,3),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resonant frequency= 845.15 rad/sec\n",
+ "Quality factor= 1.183\n",
+ "Bandwidth= 714.29 rad/sec\n",
+ "Lower frequency= 488.0 rad/sec\n",
+ "Upper frequency= 1202.3 rad/sec\n",
+ "Maximum value of voltage across capacitor= 0.837 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.51:pg-228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "V=10/sqrt(2); #Assigning values to parameters\n",
+ "Vc=500;\n",
+ "BW=400/(2*math.pi);\n",
+ "R=100;\n",
+ "Q=Vc/V;\n",
+ "BW=round(BW,2);\n",
+ "Q=round(Q,2);\n",
+ "fr1=(Q*BW);\n",
+ "f1=fr1-(BW/2);\n",
+ "f2=fr1+BW/2;\n",
+ "L=R/(2*math.pi*BW);\n",
+ "fr=1.0/(2*math.pi*sqrt(L*C));\n",
+ "C=1.0/(fr1*fr1*4*math.pi*math.pi*L);\n",
+ "print\"Resonant frequency=\",round(fr1,2),\"Hertz\"\n",
+ "print\"Lower frequency=\",round(f1,2),\"Hertz\"\n",
+ "print\"Upper frequency=\",round(f2,2),\"Hertz\"\n",
+ "print\"Inductor value=\",round(L,2),\"Hertz\"\n",
+ "print\"Capacitor value=\",round(C,9),\"Farads\"\n",
+ "# the answer of the capacitance in ths book is given in nF"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resonant frequency= 4501.4 Hertz\n",
+ "Lower frequency= 4469.57 Hertz\n",
+ "Upper frequency= 4533.23 Hertz\n",
+ "Inductor value= 0.25 Hertz\n",
+ "Capacitor value= 5e-09 Farads\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.52:pg-229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "f=1*10**6; #Assigning values to parameters\n",
+ "C1=500*10**-12;\n",
+ "C2=600810**-12;\n",
+ "Xl=1.0/(2*math.pi*f*C1);\n",
+ "L=Xl/(2*math.pi*f);\n",
+ "R=30.623;\n",
+ "Q=(1/R)*sqrt(L/C1);\n",
+ "print\"Resistance=\",round(R,2),\"ohms\"\n",
+ "print\"Inductance=\",round(L,9),\"Henery\"\n",
+ "print\"Quality Factor=\",round(Q,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance= 30.62 ohms\n",
+ "Inductance= 5.0661e-05 Henery\n",
+ "Quality Factor= 10.39\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.53:pg-230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "r=2.0; #Assigning values to parameters\n",
+ "L=0.01\n",
+ "V=230.0;\n",
+ "f=50.0;\n",
+ "C=1.0/(f*f*4*math.pi*math.pi*L);\n",
+ "Ir=V/r;\n",
+ "Vc=(V/r)*sqrt(L/C);\n",
+ "print\"Current across capacitor C=\",\"{:.3e}\".format(C),\"Farad\"\n",
+ "print\"Current I=\",round(Ir,2),\"A\"\n",
+ "print\"Voltage across the capacitor Vc=\",round(Vc,1),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current across capacitor C= 1.013e-03 Farad\n",
+ "Current I= 115.0 A\n",
+ "Voltage across the capacitor Vc= 361.3 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 151
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.54:pg-230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "L=0.1; #Assigning values to parameters\n",
+ "R=10.0;\n",
+ "V=230.0;\n",
+ "f=50.0;\n",
+ "C=200*10**-6;\n",
+ "Xl=2*math.pi*f*L;\n",
+ "Xc=1.0/(2*math.pi*f*C);\n",
+ "Z=sqrt(R*R+(Xl-Xc)*(Xl-Xc));\n",
+ "I=V/Z;\n",
+ "Zcoil=sqrt(R*R+Xl*Xl);\n",
+ "Vcoil=I*Zcoil;\n",
+ "Vc=I*Xc;\n",
+ "print\"Circuit Current I=\",round(I,2),\"Amperes\"\n",
+ "print\"Coil impedance Zcoil=\",round(Zcoil,2),\"Ohms\"\n",
+ "print\"Volts\",\"Coil voltage Vcoil=\",round(Vcoil,1),\"Volts\"\n",
+ "print\"Capacitor Voltage Vc=\",round(Vc,2),\"Volts\"\n",
+ "fr=1.0/(2*math.pi*sqrt(L*C));\n",
+ "Ir=V/R;\n",
+ "Xl=2*math.pi*fr*L;\n",
+ "Xc=Xl;\n",
+ "Zcoil=sqrt(R*R+Xl*Xl);\n",
+ "Vcoil=Ir*Zcoil;\n",
+ "Vc=Ir*Xc;\n",
+ "print\"Circuit Current at resonance Ir=\",round(Ir,2),\"Amperes\"\n",
+ "print\"Coil impedance at resonance Zcoil=\",round(Zcoil,2),\"Ohms\"\n",
+ "print\"Coil voltage at resonance Vcoil=\",round(Vcoil,3),\"Volts\"\n",
+ "print\"Capacitor Voltage at resonance Vc=\",round(Vc,2),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Circuit Current I= 12.47 Amperes\n",
+ "Coil impedance Zcoil= 32.97 Ohms\n",
+ "Volts Coil voltage Vcoil= 411.1 Volts\n",
+ "Capacitor Voltage Vc= 198.45 Volts\n",
+ "Circuit Current at resonance Ir= 23.0 Amperes\n",
+ "Coil impedance at resonance Zcoil= 24.49 Ohms\n",
+ "Coil voltage at resonance Vcoil= 563.383 Volts\n",
+ "Capacitor Voltage at resonance Vc= 514.3 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.55:pg-232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "Vr=200.0; #Assiging values to parameters\n",
+ "P=15.3;\n",
+ "fr=10000.0;\n",
+ "BW=1000.0;\n",
+ "R=Vr**2/P;\n",
+ "Q=fr/BW;\n",
+ "L=Q*R/(2*math.pi*fr);\n",
+ "C=1.0/(4*math.pi*math.pi*fr*fr*L);\n",
+ "print\"resistance=\",round(R,2),\"ohms\"\n",
+ "print\"inductor=\",round(L,3),\"Henery\"\n",
+ "print\"Capacitor=\",round(C,9),\"Farad\"\n",
+ "#The answer of the capacitance in the book is given in the form of pF"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "resistance= 2614.38 ohms\n",
+ "inductor= 0.416 Henery\n",
+ "Capacitor= 1e-09 Farad\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.56:pg-236"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "R=20.0; #Assigning values to parameters\n",
+ "L=31.8*10**-3;\n",
+ "V=230.0;\n",
+ "f=50.0;\n",
+ "I1=V/R;\n",
+ "Xl=2*math.pi*f*L;\n",
+ "I2=V/Xl;\n",
+ "I2=round(I2);\n",
+ "I=sqrt(I1*I1+I2*I2);\n",
+ "pf=I1/I;\n",
+ "pf=round(pf,3);\n",
+ "P=V*I*pf;\n",
+ "print\"Line current=\",round(I,2),\"A\"\n",
+ "print\"Power factor=\",round(pf,3)\n",
+ "print\"Power consumed=\",round(P,1),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Line current= 25.71 A\n",
+ "Power factor= 0.447\n",
+ "Power consumed= 2643.7 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.57:pg-238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "V=230+1j*0; #Assigning values to parameters\n",
+ "L=10*10**-3;\n",
+ "f=50.0;\n",
+ "R=10.0;\n",
+ "Xl=2*math.pi*f*L;\n",
+ "Xc=1.0/(2*math.pi*f*C);\n",
+ "Z1=10+1j*3.14;\n",
+ "Z2=10-1j*6.37;\n",
+ "Z=(Z1*Z2)/(Z1+Z2);\n",
+ "I=V/Z;\n",
+ "I1=V/Z1;\n",
+ "[r1,t1]=cmath.polar(I1);\n",
+ "I2=V/Z2;\n",
+ "[r2,t2]=cmath.polar(I2);\n",
+ "[r,t]=cmath.polar(Z1);\n",
+ "[ro,th]=cmath.polar(Z2);\n",
+ "[rot,tt]=cmath.polar(Z);\n",
+ "pf1=cos(t);\n",
+ "pf2=cos(th);\n",
+ "pft=cos(tt);\n",
+ "P1=I1*I1*R;\n",
+ "[r4,t4]=cmath.polar(P1);\n",
+ "P2=I2*I2*R;\n",
+ "[r5,t5]=cmath.polar(P2);\n",
+ "print\"Total Impedance=\",round(Z.real,2),\"Ohms\"\n",
+ "print\"Branch current I1=\",I1,\"=\",cmath.polar(I1),\"=\",round(r1,2),\"Amperes\"\n",
+ "print\"Branch current I2=\",I2,\"=\",cmath.polar(I2),\"=\",round(r2,3),\"Amperes\"\n",
+ "print\" Power factor of branch1=\",round(pf1,3)\n",
+ "print\" Power factor of branch2=\",round(pf2,3)\n",
+ "print\" Total Power factor=\",round(pft,3)\n",
+ "print\" Power consumed by branch 1=\",P1,\"=\",cmath.polar(P1),\"=\",round(r4,2),\"Watts\"\n",
+ "print\" Power consumed by branch 2=\",P2,\"=\",cmath.polar(P2),\"=\",round(r5,2),\"Watts\"\n",
+ "#In the book the answer is given in the polar form."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Impedance= 6.1 Ohms\n",
+ "Branch current I1= (20.935812619-6.57384516237j) = (21.94364806128091, -0.3042508322379845) = 21.94 Amperes\n",
+ "Branch current I2= (16.3611517966+10.4220536945j) = (19.3986208613536, 0.5671820281530153) = 19.399 Amperes\n",
+ " Power factor of branch1= 0.954\n",
+ " Power factor of branch2= 0.843\n",
+ " Total Power factor= 0.995\n",
+ " Power consumed by branch 1= (3950.928098-2752.57581012j) = (4815.236902373575, -0.608501664475969) = 4815.24 Watts\n",
+ " Power consumed by branch 2= (1590.68084902+3410.33605055j) = (3763.0649132254307, 1.1343640563060304) = 3763.06 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.58:pg-239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "Vm=100.0; #Assigning values to parameters\n",
+ "w=3.0;\n",
+ "#function v=f(t), v=Vm*sin(w*t), endfunction #Defining voltage equation\n",
+ "V=Vm/sqrt(2)+0*1j;\n",
+ "L=1.0/3;\n",
+ "Xl=w*L;\n",
+ "C=1.0/6;\n",
+ "Xc=1.0/(w*C);\n",
+ "Z1=1+1j*1;\n",
+ "Z2=1-1j*2;\n",
+ "I1=V/Z1;\n",
+ "[r,t]=cmath.polar(I1);\n",
+ "I2=V/Z2;\n",
+ "[r1,t1]=cmath.polar(I2);\n",
+ "I=I1+I2;\n",
+ "[r2,t2]=cmath.polar(I);\n",
+ "print\"Branch current I1=\",I1,\"=\",cmath.polar(I1),\"=\",round(r,3),\"A\"\n",
+ "print\"Branch current I2=\",I2,\"=\",cmath.polar(I2),\"=\",round(r1,3),\"A\"\n",
+ "print\"Total current=\",I,\"=\",cmath.polar(I),\"=\",round(r2,3),\"A\"\n",
+ "#In the book the final answer is given in the polar form."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Branch current I1= (35.3553390593-35.3553390593j) = (49.99999999999999, -0.7853981633974483) = 50.0 A\n",
+ "Branch current I2= (14.1421356237+28.2842712475j) = (31.622776601683785, 1.1071487177940904) = 31.623 A\n",
+ "Total current= (49.4974746831-7.07106781187j) = (49.999999999999986, -0.14189705460416396) = 50.0 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.59:pg-240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "Z1=10+1j*15; #Assigning values to parameters\n",
+ "Z2=6-1j*8;\n",
+ "I=15.0;\n",
+ "Z=(Z1*Z2)/(Z1+Z2);\n",
+ "V=I*Z;\n",
+ "I1=V/Z1;\n",
+ "I2=V/Z2;\n",
+ "P1=I1**2*real(Z1);\n",
+ "[r,t]=cmath.polar(P1);\n",
+ "P2=I2**2*real(Z2);\n",
+ "[r1,t1]=cmath.polar(P2);\n",
+ "print\"Power taken by branch 1=\",P1,\"=\",cmath.polar(P1),\"=\",round(r,3),\"Watts\"\n",
+ "print\"Power taken by branch 2=\",P2,\"=\",cmath.polar(P2),\"=\",round(r1,3),\"Watts\"\n",
+ "#In the book the final answer is given in the polar form."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power taken by branch 1= (-660.306369256-328.943832303j) = (737.7049180327872, -2.679411319197999) = 737.705 Watts\n",
+ "Power taken by branch 2= (599.717817791+1307.5517334j) = (1438.5245901639341, 1.1407665632998834) = 1438.525 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.60:pg-241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "V=200; #Assigning values to parameters\n",
+ "f=50;\n",
+ "Ra=10;\n",
+ "La=0.12;\n",
+ "Rb=20;\n",
+ "Cb=40*10**-6;\n",
+ "Xla=2*math.pi*f*La;\n",
+ "Xcb=1/(2*math.pi*f*Cb);\n",
+ "Za=Ra+1j*Xla;\n",
+ "Zb=Rb-1j*Xcb;\n",
+ "Zeq=(Za*Zb)/(Za+Zb);\n",
+ "[r,t]=cmath.polar(Zeq);\n",
+ "Ia=V/Za;\n",
+ "[r1,t1]=cmath.polar(Ia);\n",
+ "Ib=V/Zb;\n",
+ "[r2,t2]=cmath.polar(Ib);\n",
+ "pf=cos(t);\n",
+ "print\"Branch current 1=\",Ia,\"=\",cmath.polar(Ia),\"=\",round(r1,3),\"A\"\n",
+ "print\"Branch current 2=\",Ib,\"=\",cmath.polar(Ib),\"=\",round(r2,3),\"A\"\n",
+ "print\"power factor=\",round(pf,2)\n",
+ "#In the book the final answer is given in the polar form."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Branch current 1= (1.31473160452-4.95642138023j) = (5.127829179131076, -1.3115093180978645) = 5.128 A\n",
+ "Branch current 2= (0.594126408901+2.36395386995j) = (2.437470838597086, 1.3245687251899845) = 2.437 A\n",
+ "power factor= 0.59\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.61:pg-242"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "Z1=14.14-1j*14.14; #Assigning values to parameters\n",
+ "Z2=26+1j*15;\n",
+ "I=10;\n",
+ "Zeq=Z1+Z2;\n",
+ "V=I*Zeq;\n",
+ "Zeq=(Z1*Z2)/(Z1+Z2);\n",
+ "I=V/Zeq;\n",
+ "[r,t]=cmath.polar(I);\n",
+ "print\"Supply current=\",I,\"=\",cmath.polar(I),\"=\",round(r,3),\"A\"\n",
+ "#In the book the final answer is given in the polar form."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Supply current= (25.6159787883+8.06347214395j) = (26.855128975653326, 0.3049633114846056) = 26.855 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.62:pg-243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "I=25*1j; #Assigning values to parameters\n",
+ "Z1=3-1j*4;\n",
+ "Z2=10;\n",
+ "I1=I*Z2/(Z1+Z2);\n",
+ "[r,t]=cmath.polar(I1);\n",
+ "I2=I-I1;\n",
+ "[r1,t1]=cmath.polar(I2);\n",
+ "print\"Current I1=\",I1,\"=\",cmath.polar(I1),\"=\",round(r,3),\"A\"\n",
+ "print\"Current I2=\",I2,\"=\",cmath.polar(I2),\"=\",round(r1,3),\"A\"\n",
+ "#In the book the final answer is given in the polar form."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current I1= (-5.40540540541+17.5675675676j) = (18.380365552345193, 1.869295258381076) = 18.38 A\n",
+ "Current I2= (5.40540540541+7.43243243243j) = (9.190182776172596, 0.9420000403794635) = 9.19 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.63:pg-244"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "V=120+1j*160; #Assigning values to parameters\n",
+ "Z1=12+1j*16;\n",
+ "Z2=10-1j*20;\n",
+ "I1=V/Z1;\n",
+ "I2=V/Z2;\n",
+ "[r,t]=cmath.polar(Z1);\n",
+ "kW1=(V*I1*cos(t))/1000;\n",
+ "[r1,t1]=cmath.polar(kW1);\n",
+ "kVAR1=(V*I1*sin(t))/1000;\n",
+ "[r2,t2]=cmath.polar(kVAR1);\n",
+ "kVA1=(V*I1)/1000;\n",
+ "[r3,t3]=cmath.polar(kVA1);\n",
+ "[ro,th]=cmath.polar(Z2);\n",
+ "kW2=(V*I2*cos(th))/1000;\n",
+ "[r4,t4]=cmath.polar(kW2);\n",
+ "kVAR2=(V*I2*sin(th))/1000;\n",
+ "[r5,t5]=cmath.polar(kVAR2);\n",
+ "kVA2=(V*I2)/1000;\n",
+ "[r6,t6]=cmath.polar(kVA2);\n",
+ "Zeq=(Z1*Z2)/(Z1+Z2);\n",
+ "[R,T]=cmath.polar(Zeq);\n",
+ "pf=cos(T);\n",
+ "print\"kW1=\",\"=\",kW1,cmath.polar(kW1),\"=\",round(r1,2)\n",
+ "print\"kVAR1=\",kVAR1,\"=\",cmath.polar(kVAR1),\"=\",round(r2,2)\n",
+ "print\"kVA1=\",kVA1,\"=\",cmath.polar(kVA1),\"=\",round(r3,2)\n",
+ "print\"kW2=\",kW2,\"=\",cmath.polar(kW2),\"=\",round(r4,2)\n",
+ "print\"kVAR2=\",kVAR2,\"=\",cmath.polar(kVAR2),\"=\",round(r5,2)\n",
+ "print\"kVA2=\",kVA2,\"=\",cmath.polar(kVA2),\"=\",round(r6,2)\n",
+ "print\"Power factor=\",round(pf,2)\n",
+ "#In the book the final answer is given in the polar form."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "kW1= = (0.72+0.96j) (1.2000000000000002, 0.9272952180016122) = 1.2\n",
+ "kVAR1= (0.96+1.28j) = (1.5999999999999999, 0.9272952180016123) = 1.6\n",
+ "kVA1= (1.2+1.6j) = (2.0, 0.9272952180016123) = 2.0\n",
+ "kW2= (-0.78709592808+0.14310835056j) = (0.8000000000000002, 2.961739153797315) = 0.8\n",
+ "kVAR2= (1.57419185616-0.28621670112j) = (1.5999999999999999, -0.1798534997924783) = 1.6\n",
+ "kVA2= (-1.76+0.32j) = (1.7888543819998317, 2.961739153797315) = 1.79\n",
+ "Power factor= 1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.65:pg-246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "R=30.0; #Assigning values to parameters\n",
+ "I=5.0;\n",
+ "V=110.0;\n",
+ "f=50.0;\n",
+ "I1=V/R;\n",
+ "I2=sqrt(I**2-I1**2);\n",
+ "Xc=V/I2;\n",
+ "C=1.0/(2*math.pi*f*Xc);\n",
+ "print\"Unknown capacitance when total current drawn is 5 A=\",round(C,8),\"Farad\"\n",
+ "Inew=4.0;\n",
+ "I2new=sqrt(Inew**2-I1**2);\n",
+ "I2new1=round(I2new,2);\n",
+ "Xc=110/1.59;\n",
+ "f=1.0/(2*math.pi*C*Xc);\n",
+ "print\"Frequency when total current drawn is 4 A=\",round(f,2),\"HZ\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Unknown capacitance when total current drawn is 5 A= 9.837e-05 Farad\n",
+ "Frequency when total current drawn is 4 A= 23.39 HZ\n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.66:pg-248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "L1=0.0191 #Assigning values to parameters\n",
+ "f=50;\n",
+ "Xl1=2*math.pi*f*L1;\n",
+ "C=398*10**-6;\n",
+ "Xc=1/(2*math.pi*f*C);\n",
+ "L3=0.0318\n",
+ "Xl3=2*math.pi*f*L3;\n",
+ "Z1=2+1j*Xl1;\n",
+ "Z2=7-1j*Xc;\n",
+ "Z3=8+1j*Xl3;\n",
+ "Zeq=((Z1*Z2)/(Z1+Z2))+Z3;\n",
+ "[r,t]=cmath.polar(Zeq)\n",
+ "print\"Equivalent Impedance=\",Zeq,\"=\",cmath.polar(Zeq),\"=\",round(r,3),\"ohms\"\n",
+ "#In the book the final answer is given in the polar form."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent Impedance= (13.9532833128+14.2011622329j) = (19.908970942113147, 0.7942021909974325) = 19.909 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.68:pg-251"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "Za=10+1j*8; #Assigning values to parameters\n",
+ "Zb=9-1j*6;\n",
+ "Zc=3+1j*2;\n",
+ "V2=100;\n",
+ "I=V2/Zc;\n",
+ "Ia=(I*Zb)/(Za+Zb);\n",
+ "[r,t]=cmath.polar(Ia);\n",
+ "Ib=I-Ia;\n",
+ "[r1,t1]=cmath.polar(Ib);\n",
+ "print\"Current Ia=\",Ia,\"=\",cmath.polar(Ia),\"=\",round(r,4),\"Amperes\"\n",
+ "print\"Current Ib=\",Ib,\"=\",cmath.polar(Ib),\"=\",round(r1,3),\"Amperes\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current Ia= (4.48893572181-15.0474183351j) = (15.70271767770641, -1.2808821458253687) = 15.7027 Amperes\n",
+ "Current Ib= (18.5879873551-0.337197049526j) = (18.591045580170096, -0.018138600054248756) = 18.591 Amperes\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.69:pg-252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "Im1=20.0; #Assigning values to parameters\n",
+ "Im2=40.0;\n",
+ "Im=25.0;\n",
+ "#function i1=f(wt), i1=Im1*sin(wt), endfunction\n",
+ "#function i2=f(wt), i2=Im2*sin(wt+%pi/6), endfunction\n",
+ "#function i=f(wt), i=Im*sin(wt+%pi/6), endfunction\n",
+ "Z=6+1j*8;\n",
+ "I1=Im1/sqrt(2);\n",
+ "I2=24.49+1j*14.14;\n",
+ "I=15.31+1j*8.84;\n",
+ "I3=I-(I1+I2);\n",
+ "[r,t]=cmath.polar(I3);\n",
+ "V=I*Z;\n",
+ "[r1,t1]=cmath.polar(V);\n",
+ "P=V*I*cos(t);\n",
+ "[r2,t2]=cmath.polar(P);\n",
+ "Z1=V/I1;\n",
+ "[r3,t3]=cmath.polar(Z1);\n",
+ "print\"Current I3=\",I3,\"=\",cmath.polar(I3),\"=\",round(r,3),\"Amperes\"\n",
+ "print\"Supply Voltage V=\",V,\"=\",cmath.polar(V),\"=\",round(r1,3),\"Volts\"\n",
+ "print\"Active Power P=\",P,\"=\",cmath.polar(P),\"=\",round(r2,3),\"Watts\"\n",
+ "print\"Impedance Z1=\",Z1,\"=\",cmath.polar(Z1),\"=\",round(r3,3),\"Ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current I3= (-23.3221356237-5.3j) = (23.916772567629184, -2.9181358418788084) = 23.917 Amperes\n",
+ "Supply Voltage V= (21.14+175.52j) = (176.78848944430746, 1.4509315848173419) = 176.788 Volts\n",
+ "Active Power P= (1197.41333962-2802.63102384j) = (3047.7105114663827, -1.167024701956722) = 3047.711 Watts\n",
+ "Impedance Z1= (1.49482373543+12.4111382234j) = (12.500833972179619, 1.4509315848173419) = 12.501 Ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.70:pg-255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "Z=8.66+1j*5; #Assigning values to parameters\n",
+ "Y=1.0/Z;\n",
+ "G=real(Y);\n",
+ "B=imag(Y);\n",
+ "print\"G =\",round(G,4),\"Mho\"\n",
+ "print\"B =\",round(-B,2),\"Mho\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "G = 0.0866 Mho\n",
+ "B = 0.05 Mho\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.71:pg-255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "V=230.0; #Assigning value to parameters\n",
+ "f=50.0;\n",
+ "Z1=8.66-5*1j;\n",
+ "Z2=10+17.32*1j;\n",
+ "Z3=40;\n",
+ "Y1=1.0/Z1;\n",
+ "[r1,t]=cmath.polar(Y1)\n",
+ "Y2=1.0/Z2;\n",
+ "[r2,t]=cmath.polar(Y2)\n",
+ "Y3=1.0/Z3;\n",
+ "[r3,t]=cmath.polar(Y3);\n",
+ "Y=Y1+Y2+Y3;\n",
+ "[r4,t]=cmath.polar(Y);\n",
+ "Z=1/Y;\n",
+ "[r,t]=cmath.polar(Z);\n",
+ "I=V/Z.real\n",
+ "[r5,t5]=cmath.polar(I);\n",
+ "pf=cos(t);\n",
+ "P=V*I*pf;\n",
+ "[r6,t6]=cmath.polar(P);\n",
+ "print\"Y1=\",Y1,\"=\",cmath.polar(Y1),\"=\",round(r1,2),\"Mho\"\n",
+ "print\"Y2=\",Y2,\"=\",cmath.polar(Y2),\"=\",round(r2,2),\"Mho\"\n",
+ "print\"Y3=\",Y3,\"=\",cmath.polar(Y3),\"=\",round(r3,3),\"Mho\"\n",
+ "print\"Equivalent Admittance Y=\",Y,\"=\",cmath.polar(Y),\"=\",round(r4,4),\"Ohms\"\n",
+ "print\"Equivalent Impedance Z=\",Z,\"=\",cmath.polar(Z),\"=\",round(r,3),\"Ohms\"\n",
+ "print\"Total current I=\",I,\"=\",cmath.polar(I),\"=\",round(r5,2),\"Amperes\"\n",
+ "print\"Power consumed P=\",P,\"=\",cmath.polar(P),\"=\",round(r6,2),\"Watts\"\n",
+ "print\"Power factor pf=\",round(pf,4)\n",
+ "#In the book the final answer is given in the polar form."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y1= (0.0866038105677+0.0500022000968j) = (0.10000220007260266, 0.5236114777699694) = 0.1 Mho\n",
+ "Y2= (0.0250011000484-0.0433019052838j) = (0.05000110003630133, -1.0471848490249271) = 0.05 Mho\n",
+ "Y3= 0.025 = (0.025, 0.0) = 0.025 Mho\n",
+ "Equivalent Admittance Y= (0.136604910616+0.00670029481297j) = (0.13676913231794818, 0.049009434500553055) = 0.1368 Ohms\n",
+ "Equivalent Impedance Z= (7.30281212656-0.358193523139j) = (7.311591314883045, -0.049009434500553055) = 7.312 Ohms\n",
+ "Total current I= 31.4947168315 = (31.494716831541105, 0.0) = 31.49 Amperes\n",
+ "Power consumed P= 7235.08709962 = (7235.087099619459, 0.0) = 7235.09 Watts\n",
+ "Power factor pf= 0.9988\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.72:pg-256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "V=200; #Assigning values to parameters\n",
+ "Z1=5*1j;\n",
+ "Z2=5+1j*8.66;\n",
+ "Z3=15;\n",
+ "Z4=-10*1j;\n",
+ "Y1=1.0/Z1;\n",
+ "Y2=1.0/Z2;\n",
+ "Y3=1.0/Z3;\n",
+ "Y4=1.0/Z4;\n",
+ "Yeq=Y1+Y2+Y3+Y4;\n",
+ "Zeq=1.0/Yeq;\n",
+ "I=V/Zeq;\n",
+ "[r,t]=cmath.polar(I);\n",
+ "print\"Total current\",\"=\", I,\"=\",cmath.polar(I),\"=\",round(r,2),\"A\"\n",
+ "#In the book the final answer is given in the polar form."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total current = (23.3337733527-37.3207621135j) = (44.01481868200551, -1.012037159177007) = 44.01 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 93
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.73:pg-258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "Xl=4.0; #Assigning values to parameters\n",
+ "Xc=8.0;\n",
+ "Z1=1.0;\n",
+ "Z2=4*1j;\n",
+ "Z3=-1j*8;\n",
+ "Zeq=Z1+(Z2*Z3)/(Z2+Z3);\n",
+ "Y=1.0/Zeq;\n",
+ "[r,t]=cmath.polar(Y);\n",
+ "print\"Admittance=\",Y,\"=\",cmath.polar(Y),\"=\",round(r,3),\"Mho\"\n",
+ "Xl=10.0;\n",
+ "Xc=5.0;\n",
+ "Z1=1.0;\n",
+ "Z2=10.0*1j;\n",
+ "Z3=-1j*5;\n",
+ "Zeq=Z1+(Z2*Z3)/(Z2+Z3);\n",
+ "Y=1.0/Zeq;\n",
+ "[r,t]=cmath.polar(Y);\n",
+ "print\"Admittance=\",Y,\"=\",cmath.polar(Y),\"=\",round(r,4),\"Mho\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Admittance= (0.0153846153846-0.123076923077j) = (0.12403473458920845, -1.446441332248135) = 0.124 Mho\n",
+ "Admittance= (0.00990099009901+0.0990099009901j) = (0.09950371902099893, 1.4711276743037347) = 0.0995 Mho\n"
+ ]
+ }
+ ],
+ "prompt_number": 91
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.74:pg-260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "Z1=14+1j*5; #Assigning values to parameters\n",
+ "Z2=18+1j*10;\n",
+ "V=200;\n",
+ "Y1=1.0/Z1;\n",
+ "[r0,t0]=cmath.polar(Y1);\n",
+ "Y2=1.0/Z2;\n",
+ "[r3,t3]=cmath.polar(Y2);\n",
+ "Yeq=Y1+Y2;\n",
+ "[r4,t4]=cmath.polar(Yeq);\n",
+ "Zeq=1.0/Yeq;\n",
+ "I1=V/Z1;\n",
+ "[r5,t5]=cmath.polar(I1);\n",
+ "I2=V/Z2;\n",
+ "[r6,t6]=cmath.polar(I2);\n",
+ "I=V/Zeq;\n",
+ "[r7,t7]=cmath.polar(I);\n",
+ "P1=I1**2*real(Z1);\n",
+ "[r8,t8]=cmath.polar(P1);\n",
+ "P2=I2**2*real(Z2);\n",
+ "[r9,t9]=cmath.polar(P2);\n",
+ "[r,t]=cmath.polar(Zeq);\n",
+ "[r1,t1]=cmath.polar(Z1);\n",
+ "[r2,t2]=cmath.polar(Z2);\n",
+ "pf1=cos(t1);\n",
+ "pf2=cos(t2);\n",
+ "pf=cos(t);\n",
+ "print\"Y1=\",Y1,\"=\",cmath.polar(Y1),\"=\",round(r0,3),\"Mho\"\n",
+ "print\"Y2=\",Y2,\"=\",cmath.polar(Y2),\"=\",round(r3,3),\"Mho\"\n",
+ "print\"Yeq=\",Yeq,\"=\",cmath.polar(Yeq),\"=\",round(r4,3),\"Mho\"\n",
+ "print\"Branch current I1=\",I1,\"=\",cmath.polar(I1),\"=\",round(r5,3),\"Amperes\"\n",
+ "print\"Branch current I2=\",I2,\"=\",cmath.polar(I2),\"=\",round(r6,3),\"Amperes\"\n",
+ "print\"Total current I=\",I,\"=\",cmath.polar(I),\"=\",round(r7,2),\"Amperes\"\n",
+ "print\"Power consumed by branch1=\",P1,\"=\",cmath.polar(P1),\"=\",round(r8,3),\"Watts\"\n",
+ "print\"Power consumed by branch2=\",P2,\"=\",cmath.polar(P2),\"=\",round(r9,3),\"Watts\"\n",
+ "print\"Power factor of branch1=\",round(pf1,3)\n",
+ "print\"Power factor of branch2=\",round(pf2,3)\n",
+ "print\"Total Power factor=\",round(pf,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y1= (0.0633484162896-0.0226244343891j) = (0.06726727939963124, -0.3430239404207034) = 0.067 Mho\n",
+ "Y2= (0.0424528301887-0.0235849056604j) = (0.04856429311786321, -0.507098504392337) = 0.049 Mho\n",
+ "Yeq= (0.105801246478-0.0462093400495j) = (0.11545218431960486, -0.41178588495508256) = 0.115 Mho\n",
+ "Branch current I1= (12.6696832579-4.52488687783j) = (13.45345587992625, -0.3430239404207034) = 13.453 Amperes\n",
+ "Branch current I2= (8.49056603774-4.71698113208j) = (9.712858623572641, -0.507098504392337) = 9.713 Amperes\n",
+ "Total current I= (21.1602492957-9.2418680099j) = (23.09043686392097, -0.41178588495508256) = 23.09 Amperes\n",
+ "Power consumed by branch1= (1960.64781638-1605.20873856j) = (2533.9366515837105, -0.6860478808414068) = 2533.937 Watts\n",
+ "Power consumed by branch2= (897.116411534-1441.79423282j) = (1698.1132075471692, -1.014197008784674) = 1698.113 Watts\n",
+ "Power factor of branch1= 0.942\n",
+ "Power factor of branch2= 0.874\n",
+ "Total Power factor= 0.916\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.75:pg-262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "V=230; #Assigning values to parameters\n",
+ "f=50;\n",
+ "L=0.08;\n",
+ "Xl=2*math.pi*f*L;\n",
+ "C=200*10**-6;\n",
+ "Xc=1/(2*math.pi*f*C);\n",
+ "Z1=20+1j*25.13;\n",
+ "Z2=10-1j*15.92;\n",
+ "Y1=1.0/Z1;\n",
+ "Y2=1.0/Z2;\n",
+ "Y=Y1+Y2;\n",
+ "I=V*Y;\n",
+ "[r,t]=cmath.polar(I);\n",
+ "pf=cos(t);\n",
+ "Z=1.0/Y;\n",
+ "[r1,t1]=cmath.polar(Z)\n",
+ "R=real(Z);\n",
+ "Xc=-1*imag(Z);\n",
+ "C=1.0/(2*math.pi*f*Xc);\n",
+ "[r2,t2]=cmath.polar(C);\n",
+ "print\"Supply Current=\",I,\"=\",cmath.polar(I),\"=\",round(r,2),\"A\"\n",
+ "print\"Power factor=\",round(pf,3)\n",
+ "print\"Total impedance=\",Z,\"=\",cmath.polar(Z),\"=\",round(r1,2),\"Ohms\"\n",
+ "print\"Resistance of eequivalent series circuit=\",R,\"=\",cmath.polar(R),\"=\",round(r1,2),\"Ohms\"\n",
+ "print\"Capacitance of eequivalent series circuit=\",C,\"=\",cmath.polar(C),\"=\",round(r2,5),\"Farads\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Supply Current= (10.9668035101+4.75640244987j) = (11.953833840878367, 0.40922414432872894) = 11.95 A\n",
+ "Power factor= 0.917\n",
+ "Total impedance= (17.6519817092-7.6558250514j) = (19.240689059393823, -0.409224144328729) = 19.24 Ohms\n",
+ "Resistance of eequivalent series circuit= 17.6519817092 = (17.651981709220966, 0.0) = 19.24 Ohms\n",
+ "Capacitance of eequivalent series circuit= 0.000415774765028 = (0.0004157747650276909, 0.0) = 0.00042 Farads\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.76:pg-263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "V=200; #Assigning values to parameters\n",
+ "Z1=3+4*1j;\n",
+ "Z2=4-1j*3;\n",
+ "Z3=4.57+1j*5.51;\n",
+ "Y1=1.0/Z1;\n",
+ "Y2=1.0/Z2;\n",
+ "Yab=Y1+Y2;\n",
+ "Zab=1.0/Yab;\n",
+ "Z=Zab+Z3;\n",
+ "[r,t]=cmath.polar(Z);\n",
+ "I=V/r\n",
+ "pf=cos(t);\n",
+ "print\"Total Impedance=\",Z,\"=\",cmath.polar(Z),\"=\",round(r,2),\"Ohms\"\n",
+ "print\"Supply current=\",round(I,2),\"A\"\n",
+ "print\"Power factor=\",round(pf,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Impedance= (8.07+6.01j) = (10.06205744368417, 0.6401220717631577) = 10.06 Ohms\n",
+ "Supply current= 19.88 A\n",
+ "Power factor= 0.802\n"
+ ]
+ }
+ ],
+ "prompt_number": 77
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.77:pg-268"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "C=2.5*10**-6; #Assigning values to parameters\n",
+ "R=15.0;\n",
+ "L=260*10**-3;\n",
+ "temp=(1.0/(L*C))-(R**2/L**2);\n",
+ "fr=(1.0/20*math.pi)*sqrt(temp);\n",
+ "Q=(2*math.pi*fr*L)/R;\n",
+ "Zr=L/(C*R);\n",
+ "print\"Resonant frequeny=\",round(fr,2),\"Hertz\"\n",
+ "print\"Quality factor=\",round(Q,2)\n",
+ "print\"Dynamic Impedance=\",round(Zr,2),\"Ohms\"\n",
+ "#the answer of the fr in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resonant frequeny= 194.62 Hertz\n",
+ "Quality factor= 21.2\n",
+ "Dynamic Impedance= 6933.33 Ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.78:pg-268"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "C=200*10**-6; #Assigning values to parameters\n",
+ "V=230.0;\n",
+ "R=20.0;\n",
+ "L=0.2;\n",
+ "temp=((1.0/(L*C))-(R**2/L**2));\n",
+ "fr=sqrt(temp)/(2*math.pi);\n",
+ "Zr=L/(C*R);\n",
+ "Ir=V/Zr;\n",
+ "Zl=sqrt(R**2+(2*math.pi*fr*L)**2);\n",
+ "Il=V/Zl;\n",
+ "Xc=1.0/(2*math.pi*fr*C);\n",
+ "Ic=V/Xc;\n",
+ "phi=math.atan(2*math.pi*fr*L/R);\n",
+ "phi=math.degrees(phi);\n",
+ "print\"Resonant frequency\",round(fr,2),\"Hertz\"\n",
+ "print\"Dynamic impedance of the circuit=\",round(Zr,2),\"Ohms\"\n",
+ "print\"circuit current Ir=\",round(Ir,2),\"A\"\n",
+ "print\"current Il=\",round(Il,2),\"A\"\n",
+ "print\"current Ic=\",round(Ic,2),\"A\"\n",
+ "print\"phase angle of the coil phi=\",round(phi,2),\"degrees\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resonant frequency 19.49 Hertz\n",
+ "Dynamic impedance of the circuit= 50.0 Ohms\n",
+ "circuit current Ir= 4.6 A\n",
+ "current Il= 7.27 A\n",
+ "current Ic= 5.63 A\n",
+ "phase angle of the coil phi= 50.77 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 87
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.79:pg-270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "pfcoil=0.3; #Assigning values to parameters\n",
+ "phi=math.acos(pfcoil);\n",
+ "V=100.0;\n",
+ "f=50.0;\n",
+ "Il=1.0;\n",
+ "Ic=Il*sin(phi);\n",
+ "Xc=V/Ic;\n",
+ "C=1.0/(2*math.pi*f*Xc);\n",
+ "Ir=Il*cos(phi);\n",
+ "Zr=V/Ir;\n",
+ "print\"Capacitance=\",round(C,8),\"Farads\"\n",
+ "print\"Dynamic impedance=\",round(Zr,2),\"Ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance= 3.036e-05 Farads\n",
+ "Dynamic impedance= 333.33 Ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.80:pg-271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "V=200.0; #Assigning values to parameters\n",
+ "f=50.0;\n",
+ "L=20.0;\n",
+ "R=15.0;\n",
+ "Zl=sqrt(R**2+L**2);\n",
+ "pfcoil=R/Zl;\n",
+ "phi=math.acos(pfcoil);\n",
+ "Il=V/Zl;\n",
+ "Ic=Il*sin(phi);\n",
+ "Xc=V/Ic;\n",
+ "C=1/(2*math.pi*f*Xc);\n",
+ "Ir=Il*math.cos(phi);\n",
+ "print\"Power factor=\",round(pfcoil,2)\n",
+ "print\"Current=\",round(Il.real,2),\"A\"\n",
+ "print\"Value f shunting capacitance=\",\"{:.4e}\".format(C),\"Farads\"\n",
+ "print\"Circuit current at resonance=\",round(Ir.real,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power factor= 0.6\n",
+ "Current= 8.0 A\n",
+ "Value f shunting capacitance= 1.0186e-04 Farads\n",
+ "Circuit current at resonance= 4.8 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 83
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter3.ipynb b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter3.ipynb new file mode 100644 index 00000000..16142135 --- /dev/null +++ b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter3.ipynb @@ -0,0 +1,798 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f5ac69af9ae1d841a7df309d87210c9fa6bb22448fba66aee7e2b96f7445f61f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter3:THREE PHASE CIRCUITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.1:pg-286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "f=50.0; #Assigning values to parameters\n",
+ "Vl=400.0;\n",
+ "Rph=20.0;\n",
+ "L=0.5;\n",
+ "Xl=2*math.pi*f*L;\n",
+ "Zph=20+1j*157;\n",
+ "[r,t]=cmath.polar(Zph);\n",
+ "Vph=Vl/sqrt(3); #Star connection\n",
+ "Iph=Vph/r;\n",
+ "Il=Iph;\n",
+ "P=sqrt(3)*Vl*Il*cos(t);\n",
+ "print\"The line current for Star connection is Il=\",round(Il,2),\"Amperes\"\n",
+ "print\"The total power absorbed in Star connection is P=\",round(P,3),\"Watts\"\n",
+ "Vph=Vl; #Delta connection\n",
+ "Iph=Vph/r;\n",
+ "Il=sqrt(3)*Iph;\n",
+ "P=sqrt(3)*Vl*Il*cos(t);\n",
+ "print\"The line current for Delta connection is Il=\",round(Il,2),\"Amperes\"\n",
+ "print\"The total power absorbed in Delta connection is P=\",round(P,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The line current for Star connection is Il= 1.46 Amperes\n",
+ "The total power absorbed in Star connection is P= 127.75 Watts\n",
+ "The line current for Delta connection is Il= 4.38 Amperes\n",
+ "The total power absorbed in Delta connection is P= 383.25 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.2:pg-288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "f=50 #Assigning values to parameters\n",
+ "rph=8\n",
+ "l=0.02\n",
+ "xl=2*math.pi*f*l\n",
+ "vl=230\n",
+ "f=50\n",
+ "vph=vl/sqrt(3)\n",
+ "zph=8+1j*6.28\n",
+ "[r,t]=cmath.polar(zph)\n",
+ "iph=vph/r\n",
+ "il=iph\n",
+ "p=sqrt(3)*vl*il*cos(t)\n",
+ "q=sqrt(3)*vl*il*sin(t)\n",
+ "s=sqrt(3)*vl*il\n",
+ "print\"The line current is il=\",round(il,2),\"Amperes\"\n",
+ "print\"The total Power absorbed is P=\",round(P,2),\"Watts\"\n",
+ "print\"The reactive volt amperes is q=\",round(q,2),\"VAR\"\n",
+ "print\"The Volt amperes is s=\",round(s,2),\"Volt Ampere\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The line current is il= 13.06 Amperes\n",
+ "The total Power absorbed is P= 383.25 Watts\n",
+ "The reactive volt amperes is q= 3211.69 VAR\n",
+ "The Volt amperes is s= 5201.33 Volt Ampere\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.3:pg-289"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "Vl=230; #Assigning values to parameters\n",
+ "f=50;\n",
+ "Rph=15;\n",
+ "L=0.03;\n",
+ "Xl=2*math.pi*f*L;\n",
+ "Zph=15+1j*9.42;\n",
+ "[r,t]=cmath.polar(Zph)\n",
+ "Vph=Vl;\n",
+ "Iph=Vph/r;\n",
+ "Il=sqrt(3)*Iph;\n",
+ "P=sqrt(3)*Vl*Il*cos(t);\n",
+ "print\"Phase current is Iph=\",round(Iph,2),\"Amperes\"\n",
+ "print\"Line current is Il=\",round(Il,1),\"Amperes\"\n",
+ "print\"Power absorbed is=\",round(P/1000,2),\"KW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Phase current is Iph= 12.99 Amperes\n",
+ "Line current is Il= 22.5 Amperes\n",
+ "Power absorbed is= 7.59 KW\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.4:pg-290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "f=50#assigning values to the parameters\n",
+ "xc=200\n",
+ "vph=400\n",
+ "vl=vph\n",
+ "zph=14.151-1j*200\n",
+ "[r,t]=cmath.polar(zph)\n",
+ "iph=vph/r\n",
+ "il=sqrt(3)*iph\n",
+ "p=sqrt(3)*vl*il*cos(t)\n",
+ "pwr=vph*iph*cos(t)\n",
+ "c=1.0/(2*math.pi*f*xc)\n",
+ "print\"power consumed in each branch of delta is pwr=\",round(pwr,2),\"Watts\"\n",
+ "print\"capacitive reactance is c=\"\"{:.2e}\".format(c),\"Farads\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "power consumed in each branch of delta is pwr= 56.32 Watts\n",
+ "capacitive reactance is c=1.59e-05 Farads\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.5:pg-290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "l=50 #Assigning values to parameters\n",
+ "w=800\n",
+ "c=50\n",
+ "xl=w*l\n",
+ "xc=1/(w*c)\n",
+ "z1=0+1j*40\n",
+ "z2=50\n",
+ "z3=0-1j*25\n",
+ "zph=z1+z2*z3/(z2+z3)\n",
+ "[r,t]=cmath.polar(zph)\n",
+ "vl=550\n",
+ "vph=vl\n",
+ "iph=vph/r\n",
+ "il=sqrt(3)*iph\n",
+ "p=sqrt(3)*vl*il*cos(t)\n",
+ "pf=cos(t)\n",
+ "q=sqrt(3)*vl*il*sin(t)\n",
+ "s=sqrt(3)*vl*il\n",
+ "print\"The phase current is\",round(iph,2),\"Amperes\"\n",
+ "print\"The line current is\",round(il,2),\"Amperes\"\n",
+ "print\"The power drawn is\",round(p/1000,2),\"kw\"\n",
+ "print\"The power factor is\",round(pf,2)\n",
+ "print\"The reactive power is\",round(q/1000,2),\"kw\"\n",
+ "print\"The kva rating of load is\",round(s/1000,2),\"KVA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The phase current is 24.6 Amperes\n",
+ "The line current is 42.6 Amperes\n",
+ "The power drawn is 18.15 kw\n",
+ "The power factor is 0.45\n",
+ "The reactive power is 36.3 kw\n",
+ "The kva rating of load is 40.58 KVA\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.7:pg-294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "p=10000 #Assigning values to parameters\n",
+ "t=math.acos(0.6)\n",
+ "vl=440\n",
+ "vph=vl\n",
+ "il=p/(sqrt(3)*vl*cos(t))\n",
+ "iph=il/sqrt(3)\n",
+ "zph=vph/iph\n",
+ "zph1=20.9-1j*27.87\n",
+ "res=zph1.real\n",
+ "xc=zph1.imag\n",
+ "q=sqrt(3)*vl*il*sin(t)\n",
+ "print\"The resistance value of circuit element is\",round(res,2),\"ohms\"\n",
+ "print\"The capacitive value of circuit element is\",round(-xc,2),\"ohms\"\n",
+ "print\"The reactive volt-ampere\",round(-q/1000,2),\"KVAR\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance value of circuit element is 20.9 ohms\n",
+ "The capacitive value of circuit element is 27.87 ohms\n",
+ "The reactive volt-ampere -13.33 KVAR\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.8:pg-295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "f=50 #Assigning values to parameters\n",
+ "vl=440\n",
+ "p=1500\n",
+ "t=math.acos(0.2)\n",
+ "vph=vl/sqrt(3)\n",
+ "il=p/(sqrt(3)*vl*p*cos(t))\n",
+ "iph=il\n",
+ "zph=vph/iph\n",
+ "zph1=5.17+1j*25.3\n",
+ "res=zph1.real\n",
+ "xl=zph1.imag\n",
+ "l=xl/(2*math.pi*f)\n",
+ "print\"The resistive circuit constant is\",round(res,2),\"ohms\"\n",
+ "print\"The inductive circuit constant is\",round(l,2),\"H\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistive circuit constant is 5.17 ohms\n",
+ "The inductive circuit constant is 0.08 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.9:pg-296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "p=100000 #Assigning values to parameters\n",
+ "il=80\n",
+ "vl=1100\n",
+ "f=50\n",
+ "vph=vl/sqrt(3)\n",
+ "iph=il\n",
+ "zph=vph/iph\n",
+ "t=math.acos(p/(sqrt(3)*vl*il))\n",
+ "zph1=5.21-1j*6\n",
+ "r=zph1.real\n",
+ "xc=zph1.imag\n",
+ "c=1/(2*math.pi*f*xc)\n",
+ "print\"The resistive circuit constant is\",round(r,2),\"ohms\"\n",
+ "print\"The capacitive circuit constant is\",round(-xc,2),\"ohms\"\n",
+ "print\"The capacitance is\",\"{:.2e}\".format(-c),\"farads\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistive circuit constant is 5.21 ohms\n",
+ "The capacitive circuit constant is 6.0 ohms\n",
+ "The capacitance is 5.31e-04 farads\n"
+ ]
+ }
+ ],
+ "prompt_number": 58
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.10:pg-296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "Vl=400; #Assigning values to parameters\n",
+ "Il=34.65;\n",
+ "P=14.4*10**3;\n",
+ "Vph=Vl;\n",
+ "Iph=Il/sqrt(3);\n",
+ "Zph=Vph/Iph;\n",
+ "t=math.acos(P/(sqrt(3)*Vl*Il))\n",
+ "Z=complex(Zph,t);\n",
+ "a=cmath.rect(Zph,t)\n",
+ "print\"Impedance\",a,\"ohms\"\n",
+ "print \"Resistance\",round(a.real),\"ohms\"\n",
+ "print \"Reactance\",round(a.imag),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Impedance (11.9937782275+15.9981840036j) ohms\n",
+ "Resistance 12.0 ohms\n",
+ "Reactance 16.0 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 79
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.11:pg-297"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import cmath\n",
+ "vl=415 #assigning values to the parameters\n",
+ "r=15\n",
+ "l=0.1\n",
+ "c=177*10**-6\n",
+ "f=50\n",
+ "vph=vl/sqrt(3)\n",
+ "xl=2*math.pi*f*l\n",
+ "xc=1.0/(2*math.pi*f*c)\n",
+ "a=xl-xc\n",
+ "zph=r+1j*a\n",
+ "[r1,t]=cmath.polar(zph)\n",
+ "iph=vph/r1\n",
+ "il=iph\n",
+ "p=sqrt(3)*vl*il*cos(t)\n",
+ "q=sqrt(3)*vl*il*sin(t)\n",
+ "s=sqrt(3)*vl*il\n",
+ "print\"The phase current is\",round(iph,1),\"Amperes\"\n",
+ "print\"The line current is\",round(il,2),\"Amperes\"\n",
+ "print\"The power drawn is\",round(p/1000,2),\"KW\"\n",
+ "print\"The reactive power is\",round(q/1000,2),\"KVAR\"\n",
+ "print\"The total kVA is\",round(s/1000,2),\"KVA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The phase current is 11.9 Amperes\n",
+ "The line current is 11.9 Amperes\n",
+ "The power drawn is 6.37 KW\n",
+ "The reactive power is 5.71 KVAR\n",
+ "The total kVA is 8.55 KVA\n"
+ ]
+ }
+ ],
+ "prompt_number": 102
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.12:pg-299"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "vl=400 #assigning values to the parameters\n",
+ "t=0\n",
+ "zph=50\n",
+ "vph=vl/sqrt(3)\n",
+ "iph=vph/zph\n",
+ "il=iph\n",
+ "p=sqrt(3)*vl*il*cos(t)\n",
+ "print\"Power taken is\",round(p,2),\"Watts\"\n",
+ "iph=4\n",
+ "il=iph\n",
+ "p=vl*il*cos(t)\n",
+ "print\"Power taken after disconecting one of the resistor is\",round(p,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power taken is 3200.0 Watts\n",
+ "Power taken after disconecting one of the resistor is 1600.0 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 103
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.13:pg-300"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "vl=400 #Assigning values to parameters\n",
+ "vph=vl\n",
+ "r=40\n",
+ "t=0\n",
+ "iph=vph/r\n",
+ "il=sqrt(3)*iph\n",
+ "p=sqrt(3)*vl*il*cos(t)\n",
+ "print\"Power taken is\",round(p,2),\"Watts\"\n",
+ "i=10\n",
+ "p=2*i*i*r\n",
+ "print\"Power taken after diconnecting one resistor is\",round(p,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power taken is 12000.0 Watts\n",
+ "Power taken after diconnecting one resistor is 8000.0 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 104
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.16:pg-310"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "w1=500 #Assigning values to parameters\n",
+ "w2=2500\n",
+ "p=w1+w2\n",
+ "t=math.atan(sqrt(3)*(w2-w1)/(w1+w2))\n",
+ "pf=cos(t)\n",
+ "print\"Total Power supplied is\",round(p,2),\"Watts\"\n",
+ "print\"Power factor is\",round(pf,3)\n",
+ "w2=2500\n",
+ "w1=-500\n",
+ "p=w1+w2\n",
+ "t=math.atan(sqrt(3)*(w2-w1)/(w1+w2))\n",
+ "pf=cos(t)\n",
+ "print\"Total Power supplied after reversing the connections to the current coil is\",round(p,2),\"Watts\"\n",
+ "print\"Power factor after reversing the connections to the current coil is\",round(pf,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Power supplied is 3000.0 Watts\n",
+ "Power factor is 0.655\n",
+ "Total Power supplied after reversing the connections to the current coil is 2000.0 Watts\n",
+ "Power factor after reversing the connections to the current coil is 0.359\n"
+ ]
+ }
+ ],
+ "prompt_number": 117
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.17:pg-311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "w1=3000 #Assigning values to parameters\n",
+ "w2=5000\n",
+ "t=math.atan(sqrt(3)*(w2-w1)/(w1+w2))\n",
+ "pf=cos(t)\n",
+ "p=w1+w2\n",
+ "il=p/(sqrt(3)*vl*cos(t))\n",
+ "print\"Watts\",p,\"Total Power supplied is\",round(p,2),\"Watts\"\n",
+ "print\"Power factor is\",round(pf,2)\n",
+ "print\"The line current is\",round(il,2),\"Amperes\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Watts 8000 Total Power supplied is 8000.0 Watts\n",
+ "Power factor is 0.92\n",
+ "The line current is 12.58 Amperes\n"
+ ]
+ }
+ ],
+ "prompt_number": 112
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex3.18:pg-311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "w1=-1000 #Assigning values to parameters\n",
+ "w2=3000\n",
+ "vl=400\n",
+ "t=math.atan(sqrt(3)*(w2-w1)/(w1+w2))\n",
+ "pf=cos(t)\n",
+ "p=w1+w2\n",
+ "il=p/(sqrt(3)*vl*cos(t))\n",
+ "print\"Total Power supplied is\",round(p,2),\"Watts\"\n",
+ "print\"Power factor is\",round(pf,3)\n",
+ "print\"The line current is\",round(il,2),\"Amperes\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Power supplied is 2000.0 Watts\n",
+ "Power factor is 0.277\n",
+ "The line current is 10.41 Amperes\n"
+ ]
+ }
+ ],
+ "prompt_number": 119
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex3.19:pg-312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "w1=100000 #Assigning values to parameters\n",
+ "w2=300000\n",
+ "vl=2000\n",
+ "n=0.9\n",
+ "t=math.atan(sqrt(3)*(w2-w1)/(w1+w2))\n",
+ "pf=cos(t)\n",
+ "p=w1+w2\n",
+ "il=p/(sqrt(3)*vl*cos(t))\n",
+ "print\"Total Power supplied is\",round(p,2),\"Watts\"\n",
+ "print\"Power factor is\",round(pf,2)\n",
+ "print\"The line current is\",round(il,2),\"Amperes\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Power supplied is 400000.0 Watts\n",
+ "Power factor is 0.76\n",
+ "The line current is 152.75 Amperes\n"
+ ]
+ }
+ ],
+ "prompt_number": 121
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex3.20:pg-312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "vl=220 #Assigning values to parameters\n",
+ "il=38\n",
+ "n=0.88\n",
+ "p=11200\n",
+ "ip=p/n\n",
+ "t=math.acos(ip/(sqrt(3)*vl*il))\n",
+ "a=math.degrees(t)\n",
+ "w2=vl*il*cos(30-a)\n",
+ "w1=vl*il*cos(30+a)\n",
+ "print\"The wattmeter reading is w2=\",round(w2,2),\"Watts\"\n",
+ "print\"The wattmeter reading is w1=\",round(w1,2),\"Watts\"\n",
+ "# the answer of w2,w1 are wrong in the book\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The wattmeter reading is w2= 449.52 Watts\n",
+ "The wattmeter reading is w1= -2972.66 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 138
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex3.21:pg-313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "w1=1 #Assigning values to parameters\n",
+ "w2=2*w1\n",
+ "t=math.atan(sqrt(3)*(w2-w1)/(w1+w2))\n",
+ "pf=cos(t)\n",
+ "print\"Power factor is\",round(pf,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power factor is 0.866\n"
+ ]
+ }
+ ],
+ "prompt_number": 127
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter4.ipynb b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter4.ipynb new file mode 100644 index 00000000..43ee0636 --- /dev/null +++ b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/chapter4.ipynb @@ -0,0 +1,1093 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:bb989fb1fd31462248b192e15441cbb384879f100f9a8a541dfbefbf515c52a9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter4:SINGLE-PHASE TRANSFORMER"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.1:pg-332"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "n2=40.0 #Assigning values to parameters\n",
+ "n1=600.0\n",
+ "kva=50.0\n",
+ "e1=2200.0\n",
+ "e2=(e1*n2)/n1\n",
+ "i1=kva*1000/e1\n",
+ "i2=kva*1000/e2\n",
+ "print\"The primary full load current is\",round(i1,2),\"A\"\n",
+ "print\"The secondary full load current is\",round(i2,2),\"A\"\n",
+ "print\"The secondary voltage at node is\",round(e2,2),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The primary full load current is 22.73 A\n",
+ "The secondary full load current is 340.91 A\n",
+ "The secondary voltage at node is 146.67 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.2:pg-333"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "e1=3200 #Assigning values to parameters\n",
+ "f=50\n",
+ "bm=1.2\n",
+ "e2=400\n",
+ "n2=111\n",
+ "kva=80\n",
+ "n1=e1*n2/e2\n",
+ "i2=kva*1000/e2\n",
+ "a=e2/(4.44*f*n2*bm)\n",
+ "print\"number of turns on primary windings is n1=\",round(n1,2)\n",
+ "print\"The secondary full load current is i2=\",round(i2,2),\"A\"\n",
+ "print\"The cross-sectional area is a=\",round(a,4),\"meter square\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "number of turns on primary windings is n1= 888.0\n",
+ "The secondary full load current is i2= 200.0 A\n",
+ "The cross-sectional area is a= 0.0135 meter square\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.3:pg-333"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "e1=6000 #Assigning values to parameters\n",
+ "f=50\n",
+ "e2=250\n",
+ "fm=0.06\n",
+ "n1=e1/(4.44*f*fm)\n",
+ "n2=e2/(4.44*f*fm)\n",
+ "print\"number of turns on primary windings is\",round(n1,2),\"turns\"\n",
+ "print\"number of turns on secondary windings is\",round(n2,3),\"turns\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "number of turns on primary windings is 450.45 turns\n",
+ "number of turns on secondary windings is 18.769 turns\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.4:pg-334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "f=50.0\n",
+ "n2=50.0 #Assigning values to parameters\n",
+ "n1=500.0\n",
+ "kva=25.0\n",
+ "e1=3000.0\n",
+ "k=n2/n1\n",
+ "i1=kva*1000/e1\n",
+ "i2=i1/k\n",
+ "e2=k*e1\n",
+ "fm=e1/(4.44*f*n1)\n",
+ "print\"The primary full load current is\",round(i1,2),\"A\"\n",
+ "print\"The secondary full load current is\",round(i2,2),\"A\"\n",
+ "print\"The secondary emf is\",round(e2,2),\"Volts\"\n",
+ "print\"The maximum flux is\",round(fm,3),\"Wb\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The primary full load current is 8.33 A\n",
+ "The secondary full load current is 83.33 A\n",
+ "The secondary emf is 300.0 Volts\n",
+ "The maximum flux is 0.027 Wb\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.5:pg-335"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "e1=230.0 #Assigning values to parameters\n",
+ "v1=e1\n",
+ "i0=5.0\n",
+ "t=math.acos(0.25)\n",
+ "n1=200.0\n",
+ "f=50.0\n",
+ "fm=e1/(4.44*f*n1)\n",
+ "w1=v1*i0*cos(t)\n",
+ "iu=i0*sin(t)\n",
+ "print\"The maximum flux is\",round(fm*1000,3),\"mWb\"\n",
+ "print\"The core loss is\",round(w1,2),\"Watts\"\n",
+ "print\"The maximum current is\",round(iu,2),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum flux is 5.18 mWb\n",
+ "The core loss is 287.5 Watts\n",
+ "The maximum current is 4.84 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.6:pg-335"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "k=0.25 #Assigning values to parameters\n",
+ "sr=50\n",
+ "pr=sr/(k*k)\n",
+ "print\"The Secondary resistance is\",round(pr,2),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Secondary resistance is 800.0 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.9:pg-338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "wf=2500 #Assigning values to parameters\n",
+ "w6=0.6*0.6*wf\n",
+ "w5=0.5*0.5*wf\n",
+ "print\"The copper loss at 60% full-load condition is\",round(w6,2),\"Watts\"\n",
+ "print\"The copper loss at 50% full-load conditionis\",round(w5,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The copper loss at 60% full-load condition is 900.0 Watts\n",
+ "The copper loss at 50% full-load conditionis 625.0 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.10:pg-338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "w7=1200 #Assigning values to parameters\n",
+ "wf=w7/(0.75*0.75)\n",
+ "w5=0.5*0.5*wf\n",
+ "print\"The copper loss at 50% full-load condition is\",round(w5,2),\"Watts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The copper loss at 50% full-load condition is 533.33 Watts\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.11:pg-339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "V=230.0; #Assigning values to parameters\n",
+ "VA=350.0;\n",
+ "loss=110.0;\n",
+ "I0=VA/V;\n",
+ "pf=loss/VA;\n",
+ "Iw=I0*pf;\n",
+ "Iu=sqrt(I0**2-Iw**2);\n",
+ "print\"Iron loss component of no load current\",round(Iw,3),\"A\"\n",
+ "print\"Magnatizing component of no load current\",round(Iu,2),\"A\"\n",
+ "print\"no load power factor\",round(pf,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Iron loss component of no load current 0.478 A\n",
+ "Magnatizing component of no load current 1.44 A\n",
+ "no load power factor 0.314\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex4.13:pg-354"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "r1=0.2 #Assigning values to parameters\n",
+ "x1=0.75\n",
+ "r2=0.05\n",
+ "x2=0.2\n",
+ "pf=0.8\n",
+ "e2=125.0\n",
+ "e1=250.0\n",
+ "t=math.acos(0.8)\n",
+ "k=e2/e1\n",
+ "kva=5.0\n",
+ "i2=kva*1000/e2\n",
+ "r02=r2+k*k*r1\n",
+ "x02=x2+k*k*x1\n",
+ "pr1=(i2*r02*cos(t)-i2*x02*sin(t))*100/e2\n",
+ "v2=e2-(e2*pr1/100)\n",
+ "print\"The percentage regulation at full load 0.8 pf leading is\",round(pr1,2)\n",
+ "print\"The secondary terminal voltage is\",round(v2,2),\"Volts\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage regulation at full load 0.8 pf leading is -4.88\n",
+ "The secondary terminal voltage is 131.1 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex4.14:pg-355"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "r1=2.0 #Assigning values to parameters\n",
+ "r2=0.02\n",
+ "wi=412.0\n",
+ "pf=0.8\n",
+ "x=1.0\n",
+ "kva=50.0\n",
+ "e1=2300.0\n",
+ "e2=230.0\n",
+ "i2=kva*1000/e2\n",
+ "i1=kva*1000/e1\n",
+ "wcf=(i1*i1*r1)+(i2*i2*r2)\n",
+ "n1=x*kva*pf*100/((x*kva*pf)+(wi*0.001)+(x*x*wcf*0.001))\n",
+ "x=0.5\n",
+ "n2=x*kva*pf*100/((x*kva*pf)+(wi*0.001)+(x*x*wcf*0.001))\n",
+ "print\"Efficiency at full node 0.8pf is\",round(n1,2),\"%\"\n",
+ "print\"Efficiency at half full node 0.8pf is\",round(n2,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency at full node 0.8pf is 94.56 %\n",
+ "Efficiency at half full node 0.8pf is 95.76 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex4.15:pg-356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "x=1.0 #Assigning values to parameters\n",
+ "kva=25.0\n",
+ "pf=0.8\n",
+ "wi=0.35\n",
+ "wcf=0.4\n",
+ "n1=x*kva*pf*100/((x*kva*pf)+(wi*0.001)+(x*x*wcf*0.001))\n",
+ "kva1=kva*(sqrt(wi/wcf))\n",
+ "nm=kva1*pf*100/((kva1*pf)+2*wi)\n",
+ "print\"Load in KVA is\",round(kva1,3)\n",
+ "print\"Maximum Efficency is\",round(nm,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Load in KVA is 23.385\n",
+ "Maximum Efficency is 96.39 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex4.16:pg-357"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "x=1.0 #Assigning values to parameters\n",
+ "kva=40.0\n",
+ "pf=0.8\n",
+ "wi=450.0\n",
+ "wcf=850.0\n",
+ "n1=x*kva*pf*100/((x*kva*pf)+(wi*0.001)+(x*x*wcf*0.001))\n",
+ "x=sqrt(wi/wcf)\n",
+ "n2=x*kva*pf*100/((x*kva*pf)+(2*wi*0.001))\n",
+ "kva1=kva*sqrt(wi/wcf)\n",
+ "print\"Efficiency at full node 0.8pf is\",round(x,4)\n",
+ "print\"Maximum Efficency is\",round(n2,2)\n",
+ "print\"Load in KVA at which maximum occurs is\",round(kva1,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency at full node 0.8pf is 0.7276\n",
+ "Maximum Efficency is 96.28\n",
+ "Load in KVA at which maximum occurs is 29.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex4.17:pg-358"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "e1=2000.0 #Assigning values to parameters\n",
+ "e2=200.0\n",
+ "r1=2.3\n",
+ "x1=4.2\n",
+ "r2=0.025\n",
+ "x2=0.04\n",
+ "kva=20.0\n",
+ "i1=kva*1000/e1\n",
+ "i2=kva*1000/e2\n",
+ "k=e2/e1\n",
+ "r01=r1+r2/(k*k)\n",
+ "x01=x1+x2/(k*k)\n",
+ "r02=r2+k*k*r1\n",
+ "x02=x2+k*k*x1\n",
+ "print\"The equivalent primary resistance is\",round(r01,2),\"ohms\"\n",
+ "print\"The equivalent primary reactance is\",round(x01,2),\"ohms\"\n",
+ "print\"The equivalent Secondary resistance is\",round(r02,3),\"ohms\"\n",
+ "print\"The equivalent Secondary reactance is\",round(x02,3),\"ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equivalent primary resistance is 4.8 ohms\n",
+ "The equivalent primary reactance is 8.2 ohms\n",
+ "The equivalent Secondary resistance is 0.048 ohms\n",
+ "The equivalent Secondary reactance is 0.082 ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "\n",
+ "Ex4.18:pg-359"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "x=1.0 #Assigning values to parameters\n",
+ "kva=20.0\n",
+ "pf=0.8\n",
+ "wi=450.0\n",
+ "wcf=900.0\n",
+ "n1=x*kva*pf*100/((x*kva*pf)+(wi*0.001)+(x*x*wcf*0.001))\n",
+ "x=sqrt(wi/wcf)\n",
+ "n2=x*kva*pf*100/((x*kva*pf)+(2*wi*0.001))\n",
+ "print\"Efficiency at full node 0.8pf is\",round(n1,2),\"%\"\n",
+ "print\"Maximum Efficency is\",round(n2,2),\"%\"\n",
+ "print\"Load at which maximum occurs is\",round(x,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency at full node 0.8pf is 92.22 %\n",
+ "Maximum Efficency is 92.63 %\n",
+ "Load at which maximum occurs is 0.707\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.20:pg-361"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "nm=98.0 #Assigning values to parameters\n",
+ "x=0.5\n",
+ "kva=200.0\n",
+ "pf=1.0\n",
+ "wi=1000*((x*kva*pf*100/nm)/2-(x*kva*pf)/2)\n",
+ "wcu=wi\n",
+ "wcf=wcu/(0.5*0.5)\n",
+ "n1=(x*kva*pf*100)/((x*kva*pf)+(wi*0.001)+(x*x*wcf*0.001))\n",
+ "x=0.75\n",
+ "n2=(x*kva*pf*100)/((x*kva*pf)+(wi*0.001)+(x*x*wcf*0.001))\n",
+ "print\"The core loss is\",round(wi/1000,4),\"kWatts\"\n",
+ "print\"Efficiency at full node 0.8pf is\",round(n1,2)\n",
+ "print\"Efficiency at 75% full node 0.8pf is\",round(n2,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The core loss is 1.0204 kWatts\n",
+ "Efficiency at full node 0.8pf is 98.0\n",
+ "Efficiency at 75% full node 0.8pf is 97.84\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.21:pg-362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "r1=0.3 #Assigning values to parameters\n",
+ "r2=0.01\n",
+ "x1=1.1\n",
+ "x2=0.035\n",
+ "kva=100\n",
+ "v1=2200\n",
+ "e1=v1\n",
+ "n1=400.0\n",
+ "n2=80.0\n",
+ "k=n2/n1\n",
+ "r01=r1+r2/(k*k)\n",
+ "x01=x1+x2/(k*k)\n",
+ "z01=sqrt(r01*r01+x01*x01)\n",
+ "e2=k*e1\n",
+ "i2=kva*1000/e2\n",
+ "r02=k*k*r01\n",
+ "x02=k*k*x01\n",
+ "pr1=(i2*r02*cos(t)-i2*x02*sin(t))*100/e2\n",
+ "v2=e2-(e2*pr1/100)\n",
+ "print\"The equivalent primary resistance is z01=\",round(z01,2),\"ohms\"\n",
+ "print\"The percentage voltage regulation at full load 0.8 pf leading is x02=\",round(x02,3),\"ohms\"\n",
+ "print\"The secondary terminal voltage is v2=\",round(v2,2),\"volts\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equivalent primary resistance is z01= 2.05 ohms\n",
+ "The percentage voltage regulation at full load 0.8 pf leading is x02= 0.079 ohms\n",
+ "The secondary terminal voltage is v2= 446.77 volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.22:pg-363"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "E2=20.0; #Assigning values to parameters\n",
+ "E1=1000.0;\n",
+ "kva=5.0;\n",
+ "I2=kva*1000/E2;\n",
+ "K=E2/E1;\n",
+ "R01=4.4\n",
+ "R02=K*K*R01;\n",
+ "X01=8.98\n",
+ "X02=K*K*X01;\n",
+ "pf=0.8\n",
+ "percentreg=(I2*R02*pf+I2*X02*sqrt(1-pf*pf))*100/E2;\n",
+ "print\"Percentage maximum regulation is=\",round(percentreg,2)\n",
+ "wi=90\n",
+ "I1=kva*1000/E1\n",
+ "Wcf=I1*I1*R01\n",
+ "kvam=kva*sqrt(wi/Wcf)\n",
+ "print\"kva at maximum Efficency is kvam=\",round(kvam,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage maximum regulation is= 4.45\n",
+ "kva at maximum Efficency is kvam= 4.52\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.23:pg-365"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "v1=200.0 #Assigning values to parameters\n",
+ "i0=0.7\n",
+ "w=70.0\n",
+ "k=400/200\n",
+ "t=math.acos(w/(v1*i0))\n",
+ "iw=i0*cos(t)\n",
+ "iu=i0*sin(t)\n",
+ "r0=v1/iw\n",
+ "x0=v1/iu\n",
+ "vsc=15.0\n",
+ "i2=10.0\n",
+ "w=85.0\n",
+ "r02=w/(i2*i2)\n",
+ "z02=vsc/i2\n",
+ "x02=sqrt(z02*z02-r02*r02)\n",
+ "r01=r02/(k*k)\n",
+ "x01=x02/(k*k)\n",
+ "e2=400.0\n",
+ "i2=5*1000/(0.8*e2)\n",
+ "v2=e2-i2*r02*cos(t)-i2*x02*sin(t)\n",
+ "print\"The secondary Voltage is v2=\",round(v2,2),\"volts\"\n",
+ "#the answer of v2 in the book is wrong,because in the book ,the values of cos(t) & sin(t) are wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The secondary Voltage is v2= 376.64 volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.24:pg-366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "wi=1000.0 #Assigning values to parameters\n",
+ "kva=50.0\n",
+ "e1=2200.0\n",
+ "ifl=kva*1000/e1\n",
+ "x=1.0\n",
+ "pf=0.8\n",
+ "wcf=(ifl/20)*(ifl/20)*500\n",
+ "n1=x*kva*pf*100/((x*kva*pf)+(wi*0.001)+(x*x*wcf*0.001))\n",
+ "x=sqrt(wi/wcf)\n",
+ "n2=x*kva*pf*100/((x*kva*pf)+(2*wi*0.001))\n",
+ "print\"Efficiency at full node 0.8pf is n1=\",round(n1,3)\n",
+ "print\"Maximum Efficency is n2=\",round(n2,2)\n",
+ "print\"Load at which maximum occurs is x=\",round(x,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency at full node 0.8pf is n1= 96.048\n",
+ "Maximum Efficency is n2= 96.14\n",
+ "Load at which maximum occurs is x= 1.24\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.25:pg-367"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "kva=5.0 #Assigning values to parameters\n",
+ "e2=400.0\n",
+ "r02=0.85\n",
+ "x02=1.236\n",
+ "i2f=kva*1000/e2\n",
+ "t=math.acos(0.8)\n",
+ "pr1=(i2f*r02*cos(t)+i2f*x02*sin(t))*100/e2\n",
+ "pr2=(i2f*r02*cos(t)-i2f*x02*sin(t))*100/e2\n",
+ "print\"The percentage regulation at full load 0.8 pf lagging is\",round(pr1,2)\n",
+ "print\"The percentage regulation at full load 0.8 pf leading is\",round(pr2,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage regulation at full load 0.8 pf lagging is 4.44\n",
+ "The percentage regulation at full load 0.8 pf leading is -0.19\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.26:pg-369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "cl=(10.0/12)*(10.0/12)*100 #Assigning values to parameters\n",
+ "op=500*10*0.8\n",
+ "il=80.0\n",
+ "eff=op*100/(op+il+cl)\n",
+ "print\"The efficiency is eff=\",round(eff,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The efficiency is eff= 96.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.27:pg-370"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "kw=15 #Assigning values to parameters\n",
+ "t=math.acos(0.8)\n",
+ "kva=kw/cos(t)\n",
+ "x=kva/25\n",
+ "wcf=500\n",
+ "cl1=0.75*0.75*wcf\n",
+ "kw=20\n",
+ "t=math.acos(0.9)\n",
+ "kva=kw/cos(t)\n",
+ "x=kva/25\n",
+ "cl2=x*x*500\n",
+ "kw=10\n",
+ "t=math.acos(0.9)\n",
+ "kva=kw/cos(t)\n",
+ "x=kva/25\n",
+ "cl3=x*x*500\n",
+ "tec=cl1*6+cl2*10+cl3*4\n",
+ "tei=400*24\n",
+ "eo=330000\n",
+ "n=eo*100/(eo+tei+tec)\n",
+ "print\"The efficiency is n=\",round(n,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The efficiency is n= 95.48 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.28:pg-371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "kw=400.0 #Assigning values to parameters\n",
+ "pf=0.8\n",
+ "kva=kw/pf\n",
+ "cl1=4.5\n",
+ "kw=300.0\n",
+ "pf=0.75\n",
+ "kva=kw/pf\n",
+ "cl2=(kva/500)*(kva/500)*4.5\n",
+ "kw=100.0\n",
+ "pf=0.8\n",
+ "kva=kw/pf\n",
+ "cl3=(kva/500)*(kva/500)*4.5\n",
+ "cl4=0\n",
+ "tec=cl1*6+cl2*10+cl3*4+cl4*4\n",
+ "tei=84.0\n",
+ "eo=5800.0\n",
+ "n=eo*100/(eo+tei+tec)\n",
+ "print\"The efficiency is n=\",round(n,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The efficiency is n= 97.63 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.29:pg-372"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "nm=0.98 #Assigning values to parameters\n",
+ "kva=15.0\n",
+ "x=1.0\n",
+ "pf=1.0\n",
+ "wi=((x*kva*pf/nm)/2-(x*kva*pf)/2)\n",
+ "wcu=wi\n",
+ "kw=2.0\n",
+ "pf=0.5\n",
+ "kva=kw/pf\n",
+ "cl1=(kva/15)*(kva/15)*wi\n",
+ "kw=12.0\n",
+ "pf=0.8\n",
+ "kva=kw/pf\n",
+ "cl2=0.153\n",
+ "kw=18.0\n",
+ "pf=0.9\n",
+ "kva=kw/pf\n",
+ "cl3=(kva/15)*(kva/15)*wi\n",
+ "tec=cl1*12+cl2*6+cl3*6\n",
+ "tei=3.672\n",
+ "eo=204.0\n",
+ "n=eo*100/(eo+tei+tec)\n",
+ "print\"The efficiency is n=\",round(n,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The efficiency is n= 96.98\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.30:pg-374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "cl1=1.5 #Assigning values to parameters\n",
+ "cl2=0.5*0.5*cl1\n",
+ "tec=cl1*3+cl2*4\n",
+ "tei=36\n",
+ "eo=500\n",
+ "n=eo*100/(eo+tei+tec)\n",
+ "print\"The efficiency is n=\",round(n,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The efficiency is n= 92.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/screenshots/ch1.png b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/screenshots/ch1.png Binary files differnew file mode 100644 index 00000000..e17d0fa1 --- /dev/null +++ b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/screenshots/ch1.png diff --git a/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/screenshots/ch2.png b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/screenshots/ch2.png Binary files differnew file mode 100644 index 00000000..1dd6b0f6 --- /dev/null +++ b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/screenshots/ch2.png diff --git a/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/screenshots/ch4.png b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/screenshots/ch4.png Binary files differnew file mode 100644 index 00000000..46a589d4 --- /dev/null +++ b/Basic_Electrical_And_Electronics_Engineering_by_B._R._Patil/screenshots/ch4.png |