summaryrefslogtreecommitdiff
path: root/Electronics_Circuits_and_Systems_by_Y._N._Bapat/Ch13.ipynb
blob: 4b40a3f32571b77f7b9f11d5827c479056ec6625 (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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 13 - Non-linear Analog Systems"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 13_1 Page No. 395"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "VT= 0.03  volts\n",
      "R1= 5000.00  ohm\n",
      " Iso = 1.00e-10  ampere\n",
      "part(i)\n",
      "vs= 1.00e-03  volts\n",
      "vo=-VT*(log(vs/(Iso*R1)))= -0.20  volts\n",
      "part(ii)\n",
      "vs= 1.00e-02  volts\n",
      "vo=-VT*(log(vs/(Iso*R1)))= -0.26  volts\n",
      "part(iii)\n",
      "vs= 0.10  volts\n",
      "vo=-VT*(log(vs/(Iso*R1)))= -0.32  volts\n",
      "part(iv)\n",
      "vs= 1.00  volts\n",
      "vo=-VT*(log(vs/(Iso*R1)))= -0.38  volts\n"
     ]
    }
   ],
   "source": [
    "from math import log\n",
    "from __future__ import division  \n",
    "VT=26*10**(-3)\n",
    "print \"VT= %0.2f\"%(VT),\" volts\" # Thermal voltage \n",
    "R1=5*10**(3)\n",
    "print \"R1= %0.2f\"%(R1),\" ohm\"  # resistance\n",
    "Iso=1*10**(-10)\n",
    "print \" Iso = %0.2e\"%(Iso),\" ampere\" # Scale factor (as current)directly proportional to cross-section area of EBJ \n",
    "\n",
    "print \"part(i)\"\n",
    "vs=1*10**(-3)\n",
    "print \"vs= %0.2e\"%(vs),\" volts\" # Input voltage1\n",
    "vo=-VT*(log(vs/(Iso*R1)))\n",
    "print \"vo=-VT*(log(vs/(Iso*R1)))= %0.2f\"%(vo),\" volts\" # Output voltage of Log OP-AMP for input1 i.e vs = 1 mV\n",
    "\n",
    "print \"part(ii)\"\n",
    "vs=10*10**(-3)\n",
    "print \"vs= %0.2e\"%(vs),\" volts\" # Input voltage2\n",
    "vo=-VT*(log(vs/(Iso*R1)))\n",
    "print \"vo=-VT*(log(vs/(Iso*R1)))= %0.2f\"%(vo),\" volts\" # Output voltage of Log OP-AMP for input1 i.e vs = 10 mV\n",
    "\n",
    "print \"part(iii)\"\n",
    "vs=100*10**(-3)\n",
    "print \"vs= %0.2f\"%(vs),\" volts\" # Input voltage3\n",
    "vo=-VT*(log(vs/(Iso*R1)))\n",
    "print \"vo=-VT*(log(vs/(Iso*R1)))= %0.2f\"%(vo),\" volts\" # Output voltage of Log OP-AMP for input1 i.e vs = 100 mV\n",
    "\n",
    "print \"part(iv)\"\n",
    "vs=1\n",
    "print \"vs= %0.2f\"%(vs),\" volts\" # Input voltage4\n",
    "vo=-VT*(log(vs/(Iso*R1)))\n",
    "print \"vo=-VT*(log(vs/(Iso*R1)))= %0.2f\"%(vo),\" volts\" # Output voltage of Log OP-AMP for input1 i.e vs = 1V"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 13_2 Page No. 396"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "VT= 0.03  volts\n",
      "R1= 100000.00  ohm\n",
      " Iso = 5.00e-08  ampere\n",
      "vs= 2.50  volts\n",
      "vo=-VT*(log(vs/(Iso*R1)))= -0.16  volts\n"
     ]
    }
   ],
   "source": [
    "from math import log\n",
    "from __future__ import division  \n",
    "VT=26*10**(-3)\n",
    "print \"VT= %0.2f\"%(VT),\" volts\" # Thermal voltage \n",
    "R1=100*10**(3)\n",
    "print \"R1= %0.2f\"%(R1),\" ohm\"  # resistance\n",
    "Iso=50*10**(-9)\n",
    "print \" Iso = %0.2e\"%(Iso),\" ampere\" # Scale factor (as current)directly proportional to cross-section area of EBJ \n",
    "vs=2.5\n",
    "print \"vs= %0.2f\"%(vs),\" volts\" # Input voltage\n",
    "vo=-VT*(log(vs/(Iso*R1)))\n",
    "print \"vo=-VT*(log(vs/(Iso*R1)))= %0.2f\"%(vo),\" volts\" # Output voltage of Log OP-AMP for input1 i.e vs = 2.5 V"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 13_3 Page No. 397"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "VT= 0.03  volts\n",
      "RF= 1.00e+05  ohm\n",
      " Iso = 5.00e-08  ampere\n",
      "vs= -0.16  volts\n",
      "vo=Iso*RF*(exp(-vs/VT))= 2.54  volts\n"
     ]
    }
   ],
   "source": [
    "from math import exp\n",
    "from __future__ import division  \n",
    "VT=26*10**(-3)\n",
    "print \"VT= %0.2f\"%(VT),\" volts\" # Thermal voltage \n",
    "RF=100*10**(3)\n",
    "print \"RF= %0.2e\"%(RF),\" ohm\"  # resistance\n",
    "Iso=50*10**(-9)\n",
    "print \" Iso = %0.2e\"%(Iso),\" ampere\" # Scale factor (as current)directly proportional to cross-section area of EBJ \n",
    "vs=-0.162\n",
    "print \"vs= %0.2f\"%(vs),\" volts\" # Input voltage\n",
    "vo=Iso*RF*(exp(-vs/VT))\n",
    "print \"vo=Iso*RF*(exp(-vs/VT))= %0.2f\"%(vo),\" volts\" # Output voltage of Antilog OP-AMP for input1 i.e vs = -0.162 V"
   ]
  }
 ],
 "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.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}