summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Peter <blendoit@gmail.com>2019-07-11 17:14:32 -0700
committerMarius Peter <blendoit@gmail.com>2019-07-11 17:14:32 -0700
commitfeaa9144eb28dd263ef79577ab369174b8c6c83b (patch)
tree23b736616707789752b9d243f800901432325e31
parente01b5ffedbc57671e5b7f2e900276ffd14882a88 (diff)
the typa guy to flex: "new plots"
-rw-r--r--hw2/code_1-2.PNGbin0 -> 8470 bytes
-rw-r--r--hw2/code_1.PNGbin0 -> 11541 bytes
-rw-r--r--hw2/code_6.PNGbin0 -> 2451 bytes
-rw-r--r--hw2/plot_1-2.PNGbin0 -> 44970 bytes
-rw-r--r--hw2/plot_1.pngbin0 -> 23568 bytes
-rw-r--r--hw2/plot_6-2.PNGbin0 -> 40909 bytes
-rw-r--r--hw2/plot_6-3.PNGbin0 -> 47152 bytes
-rw-r--r--hw2/plot_6.PNGbin0 -> 44074 bytes
-rw-r--r--hw2/prob_1.py22
-rw-r--r--hw2/prob_5.py5
-rw-r--r--hw2/prob_6.m.txt4
11 files changed, 29 insertions, 2 deletions
diff --git a/hw2/code_1-2.PNG b/hw2/code_1-2.PNG
new file mode 100644
index 0000000..17cb63e
--- /dev/null
+++ b/hw2/code_1-2.PNG
Binary files differ
diff --git a/hw2/code_1.PNG b/hw2/code_1.PNG
new file mode 100644
index 0000000..bfaa2da
--- /dev/null
+++ b/hw2/code_1.PNG
Binary files differ
diff --git a/hw2/code_6.PNG b/hw2/code_6.PNG
new file mode 100644
index 0000000..90b981a
--- /dev/null
+++ b/hw2/code_6.PNG
Binary files differ
diff --git a/hw2/plot_1-2.PNG b/hw2/plot_1-2.PNG
new file mode 100644
index 0000000..733882b
--- /dev/null
+++ b/hw2/plot_1-2.PNG
Binary files differ
diff --git a/hw2/plot_1.png b/hw2/plot_1.png
new file mode 100644
index 0000000..7915b94
--- /dev/null
+++ b/hw2/plot_1.png
Binary files differ
diff --git a/hw2/plot_6-2.PNG b/hw2/plot_6-2.PNG
new file mode 100644
index 0000000..f725283
--- /dev/null
+++ b/hw2/plot_6-2.PNG
Binary files differ
diff --git a/hw2/plot_6-3.PNG b/hw2/plot_6-3.PNG
new file mode 100644
index 0000000..7bb658e
--- /dev/null
+++ b/hw2/plot_6-3.PNG
Binary files differ
diff --git a/hw2/plot_6.PNG b/hw2/plot_6.PNG
new file mode 100644
index 0000000..e1b63be
--- /dev/null
+++ b/hw2/plot_6.PNG
Binary files differ
diff --git a/hw2/prob_1.py b/hw2/prob_1.py
index 615d855..e26a5fc 100644
--- a/hw2/prob_1.py
+++ b/hw2/prob_1.py
@@ -1,13 +1,31 @@
import numpy as np
import matplotlib.pyplot as plt
+from scipy import signal
t = [0.001 * x for x in range(0, 141)]
y = [0.873
- 0.873 * np.exp(-46 * t) * np.cos(105.4 * t)
- 0.381 * np.exp(-46 * t) * np.sin(105.4 * t) for t in t]
+# plt.plot(t, y)
+# plt.xlabel('t (sec)')
+# plt.ylabel('y(t)')
+# plt.title('MAE 171A - Homework 2.1\n Output y(t)')
+# plt.show()
+
+# numH = []
+# denH =
+# sysH = signal.TransferFunction(numH, denH)
+# impulse = signal.impulse(sysH)
+
+system = ([11550], [1, 92, 13225, 0])
+t, y = signal.impulse2(system)
plt.plot(t, y)
+
+# y_s = [11550 / (t * (t**2 + 92 * t + 13225)) for t in t]
+
+# plt.plot(impulse)
plt.xlabel('t (sec)')
-plt.ylabel('y(t)')
-plt.title('MAE 171A - Homework 2.1\n Output y(t)')
+plt.ylabel('Amplitude')
+plt.title('MAE 171A - Homework 2.1\n Impulse Response')
plt.show()
diff --git a/hw2/prob_5.py b/hw2/prob_5.py
new file mode 100644
index 0000000..98d74f4
--- /dev/null
+++ b/hw2/prob_5.py
@@ -0,0 +1,5 @@
+import numpy as np
+
+p = [1, 2, 3, 8, 8]
+r = np.roots(p)
+print(np.around(r, 2))
diff --git a/hw2/prob_6.m.txt b/hw2/prob_6.m.txt
new file mode 100644
index 0000000..01262f8
--- /dev/null
+++ b/hw2/prob_6.m.txt
@@ -0,0 +1,4 @@
+N=1;K=0;
+D=[1 5 10 10 5 K];
+sys=tf(N,D);
+pzplot(sys) \ No newline at end of file
Copyright 2019--2024 Marius PETER