summaryrefslogtreecommitdiff
path: root/Electrical_Circuit_Theory_And_Technology/chapter_25-checkpoint_1.ipynb
diff options
context:
space:
mode:
authorJovina Dsouza2014-07-22 00:00:04 +0530
committerJovina Dsouza2014-07-22 00:00:04 +0530
commitc8733e4b6b4bffcddf7eb45ff1c72ccc837aa3af (patch)
tree0f7627eb79ddb66b8fa81efd380036bc75586ba8 /Electrical_Circuit_Theory_And_Technology/chapter_25-checkpoint_1.ipynb
parente7deb0183418e63da824955296b8bb3598ba359d (diff)
downloadPython-Textbook-Companions-c8733e4b6b4bffcddf7eb45ff1c72ccc837aa3af.tar.gz
Python-Textbook-Companions-c8733e4b6b4bffcddf7eb45ff1c72ccc837aa3af.tar.bz2
Python-Textbook-Companions-c8733e4b6b4bffcddf7eb45ff1c72ccc837aa3af.zip
adding book
Diffstat (limited to 'Electrical_Circuit_Theory_And_Technology/chapter_25-checkpoint_1.ipynb')
-rwxr-xr-xElectrical_Circuit_Theory_And_Technology/chapter_25-checkpoint_1.ipynb647
1 files changed, 647 insertions, 0 deletions
diff --git a/Electrical_Circuit_Theory_And_Technology/chapter_25-checkpoint_1.ipynb b/Electrical_Circuit_Theory_And_Technology/chapter_25-checkpoint_1.ipynb
new file mode 100755
index 00000000..19e462e5
--- /dev/null
+++ b/Electrical_Circuit_Theory_And_Technology/chapter_25-checkpoint_1.ipynb
@@ -0,0 +1,647 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 25: Application of complex numbers to parallel a.c. circuits</h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 1, page no. 446</h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the admittance, conductance and susceptance\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "import cmath\n",
+ "#initializing the variables:\n",
+ "Z1 = 0 - 5j;# in ohms\n",
+ "Z2 = 25 + 40j;# in ohms\n",
+ "Z3 = 3 - 2j;# in ohms\n",
+ "r4 = 50;# in ohms\n",
+ "theta4 = 40;# in degrees\n",
+ "\n",
+ "#calculation:\n",
+ " #admittance Y\n",
+ "Y1 = 1/Z1\n",
+ " #conductance, G\n",
+ "G1 = Y1.real\n",
+ " #Suspectance, Bc\n",
+ "Bc1 = abs(Y1.imag)\n",
+ " #admittance Y\n",
+ "Y2 = 1/Z2\n",
+ " #conductance, G\n",
+ "G2 = Y2.real\n",
+ " #Suspectance, Bc\n",
+ "Bc2 = abs(Y2.imag)\n",
+ " #admittance Y\n",
+ "Y3 = 1/Z3\n",
+ " #conductance, G\n",
+ "G3 = Y3.real\n",
+ " #Suspectance, Bc\n",
+ "Bc3 = abs(Y3.imag)\n",
+ "Z4 = r4*math.cos(theta4*math.pi/180) + 1j*r4*math.sin(theta4*math.pi/180)\n",
+ " #admittance Y\n",
+ "Y4 = 1/Z4\n",
+ " #conductance, G\n",
+ "G4 = Y4.real\n",
+ " #Suspectance, Bc\n",
+ "Bc4 = abs(Y4.imag)\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print \"\\n\\n Result \\n\\n\"\n",
+ "print \"\\n (a)admittance Y is (\",round(Y1.real,2),\" + (\",round(Y1.imag,2),\")i) S, \"\n",
+ "print \" conductance, G is \",round(G1,2),\" S, susceptance,Bc is \",round(Bc1,2),\" S\\n\"\n",
+ "print \"\\n (b)admittance Y is (\",round(Y2.real,2),\" + (\",round(Y2.imag,2),\")i) S, \"\n",
+ "print \" conductance, G is \",round(G2,2),\" S, susceptance,Bc is \",round(Bc2,2),\" S\\n\"\n",
+ "print \"\\n (c)admittance Y is (\",round(Y3.real,2),\" + (\",round(Y3.imag,2),\")i) S, \"\n",
+ "print \" conductance, G is \",round(G3,2),\" S, susceptance,Bc is \",round(Bc3,2),\" S\\n\"\n",
+ "print \"\\n (d)admittance Y is (\",round(Y4.real,2),\" + (\",round(Y4.imag,2),\")i) S, \"\n",
+ "print \" conductance, G is \",round(G4,2),\" S, susceptance,Bc is \",round(Bc4,2),\" S\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Result \n",
+ "\n",
+ "\n",
+ "\n",
+ " (a)admittance Y is ( -0.0 + ( 0.2 )i) S, \n",
+ " conductance, G is -0.0 S, susceptance,Bc is 0.2 S\n",
+ "\n",
+ "\n",
+ " (b)admittance Y is ( 0.01 + ( -0.02 )i) S, \n",
+ " conductance, G is 0.01 S, susceptance,Bc is 0.02 S\n",
+ "\n",
+ "\n",
+ " (c)admittance Y is ( 0.23 + ( 0.15 )i) S, \n",
+ " conductance, G is 0.23 S, susceptance,Bc is 0.15 S\n",
+ "\n",
+ "\n",
+ " (d)admittance Y is ( 0.02 + ( -0.01 )i) S, \n",
+ " conductance, G is 0.02 S, susceptance,Bc is 0.01 S\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 2, page no. 447</h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine expressions for the impedance\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "import cmath\n",
+ "#initializing the variables:\n",
+ "Y2 = 0.001 - 0.002j;# in S\n",
+ "Y3 = 0.05 + 0.08j;# in S\n",
+ "r1 = 0.004;# in S\n",
+ "theta1 = 30;# in degrees\n",
+ "\n",
+ " #calculation:\n",
+ " #impedance, Z\n",
+ "Z2 = 1/Y2\n",
+ "Z3 = 1/Y3\n",
+ "Y1 = r1*math.cos(theta1*math.pi/180) + 1j*r1*math.sin(theta1*math.pi/180)\n",
+ "Z1 = 1/Y1\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print \"\\n\\n Result \\n\\n\"\n",
+ "print \"\\n (a)Impedance,Z is (\",round(Z1.real,2),\" + (\",round( Z1.imag,2),\")i) ohm\\n\"\n",
+ "print \"\\n (b)Impedance,Z is (\",round(Z2.real,2),\" + (\",round( Z2.imag,2),\")i) ohm\\n\"\n",
+ "print \"\\n (c)Impedance,Z is (\",round(Z3.real,2),\" + (\",round( Z3.imag,2),\")i) ohm\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Result \n",
+ "\n",
+ "\n",
+ "\n",
+ " (a)Impedance,Z is ( 216.51 + ( -125.0 )i) ohm\n",
+ "\n",
+ "\n",
+ " (b)Impedance,Z is ( 200.0 + ( 400.0 )i) ohm\n",
+ "\n",
+ "\n",
+ " (c)Impedance,Z is ( 5.62 + ( -8.99 )i) ohm"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 3, page no. 448</h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the values of the resistance and the capacitive reactance of the circuit if they are connected \n",
+ "#(a) in parallel, (b) in series.\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "import cmath\n",
+ "#initializing the variables:\n",
+ "Y = 0.040 - 1j*0.025;# in S\n",
+ "\n",
+ "#calculation:\n",
+ " #impedance, Z\n",
+ "Z = 1/Y\n",
+ " #conductance, G\n",
+ "G = Y.real\n",
+ " #Suspectance, Bc\n",
+ "Bc = abs(Y.imag)\n",
+ " #parallrl \n",
+ " #resistance, R\n",
+ "Rp = 1/G\n",
+ " #capacitive reactance\n",
+ "Xcp = 1/Bc\n",
+ " #series\n",
+ " #resistance, R\n",
+ "Rs = Z.real\n",
+ " #capacitive reactance\n",
+ "Xcs = abs(Z.imag)\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print \"\\n\\n Result \\n\\n\"\n",
+ "print \"\\n (a)for parallel, resistance,R is \",round(Rp,2),\" ohm and capacitive reactance, Xc is \",round(Xcp,2),\" ohm\\n\"\n",
+ "print \"\\n (b)forseries, resistance,R is \",round(Rs,2),\" ohm and capacitive reactance, Xc is \",round(Xcs,2),\" ohm\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Result \n",
+ "\n",
+ "\n",
+ "\n",
+ " (a)for parallel, resistance,R is 25.0 ohm and capacitive reactance, Xc is 40.0 ohm\n",
+ "\n",
+ "\n",
+ " (b)forseries, resistance,R is 17.98 ohm and capacitive reactance, Xc is 11.24 ohm"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 4, page no. 449</h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the values of currents I, I1 and I2.\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "import cmath\n",
+ "#initializing the variables:\n",
+ "R1 = 8;# in ohm\n",
+ "R = 5;# in ohm\n",
+ "R2 = 6;# ohm\n",
+ "rv = 50;# in volts\n",
+ "thetav = 0;# in degrees\n",
+ "\n",
+ "#calculation:\n",
+ " #voltage,V\n",
+ "V = rv*math.cos(thetav*math.pi/180) + 1j*rv*math.sin(thetav*math.pi/180)\n",
+ " #circuit impedance, ZT\n",
+ "ZT = R + (R1*1j*R2/(R1 + 1j*R2))\n",
+ " #Current I\n",
+ "I = V/ZT\n",
+ " #current,I1\n",
+ "I1 = I*(1j*R2/(R1 + 1j*R2))\n",
+ " #current, I2\n",
+ "I2 = I*(R1/(R1 + 1j*R2))\n",
+ "\n",
+ "#Results\n",
+ "print \"\\n\\n Result \\n\\n\"\n",
+ "print \"\\n current, I = \",round(abs(I),2),\"/_\",round(cmath.phase(complex(I.real, I.imag))*180/math.pi,2),\"deg A,\"\n",
+ "print \"current,I1 = \",round(abs(I1),2),\"/_\",round(cmath.phase(complex(I1.real, I1.imag))*180/math.pi,2),\"deg A, \"\n",
+ "print \"current, I2 = \",round(abs(I2),2),\"/_\",round(cmath.phase(complex(I2.real, I2.imag))*180/math.pi,2),\"deg A\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Result \n",
+ "\n",
+ "\n",
+ "\n",
+ " current, I = 5.7 /_ -25.98 deg A,\n",
+ "current,I1 = 3.42 /_ 27.15 deg A, \n",
+ "current, I2 = 4.56 /_ -62.85 deg A\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 5, page no. 450</h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the value of supply current I and its phase relative to the 40 V supply.\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "import cmath\n",
+ "#initializing the variables:\n",
+ "R1 = 5;# in ohm\n",
+ "R2 = 3;# in ohm \n",
+ "R3 = 8;# ohm\n",
+ "Xc = 4;# in ohms\n",
+ "XL = 12;# in Ohms\n",
+ "V = 40;# in volts\n",
+ "f = 50;# in Hz\n",
+ "\n",
+ "#calculation:\n",
+ "Z1 = R1 + 1j*XL\n",
+ "Z2 = R2 - 1j*Xc\n",
+ "Z3 = R3\n",
+ " #circuit admittance, YT = 1/ZT\n",
+ "YT = (1/Z1) + (1/Z2) + (1/Z3)\n",
+ " #Current I\n",
+ "I = V*YT\n",
+ "I1 = V/Z1\n",
+ "I2 = V/Z2\n",
+ "I3 = V/Z2\n",
+ "thetav = 0\n",
+ "thetai = cmath.phase(complex(I.real, I.imag))*180/math.pi\n",
+ "phi = thetav - thetai \n",
+ "if (phi>0):\n",
+ " a = \"lagging\"\n",
+ "else:\n",
+ " a = \"leading\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print \"\\n\\n Result \\n\\n\"\n",
+ "print \"\\n current, I is (\",round(I.real,2),\" + (\",round(I.imag,2),\")i) A,\"\n",
+ "print \"and its phase relative to the 40 V supply is \",a,\"s by \",round(abs(phi),2),\"deg\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Result \n",
+ "\n",
+ "\n",
+ "\n",
+ " current, I is ( 10.98 + ( 3.56 )i) A,\n",
+ "and its phase relative to the 40 V supply is leading s by 17.96 deg\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 6, page no. 451</h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine (a) the total equivalent circuit impedance, (b) the supply current, \n",
+ "#(c) the circuit phase angle, (d) the current in the coil, and (e) the current in the capacitor.\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "import cmath\n",
+ "#initializing the variables:\n",
+ "L = 0.07958;# in Henry\n",
+ "R = 18;# in ohm\n",
+ "C = 64.96E-6;# in Farad\n",
+ "rv = 250;# in volts\n",
+ "thetav = 0;# in degrees\n",
+ "f = 50;# in Hz\n",
+ "\n",
+ "#calculation:\n",
+ " #Inductive reactance\n",
+ "XL = 2*math.pi*f*L\n",
+ " #capacitive reactance\n",
+ "Xc = 1/(2*math.pi*f*C)\n",
+ " #impedance of the coil,\n",
+ "Zcoil = R + 1j*XL\n",
+ " #impedance presented by the capacitor,\n",
+ "Zc = -1j*Xc\n",
+ " #Total equivalent circuit impedance,\n",
+ "ZT = Zcoil*Zc/(Zcoil + Zc)\n",
+ " #voltage\n",
+ "V = rv*math.cos(thetav*math.pi/180) + 1j*rv*math.sin(thetav*math.pi/180)\n",
+ " #current, I\n",
+ "I = V/ZT\n",
+ "thetai = cmath.phase(complex(I.real,I.imag))*180/math.pi\n",
+ "phi = thetav - thetai\n",
+ "if (phi>0):\n",
+ " a = \"lagging\"\n",
+ "else:\n",
+ " a = \"leading\"\n",
+ "\n",
+ " #Current in the coil, ICOIL\n",
+ "Icoil = V/Zcoil\n",
+ " #Current in the capacitor, IC\n",
+ "Ic = V/Zc\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print \"\\n\\n Result \\n\\n\"\n",
+ "print \"\\n (a)the circuit impedance is \",round(ZT.real,2),\" + (\",round( ZT.imag,2),\")i ohm\\n\"\n",
+ "print \"\\n (b)supply current, I = \",round(abs(I),2),\"/_\",round(cmath.phase(complex(I.real, I.imag))*180/math.pi,2),\"deg A\\n\"\n",
+ "print \"\\n (c)circuit phase relative is \",a,\"s by \",round(abs(phi),2),\"deg\\n\"\n",
+ "print \"\\n (d)current in coil, Icoil = \",round(abs(Icoil),2),\"/_\",round(cmath.phase(complex(Icoil.real, Icoil.imag))*180/math.pi,2),\"deg A\\n\"\n",
+ "print \"\\n (e)current in capacitor, Ic = \",round(abs(Ic),2),\"/_\",round(cmath.phase(complex(Ic.real, Ic.imag))*180/math.pi,2),\"deg A\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Result \n",
+ "\n",
+ "\n",
+ "\n",
+ " (a)the circuit impedance is 48.02 + ( 15.03 )i ohm\n",
+ "\n",
+ "\n",
+ " (b)supply current, I = 4.97 /_ -17.38 deg A\n",
+ "\n",
+ "\n",
+ " (c)circuit phase relative is lagging s by 17.38 deg\n",
+ "\n",
+ "\n",
+ " (d)current in coil, Icoil = 8.12 /_ -54.25 deg A\n",
+ "\n",
+ "\n",
+ " (e)current in capacitor, Ic = 5.1 /_ 90.0 deg A"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 7, page no. 452</h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#(a)determine the value of impedance Z1 \n",
+ "#(b) If the supply frequency is 5 kHz,determine the value of the components comprising impedance Z1\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "import cmath\n",
+ "#initializing the variables:\n",
+ "RL = 6j;# in ohm\n",
+ "R2 = 8;# in ohm\n",
+ "Z3 = 10;# in ohm\n",
+ "rv = 50;# in volts\n",
+ "thetav = 30;# in degrees\n",
+ "ri = 31.4;# in amperes\n",
+ "thetai = 52.48;# in degrees\n",
+ "f = 5000;# in Hz\n",
+ "\n",
+ "#calculation:\n",
+ " #impedance, Z2\n",
+ "Z2 = R2 + RL\n",
+ " #voltage\n",
+ "V = rv*math.cos(thetav*math.pi/180) + 1j*rv*math.sin(thetav*math.pi/180)\n",
+ " #current, I\n",
+ "I = ri*math.cos(thetai*math.pi/180) + 1j*ri*math.sin(thetai*math.pi/180)\n",
+ " #Total circuit admittance,\n",
+ "YT = I/V\n",
+ " #admittance, Y3\n",
+ "Y3 = 1/Z3\n",
+ " #admittance, Y2\n",
+ "Y2 = 1/Z2\n",
+ " #admittance, Y1\n",
+ "Y1 = YT - Y2 - Y3\n",
+ " #impedance, Z1\n",
+ "Z1 = 1/Y1\n",
+ "\n",
+ "#Results\n",
+ "print \"\\n\\n Result \\n\\n\"\n",
+ "print \"\\n (a)the impedance Z1 is \",round(Z1.real,2),\" + (\",round( Z1.imag,2),\")i ohm\\n\"\n",
+ "\n",
+ " #resistance, R1\n",
+ "R1 = Z1.real\n",
+ "X1 = Z1.imag \n",
+ "if ((R1>0)&(X1<0)):\n",
+ " C1 = -1/(2*math.pi*f*X1)\n",
+ " print \"\\n (b)The series circuit thus consists of a resistor of resistance \",round(R1,2),\" ohm\"\n",
+ " print \" and a capacitor of capacitance \",round(C1*1E6,2),\"uFarad\\n\"\n",
+ "elif ((R1>0)&(X1>0)):\n",
+ " L1 = 2*math.pi*f*X1\n",
+ " print \"\\n (b)The series circuit thus consists of a resistor of resistance \",round(R1,2),\" ohm \"\n",
+ " print \" and a inductor of insuctance \",round(L1*1000,2),\"mHenry\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Result \n",
+ "\n",
+ "\n",
+ "\n",
+ " (a)the impedance Z1 is 1.6 + ( -1.2 )i ohm\n",
+ "\n",
+ "\n",
+ " (b)The series circuit thus consists of a resistor of resistance 1.6 ohm\n",
+ " and a capacitor of capacitance 26.55 uFarad\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 8, page no. 453</h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine (a) the equivalent series circuit impedance,\n",
+ "#(b) the supply current I, (c) the circuit phase angle,\n",
+ "#(d) the values of voltages V1 and V2, and (e) the values of currents IA and IB\n",
+ "from __future__ import division\n",
+ "import math\n",
+ "import cmath\n",
+ "#initializing the variables:\n",
+ "RL1 = 1.02j;# in ohm\n",
+ "R1 = 1.65;# in ohm\n",
+ "RLa = 7j;# in ohm\n",
+ "Ra = 5;# in ohm\n",
+ "Rcb = -1j*15;# in ohm\n",
+ "Rb = 4;# in ohm\n",
+ "rv = 91;# in volts\n",
+ "thetav = 0;# in degree\n",
+ "\n",
+ "#calculation:\n",
+ " #voltage\n",
+ "V = rv*math.cos(thetav*math.pi/180) + 1j*rv*math.sin(thetav*math.pi/180)\n",
+ " #impedance, Z1\n",
+ "Z1 = R1 + RL1\n",
+ " #impedance, Za\n",
+ "Za = Ra + RLa\n",
+ " #impedance, Zb\n",
+ "Zb = Rb + Rcb\n",
+ " #impedance, Z, of the two branches connected in parallel\n",
+ "Z = Za*Zb/(Za + Zb)\n",
+ " #Total circuit impedance\n",
+ "ZT = Z1 + Z\n",
+ " #Supply current, I\n",
+ "I = V/ZT\n",
+ "thetai = cmath.phase(complex(I.real, I.imag))*180/math.pi\n",
+ "phi = thetav - thetai \n",
+ "if (phi>0):\n",
+ " a = \"lagging\"\n",
+ "else:\n",
+ " a = \"leading\"\n",
+ "\n",
+ " #Voltage V1\n",
+ "V1 = I*Z1\n",
+ " #Voltage V2\n",
+ "V2 = I*Z\n",
+ " #current Ia\n",
+ "Ia = V2/Za\n",
+ " #Current Ib\n",
+ "Ib = V2/Zb\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print \"\\n\\n Result \\n\\n\"\n",
+ "print \"\\n (a)equivalent series circuit impedance is \",round(ZT.real,2),\" + (\",round( ZT.imag,2),\")i ohm\\n\"\n",
+ "print \"\\n (b)supply current, I is \",round(I.real,2),\" + (\",round( I.imag,2),\")i A\\n\"\n",
+ "print \"\\n (c)circuit phase relative is \",a,\" by \",round(abs(phi),2),\"deg\\n\"\n",
+ "print \"\\n (d)voltage, V1 is (\",round(V1.real,2),\" + (\",round(V1.imag,2),\")i) V and V2 is(\",round(V2.real,2),\" + (\",round( V2.imag,2),\")i) V\\n\"\n",
+ "print \"\\n (e)current, Ia is (\",round(Ia.real,2),\" + (\",round( Ia.imag,2),\")i) A and Ib is(\",round(Ib.real,2),\" + (\",round( Ib.imag,2),\")i) A\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ " Result \n",
+ "\n",
+ "\n",
+ "\n",
+ " (a)equivalent series circuit impedance is 12.0 + ( 5.0 )i ohm\n",
+ "\n",
+ "\n",
+ " (b)supply current, I is 6.46 + ( -2.69 )i A\n",
+ "\n",
+ "\n",
+ " (c)circuit phase relative is lagging by 22.61 deg\n",
+ "\n",
+ "\n",
+ " (d)voltage, V1 is ( 13.41 + ( 2.15 )i) V and V2 is( 77.59 + ( -2.15 )i) V\n",
+ "\n",
+ "\n",
+ " (e)current, Ia is ( 5.04 + ( -7.49 )i) A and Ib is( 1.42 + ( 4.79 )i) A"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file