summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-04-17 21:14:25 -0400
committerHolden Rohrer <hr@hrhr.dev>2020-04-17 21:14:25 -0400
commit928af7d1bf9c74356f00d1ce3e7ac2cc0905ca89 (patch)
tree64dcb753e0dc76eb72a31114536f3c3aa5f8da74
parent1189da26ec62633529c509f0be9ea5d660561cff (diff)
included graph
-rw-r--r--graph.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/graph.py b/graph.py
index ada7092..8b66af7 100644
--- a/graph.py
+++ b/graph.py
@@ -1,5 +1,9 @@
#!/usr/bin/env python
+import matplotlib.pyplot as plt
+import tkinter
+from math import sin,cos,e
+
w = 100 # May vary
c1 = 2.5*10**(-6)
c2 = 1*10**(-6)
@@ -31,4 +35,16 @@ reE = F.real
imr1 = r2.imag
imE = F.imag # switched because positive ones were needed
-print("%.2E * sin(theta) + %.2E * cos(theta) + 2e^(%.2f t) (%.2E cos(%.2f t) - %.2E sin(%.2f t))" % (G, B, rer1, reE, imr1, imE, imr1))
+print("%.2E * sin(t) + %.2E * cos(t) + 2e^(%.2f t) (%.2E cos(%.2f t) - %.2E sin(%.2f t))" % (G, B, rer1, reE, imr1, imE, imr1))
+
+def f(x):
+ return G*sin(x) + B*cos(x) + 2*e**(rer1 * x) * (reE * cos(imr1 * x) - imE * sin(imr1 * x))
+
+x = []
+y = []
+for i in range(0, 1000):
+ x.append(i/100)
+ y.append(f(i/100))
+
+plt.plot(x,y)
+plt.show()