From f6d1e27f8088321749ef98c6226d5f0c3df28043 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Thu, 21 Apr 2022 10:14:22 +0200 Subject: [PATCH] Stuff --- mas/shrodequ_superpos/main.py | 41 +++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/mas/shrodequ_superpos/main.py b/mas/shrodequ_superpos/main.py index 7bbb0fe..01c5e58 100755 --- a/mas/shrodequ_superpos/main.py +++ b/mas/shrodequ_superpos/main.py @@ -1,5 +1,7 @@ #!/usr/bin/python3 import matplotlib.pyplot as plt +from matplotlib.widgets import Slider, Button + import numpy as np from phys import * from scipy.constants import electron_mass @@ -9,18 +11,33 @@ system = infbox(0.001) # box with inf walls p1 = particle(electron_mass, system, 1) p2 = particle(electron_mass, system, 2) +t = 0.2 # s x = np.arange(0, BOX_LENGTH, 0.00001) -t = np.arange(0, 1, 0.01) -X, T = np.meshgrid(x, t) -P = system.plot_superpos(x, t) - -fig = plt.figure() -ax = plt.axes(projection='3d') -ax.plot_surface(X, T, P, rstride=1, cstride=1, cmap='viridis', edgecolor='none') -ax.set_xlabel('x [m]') -ax.set_ylabel('time [s]') -ax.set_zlabel('probability [frac]'); - -plt.show() +# # Time slider +# axfreq = plt.axes([0.25, 0.1, 0.65, 0.03]) +# freq_slider = Slider( +# ax=axfreq, +# label='Time [ms]', +# valmin=0, +# valmax=10, +# valinit=0, +# ) +# +# x = np.arange(0, BOX_LENGTH, 0.00001) +# t = np.arange(0, 1, 0.01) +# X, T = np.meshgrid(x, t) +# P = system.plot_superpos(x, t) +# +# +# fig = plt.figure() +# ax = plt.axes(projection='3d') +# ax.plot_surface(X, T, P, rstride=1, cstride=1, cmap='viridis', edgecolor='none') +# ax.set_xlabel('x [m]') +# ax.set_ylabel('time [s]') +# ax.set_zlabel('probability [frac]'); +# +# plt.show() +# +#