diff options
Diffstat (limited to 'Electrical_and_Electronic_Systems_by_Neil_Storey')
60 files changed, 12380 insertions, 0 deletions
diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter11.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter11.ipynb new file mode 100644 index 00000000..1e08381f --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter11.ipynb @@ -0,0 +1,280 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:3a4ef8be1017f129a0421c21819212b5457aab0abc06690d5c2563f72500374f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11: Measurement of Voltages and Currents" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1, Page 209" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialisation\n", + "t=0.02 #time period in seconds from diagram\n", + "v1=7 #peak voltage from diagram\n", + "\n", + "\n", + "#Calculation\n", + "f=1*t**-1 #frequency in Hz\n", + "v2=2*v1 # Peak to Peak Voltage\n", + "\n", + "#Result\n", + "print'Frequency = %d Hz\\n'%f\n", + "print'Peak to Peak Voltage = %d V\\n'%v2\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Frequency = 50 Hz\n", + "\n", + "Peak to Peak Voltage = 14 V\n", + "\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.2, Page 210" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Initialisation\n", + "t=0.05 #time period in seconds from diagram\n", + "v1=10 #peak voltage from diagram\n", + "\n", + "\n", + "#Calculation\n", + "f1=1*t**-1 #frequency in Hz\n", + "w1=2*math.pi*f1 #Angular velocity\n", + "\n", + "#Result\n", + "print'%d sin %.1ft Hz\\n'%(v1,w1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "10 sin 125.7t Hz\n", + "\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3, Page 211" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Initialisation\n", + "t=0.1 #time period in seconds from diagram\n", + "v1=10 #peak voltage from diagram\n", + "t1=25*10**-3\n", + "\n", + "#Calculation\n", + "f1=1*t**-1 #frequency in Hz\n", + "w1=2*math.pi*f1 #Angular velocity\n", + "phi=-(t1*t**-1)*360 #phase angle\n", + "\n", + "#Result\n", + "print'phi = %d degree'%phi\n", + "print'%d sin %dt%d Hz\\n'%(v1,round(w1),phi)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "phi = -90 degree\n", + "10 sin 63t-90 Hz\n", + "\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4, Page 215" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Initialisation\n", + "v1=5 #constant 5V\n", + "r=10 #resistance in Ohm\n", + "vrms=5 #sine wave of 5 V r.m.s\n", + "vp=5 #5 V peak\n", + "\n", + "#Calculation\n", + "p=(v1**2)*r**-1 #Power in watts\n", + "p2=(vrms**2)*r**-1 #Power avarage in watts\n", + "a=(vp*math.sqrt(2)**-1)**2\n", + "p3=a*r**-1 #Power avarage in watts \n", + "\n", + "#Result\n", + "print'(1) P = %.1f W\\n'%p\n", + "print'(2) Pav = %.1f W\\n'%p2\n", + "print'(3) Pav = %.2f W\\n'%p3" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1) P = 2.5 W\n", + "\n", + "(2) Pav = 2.5 W\n", + "\n", + "(3) Pav = 1.25 W\n", + "\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.5, Page 220" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialisation\n", + "fsd1=50*10**-3 #full scale defelction of ammeter in Ampere\n", + "fsd2=1*10**-3 #full scale defelction of moving coil meter in Ampere\n", + "Rm=25 #resistance of moving coil meter in Ohms\n", + "\n", + "#Calculation\n", + "Rsm=fsd1*fsd2**-1 #sensitivity factor\n", + "Rsh=Rm*49**-1 #shunt resistor\n", + "\n", + "#Result\n", + "print'Therefore, Resistor = %d mOhm\\n'%round(Rsh*10**3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Therefore, Resistor = 510 mOhm\n", + "\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.6, Page 222" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialisation\n", + "fsd1=50 #full scale defelction of voltmeter in Volts\n", + "fsd2=1*10**-3 #full scale defelction of moving coil meter in Ampere\n", + "Rm=25 #resistance of moving coil meter in Ohms\n", + "\n", + "#Calculation\n", + "Rsm=fsd1*fsd2**-1\n", + "Rse=Rsm-Rm\n", + "\n", + "#Result\n", + "print'Rse = %.3f KOhm\\n'%(Rse*10**-3)\n", + "print'Therefore, Resistor ~ %d KOhm\\n'%round(Rse*10**-3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Rse = 49.975 KOhm\n", + "\n", + "Therefore, Resistor ~ 50 KOhm\n", + "\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter11_1cYIymv.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter11_1cYIymv.ipynb new file mode 100644 index 00000000..1e08381f --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter11_1cYIymv.ipynb @@ -0,0 +1,280 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:3a4ef8be1017f129a0421c21819212b5457aab0abc06690d5c2563f72500374f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11: Measurement of Voltages and Currents" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1, Page 209" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialisation\n", + "t=0.02 #time period in seconds from diagram\n", + "v1=7 #peak voltage from diagram\n", + "\n", + "\n", + "#Calculation\n", + "f=1*t**-1 #frequency in Hz\n", + "v2=2*v1 # Peak to Peak Voltage\n", + "\n", + "#Result\n", + "print'Frequency = %d Hz\\n'%f\n", + "print'Peak to Peak Voltage = %d V\\n'%v2\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Frequency = 50 Hz\n", + "\n", + "Peak to Peak Voltage = 14 V\n", + "\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.2, Page 210" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Initialisation\n", + "t=0.05 #time period in seconds from diagram\n", + "v1=10 #peak voltage from diagram\n", + "\n", + "\n", + "#Calculation\n", + "f1=1*t**-1 #frequency in Hz\n", + "w1=2*math.pi*f1 #Angular velocity\n", + "\n", + "#Result\n", + "print'%d sin %.1ft Hz\\n'%(v1,w1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "10 sin 125.7t Hz\n", + "\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3, Page 211" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Initialisation\n", + "t=0.1 #time period in seconds from diagram\n", + "v1=10 #peak voltage from diagram\n", + "t1=25*10**-3\n", + "\n", + "#Calculation\n", + "f1=1*t**-1 #frequency in Hz\n", + "w1=2*math.pi*f1 #Angular velocity\n", + "phi=-(t1*t**-1)*360 #phase angle\n", + "\n", + "#Result\n", + "print'phi = %d degree'%phi\n", + "print'%d sin %dt%d Hz\\n'%(v1,round(w1),phi)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "phi = -90 degree\n", + "10 sin 63t-90 Hz\n", + "\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4, Page 215" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Initialisation\n", + "v1=5 #constant 5V\n", + "r=10 #resistance in Ohm\n", + "vrms=5 #sine wave of 5 V r.m.s\n", + "vp=5 #5 V peak\n", + "\n", + "#Calculation\n", + "p=(v1**2)*r**-1 #Power in watts\n", + "p2=(vrms**2)*r**-1 #Power avarage in watts\n", + "a=(vp*math.sqrt(2)**-1)**2\n", + "p3=a*r**-1 #Power avarage in watts \n", + "\n", + "#Result\n", + "print'(1) P = %.1f W\\n'%p\n", + "print'(2) Pav = %.1f W\\n'%p2\n", + "print'(3) Pav = %.2f W\\n'%p3" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1) P = 2.5 W\n", + "\n", + "(2) Pav = 2.5 W\n", + "\n", + "(3) Pav = 1.25 W\n", + "\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.5, Page 220" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialisation\n", + "fsd1=50*10**-3 #full scale defelction of ammeter in Ampere\n", + "fsd2=1*10**-3 #full scale defelction of moving coil meter in Ampere\n", + "Rm=25 #resistance of moving coil meter in Ohms\n", + "\n", + "#Calculation\n", + "Rsm=fsd1*fsd2**-1 #sensitivity factor\n", + "Rsh=Rm*49**-1 #shunt resistor\n", + "\n", + "#Result\n", + "print'Therefore, Resistor = %d mOhm\\n'%round(Rsh*10**3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Therefore, Resistor = 510 mOhm\n", + "\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.6, Page 222" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialisation\n", + "fsd1=50 #full scale defelction of voltmeter in Volts\n", + "fsd2=1*10**-3 #full scale defelction of moving coil meter in Ampere\n", + "Rm=25 #resistance of moving coil meter in Ohms\n", + "\n", + "#Calculation\n", + "Rsm=fsd1*fsd2**-1\n", + "Rse=Rsm-Rm\n", + "\n", + "#Result\n", + "print'Rse = %.3f KOhm\\n'%(Rse*10**-3)\n", + "print'Therefore, Resistor ~ %d KOhm\\n'%round(Rse*10**-3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Rse = 49.975 KOhm\n", + "\n", + "Therefore, Resistor ~ 50 KOhm\n", + "\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter11_b2XsTwq.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter11_b2XsTwq.ipynb new file mode 100644 index 00000000..1e08381f --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter11_b2XsTwq.ipynb @@ -0,0 +1,280 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:3a4ef8be1017f129a0421c21819212b5457aab0abc06690d5c2563f72500374f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11: Measurement of Voltages and Currents" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1, Page 209" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialisation\n", + "t=0.02 #time period in seconds from diagram\n", + "v1=7 #peak voltage from diagram\n", + "\n", + "\n", + "#Calculation\n", + "f=1*t**-1 #frequency in Hz\n", + "v2=2*v1 # Peak to Peak Voltage\n", + "\n", + "#Result\n", + "print'Frequency = %d Hz\\n'%f\n", + "print'Peak to Peak Voltage = %d V\\n'%v2\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Frequency = 50 Hz\n", + "\n", + "Peak to Peak Voltage = 14 V\n", + "\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.2, Page 210" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Initialisation\n", + "t=0.05 #time period in seconds from diagram\n", + "v1=10 #peak voltage from diagram\n", + "\n", + "\n", + "#Calculation\n", + "f1=1*t**-1 #frequency in Hz\n", + "w1=2*math.pi*f1 #Angular velocity\n", + "\n", + "#Result\n", + "print'%d sin %.1ft Hz\\n'%(v1,w1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "10 sin 125.7t Hz\n", + "\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3, Page 211" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Initialisation\n", + "t=0.1 #time period in seconds from diagram\n", + "v1=10 #peak voltage from diagram\n", + "t1=25*10**-3\n", + "\n", + "#Calculation\n", + "f1=1*t**-1 #frequency in Hz\n", + "w1=2*math.pi*f1 #Angular velocity\n", + "phi=-(t1*t**-1)*360 #phase angle\n", + "\n", + "#Result\n", + "print'phi = %d degree'%phi\n", + "print'%d sin %dt%d Hz\\n'%(v1,round(w1),phi)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "phi = -90 degree\n", + "10 sin 63t-90 Hz\n", + "\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4, Page 215" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "#Initialisation\n", + "v1=5 #constant 5V\n", + "r=10 #resistance in Ohm\n", + "vrms=5 #sine wave of 5 V r.m.s\n", + "vp=5 #5 V peak\n", + "\n", + "#Calculation\n", + "p=(v1**2)*r**-1 #Power in watts\n", + "p2=(vrms**2)*r**-1 #Power avarage in watts\n", + "a=(vp*math.sqrt(2)**-1)**2\n", + "p3=a*r**-1 #Power avarage in watts \n", + "\n", + "#Result\n", + "print'(1) P = %.1f W\\n'%p\n", + "print'(2) Pav = %.1f W\\n'%p2\n", + "print'(3) Pav = %.2f W\\n'%p3" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1) P = 2.5 W\n", + "\n", + "(2) Pav = 2.5 W\n", + "\n", + "(3) Pav = 1.25 W\n", + "\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.5, Page 220" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialisation\n", + "fsd1=50*10**-3 #full scale defelction of ammeter in Ampere\n", + "fsd2=1*10**-3 #full scale defelction of moving coil meter in Ampere\n", + "Rm=25 #resistance of moving coil meter in Ohms\n", + "\n", + "#Calculation\n", + "Rsm=fsd1*fsd2**-1 #sensitivity factor\n", + "Rsh=Rm*49**-1 #shunt resistor\n", + "\n", + "#Result\n", + "print'Therefore, Resistor = %d mOhm\\n'%round(Rsh*10**3)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Therefore, Resistor = 510 mOhm\n", + "\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.6, Page 222" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialisation\n", + "fsd1=50 #full scale defelction of voltmeter in Volts\n", + "fsd2=1*10**-3 #full scale defelction of moving coil meter in Ampere\n", + "Rm=25 #resistance of moving coil meter in Ohms\n", + "\n", + "#Calculation\n", + "Rsm=fsd1*fsd2**-1\n", + "Rse=Rsm-Rm\n", + "\n", + "#Result\n", + "print'Rse = %.3f KOhm\\n'%(Rse*10**-3)\n", + "print'Therefore, Resistor ~ %d KOhm\\n'%round(Rse*10**-3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Rse = 49.975 KOhm\n", + "\n", + "Therefore, Resistor ~ 50 KOhm\n", + "\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter12.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter12.ipynb new file mode 100644 index 00000000..0b76bb5c --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter12.ipynb @@ -0,0 +1,313 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12: Resistance and DC Circuits" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.1, Page 237" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnitude, I4 = -3 A\n" + ] + } + ], + "source": [ + "#Initialization\n", + "i1=8 #current in Amp\n", + "i2=1 #current in Amp\n", + "i3=4 #current in Amp\n", + "\n", + "#Calculation\n", + "i4=i2+i3-i1 #current in Amp\n", + "\n", + "#Results\n", + "print'Magnitude, I4 = %d A'%i4" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.2, Page 239" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "#Initialization\n", + "e=12 #EMF source in volt\n", + "v1=3 #node voltage\n", + "v3=3 #node voltage\n", + "\n", + "#Calculation\n", + "v2=v1+v3-e #node voltage\n", + "\n", + "#Results\n", + "print'V2 = %d V'%v2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4, Page 242" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voc = 10 V\n", + "R = 100 ohm\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "\n", + "#We have used method II for solving our problem by using simultaneous equations\n", + "\n", + "a = np.array([[25,-2],[400,-8]]) \n", + "b = np.array([[50],[3200]])\n", + "c=np.linalg.solve(a,b)\n", + "\n", + "print'Voc = %d V'%c[0]\n", + "print'R = %d ohm'%c[1]\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.5, Page 244" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage, V = 7.14\n" + ] + } + ], + "source": [ + "#Initialization\n", + "r1=100 #Resistance in Ohm\n", + "r2=200 #Resistance in Ohm\n", + "r3=50 #Resistance in Ohm\n", + "v1=15 #voltage source\n", + "v2=20 #voltage source\n", + "\n", + "#Calculation\n", + "#Considering 15 V as a source & replace the other voltage source by its internal resistance,\n", + "r11=(r2*r3)*(r2+r3)**-1 #resistance in parallel\n", + "v11=v1*(r11/(r1+r11)) #voltage\n", + "#Considering 20 V as a source & replace the other voltage source by its internal resistance,\n", + "r22=(r1*r3)*(r1+r3)**-1 #resistance in parallel\n", + "v22=v2*(r22/(r2+r22)) #voltage\n", + "\n", + "#output of the original circuit\n", + "v33=v11+v22\n", + "\n", + "\n", + "\n", + "#Results\n", + "print'Voltage, V = %.2f'%v33" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.6, Page 246" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Current, I = 1.67 A\n" + ] + } + ], + "source": [ + "#Initialization\n", + "r1=10 #Resistance in Ohm\n", + "r2=5 #Resistance in Ohm\n", + "v2=5 #voltage source\n", + "i=2 #current in Amp\n", + "\n", + "#Calculation\n", + "#Considering 5 V as a source & replace the current source by its internal resistance,\n", + "i1=v2*(r1+r2)**-1 #current using Ohms law\n", + "#Considering current source & replace the voltage source by its internal resistance,\n", + "r3=(r1*r2)*(r1+r2)**-1 #resistance in parallel\n", + "v3=i*r3 #voltage using Ohms law\n", + "i2=v3*r2**-1 #current using Ohms law\n", + "i3=i1+i2 #total current\n", + "\n", + "#Results\n", + "print'Output Current, I = %.2f A'%i3" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.8, Page 251" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "V2 = 33.04 V\n", + "V3 = 43.15 V\n", + "Current, I1 = 1.73 A\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "r=25 #resistance in ohm\n", + "\n", + "#We have used for solving our problem by using simultaneous equations\n", + "\n", + "a = np.array([[(-13*60**-1),(1*20**-1)],[(1*60**-1),(-9*100**-1)]]) \n", + "b = np.array([[-5],[-100*30**-1]])\n", + "c=np.linalg.solve(a,b)\n", + "i1=c[1]/r #required current\n", + "\n", + "print'V2 = %.2f V'%c[0] #wrong answer in textbook\n", + "print'V3 = %.2f V'%c[1] #wrong answer in textbook\n", + "print'Current, I1 = %.2f A'%i1\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.9, Page 253" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "I1 = 326 mA\n", + "I2 = 33 mA\n", + "I3 = 53 mA\n", + "Voltage, Ve = 0.197 V\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "re=10 #resistance in ohm\n", + "\n", + "#We have used for solving our problem by using simultaneous equations\n", + "\n", + "a = np.array([[(-160),(20), (30)],[(20),(-210), (10)], [(30),(10), (-190)]]) \n", + "b = np.array([[-50],[0],[0]])\n", + "c=np.linalg.solve(a,b)\n", + "ve=re*(c[2]-c[1])\n", + "\n", + "print'I1 = %d mA'%(c[0]*10**3) #current I1\n", + "print'I2 = %d mA'%(c[1]*10**3) #current I2\n", + "print'I3 = %d mA'%(c[2]*10**3) #current I3\n", + "print'Voltage, Ve = %.3f V'%ve\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter12_MbtXOSy.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter12_MbtXOSy.ipynb new file mode 100644 index 00000000..0b76bb5c --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter12_MbtXOSy.ipynb @@ -0,0 +1,313 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12: Resistance and DC Circuits" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.1, Page 237" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnitude, I4 = -3 A\n" + ] + } + ], + "source": [ + "#Initialization\n", + "i1=8 #current in Amp\n", + "i2=1 #current in Amp\n", + "i3=4 #current in Amp\n", + "\n", + "#Calculation\n", + "i4=i2+i3-i1 #current in Amp\n", + "\n", + "#Results\n", + "print'Magnitude, I4 = %d A'%i4" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.2, Page 239" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "#Initialization\n", + "e=12 #EMF source in volt\n", + "v1=3 #node voltage\n", + "v3=3 #node voltage\n", + "\n", + "#Calculation\n", + "v2=v1+v3-e #node voltage\n", + "\n", + "#Results\n", + "print'V2 = %d V'%v2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4, Page 242" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voc = 10 V\n", + "R = 100 ohm\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "\n", + "#We have used method II for solving our problem by using simultaneous equations\n", + "\n", + "a = np.array([[25,-2],[400,-8]]) \n", + "b = np.array([[50],[3200]])\n", + "c=np.linalg.solve(a,b)\n", + "\n", + "print'Voc = %d V'%c[0]\n", + "print'R = %d ohm'%c[1]\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.5, Page 244" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage, V = 7.14\n" + ] + } + ], + "source": [ + "#Initialization\n", + "r1=100 #Resistance in Ohm\n", + "r2=200 #Resistance in Ohm\n", + "r3=50 #Resistance in Ohm\n", + "v1=15 #voltage source\n", + "v2=20 #voltage source\n", + "\n", + "#Calculation\n", + "#Considering 15 V as a source & replace the other voltage source by its internal resistance,\n", + "r11=(r2*r3)*(r2+r3)**-1 #resistance in parallel\n", + "v11=v1*(r11/(r1+r11)) #voltage\n", + "#Considering 20 V as a source & replace the other voltage source by its internal resistance,\n", + "r22=(r1*r3)*(r1+r3)**-1 #resistance in parallel\n", + "v22=v2*(r22/(r2+r22)) #voltage\n", + "\n", + "#output of the original circuit\n", + "v33=v11+v22\n", + "\n", + "\n", + "\n", + "#Results\n", + "print'Voltage, V = %.2f'%v33" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.6, Page 246" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Current, I = 1.67 A\n" + ] + } + ], + "source": [ + "#Initialization\n", + "r1=10 #Resistance in Ohm\n", + "r2=5 #Resistance in Ohm\n", + "v2=5 #voltage source\n", + "i=2 #current in Amp\n", + "\n", + "#Calculation\n", + "#Considering 5 V as a source & replace the current source by its internal resistance,\n", + "i1=v2*(r1+r2)**-1 #current using Ohms law\n", + "#Considering current source & replace the voltage source by its internal resistance,\n", + "r3=(r1*r2)*(r1+r2)**-1 #resistance in parallel\n", + "v3=i*r3 #voltage using Ohms law\n", + "i2=v3*r2**-1 #current using Ohms law\n", + "i3=i1+i2 #total current\n", + "\n", + "#Results\n", + "print'Output Current, I = %.2f A'%i3" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.8, Page 251" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "V2 = 33.04 V\n", + "V3 = 43.15 V\n", + "Current, I1 = 1.73 A\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "r=25 #resistance in ohm\n", + "\n", + "#We have used for solving our problem by using simultaneous equations\n", + "\n", + "a = np.array([[(-13*60**-1),(1*20**-1)],[(1*60**-1),(-9*100**-1)]]) \n", + "b = np.array([[-5],[-100*30**-1]])\n", + "c=np.linalg.solve(a,b)\n", + "i1=c[1]/r #required current\n", + "\n", + "print'V2 = %.2f V'%c[0] #wrong answer in textbook\n", + "print'V3 = %.2f V'%c[1] #wrong answer in textbook\n", + "print'Current, I1 = %.2f A'%i1\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.9, Page 253" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "I1 = 326 mA\n", + "I2 = 33 mA\n", + "I3 = 53 mA\n", + "Voltage, Ve = 0.197 V\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "re=10 #resistance in ohm\n", + "\n", + "#We have used for solving our problem by using simultaneous equations\n", + "\n", + "a = np.array([[(-160),(20), (30)],[(20),(-210), (10)], [(30),(10), (-190)]]) \n", + "b = np.array([[-50],[0],[0]])\n", + "c=np.linalg.solve(a,b)\n", + "ve=re*(c[2]-c[1])\n", + "\n", + "print'I1 = %d mA'%(c[0]*10**3) #current I1\n", + "print'I2 = %d mA'%(c[1]*10**3) #current I2\n", + "print'I3 = %d mA'%(c[2]*10**3) #current I3\n", + "print'Voltage, Ve = %.3f V'%ve\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter12_tyNLSnr.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter12_tyNLSnr.ipynb new file mode 100644 index 00000000..0b76bb5c --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter12_tyNLSnr.ipynb @@ -0,0 +1,313 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12: Resistance and DC Circuits" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.1, Page 237" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnitude, I4 = -3 A\n" + ] + } + ], + "source": [ + "#Initialization\n", + "i1=8 #current in Amp\n", + "i2=1 #current in Amp\n", + "i3=4 #current in Amp\n", + "\n", + "#Calculation\n", + "i4=i2+i3-i1 #current in Amp\n", + "\n", + "#Results\n", + "print'Magnitude, I4 = %d A'%i4" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.2, Page 239" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "#Initialization\n", + "e=12 #EMF source in volt\n", + "v1=3 #node voltage\n", + "v3=3 #node voltage\n", + "\n", + "#Calculation\n", + "v2=v1+v3-e #node voltage\n", + "\n", + "#Results\n", + "print'V2 = %d V'%v2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4, Page 242" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voc = 10 V\n", + "R = 100 ohm\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "\n", + "#We have used method II for solving our problem by using simultaneous equations\n", + "\n", + "a = np.array([[25,-2],[400,-8]]) \n", + "b = np.array([[50],[3200]])\n", + "c=np.linalg.solve(a,b)\n", + "\n", + "print'Voc = %d V'%c[0]\n", + "print'R = %d ohm'%c[1]\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.5, Page 244" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage, V = 7.14\n" + ] + } + ], + "source": [ + "#Initialization\n", + "r1=100 #Resistance in Ohm\n", + "r2=200 #Resistance in Ohm\n", + "r3=50 #Resistance in Ohm\n", + "v1=15 #voltage source\n", + "v2=20 #voltage source\n", + "\n", + "#Calculation\n", + "#Considering 15 V as a source & replace the other voltage source by its internal resistance,\n", + "r11=(r2*r3)*(r2+r3)**-1 #resistance in parallel\n", + "v11=v1*(r11/(r1+r11)) #voltage\n", + "#Considering 20 V as a source & replace the other voltage source by its internal resistance,\n", + "r22=(r1*r3)*(r1+r3)**-1 #resistance in parallel\n", + "v22=v2*(r22/(r2+r22)) #voltage\n", + "\n", + "#output of the original circuit\n", + "v33=v11+v22\n", + "\n", + "\n", + "\n", + "#Results\n", + "print'Voltage, V = %.2f'%v33" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.6, Page 246" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Current, I = 1.67 A\n" + ] + } + ], + "source": [ + "#Initialization\n", + "r1=10 #Resistance in Ohm\n", + "r2=5 #Resistance in Ohm\n", + "v2=5 #voltage source\n", + "i=2 #current in Amp\n", + "\n", + "#Calculation\n", + "#Considering 5 V as a source & replace the current source by its internal resistance,\n", + "i1=v2*(r1+r2)**-1 #current using Ohms law\n", + "#Considering current source & replace the voltage source by its internal resistance,\n", + "r3=(r1*r2)*(r1+r2)**-1 #resistance in parallel\n", + "v3=i*r3 #voltage using Ohms law\n", + "i2=v3*r2**-1 #current using Ohms law\n", + "i3=i1+i2 #total current\n", + "\n", + "#Results\n", + "print'Output Current, I = %.2f A'%i3" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.8, Page 251" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "V2 = 33.04 V\n", + "V3 = 43.15 V\n", + "Current, I1 = 1.73 A\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "r=25 #resistance in ohm\n", + "\n", + "#We have used for solving our problem by using simultaneous equations\n", + "\n", + "a = np.array([[(-13*60**-1),(1*20**-1)],[(1*60**-1),(-9*100**-1)]]) \n", + "b = np.array([[-5],[-100*30**-1]])\n", + "c=np.linalg.solve(a,b)\n", + "i1=c[1]/r #required current\n", + "\n", + "print'V2 = %.2f V'%c[0] #wrong answer in textbook\n", + "print'V3 = %.2f V'%c[1] #wrong answer in textbook\n", + "print'Current, I1 = %.2f A'%i1\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.9, Page 253" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "I1 = 326 mA\n", + "I2 = 33 mA\n", + "I3 = 53 mA\n", + "Voltage, Ve = 0.197 V\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "re=10 #resistance in ohm\n", + "\n", + "#We have used for solving our problem by using simultaneous equations\n", + "\n", + "a = np.array([[(-160),(20), (30)],[(20),(-210), (10)], [(30),(10), (-190)]]) \n", + "b = np.array([[-50],[0],[0]])\n", + "c=np.linalg.solve(a,b)\n", + "ve=re*(c[2]-c[1])\n", + "\n", + "print'I1 = %d mA'%(c[0]*10**3) #current I1\n", + "print'I2 = %d mA'%(c[1]*10**3) #current I2\n", + "print'I3 = %d mA'%(c[2]*10**3) #current I3\n", + "print'Voltage, Ve = %.3f V'%ve\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter13.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter13.ipynb new file mode 100644 index 00000000..6ed908f9 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter13.ipynb @@ -0,0 +1,278 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d756c6c77a4ac290c4965398d89838e2f053a559b464bd46ff8cc1c208f13b8e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13: Capacitance and Electric Fields" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1, Page 264" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "c=10*10**-6 #capacitance in Farad\n", + "v=10 #voltage\n", + "\n", + "#Calculation\n", + "q=c*v #charge in coulomb\n", + "\n", + "#Results\n", + "print'Charge, q = %.1f uC'%(q*10**6)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Charge, q = 100.0 uC\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2, Page 264" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "l=25*10**-3 #length in meter\n", + "b=10*10**-3 #breadth in meter\n", + "d=7*10**-6 #distance between plates in meter\n", + "e=100 #dielectric constant of material\n", + "e0=8.85*10**-12 #dielectric constant of air \n", + "\n", + "#Calculation\n", + "c=(e0*e*l*b)*d**-1 #Capacitance\n", + "#Results\n", + "print'Capacitance, C = %.1f nF'%(c*10**9)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Capacitance, C = 31.6 nF\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.3, Page 268" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "v=100 #voltage\n", + "d=10**-5 #distance in meter\n", + "\n", + "#Calculation\n", + "e=v*d**-1 #Electric Field Strength\n", + "\n", + "#Results\n", + "print'Electric Field Strength, E = %d ^7 V/m'%round(e*10**-6)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Electric Field Strength, E = 10 ^7 V/m\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.4, Page 268" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "q=15*10**-6 #charge in coulomb\n", + "a=200*10**-6 #area\n", + "\n", + "#Calculation\n", + "d=q/a #electric flux density\n", + "\n", + "#Results\n", + "print'D = %d mC/m^2'%(d*10**3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "D = 75 mC/m^2\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.5, Page 270" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "C1=10*10**-6 #capacitance in Farad\n", + "C2=25*10**-6 #capacitance in Farad\n", + "\n", + "#Calculation\n", + "C=C1+C2 #capacitance in Farad\n", + "\n", + "#Results\n", + "print'C = %d uF'%(C*10**6)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "C = 35 uF\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.6, Page 271" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "C1=10*10**-6 #capacitance in Farad\n", + "C2=25*10**-6 #capacitance in Farad\n", + "\n", + "#Calculation\n", + "C=(C1*C2)/(C1+C2) #capacitance in Farad\n", + "\n", + "#Results\n", + "print'C = %.2f uF'%(C*10**6)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "C = 7.14 uF\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.7, Page 275" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "C1=10*10**-6 #capacitance in Farad\n", + "V=100 #voltage\n", + "\n", + "#Calculation\n", + "E=(0.5)*(C1*V**2) #Energy stored\n", + "\n", + "#Results\n", + "print'E = %.1f mJ'%(E*10**3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "E = 50.0 mJ\n" + ] + } + ], + "prompt_number": 35 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter13_IKwAwKI.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter13_IKwAwKI.ipynb new file mode 100644 index 00000000..6ed908f9 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter13_IKwAwKI.ipynb @@ -0,0 +1,278 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d756c6c77a4ac290c4965398d89838e2f053a559b464bd46ff8cc1c208f13b8e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13: Capacitance and Electric Fields" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1, Page 264" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "c=10*10**-6 #capacitance in Farad\n", + "v=10 #voltage\n", + "\n", + "#Calculation\n", + "q=c*v #charge in coulomb\n", + "\n", + "#Results\n", + "print'Charge, q = %.1f uC'%(q*10**6)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Charge, q = 100.0 uC\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2, Page 264" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "l=25*10**-3 #length in meter\n", + "b=10*10**-3 #breadth in meter\n", + "d=7*10**-6 #distance between plates in meter\n", + "e=100 #dielectric constant of material\n", + "e0=8.85*10**-12 #dielectric constant of air \n", + "\n", + "#Calculation\n", + "c=(e0*e*l*b)*d**-1 #Capacitance\n", + "#Results\n", + "print'Capacitance, C = %.1f nF'%(c*10**9)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Capacitance, C = 31.6 nF\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.3, Page 268" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "v=100 #voltage\n", + "d=10**-5 #distance in meter\n", + "\n", + "#Calculation\n", + "e=v*d**-1 #Electric Field Strength\n", + "\n", + "#Results\n", + "print'Electric Field Strength, E = %d ^7 V/m'%round(e*10**-6)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Electric Field Strength, E = 10 ^7 V/m\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.4, Page 268" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "q=15*10**-6 #charge in coulomb\n", + "a=200*10**-6 #area\n", + "\n", + "#Calculation\n", + "d=q/a #electric flux density\n", + "\n", + "#Results\n", + "print'D = %d mC/m^2'%(d*10**3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "D = 75 mC/m^2\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.5, Page 270" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "C1=10*10**-6 #capacitance in Farad\n", + "C2=25*10**-6 #capacitance in Farad\n", + "\n", + "#Calculation\n", + "C=C1+C2 #capacitance in Farad\n", + "\n", + "#Results\n", + "print'C = %d uF'%(C*10**6)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "C = 35 uF\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.6, Page 271" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "C1=10*10**-6 #capacitance in Farad\n", + "C2=25*10**-6 #capacitance in Farad\n", + "\n", + "#Calculation\n", + "C=(C1*C2)/(C1+C2) #capacitance in Farad\n", + "\n", + "#Results\n", + "print'C = %.2f uF'%(C*10**6)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "C = 7.14 uF\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.7, Page 275" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "C1=10*10**-6 #capacitance in Farad\n", + "V=100 #voltage\n", + "\n", + "#Calculation\n", + "E=(0.5)*(C1*V**2) #Energy stored\n", + "\n", + "#Results\n", + "print'E = %.1f mJ'%(E*10**3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "E = 50.0 mJ\n" + ] + } + ], + "prompt_number": 35 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter13_xbFXJW8.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter13_xbFXJW8.ipynb new file mode 100644 index 00000000..6ed908f9 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter13_xbFXJW8.ipynb @@ -0,0 +1,278 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d756c6c77a4ac290c4965398d89838e2f053a559b464bd46ff8cc1c208f13b8e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13: Capacitance and Electric Fields" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1, Page 264" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "c=10*10**-6 #capacitance in Farad\n", + "v=10 #voltage\n", + "\n", + "#Calculation\n", + "q=c*v #charge in coulomb\n", + "\n", + "#Results\n", + "print'Charge, q = %.1f uC'%(q*10**6)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Charge, q = 100.0 uC\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2, Page 264" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "l=25*10**-3 #length in meter\n", + "b=10*10**-3 #breadth in meter\n", + "d=7*10**-6 #distance between plates in meter\n", + "e=100 #dielectric constant of material\n", + "e0=8.85*10**-12 #dielectric constant of air \n", + "\n", + "#Calculation\n", + "c=(e0*e*l*b)*d**-1 #Capacitance\n", + "#Results\n", + "print'Capacitance, C = %.1f nF'%(c*10**9)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Capacitance, C = 31.6 nF\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.3, Page 268" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "v=100 #voltage\n", + "d=10**-5 #distance in meter\n", + "\n", + "#Calculation\n", + "e=v*d**-1 #Electric Field Strength\n", + "\n", + "#Results\n", + "print'Electric Field Strength, E = %d ^7 V/m'%round(e*10**-6)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Electric Field Strength, E = 10 ^7 V/m\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.4, Page 268" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "q=15*10**-6 #charge in coulomb\n", + "a=200*10**-6 #area\n", + "\n", + "#Calculation\n", + "d=q/a #electric flux density\n", + "\n", + "#Results\n", + "print'D = %d mC/m^2'%(d*10**3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "D = 75 mC/m^2\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.5, Page 270" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "C1=10*10**-6 #capacitance in Farad\n", + "C2=25*10**-6 #capacitance in Farad\n", + "\n", + "#Calculation\n", + "C=C1+C2 #capacitance in Farad\n", + "\n", + "#Results\n", + "print'C = %d uF'%(C*10**6)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "C = 35 uF\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.6, Page 271" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "C1=10*10**-6 #capacitance in Farad\n", + "C2=25*10**-6 #capacitance in Farad\n", + "\n", + "#Calculation\n", + "C=(C1*C2)/(C1+C2) #capacitance in Farad\n", + "\n", + "#Results\n", + "print'C = %.2f uF'%(C*10**6)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "C = 7.14 uF\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.7, Page 275" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Initialization\n", + "C1=10*10**-6 #capacitance in Farad\n", + "V=100 #voltage\n", + "\n", + "#Calculation\n", + "E=(0.5)*(C1*V**2) #Energy stored\n", + "\n", + "#Results\n", + "print'E = %.1f mJ'%(E*10**3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "E = 50.0 mJ\n" + ] + } + ], + "prompt_number": 35 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter14.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter14.ipynb new file mode 100644 index 00000000..e0d13aee --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter14.ipynb @@ -0,0 +1,268 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 14: Inductance and Magnetic Fields" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.1, Page 280" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnetic Field Strength, H = 7.96 A/m\n" + ] + } + ], + "source": [ + "#Initialization\n", + "i=5 #current in ampere\n", + "l=0.628 #circumference\n", + "\n", + "\n", + "#Calculation\n", + "h=i/l #magnetic field strength\n", + "\n", + "#Results\n", + "print'Magnetic Field Strength, H = %.2f A/m'%h" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.2, Page 283" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Magnetomotive Force, H = 3000.00 ampere-turns\n", + "(b) Magnetic Field Strength, H = 7500.00 A/m\n", + "(c) B = 9.42 mT\n", + "(d) Toal Flux, phi = 2.83 uWb\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "i=6 #current in ampere\n", + "n=500 #turns\n", + "l=0.4 #circumference\n", + "uo=4*math.pi*10**-7 #epsilon zero constant\n", + "a=300*10**-6 #area\n", + "\n", + "#Calculation\n", + "f=n*i #Magnetomotive Force\n", + "h=f/l #magnetic field strength\n", + "b=uo*h #magnetic induction\n", + "phi=b*a #flux\n", + "\n", + "#Results\n", + "print'(a) Magnetomotive Force, H = %.2f ampere-turns'%f\n", + "print'(b) Magnetic Field Strength, H = %.2f A/m'%h\n", + "print'(c) B = %.2f mT'%(b*10**3)\n", + "print'(d) Toal Flux, phi = %.2f uWb'%(phi*10**6)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.3, Page 285" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage, V = 30 mV\n" + ] + } + ], + "source": [ + "#Initialization\n", + "l=10*10**-3 #inductance in henry\n", + "di=3\n", + "\n", + "\n", + "#Calculation\n", + "v=l*di #voltage \n", + "\n", + "#Results\n", + "print'Voltage, V = %d mV'%(v*10**3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.4, Page 287" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Inductance,L = 30 uH\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "n=400 #turns\n", + "l=200*10**-3 #circumference\n", + "uo=4*math.pi*10**-7 #epsilon zero constant\n", + "a=30*10**-6 #area\n", + "\n", + "#Calculation\n", + "L=(uo*a*n**2)/l #Inductance in henry \n", + "\n", + "#Results\n", + "print'Inductance,L = %d uH'%(L*10**6)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.5, Page 289" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Inductance in series,L = 30 uH\n", + "(b) Inductance in parallel,L = 6.67 uH\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "l1=10 #Inductance in henry \n", + "l2=20 #Inductance in henry \n", + "\n", + "#Calculation\n", + "ls=l1+l2 #Inductance in henry \n", + "lp=((l1*l2)*(l1+l2)**-1) #Inductance in henry \n", + "#Results\n", + "print'(a) Inductance in series,L = %d uH'%ls\n", + "print'(b) Inductance in parallel,L = %.2f uH'%lp" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.6, Page 293" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Stored Energy = 125 mJ\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "l=10**-2 #Inductance in henry \n", + "i=5 #current in ampere \n", + "\n", + "#Calculation\n", + "s=0.5*l*i**2 #stored energy\n", + "\n", + "#Results\n", + "print'Stored Energy = %d mJ'%(s*10**3)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter14_Gi0X0ZR.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter14_Gi0X0ZR.ipynb new file mode 100644 index 00000000..e0d13aee --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter14_Gi0X0ZR.ipynb @@ -0,0 +1,268 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 14: Inductance and Magnetic Fields" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.1, Page 280" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnetic Field Strength, H = 7.96 A/m\n" + ] + } + ], + "source": [ + "#Initialization\n", + "i=5 #current in ampere\n", + "l=0.628 #circumference\n", + "\n", + "\n", + "#Calculation\n", + "h=i/l #magnetic field strength\n", + "\n", + "#Results\n", + "print'Magnetic Field Strength, H = %.2f A/m'%h" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.2, Page 283" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Magnetomotive Force, H = 3000.00 ampere-turns\n", + "(b) Magnetic Field Strength, H = 7500.00 A/m\n", + "(c) B = 9.42 mT\n", + "(d) Toal Flux, phi = 2.83 uWb\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "i=6 #current in ampere\n", + "n=500 #turns\n", + "l=0.4 #circumference\n", + "uo=4*math.pi*10**-7 #epsilon zero constant\n", + "a=300*10**-6 #area\n", + "\n", + "#Calculation\n", + "f=n*i #Magnetomotive Force\n", + "h=f/l #magnetic field strength\n", + "b=uo*h #magnetic induction\n", + "phi=b*a #flux\n", + "\n", + "#Results\n", + "print'(a) Magnetomotive Force, H = %.2f ampere-turns'%f\n", + "print'(b) Magnetic Field Strength, H = %.2f A/m'%h\n", + "print'(c) B = %.2f mT'%(b*10**3)\n", + "print'(d) Toal Flux, phi = %.2f uWb'%(phi*10**6)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.3, Page 285" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage, V = 30 mV\n" + ] + } + ], + "source": [ + "#Initialization\n", + "l=10*10**-3 #inductance in henry\n", + "di=3\n", + "\n", + "\n", + "#Calculation\n", + "v=l*di #voltage \n", + "\n", + "#Results\n", + "print'Voltage, V = %d mV'%(v*10**3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.4, Page 287" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Inductance,L = 30 uH\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "n=400 #turns\n", + "l=200*10**-3 #circumference\n", + "uo=4*math.pi*10**-7 #epsilon zero constant\n", + "a=30*10**-6 #area\n", + "\n", + "#Calculation\n", + "L=(uo*a*n**2)/l #Inductance in henry \n", + "\n", + "#Results\n", + "print'Inductance,L = %d uH'%(L*10**6)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.5, Page 289" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Inductance in series,L = 30 uH\n", + "(b) Inductance in parallel,L = 6.67 uH\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "l1=10 #Inductance in henry \n", + "l2=20 #Inductance in henry \n", + "\n", + "#Calculation\n", + "ls=l1+l2 #Inductance in henry \n", + "lp=((l1*l2)*(l1+l2)**-1) #Inductance in henry \n", + "#Results\n", + "print'(a) Inductance in series,L = %d uH'%ls\n", + "print'(b) Inductance in parallel,L = %.2f uH'%lp" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.6, Page 293" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Stored Energy = 125 mJ\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "l=10**-2 #Inductance in henry \n", + "i=5 #current in ampere \n", + "\n", + "#Calculation\n", + "s=0.5*l*i**2 #stored energy\n", + "\n", + "#Results\n", + "print'Stored Energy = %d mJ'%(s*10**3)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter14_XSNxMWG.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter14_XSNxMWG.ipynb new file mode 100644 index 00000000..e0d13aee --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter14_XSNxMWG.ipynb @@ -0,0 +1,268 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 14: Inductance and Magnetic Fields" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.1, Page 280" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Magnetic Field Strength, H = 7.96 A/m\n" + ] + } + ], + "source": [ + "#Initialization\n", + "i=5 #current in ampere\n", + "l=0.628 #circumference\n", + "\n", + "\n", + "#Calculation\n", + "h=i/l #magnetic field strength\n", + "\n", + "#Results\n", + "print'Magnetic Field Strength, H = %.2f A/m'%h" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.2, Page 283" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Magnetomotive Force, H = 3000.00 ampere-turns\n", + "(b) Magnetic Field Strength, H = 7500.00 A/m\n", + "(c) B = 9.42 mT\n", + "(d) Toal Flux, phi = 2.83 uWb\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "i=6 #current in ampere\n", + "n=500 #turns\n", + "l=0.4 #circumference\n", + "uo=4*math.pi*10**-7 #epsilon zero constant\n", + "a=300*10**-6 #area\n", + "\n", + "#Calculation\n", + "f=n*i #Magnetomotive Force\n", + "h=f/l #magnetic field strength\n", + "b=uo*h #magnetic induction\n", + "phi=b*a #flux\n", + "\n", + "#Results\n", + "print'(a) Magnetomotive Force, H = %.2f ampere-turns'%f\n", + "print'(b) Magnetic Field Strength, H = %.2f A/m'%h\n", + "print'(c) B = %.2f mT'%(b*10**3)\n", + "print'(d) Toal Flux, phi = %.2f uWb'%(phi*10**6)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.3, Page 285" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage, V = 30 mV\n" + ] + } + ], + "source": [ + "#Initialization\n", + "l=10*10**-3 #inductance in henry\n", + "di=3\n", + "\n", + "\n", + "#Calculation\n", + "v=l*di #voltage \n", + "\n", + "#Results\n", + "print'Voltage, V = %d mV'%(v*10**3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.4, Page 287" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Inductance,L = 30 uH\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "n=400 #turns\n", + "l=200*10**-3 #circumference\n", + "uo=4*math.pi*10**-7 #epsilon zero constant\n", + "a=30*10**-6 #area\n", + "\n", + "#Calculation\n", + "L=(uo*a*n**2)/l #Inductance in henry \n", + "\n", + "#Results\n", + "print'Inductance,L = %d uH'%(L*10**6)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.5, Page 289" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Inductance in series,L = 30 uH\n", + "(b) Inductance in parallel,L = 6.67 uH\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "l1=10 #Inductance in henry \n", + "l2=20 #Inductance in henry \n", + "\n", + "#Calculation\n", + "ls=l1+l2 #Inductance in henry \n", + "lp=((l1*l2)*(l1+l2)**-1) #Inductance in henry \n", + "#Results\n", + "print'(a) Inductance in series,L = %d uH'%ls\n", + "print'(b) Inductance in parallel,L = %.2f uH'%lp" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.6, Page 293" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Stored Energy = 125 mJ\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "l=10**-2 #Inductance in henry \n", + "i=5 #current in ampere \n", + "\n", + "#Calculation\n", + "s=0.5*l*i**2 #stored energy\n", + "\n", + "#Results\n", + "print'Stored Energy = %d mJ'%(s*10**3)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter15.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter15.ipynb new file mode 100644 index 00000000..0cab5dbb --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter15.ipynb @@ -0,0 +1,395 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter : Alternating Voltages and Currents" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.1, Page 305" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Reactance, Xl = 1 Ohm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "w=1000 #Angular Frequency \n", + "L=10**-3 #Inductance\n", + "\n", + "#Calculation\n", + "Xl=w*L #Reactance\n", + "\n", + "#Result\n", + "print'Reactance, Xl = %d Ohm'%Xl" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.2, Page 305" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Reactance, Xl = 1.59 KOhm\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "f=50 #frequency\n", + "C=2*10**-6 #Capacitance\n", + "\n", + "#Calculation\n", + "w=2*math.pi*f #Angular Frequency \n", + "Xc=1/(w*C) #Reactance\n", + "\n", + "#Result\n", + "print'Reactance, Xl = %.2f KOhm'%(Xc/1000)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.3, Page 306" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Peak Current, IL = 318 mA\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "f=100 #frequency\n", + "l=25*10**-3 #Inductance\n", + "Vl=5 #AC Voltage (Sine)\n", + "\n", + "#Calculation\n", + "w=2*math.pi*f #Angular Frequency \n", + "Xl=w*l #Reactance\n", + "Il=Vl*Xl**-1\n", + "\n", + "#Result\n", + "print'Peak Current, IL = %d mA'%(Il*10**3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.4, Page 306" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage appear across the capacitor, V = 8 V r.m.s\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "Ic=2 #sinusoidal Current\n", + "C=10*10**-3 #Capacitance\n", + "w=25 #Angular Frequency \n", + "\n", + "\n", + "\n", + "#Calculation \n", + "Xc=1/(w*C) #Reactance\n", + "Vc= Ic*Xc #Voltage\n", + "\n", + "#Result\n", + "print'Voltage appear across the capacitor, V = %d V r.m.s'%(Vc)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.5, Page 309" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) V = 63.6 V\n", + "(b) V = 38.15 V\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "I=5 #sinusoidal Current\n", + "R=10 #Resistance in Ohm\n", + "f=50 #Frequency in Hertz\n", + "L=0.025 #Inductancec in Henry\n", + " \n", + "\n", + "#Calculation \n", + "Vr=I*R #Voltage across resistor\n", + "Xl=2*math.pi*f*L #Reactance\n", + "VL= I*Xl #Voltage across inductor\n", + "V=math.sqrt((Vr**2)+(VL**2)) #total voltage\n", + "phi=math.atan(VL*Vr**-1) #Phase Angle in radians\n", + "\n", + "#Result\n", + "print'(a) V = %.1f V'%(V)\n", + "print'(b) V = %.2f V'%(phi*180/math.pi) #phase angle in degree" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.6, Page 311" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Current, I = 884 uA\n", + "(b) V = -27.95 V\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "R=10**4 #Resistance in Ohm\n", + "f=10**3 #Frequency in Hertz\n", + "C=3*10**-8 #Capacitance in Farad\n", + "V=10 #Voltage\n", + "\n", + "#Calculation \n", + "Xc=1/(2*math.pi*f*C) #Reactance\n", + "a=((10**4)**2)+(5.3*10**3)**2\n", + "I=math.sqrt((V**2)/a) #Current in Amp\n", + "Vr=I*R #Voltage\n", + "Vc=Xc*I #Voltage\n", + "phi=math.atan(Vc/Vr) #Phase Angle in radians\n", + "\n", + "#Result\n", + "print'(a) Current, I = %d uA'%round(I*10**6)\n", + "print'(b) V = %.2f V'%(-phi*180/math.pi) #phase angle in degree" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.7, Page 317" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Z = 200 + j 62 Ohms\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "I=5 #sinusoidal Current\n", + "R=200 #Resistance in Ohm\n", + "f=50 #Frequency in Hertz\n", + "L=400*10**-3 #Inductancec in Henry\n", + "C=50*10**-6 #Capacitance in Henry \n", + "\n", + "#Calculation \n", + "Vr=I*R #Voltage across resistor\n", + "Xl=2*math.pi*f*L #Reactance\n", + "Xc=1/(2*math.pi*f*C) #Reactance\n", + "i=Xl-Xc\n", + "\n", + "#Result\n", + "print'Z = %d + j %d Ohms'%(R,i)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.8, Page 320" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "vo = 12.4 < 29.7\n", + "Therefore\n", + "vo = 12.4 sin(500 t + 29.7)\n" + ] + } + ], + "source": [ + "import math\n", + "from numpy import ones\n", + "\n", + "#Initialisation\n", + "R1=5 #Resistance in Ohm\n", + "R2=50 #Resistance in Ohm\n", + "w=500 #rad/s\n", + "L=50*10**-3 #Inductancec in Henry\n", + "C=200*10**-6 #Capacitance in Henry \n", + "v=10\n", + "\n", + "#Calculation\n", + "Xc=1/(w*C) #Reactance\n", + "Z1=complex(R1,-Xc) #taking in complex form\n", + "a=(R2*w**2*L**2)/(R2**2+(w**2*L**2))\n", + "b=(R2**2*w*L)/(R2**2+(w**2*L**2))\n", + "Z2=complex(a,b) #taking in complex form\n", + "Z3=(Z1+Z2)\n", + "Z=Z2/Z3\n", + "r=math.sqrt((Z.real)**2 + (Z.imag)**2) #converting in polar (absolute)\n", + "r1=v*r \n", + "phi=math.atan(Z.imag/Z.real) #converting in polar (phase)\n", + "\n", + "#Result\n", + "print'vo = %.1f < %.1f'%(r1,(phi*180/math.pi))\n", + "print'Therefore'\n", + "print'vo = %.1f sin(%d t + %.1f)'%(r1,w,(phi*180/math.pi))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter15_QY6wZIq.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter15_QY6wZIq.ipynb new file mode 100644 index 00000000..1862ee2c --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter15_QY6wZIq.ipynb @@ -0,0 +1,396 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 15: Alternating Voltages and Currents" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.1, Page 305" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Reactance, Xl = 1 Ohm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "w=1000 #Angular Frequency \n", + "L=10**-3 #Inductance\n", + "\n", + "#Calculation\n", + "Xl=w*L #Reactance\n", + "\n", + "#Result\n", + "print'Reactance, Xl = %d Ohm'%Xl" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.2, Page 305" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Reactance, Xl = 1.59 KOhm\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "f=50 #frequency\n", + "C=2*10**-6 #Capacitance\n", + "\n", + "#Calculation\n", + "w=2*math.pi*f #Angular Frequency \n", + "Xc=1/(w*C) #Reactance\n", + "\n", + "#Result\n", + "print'Reactance, Xl = %.2f KOhm'%(Xc/1000)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.3, Page 306" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Peak Current, IL = 318 mA\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "f=100 #frequency\n", + "l=25*10**-3 #Inductance\n", + "Vl=5 #AC Voltage (Sine)\n", + "\n", + "#Calculation\n", + "w=2*math.pi*f #Angular Frequency \n", + "Xl=w*l #Reactance\n", + "Il=Vl*Xl**-1\n", + "\n", + "#Result\n", + "print'Peak Current, IL = %d mA'%(Il*10**3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.4, Page 306" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage appear across the capacitor, V = 8 V r.m.s\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "Ic=2 #sinusoidal Current\n", + "C=10*10**-3 #Capacitance\n", + "w=25 #Angular Frequency \n", + "\n", + "\n", + "\n", + "#Calculation \n", + "Xc=1/(w*C) #Reactance\n", + "Vc= Ic*Xc #Voltage\n", + "\n", + "#Result\n", + "print'Voltage appear across the capacitor, V = %d V r.m.s'%(Vc)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.5, Page 309" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) V = 63.6 V\n", + "(b) V = 38.15 V\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "I=5 #sinusoidal Current\n", + "R=10 #Resistance in Ohm\n", + "f=50 #Frequency in Hertz\n", + "L=0.025 #Inductancec in Henry\n", + " \n", + "\n", + "#Calculation \n", + "Vr=I*R #Voltage across resistor\n", + "Xl=2*math.pi*f*L #Reactance\n", + "VL= I*Xl #Voltage across inductor\n", + "V=math.sqrt((Vr**2)+(VL**2)) #total voltage\n", + "phi=math.atan(VL*Vr**-1) #Phase Angle in radians\n", + "\n", + "#Result\n", + "print'(a) V = %.1f V'%(V)\n", + "print'(b) V = %.2f V'%(phi*180/math.pi) #phase angle in degree" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.6, Page 311" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Current, I = 884 uA\n", + "(b) V = -27.95 V\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "R=10**4 #Resistance in Ohm\n", + "f=10**3 #Frequency in Hertz\n", + "C=3*10**-8 #Capacitance in Farad\n", + "V=10 #Voltage\n", + "\n", + "#Calculation \n", + "Xc=1/(2*math.pi*f*C) #Reactance\n", + "a=((10**4)**2)+(5.3*10**3)**2\n", + "I=math.sqrt((V**2)/a) #Current in Amp\n", + "Vr=I*R #Voltage\n", + "Vc=Xc*I #Voltage\n", + "phi=math.atan(Vc/Vr) #Phase Angle in radians\n", + "\n", + "#Result\n", + "print'(a) Current, I = %d uA'%round(I*10**6)\n", + "print'(b) V = %.2f V'%(-phi*180/math.pi) #phase angle in degree" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.7, Page 317" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Z = 200 + j 62 Ohms\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "I=5 #sinusoidal Current\n", + "R=200 #Resistance in Ohm\n", + "f=50 #Frequency in Hertz\n", + "L=400*10**-3 #Inductancec in Henry\n", + "C=50*10**-6 #Capacitance in Henry \n", + "\n", + "#Calculation \n", + "Vr=I*R #Voltage across resistor\n", + "Xl=2*math.pi*f*L #Reactance\n", + "Xc=1/(2*math.pi*f*C) #Reactance\n", + "i=Xl-Xc\n", + "\n", + "#Result\n", + "print'Z = %d + j %d Ohms'%(R,i)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.8, Page 320" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "vo = 12.4 < 29.7\n", + "Therefore\n", + "vo = 12.4 sin(500 t + 29.7)\n" + ] + } + ], + "source": [ + "import math\n", + "from numpy import ones\n", + "\n", + "#Initialisation\n", + "R1=5 #Resistance in Ohm\n", + "R2=50 #Resistance in Ohm\n", + "w=500 #rad/s\n", + "L=50*10**-3 #Inductancec in Henry\n", + "C=200*10**-6 #Capacitance in Henry \n", + "v=10\n", + "\n", + "#Calculation\n", + "Xc=1/(w*C) #Reactance\n", + "Z1=complex(R1,-Xc) #taking in complex form\n", + "a=(R2*w**2*L**2)/(R2**2+(w**2*L**2))\n", + "b=(R2**2*w*L)/(R2**2+(w**2*L**2))\n", + "Z2=complex(a,b) #taking in complex form\n", + "Z3=(Z1+Z2)\n", + "Z=Z2/Z3\n", + "r=math.sqrt((Z.real)**2 + (Z.imag)**2) #converting in polar (absolute)\n", + "r1=v*r \n", + "phi=math.atan(Z.imag/Z.real) #converting in polar (phase)\n", + "\n", + "#Result\n", + "print'vo = %.1f < %.1f'%(r1,(phi*180/math.pi))\n", + "print'Therefore'\n", + "print'vo = %.1f sin(%d t + %.1f)'%(r1,w,(phi*180/math.pi))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter15_RiCS0Ai.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter15_RiCS0Ai.ipynb new file mode 100644 index 00000000..1862ee2c --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter15_RiCS0Ai.ipynb @@ -0,0 +1,396 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 15: Alternating Voltages and Currents" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.1, Page 305" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Reactance, Xl = 1 Ohm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "w=1000 #Angular Frequency \n", + "L=10**-3 #Inductance\n", + "\n", + "#Calculation\n", + "Xl=w*L #Reactance\n", + "\n", + "#Result\n", + "print'Reactance, Xl = %d Ohm'%Xl" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.2, Page 305" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Reactance, Xl = 1.59 KOhm\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "f=50 #frequency\n", + "C=2*10**-6 #Capacitance\n", + "\n", + "#Calculation\n", + "w=2*math.pi*f #Angular Frequency \n", + "Xc=1/(w*C) #Reactance\n", + "\n", + "#Result\n", + "print'Reactance, Xl = %.2f KOhm'%(Xc/1000)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.3, Page 306" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Peak Current, IL = 318 mA\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "f=100 #frequency\n", + "l=25*10**-3 #Inductance\n", + "Vl=5 #AC Voltage (Sine)\n", + "\n", + "#Calculation\n", + "w=2*math.pi*f #Angular Frequency \n", + "Xl=w*l #Reactance\n", + "Il=Vl*Xl**-1\n", + "\n", + "#Result\n", + "print'Peak Current, IL = %d mA'%(Il*10**3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.4, Page 306" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage appear across the capacitor, V = 8 V r.m.s\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "Ic=2 #sinusoidal Current\n", + "C=10*10**-3 #Capacitance\n", + "w=25 #Angular Frequency \n", + "\n", + "\n", + "\n", + "#Calculation \n", + "Xc=1/(w*C) #Reactance\n", + "Vc= Ic*Xc #Voltage\n", + "\n", + "#Result\n", + "print'Voltage appear across the capacitor, V = %d V r.m.s'%(Vc)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.5, Page 309" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) V = 63.6 V\n", + "(b) V = 38.15 V\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "I=5 #sinusoidal Current\n", + "R=10 #Resistance in Ohm\n", + "f=50 #Frequency in Hertz\n", + "L=0.025 #Inductancec in Henry\n", + " \n", + "\n", + "#Calculation \n", + "Vr=I*R #Voltage across resistor\n", + "Xl=2*math.pi*f*L #Reactance\n", + "VL= I*Xl #Voltage across inductor\n", + "V=math.sqrt((Vr**2)+(VL**2)) #total voltage\n", + "phi=math.atan(VL*Vr**-1) #Phase Angle in radians\n", + "\n", + "#Result\n", + "print'(a) V = %.1f V'%(V)\n", + "print'(b) V = %.2f V'%(phi*180/math.pi) #phase angle in degree" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.6, Page 311" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Current, I = 884 uA\n", + "(b) V = -27.95 V\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "R=10**4 #Resistance in Ohm\n", + "f=10**3 #Frequency in Hertz\n", + "C=3*10**-8 #Capacitance in Farad\n", + "V=10 #Voltage\n", + "\n", + "#Calculation \n", + "Xc=1/(2*math.pi*f*C) #Reactance\n", + "a=((10**4)**2)+(5.3*10**3)**2\n", + "I=math.sqrt((V**2)/a) #Current in Amp\n", + "Vr=I*R #Voltage\n", + "Vc=Xc*I #Voltage\n", + "phi=math.atan(Vc/Vr) #Phase Angle in radians\n", + "\n", + "#Result\n", + "print'(a) Current, I = %d uA'%round(I*10**6)\n", + "print'(b) V = %.2f V'%(-phi*180/math.pi) #phase angle in degree" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.7, Page 317" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Z = 200 + j 62 Ohms\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "I=5 #sinusoidal Current\n", + "R=200 #Resistance in Ohm\n", + "f=50 #Frequency in Hertz\n", + "L=400*10**-3 #Inductancec in Henry\n", + "C=50*10**-6 #Capacitance in Henry \n", + "\n", + "#Calculation \n", + "Vr=I*R #Voltage across resistor\n", + "Xl=2*math.pi*f*L #Reactance\n", + "Xc=1/(2*math.pi*f*C) #Reactance\n", + "i=Xl-Xc\n", + "\n", + "#Result\n", + "print'Z = %d + j %d Ohms'%(R,i)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 15.8, Page 320" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "vo = 12.4 < 29.7\n", + "Therefore\n", + "vo = 12.4 sin(500 t + 29.7)\n" + ] + } + ], + "source": [ + "import math\n", + "from numpy import ones\n", + "\n", + "#Initialisation\n", + "R1=5 #Resistance in Ohm\n", + "R2=50 #Resistance in Ohm\n", + "w=500 #rad/s\n", + "L=50*10**-3 #Inductancec in Henry\n", + "C=200*10**-6 #Capacitance in Henry \n", + "v=10\n", + "\n", + "#Calculation\n", + "Xc=1/(w*C) #Reactance\n", + "Z1=complex(R1,-Xc) #taking in complex form\n", + "a=(R2*w**2*L**2)/(R2**2+(w**2*L**2))\n", + "b=(R2**2*w*L)/(R2**2+(w**2*L**2))\n", + "Z2=complex(a,b) #taking in complex form\n", + "Z3=(Z1+Z2)\n", + "Z=Z2/Z3\n", + "r=math.sqrt((Z.real)**2 + (Z.imag)**2) #converting in polar (absolute)\n", + "r1=v*r \n", + "phi=math.atan(Z.imag/Z.real) #converting in polar (phase)\n", + "\n", + "#Result\n", + "print'vo = %.1f < %.1f'%(r1,(phi*180/math.pi))\n", + "print'Therefore'\n", + "print'vo = %.1f sin(%d t + %.1f)'%(r1,w,(phi*180/math.pi))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter16.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter16.ipynb new file mode 100644 index 00000000..7a471548 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter16.ipynb @@ -0,0 +1,215 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 16: Power in AC Circuits" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.1, Page 329" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Apparent power, S = 250 VA\n", + "(b) Power Factor = 0.866\n", + "(c) Active Power, P = 216.5\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "V=50 #Voltage\n", + "I=5 #Current in Ampere r.m.s\n", + "phase=30 #in degrees\n", + "\n", + "#Calculation \n", + "S=V*I #apparent power\n", + "pf=math.cos(phase*math.pi/180) #power factor\n", + "apf=S*pf #active power\n", + "\n", + "#Result\n", + "print'(a) Apparent power, S = %d VA'%S\n", + "print'(b) Power Factor = %.3f'%pf\n", + "print'(c) Active Power, P = %.1f'%apf" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.2, Page 331" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Apparent Power, P = 2000 W\n", + " Active Power, P = 1500 W\n", + " Reactive Power, Q = 1322 var\n", + " Current I = 8.33 A\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "pf=0.75 #power factor\n", + "S=2000 #apparent power in VA\n", + "V=240 #Voltage in volts\n", + "\n", + "#Calculation \n", + "apf=S*pf #active power\n", + "sin=math.sqrt(1-(pf**2)) \n", + "Q=S*sin #Reactive Power\n", + "I=S*V**-1 #Current\n", + "#Result\n", + "print' Apparent Power, P = %d W'%S\n", + "print' Active Power, P = %d W'%apf\n", + "print' Reactive Power, Q = %d var'%Q\n", + "print' Current I = %.2f A'%I" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.3, Page 333" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Apparent Power, S = 1500 W\n", + " Active Power, P = 1500 W\n", + " Reactive Power, Q = 1322 var\n", + " Current I = 6.25 A\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "pf=0.75 #power factor\n", + "S=1500 #apparent power in W\n", + "V=240 #Voltage in volts\n", + "P1 = 2000 #apparent power\n", + "P2 = 1500 #active power\n", + "Q = 1322 #reactive power\n", + "I = 8.33 #current in amp\n", + "f=50 #frequency in hertz\n", + "\n", + "#Calculation \n", + "Xc=V**2/Q #reactive capacitance\n", + "C=1/(Xc*2*math.pi*f) #capacitance\n", + "I=S*V**-1 #current\n", + "\n", + "#Result\n", + "print' Apparent Power, S = %d W'%S\n", + "print' Active Power, P = %d W'%apf\n", + "print' Reactive Power, Q = %d var'%Q\n", + "print' Current I = %.2f A'%I" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.4, Page 335" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Zl = (50+20j)\n" + ] + } + ], + "source": [ + "import math\n", + "import numpy as np\n", + "\n", + "#Initialisation\n", + "Zo=complex(50,-20) #complex form of output impedance\n", + "\n", + "#Calculation \n", + "Zl=np.conjugate(Zo) #complex form of Load impedance\n", + "\n", + "#Result\n", + "print'Zl = %s'%Zl" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter16_0NyhPvP.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter16_0NyhPvP.ipynb new file mode 100644 index 00000000..7a471548 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter16_0NyhPvP.ipynb @@ -0,0 +1,215 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 16: Power in AC Circuits" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.1, Page 329" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Apparent power, S = 250 VA\n", + "(b) Power Factor = 0.866\n", + "(c) Active Power, P = 216.5\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "V=50 #Voltage\n", + "I=5 #Current in Ampere r.m.s\n", + "phase=30 #in degrees\n", + "\n", + "#Calculation \n", + "S=V*I #apparent power\n", + "pf=math.cos(phase*math.pi/180) #power factor\n", + "apf=S*pf #active power\n", + "\n", + "#Result\n", + "print'(a) Apparent power, S = %d VA'%S\n", + "print'(b) Power Factor = %.3f'%pf\n", + "print'(c) Active Power, P = %.1f'%apf" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.2, Page 331" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Apparent Power, P = 2000 W\n", + " Active Power, P = 1500 W\n", + " Reactive Power, Q = 1322 var\n", + " Current I = 8.33 A\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "pf=0.75 #power factor\n", + "S=2000 #apparent power in VA\n", + "V=240 #Voltage in volts\n", + "\n", + "#Calculation \n", + "apf=S*pf #active power\n", + "sin=math.sqrt(1-(pf**2)) \n", + "Q=S*sin #Reactive Power\n", + "I=S*V**-1 #Current\n", + "#Result\n", + "print' Apparent Power, P = %d W'%S\n", + "print' Active Power, P = %d W'%apf\n", + "print' Reactive Power, Q = %d var'%Q\n", + "print' Current I = %.2f A'%I" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.3, Page 333" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Apparent Power, S = 1500 W\n", + " Active Power, P = 1500 W\n", + " Reactive Power, Q = 1322 var\n", + " Current I = 6.25 A\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "pf=0.75 #power factor\n", + "S=1500 #apparent power in W\n", + "V=240 #Voltage in volts\n", + "P1 = 2000 #apparent power\n", + "P2 = 1500 #active power\n", + "Q = 1322 #reactive power\n", + "I = 8.33 #current in amp\n", + "f=50 #frequency in hertz\n", + "\n", + "#Calculation \n", + "Xc=V**2/Q #reactive capacitance\n", + "C=1/(Xc*2*math.pi*f) #capacitance\n", + "I=S*V**-1 #current\n", + "\n", + "#Result\n", + "print' Apparent Power, S = %d W'%S\n", + "print' Active Power, P = %d W'%apf\n", + "print' Reactive Power, Q = %d var'%Q\n", + "print' Current I = %.2f A'%I" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.4, Page 335" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Zl = (50+20j)\n" + ] + } + ], + "source": [ + "import math\n", + "import numpy as np\n", + "\n", + "#Initialisation\n", + "Zo=complex(50,-20) #complex form of output impedance\n", + "\n", + "#Calculation \n", + "Zl=np.conjugate(Zo) #complex form of Load impedance\n", + "\n", + "#Result\n", + "print'Zl = %s'%Zl" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter16_pnkscJu.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter16_pnkscJu.ipynb new file mode 100644 index 00000000..7a471548 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter16_pnkscJu.ipynb @@ -0,0 +1,215 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 16: Power in AC Circuits" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.1, Page 329" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Apparent power, S = 250 VA\n", + "(b) Power Factor = 0.866\n", + "(c) Active Power, P = 216.5\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "V=50 #Voltage\n", + "I=5 #Current in Ampere r.m.s\n", + "phase=30 #in degrees\n", + "\n", + "#Calculation \n", + "S=V*I #apparent power\n", + "pf=math.cos(phase*math.pi/180) #power factor\n", + "apf=S*pf #active power\n", + "\n", + "#Result\n", + "print'(a) Apparent power, S = %d VA'%S\n", + "print'(b) Power Factor = %.3f'%pf\n", + "print'(c) Active Power, P = %.1f'%apf" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.2, Page 331" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Apparent Power, P = 2000 W\n", + " Active Power, P = 1500 W\n", + " Reactive Power, Q = 1322 var\n", + " Current I = 8.33 A\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "pf=0.75 #power factor\n", + "S=2000 #apparent power in VA\n", + "V=240 #Voltage in volts\n", + "\n", + "#Calculation \n", + "apf=S*pf #active power\n", + "sin=math.sqrt(1-(pf**2)) \n", + "Q=S*sin #Reactive Power\n", + "I=S*V**-1 #Current\n", + "#Result\n", + "print' Apparent Power, P = %d W'%S\n", + "print' Active Power, P = %d W'%apf\n", + "print' Reactive Power, Q = %d var'%Q\n", + "print' Current I = %.2f A'%I" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.3, Page 333" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Apparent Power, S = 1500 W\n", + " Active Power, P = 1500 W\n", + " Reactive Power, Q = 1322 var\n", + " Current I = 6.25 A\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "pf=0.75 #power factor\n", + "S=1500 #apparent power in W\n", + "V=240 #Voltage in volts\n", + "P1 = 2000 #apparent power\n", + "P2 = 1500 #active power\n", + "Q = 1322 #reactive power\n", + "I = 8.33 #current in amp\n", + "f=50 #frequency in hertz\n", + "\n", + "#Calculation \n", + "Xc=V**2/Q #reactive capacitance\n", + "C=1/(Xc*2*math.pi*f) #capacitance\n", + "I=S*V**-1 #current\n", + "\n", + "#Result\n", + "print' Apparent Power, S = %d W'%S\n", + "print' Active Power, P = %d W'%apf\n", + "print' Reactive Power, Q = %d var'%Q\n", + "print' Current I = %.2f A'%I" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 16.4, Page 335" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Zl = (50+20j)\n" + ] + } + ], + "source": [ + "import math\n", + "import numpy as np\n", + "\n", + "#Initialisation\n", + "Zo=complex(50,-20) #complex form of output impedance\n", + "\n", + "#Calculation \n", + "Zl=np.conjugate(Zo) #complex form of Load impedance\n", + "\n", + "#Result\n", + "print'Zl = %s'%Zl" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter18.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter18.ipynb new file mode 100644 index 00000000..b24f0f02 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter18.ipynb @@ -0,0 +1,158 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 18: Transient Behaviour" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.1, Page 376" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v = 18.36 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "c=100*10**-6 #capacitance in farad\n", + "r=100*10**3 #resistance in ohm\n", + "v=20 #volt\n", + "t=25 #time in seconds\n", + "e=2.71828 #mathematical constant\n", + "\n", + "#Calculation\n", + "T=c*r #time in seconds\n", + "v1=v*(1-e**(-t*T**-1)) #volt\n", + "\n", + "#Result\n", + "print'v = %.2f V'%v1\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.2, Page 378" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "t = 10.2 mSec\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "l=400*10**-3 #inductance in henry\n", + "i1=300 #current in milliamp\n", + "r=20 #resistance in ohm\n", + "v=15 #volt\n", + "t=25 #time in seconds\n", + "e=2.71828 #mathematical constant\n", + "\n", + "#Calculation\n", + "T=l/r #time in seconds\n", + "i=(v*r**-1)*10**3 #current in amp\n", + "t=((math.log(i/(i-i1)))/(math.log(e)))*0.02 #expression to find time t\n", + "\n", + "#Result\n", + "print't = %.1f mSec'%(t*10**3)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.3, Page 382" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v = 10 - 5 e^( -t/0.2 ) V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "c=20*10**-6 #capacitance in farad\n", + "r=10*10**3 #resistance in ohm\n", + "v=5 #volt\n", + "v2=10 #volt\n", + "\n", + "#Calculation\n", + "T=c*r #time in seconds\n", + "\n", + "#Result\n", + "print'v = %d - %d e^( -t/%.1f ) V'%(v2,v,T)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter18_C36GpSn.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter18_C36GpSn.ipynb new file mode 100644 index 00000000..b24f0f02 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter18_C36GpSn.ipynb @@ -0,0 +1,158 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 18: Transient Behaviour" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.1, Page 376" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v = 18.36 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "c=100*10**-6 #capacitance in farad\n", + "r=100*10**3 #resistance in ohm\n", + "v=20 #volt\n", + "t=25 #time in seconds\n", + "e=2.71828 #mathematical constant\n", + "\n", + "#Calculation\n", + "T=c*r #time in seconds\n", + "v1=v*(1-e**(-t*T**-1)) #volt\n", + "\n", + "#Result\n", + "print'v = %.2f V'%v1\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.2, Page 378" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "t = 10.2 mSec\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "l=400*10**-3 #inductance in henry\n", + "i1=300 #current in milliamp\n", + "r=20 #resistance in ohm\n", + "v=15 #volt\n", + "t=25 #time in seconds\n", + "e=2.71828 #mathematical constant\n", + "\n", + "#Calculation\n", + "T=l/r #time in seconds\n", + "i=(v*r**-1)*10**3 #current in amp\n", + "t=((math.log(i/(i-i1)))/(math.log(e)))*0.02 #expression to find time t\n", + "\n", + "#Result\n", + "print't = %.1f mSec'%(t*10**3)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.3, Page 382" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v = 10 - 5 e^( -t/0.2 ) V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "c=20*10**-6 #capacitance in farad\n", + "r=10*10**3 #resistance in ohm\n", + "v=5 #volt\n", + "v2=10 #volt\n", + "\n", + "#Calculation\n", + "T=c*r #time in seconds\n", + "\n", + "#Result\n", + "print'v = %d - %d e^( -t/%.1f ) V'%(v2,v,T)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter18_EqgYm0p.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter18_EqgYm0p.ipynb new file mode 100644 index 00000000..b24f0f02 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter18_EqgYm0p.ipynb @@ -0,0 +1,158 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 18: Transient Behaviour" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.1, Page 376" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v = 18.36 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "c=100*10**-6 #capacitance in farad\n", + "r=100*10**3 #resistance in ohm\n", + "v=20 #volt\n", + "t=25 #time in seconds\n", + "e=2.71828 #mathematical constant\n", + "\n", + "#Calculation\n", + "T=c*r #time in seconds\n", + "v1=v*(1-e**(-t*T**-1)) #volt\n", + "\n", + "#Result\n", + "print'v = %.2f V'%v1\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.2, Page 378" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "t = 10.2 mSec\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Initialisation\n", + "l=400*10**-3 #inductance in henry\n", + "i1=300 #current in milliamp\n", + "r=20 #resistance in ohm\n", + "v=15 #volt\n", + "t=25 #time in seconds\n", + "e=2.71828 #mathematical constant\n", + "\n", + "#Calculation\n", + "T=l/r #time in seconds\n", + "i=(v*r**-1)*10**3 #current in amp\n", + "t=((math.log(i/(i-i1)))/(math.log(e)))*0.02 #expression to find time t\n", + "\n", + "#Result\n", + "print't = %.1f mSec'%(t*10**3)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.3, Page 382" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v = 10 - 5 e^( -t/0.2 ) V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "c=20*10**-6 #capacitance in farad\n", + "r=10*10**3 #resistance in ohm\n", + "v=5 #volt\n", + "v2=10 #volt\n", + "\n", + "#Calculation\n", + "T=c*r #time in seconds\n", + "\n", + "#Result\n", + "print'v = %d - %d e^( -t/%.1f ) V'%(v2,v,T)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter19.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter19.ipynb new file mode 100644 index 00000000..b87fa7b1 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter19.ipynb @@ -0,0 +1,113 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 19: Semiconductor Diodes" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.1, Page 392" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Peak Ripple Voltage = 0.4 V\n" + ] + } + ], + "source": [ + "#Introduction\n", + "i=0.2 #current in amp\n", + "C=0.01 #Capacitance in farad\n", + "t=20*10**-3 #time in sec\n", + "\n", + "#Calculation\n", + "dv=i/C #change in voltage w.r.t time\n", + "v=dv*t #peak ripple voltage\n", + "\n", + "#Result\n", + "print'Peak Ripple Voltage = %.1f V'%v\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.2, Page 406" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Peak Ripple Voltage = 0.2 V\n" + ] + } + ], + "source": [ + "#Introduction\n", + "i=0.2 #current in amp\n", + "C=0.01 #Capacitance in farad\n", + "t=10*10**-3 #time in sec\n", + "\n", + "#Calculation\n", + "dv=i/C #change in voltage w.r.t time\n", + "v=dv*t #peak ripple voltage\n", + "\n", + "#Result\n", + "print'Peak Ripple Voltage = %.1f V'%v\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter19_0g2boiT.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter19_0g2boiT.ipynb new file mode 100644 index 00000000..b87fa7b1 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter19_0g2boiT.ipynb @@ -0,0 +1,113 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 19: Semiconductor Diodes" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.1, Page 392" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Peak Ripple Voltage = 0.4 V\n" + ] + } + ], + "source": [ + "#Introduction\n", + "i=0.2 #current in amp\n", + "C=0.01 #Capacitance in farad\n", + "t=20*10**-3 #time in sec\n", + "\n", + "#Calculation\n", + "dv=i/C #change in voltage w.r.t time\n", + "v=dv*t #peak ripple voltage\n", + "\n", + "#Result\n", + "print'Peak Ripple Voltage = %.1f V'%v\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.2, Page 406" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Peak Ripple Voltage = 0.2 V\n" + ] + } + ], + "source": [ + "#Introduction\n", + "i=0.2 #current in amp\n", + "C=0.01 #Capacitance in farad\n", + "t=10*10**-3 #time in sec\n", + "\n", + "#Calculation\n", + "dv=i/C #change in voltage w.r.t time\n", + "v=dv*t #peak ripple voltage\n", + "\n", + "#Result\n", + "print'Peak Ripple Voltage = %.1f V'%v\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter19_QpHK5JI.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter19_QpHK5JI.ipynb new file mode 100644 index 00000000..b87fa7b1 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter19_QpHK5JI.ipynb @@ -0,0 +1,113 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 19: Semiconductor Diodes" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.1, Page 392" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Peak Ripple Voltage = 0.4 V\n" + ] + } + ], + "source": [ + "#Introduction\n", + "i=0.2 #current in amp\n", + "C=0.01 #Capacitance in farad\n", + "t=20*10**-3 #time in sec\n", + "\n", + "#Calculation\n", + "dv=i/C #change in voltage w.r.t time\n", + "v=dv*t #peak ripple voltage\n", + "\n", + "#Result\n", + "print'Peak Ripple Voltage = %.1f V'%v\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 19.2, Page 406" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Peak Ripple Voltage = 0.2 V\n" + ] + } + ], + "source": [ + "#Introduction\n", + "i=0.2 #current in amp\n", + "C=0.01 #Capacitance in farad\n", + "t=10*10**-3 #time in sec\n", + "\n", + "#Calculation\n", + "dv=i/C #change in voltage w.r.t time\n", + "v=dv*t #peak ripple voltage\n", + "\n", + "#Result\n", + "print'Peak Ripple Voltage = %.1f V'%v\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter2.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter2.ipynb new file mode 100644 index 00000000..8bc25886 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter2.ipynb @@ -0,0 +1,363 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Basic Electric Circuits and Components" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1, Page 23" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current, I = 15.9 mA\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "v1=15.8 #voltage across r1\n", + "v2=12.3 #voltage across r2\n", + "r2=220 #resistance R2 in ohm\n", + "\n", + "#Calculation\n", + "v=v1-v2 #voltage difference across the resistor\n", + "i=v/r2 #current in ampere\n", + "\n", + "#Result\n", + "print'Current, I = %.1f mA'%(i*1000)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2, Page 24" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "I2 = 7 A\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "i1=10; #current in amp\n", + "i3=3; #current in amp\n", + "\n", + "\n", + "#Calculation\n", + "i2=i1-i3 #current in amp\n", + "\n", + "#Result\n", + "print'I2 = %d A'%i2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3, Page 25" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "V1 = 5 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "E=12 #EMF in volt\n", + "v2=7 #volt\n", + "\n", + "\n", + "#Calculation\n", + "v1=E-v2 #volt\n", + "\n", + "#Result\n", + "print'V1 = %d V'%v1" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.4, Page 25" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P = 450 W\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "i=3 #current in amp\n", + "r=50 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "p=(i**2)*r #power in watt\n", + "\n", + "#Result\n", + "print'P = %d W'%p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.5, Page 26" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R = 70 ohm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "r1=10 #resistance in ohm\n", + "r2=20 #resistance in ohm\n", + "r3=15 #resistance in ohm\n", + "r4=25 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "r=r1+r2+r3+r4 #series resistance in ohm\n", + "\n", + "#Result\n", + "print'R = %d ohm'%r\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.6, Page 27" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R = 6.67 ohm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "r1=10 #resistance in ohm\n", + "r2=20 #resistance in ohm\n", + "\n", + "\n", + "\n", + "#Calculation\n", + "r=(r1*r2)*(r1+r2)**-1 #parallel resistance in ohm\n", + "\n", + "#Result\n", + "print'R = %.2f ohm'%r\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.7, Page 28" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "V = 6 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "r1=200 #resistance in ohm\n", + "r2=300 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "v=(10*r2)/(r1+r2) #resistance in ohm\n", + "\n", + "#Result\n", + "print'V = %d V'%v" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.8, Page 29" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "V = 7 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "r1=1*10**3 #resistance in ohm\n", + "r2=500 #resistance in ohm\n", + "v1=15 #voltage\n", + "v2=3 #voltage\n", + "\n", + "#Calculation\n", + "v=v2+((v1-v2)*((r2)*(r1+r2)**-1)) #resistance in ohm\n", + "\n", + "#Result\n", + "print'V = %d V'%v\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.9, Page 30" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T = 20 ms\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "f=50 #frequency in herts\n", + "\n", + "\n", + "#Calculation\n", + "t=(1*f**-1) #time period\n", + "\n", + "\n", + "#Result\n", + "print'T = %d ms'%(t*10**3)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter20.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter20.ipynb new file mode 100644 index 00000000..960e2bde --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter20.ipynb @@ -0,0 +1,121 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 20: Field-effect Transistors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20.1, Page" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Small signal voltage gain = -4 \n", + "Low frequency cut off = 0.16 Hz\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Introduction\n", + "gm=2*10**-3\n", + "rd=2*10**3 #resistance in ohm\n", + "C=10**-6 #capacitance in farad\n", + "R=10**6 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "G=-gm*rd #Small signal voltage gain\n", + "fc=1/(2*math.pi*C*R) #frequency in Hz\n", + "\n", + "#Result\n", + "print'Small signal voltage gain = %d '%G\n", + "print'Low frequency cut off = %.2f Hz'%fc" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20.2, Page" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rd = 0.67 kOhm\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Introduction\n", + "idd=4*10**-3 #current in ampere\n", + "vo=8 #voltage\n", + "vdd=12 #voltage\n", + "\n", + "#Calculation\n", + "Rd=vo*(vdd-idd)**-1\n", + "\n", + "#Result\n", + "print'Rd = %.2f kOhm'%Rd #wrong answer in textbook" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter20_SPZbkqz.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter20_SPZbkqz.ipynb new file mode 100644 index 00000000..960e2bde --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter20_SPZbkqz.ipynb @@ -0,0 +1,121 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 20: Field-effect Transistors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20.1, Page" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Small signal voltage gain = -4 \n", + "Low frequency cut off = 0.16 Hz\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Introduction\n", + "gm=2*10**-3\n", + "rd=2*10**3 #resistance in ohm\n", + "C=10**-6 #capacitance in farad\n", + "R=10**6 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "G=-gm*rd #Small signal voltage gain\n", + "fc=1/(2*math.pi*C*R) #frequency in Hz\n", + "\n", + "#Result\n", + "print'Small signal voltage gain = %d '%G\n", + "print'Low frequency cut off = %.2f Hz'%fc" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20.2, Page" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rd = 0.67 kOhm\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Introduction\n", + "idd=4*10**-3 #current in ampere\n", + "vo=8 #voltage\n", + "vdd=12 #voltage\n", + "\n", + "#Calculation\n", + "Rd=vo*(vdd-idd)**-1\n", + "\n", + "#Result\n", + "print'Rd = %.2f kOhm'%Rd #wrong answer in textbook" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter20_hKMNWxW.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter20_hKMNWxW.ipynb new file mode 100644 index 00000000..960e2bde --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter20_hKMNWxW.ipynb @@ -0,0 +1,121 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 20: Field-effect Transistors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20.1, Page" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Small signal voltage gain = -4 \n", + "Low frequency cut off = 0.16 Hz\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Introduction\n", + "gm=2*10**-3\n", + "rd=2*10**3 #resistance in ohm\n", + "C=10**-6 #capacitance in farad\n", + "R=10**6 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "G=-gm*rd #Small signal voltage gain\n", + "fc=1/(2*math.pi*C*R) #frequency in Hz\n", + "\n", + "#Result\n", + "print'Small signal voltage gain = %d '%G\n", + "print'Low frequency cut off = %.2f Hz'%fc" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 20.2, Page" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rd = 0.67 kOhm\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#Introduction\n", + "idd=4*10**-3 #current in ampere\n", + "vo=8 #voltage\n", + "vdd=12 #voltage\n", + "\n", + "#Calculation\n", + "Rd=vo*(vdd-idd)**-1\n", + "\n", + "#Result\n", + "print'Rd = %.2f kOhm'%Rd #wrong answer in textbook" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter21.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter21.ipynb new file mode 100644 index 00000000..6d1b753b --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter21.ipynb @@ -0,0 +1,241 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 21: Bipolar Transistors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.1, Page 445" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Current, I = 2.04 mA\n", + "Output Voltage, V = 4.5 V\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vcc=10 #voltage\n", + "vbe=0.7 #voltage, base-to-emitter junction\n", + "rb=910*10**3 #resistance in ohm\n", + "hfe=200\n", + "rc=2.7*10**3 #resistance in ohm\n", + "\n", + "#Calculation\n", + "ib=(vcc-vbe)/rb #base current in ampere\n", + "ic=hfe*ib #collector in current in ampere\n", + "vo=vcc-(ic*rc) #output voltage\n", + "\n", + "#Result\n", + "print'Output Current, I = %.2f mA'%(ic*10**3)\n", + "print'Output Voltage, V = %.1f V'%vo" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.2, Page 445" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Quiescent Output Voltage, V = 5.6 V\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vcc=10 #voltage\n", + "r2=10*10**3 #resistance in ohm\n", + "r1=27*10**3 #resistance in ohm\n", + "vbe=0.7 #voltage, base-to-emitter junction\n", + "re=10**3 #resistance in ohm\n", + "rc=2.2*10**3 #resistance in ohm\n", + "\n", + "#Calculation\n", + "vb=vcc*(r2*(r1+r2)**-1) # base voltage\n", + "ve=vb-vbe #emitter voltage\n", + "ie=ve/re #emitter current\n", + "ic=ie #collector current\n", + "vo=vcc-(ic*rc) #output voltage\n", + "\n", + "#Result\n", + "print'Quiescent Output Voltage, V = %.1f V'%vo\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.3, Page 448" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage Gain = -2.2 mA\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "re=10**3 #resistance in ohm\n", + "rc=2.2*10**3 #resistance in ohm\n", + "\n", + "#Calculation\n", + "gain=-rc/re #voltage gain\n", + "\n", + "#Result\n", + "print'Voltage Gain = %.1f mA'%gain\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.4, Page 451" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage Gain = 64 Hz\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "r1=15*10**3 #resistance in ohm\n", + "r2=47*10**3 #resistance in ohm\n", + "C=220*10**-9 #capacitance in farad\n", + "\n", + "#Calculation\n", + "ri=(r1*r2)/(r1+r2) #resistance in paraller\n", + "fco=1/(2*math.pi*C*ri) #frequency in Hz\n", + "\n", + "\n", + "#Result\n", + "print'Voltage Gain = %d Hz'%round(fco)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.5, Page 453" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Quiescent Output Voltage, V = 2.0 V\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vcc=10 #voltage\n", + "r2=10*10**3 #resistance in ohm\n", + "r1=27*10**3 #resistance in ohm\n", + "vbe=0.7 #voltage, base-to-emitter junction\n", + "re=10**3 #resistance in ohm\n", + "rc=2.2*10**3 #resistance in ohm\n", + "\n", + "#Calculation\n", + "vb=vcc*(r2*(r1+r2)**-1) # base voltage\n", + "ve=vb-vbe #emitter voltage\n", + "\n", + "\n", + "#Result\n", + "print'Quiescent Output Voltage, V = %.1f V'%ve\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter21_GeNhAzQ.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter21_GeNhAzQ.ipynb new file mode 100644 index 00000000..6d1b753b --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter21_GeNhAzQ.ipynb @@ -0,0 +1,241 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 21: Bipolar Transistors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.1, Page 445" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Current, I = 2.04 mA\n", + "Output Voltage, V = 4.5 V\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vcc=10 #voltage\n", + "vbe=0.7 #voltage, base-to-emitter junction\n", + "rb=910*10**3 #resistance in ohm\n", + "hfe=200\n", + "rc=2.7*10**3 #resistance in ohm\n", + "\n", + "#Calculation\n", + "ib=(vcc-vbe)/rb #base current in ampere\n", + "ic=hfe*ib #collector in current in ampere\n", + "vo=vcc-(ic*rc) #output voltage\n", + "\n", + "#Result\n", + "print'Output Current, I = %.2f mA'%(ic*10**3)\n", + "print'Output Voltage, V = %.1f V'%vo" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.2, Page 445" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Quiescent Output Voltage, V = 5.6 V\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vcc=10 #voltage\n", + "r2=10*10**3 #resistance in ohm\n", + "r1=27*10**3 #resistance in ohm\n", + "vbe=0.7 #voltage, base-to-emitter junction\n", + "re=10**3 #resistance in ohm\n", + "rc=2.2*10**3 #resistance in ohm\n", + "\n", + "#Calculation\n", + "vb=vcc*(r2*(r1+r2)**-1) # base voltage\n", + "ve=vb-vbe #emitter voltage\n", + "ie=ve/re #emitter current\n", + "ic=ie #collector current\n", + "vo=vcc-(ic*rc) #output voltage\n", + "\n", + "#Result\n", + "print'Quiescent Output Voltage, V = %.1f V'%vo\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.3, Page 448" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage Gain = -2.2 mA\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "re=10**3 #resistance in ohm\n", + "rc=2.2*10**3 #resistance in ohm\n", + "\n", + "#Calculation\n", + "gain=-rc/re #voltage gain\n", + "\n", + "#Result\n", + "print'Voltage Gain = %.1f mA'%gain\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.4, Page 451" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage Gain = 64 Hz\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "r1=15*10**3 #resistance in ohm\n", + "r2=47*10**3 #resistance in ohm\n", + "C=220*10**-9 #capacitance in farad\n", + "\n", + "#Calculation\n", + "ri=(r1*r2)/(r1+r2) #resistance in paraller\n", + "fco=1/(2*math.pi*C*ri) #frequency in Hz\n", + "\n", + "\n", + "#Result\n", + "print'Voltage Gain = %d Hz'%round(fco)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.5, Page 453" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Quiescent Output Voltage, V = 2.0 V\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vcc=10 #voltage\n", + "r2=10*10**3 #resistance in ohm\n", + "r1=27*10**3 #resistance in ohm\n", + "vbe=0.7 #voltage, base-to-emitter junction\n", + "re=10**3 #resistance in ohm\n", + "rc=2.2*10**3 #resistance in ohm\n", + "\n", + "#Calculation\n", + "vb=vcc*(r2*(r1+r2)**-1) # base voltage\n", + "ve=vb-vbe #emitter voltage\n", + "\n", + "\n", + "#Result\n", + "print'Quiescent Output Voltage, V = %.1f V'%ve\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter21_tQfhnpH.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter21_tQfhnpH.ipynb new file mode 100644 index 00000000..6d1b753b --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter21_tQfhnpH.ipynb @@ -0,0 +1,241 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 21: Bipolar Transistors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.1, Page 445" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Current, I = 2.04 mA\n", + "Output Voltage, V = 4.5 V\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vcc=10 #voltage\n", + "vbe=0.7 #voltage, base-to-emitter junction\n", + "rb=910*10**3 #resistance in ohm\n", + "hfe=200\n", + "rc=2.7*10**3 #resistance in ohm\n", + "\n", + "#Calculation\n", + "ib=(vcc-vbe)/rb #base current in ampere\n", + "ic=hfe*ib #collector in current in ampere\n", + "vo=vcc-(ic*rc) #output voltage\n", + "\n", + "#Result\n", + "print'Output Current, I = %.2f mA'%(ic*10**3)\n", + "print'Output Voltage, V = %.1f V'%vo" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.2, Page 445" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Quiescent Output Voltage, V = 5.6 V\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vcc=10 #voltage\n", + "r2=10*10**3 #resistance in ohm\n", + "r1=27*10**3 #resistance in ohm\n", + "vbe=0.7 #voltage, base-to-emitter junction\n", + "re=10**3 #resistance in ohm\n", + "rc=2.2*10**3 #resistance in ohm\n", + "\n", + "#Calculation\n", + "vb=vcc*(r2*(r1+r2)**-1) # base voltage\n", + "ve=vb-vbe #emitter voltage\n", + "ie=ve/re #emitter current\n", + "ic=ie #collector current\n", + "vo=vcc-(ic*rc) #output voltage\n", + "\n", + "#Result\n", + "print'Quiescent Output Voltage, V = %.1f V'%vo\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.3, Page 448" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage Gain = -2.2 mA\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "re=10**3 #resistance in ohm\n", + "rc=2.2*10**3 #resistance in ohm\n", + "\n", + "#Calculation\n", + "gain=-rc/re #voltage gain\n", + "\n", + "#Result\n", + "print'Voltage Gain = %.1f mA'%gain\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.4, Page 451" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage Gain = 64 Hz\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "r1=15*10**3 #resistance in ohm\n", + "r2=47*10**3 #resistance in ohm\n", + "C=220*10**-9 #capacitance in farad\n", + "\n", + "#Calculation\n", + "ri=(r1*r2)/(r1+r2) #resistance in paraller\n", + "fco=1/(2*math.pi*C*ri) #frequency in Hz\n", + "\n", + "\n", + "#Result\n", + "print'Voltage Gain = %d Hz'%round(fco)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 21.5, Page 453" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Quiescent Output Voltage, V = 2.0 V\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vcc=10 #voltage\n", + "r2=10*10**3 #resistance in ohm\n", + "r1=27*10**3 #resistance in ohm\n", + "vbe=0.7 #voltage, base-to-emitter junction\n", + "re=10**3 #resistance in ohm\n", + "rc=2.2*10**3 #resistance in ohm\n", + "\n", + "#Calculation\n", + "vb=vcc*(r2*(r1+r2)**-1) # base voltage\n", + "ve=vb-vbe #emitter voltage\n", + "\n", + "\n", + "#Result\n", + "print'Quiescent Output Voltage, V = %.1f V'%ve\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter22.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter22.ipynb new file mode 100644 index 00000000..b477d5ec --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter22.ipynb @@ -0,0 +1,123 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 22: Power Electronics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22.1, Page 475" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Output Voltage, V = 12.0 V\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vz=4.7 #voltage\n", + "r3=1.222*10**3 #resistance in ohm\n", + "r4=10**3 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "Vo=(vz+0.7)*((r3+r4)*r4**-1) #output voltage\n", + "\n", + "\n", + "#Result\n", + "print' Output Voltage, V = %.1f V'%Vo\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22.2, Page 476" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power delivered to the load, P = 5 W\n", + "Power dissipated in the output transistor, P = 10 W\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vo=10 #voltage\n", + "rl=5 #resistance in ohm\n", + "vi=15 #voltage\n", + "\n", + "\n", + "#Calculation\n", + "io=vo*rl**-1 #current in ampere\n", + "po=vo*io**-1 #power delivered to the load in watt\n", + "pt=(vi-vo)*io #power dissipated in the output transistor in watt\n", + "\n", + "\n", + "\n", + "#Result\n", + "print'Power delivered to the load, P = %d W'%po\n", + "print'Power dissipated in the output transistor, P = %d W'%pt\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter22_R5zqRoP.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter22_R5zqRoP.ipynb new file mode 100644 index 00000000..b477d5ec --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter22_R5zqRoP.ipynb @@ -0,0 +1,123 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 22: Power Electronics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22.1, Page 475" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Output Voltage, V = 12.0 V\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vz=4.7 #voltage\n", + "r3=1.222*10**3 #resistance in ohm\n", + "r4=10**3 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "Vo=(vz+0.7)*((r3+r4)*r4**-1) #output voltage\n", + "\n", + "\n", + "#Result\n", + "print' Output Voltage, V = %.1f V'%Vo\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22.2, Page 476" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power delivered to the load, P = 5 W\n", + "Power dissipated in the output transistor, P = 10 W\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vo=10 #voltage\n", + "rl=5 #resistance in ohm\n", + "vi=15 #voltage\n", + "\n", + "\n", + "#Calculation\n", + "io=vo*rl**-1 #current in ampere\n", + "po=vo*io**-1 #power delivered to the load in watt\n", + "pt=(vi-vo)*io #power dissipated in the output transistor in watt\n", + "\n", + "\n", + "\n", + "#Result\n", + "print'Power delivered to the load, P = %d W'%po\n", + "print'Power dissipated in the output transistor, P = %d W'%pt\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter22_wZJNJdr.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter22_wZJNJdr.ipynb new file mode 100644 index 00000000..b477d5ec --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter22_wZJNJdr.ipynb @@ -0,0 +1,123 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 22: Power Electronics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22.1, Page 475" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Output Voltage, V = 12.0 V\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vz=4.7 #voltage\n", + "r3=1.222*10**3 #resistance in ohm\n", + "r4=10**3 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "Vo=(vz+0.7)*((r3+r4)*r4**-1) #output voltage\n", + "\n", + "\n", + "#Result\n", + "print' Output Voltage, V = %.1f V'%Vo\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 22.2, Page 476" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power delivered to the load, P = 5 W\n", + "Power dissipated in the output transistor, P = 10 W\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialization\n", + "vo=10 #voltage\n", + "rl=5 #resistance in ohm\n", + "vi=15 #voltage\n", + "\n", + "\n", + "#Calculation\n", + "io=vo*rl**-1 #current in ampere\n", + "po=vo*io**-1 #power delivered to the load in watt\n", + "pt=(vi-vo)*io #power dissipated in the output transistor in watt\n", + "\n", + "\n", + "\n", + "#Result\n", + "print'Power delivered to the load, P = %d W'%po\n", + "print'Power dissipated in the output transistor, P = %d W'%pt\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter23.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter23.ipynb new file mode 100644 index 00000000..e17dafb8 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter23.ipynb @@ -0,0 +1,151 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 23: Electric Motors and Generators" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.1, Page 483" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sinusoidal Voltage with Peak value = 8.4 V\n" + ] + } + ], + "source": [ + "#initialization\n", + "n=100 #no of turns\n", + "b=400*10**-3 #magnetic field\n", + "a=20*10**-4 #area in cm^2\n", + "w=105 #angular frequency\n", + "\n", + "#calculation\n", + "v=n*b*a*w #voltage\n", + "\n", + "#result\n", + "print'Sinusoidal Voltage with Peak value = %.1f V'%v" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.2, Page 488" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rotation Speed = 1800 rpm\n" + ] + } + ], + "source": [ + "#initialization\n", + "f=60 #frequency in Hz\n", + "a=60 #seconds\n", + "\n", + "#calculation\n", + "f1=f/2 #required rotation speed\n", + "f2=f1*a #equivalent rotation speed\n", + "\n", + "\n", + "#result\n", + "print'Rotation Speed = %d rpm'%f2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.3, Page 490" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rotation Speed = 12000 rpm\n" + ] + } + ], + "source": [ + "#initialization\n", + "f=50 #frequency in Hz\n", + "p=4 #four times magnetic field for 8 pole motor\n", + "a=60 #seconds\n", + "\n", + "#calculation\n", + "f1=f*p #required rotation speed\n", + "f2=f1*a #equivalent rotation speed\n", + "\n", + "\n", + "#result\n", + "print'Rotation Speed = %d rpm'%f2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter23_3CMvYM4.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter23_3CMvYM4.ipynb new file mode 100644 index 00000000..e17dafb8 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter23_3CMvYM4.ipynb @@ -0,0 +1,151 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 23: Electric Motors and Generators" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.1, Page 483" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sinusoidal Voltage with Peak value = 8.4 V\n" + ] + } + ], + "source": [ + "#initialization\n", + "n=100 #no of turns\n", + "b=400*10**-3 #magnetic field\n", + "a=20*10**-4 #area in cm^2\n", + "w=105 #angular frequency\n", + "\n", + "#calculation\n", + "v=n*b*a*w #voltage\n", + "\n", + "#result\n", + "print'Sinusoidal Voltage with Peak value = %.1f V'%v" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.2, Page 488" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rotation Speed = 1800 rpm\n" + ] + } + ], + "source": [ + "#initialization\n", + "f=60 #frequency in Hz\n", + "a=60 #seconds\n", + "\n", + "#calculation\n", + "f1=f/2 #required rotation speed\n", + "f2=f1*a #equivalent rotation speed\n", + "\n", + "\n", + "#result\n", + "print'Rotation Speed = %d rpm'%f2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.3, Page 490" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rotation Speed = 12000 rpm\n" + ] + } + ], + "source": [ + "#initialization\n", + "f=50 #frequency in Hz\n", + "p=4 #four times magnetic field for 8 pole motor\n", + "a=60 #seconds\n", + "\n", + "#calculation\n", + "f1=f*p #required rotation speed\n", + "f2=f1*a #equivalent rotation speed\n", + "\n", + "\n", + "#result\n", + "print'Rotation Speed = %d rpm'%f2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter23_9hMbnX4.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter23_9hMbnX4.ipynb new file mode 100644 index 00000000..e17dafb8 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter23_9hMbnX4.ipynb @@ -0,0 +1,151 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 23: Electric Motors and Generators" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.1, Page 483" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sinusoidal Voltage with Peak value = 8.4 V\n" + ] + } + ], + "source": [ + "#initialization\n", + "n=100 #no of turns\n", + "b=400*10**-3 #magnetic field\n", + "a=20*10**-4 #area in cm^2\n", + "w=105 #angular frequency\n", + "\n", + "#calculation\n", + "v=n*b*a*w #voltage\n", + "\n", + "#result\n", + "print'Sinusoidal Voltage with Peak value = %.1f V'%v" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.2, Page 488" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rotation Speed = 1800 rpm\n" + ] + } + ], + "source": [ + "#initialization\n", + "f=60 #frequency in Hz\n", + "a=60 #seconds\n", + "\n", + "#calculation\n", + "f1=f/2 #required rotation speed\n", + "f2=f1*a #equivalent rotation speed\n", + "\n", + "\n", + "#result\n", + "print'Rotation Speed = %d rpm'%f2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 23.3, Page 490" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rotation Speed = 12000 rpm\n" + ] + } + ], + "source": [ + "#initialization\n", + "f=50 #frequency in Hz\n", + "p=4 #four times magnetic field for 8 pole motor\n", + "a=60 #seconds\n", + "\n", + "#calculation\n", + "f1=f*p #required rotation speed\n", + "f2=f1*a #equivalent rotation speed\n", + "\n", + "\n", + "#result\n", + "print'Rotation Speed = %d rpm'%f2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter2_8BakG8I.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter2_8BakG8I.ipynb new file mode 100644 index 00000000..a103be90 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter2_8BakG8I.ipynb @@ -0,0 +1,363 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2: Basic Electric Circuits and Components" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1, Page 23" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current, I = 15.9 mA\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "v1=15.8 #voltage across r1\n", + "v2=12.3 #voltage across r2\n", + "r2=220 #resistance R2 in ohm\n", + "\n", + "#Calculation\n", + "v=v1-v2 #voltage difference across the resistor\n", + "i=v/r2 #current in ampere\n", + "\n", + "#Result\n", + "print'Current, I = %.1f mA'%(i*1000)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2, Page 24" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "I2 = 7 A\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "i1=10; #current in amp\n", + "i3=3; #current in amp\n", + "\n", + "\n", + "#Calculation\n", + "i2=i1-i3 #current in amp\n", + "\n", + "#Result\n", + "print'I2 = %d A'%i2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3, Page 25" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "V1 = 5 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "E=12 #EMF in volt\n", + "v2=7 #volt\n", + "\n", + "\n", + "#Calculation\n", + "v1=E-v2 #volt\n", + "\n", + "#Result\n", + "print'V1 = %d V'%v1" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.4, Page 25" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P = 450 W\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "i=3 #current in amp\n", + "r=50 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "p=(i**2)*r #power in watt\n", + "\n", + "#Result\n", + "print'P = %d W'%p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.5, Page 26" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R = 70 ohm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "r1=10 #resistance in ohm\n", + "r2=20 #resistance in ohm\n", + "r3=15 #resistance in ohm\n", + "r4=25 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "r=r1+r2+r3+r4 #series resistance in ohm\n", + "\n", + "#Result\n", + "print'R = %d ohm'%r\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.6, Page 27" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R = 6.67 ohm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "r1=10 #resistance in ohm\n", + "r2=20 #resistance in ohm\n", + "\n", + "\n", + "\n", + "#Calculation\n", + "r=(r1*r2)*(r1+r2)**-1 #parallel resistance in ohm\n", + "\n", + "#Result\n", + "print'R = %.2f ohm'%r\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.7, Page 28" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "V = 6 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "r1=200 #resistance in ohm\n", + "r2=300 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "v=(10*r2)/(r1+r2) #resistance in ohm\n", + "\n", + "#Result\n", + "print'V = %d V'%v" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.8, Page 29" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "V = 7 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "r1=1*10**3 #resistance in ohm\n", + "r2=500 #resistance in ohm\n", + "v1=15 #voltage\n", + "v2=3 #voltage\n", + "\n", + "#Calculation\n", + "v=v2+((v1-v2)*((r2)*(r1+r2)**-1)) #resistance in ohm\n", + "\n", + "#Result\n", + "print'V = %d V'%v\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.9, Page 30" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T = 20 ms\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "f=50 #frequency in herts\n", + "\n", + "\n", + "#Calculation\n", + "t=(1*f**-1) #time period\n", + "\n", + "\n", + "#Result\n", + "print'T = %d ms'%(t*10**3)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter2_W8u7liz.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter2_W8u7liz.ipynb new file mode 100644 index 00000000..a103be90 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter2_W8u7liz.ipynb @@ -0,0 +1,363 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2: Basic Electric Circuits and Components" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1, Page 23" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current, I = 15.9 mA\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "v1=15.8 #voltage across r1\n", + "v2=12.3 #voltage across r2\n", + "r2=220 #resistance R2 in ohm\n", + "\n", + "#Calculation\n", + "v=v1-v2 #voltage difference across the resistor\n", + "i=v/r2 #current in ampere\n", + "\n", + "#Result\n", + "print'Current, I = %.1f mA'%(i*1000)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2, Page 24" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "I2 = 7 A\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "i1=10; #current in amp\n", + "i3=3; #current in amp\n", + "\n", + "\n", + "#Calculation\n", + "i2=i1-i3 #current in amp\n", + "\n", + "#Result\n", + "print'I2 = %d A'%i2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3, Page 25" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "V1 = 5 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "E=12 #EMF in volt\n", + "v2=7 #volt\n", + "\n", + "\n", + "#Calculation\n", + "v1=E-v2 #volt\n", + "\n", + "#Result\n", + "print'V1 = %d V'%v1" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.4, Page 25" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P = 450 W\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "i=3 #current in amp\n", + "r=50 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "p=(i**2)*r #power in watt\n", + "\n", + "#Result\n", + "print'P = %d W'%p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.5, Page 26" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R = 70 ohm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "r1=10 #resistance in ohm\n", + "r2=20 #resistance in ohm\n", + "r3=15 #resistance in ohm\n", + "r4=25 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "r=r1+r2+r3+r4 #series resistance in ohm\n", + "\n", + "#Result\n", + "print'R = %d ohm'%r\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.6, Page 27" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R = 6.67 ohm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "r1=10 #resistance in ohm\n", + "r2=20 #resistance in ohm\n", + "\n", + "\n", + "\n", + "#Calculation\n", + "r=(r1*r2)*(r1+r2)**-1 #parallel resistance in ohm\n", + "\n", + "#Result\n", + "print'R = %.2f ohm'%r\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.7, Page 28" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "V = 6 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "r1=200 #resistance in ohm\n", + "r2=300 #resistance in ohm\n", + "\n", + "\n", + "#Calculation\n", + "v=(10*r2)/(r1+r2) #resistance in ohm\n", + "\n", + "#Result\n", + "print'V = %d V'%v" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.8, Page 29" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "V = 7 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "r1=1*10**3 #resistance in ohm\n", + "r2=500 #resistance in ohm\n", + "v1=15 #voltage\n", + "v2=3 #voltage\n", + "\n", + "#Calculation\n", + "v=v2+((v1-v2)*((r2)*(r1+r2)**-1)) #resistance in ohm\n", + "\n", + "#Result\n", + "print'V = %d V'%v\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.9, Page 30" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T = 20 ms\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "f=50 #frequency in herts\n", + "\n", + "\n", + "#Calculation\n", + "t=(1*f**-1) #time period\n", + "\n", + "\n", + "#Result\n", + "print'T = %d ms'%(t*10**3)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter5.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter5.ipynb new file mode 100644 index 00000000..55d66248 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter5.ipynb @@ -0,0 +1,253 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: Signals and Data Transmission" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1, Page 71" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "An 8-bit word can take 2^8 = 256 values\n", + "\n", + "An 16-bit word can take 2^16 = 65536 values\n", + "\n", + "An 32-bit word can take 2^32 = 4.000000 x 10^9 values\n", + "\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "n=8 #8 bit\n", + "n2=16 #16 bit\n", + "n3=32 #32 bit\n", + "\n", + "#Calculation\n", + "c=2**n #value for 8 bit\n", + "c2=2**n2 #value for 16 bit\n", + "c3=2**n3 #value for 32 bit\n", + "\n", + "#Result\n", + "print'An 8-bit word can take 2^8 = %d values\\n'%c\n", + "print'An 16-bit word can take 2^16 = %d values\\n'%c2\n", + "print'An 32-bit word can take 2^32 = %f x 10^9 values\\n'%(c3/10**9)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2, Page 71" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "An 8-bit word resolution = 0.39 percent\n", + "\n", + "An 16-bit word resolution = 0.0015 percent\n", + "\n", + "An 32-bit word resolution = 0.000000023 percent\n", + "\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "n=8 #8 bit\n", + "n2=16 #16 bit\n", + "n3=32 #32 bit\n", + "\n", + "\n", + "#Calculation\n", + "c=2**n #value for 8 bit\n", + "p=(1*c**-1)*100 #percent\n", + "c2=2**n2 #value for 16 bit\n", + "p2=(1*c2**-1)*100 #percent\n", + "c3=2**n3 #value for 32 bit\n", + "p3=(1*c3**-1)*100 #percent\n", + "\n", + "#Result\n", + "print'An 8-bit word resolution = %.2f percent\\n'%p\n", + "print'An 16-bit word resolution = %.4f percent\\n'%p2\n", + "print'An 32-bit word resolution = %.9f percent\\n'%p3" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3, Page 73" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEZCAYAAACNebLAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG4pJREFUeJzt3X2UXXV97/H3J4RHUxhFGyGQzDINZqHQATSEgs1YCybI\ng7flQaqFgduWpahUdClFbS7qur3Lem2gQBEEQlAKiEpQoMUKU5CHoAlzSZHwUAiEKPEBQoBQGuB7\n/9h7wuZkn5kzk73n/GbO57XWWZy99+/s8z0/fjnfs3/fvfcoIjAzM2s0qd0BmJlZmpwgzMyslBOE\nmZmVcoIwM7NSThBmZlbKCcLMzEo5QZiZWSknCKuUpNWSNkraIOm5/L9vbXdc7SDpaEn3Slov6VeS\n/k3SjJrf81VJb6vzPaxzTG53ADbhBPCBiLh1qEaStomIV8YopjEnaSZwOfDBiOiX9AbgMKDuzzzk\nla8Tvd+tWj6CsDpoixXSjPzX7SmSHgd+nK+fK+kOSc/kv7bnFV7TLalf0rOS/lXSP0q6It82T9Ka\nhvd4TNIf5c8l6UxJj0j6taSrJHU1xHKipMfzX/dn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dmX/C8a2mxHdtR0WkTcXlj/SLGfikdR+fLBwF+Q/RU3s5Y5\nQdh49ELhuYC/i4iLiw0knT7E61/mtenVHRr29YmI+FHDvuYBLxVWvcJr/3a2mN6JiBcl/Qj4IHAs\ncMAQsQwq7v9Vyv9tvkxWt5gP3F6yfQuSdgMuBo4cvH22Watcg7CUtfInJ/8VOEXSGwAk7S7pLcBt\nwAclbS/pd4AjC69ZDbwrf35sw74+lt9XH0mzJO00xHs/CLxV0gF5+ymSBv9NXQKcS3bk8WyzHYxQ\nkB2RzJb02cL6ZjWIycA1wOci4j8risE6iI8gLGXDnp0TET+SNBu4KytB8BzwkYi4V9I1wH3AOuCe\nwsu+BlyTF6FvKKz/JtnU0Yq8nvErsqOA0rgiYpOk44HzJO1IVvf4Y7KpsRWSNgCXjeQDF/df/nEj\nJJ0ALM33f9MQ7f+A7OjlbElfytsdHhFPjSIm60C+3bd1hHxe/rmI+PoYvd/uwC0RMXss3s+sDp5i\nMquYpD8H7iL7gy1m45aPIMzMrJSPIMzMrJQThJmZlXKCMDOzUk4QZmZWygnCzMxKOUGYmVmp/w9Q\n8qp7rMXCBAAAAABJRU5ErkJggg==\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x8ee1f60>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "#data\n", + "x = np.linspace(0, 3, 1)\n", + "y=2\n", + "\n", + "#plotting\n", + "\n", + "plt.bar(1, y, 0.001*max(x))\n", + "\n", + "\n", + "xlabel(\"Frequency in kHz\")\n", + "ylabel(\"Voltage\")\n", + "title(\"Frequency Spectrum\")\n", + "plt.axis([0, 2, 0, 3])\n", + "plt.grid()\n", + "plt.show()\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.4, Page 73" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png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UyQUiSWpkgJEmtTBCSpFYmCElSq/8PK/+gYIz8oXAAAAAASUVORK5CYII=\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x8b6bd30>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "#data\n", + "x = np.linspace(0, 3, 1)\n", + "y=2\n", + "y1=1\n", + "\n", + "#plotting\n", + "plt.bar(1, y, 0.001*max(x))\n", + "plt.bar(1.5, y1, 0.001*max(x))\n", + "\n", + "\n", + "xlabel(\"Frequency in kHz\")\n", + "ylabel(\"Voltage\")\n", + "title(\"Frequency Spectrum\")\n", + "plt.axis([0, 2, 0, 3])\n", + "plt.grid()\n", + "plt.show()\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.5, Page 74" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Bandwidth = 7.0 kHz\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "f1=7000 #Human Speech Frequency Upper limit in HZ\n", + "f2=50 #Human Speech Frequency Lower limit in Hz\n", + "\n", + "#Calculation\n", + "B=f1-f2 #Bandwidth in Hz\n", + "\n", + "#Result\n", + "print'Bandwidth = %.1f kHz'%(B*1000**-1)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter5_RsBz4a7.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter5_RsBz4a7.ipynb new file mode 100644 index 00000000..55d66248 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter5_RsBz4a7.ipynb @@ -0,0 +1,253 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: Signals and Data Transmission" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1, Page 71" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "An 8-bit word can take 2^8 = 256 values\n", + "\n", + "An 16-bit word can take 2^16 = 65536 values\n", + "\n", + "An 32-bit word can take 2^32 = 4.000000 x 10^9 values\n", + "\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "n=8 #8 bit\n", + "n2=16 #16 bit\n", + "n3=32 #32 bit\n", + "\n", + "#Calculation\n", + "c=2**n #value for 8 bit\n", + "c2=2**n2 #value for 16 bit\n", + "c3=2**n3 #value for 32 bit\n", + "\n", + "#Result\n", + "print'An 8-bit word can take 2^8 = %d values\\n'%c\n", + "print'An 16-bit word can take 2^16 = %d values\\n'%c2\n", + "print'An 32-bit word can take 2^32 = %f x 10^9 values\\n'%(c3/10**9)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2, Page 71" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "An 8-bit word resolution = 0.39 percent\n", + "\n", + "An 16-bit word resolution = 0.0015 percent\n", + "\n", + "An 32-bit word resolution = 0.000000023 percent\n", + "\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "n=8 #8 bit\n", + "n2=16 #16 bit\n", + "n3=32 #32 bit\n", + "\n", + "\n", + "#Calculation\n", + "c=2**n #value for 8 bit\n", + "p=(1*c**-1)*100 #percent\n", + "c2=2**n2 #value for 16 bit\n", + "p2=(1*c2**-1)*100 #percent\n", + "c3=2**n3 #value for 32 bit\n", + "p3=(1*c3**-1)*100 #percent\n", + "\n", + "#Result\n", + "print'An 8-bit word resolution = %.2f percent\\n'%p\n", + "print'An 16-bit word resolution = %.4f percent\\n'%p2\n", + "print'An 32-bit word resolution = %.9f percent\\n'%p3" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3, Page 73" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEZCAYAAACNebLAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG4pJREFUeJzt3X2UXXV97/H3J4RHUxhFGyGQzDINZqHQATSEgs1YCybI\ng7flQaqFgduWpahUdClFbS7qur3Lem2gQBEEQlAKiEpQoMUKU5CHoAlzSZHwUAiEKPEBQoBQGuB7\n/9h7wuZkn5kzk73n/GbO57XWWZy99+/s8z0/fjnfs3/fvfcoIjAzM2s0qd0BmJlZmpwgzMyslBOE\nmZmVcoIwM7NSThBmZlbKCcLMzEo5QZiZWSknCKuUpNWSNkraIOm5/L9vbXdc7SDpaEn3Slov6VeS\n/k3SjJrf81VJb6vzPaxzTG53ADbhBPCBiLh1qEaStomIV8YopjEnaSZwOfDBiOiX9AbgMKDuzzzk\nla8Tvd+tWj6CsDpoixXSjPzX7SmSHgd+nK+fK+kOSc/kv7bnFV7TLalf0rOS/lXSP0q6It82T9Ka\nhvd4TNIf5c8l6UxJj0j6taSrJHU1xHKipMfzX/dnFfYzSdJZ+Ws3SPqppGmSzpP0tYb3XCrp9JI+\n6AEejYh+gIh4ISK+HxFP5q9bKOk7eVwbJP1M0r6F/e4m6do8tv+U9Ilh4ttD0r/nfX9fvv7YwX6S\n9FlJvwQulXSSpNsbPsfmIw9Jl0k6X9KN+VHg7ZKmSvoHSU9L+rmk32/6f98mDCcIG2t/CMwG3i9p\nd+CHwJci4o3AZ4DvS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AjC69ZDbwrf35sw74+lt9XH0mzJO00xHs/CLxV0gF5+ymSBv9NXQKcS3bk8WyzHYxQ\nkB2RzJb02cL6ZjWIycA1wOci4j8risE6iI8gLGXDnp0TET+SNBu4KytB8BzwkYi4V9I1wH3AOuCe\nwsu+BlyTF6FvKKz/JtnU0Yq8nvErsqOA0rgiYpOk44HzJO1IVvf4Y7KpsRWSNgCXjeQDF/df/nEj\nJJ0ALM33f9MQ7f+A7OjlbElfytsdHhFPjSIm60C+3bd1hHxe/rmI+PoYvd/uwC0RMXss3s+sDp5i\nMquYpD8H7iL7gy1m45aPIMzMrJSPIMzMrJQThJmZlXKCMDOzUk4QZmZWygnCzMxKOUGYmVmp/w9Q\n8qp7rMXCBAAAAABJRU5ErkJggg==\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x8ee1f60>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "#data\n", + "x = np.linspace(0, 3, 1)\n", + "y=2\n", + "\n", + "#plotting\n", + "\n", + "plt.bar(1, y, 0.001*max(x))\n", + "\n", + "\n", + "xlabel(\"Frequency in kHz\")\n", + "ylabel(\"Voltage\")\n", + "title(\"Frequency Spectrum\")\n", + "plt.axis([0, 2, 0, 3])\n", + "plt.grid()\n", + "plt.show()\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.4, Page 73" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEZCAYAAACNebLAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG21JREFUeJzt3Xu0ZGV55/HvD9oLymB7G0SQ7hWCslBJK4oYdLqNUcGo\nOImIjgZbJwnL+0RdalDT42UlaxnHIFFjULSBSLwrKJJolBPwBgr0QBRQglxVvCByaYZwee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jeNO+z5Rf4/2Rwf5onNPeu+maSrzTb1gD7Aj9r1v8ug3tdfQI4rKrObe6keTPwEQa3\nMfjzJHsD96qqu0wDjbwvwCMY3HrifsDFST7YNjpK8l8Z3FPnqKr6epJVwF5NP9H01a7Ae6rqp01f\nkeQVwJOr6srRfUrTMUGozzZPM8X01ar6TfP86cDThhLJfYG9gV2Az1fVLcAtSUZv+tjm6cCjkxzW\nLO/S7OtW4OzmC5ckm4DVwPXAT6rqXNj6h1pI8hngbUneALwM2DjGe59aVbcBv0pyDYMv+Z+MtLkn\ng1HTK6vqzKH1lwz30/Aoqlk+CPgTBn/FTRqbCULbo5uGngf466r68HCDJK+d4fW3cef06r1H9vXq\nqvrqyL7WArcMrbqdO//t3G16p6puTvJV4LnAYcD+M8SyxfD+76D93+ZtDOoWBwNntmy/myS7AR8G\nnr3l9tnSuKxBqM/G+ZOT/wK8LMl9AZI8NMmDgTOA5ya5V5L/Ajx76DWXAY9rnh82sq9XNPfVJ8ne\nSe4zw3tfDDwkyf5N+52TbPk3dRxwDIORx2+m28EcFYMRyT5J3ji0froaxArgU8Cbquo/OopBy4gj\nCPXZrGfnVNVXk+wDfHtQguAG4MVVdV6STwHnA9cAZw+97D3Ap5oi9KlD6z/CYOro3Kae8XMGo4DW\nuKrq1iSHA+9PshODusfvM5gaOzfJ9cDH5vKBh/ff/nGrkrwQOLnZ/2kztP9dBqOXtyd5R9PumVX1\ns3nEpGXI231rWWjm5W+oqvcu0Ps9FPh6Ve2zEO8nTYJTTFLHkvwx8G0Gf7BF2m45gpAktXIEIUlq\nZYKQJLUyQUiSWpkgJEmtTBCSpFYmCElSq/8PK/+gYIz8oXAAAAAASUVORK5CYII=\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x8b6bd30>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "#data\n", + "x = np.linspace(0, 3, 1)\n", + "y=2\n", + "y1=1\n", + "\n", + "#plotting\n", + "plt.bar(1, y, 0.001*max(x))\n", + "plt.bar(1.5, y1, 0.001*max(x))\n", + "\n", + "\n", + "xlabel(\"Frequency in kHz\")\n", + "ylabel(\"Voltage\")\n", + "title(\"Frequency Spectrum\")\n", + "plt.axis([0, 2, 0, 3])\n", + "plt.grid()\n", + "plt.show()\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.5, Page 74" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Bandwidth = 7.0 kHz\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "f1=7000 #Human Speech Frequency Upper limit in HZ\n", + "f2=50 #Human Speech Frequency Lower limit in Hz\n", + "\n", + "#Calculation\n", + "B=f1-f2 #Bandwidth in Hz\n", + "\n", + "#Result\n", + "print'Bandwidth = %.1f kHz'%(B*1000**-1)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter5_VQzvFGO.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter5_VQzvFGO.ipynb new file mode 100644 index 00000000..55d66248 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter5_VQzvFGO.ipynb @@ -0,0 +1,253 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: Signals and Data Transmission" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1, Page 71" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "An 8-bit word can take 2^8 = 256 values\n", + "\n", + "An 16-bit word can take 2^16 = 65536 values\n", + "\n", + "An 32-bit word can take 2^32 = 4.000000 x 10^9 values\n", + "\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "n=8 #8 bit\n", + "n2=16 #16 bit\n", + "n3=32 #32 bit\n", + "\n", + "#Calculation\n", + "c=2**n #value for 8 bit\n", + "c2=2**n2 #value for 16 bit\n", + "c3=2**n3 #value for 32 bit\n", + "\n", + "#Result\n", + "print'An 8-bit word can take 2^8 = %d values\\n'%c\n", + "print'An 16-bit word can take 2^16 = %d values\\n'%c2\n", + "print'An 32-bit word can take 2^32 = %f x 10^9 values\\n'%(c3/10**9)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2, Page 71" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "An 8-bit word resolution = 0.39 percent\n", + "\n", + "An 16-bit word resolution = 0.0015 percent\n", + "\n", + "An 32-bit word resolution = 0.000000023 percent\n", + "\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "n=8 #8 bit\n", + "n2=16 #16 bit\n", + "n3=32 #32 bit\n", + "\n", + "\n", + "#Calculation\n", + "c=2**n #value for 8 bit\n", + "p=(1*c**-1)*100 #percent\n", + "c2=2**n2 #value for 16 bit\n", + "p2=(1*c2**-1)*100 #percent\n", + "c3=2**n3 #value for 32 bit\n", + "p3=(1*c3**-1)*100 #percent\n", + "\n", + "#Result\n", + "print'An 8-bit word resolution = %.2f percent\\n'%p\n", + "print'An 16-bit word resolution = %.4f percent\\n'%p2\n", + "print'An 32-bit word resolution = %.9f percent\\n'%p3" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3, Page 73" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEZCAYAAACNebLAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG4pJREFUeJzt3X2UXXV97/H3J4RHUxhFGyGQzDINZqHQATSEgs1YCybI\ng7flQaqFgduWpahUdClFbS7qur3Lem2gQBEEQlAKiEpQoMUKU5CHoAlzSZHwUAiEKPEBQoBQGuB7\n/9h7wuZkn5kzk73n/GbO57XWWZy99+/s8z0/fjnfs3/fvfcoIjAzM2s0qd0BmJlZmpwgzMyslBOE\nmZmVcoIwM7NSThBmZlbKCcLMzEo5QZiZWSknCKuUpNWSNkraIOm5/L9vbXdc7SDpaEn3Slov6VeS\n/k3SjJrf81VJb6vzPaxzTG53ADbhBPCBiLh1qEaStomIV8YopjEnaSZwOfDBiOiX9AbgMKDuzzzk\nla8Tvd+tWj6CsDpoixXSjPzX7SmSHgd+nK+fK+kOSc/kv7bnFV7TLalf0rOS/lXSP0q6It82T9Ka\nhvd4TNIf5c8l6UxJj0j6taSrJHU1xHKipMfzX/dnFfYzSdJZ+Ws3SPqppGmSzpP0tYb3XCrp9JI+\n6AEejYh+gIh4ISK+HxFP5q9bKOk7eVwbJP1M0r6F/e4m6do8tv+U9Ilh4ttD0r/nfX9fvv7YwX6S\n9FlJvwQulXSSpNsbPsfmIw9Jl0k6X9KN+VHg7ZKmSvoHSU9L+rmk32/6f98mDCcIG2t/CMwG3i9p\nd+CHwJci4o3AZ4DvSto1b3sl8FPgzcBXgJN4/S/koX4tfxI4CngPsDvwDHBBQ5uDgVnAHwN/K+nt\n+fpPA8cD8yNiZ+AUYCPZEcGHBl+cx/k+4Nsl778CmC3p65J68yOIRkcBVwNvBP4ZuE7SNpIE/AC4\nF9gtf4/TJR06RHwvRMRgct0nInaOiO/ky28FuoDpwF/l6xr7rnH5WOAsYFfgv4G7gJ/ly98F/qHk\n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nEj\nJJ0ALM33f9MQ7f+A7OjlbElfytsdHhFPjSIm60C+3bd1hHxe/rmI+PoYvd/uwC0RMXss3s+sDp5i\nMquYpD8H7iL7gy1m45aPIMzMrJSPIMzMrJQThJmZlXKCMDOzUk4QZmZWygnCzMxKOUGYmVmp/w9Q\n8qp7rMXCBAAAAABJRU5ErkJggg==\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x8ee1f60>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "#data\n", + "x = np.linspace(0, 3, 1)\n", + "y=2\n", + "\n", + "#plotting\n", + "\n", + "plt.bar(1, y, 0.001*max(x))\n", + "\n", + "\n", + "xlabel(\"Frequency in kHz\")\n", + "ylabel(\"Voltage\")\n", + "title(\"Frequency Spectrum\")\n", + "plt.axis([0, 2, 0, 3])\n", + "plt.grid()\n", + "plt.show()\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.4, Page 73" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEZCAYAAACNebLAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG21JREFUeJzt3Xu0ZGV55/HvD9oLymB7G0SQ7hWCslBJK4oYdLqNUcGo\nOImIjgZbJwnL+0RdalDT42UlaxnHIFFjULSBSLwrKJJolBPwBgr0QBRQglxVvCByaYZweeaP2t0U\nxT7n1Dm965zd53w/a9Wi9t5v7XrqZXc99b7P3vukqpAkadQOix2AJKmfTBCSpFYmCElSKxOEJKmV\nCUKS1MoEIUlqZYKQJLUyQahTSS5LsjnJ9UluaP77kMWOazEkOTTJeUmuS/LzJP+aZNWE3/OOJL81\nyffQ8rFisQPQklPAH1TV6TM1SrJjVd2+QDEtuCR7AccDz62qqST3BZ4OTPozz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zW\nLO/S7OtW4OzmC5ckm4DVwPXAT6rqXNj6h1pI8hngbUneALwM2DjGe59aVbcBv0pyDYMv+Z+MtLkn\ng1HTK6vqzKH1lwz30/Aoqlk+CPgTBn/FTRqbCULbo5uGngf466r68HCDJK+d4fW3cef06r1H9vXq\nqvrqyL7WArcMrbqdO//t3G16p6puTvJV4LnAYcD+M8SyxfD+76D93+ZtDOoWBwNntmy/myS7AR8G\nnr3l9tnSuKxBqM/G+ZOT/wK8LMl9AZI8NMmDgTOA5ya5V5L/Ajx76DWXAY9rnh82sq9XNPfVJ8ne\nSe4zw3tfDDwkyf5N+52TbPk3dRxwDIORx2+m28EcFYMRyT5J3ji0froaxArgU8Cbquo/OopBy4gj\nCPXZrGfnVNVXk+wDfHtQguAG4MVVdV6STwHnA9cAZw+97D3Ap5oi9KlD6z/CYOro3Kae8XMGo4DW\nuKrq1iSHA+9PshODusfvM5gaOzfJ9cDH5vKBh/ff/nGrkrwQOLnZ/2kztP9dBqOXtyd5R9PumVX1\ns3nEpGXI231rWWjm5W+oqvcu0Ps9FPh6Ve2zEO8nTYJTTFLHkvwx8G0Gf7BF2m45gpAktXIEIUlq\nZYKQJLUyQUiSWpkgJEmtTBCSpFYmCElSq/8PK/+gYIz8oXAAAAAASUVORK5CYII=\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x8b6bd30>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "#data\n", + "x = np.linspace(0, 3, 1)\n", + "y=2\n", + "y1=1\n", + "\n", + "#plotting\n", + "plt.bar(1, y, 0.001*max(x))\n", + "plt.bar(1.5, y1, 0.001*max(x))\n", + "\n", + "\n", + "xlabel(\"Frequency in kHz\")\n", + "ylabel(\"Voltage\")\n", + "title(\"Frequency Spectrum\")\n", + "plt.axis([0, 2, 0, 3])\n", + "plt.grid()\n", + "plt.show()\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.5, Page 74" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Bandwidth = 7.0 kHz\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "f1=7000 #Human Speech Frequency Upper limit in HZ\n", + "f2=50 #Human Speech Frequency Lower limit in Hz\n", + "\n", + "#Calculation\n", + "B=f1-f2 #Bandwidth in Hz\n", + "\n", + "#Result\n", + "print'Bandwidth = %.1f kHz'%(B*1000**-1)" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter6.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter6.ipynb new file mode 100644 index 00000000..4bcd3580 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter6.ipynb @@ -0,0 +1,261 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: Amplification" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1, Page 92" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ouput voltage of and amplifier = 15.2 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Ri=1000 #Input Resistance of amplifier in Ohm\n", + "Rs=100 #Output Resistance of sensor in Ohm\n", + "Rl=50 #Load Resistance\n", + "Ro=10 #Output Resistance of amplifier in Ohm\n", + "Av=10 #Voltage gain\n", + "Vs=2 #Sensor voltage\n", + "\n", + "#Calculation\n", + "Vi=Ri*Vs*(Rs+Ri)**-1 #Input Voltage of Amplifier\n", + "Vo=Av*Vi*Rl*(Ro+Rl)**-1 #Output Voltage of Amplifier\n", + "\n", + "#Result\n", + "print'Ouput voltage of and amplifier = %.1f V'%Vo\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2, Page 93" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage Gain, Av = 8.35\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Vo=15.2 #Output Voltage of Amplifier\n", + "Vi=1.82 #Input Voltage of Amplifier\n", + "\n", + "#Calculation\n", + "Av=Vo/Vi #Voltage gain\n", + "\n", + "#Result\n", + "print'Voltage Gain, Av = %.2f'%Av\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3, Page 94" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ouput voltage of and amplifier = 20.0 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Av=10 #Voltage gain\n", + "Vi=2 #Input Voltage of Amplifier\n", + "Rl=50 #Load Resistance\n", + "Ro=0 #Output Resistance of amplifier in Ohm\n", + "\n", + "\n", + "#Calculation\n", + "Vo=Av*Vi*Rl/(Ro+Rl) #Output Voltage of Amplifier\n", + "\n", + "#Result\n", + "print'Ouput voltage of and amplifier = %.1f V'%Vo\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4, Page 96" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Power, Po = 4.6 W\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Vo=15.2 #Output Voltage\n", + "Rl=50 #Load Resistance\n", + "\n", + "#Calculation \n", + "Po=(Vo**2)/Rl #Output Power\n", + "\n", + "#Result\n", + "print'Output Power, Po = %.1f W'%Po" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5, Page 98" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power Gain, Ap = 1395\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Vi=1.82 #Input Voltage of Amplifier\n", + "Ri=1000 #Input Resistance of amplifier in Ohm\n", + "Vo=15.2 #Output Voltage of Amplifier\n", + "Rl=50 #Load Resistance\n", + "\n", + "\n", + "#Calculation\n", + "Pi=(Vi**2)*Ri**-1 #Input Power in Watt\n", + "Po=(Vo**2)*Rl**-1 #Output Power in Watt\n", + "Ap=Po/Pi #Power Gain\n", + " \n", + "\n", + "#Result\n", + "print'Power Gain, Ap = %d'%Ap #wrong answer in textbook \n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6, Page 99" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power Gain (dB) = 31.5 dB\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialisation\n", + "P=1400 #Power gain\n", + "\n", + "#Calculation\n", + "pdb=10*math.log10(P) #Power Gain in dB\n", + "\n", + "#Result\n", + "print'Power Gain (dB) = %.1f dB'%pdb\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter6_18MJqWw.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter6_18MJqWw.ipynb new file mode 100644 index 00000000..4bcd3580 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter6_18MJqWw.ipynb @@ -0,0 +1,261 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: Amplification" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1, Page 92" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ouput voltage of and amplifier = 15.2 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Ri=1000 #Input Resistance of amplifier in Ohm\n", + "Rs=100 #Output Resistance of sensor in Ohm\n", + "Rl=50 #Load Resistance\n", + "Ro=10 #Output Resistance of amplifier in Ohm\n", + "Av=10 #Voltage gain\n", + "Vs=2 #Sensor voltage\n", + "\n", + "#Calculation\n", + "Vi=Ri*Vs*(Rs+Ri)**-1 #Input Voltage of Amplifier\n", + "Vo=Av*Vi*Rl*(Ro+Rl)**-1 #Output Voltage of Amplifier\n", + "\n", + "#Result\n", + "print'Ouput voltage of and amplifier = %.1f V'%Vo\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2, Page 93" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage Gain, Av = 8.35\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Vo=15.2 #Output Voltage of Amplifier\n", + "Vi=1.82 #Input Voltage of Amplifier\n", + "\n", + "#Calculation\n", + "Av=Vo/Vi #Voltage gain\n", + "\n", + "#Result\n", + "print'Voltage Gain, Av = %.2f'%Av\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3, Page 94" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ouput voltage of and amplifier = 20.0 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Av=10 #Voltage gain\n", + "Vi=2 #Input Voltage of Amplifier\n", + "Rl=50 #Load Resistance\n", + "Ro=0 #Output Resistance of amplifier in Ohm\n", + "\n", + "\n", + "#Calculation\n", + "Vo=Av*Vi*Rl/(Ro+Rl) #Output Voltage of Amplifier\n", + "\n", + "#Result\n", + "print'Ouput voltage of and amplifier = %.1f V'%Vo\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4, Page 96" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Power, Po = 4.6 W\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Vo=15.2 #Output Voltage\n", + "Rl=50 #Load Resistance\n", + "\n", + "#Calculation \n", + "Po=(Vo**2)/Rl #Output Power\n", + "\n", + "#Result\n", + "print'Output Power, Po = %.1f W'%Po" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5, Page 98" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power Gain, Ap = 1395\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Vi=1.82 #Input Voltage of Amplifier\n", + "Ri=1000 #Input Resistance of amplifier in Ohm\n", + "Vo=15.2 #Output Voltage of Amplifier\n", + "Rl=50 #Load Resistance\n", + "\n", + "\n", + "#Calculation\n", + "Pi=(Vi**2)*Ri**-1 #Input Power in Watt\n", + "Po=(Vo**2)*Rl**-1 #Output Power in Watt\n", + "Ap=Po/Pi #Power Gain\n", + " \n", + "\n", + "#Result\n", + "print'Power Gain, Ap = %d'%Ap #wrong answer in textbook \n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6, Page 99" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power Gain (dB) = 31.5 dB\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialisation\n", + "P=1400 #Power gain\n", + "\n", + "#Calculation\n", + "pdb=10*math.log10(P) #Power Gain in dB\n", + "\n", + "#Result\n", + "print'Power Gain (dB) = %.1f dB'%pdb\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter6_4vuzkiJ.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter6_4vuzkiJ.ipynb new file mode 100644 index 00000000..4bcd3580 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter6_4vuzkiJ.ipynb @@ -0,0 +1,261 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: Amplification" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1, Page 92" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ouput voltage of and amplifier = 15.2 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Ri=1000 #Input Resistance of amplifier in Ohm\n", + "Rs=100 #Output Resistance of sensor in Ohm\n", + "Rl=50 #Load Resistance\n", + "Ro=10 #Output Resistance of amplifier in Ohm\n", + "Av=10 #Voltage gain\n", + "Vs=2 #Sensor voltage\n", + "\n", + "#Calculation\n", + "Vi=Ri*Vs*(Rs+Ri)**-1 #Input Voltage of Amplifier\n", + "Vo=Av*Vi*Rl*(Ro+Rl)**-1 #Output Voltage of Amplifier\n", + "\n", + "#Result\n", + "print'Ouput voltage of and amplifier = %.1f V'%Vo\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2, Page 93" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voltage Gain, Av = 8.35\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Vo=15.2 #Output Voltage of Amplifier\n", + "Vi=1.82 #Input Voltage of Amplifier\n", + "\n", + "#Calculation\n", + "Av=Vo/Vi #Voltage gain\n", + "\n", + "#Result\n", + "print'Voltage Gain, Av = %.2f'%Av\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3, Page 94" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ouput voltage of and amplifier = 20.0 V\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Av=10 #Voltage gain\n", + "Vi=2 #Input Voltage of Amplifier\n", + "Rl=50 #Load Resistance\n", + "Ro=0 #Output Resistance of amplifier in Ohm\n", + "\n", + "\n", + "#Calculation\n", + "Vo=Av*Vi*Rl/(Ro+Rl) #Output Voltage of Amplifier\n", + "\n", + "#Result\n", + "print'Ouput voltage of and amplifier = %.1f V'%Vo\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4, Page 96" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Power, Po = 4.6 W\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Vo=15.2 #Output Voltage\n", + "Rl=50 #Load Resistance\n", + "\n", + "#Calculation \n", + "Po=(Vo**2)/Rl #Output Power\n", + "\n", + "#Result\n", + "print'Output Power, Po = %.1f W'%Po" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5, Page 98" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power Gain, Ap = 1395\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "Vi=1.82 #Input Voltage of Amplifier\n", + "Ri=1000 #Input Resistance of amplifier in Ohm\n", + "Vo=15.2 #Output Voltage of Amplifier\n", + "Rl=50 #Load Resistance\n", + "\n", + "\n", + "#Calculation\n", + "Pi=(Vi**2)*Ri**-1 #Input Power in Watt\n", + "Po=(Vo**2)*Rl**-1 #Output Power in Watt\n", + "Ap=Po/Pi #Power Gain\n", + " \n", + "\n", + "#Result\n", + "print'Power Gain, Ap = %d'%Ap #wrong answer in textbook \n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6, Page 99" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Power Gain (dB) = 31.5 dB\n" + ] + } + ], + "source": [ + "import math\n", + "#Initialisation\n", + "P=1400 #Power gain\n", + "\n", + "#Calculation\n", + "pdb=10*math.log10(P) #Power Gain in dB\n", + "\n", + "#Result\n", + "print'Power Gain (dB) = %.1f dB'%pdb\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter8.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter8.ipynb new file mode 100644 index 00000000..bc1fdb59 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter8.ipynb @@ -0,0 +1,175 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: Operational Amplifier" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.3, Page 148" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Gain = 50\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "f=20*10**3 #bandwidth frequency in KHz\n", + "\n", + "#Calculation\n", + "gain=(10**6)/(f) #gain\n", + "\n", + "#Result\n", + "print'Gain = %d'%gain" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.4, Page 150" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Resistance = 7.5 mOhm\n", + "\n", + "Input Resistance = 20 GOhm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "og=2*10**5 #Open Loop Gain\n", + "cg=20 #Closed Loop Gain\n", + "or1=75 #Output Resistance\n", + "ir1=2*10**6 #Input Resistance\n", + "\n", + "#Calculation\n", + "ab=og*cg**-1 #factor (1+AB)\n", + "or2=or1/ab #Output Resistance\n", + "ir2=ir1*ab #Input Resistance\n", + "\n", + "#Result\n", + "print'Output Resistance = %.1f mOhm\\n'%(or2*1000)\n", + "print'Input Resistance = %d GOhm'%(ir2*10**-9)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.5, Page 150" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Resistance = 7.5 mOhm\n", + "\n", + "Input Resistance = 1 KOhm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "og=2*10**5 #Open Loop Gain\n", + "cg=20 #Closed Loop Gain\n", + "or1=75 #Output Resistance\n", + "ir1=2*10**6 #Input Resistance\n", + "r1=20*10**3 #Resistnce in Ohm\n", + "r2=10**3 #Resistnce in Ohm\n", + "\n", + "#Calculation\n", + "ab=og*cg**-1 #factor (1+AB)\n", + "or2=or1*ab**-1 #Output Resistance\n", + "#the input is connected to a virtual earth point by the resistance R2, \n", + "#so the input resistance is equal to R 2 ,\n", + "ir2=r2 #Input Resistance\n", + "\n", + "#Result\n", + "print'Output Resistance = %.1f mOhm\\n'%(or2*1000)\n", + "print'Input Resistance = %d KOhm'%(ir2*10**-3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.6, Page 151" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Resistance = 375 uOhm\n", + "\n", + "Input Resistance = 400 GOhm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "og=2*10**5 #Open Loop Gain\n", + "cg=1 #Closed Loop Gain\n", + "or1=75 #Output Resistance\n", + "ir1=2*10**6 #Input Resistance\n", + "\n", + "#Calculation\n", + "ab=og*cg**-1 #factor (1+AB)\n", + "or2=or1*ab**-1 #Output Resistance\n", + "ir2=ir1*ab #Input Resistance\n", + "\n", + "#Result\n", + "print'Output Resistance = %d uOhm\\n'%(or2*10**6) #wrong answer in the textbook\n", + "print'Input Resistance = %d GOhm'%(ir2*10**-9)" + ] + } + ], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter8_817bFiA.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter8_817bFiA.ipynb new file mode 100644 index 00000000..bc1fdb59 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter8_817bFiA.ipynb @@ -0,0 +1,175 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: Operational Amplifier" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.3, Page 148" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Gain = 50\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "f=20*10**3 #bandwidth frequency in KHz\n", + "\n", + "#Calculation\n", + "gain=(10**6)/(f) #gain\n", + "\n", + "#Result\n", + "print'Gain = %d'%gain" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.4, Page 150" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Resistance = 7.5 mOhm\n", + "\n", + "Input Resistance = 20 GOhm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "og=2*10**5 #Open Loop Gain\n", + "cg=20 #Closed Loop Gain\n", + "or1=75 #Output Resistance\n", + "ir1=2*10**6 #Input Resistance\n", + "\n", + "#Calculation\n", + "ab=og*cg**-1 #factor (1+AB)\n", + "or2=or1/ab #Output Resistance\n", + "ir2=ir1*ab #Input Resistance\n", + "\n", + "#Result\n", + "print'Output Resistance = %.1f mOhm\\n'%(or2*1000)\n", + "print'Input Resistance = %d GOhm'%(ir2*10**-9)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.5, Page 150" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Resistance = 7.5 mOhm\n", + "\n", + "Input Resistance = 1 KOhm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "og=2*10**5 #Open Loop Gain\n", + "cg=20 #Closed Loop Gain\n", + "or1=75 #Output Resistance\n", + "ir1=2*10**6 #Input Resistance\n", + "r1=20*10**3 #Resistnce in Ohm\n", + "r2=10**3 #Resistnce in Ohm\n", + "\n", + "#Calculation\n", + "ab=og*cg**-1 #factor (1+AB)\n", + "or2=or1*ab**-1 #Output Resistance\n", + "#the input is connected to a virtual earth point by the resistance R2, \n", + "#so the input resistance is equal to R 2 ,\n", + "ir2=r2 #Input Resistance\n", + "\n", + "#Result\n", + "print'Output Resistance = %.1f mOhm\\n'%(or2*1000)\n", + "print'Input Resistance = %d KOhm'%(ir2*10**-3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.6, Page 151" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Resistance = 375 uOhm\n", + "\n", + "Input Resistance = 400 GOhm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "og=2*10**5 #Open Loop Gain\n", + "cg=1 #Closed Loop Gain\n", + "or1=75 #Output Resistance\n", + "ir1=2*10**6 #Input Resistance\n", + "\n", + "#Calculation\n", + "ab=og*cg**-1 #factor (1+AB)\n", + "or2=or1*ab**-1 #Output Resistance\n", + "ir2=ir1*ab #Input Resistance\n", + "\n", + "#Result\n", + "print'Output Resistance = %d uOhm\\n'%(or2*10**6) #wrong answer in the textbook\n", + "print'Input Resistance = %d GOhm'%(ir2*10**-9)" + ] + } + ], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter8_wMvTWIF.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter8_wMvTWIF.ipynb new file mode 100644 index 00000000..bc1fdb59 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter8_wMvTWIF.ipynb @@ -0,0 +1,175 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: Operational Amplifier" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.3, Page 148" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Gain = 50\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "f=20*10**3 #bandwidth frequency in KHz\n", + "\n", + "#Calculation\n", + "gain=(10**6)/(f) #gain\n", + "\n", + "#Result\n", + "print'Gain = %d'%gain" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.4, Page 150" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Resistance = 7.5 mOhm\n", + "\n", + "Input Resistance = 20 GOhm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "og=2*10**5 #Open Loop Gain\n", + "cg=20 #Closed Loop Gain\n", + "or1=75 #Output Resistance\n", + "ir1=2*10**6 #Input Resistance\n", + "\n", + "#Calculation\n", + "ab=og*cg**-1 #factor (1+AB)\n", + "or2=or1/ab #Output Resistance\n", + "ir2=ir1*ab #Input Resistance\n", + "\n", + "#Result\n", + "print'Output Resistance = %.1f mOhm\\n'%(or2*1000)\n", + "print'Input Resistance = %d GOhm'%(ir2*10**-9)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.5, Page 150" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Resistance = 7.5 mOhm\n", + "\n", + "Input Resistance = 1 KOhm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "og=2*10**5 #Open Loop Gain\n", + "cg=20 #Closed Loop Gain\n", + "or1=75 #Output Resistance\n", + "ir1=2*10**6 #Input Resistance\n", + "r1=20*10**3 #Resistnce in Ohm\n", + "r2=10**3 #Resistnce in Ohm\n", + "\n", + "#Calculation\n", + "ab=og*cg**-1 #factor (1+AB)\n", + "or2=or1*ab**-1 #Output Resistance\n", + "#the input is connected to a virtual earth point by the resistance R2, \n", + "#so the input resistance is equal to R 2 ,\n", + "ir2=r2 #Input Resistance\n", + "\n", + "#Result\n", + "print'Output Resistance = %.1f mOhm\\n'%(or2*1000)\n", + "print'Input Resistance = %d KOhm'%(ir2*10**-3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.6, Page 151" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output Resistance = 375 uOhm\n", + "\n", + "Input Resistance = 400 GOhm\n" + ] + } + ], + "source": [ + "#Initialisation\n", + "og=2*10**5 #Open Loop Gain\n", + "cg=1 #Closed Loop Gain\n", + "or1=75 #Output Resistance\n", + "ir1=2*10**6 #Input Resistance\n", + "\n", + "#Calculation\n", + "ab=og*cg**-1 #factor (1+AB)\n", + "or2=or1*ab**-1 #Output Resistance\n", + "ir2=ir1*ab #Input Resistance\n", + "\n", + "#Result\n", + "print'Output Resistance = %d uOhm\\n'%(or2*10**6) #wrong answer in the textbook\n", + "print'Input Resistance = %d GOhm'%(ir2*10**-9)" + ] + } + ], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter9.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter9.ipynb new file mode 100644 index 00000000..489ec875 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter9.ipynb @@ -0,0 +1,418 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9: Digital Electronics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.8, Page 176" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Decimal Equivalent = 26.000000\n" + ] + } + ], + "source": [ + "#Initialization\n", + "ni1=11010 #binary number\n", + "\n", + "#Calculation\n", + "def binary_decimal(ni): # Function to convert binary to decimal\n", + " deci = 0;\n", + " i = 0;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/10.)*10\n", + " ni = int(ni/10.);\n", + " deci = deci + rem*2**i;\n", + " i = i + 1;\n", + " return deci\n", + "\n", + "w=binary_decimal(ni1) #calling the function\n", + "\n", + "#Declaration\n", + "print'Decimal Equivalent = %f'%w" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.9, Page 176" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Binary Equivalent = 11010\n" + ] + } + ], + "source": [ + "#Initialization\n", + "ni1=26 #Decimal number\n", + "\n", + "#Calculation\n", + "def decimal_binary(ni): # Function to convert decimal to binary\n", + " bini = 0;\n", + " i = 1;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/2)*2; \n", + " ni = int(ni/2);\n", + " bini = bini + rem*i;\n", + " i = i * 10;\n", + " return bini\n", + "\n", + "w=decimal_binary(ni1) #calling the function\n", + "\n", + "#Declaration\n", + "print'Binary Equivalent = %d'%w" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.10, Page 177" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Decimal equivalent of 34.6875 = 100010.1011\n" + ] + } + ], + "source": [ + "#Initializaton\n", + "\n", + "no=34.6875 #decimal number\n", + "n_int = int(no); # Extract the integral part\n", + "n_frac = no-n_int; # Extract the fractional part\n", + "\n", + "#Calculation\n", + "\n", + "def decimal_binary(ni): # Function to convert decimal to binary\n", + " bini = 0;\n", + " i = 1;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/2)*2; \n", + " ni = int(ni/2);\n", + " bini = bini + rem*i;\n", + " i = i * 10;\n", + " return bini\n", + "\n", + "def decifrac_binfrac(nf): # Function to convert binary fraction to decimal fraction\n", + " binf = 0; i = 0.1;\n", + " while (nf != 0):\n", + " nf = nf*2;\n", + " rem = int(nf); \n", + " nf = nf-rem;\n", + " binf = binf + rem*i;\n", + " i = i/10;\n", + " return binf\n", + "\n", + "\n", + "\n", + "#Result\n", + "print \"Decimal equivalent of 34.6875 = %.4f\"%(decimal_binary(n_int)+decifrac_binfrac(n_frac))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.11, Page 177" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W = 40979\n" + ] + } + ], + "source": [ + "#initialization\n", + "n='A013' #Hex number \n", + "\n", + "#Calculation\n", + "w=int(n, 16) #Hex to Decimal Coversion\n", + "\n", + "\n", + "#Result\n", + "print'W = %d'%w" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.12, Page 178" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The hexadecimal equivalent of 7046 is 0x1b86\n" + ] + } + ], + "source": [ + "\n", + "#Variable declaration\n", + "n=7046 #Hex number \n", + "\n", + "#Calculations\n", + "h = hex(n) #decimal to hex conversion\n", + "\n", + "#Result\n", + "print \"The hexadecimal equivalent of 7046 is\",h" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.13, Page 178" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Decimal equivalent of 34.6875 = 1111100001010001\n" + ] + } + ], + "source": [ + "#Initializaton\n", + "\n", + "n='f851' #Hex Number\n", + "\n", + "#Calculation\n", + "\n", + "w=int(n, 16) #Hex to Decimal Coversion\n", + "\n", + "def decimal_binary(ni): # Function to convert decimal to binary\n", + " bini = 0;\n", + " i = 1;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/2)*2; \n", + " ni = int(ni/2);\n", + " bini = bini + rem*i;\n", + " i = i * 10;\n", + " return bini\n", + "\n", + "\n", + "w1=decimal_binary(w) #calling the function\n", + "\n", + "\n", + "#Result\n", + "print \"Decimal equivalent of 34.6875 = %.d\"%(w1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.14, Page 179" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The hexadecimal equivalent of 111011011000100 is 0x76c4\n" + ] + } + ], + "source": [ + "#Initialiation\n", + "ni1=111011011000100 #binary number\n", + "\n", + "#Calculation\n", + "def binary_decimal(ni): # Function to convert binary to decimal\n", + " deci = 0;\n", + " i = 0;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/10.)*10\n", + " ni = int(ni/10.);\n", + " deci = deci + rem*2**i;\n", + " i = i + 1;\n", + " return deci\n", + "\n", + "w=binary_decimal(ni1) #calling the function\n", + "h = hex(w) #decimal to hex conversion\n", + "\n", + "#Result\n", + "print \"The hexadecimal equivalent of 111011011000100 is\",h" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": false + }, + "source": [ + "## Example 9.15, Page 182" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Eqivalent BCD of 72 = 1001010001010000\n" + ] + } + ], + "source": [ + "#initialisation\n", + "x='9450' #decimal number to be convert\n", + "\n", + "#calculation\n", + "digits = [int(c) for c in x]\n", + "zero_padded_BCD_digits = [format(d, '04b') for d in digits]\n", + "\n", + "#results\n", + "print \"Eqivalent BCD of 72 = \",\n", + "print ''.join(zero_padded_BCD_digits)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.16, Page 182" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The equivalent decimal =3876.\n" + ] + } + ], + "source": [ + "\n", + "#Initialisation\n", + "BCD=\"0011 1000 0111 0110\" #Given BCD string\n", + "BCD_split=BCD.split(\" \"); #Splitting th binary string into individual BCD \n", + "d=0;\n", + "for i in range(len(BCD_split),0,-1):\n", + " d+=int(BCD_split[len(BCD_split)-i],2)*10**(i-1);\n", + "\n", + "#Result\n", + "print(\"The equivalent decimal = %d.\"%d);\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter9_f0YzOCH.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter9_f0YzOCH.ipynb new file mode 100644 index 00000000..489ec875 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter9_f0YzOCH.ipynb @@ -0,0 +1,418 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9: Digital Electronics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.8, Page 176" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Decimal Equivalent = 26.000000\n" + ] + } + ], + "source": [ + "#Initialization\n", + "ni1=11010 #binary number\n", + "\n", + "#Calculation\n", + "def binary_decimal(ni): # Function to convert binary to decimal\n", + " deci = 0;\n", + " i = 0;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/10.)*10\n", + " ni = int(ni/10.);\n", + " deci = deci + rem*2**i;\n", + " i = i + 1;\n", + " return deci\n", + "\n", + "w=binary_decimal(ni1) #calling the function\n", + "\n", + "#Declaration\n", + "print'Decimal Equivalent = %f'%w" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.9, Page 176" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Binary Equivalent = 11010\n" + ] + } + ], + "source": [ + "#Initialization\n", + "ni1=26 #Decimal number\n", + "\n", + "#Calculation\n", + "def decimal_binary(ni): # Function to convert decimal to binary\n", + " bini = 0;\n", + " i = 1;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/2)*2; \n", + " ni = int(ni/2);\n", + " bini = bini + rem*i;\n", + " i = i * 10;\n", + " return bini\n", + "\n", + "w=decimal_binary(ni1) #calling the function\n", + "\n", + "#Declaration\n", + "print'Binary Equivalent = %d'%w" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.10, Page 177" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Decimal equivalent of 34.6875 = 100010.1011\n" + ] + } + ], + "source": [ + "#Initializaton\n", + "\n", + "no=34.6875 #decimal number\n", + "n_int = int(no); # Extract the integral part\n", + "n_frac = no-n_int; # Extract the fractional part\n", + "\n", + "#Calculation\n", + "\n", + "def decimal_binary(ni): # Function to convert decimal to binary\n", + " bini = 0;\n", + " i = 1;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/2)*2; \n", + " ni = int(ni/2);\n", + " bini = bini + rem*i;\n", + " i = i * 10;\n", + " return bini\n", + "\n", + "def decifrac_binfrac(nf): # Function to convert binary fraction to decimal fraction\n", + " binf = 0; i = 0.1;\n", + " while (nf != 0):\n", + " nf = nf*2;\n", + " rem = int(nf); \n", + " nf = nf-rem;\n", + " binf = binf + rem*i;\n", + " i = i/10;\n", + " return binf\n", + "\n", + "\n", + "\n", + "#Result\n", + "print \"Decimal equivalent of 34.6875 = %.4f\"%(decimal_binary(n_int)+decifrac_binfrac(n_frac))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.11, Page 177" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W = 40979\n" + ] + } + ], + "source": [ + "#initialization\n", + "n='A013' #Hex number \n", + "\n", + "#Calculation\n", + "w=int(n, 16) #Hex to Decimal Coversion\n", + "\n", + "\n", + "#Result\n", + "print'W = %d'%w" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.12, Page 178" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The hexadecimal equivalent of 7046 is 0x1b86\n" + ] + } + ], + "source": [ + "\n", + "#Variable declaration\n", + "n=7046 #Hex number \n", + "\n", + "#Calculations\n", + "h = hex(n) #decimal to hex conversion\n", + "\n", + "#Result\n", + "print \"The hexadecimal equivalent of 7046 is\",h" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.13, Page 178" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Decimal equivalent of 34.6875 = 1111100001010001\n" + ] + } + ], + "source": [ + "#Initializaton\n", + "\n", + "n='f851' #Hex Number\n", + "\n", + "#Calculation\n", + "\n", + "w=int(n, 16) #Hex to Decimal Coversion\n", + "\n", + "def decimal_binary(ni): # Function to convert decimal to binary\n", + " bini = 0;\n", + " i = 1;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/2)*2; \n", + " ni = int(ni/2);\n", + " bini = bini + rem*i;\n", + " i = i * 10;\n", + " return bini\n", + "\n", + "\n", + "w1=decimal_binary(w) #calling the function\n", + "\n", + "\n", + "#Result\n", + "print \"Decimal equivalent of 34.6875 = %.d\"%(w1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.14, Page 179" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The hexadecimal equivalent of 111011011000100 is 0x76c4\n" + ] + } + ], + "source": [ + "#Initialiation\n", + "ni1=111011011000100 #binary number\n", + "\n", + "#Calculation\n", + "def binary_decimal(ni): # Function to convert binary to decimal\n", + " deci = 0;\n", + " i = 0;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/10.)*10\n", + " ni = int(ni/10.);\n", + " deci = deci + rem*2**i;\n", + " i = i + 1;\n", + " return deci\n", + "\n", + "w=binary_decimal(ni1) #calling the function\n", + "h = hex(w) #decimal to hex conversion\n", + "\n", + "#Result\n", + "print \"The hexadecimal equivalent of 111011011000100 is\",h" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": false + }, + "source": [ + "## Example 9.15, Page 182" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Eqivalent BCD of 72 = 1001010001010000\n" + ] + } + ], + "source": [ + "#initialisation\n", + "x='9450' #decimal number to be convert\n", + "\n", + "#calculation\n", + "digits = [int(c) for c in x]\n", + "zero_padded_BCD_digits = [format(d, '04b') for d in digits]\n", + "\n", + "#results\n", + "print \"Eqivalent BCD of 72 = \",\n", + "print ''.join(zero_padded_BCD_digits)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.16, Page 182" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The equivalent decimal =3876.\n" + ] + } + ], + "source": [ + "\n", + "#Initialisation\n", + "BCD=\"0011 1000 0111 0110\" #Given BCD string\n", + "BCD_split=BCD.split(\" \"); #Splitting th binary string into individual BCD \n", + "d=0;\n", + "for i in range(len(BCD_split),0,-1):\n", + " d+=int(BCD_split[len(BCD_split)-i],2)*10**(i-1);\n", + "\n", + "#Result\n", + "print(\"The equivalent decimal = %d.\"%d);\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter9_vhHgT2e.ipynb b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter9_vhHgT2e.ipynb new file mode 100644 index 00000000..489ec875 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/Chapter9_vhHgT2e.ipynb @@ -0,0 +1,418 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9: Digital Electronics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.8, Page 176" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Decimal Equivalent = 26.000000\n" + ] + } + ], + "source": [ + "#Initialization\n", + "ni1=11010 #binary number\n", + "\n", + "#Calculation\n", + "def binary_decimal(ni): # Function to convert binary to decimal\n", + " deci = 0;\n", + " i = 0;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/10.)*10\n", + " ni = int(ni/10.);\n", + " deci = deci + rem*2**i;\n", + " i = i + 1;\n", + " return deci\n", + "\n", + "w=binary_decimal(ni1) #calling the function\n", + "\n", + "#Declaration\n", + "print'Decimal Equivalent = %f'%w" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.9, Page 176" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Binary Equivalent = 11010\n" + ] + } + ], + "source": [ + "#Initialization\n", + "ni1=26 #Decimal number\n", + "\n", + "#Calculation\n", + "def decimal_binary(ni): # Function to convert decimal to binary\n", + " bini = 0;\n", + " i = 1;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/2)*2; \n", + " ni = int(ni/2);\n", + " bini = bini + rem*i;\n", + " i = i * 10;\n", + " return bini\n", + "\n", + "w=decimal_binary(ni1) #calling the function\n", + "\n", + "#Declaration\n", + "print'Binary Equivalent = %d'%w" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.10, Page 177" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Decimal equivalent of 34.6875 = 100010.1011\n" + ] + } + ], + "source": [ + "#Initializaton\n", + "\n", + "no=34.6875 #decimal number\n", + "n_int = int(no); # Extract the integral part\n", + "n_frac = no-n_int; # Extract the fractional part\n", + "\n", + "#Calculation\n", + "\n", + "def decimal_binary(ni): # Function to convert decimal to binary\n", + " bini = 0;\n", + " i = 1;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/2)*2; \n", + " ni = int(ni/2);\n", + " bini = bini + rem*i;\n", + " i = i * 10;\n", + " return bini\n", + "\n", + "def decifrac_binfrac(nf): # Function to convert binary fraction to decimal fraction\n", + " binf = 0; i = 0.1;\n", + " while (nf != 0):\n", + " nf = nf*2;\n", + " rem = int(nf); \n", + " nf = nf-rem;\n", + " binf = binf + rem*i;\n", + " i = i/10;\n", + " return binf\n", + "\n", + "\n", + "\n", + "#Result\n", + "print \"Decimal equivalent of 34.6875 = %.4f\"%(decimal_binary(n_int)+decifrac_binfrac(n_frac))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.11, Page 177" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "W = 40979\n" + ] + } + ], + "source": [ + "#initialization\n", + "n='A013' #Hex number \n", + "\n", + "#Calculation\n", + "w=int(n, 16) #Hex to Decimal Coversion\n", + "\n", + "\n", + "#Result\n", + "print'W = %d'%w" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.12, Page 178" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The hexadecimal equivalent of 7046 is 0x1b86\n" + ] + } + ], + "source": [ + "\n", + "#Variable declaration\n", + "n=7046 #Hex number \n", + "\n", + "#Calculations\n", + "h = hex(n) #decimal to hex conversion\n", + "\n", + "#Result\n", + "print \"The hexadecimal equivalent of 7046 is\",h" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.13, Page 178" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Decimal equivalent of 34.6875 = 1111100001010001\n" + ] + } + ], + "source": [ + "#Initializaton\n", + "\n", + "n='f851' #Hex Number\n", + "\n", + "#Calculation\n", + "\n", + "w=int(n, 16) #Hex to Decimal Coversion\n", + "\n", + "def decimal_binary(ni): # Function to convert decimal to binary\n", + " bini = 0;\n", + " i = 1;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/2)*2; \n", + " ni = int(ni/2);\n", + " bini = bini + rem*i;\n", + " i = i * 10;\n", + " return bini\n", + "\n", + "\n", + "w1=decimal_binary(w) #calling the function\n", + "\n", + "\n", + "#Result\n", + "print \"Decimal equivalent of 34.6875 = %.d\"%(w1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.14, Page 179" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The hexadecimal equivalent of 111011011000100 is 0x76c4\n" + ] + } + ], + "source": [ + "#Initialiation\n", + "ni1=111011011000100 #binary number\n", + "\n", + "#Calculation\n", + "def binary_decimal(ni): # Function to convert binary to decimal\n", + " deci = 0;\n", + " i = 0;\n", + " while (ni != 0):\n", + " rem = ni-int(ni/10.)*10\n", + " ni = int(ni/10.);\n", + " deci = deci + rem*2**i;\n", + " i = i + 1;\n", + " return deci\n", + "\n", + "w=binary_decimal(ni1) #calling the function\n", + "h = hex(w) #decimal to hex conversion\n", + "\n", + "#Result\n", + "print \"The hexadecimal equivalent of 111011011000100 is\",h" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": false + }, + "source": [ + "## Example 9.15, Page 182" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Eqivalent BCD of 72 = 1001010001010000\n" + ] + } + ], + "source": [ + "#initialisation\n", + "x='9450' #decimal number to be convert\n", + "\n", + "#calculation\n", + "digits = [int(c) for c in x]\n", + "zero_padded_BCD_digits = [format(d, '04b') for d in digits]\n", + "\n", + "#results\n", + "print \"Eqivalent BCD of 72 = \",\n", + "print ''.join(zero_padded_BCD_digits)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.16, Page 182" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The equivalent decimal =3876.\n" + ] + } + ], + "source": [ + "\n", + "#Initialisation\n", + "BCD=\"0011 1000 0111 0110\" #Given BCD string\n", + "BCD_split=BCD.split(\" \"); #Splitting th binary string into individual BCD \n", + "d=0;\n", + "for i in range(len(BCD_split),0,-1):\n", + " d+=int(BCD_split[len(BCD_split)-i],2)*10**(i-1);\n", + "\n", + "#Result\n", + "print(\"The equivalent decimal = %d.\"%d);\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/cap1.png b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/cap1.png Binary files differnew file mode 100644 index 00000000..30eb3a12 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/cap1.png diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/cap1_v96t3WK.png b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/cap1_v96t3WK.png Binary files differnew file mode 100644 index 00000000..30eb3a12 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/cap1_v96t3WK.png diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/index.png b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/index.png Binary files differnew file mode 100644 index 00000000..1e4ff4d3 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/index.png diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/index2.png b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/index2.png Binary files differnew file mode 100644 index 00000000..8cdd1ca3 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/index2.png diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/index2_za7aGFC.png b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/index2_za7aGFC.png Binary files differnew file mode 100644 index 00000000..8cdd1ca3 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/index2_za7aGFC.png diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/index_Is0qqx4.png b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/index_Is0qqx4.png Binary files differnew file mode 100644 index 00000000..1e4ff4d3 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/index_Is0qqx4.png diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/pic1.png b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/pic1.png Binary files differnew file mode 100644 index 00000000..1e4ff4d3 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/pic1.png diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/pic2.png b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/pic2.png Binary files differnew file mode 100644 index 00000000..8cdd1ca3 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/pic2.png diff --git a/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/pic3.png b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/pic3.png Binary files differnew file mode 100644 index 00000000..30eb3a12 --- /dev/null +++ b/Electrical_and_Electronic_Systems_by_Neil_Storey/screenshots/pic3.png |