{ "metadata": { "Asif": "", "signature": "sha256:721a6a2445404e28ea958d05a879e1927a64948a8c3a5aa0f2d75d58bb60d3b3" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "#Example 4.2.1\n", "#given data :\n", "E_rms=230; #Voltage rms value in V\n", "Ep=2**(1/2)*E_rms; #peak amplitude\n", "#Result\n", "print\"peak amplitude,Ep(V) = \",Ep" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "peak amplitude,Ep(V) = 230\n" ] } ], "prompt_number": 5 }, { "cell_type": "code", "collapsed": false, "input": [ "#Example 4.12.1\n", "#given data :\n", "Rm=500; #in ohm\n", "E_rms=50; # in V\n", "E_dc=(2**(1/2)*E_rms)/(math.pi/2) # in V\n", "Im=1*10^-3; #in A\n", "R=E_dc/Im; #in ohm\n", "Rs=(Rm-R)*10**(-3);#in ohm\n", "#result\n", "print\"the resistance,Rs(kohm) = \",round(Rs,4)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the resistance,Rs(kohm) = 0.5035\n" ] } ], "prompt_number": 41 }, { "cell_type": "code", "collapsed": false, "input": [ "#Example 4.14.1\n", "ff1=1 #form factor\n", "r=1.11 #sine wave form factor\n", "error=((r-ff1)/ff1)*100 #percentage error\n", "#result\n", "print\"percentage error is\",error" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "percentage error is 11.0\n" ] } ], "prompt_number": 22 }, { "cell_type": "code", "collapsed": false, "input": [ "#Example 4.19.1\n", "#given data :\n", "gm=0.005 #iConductance in mho\n", "V1=1.5 #Voltage in V\n", "rd=200*10**3 #resistance in Ohm\n", "Rd=15*10**3 #resistance in Ohm\n", "Rm=75 #resistance in Ohm\n", "I=(gm*V1*((Rd*rd)/(rd+Rd)))/((2*((Rd*rd)/(rd+Rd)))+Rm)*10**3 #Current in mA\n", "#result\n", "print\"current,I(mA) = \",I" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "current,I(mA) = 3.73994853651\n" ] } ], "prompt_number": 30 }, { "cell_type": "code", "collapsed": false, "input": [ "#Example 4.19.3\n", "v1=100 # in volts\n", "v2=30 #in volts\n", "v3=103 # in volts\n", "v4=1 #in volts\n", "x=9 #assume input resistance in Mohm\n", "r4=(v4/v3)*x*10**3 #in kohms\n", "r3=(((v4/v1)*x*10**6)-(r4*10**3))*10**(-3) #in kohms\n", "r2=(((v4/v2)*x*10**6)-((r4+r3)*10**3))*10**(-3) # in kohms\n", "r1=9*10**6-((r2+r3+r4)*10**3) #in ohms\n", "r1=r1*10**(-6) # Mohm\n", "print\"resistance (R4) in kohm is\",r4\n", "print\"resistance (R3) in kohm is\",r3\n", "print\"resistance (R2) in kohm is\",r2\n", "print\"resistance (R1) in Mohm is\",r1" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "resistance (R4) in kohm is 0\n", "resistance (R3) in kohm is 0.0\n", "resistance (R2) in kohm is 0.0\n", "resistance (R1) in Mohm is 9.0\n" ] } ], "prompt_number": 34 }, { "cell_type": "code", "collapsed": false, "input": [ "#Example 4.19.4\n", "#given data :\n", "rd=150*10**3 #in ohm\n", "Rm=50 # in ohm\n", "Rs=1000*10**3 #in ohm\n", "gm=0.0052 #in mho\n", "rd1=rd/((gm*rd)+1)\n", "V0=gm*((rd1*Rs)/(rd1+Rs))\n", "R0=(2*Rs*rd1)/(Rs+rd1)\n", "I=V0/(R0+Rm)*10**3 #Current in mA\n", "print\"curent,I(mA) = \",round(I,4)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "curent,I(mA) = 2.3005\n" ] } ], "prompt_number": 38 }, { "cell_type": "code", "collapsed": false, "input": [ "#Example 4.19.5\n", "#given data :\n", "V1=1 #in V\n", "I=1.5*10**-3 #in A\n", "rd=200*10^3 # in ohm\n", "Rm=50 # in ohm\n", "Rs=600*10**3 # in ohm\n", "gm=0.005 #in mho\n", "rd1=rd/((gm*rd)+1)\n", "V0=gm*((rd1*Rs)/(rd1+Rs))*V1\n", "R0=(2*Rs*rd1)/(Rs+rd1)\n", "R_cal=(V0/I)-Rm-R0;\n", "print\"resistance ,R_cal(ohm) = \",round(R_cal,4)\n", "# answer is wrong in the textbook" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "resistance ,R_cal(ohm) = 192.3838\n" ] } ], "prompt_number": 40 } ], "metadata": {} } ] }