From 928af7d1bf9c74356f00d1ce3e7ac2cc0905ca89 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Fri, 17 Apr 2020 21:14:25 -0400 Subject: included graph --- graph.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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() -- cgit