summaryrefslogtreecommitdiff
path: root/Basic_Electronics_and_Linear_Circuits/ch2.ipynb
blob: ea7aa645cf5feb5edbcda848eff55167d3d39e2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
{
 "metadata": {
  "name": "ch2"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2:Current and Voltage Source"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.1 Page no.39"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 2.1\n",
      "# Obtain Equivalent Current Source Representaion from Given Voltage Source Representation in fig 2.16\n",
      "\n",
      "#Voltage Source or Thevenin's Representaion (Series Voltage Source & Resistor\n",
      "Vs=2           #V open circuit voltage\n",
      "Rs=1           #ohm . internal impedence\n",
      "#Current Source or Norton's Representaion (Parallel Current Source & Resistor\n",
      "Is=Vs/Rs    #Ampere, short circuit current\n",
      "#result\n",
      "print \"The Short Circuit Current Value is  \",Is,\"A\"\n",
      "print \"The Source Impedence Value is \",Rs,\"ohm\"\n",
      "print \"The Current Source & Source Impedance are connected in Parallel.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.2 Page no.40"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 2.2\n",
      "# Obtain Equivalent Voltage Source Representaion from Given Current Source Representation\n",
      "\n",
      "#Current Source or Norton's Representaion (Parallel Current Source & Resistor)\n",
      "Is=0.2          #Amperes\n",
      "Zs=100       #Ohms\n",
      "#Voltage Source or Thevenin's Representaion (Series Voltage Source & Resistor)\n",
      "Vs=Is*Zs   #Volts\n",
      "# Results \n",
      "print \"The Open Circuit Voltage is  \",Vs,\"V\"\n",
      "print \"The Source Impedence Value is  \",Zs,\"ohm\"\n",
      "print \"The Voltage Source & Source Impedance are connected in Series.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.3 Page no.40"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 2.3\n",
      "#Program to Calculate Current in a Branch by Using Current Source Representation \n",
      "#Verify the Circuit's Result for its equivalence with Voltage Source Representation\n",
      "\n",
      "#Given Circuit Data\n",
      "Is=1.5*10**(-3)       #Amperes ,source current\n",
      "Zs=2000            #Ohms, resistance connected to the loads\n",
      "Z1=10000          #Ohms , load resistance 1\n",
      "Z2=40000          #Ohms  load resistance 2\n",
      "#Calculation for Current Source Representation\n",
      "Zl=Z1*Z2/(Z1+Z2)\n",
      "I2=Is*Zs/(Zs+Zl)\n",
      "I4I=I2*Z1/(Z1+Z2)     #Using Current Divider Rule\n",
      "\n",
      "#Calculation for Current Source Representation\n",
      "Vs=Is*Zs                    #Open Circuit Volatge\n",
      "I=Vs/(Zs+Zl)\n",
      "I4V=I*Z1/(Z1+Z2)    #Using Current Divider Rule\n",
      "# Results \n",
      "print \"The Load Current using Current Source Representaion is I4I =  \",I4I,\"A\"\n",
      "print \"The Load Current using Voltage Source Representaion is I4V =  \",I4V,\"A\"\n",
      "print \"I4I==I4V so\"\n",
      "print \" Both Results are same.\"\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 2.4 Page no.45"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 2.4\n",
      "# Obtain Output Voltage Vo from Given A.C. Equivalent of an Amplifier using a Transistor\n",
      "\n",
      "#Given Circuit Data\n",
      "#Input Side\n",
      "Vs=0.01              #V ,dc voltage\n",
      "Rs=1000            # ohm, resistance\n",
      "#Output Side resistance\n",
      "Ro1=20000       #ohm, 20 kOhms\n",
      "Ro2=2000         # Ohms\n",
      "\n",
      "#Calculation\n",
      "i=Vs/Rs          #Input Current\n",
      "Io=100*i       #Output Current\n",
      "Il=Io*Ro1/(Ro1+Ro2)  #Using Current Divider Rule\n",
      "Vo=Il*Ro2                     #Output Volatge\n",
      "\n",
      "# Result\n",
      "print \"The Output Voltage Vo =  \",round(Vo,3),\"V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}