File:Gaussian wavepacket p0=1.webm
Original file (WebM audio/video file, VP9, length 10 s, 1,560 × 1,560 pixels, 510 kbps overall, file size: 633 KB)
Captions
Summary
[edit]DescriptionGaussian wavepacket p0=1.webm |
English: ```python
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D
a = 1.0 hbar = 1.0 m = 1.0 p0 = 1.0 xmax = 10 ymax = 0.8 zmax = ymax x = np.linspace(-xmax,xmax, 400) def psi(x, t): r = x denominator = a + 1j * hbar * t / m psi_val = (a / denominator)**(3/2) * np.exp(-r**2 / (2 * denominator)) * np.exp(1j * r * p0) return psi_val tmax = 10 frames_per_t = 12 t_values = np.linspace(-tmax, tmax, frames_per_t * (tmax * 2)) import os movie_name = "gaussian_wavepacket" dir_path = f"./{movie_name}" for N, t in enumerate(t_values): fig = plt.figure(figsize=(20, 20)) ax = fig.add_subplot(111, projection='3d') # ax.set_axis_off() Z = psi(x, t) ax.plot(x, Z.real, Z.imag, label=f't = {t}', linewidth=4) ax.set_xlim(-xmax, xmax) ax.set_ylim(-ymax, ymax) ax.set_zlim(-zmax, zmax) if not os.path.exists(dir_path): os.makedirs(dir_path) plt.savefig(f"{dir_path}/{N:03d}.png",bbox_inches='tight') plt.close() import imageio.v3 as iio from natsort import natsorted import moviepy.editor as mp for dir_path in [dir_path]: file_names = natsorted((fn for fn in os.listdir(dir_path) if fn.endswith('.png'))) # Create a list of image files and set the frame rate images = [] fps = 24 # Iterate over the file names and append the images to the list for file_name in file_names: file_path = os.path.join(dir_path, file_name) images.append(iio.imread(file_path)) filename = dir_path[2:] clip = mp.ImageSequenceClip(images, fps=fps) clip.write_videofile(f"output.mp4")
|
Date | |
Source | Own work |
Author | Cosmia Nebula |
Licensing
[edit]- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 23:32, 30 August 2024 | 10 s, 1,560 × 1,560 (633 KB) | Cosmia Nebula (talk | contribs) | Uploaded while editing "Wave packet" on en.wikipedia.org |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
Transcode status
Update transcode statusFile usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Software used |
---|