summaryrefslogtreecommitdiff
path: root/sample_notebooks/SumadhuriDamerla/Chapter_1_Passive.ipynb
diff options
context:
space:
mode:
authorkinitrupti2017-05-12 18:53:46 +0530
committerkinitrupti2017-05-12 18:53:46 +0530
commit6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d (patch)
tree22789c9dbe468dae6697dcd12d8e97de4bcf94a2 /sample_notebooks/SumadhuriDamerla/Chapter_1_Passive.ipynb
parentd36fc3b8f88cc3108ffff6151e376b619b9abb01 (diff)
downloadPython-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.tar.gz
Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.tar.bz2
Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.zip
Removed duplicates
Diffstat (limited to 'sample_notebooks/SumadhuriDamerla/Chapter_1_Passive.ipynb')
-rwxr-xr-xsample_notebooks/SumadhuriDamerla/Chapter_1_Passive.ipynb370
1 files changed, 0 insertions, 370 deletions
diff --git a/sample_notebooks/SumadhuriDamerla/Chapter_1_Passive.ipynb b/sample_notebooks/SumadhuriDamerla/Chapter_1_Passive.ipynb
deleted file mode 100755
index 916e874c..00000000
--- a/sample_notebooks/SumadhuriDamerla/Chapter_1_Passive.ipynb
+++ /dev/null
@@ -1,370 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Chapter 1 Passive Circuits"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Example 1.2.2, Pg.no.5"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "metadata": {
- "collapsed": false
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "The value of resistance R is 16.61 ohm\n",
- "The value of resistance R3 is 66.82 ohm\n"
- ]
- }
- ],
- "source": [
- "import math\n",
- "#given\n",
- "Ro=50.0\n",
- "ILdB=6.0 #T−type attenuator provide 6−dB insertion loss \n",
- "#calculation\n",
- "IL=10**-(ILdB/20) #Determination of R\n",
- "R=Ro*(1-IL)/(1+IL)\n",
- "R=round(R,2)\n",
- "print 'The value of resistance R is',R,'ohm' \n",
- "#Determination of R3\n",
- "R3=(2*Ro*IL)/(1-(0.5)**2)\n",
- "R3=round(R3,2)\n",
- "print 'The value of resistance R3 is',R3,'ohm'"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Example 1.2.3,Pg.no.7"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 5,
- "metadata": {
- "collapsed": false
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "The value of resistance RA and RB is 150.5 ohm\n",
- "The value of resistance RC is 37.35 ohm\n"
- ]
- }
- ],
- "source": [
- "import math\n",
- "#given\n",
- "Ro=50.0\n",
- "ILdB=6.0\n",
- "IL=10**-(ILdB/20) #Determination of RA and RB\n",
- "RA=Ro*(1+IL)/(1-IL)\n",
- "RA=round(RA,1)\n",
- "print 'The value of resistance RA and RB is',RA,'ohm'\n",
- "#Determination of RC\n",
- "RC=Ro*(1-(IL)**2)/(2*IL)\n",
- "RC=round(RC,2)\n",
- "print 'The value of resistance RC is',RC,'ohm'"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Example 1.2.4,Pg.no.9"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 7,
- "metadata": {
- "collapsed": false
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "The value of resistance R1 is 1.0 ohm\n",
- "The value of resistance R3 is 5624.0 ohm\n",
- "The value of insertion loss is 0.12 decibels\n"
- ]
- }
- ],
- "source": [
- "import math\n",
- "from math import log10\n",
- "#given\n",
- "Rs=75.0 #resistance\n",
- "Rl=50.0 \n",
- "#Determination of R1\n",
- "R1=(Rs*(Rs-Rl))**(1/2)\n",
- "R1=round(R1,2)\n",
- "print 'The value of resistance R1 is',R1,'ohm'\n",
- "#Determination of R3\n",
- "R3=((Rs**2)-(R1**2))/R1\n",
- "R3=round(R3,2)\n",
- "print 'The value of resistance R3 is',R3,'ohm'\n",
- "#Determination of insertion loss\n",
- "IL=(R3*(Rs+R1))/((Rs+R1+R3)*(R3+R1)-(R3)**2)\n",
- "ILdB=-20*log10(IL) #convertion of power in decibels\n",
- "ILdB=round(ILdB,2)\n",
- "print 'The value of insertion loss is',ILdB,'decibels'"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Example 1.2.5,Pg.no.10"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 8,
- "metadata": {
- "collapsed": false
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "The value of resistance R2 is 1.0 ohm\n",
- "The value of resistance R3 is 2499.0 ohm\n",
- "The value of insertion loss is 0.2 decibels\n"
- ]
- }
- ],
- "source": [
- "from math import log10\n",
- "Rs=10.0\n",
- "Rl=50.0 #Determination of R2\n",
- "R2=(Rl*(Rl-Rs))**(1/2)\n",
- "R2=round(R2,2)\n",
- "print 'The value of resistance R2 is',R2,'ohm'\n",
- "#Determination of R3\n",
- "R3=((Rl**2)-(R2**2))/R2\n",
- "R3=round(R3,2)\n",
- "print 'The value of resistance R3 is',R3,'ohm'\n",
- "#Determination of insertion loss\n",
- "IL=(R3*(Rs+Rl))/((Rs+R3)*(R3+R2+Rl)-(R3)**2)\n",
- "ILdB=-20*log10(IL) #convertion of power in decibels\n",
- "ILdB=round(ILdB,1)\n",
- "print 'The value of insertion loss is',ILdB,'decibels'"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Example 1.5.1,Pg.no.21"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 13,
- "metadata": {
- "collapsed": false
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "The value of self resonant freq is 60.2 MHz\n",
- "The value of Q−factor is 31.4\n",
- "The value of effective inductance is -5.79846400003e-12 uH\n",
- "The value of effective Q−factor is -5.41522720497e+12\n"
- ]
- }
- ],
- "source": [
- "import math\n",
- "C=7*10**-12\n",
- "R=5.0\n",
- "L=10**-6\n",
- "f=25*10**6 \n",
- "#Determination of self resonant freq of coil denoted as Fsr\n",
- "Fsr=1/(2*3.14*(L*C)**0.5)\n",
- "Fsr=Fsr/(10**6)\n",
- "Fsr=round(Fsr,1)\n",
- "print 'The value of self resonant freq is',Fsr,'MHz'\n",
- "#Determination of Q−factor of coil , excluding self − capacitive effects\n",
- "Q=(2*3.14*f*L)/R\n",
- "print 'The value of Q−factor is',Q\n",
- "#Determination of effective inductance\n",
- "Leff=L/(1-(f/Fsr)**2)\n",
- "Leff=Leff*(10**6)\n",
- "#Leff=round(Leff,0)\n",
- "print 'The value of effective inductance is',Leff,'uH'\n",
- "#Determination of effective Q−factor\n",
- "Qeff=Q*(1-(f/Fsr)**2)\n",
- "Qeff=round(Qeff,0)\n",
- "print 'The value of effective Q−factor is',Qeff"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Example 1.8.1,Pg.no.26"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 8,
- "metadata": {
- "collapsed": false
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "The value of common resonant freq is 1e-06 Mrad/sec\n",
- "The transfer impedance is -6.83732235918e-05 ohm\n"
- ]
- }
- ],
- "source": [
- "import cmath\n",
- "#given\n",
- "Lp=150*10**-6 #inductance\n",
- "Ls=150*10**-6\n",
- "Cp=470*10**-12 #capacitance\n",
- "Cs=470*10**-12 #Lp=Ls=150 uH,Cp=Cs=470 pF\n",
- "Q=85.0 #Q−factor for each ckt is 85\n",
- "c=0.01 #Coeff of coupling is 0.01\n",
- "Rl=5000.0 #Load resistance Rl=5000 ohm\n",
- "r=75000.0 #Constant current source with internal resistance r=75 kohm\n",
- "#calculations\n",
- "#Determination of common resonant frequency\n",
- "wo=1/((Lp*Cp)**(1/2))\n",
- "wo=wo/(10**6)\n",
- "print 'The value of common resonant freq is',wo,'Mrad/sec'\n",
- "p=3.77*10**6\n",
- "Z2=complex(62.9004,557.266) #Formula=Rl/(1+(p*j*Cs*Rl))\n",
- "Z1=complex(4.2465,564.33) #Formula=r/(1+(p*j*Cp*r)) ;At resonance Zs=Zp=Z\n",
- "z=complex(0,1)\n",
- "Z=wo*Ls*(1/Q +z)\n",
- "Zm=complex(0,p*c*Lp) #Determination of denominator\n",
- "Dr=((Z+Z1)*(Z+Z2))-(Zm**2) \n",
- "#Hence transfer impedance is given as\n",
- "Zr= (Z1*Z2*Zm)/Dr\n",
- "Z=Zr.real\n",
- "#Z=round(Z,2)\n",
- "#Zr.imag=round(Zr.imag,2)\n",
- "print 'The transfer impedance is',Z,'ohm'"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Example 1.10.1,Pg.no.34"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 10,
- "metadata": {
- "collapsed": false
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "The value of common resonant freq is 169.56 Mrad/ sec\n",
- "The value of Gl is 5.0 mSec\n",
- "The value of alpha is 3.14\n",
- "The value of effective load is 1.97 kohm\n",
- "The value of tuning capacitance is 47.73 pF\n",
- "The value of Rd is 1.85343097504e-05 kohm\n",
- "The value of −3dB BW is 1.69 MHz\n"
- ]
- }
- ],
- "source": [
- "import math\n",
- "C1=70*10**-12\n",
- "C2=150*10**-12\n",
- "Rl=200.0\n",
- "Q=150.0\n",
- "f=27*10**6\n",
- "r=40000.0\n",
- "#Determination of common resonant freq\n",
- "wo=2*3.14*f\n",
- "wo=wo/(10**6)\n",
- "print 'The value of common resonant freq is',wo,'Mrad/ sec'\n",
- "#Determination of Gl\n",
- "Gl=1/Rl\n",
- "G1=Gl*(10**3) \n",
- "print'The value of Gl is',G1,'mSec'\n",
- "#Checking the approxiamtion in denominator\n",
- "ap=((wo*(C1+C2))/(Gl))**2\n",
- "alpha=(C1+C2)/C1\n",
- "alpha=round(alpha,2)\n",
- "print 'The value of alpha is',alpha\n",
- "#Determination of effective load\n",
- "Reff=((alpha)**2)*Rl\n",
- "Reff=Reff/(10**3)\n",
- "Reff=round(Reff,2)\n",
- "print 'The value of effective load is',Reff,'kohm' \n",
- "#If effective load is much less than internal resistance hence tuning capacitance then\n",
- "Cs=C1*C2/(C1+C2)\n",
- "Cs=Cs*(10**12)\n",
- "Cs=round(Cs,2)\n",
- "print 'The value of tuning capacitance is',Cs,'pF'\n",
- "#Determination of Rd\n",
- "Rd=Q/(wo*Cs)\n",
- "Rd=Rd/(10**3)\n",
- "print 'The value of Rd is',Rd,'kohm'\n",
- "#If Rd is much greater than Reff then −3dB bandwidth is given by\n",
- "B=1/(2*3.14*C2*alpha*Rl)\n",
- "B=B/(10**6)\n",
- "B=round(B,2)\n",
- "print 'The value of −3dB BW is',B,'MHz'"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 2",
- "language": "python",
- "name": "python2"
- },
- "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.10"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 0
-}