Numerical solution of Maxwell equations for monochromatic light using 2D Yee-net algorithm.
$: pip install -r requirements.txt
$: python3 fdtd.py #init params in fdtd.config
You can convert generated images from result/
folder to (%04d
refers to the simulation len(str(simulation_time))
):
$: ffmpeg -i img_%04d.png output.mp4 #MP4
$: ffmpeg -y -i output.mp4 -filter_complex "fps=5,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=32[p];[s1][p]paletteuse=dither=bayer" output.gif #GIF
Due to huge GIF size framerate reduced to 5-10fps. Original .mp4 files in examples
folder.