File:Gaussian wavepacket p0=1.webm

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file (WebM audio/video file, VP9, length 10 s, 1,560 × 1,560 pixels, 510 kbps overall, file size: 633 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: ```python
  1. import numpy as np

import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D

  1. Constants

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")
  1. !ffmpeg -y -i output.mp4 -c:v libvpx-vp9 -b:v 0 -crf 10 -c:a libvorbis output.webm
```
Date
Source Own work
Author Cosmia Nebula

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
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/TimeThumbnailDimensionsUserComment
current23:32, 30 August 202410 s, 1,560 × 1,560 (633 KB)Cosmia Nebula (talk | contribs)Uploaded while editing "Wave packet" on en.wikipedia.org

There are no pages that use this file.

Transcode status

Update transcode status
Format Bitrate Download Status Encode time
VP9 1080P 211 kbps Completed 23:33, 30 August 2024 6.0 s
VP9 720P 118 kbps Completed 23:32, 30 August 2024 4.0 s
VP9 480P 64 kbps Completed 23:32, 30 August 2024 3.0 s
VP9 360P 41 kbps Completed 23:32, 30 August 2024 3.0 s
VP9 240P 22 kbps Completed 23:32, 30 August 2024 2.0 s
WebM 360P 60 kbps Completed 23:32, 30 August 2024 2.0 s
QuickTime 144p (MJPEG) 306 kbps Completed 16:57, 27 October 2024 1.0 s

File usage on other wikis

The following other wikis use this file:

Metadata