diff --git a/Parameters.md b/Parameters.md index a3d7664..33f0c8e 100644 --- a/Parameters.md +++ b/Parameters.md @@ -5,10 +5,14 @@ C code for videos on YouTube Channel https://www.youtube.com/c/NilsBerglund Below are parameter values used for different simulations, as well as initial conditions used in function animation. Some simulations use variants of the published code. The list is going to be updated gradually. -### 29 July 2025 - Lunar dust: Charged particles subject to gravity ### + + +### 03 November 2025 - Interacting spins on a sphere ### **Program:** `lennardjones.c` +**3D part:** + ``` #define MOVIE 1 /* set to 1 to generate movie */ #define DOUBLE_MOVIE 0 /* set to 1 to produce movies for wave height and energy simultaneously */ @@ -27,15 +31,15 @@ Below are parameter values used for different simulations, as well as initial co #define WINWIDTH 1760 /* window width */ #define WINHEIGHT 990 /* 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 XMIN 0.0 +#define XMAX 6.283185307 /* x interval */ +#define YMIN 0.0 +#define YMAX 3.141592654 /* y interval for 9/16 aspect ratio */ -#define INITXMIN -0.1 -#define INITXMAX 0.1 /* x interval for initial condition */ -#define INITYMIN -0.1 -#define INITYMAX 0.1 /* y interval for initial condition */ +#define INITXMIN 0.025 +#define INITXMAX 6.255 /* x interval for initial condition */ +#define INITYMIN 0.4 +#define INITYMAX 2.74 /* y interval for initial condition */ #define THERMOXMIN -1.25 #define THERMOXMAX 1.25 /* x interval for initial condition */ @@ -46,13 +50,13 @@ Below are parameter values used for different simulations, as well as initial co #define ADDXMAX 1.9 /* x interval for adding particles */ #define ADDYMIN 1.2 #define ADDYMAX 1.3 /* y interval for adding particles */ -#define ADDRMIN 4.75 -#define ADDRMAX 6.0 /* r interval for adding particles */ +#define ADDRMIN 2.0 +#define ADDRMAX 2.1 /* r interval for adding particles */ -#define BCXMIN -2.0 -#define BCXMAX 2.0 /* x interval for boundary condition */ -#define BCYMIN -1.125 -#define BCYMAX 1.325 /* y interval for boundary condition */ +#define BCXMIN 0.0 +#define BCXMAX 6.283185307 /* x interval for boundary condition */ +#define BCYMIN 0.05 +#define BCYMAX 3.091592654 /* y interval for boundary condition */ #define OBSXMIN -2.0 #define OBSXMAX 2.0 /* x interval for motion of obstacle */ @@ -82,7 +86,7 @@ Below are parameter values used for different simulations, as well as initial co #define COUPLE_MINLENGTH 0.5 /* length at which bonds decouple */ #define ADD_FIXED_SEGMENTS 0 /* set to 1 to add fixed segments as obstacles */ -#define SEGMENT_PATTERN 15 /* pattern of repelling segments, see list in global_ljones.c */ +#define SEGMENT_PATTERN 100 /* pattern of repelling segments, see list in global_ljones.c */ #define ROCKET_SHAPE 3 /* shape of rocket combustion chamber, see list in global_ljones.c */ #define ROCKET_SHAPE_B 3 /* shape of second rocket */ #define NOZZLE_SHAPE 6 /* shape of nozzle, see list in global_ljones.c */ @@ -95,15 +99,15 @@ Below are parameter values used for different simulations, as well as initial co #define TWO_TYPES 0 /* set to 1 to have two types of particles */ #define TYPE_PROPORTION 0.5 /* proportion of particles of first type */ #define TWOTYPE_CONFIG 0 /* choice of types, see TTC_ list in global_ljones.c */ -#define SYMMETRIZE_FORCE 1 /* set to 1 to symmetrize two-particle interaction, only needed if particles are not all the same */ +#define SYMMETRIZE_FORCE 0 /* set to 1 to symmetrize two-particle interaction, only needed if particles are not all the same */ #define CENTER_PX 0 /* set to 1 to center horizontal momentum */ #define CENTER_PY 0 /* set to 1 to center vertical momentum */ #define CENTER_PANGLE 0 /* set to 1 to center angular momentum */ -#define INTERACTION 12 /* particle interaction, see list in global_ljones.c */ +#define INTERACTION 1 /* particle interaction, see list in global_ljones.c */ #define INTERACTION_B 1 /* particle interaction for second type of particle, see list in global_ljones.c */ -#define SPIN_INTER_FREQUENCY 4.0 /* angular frequency of spin-spin interaction */ -#define SPIN_INTER_FREQUENCY_B 4.0 /* angular frequency of spin-spin interaction for second particle type */ +#define SPIN_INTER_FREQUENCY 1.0 /* angular frequency of spin-spin interaction */ +#define SPIN_INTER_FREQUENCY_B 1.0 /* angular frequency of spin-spin interaction for second particle type */ #define MOL_ANGLE_FACTOR 1.0 /* rotation angle for P_MOL_ANGLE color scheme */ #define P_PERCOL 0.25 /* probability of having a circle in C_RAND_PERCOL arrangement */ @@ -113,9 +117,10 @@ Below are parameter values used for different simulations, as well as initial co #define RANDOM_POLY_ANGLE 0 /* set to 1 to randomize angle of polygons */ #define LAMBDA 0.2 /* parameter controlling the dimensions of domain */ -#define MU 0.016 /* parameter controlling radius of particles */ -#define MU_B 0.012 /* parameter controlling radius of particles of second type */ -#define MU_ADD 0.016 /* parameter controlling radius of added particles */ +#define MU 0.027 /* parameter controlling radius of particles */ +#define MU_B 0.03 /* parameter controlling radius of particles of second type */ +#define MU_ADD 0.014 /* parameter controlling radius of added particles */ +#define MU_ADD_B 0.014 /* parameter controlling radius of added particles */ #define NPOLY 3 /* number of sides of polygon */ #define APOLY 0.0 /* angle by which to turn polygon, in units of Pi/2 */ #define AWEDGE 0.5 /* opening angle of wedge, in units of Pi/2 */ @@ -124,8 +129,8 @@ Below are parameter values used for different simulations, as well as initial co #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 1 /* number of grid point for grid of disks */ -#define NGRIDY 1 /* number of grid point for grid of disks */ +#define NGRIDX 56 /* number of grid point for grid of disks */ +#define NGRIDY 28 /* number of grid point for grid of disks */ #define EHRENFEST_RADIUS 0.9 /* radius of container for Ehrenfest urn configuration */ #define EHRENFEST_WIDTH 0.035 /* width of tube for Ehrenfest urn configuration */ #define TWO_CIRCLES_RADIUS_RATIO 0.8 /* ratio of radii for S_TWO_CIRCLES_EXT segment configuration */ @@ -141,8 +146,8 @@ Below are parameter values used for different simulations, as well as initial co /* Parameters for length and speed of simulation */ -#define NSTEPS 5200 /* number of frames of movie */ -#define NVID 100 /* number of iterations between images displayed on screen */ +#define NSTEPS 2100 /* number of frames of movie */ +#define NVID 100 /* number of iterations between images displayed on screen */ #define NSEG 25 /* number of segments of boundary of circles */ #define INITIAL_TIME 0 /* time after which to start saving frames */ #define OBSTACLE_INITIAL_TIME 0 /* time after which to start moving obstacle */ @@ -155,25 +160,25 @@ Below are parameter values used for different simulations, as well as initial co #define SLEEP1 1 /* initial sleeping time */ #define SLEEP2 1 /* final sleeping time */ #define MID_FRAMES 100 /* number of still frames between parts of two-part movie */ -#define END_FRAMES 100 /* number of still frames at end of movie */ +#define END_FRAMES 200 /* number of still frames at end of movie */ /* Boundary conditions, see list in global_ljones.c */ -#define BOUNDARY_COND 1 +#define BOUNDARY_COND 30 /* Plot type, see list in global_ljones.c */ -#define PLOT 13 -#define PLOT_B 17 /* plot type for second movie */ +#define PLOT 4 +#define PLOT_B 13 /* plot type for second movie */ /* Background color depending on particle properties */ #define COLOR_BACKGROUND 0 /* set to 1 to color background */ -#define BG_COLOR 6 /* type of background coloring, see list in global_ljones.c */ -#define BG_COLOR_B 9 /* type of background coloring, see list in global_ljones.c */ +#define BG_COLOR 10 /* type of background coloring, see list in global_ljones.c */ +#define BG_COLOR_B 3 /* type of background coloring, see list in global_ljones.c */ #define OBSTACLE_COLOR 0 /* type of obstacle, see OC_ in global_ljones.c */ -#define DRAW_BONDS 0 /* set to 1 to draw bonds between neighbours */ +#define DRAW_BONDS 1 /* set to 1 to draw bonds between neighbours */ #define COLOR_BONDS 1 /* set to 1 to color bonds according to length */ #define FILL_TRIANGLES 0 /* set to 1 to fill triangles between neighbours */ #define DRAW_CLUSTER_LINKS 0 /* set to 1 to draw links between particles in cluster */ @@ -224,7 +229,7 @@ Below are parameter values used for different simulations, as well as initial co #define COLOR_HUESHIFT 1.0 /* shift in color hue (for some cyclic palettes) */ #define PRINT_PARAMETERS 1 /* set to 1 to print certain parameters */ -#define PRINT_TEMPERATURE 0 /* set to 1 to print current temperature */ +#define PRINT_TEMPERATURE 1 /* set to 1 to print current temperature */ #define PRINT_ANGLE 0 /* set to 1 to print obstacle orientation */ #define PRINT_OMEGA 0 /* set to 1 to print angular speed */ #define PRINT_PARTICLE_SPEEDS 0 /* set to 1 to print average speeds/momenta of particles */ @@ -241,7 +246,9 @@ Below are parameter values used for different simulations, as well as initial co #define PARTICLE_HUE_MIN 359.0 /* color of original particle */ #define PARTICLE_HUE_MAX 0.0 /* color of saturated particle */ #define PARTICLE_EMIN 0.0 /* energy of particle with coolest color */ -#define PARTICLE_EMAX 50000.0 /* energy of particle with hottest color */ +#define PARTICLE_EMAX 2000.0 /* energy of particle with hottest color */ +#define PARTICLE_DMIN 200.0 /* energy of particle with largest local density */ +#define PARTICLE_DMAX 500.0 /* energy of particle with largest local density */ #define SEGMENT_HUE_MIN 275.0 /* color of original segment */ #define SEGMENT_HUE_MAX 30.0 /* color of saturated segment */ #define OBSTACLE_EMAX 1000000.0 /* energy of obstacle with hottest color */ @@ -254,7 +261,9 @@ Below are parameter values used for different simulations, as well as initial co #define HUE_TYPE5 60.0 /* hue of particles of type 5 */ #define HUE_TYPE6 130.0 /* hue of particles of type 6 */ #define HUE_TYPE7 150.0 /* hue of particles of type 7 */ -#define BG_FORCE_SLOPE 1.0e-6 /* contant in BG_FORCE backgound color scheme*/ +#define BG_LOG_EKIN_SHIFT 1.0 /* constant in BG_LOG_EKIN background color scheme */ +#define BG_FORCE_SLOPE 1.0e-6 /* constant in BG_FORCE backgound color scheme */ +#define BG_CHARGE_SLOPE 0.75 /* constant in BG_CHARGE backgound color scheme (default: 0.5) */ #define PARTICLE_LMAX 1.5e4 /* angular momentum particle with brightest color */ #define RANDOM_RADIUS 0 /* set to 1 for random particle radius */ @@ -264,39 +273,42 @@ Below are parameter values used for different simulations, as well as initial co #define ADAPT_DAMPING_TO_RADIUS 0.0 /* set to positive value to for friction prop to power of radius */ #define ADAPT_DAMPING_FACTOR 0.0 /* factor by which damping is adapted to radius */ #define DT_PARTICLE 1.0e-6 /* time step for particle displacement */ -#define KREPEL 20.0 /* constant in repelling force between particles */ -#define EQUILIBRIUM_DIST 4.0 /* Lennard-Jones equilibrium distance */ -#define EQUILIBRIUM_DIST_B 4.0 /* Lennard-Jones equilibrium distance for second type of particle */ +#define KREPEL 50.0 /* constant in repelling force between particles */ +#define EQUILIBRIUM_DIST 5.0 /* Lennard-Jones equilibrium distance */ +#define EQUILIBRIUM_DIST_B 5.0 /* Lennard-Jones equilibrium distance for second type of particle */ #define SEGMENT_FORCE_EQR 1.0 /* equilibrium distance factor for force from segments (default 1.5) */ #define REPEL_RADIUS 25.0 /* radius in which repelling force acts (in units of particle radius) */ -#define DAMPING 50.0 /* damping coefficient of particles */ +#define DAMPING 0.0 /* damping coefficient of particles */ #define INITIAL_DAMPING 1000.0 /* damping coefficient of particles during initial phase */ -#define DAMPING_ROT 5.0 /* damping coefficient for rotation of particles */ +#define DAMPING_ROT 50.0 /* damping coefficient for rotation of particles */ #define DAMPING_PAIRS 0.0 /* damping between paired particles */ -#define PARTICLE_MASS 2.0 /* mass of particle of radius MU */ +#define PARTICLE_MASS 1.0 /* mass of particle of radius MU */ #define PARTICLE_MASS_B 1.0 /* mass of particle of radius MU_B */ -#define PARTICLE_ADD_MASS 2.0 /* mass of added particles */ +#define PARTICLE_ADD_MASS 4.0 /* mass of added particles */ +#define PARTICLE_ADD_MASS_B 1.0 /* mass of added particles */ #define PARTICLE_INERTIA_MOMENT 0.1 /* moment of inertia of particle */ #define PARTICLE_INERTIA_MOMENT_B 0.1 /* moment of inertia of second type of particle */ -#define V_INITIAL 100.0 /* initial velocity range */ -#define V_INITIAL_ADD 100.0 /* initial velocity range for added particles */ +#define V_INITIAL 25.0 /* initial velocity range */ +#define V_INITIAL_ADD 0.0 /* initial velocity range for added particles */ #define OMEGA_INITIAL 100.0 /* initial angular velocity range */ #define VICSEK_VMIN 1.0 /* minimal speed of particles in Vicsek model */ #define VICSEK_VMAX 40.0 /* minimal speed of particles in Vicsek model */ #define COULOMB_LJ_FACTOR 1.0 /* relative intensity of LJ interaction in I_COULOMB_LJ interaction (default: 0.01) */ +#define KCOULOMB_FACTOR 50.0 /* relative intensity of Coulomb interaction in I_COULOMB_LJ (default: 100.0) */ #define OBSTACLE_DAMPING 0.0 /* damping of oscillating obstacles */ #define V_INITIAL_TYPE 0 /* type of initial speed distribution (see VI_ in global_ljones.c) */ -#define THERMOSTAT 0 /* set to 1 to switch on thermostat */ +#define THERMOSTAT 1 /* set to 1 to switch on thermostat */ #define VARY_THERMOSTAT 0 /* set to 1 for time-dependent thermostat schedule */ #define SIGMA 5.0 /* noise intensity in thermostat */ -#define BETA 0.004 /* initial inverse temperature */ +#define BETA 0.0005 /* initial inverse temperature */ #define MU_XI 0.005 /* friction constant in thermostat */ #define KSPRING_BOUNDARY 2.0e11 /* confining harmonic potential outside simulation region */ #define KSPRING_OBSTACLE 5.0e11 /* harmonic potential of obstacles */ -#define NBH_DIST_FACTOR 4.0 /* radius in which to count neighbours */ -#define GRAVITY 10000.0 /* gravity acting on all particles */ +#define NBH_DIST_FACTOR 6.0 /* radius in which to count neighbours */ +#define BOND_DIST_FACTOR 6.0 /* radius in which to draw bonds */ +#define GRAVITY 0.0 /* gravity acting on all particles */ #define GRAVITY_X 0.0 /* horizontal gravity acting on all particles */ #define CIRCULAR_GRAVITY 0 /* set to 1 to have gravity directed to center */ #define INCREASE_GRAVITY 0 /* set to 1 to increase gravity during the simulation */ @@ -312,9 +324,10 @@ Below are parameter values used for different simulations, as well as initial co #define EFIELD_Y 0.0 /* value of electric field */ #define ADD_BFIELD 0 /* set to 1 to add a magnetic field */ #define BFIELD 20000.0 /* value of magnetic field */ -#define CHARGE 1.0 /* charge of particles of first type */ -#define CHARGE_B -1.0 /* charge of particles of second type */ -#define CHARGE_ADD 1.0 /* charge of added particles */ +#define CHARGE 0.0 /* charge of particles of first type */ +#define CHARGE_B 0.0 /* charge of particles of second type */ +#define CHARGE_ADD -1.0 /* charge of added particles */ +#define CHARGE_ADD_B 1.0 /* charge of added particles */ #define INCREASE_E 0 /* set to 1 to increase electric field */ #define OSCILLATE_E 0 /* set to 1 for oscillating electric field */ #define E_PERIOD 1000 /* period of oscillating electric field */ @@ -341,30 +354,31 @@ Below are parameter values used for different simulations, as well as initial co #define WIND_FORCE 1.35e6 /* force of wind */ #define WIND_YMIN -0.6 /* min altitude of region with wind */ -#define ROTATION 0 /* set to 1 to include rotation of particles */ -#define COUPLE_ANGLE_TO_THERMOSTAT 0 /* set to 1 to couple angular degrees of freedom to thermostat */ -#define DIMENSION_FACTOR 1.0 /* scaling factor taking into account number of degrees of freedom */ -#define KTORQUE 1.0e5 /* force constant in angular dynamics */ +#define ROTATION 1 /* set to 1 to include rotation of particles */ +#define COUPLE_ANGLE_TO_THERMOSTAT 1 /* set to 1 to couple angular degrees of freedom to thermostat */ +#define DIMENSION_FACTOR 0.25 /* scaling factor taking into account number of degrees of freedom */ +#define KTORQUE 2.0e3 /* force constant in angular dynamics */ #define KTORQUE_BOUNDARY 1.0e5 /* constant in torque from the boundary */ #define KTORQUE_B 10.0 /* force constant in angular dynamics */ #define KTORQUE_DIFF 500.0 /* force constant in angular dynamics for different particles */ -#define DRAW_SPIN 0 /* set to 1 to draw spin vectors of particles */ +#define DRAW_SPIN 1 /* set to 1 to draw spin vectors of particles */ #define DRAW_SPIN_B 0 /* set to 1 to draw spin vectors of particles */ #define DRAW_CROSS 1 /* set to 1 to draw cross on particles of second type */ #define DRAW_MINUS 1 /* set to 1 to draw cross on particles of negative charge */ -#define SPIN_RANGE 10.0 /* range of spin-spin interaction */ -#define SPIN_RANGE_B 10.0 /* range of spin-spin interaction for second type of particle */ +#define SPIN_RANGE 5.0 /* range of spin-spin interaction */ +#define SPIN_RANGE_B 5.0 /* range of spin-spin interaction for second type of particle */ #define QUADRUPOLE_RATIO 0.6 /* anisotropy in quadrupole potential */ -#define INCREASE_BETA 0 /* set to 1 to increase BETA during simulation */ -#define BETA_SCHEDULE 3 /* type of temperature schedule, see TS_* in global_ljones */ -#define BETA_FACTOR 0.06 /* factor by which to change BETA during simulation */ +#define INCREASE_BETA 1 /* set to 1 to increase BETA during simulation */ +#define BETA_SCHEDULE 1 /* type of temperature schedule, see TS_* in global_ljones */ +#define BETA_FACTOR 100.0 /* factor by which to change BETA during simulation */ #define TS_SLOPE 8.5 /* controls speed of change of BETA for TS_TANH schedule (default 1.0) */ -#define N_TOSCILLATIONS 1.0 /* number of temperature oscillations in BETA schedule */ +#define N_TOSCILLATIONS 1.5 /* number of temperature oscillations in BETA schedule */ #define NO_OSCILLATION 0 /* set to 1 to have exponential BETA change only */ -#define MIDDLE_CONSTANT_PHASE 0 /* final phase in which temperature is constant */ -#define FINAL_DECREASE_PHASE 0 /* final phase in which temperature decreases */ -#define FINAL_CONSTANT_PHASE -1 /* final phase in which temperature is constant */ +#define INITIAL_CONSTANT_PHASE 500 /* initial phase in which temperature is constant */ +#define MIDDLE_CONSTANT_PHASE 0 /* middle phase in which temperature is constant */ +#define FINAL_DECREASE_PHASE 1 /* final phase in which temperature decreases */ +#define FINAL_CONSTANT_PHASE 200 /* final phase in which temperature is constant */ #define DECREASE_CONTAINER_SIZE 0 /* set to 1 to decrease size of container */ #define SMOOTH_CONTAINER_DECREASE 1 /* set to 1 to decrease size smoothly at each simulation step */ @@ -401,21 +415,24 @@ Below are parameter values used for different simulations, as well as initial co #define MASS_PART_BOTTOM 10000.0 /* mass of particles at bottom */ #define NPART_BOTTOM 100 /* number of particles at the bottom */ -#define ADD_PARTICLES 1 /* set to 1 to add particles */ -#define ADD_REGION 0 /* shape of add regions, cf ADD_* in global_ljones */ +#define ADD_PARTICLES 0 /* set to 1 to add particles */ +#define ADD_REGION 1 /* shape of add regions, cf ADD_* in global_ljones */ #define ADD_TIME 0 /* time at which to add first particle */ -#define ADD_PERIOD 25 /* time interval between adding further particles */ +#define ADD_PERIOD 6 /* time interval between adding further particles */ +#define ADD_TYPE 1 /* type of added particles */ #define N_ADD_PARTICLES 1 /* number of particles to add */ -#define FINAL_NOADD_PERIOD 1000 /* final period where no particles are added */ +#define FINAL_NOADD_PERIOD 1800 /* final period where no particles are added */ #define SAFETY_FACTOR 4.0 /* no particles are added at distance less than MU*SAFETY_FACTOR of other particles */ -#define ADD_ALTERNATE_CHARGE 0 /* set to 1 to randomly select sign of added charge */ +#define ADD_ALTERNATE_CHARGE 1 /* set to 1 to randomly select sign of added charge */ +#define TIME_DEPENDENT_ADD_CHARGE 0 /* set to 1 to have added charge depend on time */ +#define ALTERNATE_CHARGE_PROPORTION 0.5 /* proportion of particles of opposite charge */ -#define TRACER_PARTICLE 1 /* set to 1 to have a tracer particle */ -#define N_TRACER_PARTICLES 500 /* number of tracer particles */ +#define TRACER_PARTICLE 0 /* set to 1 to have a tracer particle */ +#define N_TRACER_PARTICLES 1000 /* number of tracer particles */ #define TRACER_STEPS 5 /* number of tracer steps recorded between images */ -#define TRAJECTORY_LENGTH 5200 /* length of recorded trajectory */ -#define TRAJECTORY_DRAW_LENGTH 1000 /* length of drawn trajectory */ -#define TRACER_LUM_FACTOR 25.0 /* controls luminosity decrease of trajectories with time */ +#define TRAJECTORY_LENGTH 7000 /* length of recorded trajectory */ +#define TRAJECTORY_DRAW_LENGTH 250 /* length of drawn trajectory */ +#define TRACER_LUM_FACTOR 100.0 /* controls luminosity decrease of trajectories with time */ #define TRACER_PARTICLE_MASS 2.0 /* relative mass of tracer particle */ #define TRAJECTORY_WIDTH 2 /* width of tracer particle trajectory */ @@ -469,11 +486,12 @@ Below are parameter values used for different simulations, as well as initial co #define SPECIAL_IC 0 /* set to 1 for choosing specaial initial condition RD_INITIAL_COND */ #define REACTION_DIFFUSION 0 /* set to 1 to simulate a chemical reaction (particles may change type) */ -#define REACTION_MAX_TIME 100 /* time after which no reactions take place */ -#define RD_REACTION 231 /* type of reaction, see list in global_ljones.c */ +#define REACTION_MAX_TIME 100000 /* time after which no reactions take place */ +#define RD_REACTION 23 /* type of reaction, see list in global_ljones.c */ #define RD_TYPES 2 /* number of types in reaction-diffusion equation */ +#define RD_PLOT_TYPES 6 /* number of types shown in graph */ #define RD_INITIAL_COND 51 /* initial condition of particles */ -#define REACTION_DIST 1.8 /* maximal distance for reaction to occur */ +#define REACTION_DIST 2.5 /* maximal distance for reaction to occur */ #define REACTION_PROB 1.0 /* probability controlling reaction term */ #define DISSOCIATION_PROB 0.0 /* probability controlling dissociation reaction */ #define KILLING_PROB 0.0015 /* probability of enzymes being killed */ @@ -485,8 +503,9 @@ Below are parameter values used for different simulations, as well as initial co #define COLLISION_TIME 25 /* time during which collisions are shown */ #define COLLISION_RADIUS 2.0 /* radius of discs showing collisions, in units of MU */ #define DELTAVMAX 200.0 /* maximal deltav allowed for pairing molecules */ -#define AGREGMAX 1 /* maximal number of partners for CHEM_AGGREGATION reaction */ +#define AGREGMAX 4 /* maximal number of partners for CHEM_AGGREGATION reaction */ #define AGREG_DECOUPLE 12 /* minimal number of partners to decouple from thermostat */ +#define NEUTRALIZE_REACTING_PARTICLES 0 /* set to 1 for reacting particles to become neutral */ #define CLUSTER_PARTICLES 0 /* set to 1 for particles to form rigid clusters */ #define CLUSTER_MAXSIZE 2 /* max size of clusters */ #define SMALL_CLUSTER_MAXSIZE 2 /* size limitation on smaller cluster */ @@ -518,10 +537,12 @@ Below are parameter values used for different simulations, as well as initial co #define WALL_TIME 0 /* time during which to keep wall */ #define CHANGE_TYPES 0 /* set to 1 to change type proportion in course of simulation */ -#define PROP_MIN 0.1 /* min proportion of type 1 particles */ -#define PROP_MAX 0.9 /* max proportion of type 1 particles */ +#define PROP_MIN 0.0 /* min proportion of type 1 particles */ +#define PROP_MAX 1.0 /* max proportion of type 1 particles */ +#define PROP_TINITIAL 250 /* initial time without change */ +#define PROP_TFINAL 250 /* final time without change */ -#define PAIR_PARTICLES 1 /* set to 1 to form particles pairs */ +#define PAIR_PARTICLES 0 /* set to 1 to form particles pairs */ #define RANDOMIZE_ANGLE 0 /* set to 1 for random orientation */ #define DEACIVATE_CLOSE_PAIRS 0 /* set to 1 to test for closeness to other particles */ #define PAIR_SAFETY_FACTOR 1.2 /* distance to deactivate divided by sum of radii */ @@ -560,12 +581,12 @@ Below are parameter values used for different simulations, as well as initial co #define MAZE_WIDTH 0.015 /* width of maze walls */ #define FLOOR_FORCE 1 /* set to 1 to limit force on particle to FMAX */ -#define FMAX 1.0e9 /* maximal force */ +#define FMAX 1.0e8 /* maximal force */ #define FLOOR_OMEGA 0 /* set to 1 to limit particle momentum to PMAX */ #define PMAX 1000.0 /* maximal force */ -#define HASHX 40 /* size of hashgrid in x direction */ -#define HASHY 20 /* size of hashgrid in y direction */ +#define HASHX 60 /* size of hashgrid in x direction */ +#define HASHY 30 /* size of hashgrid in y direction */ #define HASHMAX 100 /* maximal number of particles per hashgrid cell */ #define HASHGRID_PADDING 0.1 /* padding of hashgrid outside simulation window */ @@ -576,1203 +597,31 @@ Below are parameter values used for different simulations, as well as initial co #define LIMIT_ENERGY 0 /* set to 1 to limit energy, when there is no thermostat */ -``` - -### 28 July 2025 - Energy of a circular wave crossing a refracting metamaterial with a hex structure ### - -**Program:** `wave_energy.c` - -**Initial condition in function `animation()`:** - -``` - init_wave_flat_comp(phi, psi, xy_in); - - /* add oscillating waves */ - wave_source_x[0] = -1.0; - wave_source_y[0] = 0.5*YMIN; - source_periods[0] = OSCILLATING_SOURCE_PERIOD; - source_amp[0] = INITIAL_AMP; - for (source = 0; source < N_SOURCES; source++) - { - dperiod = source_periods[source]; - phase = i - (int)(dperiod*(double)((int)((double)i/dperiod))); - if ((ADD_OSCILLATING_SOURCE)&&(phase == 1)&&(i