File:Airy wave train.webm

From testwiki
Jump to navigation Jump to search
Airy_wave_train.webm (file size: 5.8 MB, MIME type: video/webm)

This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

Summary

Description
English: ```python

import matplotlib.pyplot as plt import numpy as np from scipy.special import airy from tqdm import tqdm

def f(x, p, B=1, t=0):

 return (1/(2**(1/3) * np.pi * B)) * airy(2**(2/3) * (B*x + (p**2)/(B**2) - 2*B*p*t))[0]

xmax = 4.5 q = np.linspace(-xmax,xmax, 500) p = np.linspace(-xmax,xmax, 500)

Q, P = np.meshgrid(q, p)

import os movie_name = "airy_wavepacket" dir_path = f"./{movie_name}" tmax = 4 frames_per_t = 24 t_values = np.linspace(-tmax, tmax, frames_per_t * (tmax * 2))

for N, t in tqdm(enumerate(t_values)):

   W = f(Q, P, B=1, t = t)
   plt.gca().set_aspect('equal')
   fig, ax = plt.subplots(figsize=(18, 16))
   wmap = wigner_cmap(W)
   contour = ax.contourf(Q, P, W, 40, cmap=wmap)
   plt.colorbar(contour)
   plt.xlabel('q')
   plt.ylabel('p')
   plt.grid(True)
   if not os.path.exists(dir_path):
       os.makedirs(dir_path)
   plt.savefig(f"{dir_path}/{N:03d}.png",bbox_inches='tight')
   plt.close()
  1. !ffmpeg -framerate 24 -i %03d.png output.webm
```
Date
Source Own work
Author Cosmia Nebula

Licensing

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.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

30 August 2024

video/webm

6,079,203 byte

8 second

3,875 pixel

4,073 pixel

cd78792c83e7cf1b72960e684a89ebeb60890b2c

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeDimensionsUserComment
current23:54, 30 August 2024 (5.8 MB)wikimediacommons>Cosmia NebulaUploaded while editing "Wave packet" on en.wikipedia.org

The following page uses this file: