summaryrefslogtreecommitdiff
path: root/sample_notebooks/DeepTrambadia/sc201.ipynb
diff options
context:
space:
mode:
authorThomas Stephen Lee2015-08-28 16:53:23 +0530
committerThomas Stephen Lee2015-08-28 16:53:23 +0530
commitdb0855dbeb41ecb8a51dde8587d43e5d7e83620f (patch)
treeb95975d958cba9af36cb1680e3f77205354f6512 /sample_notebooks/DeepTrambadia/sc201.ipynb
parent5a86a20b9de487553d4ef88719fb0fd76a5dd6a7 (diff)
downloadPython-Textbook-Companions-db0855dbeb41ecb8a51dde8587d43e5d7e83620f.tar.gz
Python-Textbook-Companions-db0855dbeb41ecb8a51dde8587d43e5d7e83620f.tar.bz2
Python-Textbook-Companions-db0855dbeb41ecb8a51dde8587d43e5d7e83620f.zip
add books
Diffstat (limited to 'sample_notebooks/DeepTrambadia/sc201.ipynb')
-rw-r--r--sample_notebooks/DeepTrambadia/sc201.ipynb53
1 files changed, 53 insertions, 0 deletions
diff --git a/sample_notebooks/DeepTrambadia/sc201.ipynb b/sample_notebooks/DeepTrambadia/sc201.ipynb
new file mode 100644
index 00000000..b76b0ff0
--- /dev/null
+++ b/sample_notebooks/DeepTrambadia/sc201.ipynb
@@ -0,0 +1,53 @@
+import math
+
+#(a)
+#initialisation of variables
+
+E=10 #E in V
+R=1 #R in Kohm
+
+
+#Calculations
+
+Id=E/R #Eq.(2.2)
+Vd=E
+print "The current Ic is= %fmA "%(Id),";Vd=0V"
+print "The diode voltage is= %fV"%(Vd),";Id=0A"
+print "The resulting load line appears in Fig. 2.4. The intersection between the load line and the characteristic curve defines the Q-point as"
+print "The level of VD is certainly an estimate, and the accuracy of ID is limited by the chosenscale. A higher degree of accuracy would require a plot that would be much large and perhaps unwieldy"
+
+
+#(B)
+print "(B)"
+Ir=9.25 #Ir in mA
+Vdq=0.78 #Vdq in v
+Vr=Ir*R
+print "Vr = Ir*R = Idq*R %d="%(Vr),"or"
+Vr = E-Vdq
+print "Vr = E-Vdq = %f" %(Vr)
+print "The difference in results is due to the accuracy with which the graph can be read. Ideally,the results obtained either way should be the same."
+
+#Graph solution to example 2.1
+
+import numpy as np
+import matplotlib.pyplot as plt
+
+Vd = np.linspace(0.0,10.0)
+Id = np.linspace(0.0,10.0)
+Id= -Vd + 10
+plt.plot(Vd, Id)
+Vd = [0,0,0.1,0.1,0.2,0.2,0.3,0.3,0.3,0.3,0.4,0.5,0.6,0.7]
+Id = [0,0,0,0,0,0,0,0,0.1,0.1,0.3,0.7,2.0,10.0]
+
+plt.plot(Vd, Id,'yo-')
+
+plt.xlabel('Voltage (v)')
+plt.ylabel('current (mA)')
+plt.title('About as simple as it gets, folks')
+plt.grid(True)
+plt.savefig("test.png")
+
+plt.show()
+
+print "example 2.2:"
+print "repeat the example 2.1 for R =2" \ No newline at end of file