summaryrefslogtreecommitdiff
path: root/hw1
diff options
context:
space:
mode:
authorMarius Peter <blendoit@gmail.com>2019-07-03 22:10:22 -0700
committerMarius Peter <blendoit@gmail.com>2019-07-03 22:10:22 -0700
commit9060d5a3d1f4d247b376894dea64aa694d9e98a6 (patch)
treee136608e4495086ba55a4a6edd878710d53cd425 /hw1
parent22d52d09fcd15d38b47e795071a8ec4b4741e690 (diff)
homework submission
Diffstat (limited to 'hw1')
-rw-r--r--hw1/code_2.PNGbin0 -> 64908 bytes
-rw-r--r--hw1/code_5.PNGbin0 -> 27697 bytes
-rw-r--r--hw1/plot_2-a.pngbin0 -> 32735 bytes
-rw-r--r--hw1/plot_5.pngbin0 -> 22644 bytes
-rw-r--r--hw1/prob_2.py30
-rw-r--r--hw1/prob_5.py11
6 files changed, 41 insertions, 0 deletions
diff --git a/hw1/code_2.PNG b/hw1/code_2.PNG
new file mode 100644
index 0000000..a6a2dbf
--- /dev/null
+++ b/hw1/code_2.PNG
Binary files differ
diff --git a/hw1/code_5.PNG b/hw1/code_5.PNG
new file mode 100644
index 0000000..45dbd56
--- /dev/null
+++ b/hw1/code_5.PNG
Binary files differ
diff --git a/hw1/plot_2-a.png b/hw1/plot_2-a.png
new file mode 100644
index 0000000..c33d758
--- /dev/null
+++ b/hw1/plot_2-a.png
Binary files differ
diff --git a/hw1/plot_5.png b/hw1/plot_5.png
new file mode 100644
index 0000000..cacb3ab
--- /dev/null
+++ b/hw1/plot_5.png
Binary files differ
diff --git a/hw1/prob_2.py b/hw1/prob_2.py
new file mode 100644
index 0000000..20585c8
--- /dev/null
+++ b/hw1/prob_2.py
@@ -0,0 +1,30 @@
+import numpy as np
+import matplotlib.pyplot as plt
+from math import pi
+
+N = 300
+fr = np.logspace(-3, 3, N)
+w = 2 * pi * fr
+s = w * 1j
+
+R1 = 1e6
+R2 = 1e4
+C = 1.6e-6 / 2 / pi
+
+num = R1 * R2 * C * s + R2
+den = R1 * R2 * C * s + R1 + R2
+H = num / den
+
+plt.figure(1)
+plt.subplot(211)
+plt.loglog(fr, abs(H))
+plt.xlabel('Frequency (Hz)')
+plt.ylabel('Magnitude (V/V)')
+plt.title('R1 = 1MΩ, R2 = 1kΩ,C = 1.6μF, Rf = 100kΩ')
+
+plt.subplot(212)
+plt.semilogx(fr, np.angle(H) * 180 / pi)
+plt.xlabel('Frequency (Hz)')
+plt.ylabel('Phase (deg)')
+
+plt.show()
diff --git a/hw1/prob_5.py b/hw1/prob_5.py
new file mode 100644
index 0000000..c3aa6d4
--- /dev/null
+++ b/hw1/prob_5.py
@@ -0,0 +1,11 @@
+import numpy as np
+import matplotlib.pyplot as plt
+
+t = [0.01 * x for x in range(0, 1001)]
+y = [-(t + 1) * np.exp(-t) for t in t]
+
+plt.plot(t, y)
+plt.xlabel('t (sec)')
+plt.ylabel('y(t)')
+plt.title('MAE 171A - Homework 1.5\n Step Response')
+plt.show()
Copyright 2019--2024 Marius PETER