From 40f8c5330bc247f58055509956607b294c570a97 Mon Sep 17 00:00:00 2001 From: nilsberglund-orleans <83530463+nilsberglund-orleans@users.noreply.github.com> Date: Wed, 28 Jul 2021 14:13:04 +0200 Subject: [PATCH] Add files via upload --- Parameters.md | 712 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 712 insertions(+) diff --git a/Parameters.md b/Parameters.md index 51c01da..0392cb8 100644 --- a/Parameters.md +++ b/Parameters.md @@ -1774,6 +1774,718 @@ updated gradually. ``` +### 6 July 21 - Working the angle - 108 degrees, or why regular pentagons cut wave fronts into pieces ### + +**Program:** Variant of `particle_billiard.c` + +**Initial condition in function `animation()`:** `init_drop_config(-1.0, 1.0, -0.65*PID, -0.4*PID, configs); ` + +``` +#define MOVIE 1 /* set to 1 to generate movie */ + +#define WINWIDTH 1280 /* window width */ +#define WINHEIGHT 720 /* window height */ + +#define XMIN -2.0 +#define XMAX 2.0 /* x interval */ +#define YMIN -1.125 +#define YMAX 1.125 /* y interval for 9/16 aspect ratio */ + +#define SCALING_FACTOR 1.0 /* scaling factor of drawing, needed for flower billiards, otherwise set to 1.0 */ + +// #define XMIN -1.8 +// #define XMAX 1.8 /* x interval */ +// #define YMIN -0.91 +// #define YMAX 1.115 /* y interval for 9/16 aspect ratio */ + +/* Choice of the billiard table */ + +#define B_DOMAIN 12 /* choice of domain shape */ + +#define D_RECTANGLE 0 /* rectangular domain */ +#define D_ELLIPSE 1 /* elliptical domain */ +#define D_STADIUM 2 /* stadium-shaped domain */ +#define D_SINAI 3 /* Sinai billiard */ +#define D_DIAMOND 4 /* diamond-shaped billiard */ +#define D_TRIANGLE 5 /* triangular billiard */ +#define D_ANNULUS 7 /* annulus */ +#define D_POLYGON 8 /* polygon */ +#define D_REULEAUX 9 /* Reuleaux and star shapes */ +#define D_FLOWER 10 /* Bunimovich flower */ +#define D_ALT_REU 11 /* alternating between star and Reuleaux */ +#define D_ANGLE 12 /* angular sector */ + +#define LAMBDA 0.6 /* parameter controlling shape of billiard */ +#define MU 0.1 /* second parameter controlling shape of billiard */ +#define FOCI 1 /* set to 1 to draw focal points of ellipse */ +#define NPOLY 6 /* number of sides of polygon */ +#define APOLY 2.0 /* angle by which to turn polygon, in units of Pi/2 */ +#define DRAW_BILLIARD 1 /* set to 1 to draw billiard */ +#define DRAW_CONSTRUCTION_LINES 1 /* set to 1 to draw additional construction lines for billiard */ +#define PERIODIC_BC 0 /* set to 1 to enforce periodic boundary conditions when drawing particles */ + +#define RESAMPLE 0 /* set to 1 if particles should be added when dispersion too large */ +#define DEBUG 0 /* draw trajectories, for debugging purposes */ + +/* Simulation parameters */ + +#define NPART 500 /* number of particles */ +#define NPARTMAX 100000 /* maximal number of particles after resampling */ +#define LMAX 0.01 /* minimal segment length triggering resampling */ +#define DMIN 0.02 /* minimal distance to boundary for triggering resampling */ +#define CYCLE 1 /* set to 1 for closed curve (start in all directions) */ + +#define NSTEPS 650 /* number of frames of movie */ +#define TIME 1000 /* time between movie frames, for fluidity of real-time simulation */ +#define DPHI 0.000006 /* integration step */ +#define NVID 150 /* number of iterations between images displayed on screen */ + +/* Decreasing TIME accelerates the animation and the movie */ +/* For constant speed of movie, TIME*DPHI should be kept constant */ +/* However, increasing DPHI too much deterioriates quality of simulation */ +/* NVID tells how often a picture is drawn in the animation, increase it for faster anim */ +/* For a good quality movie, take for instance TIME = 400, DPHI = 0.00005, NVID = 100 */ + +/* Colors and other graphical parameters */ + +#define NCOLORS 6 /* number of colors */ +#define COLORSHIFT 0 /* hue of initial color */ +#define FLOWER_COLOR 0 /* set to 1 to adapt initial colors to flower billiard (tracks vs core) */ +#define NSEG 100 /* number of segments of boundary */ +#define LENGTH 0.04 /* length of velocity vectors */ +#define BILLIARD_WIDTH 3 /* width of billiard */ +#define PARTICLE_WIDTH 2 /* width of particles */ +#define FRONT_WIDTH 3 /* width of wave front */ + +#define BLACK 1 /* set to 1 for black background */ +#define COLOR_OUTSIDE 0 /* set to 1 for colored outside */ +#define OUTER_COLOR 270.0 /* color outside billiard */ +#define PAINT_INT 0 /* set to 1 to paint interior in other color (for polygon/Reuleaux) */ + + +#define PAUSE 1000 /* number of frames after which to pause */ +#define PSLEEP 1 /* sleep time during pause */ +#define SLEEP1 1 /* initial sleeping time */ +#define SLEEP2 1000 /* final sleeping time */ + +#define PI 3.141592654 +#define DPI 6.283185307 +#define PID 1.570796327 + +``` + +### 5 July 21 - Waves colliding with a hexagonal grid ### + +**Program:** `wave_billiard.c` + +**Initial condition in function `animation()`:** `init_wave(-1.5, 0.0, phi, psi, phi_tmp, psi_tmp, xy_in);` + +``` +#define MOVIE 1 /* set to 1 to generate movie */ + +/* General geometrical parameters */ + +#define WINWIDTH 1280 /* window width */ +#define WINHEIGHT 720 /* window height */ + +#define NX 1280 /* number of grid points on x axis */ +#define NY 720 /* number of grid points on y axis */ + +#define XMIN -2.0 +#define XMAX 2.0 /* x interval */ +#define YMIN -1.125 +#define YMAX 1.125 /* y interval for 9/16 aspect ratio */ + +#define JULIA_SCALE 1.1 /* scaling for Julia sets */ + +/* Choice of the billiard table */ + +#define B_DOMAIN 13 /* choice of domain shape */ + +#define D_RECTANGLE 0 /* rectangular domain */ +#define D_ELLIPSE 1 /* elliptical domain */ +#define D_STADIUM 2 /* stadium-shaped domain */ +#define D_SINAI 3 /* Sinai billiard */ +#define D_DIAMOND 4 /* diamond-shaped billiard */ +#define D_TRIANGLE 5 /* triangular billiard */ +#define D_FLAT 6 /* flat interface */ +#define D_ANNULUS 7 /* annulus */ +#define D_POLYGON 8 /* polygon */ +#define D_YOUNG 9 /* Young diffraction slits */ +#define D_GRATING 10 /* diffraction grating */ +#define D_EHRENFEST 11 /* Ehrenfest urn type geometry */ +#define D_DISK_GRID 12 /* grid of disks */ +#define D_DISK_HEX 13 /* haxagonl grid of disks */ + +#define D_MENGER 15 /* Menger-Sierpinski carpet */ +#define D_JULIA_INT 16 /* interior of Julia set */ + +/* Billiard tables for heat equation */ + +#define D_ANNULUS_HEATED 21 /* annulus with different temperatures */ +#define D_MENGER_HEATED 22 /* Menger gasket with different temperatures */ +#define D_MENGER_H_OPEN 23 /* Menger gasket with different temperatures and larger domain */ +#define D_MANDELBROT 24 /* Mandelbrot set */ +#define D_JULIA 25 /* Julia set */ +#define D_MANDELBROT_CIRCLE 26 /* Mandelbrot set with circular conductor */ + +#define LAMBDA 1.0 /* parameter controlling the dimensions of domain */ +#define MU 0.025 /* parameter controlling the dimensions of domain */ +#define NPOLY 8 /* number of sides of polygon */ +#define APOLY 1.0 /* angle by which to turn polygon, in units of Pi/2 */ +#define MDEPTH 4 /* depth of computation of Menger gasket */ +#define MRATIO 3 /* ratio defining Menger gasket */ +#define MANDELLEVEL 1000 /* iteration level for Mandelbrot set */ +#define MANDELLIMIT 10.0 /* limit value for approximation of Mandelbrot set */ +#define FOCI 1 /* set to 1 to draw focal points of ellipse */ +#define NGRIDX 15 /* number of grid point for grid of disks */ +#define NGRIDY 20 /* number of grid point for grid of disks */ + +/* You can add more billiard tables by adapting the functions */ +/* xy_in_billiard and draw_billiard below */ + +/* Physical parameters of wave equation */ + +#define OMEGA 0.9 /* frequency of periodic excitation */ +#define COURANT 0.01 /* Courant number */ +#define GAMMA 0.0 /* damping factor in wave equation */ +#define KAPPA 0.0 /* "elasticity" term enforcing oscillations */ +/* The Courant number is given by c*DT/DX, where DT is the time step and DX the lattice spacing */ +/* The physical damping coefficient is given by GAMMA/(DT)^2 */ +/* Increasing COURANT speeds up the simulation, but decreases accuracy */ +/* For similar wave forms, COURANT^2*GAMMA should be kept constant */ + +/* Boundary conditions */ + +#define B_COND 2 + +#define BC_DIRICHLET 0 /* Dirichlet boundary conditions */ +#define BC_PERIODIC 1 /* periodic boundary conditions */ +#define BC_ABSORBING 2 /* absorbing boundary conditions (beta version) */ + + +/* For debugging purposes only */ +#define FLOOR 0 /* set to 1 to limit wave amplitude to VMAX */ +#define VMAX 10.0 /* max value of wave amplitude */ + +/* Parameters for length and speed of simulation */ + +#define NSTEPS 8000 /* number of frames of movie */ +#define NVID 25 /* number of iterations between images displayed on screen */ +#define NSEG 100 /* number of segments of boundary */ + +#define PAUSE 1000 /* number of frames after which to pause */ +#define PSLEEP 1 /* sleep time during pause */ +#define SLEEP1 1 /* initial sleeping time */ +#define SLEEP2 1 /* final sleeping time */ + +/* Plot type */ + +#define PLOT 0 + +#define P_AMPLITUDE 0 /* plot amplitude of wave */ +#define P_ENERGY 1 /* plot energy of wave */ + + +/* Color schemes */ + +#define BLACK 1 /* background */ + +#define COLOR_SCHEME 1 /* choice of color scheme */ + +#define C_LUM 0 /* color scheme modifies luminosity (with slow drift of hue) */ +#define C_HUE 1 /* color scheme modifies hue */ + +#define SCALE 0 /* set to 1 to adjust color scheme to variance of field */ +#define SLOPE 1.0 /* sensitivity of color on wave amplitude */ +#define ATTENUATION 0.0 /* exponential attenuation coefficient of contrast with time */ + +#define COLORHUE 260 /* initial hue of water color for scheme C_LUM */ +#define COLORDRIFT 0.0 /* how much the color hue drifts during the whole simulation */ +#define LUMMEAN 0.5 /* amplitude of luminosity variation for scheme C_LUM */ +#define LUMAMP 0.3 /* amplitude of luminosity variation for scheme C_LUM */ +#define HUEMEAN 220.0 /* mean value of hue for color scheme C_HUE */ +#define HUEAMP -240.0 /* amplitude of variation of hue for color scheme C_HUE */ + +/* Basic math */ + +#define PI 3.141592654 +#define DPI 6.283185307 +#define PID 1.570796327 + +``` +### 4 July 21 - A "billiard" with a 1080 degrees angle ### + +**Program:** `particle_billiard.c` + +**Initial condition in function `animation()`:** `init_line_config(0.0, -1.0, -1.0, 1.0, atan(0.5), configs);` + +``` +#define MOVIE 1 /* set to 1 to generate movie */ + +#define WINWIDTH 1280 /* window width */ +#define WINHEIGHT 720 /* window height */ + +#define XMIN -2.0 +#define XMAX 2.0 /* x interval */ +#define YMIN -1.125 +#define YMAX 1.125 /* y interval for 9/16 aspect ratio */ + +#define SCALING_FACTOR 1.0 /* scaling factor of drawing, needed for flower billiards, otherwise set to 1.0 */ + +/* Choice of the billiard table */ + +#define B_DOMAIN 13 /* choice of domain shape */ + +#define D_RECTANGLE 0 /* rectangular domain */ +#define D_ELLIPSE 1 /* elliptical domain */ +#define D_STADIUM 2 /* stadium-shaped domain */ +#define D_SINAI 3 /* Sinai billiard */ +#define D_DIAMOND 4 /* diamond-shaped billiard */ +#define D_TRIANGLE 5 /* triangular billiard */ +#define D_ANNULUS 7 /* annulus */ +#define D_POLYGON 8 /* polygon */ +#define D_REULEAUX 9 /* Reuleaux and star shapes */ +#define D_FLOWER 10 /* Bunimovich flower */ +#define D_ALT_REU 11 /* alternating between star and Reuleaux */ +#define D_ANGLE 12 /* angular sector */ +#define D_LSHAPE 13 /* L-shaped billiard for conical singularity */ + +#define LAMBDA 0.75 /* parameter controlling shape of billiard */ +#define MU 0.1 /* second parameter controlling shape of billiard */ +#define FOCI 1 /* set to 1 to draw focal points of ellipse */ +#define NPOLY 6 /* number of sides of polygon */ +#define APOLY 2.0 /* angle by which to turn polygon, in units of Pi/2 */ +#define DRAW_BILLIARD 1 /* set to 1 to draw billiard */ +#define DRAW_CONSTRUCTION_LINES 1 /* set to 1 to draw additional construction lines for billiard */ +#define PERIODIC_BC 0 /* set to 1 to enforce periodic boundary conditions when drawing particles */ + +#define RESAMPLE 0 /* set to 1 if particles should be added when dispersion too large */ +#define DEBUG 0 /* draw trajectories, for debugging purposes */ + +/* Simulation parameters */ + +#define NPART 2001 /* number of particles */ +#define NPARTMAX 100000 /* maximal number of particles after resampling */ +#define LMAX 0.01 /* minimal segment length triggering resampling */ +#define DMIN 0.02 /* minimal distance to boundary for triggering resampling */ +#define CYCLE 1 /* set to 1 for closed curve (start in all directions) */ + +#define NSTEPS 1788 /* number of frames of movie */ +#define TIME 1000 /* time between movie frames, for fluidity of real-time simulation */ +#define DPHI 0.000005 /* integration step */ +#define NVID 150 /* number of iterations between images displayed on screen */ + +/* Decreasing TIME accelerates the animation and the movie */ +/* For constant speed of movie, TIME*DPHI should be kept constant */ +/* However, increasing DPHI too much deterioriates quality of simulation */ +/* NVID tells how often a picture is drawn in the animation, increase it for faster anim */ +/* For a good quality movie, take for instance TIME = 400, DPHI = 0.00005, NVID = 100 */ + +/* Colors and other graphical parameters */ + +#define NCOLORS 12 /* number of colors */ +#define COLORSHIFT 0 /* hue of initial color */ +#define RAINBOW_COLOR 1 /* set to 1 to use different colors for all particles */ +#define FLOWER_COLOR 0 /* set to 1 to adapt initial colors to flower billiard (tracks vs core) */ +#define NSEG 100 /* number of segments of boundary */ +#define LENGTH 0.04 /* length of velocity vectors */ +#define BILLIARD_WIDTH 3 /* width of billiard */ +#define PARTICLE_WIDTH 2 /* width of particles */ +#define FRONT_WIDTH 3 /* width of wave front */ + +#define BLACK 1 /* set to 1 for black background */ +#define COLOR_OUTSIDE 0 /* set to 1 for colored outside */ +#define OUTER_COLOR 270.0 /* color outside billiard */ +#define PAINT_INT 0 /* set to 1 to paint interior in other color (for polygon/Reuleaux) */ + + +#define PAUSE 1000 /* number of frames after which to pause */ +#define PSLEEP 1 /* sleep time during pause */ +#define SLEEP1 1 /* initial sleeping time */ +#define SLEEP2 1000 /* final sleeping time */ + +#define PI 3.141592654 +#define DPI 6.283185307 +#define PID 1.570796327 + +``` + +### 3 July 21 - Anderson localization: randomly placed mangroves offer better tsunami protection ### + +**Program:** `wave_billiard.c` + +**Initial condition in function `animation()`:** `init_wave(-1.5, 0.0, phi, psi, phi_tmp, psi_tmp, xy_in);` + +``` +#define MOVIE 1 /* set to 1 to generate movie */ + +/* General geometrical parameters */ + +#define WINWIDTH 1280 /* window width */ +#define WINHEIGHT 720 /* window height */ + +#define NX 1280 /* number of grid points on x axis */ +#define NY 720 /* number of grid points on y axis */ + +#define XMIN -2.0 +#define XMAX 2.0 /* x interval */ +#define YMIN -1.125 +#define YMAX 1.125 /* y interval for 9/16 aspect ratio */ + +#define JULIA_SCALE 1.1 /* scaling for Julia sets */ + +/* Choice of the billiard table */ + +#define B_DOMAIN 13 /* choice of domain shape */ +/* superseded in later versions by D_DOMAIN 20 with D_CIRCLES 20 + and CIRCLE_PATTERN 2 with C_RAND_DISPLACED 2 */ + +#define D_RECTANGLE 0 /* rectangular domain */ +#define D_ELLIPSE 1 /* elliptical domain */ +#define D_STADIUM 2 /* stadium-shaped domain */ +#define D_SINAI 3 /* Sinai billiard */ +#define D_DIAMOND 4 /* diamond-shaped billiard */ +#define D_TRIANGLE 5 /* triangular billiard */ +#define D_FLAT 6 /* flat interface */ +#define D_ANNULUS 7 /* annulus */ +#define D_POLYGON 8 /* polygon */ +#define D_YOUNG 9 /* Young diffraction slits */ +#define D_GRATING 10 /* diffraction grating */ +#define D_EHRENFEST 11 /* Ehrenfest urn type geometry */ +#define D_DISK_GRID 12 /* grid of disks */ +#define D_DISK_RANDOM 13 /* grid of randomly displaces disks */ +/* superseded in later versions by D_DOMAIN 20 with D_CIRCLES 20 + and CIRCLE_PATTERN 2 with C_RAND_DISPLACED 2 */ + +#define D_MENGER 15 /* Menger-Sierpinski carpet */ +#define D_JULIA_INT 16 /* interior of Julia set */ + +/* Billiard tables for heat equation */ + +#define D_ANNULUS_HEATED 21 /* annulus with different temperatures */ +#define D_MENGER_HEATED 22 /* Menger gasket with different temperatures */ +#define D_MENGER_H_OPEN 23 /* Menger gasket with different temperatures and larger domain */ +#define D_MANDELBROT 24 /* Mandelbrot set */ +#define D_JULIA 25 /* Julia set */ +#define D_MANDELBROT_CIRCLE 26 /* Mandelbrot set with circular conductor */ + +#define LAMBDA 1.0 /* parameter controlling the dimensions of domain */ +#define MU 0.025 /* parameter controlling the dimensions of domain */ +#define NPOLY 8 /* number of sides of polygon */ +#define APOLY 1.0 /* angle by which to turn polygon, in units of Pi/2 */ +#define MDEPTH 4 /* depth of computation of Menger gasket */ +#define MRATIO 3 /* ratio defining Menger gasket */ +#define MANDELLEVEL 1000 /* iteration level for Mandelbrot set */ +#define MANDELLIMIT 10.0 /* limit value for approximation of Mandelbrot set */ +#define FOCI 1 /* set to 1 to draw focal points of ellipse */ +#define NGRIDX 15 /* number of grid point for grid of disks */ +#define NGRIDY 20 /* number of grid point for grid of disks */ + +/* You can add more billiard tables by adapting the functions */ +/* xy_in_billiard and draw_billiard below */ + +/* Physical parameters of wave equation */ + +#define OMEGA 0.9 /* frequency of periodic excitation */ +#define COURANT 0.01 /* Courant number */ +#define GAMMA 0.0 /* damping factor in wave equation */ +#define KAPPA 0.0 /* "elasticity" term enforcing oscillations */ +/* The Courant number is given by c*DT/DX, where DT is the time step and DX the lattice spacing */ +/* The physical damping coefficient is given by GAMMA/(DT)^2 */ +/* Increasing COURANT speeds up the simulation, but decreases accuracy */ +/* For similar wave forms, COURANT^2*GAMMA should be kept constant */ + +/* Boundary conditions */ + +#define B_COND 2 + +#define BC_DIRICHLET 0 /* Dirichlet boundary conditions */ +#define BC_PERIODIC 1 /* periodic boundary conditions */ +#define BC_ABSORBING 2 /* absorbing boundary conditions (beta version) */ + + +/* For debugging purposes only */ +#define FLOOR 0 /* set to 1 to limit wave amplitude to VMAX */ +#define VMAX 10.0 /* max value of wave amplitude */ + +/* Parameters for length and speed of simulation */ + +#define NSTEPS 5500 /* number of frames of movie */ +#define NVID 25 /* number of iterations between images displayed on screen */ +#define NSEG 100 /* number of segments of boundary */ + +#define PAUSE 1000 /* number of frames after which to pause */ +#define PSLEEP 1 /* sleep time during pause */ +#define SLEEP1 1 /* initial sleeping time */ +#define SLEEP2 1 /* final sleeping time */ + +/* Plot type */ + +#define PLOT 1 + +#define P_AMPLITUDE 0 /* plot amplitude of wave */ +#define P_ENERGY 1 /* plot energy of wave */ + + +/* Color schemes */ + +#define BLACK 1 /* background */ + +#define COLOR_SCHEME 1 /* choice of color scheme */ + +#define C_LUM 0 /* color scheme modifies luminosity (with slow drift of hue) */ +#define C_HUE 1 /* color scheme modifies hue */ + +#define SCALE 0 /* set to 1 to adjust color scheme to variance of field */ +#define SLOPE 0.02 /* sensitivity of color on wave amplitude */ +#define ATTENUATION 0.0 /* exponential attenuation coefficient of contrast with time */ + +#define COLORHUE 260 /* initial hue of water color for scheme C_LUM */ +#define COLORDRIFT 0.0 /* how much the color hue drifts during the whole simulation */ +#define LUMMEAN 0.5 /* amplitude of luminosity variation for scheme C_LUM */ +#define LUMAMP 0.3 /* amplitude of luminosity variation for scheme C_LUM */ +#define HUEMEAN 240.0 /* mean value of hue for color scheme C_HUE */ +#define HUEAMP -240.0 /* amplitude of variation of hue for color scheme C_HUE */ + +/* Basic math */ + +#define PI 3.141592654 +#define DPI 6.283185307 +#define PID 1.570796327 + +``` +### 2 July 21 - #shorts: Working the angle - 120 degrees ### + +**Program:** Variant of `particle_billiard.c` + +**Initial condition in function `animation()`:** `init_drop_config(-1.0, 1.0, -0.65*PID, -0.4*PID, configs); ` + +``` +#define MOVIE 1 /* set to 1 to generate movie */ + +#define WINWIDTH 1280 /* window width */ +#define WINHEIGHT 720 /* window height */ + +#define XMIN -2.0 +#define XMAX 2.0 /* x interval */ +#define YMIN -1.125 +#define YMAX 1.125 /* y interval for 9/16 aspect ratio */ + +#define SCALING_FACTOR 1.0 /* scaling factor of drawing, needed for flower billiards, otherwise set to 1.0 */ + +/* Choice of the billiard table */ + +#define B_DOMAIN 12 /* choice of domain shape */ + +#define D_RECTANGLE 0 /* rectangular domain */ +#define D_ELLIPSE 1 /* elliptical domain */ +#define D_STADIUM 2 /* stadium-shaped domain */ +#define D_SINAI 3 /* Sinai billiard */ +#define D_DIAMOND 4 /* diamond-shaped billiard */ +#define D_TRIANGLE 5 /* triangular billiard */ +#define D_ANNULUS 7 /* annulus */ +#define D_POLYGON 8 /* polygon */ +#define D_REULEAUX 9 /* Reuleaux and star shapes */ +#define D_FLOWER 10 /* Bunimovich flower */ +#define D_ALT_REU 11 /* alternating between star and Reuleaux */ +#define D_ANGLE 12 /* angular sector */ + +#define LAMBDA 0.6666666666666666 /* parameter controlling shape of billiard */ +#define MU 0.1 /* second parameter controlling shape of billiard */ +#define FOCI 1 /* set to 1 to draw focal points of ellipse */ +#define NPOLY 6 /* number of sides of polygon */ +#define APOLY 2.0 /* angle by which to turn polygon, in units of Pi/2 */ +#define DRAW_BILLIARD 1 /* set to 1 to draw billiard */ +#define DRAW_CONSTRUCTION_LINES 1 /* set to 1 to draw additional construction lines for billiard */ +#define PERIODIC_BC 0 /* set to 1 to enforce periodic boundary conditions when drawing particles */ + +#define RESAMPLE 0 /* set to 1 if particles should be added when dispersion too large */ +#define DEBUG 0 /* draw trajectories, for debugging purposes */ + +/* Simulation parameters */ + +#define NPART 500 /* number of particles */ +#define NPARTMAX 100000 /* maximal number of particles after resampling */ +#define LMAX 0.01 /* minimal segment length triggering resampling */ +#define DMIN 0.02 /* minimal distance to boundary for triggering resampling */ +#define CYCLE 1 /* set to 1 for closed curve (start in all directions) */ + +#define NSTEPS 700 /* number of frames of movie */ +#define TIME 1000 /* time between movie frames, for fluidity of real-time simulation */ +#define DPHI 0.000006 /* integration step */ +#define NVID 150 /* number of iterations between images displayed on screen */ + +/* Decreasing TIME accelerates the animation and the movie */ +/* For constant speed of movie, TIME*DPHI should be kept constant */ +/* However, increasing DPHI too much deterioriates quality of simulation */ +/* NVID tells how often a picture is drawn in the animation, increase it for faster anim */ +/* For a good quality movie, take for instance TIME = 400, DPHI = 0.00005, NVID = 100 */ + +/* Colors and other graphical parameters */ + +#define NCOLORS 6 /* number of colors */ +#define COLORSHIFT 0 /* hue of initial color */ +#define FLOWER_COLOR 0 /* set to 1 to adapt initial colors to flower billiard (tracks vs core) */ +#define NSEG 100 /* number of segments of boundary */ +#define LENGTH 0.04 /* length of velocity vectors */ +#define BILLIARD_WIDTH 3 /* width of billiard */ +#define PARTICLE_WIDTH 2 /* width of particles */ +#define FRONT_WIDTH 3 /* width of wave front */ + +#define BLACK 1 /* set to 1 for black background */ +#define COLOR_OUTSIDE 0 /* set to 1 for colored outside */ +#define OUTER_COLOR 270.0 /* color outside billiard */ +#define PAINT_INT 0 /* set to 1 to paint interior in other color (for polygon/Reuleaux) */ + + +#define PAUSE 1000 /* number of frames after which to pause */ +#define PSLEEP 1 /* sleep time during pause */ +#define SLEEP1 1 /* initial sleeping time */ +#define SLEEP2 1000 /* final sleeping time */ + +#define PI 3.141592654 +#define DPI 6.283185307 +#define PID 1.570796327 + +``` + +### 1 July 21 - #shorts: Young's double-slit experiment with a quantum particle ### + +**Program:** `schrodinger.c` + +**Initial condition in function `animation()`:** `init_coherent_state(-1.2, 0.0, 20.0, 0.0, 0.25, phi, psi, xy_in);` + +``` +#define MOVIE 1 /* set to 1 to generate movie */ + +/* General geometrical parameters */ + +#define WINWIDTH 1280 /* window width */ +#define WINHEIGHT 720 /* window height */ + +#define NX 1280 /* number of grid points on x axis */ +#define NY 720 /* number of grid points on y axis */ + +#define XMIN -2.0 +#define XMAX 2.0 /* x interval */ +#define YMIN -1.125 +#define YMAX 1.125 /* y interval for 9/16 aspect ratio */ + +#define JULIA_SCALE 1.0 /* scaling for Julia sets */ + +/* Choice of the billiard table */ + +#define B_DOMAIN 9 /* choice of domain shape */ + +#define D_RECTANGLE 0 /* rectangular domain */ +#define D_ELLIPSE 1 /* elliptical domain */ +#define D_STADIUM 2 /* stadium-shaped domain */ +#define D_SINAI 3 /* Sinai billiard */ +#define D_DIAMOND 4 /* diamond-shaped billiard */ +#define D_TRIANGLE 5 /* triangular billiard */ +#define D_FLAT 6 /* flat interface */ +#define D_ANNULUS 7 /* annulus */ +#define D_POLYGON 8 /* polygon */ +#define D_YOUNG 9 /* Young diffraction slits */ +#define D_GRATING 10 /* diffraction grating */ +#define D_EHRENFEST 11 /* Ehrenfest urn type geometry */ +#define D_DISK_GRID 12 /* grid of disks */ + +#define D_MENGER 15 /* Menger-Sierpinski carpet */ +#define D_JULIA_INT 16 /* interior of Julia set */ + +/* Billiard tables for heat equation */ + +#define D_ANNULUS_HEATED 21 /* annulus with different temperatures */ +#define D_MENGER_HEATED 22 /* Menger gasket with different temperatures */ +#define D_MENGER_H_OPEN 23 /* Menger gasket with different temperatures and larger domain */ +#define D_MANDELBROT 24 /* Mandelbrot set */ +#define D_JULIA 25 /* Julia set */ +#define D_MANDELBROT_CIRCLE 26 /* Mandelbrot set with circular conductor */ + +#define LAMBDA 0.3 /* parameter controlling the dimensions of domain */ +#define MU 0.05 /* parameter controlling the dimensions of domain */ +#define NPOLY 6 /* number of sides of polygon */ +#define APOLY 1.0 /* angle by which to turn polygon, in units of Pi/2 */ +#define MDEPTH 3 /* depth of computation of Menger gasket */ +#define MRATIO 3 /* ratio defining Menger gasket */ +#define MANDELLEVEL 1000 /* iteration level for Mandelbrot set */ +#define MANDELLIMIT 10.0 /* limit value for approximation of Mandelbrot set */ +#define FOCI 1 /* set to 1 to draw focal points of ellipse */ +#define NGRIDX 15 /* number of grid point for grid of disks */ +#define NGRIDY 20 /* number of grid point for grid of disks */ + +/* You can add more billiard tables by adapting the functions */ +/* xy_in_billiard and draw_billiard in sub_wave.c */ + +/* Physical patameters of wave equation */ + +#define DT 0.000000005 +#define HBAR 1.0 + +/* Boundary conditions */ + +#define B_COND 1 + +#define BC_DIRICHLET 0 /* Dirichlet boundary conditions */ +#define BC_PERIODIC 1 /* periodic boundary conditions */ +#define BC_ABSORBING 2 /* absorbing boundary conditions (beta version) */ + +/* Parameters for length and speed of simulation */ + +#define NSTEPS 1400 /* number of frames of movie */ +#define NVID 1200 /* number of iterations between images displayed on screen */ +#define NSEG 100 /* number of segments of boundary */ + +#define PAUSE 1000 /* number of frames after which to pause */ +#define PSLEEP 1 /* sleep time during pause */ +#define SLEEP1 1 /* initial sleeping time */ +#define SLEEP2 1 /* final sleeping time */ + +/* For debugging purposes only */ +#define FLOOR 0 /* set to 1 to limit wave amplitude to VMAX */ +#define VMAX 10.0 /* max value of wave amplitude */ + + +/* Plot type */ + +#define PLOT 0 + +#define P_MODULE 0 /* plot module of wave function squared */ +#define P_PHASE 1 /* plot phase of wave function */ +#define P_REAL 2 /* plot real part */ +#define P_IMAGINARY 3 /* plot imaginary part */ + +/* Color schemes */ + +#define BLACK 1 /* black background */ + +#define COLOR_SCHEME 1 /* choice of color scheme */ + +#define C_LUM 0 /* color scheme modifies luminosity (with slow drift of hue) */ +#define C_HUE 1 /* color scheme modifies hue */ +#define C_PHASE 2 /* color scheme shows phase */ + +#define SCALE 1 /* set to 1 to adjust color scheme to variance of field */ +#define SLOPE 1.0 /* sensitivity of color on wave amplitude */ +#define ATTENUATION 0.0 /* exponential attenuation coefficient of contrast with time */ + +#define COLORHUE 260 /* initial hue of water color for scheme C_LUM */ +#define COLORDRIFT 0.0 /* how much the color hue drifts during the whole simulation */ +#define LUMMEAN 0.5 /* amplitude of luminosity variation for scheme C_LUM */ +#define LUMAMP 0.3 /* amplitude of luminosity variation for scheme C_LUM */ +#define HUEMEAN 150.0 /* mean value of hue for color scheme C_HUE */ +#define HUEAMP -150.0 /* amplitude of variation of hue for color scheme C_HUE */ + +/* Basic math */ + +#define PI 3.141592654 +#define DPI 6.283185307 +#define PID 1.570796327 + +``` + ### xx July 21 - ### **Program:** `x.c`