diff options
-rw-r--r-- | graph.py | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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() |