Nils BerglundThis is a variant of the video youtu.be/HNBTewymZa4 of a device sorting particles by size. The particles are heptagons instead of pentagons, and the friction is 20% lower as in the previous video. The particle sorter in this simulation is inspired by a comment to a previous video. Instead of using several sieves one above the other, it uses a single sieve, with rotating obstacles of decreasing radius and increasing gaps between them.The obstacles rotate and exert a tangential force on the particles, in order to decrease clogging of the sieves. The angular speed of the obstacles varies periodically in time, in order to reduce the chance of particles getting stuck. In addition, the obstacles have a circular motion of small amplitude, which reduces the chances of particles getting stuck even more. The conveyor belt effect results from the segments forming the belt exerting a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. The color of the polygons depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
Sorting heptagons with a linear sieveNils Berglund2024-09-30 | This is a variant of the video youtu.be/HNBTewymZa4 of a device sorting particles by size. The particles are heptagons instead of pentagons, and the friction is 20% lower as in the previous video. The particle sorter in this simulation is inspired by a comment to a previous video. Instead of using several sieves one above the other, it uses a single sieve, with rotating obstacles of decreasing radius and increasing gaps between them.The obstacles rotate and exert a tangential force on the particles, in order to decrease clogging of the sieves. The angular speed of the obstacles varies periodically in time, in order to reduce the chance of particles getting stuck. In addition, the obstacles have a circular motion of small amplitude, which reduces the chances of particles getting stuck even more. The conveyor belt effect results from the segments forming the belt exerting a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. The color of the polygons depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #polygons #conveyorTrajectories in a mass spectrometerNils Berglund2024-10-18 | This remake of the video youtu.be/O837373mq-Y with particle trajectories was requested by viewers. The simulation illustrates the principle of a mass spectrometer, which is a device allowing to sort charged particles according the their mass/charge ratio. The particles injected on the left side have an random radius, a mass proportional to their radius squared, and a constant positive charge. There is a constant electric field, directed from left to right, that accelerates the particles. In the middle of the simulation region, there is a constant magnetic field, perpendicular to the simulation plane. The particles interact via a Lennard-Jones potential, and are subject to a viscous drag, in order to avoid numerical instability. The Coulomb interaction between particles has been turned off, however, since otherwise they would not stay in the bins at the right (in practice, one uses more elaborate ways to collect the separated particles). The particles' acceleration, resulting from the Lorentz force, is proportional to the ratio between their charge and their mass. Therefore, lighter particles are deflected more, and tend to land in lower bins than heavier particles. The video has two parts, showing the same simulation with two different representations. With trajectories: 0:00 Without trajectories: 2:44 The particles' color depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #mass_spectrometerCreating rotating waves in a circle with fifteen angled secondary cavitiesNils Berglund2024-10-17 | This simulation of a resonating cavity implements a suggestion made by viewers of a previous simulation. It is a variant of the simulation youtu.be/cimKdtw04hg using 15 instead of 10 secondary cavities. By placing the channels connecting the main cavity to the secondary ones at an angle, instead of radially, the waves excited in the main cavity should have a tendency to rotate. It turns out that this works indeed quite well. Another difference with the previous video is the order in which the sources fire: instead of oscillating in the same order they are placed around the central cavity, the sources at odd positions fire before those at even positions. This different phase shift creates a larger angular velocity. This video has two parts, showing the same evolution with two different color gradients: Wave height: 0:00 Averaged wave energy: 1:43 In the first part, the color hue depends on the height of the wave. In the second part, it depends on the energy of the wave, slightly averaged over a sliding time window.
Music: "Electrosamba" by Quincas Moreira@QuincasMoreira
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorSimulation of an asteroid impact between Ireland and NewfoundlandNils Berglund2024-10-16 | This new simulation of an asteroid impact assumes the asteroid falls into the North Atlantic ocean about halfway between Ireland and Newfoundland, more to the north than in the previous simulation youtu.be/cr3rCxjWL4k of a North Atlantic impact. The simulation includes a respawning of tracer particles, which gives a better idea of the velocity field. The simulation is based on a shallow water equation. The model includes lunar forcing accounting for tides, and allows for some flooding of land areas. The vertical scale of both mountains and waves has been exaggerated. The main difference between the nonlinear equation and the linear wave equation is that the wave speed becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. This causes problems in the simulation, because land masses can lead to blow-up of the solution. This problem is circumvented here by replacing the continents by a repelling force field, plus a dissipative term. The initial state features velocities radiating outward from the impact point of the asteroid. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations at two different speeds and with two different visualizations: Time lapse, 3D: 0:00 Time lapse, 2D: 0:16 Original speed, 3D: 0:32 Original speed, 2D: 1:38 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. In the 3D parts, the point of view is slowly rotating around the Earth in a plane containing its center. In parts 1 and 2, the animation has been speeded up by a factor 4. The velocity field is materialized by 2000 tracer particles that are advected by the flow. The tracers are randomly "respawned", by moving them to a random new location at random times. This is to avoid that particles concentrate in some areas, as has happened on some previous simulations.
Render time: 3D parts - 2 hours 26 minutes 2D parts - 2 hours 18 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "The Arid Land" by Sir Cubworth@SirCubworth
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #EarthWinnowing 3: Throwing the particles from the groundNils Berglund2024-10-15 | This variant of the video youtu.be/jd5dmbsgqic shows again the process of sorting particles by size using wind, the difference being that here the particles are thrown from near the ground instead of being dropped from above. This is closer to the real process used for winnowing, or separating grain from chaff by throwing it into the air, after it has been threshed. There are a few more sorting errors than in the previous simulation, which seem to be due to collisions between particles. In this simulation, the particles have different sizes, but the same mass. They are subjected to gravity, and to a horizontal force proportional to their radius, modeling the effect of wind. The wind stops a short distance above the bins at the bottom, to avoid that the particles bounce on the bins' walls. The particles' color depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #winnowingCreating rotating waves in a circle with ten angled secondary cavitiesNils Berglund2024-10-14 | This simulation of a resonating cavity implements a suggestion made by viewers of a previous simulation: By placing the channels connecting the main cavity to the secondary ones at an angle, instead of radially, the waves excited in the main cavity should have a tendency to rotate. It turns out that this works indeed quite well. This video has two parts, showing the same evolution with two different color gradients: Wave height: 0:00 Averaged wave energy: 2:04 In the first part, the color hue depends on the height of the wave. In the second part, it depends on the energy of the wave, slightly averaged over a sliding time window.
Music: "September Pass" by Asher Fulero@AsherFulero
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorViewer request: Simulation of an asteroid impact off the coast of CaliforniaNils Berglund2024-10-13 | This simulation has been requested by a viewer, who wanted to see the effect of an asteroid impact "500 km off the coast of Santa Monica". They didn't say why, maybe it's because their mother in law lives there, but since I have the code ready, I am happy to oblige. The simulation is based on a shallow water equation. The model includes lunar forcing accounting for tides, and allows for some flooding of land areas. The vertical scale of both mountains and waves has been exaggerated. The main difference between the nonlinear equation and the linear wave equation is that the wave speed becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. This causes problems in the simulation, because land masses can lead to blow-up of the solution. This problem is circumvented here by replacing the continents by a repelling force field, plus a dissipative term. The initial state features velocities radiating outward from the impact point of the asteroid. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations at two different speeds and with two different visualizations: Time lapse, 3D: 0:00 Time lapse, 2D: 0:14 Original speed, 3D: 0:29 Original speed, 2D: 1:26 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. In the 3D parts, the point of view is slowly rotating around the Earth in a plane containing its center. In parts 1 and 2, the animation has been speeded up by a factor 4. The velocity field is materialized by 2000 tracer particles that are advected by the flow. The tracers are randomly "respawned", by moving them to a random new location at random times. This is to avoid that particles concentrate in some areas, as has happened on some previous simulations.
Render time: 3D parts - 2 hours 2 minutes 2D parts - 1 hour 50 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "Frequency" by Silent Partner
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #EarthWinnowing 2: Separating triangles by size using windNils Berglund2024-10-12 | This is a variant of the video youtu.be/jd5dmbsgqic , illustrating the process of winnowing, but with triangular instead of circular particles. Using wind to separate particles according to their size is an old method, going back to winnowing, or separating grain from chaff by throwing it into the air after it has been threshed. In this simulation, the particles have different sizes, but the same mass. They are subjected to gravity, and to a horizontal force proportional to their radius, modeling the effect of wind. The wind stops a short distance above the bins at the bottom, to avoid that the particles bounce on the bins' walls. The video has two parts, showing the same simulation with two different color gradients. Particle size: 0:00 Kinetic energy: 2:36 In part 1, the particles' color depends on their size. In part 2, in depends on the direction of their velocity. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle.
Music: "Sunshine on Sand" by the Unicorn Heads@UnicornHeads
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #winnowingExciting resonant modes in a circle, with a single source and sixteen secondary cavitiesNils Berglund2024-10-11 | This is a variant of the video youtu.be/XmJ_Ydldqvk , showing waves in a circular cavity excited by pulsing sources in other, connected cavities. In this case, there are sixteen secondary cavities, but only one source. One can notice that after a while, this source excites standing waves in all sixteen cavities. This video has two parts, showing the same evolution with two different color gradients: Wave height: 0:00 Averaged wave energy: 2:12 In the first part, the color hue depends on the height of the wave. In the second part, it depends on the energy of the wave, slightly averaged over a sliding time window.
Music: "Lazy Laura" by Quincas Moreira@QuincasMoreira
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorA tide simulation with a more realistic lunar forcingNils Berglund2024-10-10 | The simulation youtu.be/QYqjmapPKsc tried to reproduce tides on the Earth, but the lunar forcing was way too strong. In this variant, the lunar forcing has been reduced to about 40% of its value in the previous video, with a more realistic result. The effect of the Moon is modeled here by a force acting on the water height, which is maximal at the part of Earth closest to the Moon and at its antipodal point. The motion of the water is modeled by a shallow water equation, taking the varying ocean depth into account. The main difference between the nonlinear equation and the linear wave equation is that the wave speed becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. This causes problems in the simulation, because land masses can lead to blow-up of the solution. This problem is circumvented here by replacing the continents by a repelling force field, plus a dissipative term. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations at two different speeds and with two different visualizations: Original speed, 3D: 0:00 Original speed, 2D: 1:13 Time lapse, 3D: 2:27 Time lapse, 2D: 2:46 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. The longitude closest to the Moon is indicated by a vertical line in the 2D parts. In the 3D parts, the point of view is slowly rotating around the Earth in a circular orbit. In parts 3 and 4, the animation has been speeded up by a factor 4. The velocity field is materialized by 2000 tracer particles that are advected by the flow. A modification compared to previous simulations is that the particles are "respawned" at random times, meaning that their location is changed randomly. This avoids the concentration of tracers seen in some previous simulations.
Render time: 3D parts - 2 hours 12 minutes 2D parts - 2 hour 46 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "Boom Bap Flick" by Quincas Moreira@QuincasMoreira
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #Earth #tsunamiWinnowing: Separating particles by size using windNils Berglund2024-10-09 | Using wind to separate particles according to their size is an old method, going back to winnowing, or separating grain from chaff by throwing it into the air after it has been threshed. In this simulation, the particles have different sizes, but the same mass. They are subjected to gravity, and to a horizontal force proportional to their radius, modeling the effect of wind. The wind stops a short distance above the bins at the bottom, to avoid that the particles bounce on the bins' walls. The video has two parts, showing the same simulation with two different color gradients. Particle size: 0:00 Kinetic energy: 2:24 In part 1, the particles' color depends on their size. In part 2, in depends on the direction of their velocity. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #winnowingA more symmetric version of resonances in a circle excited by five out of phase sourcesNils Berglund2024-10-08 | This is a variant of the video youtu.be/4Qjj9gTLm4k showing waves excited by five out of phase sources in a circular cavity. As was pointed out in the comments, the result lacked five-fold symmetry, which seemed to be due to a phase shift of a tenth, rather than a fifth full turn. Indeed the additional factor two stemmed from the fact that the excitations changed sign after each period. This has been corrected here, resulting in somewhat more symmetric patterns. One can still notice some imperfections, though, that probably stem from the simulation lattice. This video has two parts, showing the same evolution with two different color gradients: Wave height: 0:00 Averaged wave energy: 1:32 In the first part, the color hue depends on the height of the wave. In the second part, it depends on the energy of the wave, slightly averaged over a sliding time window.
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorHow tides could look if the Moon were much closer to EarthNils Berglund2024-10-07 | Like in the video youtu.be/DNPFUomUFyw , this simulation uses a shallow water equation as a simplified model for the tides. The main difference with the previous simulation is the initial state, which already takes the influence of the Moon into account.The effect of the Moon is modeled by a force acting on the water height, which is maximal at the position of the Moon and at its antipode. The parameter tuning this effect has been chosen too large, however, so that in effect we get an impression of what tides would look like if the Moon were much closer to the Earth than it actually is. The main difference between the nonlinear equation and the linear wave equation is that the wave speed becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. This causes problems in the simulation, because land masses can lead to blow-up of the solution. This problem is circumvented here by replacing the continents by a repelling force field, plus a dissipative term. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations at two different speeds and with two different visualizations: Original speed, 3D: 0:00 Original speed, 2D: 1:05 Time lapse, 3D: 2:12 Time lapse, 2D: 2:28 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. The longitude closest to the Moon is indicated by a vertical line in the 2D parts. In the 3D parts, the point of view is slowly rotating around the Earth in a circular orbit. In parts 3 and 4, the animation has been speeded up by a factor 4. The velocity field is materialized by 2000 tracer particles that are advected by the flow.
Render time: 3D parts - 2 hours 29 minutes 2D parts - 1 hour 51 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "You're Not Wrong" by roljui@roljui1445
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #Earth #tsunamiA particle sorter with rollers of constant radius and increasing gapsNils Berglund2024-10-06 | This simulation uses a similar device sorting particles by size as the videos youtu.be/HNBTewymZa4 and youtu.be/U13YpO-nepw . The main difference is that instead of using a sieve with rollers having equally spaced centers, and decreasing radius, here the rollers have constant radius, while the distance between their axes increases. This modification was suggested in a comment to a previous video. The obstacles rotate and exert a tangential force on the particles, in order to decrease clogging of the sieves. The angular speed of the obstacles varies periodically in time, in order to reduce the chance of particles getting stuck. In addition, the obstacles have a circular motion of small amplitude, which reduces the chances of particles getting stuck even more. The conveyor belt effect results from the segments forming the belt exerting a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. The color of the polygons depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #polygons #conveyorExciting resonant modes in a circle, with fewer sources than cavitiesNils Berglund2024-10-05 | This video is based on a suggestion in a comment. Like several previous videos on this channel , this one shows waves in a circular cavity excited by pulsing sources in other, connected cavities. In this case, there are sixteen cavities, but only six sources, pulsing with a phase shift of one twelfth of the period. Source are located in every third cavity, where the spacing of 3 has been chosen because it is coprime with 16. One can notice that after a while, these sources excite standing waves in all sixteen cavities. This video has two parts, showing the same evolution with two different color gradients: Wave height: 0:00 Averaged wave energy: 1:40 In the first part, the color hue depends on the height of the wave. In the second part, it depends on the energy of the wave, slightly averaged over a sliding time window.
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorTrying to model tides with a shallow water equationNils Berglund2024-10-04 | This is an attempt at modeling tides with a shallow water equation. A version using the linear wave equation previously appeared in the video youtu.be/SqwvZX20Q2Y . The initial state has been chosen somewhat arbitrarily, just to have some currents in the oceans. Then the effect of the Moon is modeled by a force acting on the water height, which is maximal at the position of the Moon and at its antipode. The longitude closest to the Moon is indicated by a vertical line in the 2D parts. The main difference between the nonlinear equation and the linear wave equation is that the wave speed becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. This causes problems in the simulation, because land masses can lead to blow-up of the solution. This problem is circumvented here by replacing the continents by a repelling force field, plus a dissipative term. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations at two different speeds and with two different visualizations: Time lapse, 3D: 0:00 Time lapse, 2D: 0:17 Original speed, 3D: 0:35 Original speed, 2D: 1:45 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. In the 3D parts, the point of view is slowly rotating around the Earth in a circular orbit. In parts 1 and 2, the animation has been speeded up by a factor 4. The velocity field is materialized by 2000 tracer particles that are advected by the flow.
Render time: 3D parts - 1 hour 58 minutes 2D parts - 2 hours 42 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "5 Star" by Causmic@Causmic
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #Earth #tsunamiA mass spectrometerNils Berglund2024-10-03 | This simulation illustrates the principle of a mass spectrometer, which is a device allowing to sort charged particles according the their mass/charge ratio. The particles injected on the left side have an random radius, a mass proportional to their radius squared, and a constant positive charge. There is a constant electric field, directed from left to right, that accelerates the particles. In the middle of the simulation region, there is a constant magnetic field, perpendicular to the simulation plane. The particles interact via a Lennard-Jones potential, and are subject to a viscous drag, in order to avoid numerical instability. The Coulomb interaction between particles has been turned off, however, since otherwise they would not stay in the bins at the right (in practice, one uses more elaborate ways to collect the separated particles). The particles' acceleration, resulting from the Lorentz force, is proportional to the ratio between their charge and their mass. Therefore, lighter particles are deflected more, and tend to land in lower bins than heavier particles. The video has two parts, showing the same simulation with two different color gradients. Particle size: 0:00 Kinetic energy: 2:44 In part 1, the particles' color depends on their size. In part 2, in depends on their kinetic energy, which is proportional to their mass times their speed squared. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #mass_spectrometerRefraction and reflection of a shock wave - Source in medium with refractive index 3Nils Berglund2024-10-02 | Like the video youtu.be/196um7yJzf8 , this one shows a simulation of shock waves created by a source traveling faster than the wave speed in a medium, near an interface to a medium with different wave speed. The difference is that here, the lower medium has relative refractive index 0.333 (the wave speed is 3 times faster in the lower part). As a result, the waves in the lower medium sometimes propagate faster than the source. As before, part of the shock wave is refracted, changing its angle in the second medium, while part of it is reflected. The relative intensity of the reflected and refracted parts depends on the angle between shock wave and interface. This video has six parts, showing the evolution with three different speeds of the source, and two different color gradients for each speed: Speed 1, wave height: 0:00 Speed 1, averaged wave energy: 0:52 Speed 2, wave height: 1:52 Speed 2, averaged wave energy: 2:44 Speed 3, wave height: 3:44 Speed 3, averaged wave energy: 4:36 In parts 1, 3 and 5, the color hue depends on the height of the wave. In the other parts, it depends on the energy of the wave, averaged over a sliding time window. The contrast has been enhanced by a shading procedure, similar to the one I have used on videos of reaction-diffusion equations. The process is to compute the normal vector to a surface in 3D that would be obtained by using the third dimension to represent the field, and then to make the luminosity depend on the angle between the normal vector and a fixed direction.
Render time: Part 1 - 21 minutes 26 seconds Part 2 - 20 minutes 26 seconds Part 3 - 21 minutes 10 seconds Compression: crf 23 Color scheme: Part 1 - Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing Part 2 - Inferno by Nathaniel J. Smith and Stefan van der Walt github.com/BIDS/colormap
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #shock_wave #sonic_boomModeling the 2023 tsunami due to a landslide and glacier collapse in eastern GreenlandNils Berglund2024-10-01 | On 16th of September, 2023, seismologists around the world recorded an unusual signal, with an oscillation period of 90 seconds, and that lasted for 9 days. As explained in the video youtu.be/60T9TKuuujs , scientists found out that the origin of the signal was a landslide in uninhabited Dickson fjord in eastern Greenland, probably due to the collapse of a melting glacier. This landslide caused a tsunami with 200 meter high waves in the fjord. Fortunately, the wave height quickly decreased with distance from the landslide. The seismic signal was shown to have been caused by a standing wave in Dickson fjord, called a seiche, that took 9 days to dissipate. This very simplified simulation uses a shallow water equation to model the propagation of the tsunami through the Atlantic Ocean. Height of land masses and waves have been greatly exaggerated. In reality, unlike what this simulation might suggest, the tsunami had dissipated too much when reaching the coasts of Norway and Iceland to affect them. However, the seismic signal did travel much further. The main difference between the nonlinear equation and the linear wave equation is that the wave speed becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. This causes problems in the simulation, because land masses can lead to blow-up of the solution. This problem is circumvented here by replacing the continents by a repelling force field, plus a dissipative term. The initial state features velocities radiating outward from the impact point of the asteroid. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations at two different speeds and with two different visualizations: Time lapse, 3D: 0:00 Time lapse, 2D: 0:15 Original speed, 3D: 0:29 Original speed, 2D: 1:30 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. In the 3D parts, the point of view is slowly rotating around the Earth in a polar orbit. In parts 1 and 2, the animation has been speeded up by a factor 4. The velocity field is materialized by 2000 tracer particles that are advected by the flow.
Thanks to Florentin Bieder from the University of Basel for letting me know about these findings.
Render time: 3D parts - 2 hours 4 minutes 2D parts - 2 hours 8 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "Spring" by HOVATOFF@hovatoff7997
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #Earth #tsunamiExciting spirals in a circle with sixteen out of phase sourcesNils Berglund2024-09-29 | Like several previous videos on this channel , this one shows waves in a circular cavity excited by pulsing sources in other, connected cavities. In this case, there are sixteen sources, pulsing a fraction 1/32 of a period out of phase. The resulting wave patterns start to resemble spirals, as suggested in comments to a previous video. This video has two parts, showing the same evolution with two different color gradients: Wave height: 0:00 Averaged wave energy: 1:27 In the first part, the color hue depends on the height of the wave. In the second part, it depends on the energy of the wave, slightly averaged over a sliding time window. The color dependence on wave height has been chosen quite important, so that the darker regions concentrate near the nodal lines of the waves, that is, the curves where the wave height is zero.
Render time: 17 minutes 51 seconds Compression: crf 23 Color scheme: Part 1 - Twilight by Bastian Bechtold github.com/bastibe/twilight Part 2 - Inferno by Nathaniel J. Smith and Stefan van der Walt github.com/BIDS/colormap
Music: "Asleep" by Verified Picasso@verifiedpicasso7260
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorAn asteroid impact in the South Pacific OceanNils Berglund2024-09-28 | This is an attempt at modeling an asteroid impact in the South Pacific Ocean using a nonlinear wave equation. This model allows for some flooding of land areas. The vertical scale of both mountains and waves has been exaggerated. The main difference between the nonlinear equation and the linear wave equation is that the wave speed becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. This causes problems in the simulation, because land masses can lead to blow-up of the solution. This problem is circumvented here by replacing the continents by a repelling force field, plus a dissipative term. The initial state features velocities radiating outward from the impact point of the asteroid. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations at two different speeds and with two different visualizations: Time lapse, 3D: 0:00 Time lapse, 2D: 0:17 Original speed, 3D: 0:34 Original speed, 2D: 1:45 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. In the 3D parts, the point of view is slowly rotating around the Earth in a plane containing its center. In parts 1 and 2, the animation has been speeded up by a factor 4. The velocity field is materialized by 2000 tracer particles that are advected by the flow.
Render time: 3D parts - 2 hours 19 minutes 2D parts - 2 hours 25 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #EarthA particle sorter with linearly increasing gapsNils Berglund2024-09-27 | The particle sorter in this simulation is inspired by a comment to a previous video. Instead of using several sieves one above the other, it uses a single sieve, with rotating obstacles of decreasing radius and increasing gaps between them.The obstacles rotate and exert a tangential force on the particles, in order to decrease clogging of the sieves. The angular speed of the obstacles varies periodically in time, in order to reduce the chance of particles getting stuck. In addition, the obstacles have a circular motion of small amplitude, which reduces the chances of particles getting stuck even more. The conveyor belt effect results from the segments forming the belt exerting a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. The color of the polygons depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Music: "Fairy Meeting" by Emily A. Sprague@emilysprague6983
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #polygons #conveyorExciting resonant modes in a circle with ten out of phase sourcesNils Berglund2024-09-26 | Like several previous videos on this channel, this one shows waves in a circular cavity excited by pulsing sources in other, connected cavities. In this case, there are ten sources, and unlike in previous simulations, the ten sources are pulsing a twentieth of a period out of phase. Some commenters suggested trying this, in the hope that it might lead to spiraling waves. This is not quite the case, but the resulting interference patterns are interesting nonetheless. This video has two parts, showing the same evolution with two different color gradients: Wave height: 0:00 Averaged wave energy: 1:44 In the first part, the color hue depends on the height of the wave. In the second part, it depends on the energy of the wave, slightly averaged over a sliding time window.
Render time: 15 minutes 30 seconds Compression: crf 23 Color scheme: Part 1 - Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing Part 2 - Magma by Nathaniel J. Smith and Stefan van der Walt github.com/BIDS/colormap
Music: "Absolutely Nothing" by Jeremy Blake@RedMeansRecording
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorAn equatorial asteroid impact in the Pacific OceanNils Berglund2024-09-25 | This is an attempt at modeling an equatorial asteroid impact in the Pacific Ocean using a nonlinear wave equation. This model allows for some flooding of land areas. The vertical scale of both mountains and waves has been exaggerated. The main difference between the nonlinear equation and the linear wave equation is that the wave speed becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. This causes problems in the simulation, because land masses can lead to blow-up of the solution. This problem is circumvented here by replacing the continents by a repelling force field, plus a dissipative term. The initial state features velocities radiating outward from the impact point of the asteroid. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations at two different speeds and with two different visualizations: Time lapse, 3D: 0:00 Time lapse, 2D: 0:16 Original speed, 3D: 0:33 Original speed, 2D: 1:39 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. In the 3D parts, the point of view is slowly rotating around the Earth in a plane containing its center. In parts 1 and 2, the animation has been speeded up by a factor 4. The velocity field is materialized by 2000 tracer particles that are advected by the flow.
Render time: 3D parts - 1 hour 49 minutes 2D parts - 2 hours 17 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "Red Sea" by Riot
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #EarthSorting magnetized bestagons by sizeNils Berglund2024-09-24 | This simulation uses the same sorting device as in the video youtu.be/EcCHSkKQ8ic , including sieves that "rattle" to avoid clogging, with hexagonal instead of square particles. The friction force is proportional to the radius of the hexagons, which helps stabillizing the larger hexagons in the rightmost bin. In addition, a torque between hexagons has been added, which tends to align their orientation. The sorting set-up consists in three grids of obstacles with decreasing space between them, acting as particle sieves. The obstacles rotate and exert a tangential force on the particles, in order to decrease clogging of the sieves. The angular speed of the obstacles varies periodically in time, in order to reduce the chance of particles getting stuck. In addition, the obstacles have a circular motion of small amplitude, which reduces the chances of particles getting stuck even more. The conveyor belt effect results from the segments forming the belt exerting a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. The color of the polygons depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #polygons #conveyorExciting resonant modes in a circle with five out of phase sourcesNils Berglund2024-09-23 | Like several previous videos on this channel , this one shows waves in a circular cavity excited by pulsing sources in other, connected cavities. In this case, there are five sources, and unlike in previous simulations, the five sources are pulsing a fifth of a period out of phase. Some commenters suggested trying this, in the hope that it might lead to spiraling waves. This is not quite the case, but the resulting interference patterns are interesting nonetheless. This video has two parts, showing the same evolution with two different color gradients: Wave height: 0:00 Averaged wave energy: 1:32 In the first part, the color hue depends on the height of the wave. In the second part, it depends on the energy of the wave, slightly averaged over a sliding time window.
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorAn asteroid impact in the North Pacific Ocean, with tsunami-induced floodingNils Berglund2024-09-22 | This is an attempt at modeling an asteroid impact in the North Pacific Ocean using a nonlinear wave equation. This model allows for some flooding of land areas. The vertical scale of both mountains and waves has been exaggerated. A mistake in the code has been corrected, which incorrectly computed the influence of the non-constant ocean depth - the east-west component of that force was using the north-south gradient of the depth, instead of the east-west gradient. The display of land masses has also been improved, by using a different criterion than before to distinguish land from sea. The main difference between the nonlinear equation and the linear wave equation is that the wave speed becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. This causes problems in the simulation, because land masses can lead to blow-up of the solution. This problem is circumvented here by replacing the continents by a repelling force field, plus a dissipative term. The initial state features velocities radiating outward from the impact point of the asteroid. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations at two different speeds and with two different visualizations: Time lapse, 3D: 0:00 Time lapse, 2D: 0:15 Original speed, 3D: 0:30 Original speed, 2D: 1:33 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. In the 3D parts, the point of view is slowly rotating around the Earth in a plane containing its center. In parts 1 and 2, the animation has been speeded up by a factor 4. The velocity field is materialized by 2000 tracer particles that are advected by the flow.
Render time: 3D parts - 1 hour 44 minutes 2D parts - 1 hours 38 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "Wandering Gaze" by Chasms@felte
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #EarthSorting triangles with rattling sievesNils Berglund2024-09-21 | This simulation uses the same sorting device as in the video youtu.be/EcCHSkKQ8ic , including sieves that "rattle" to avoid clogging, with triangular instead of square particles. Another difference is that larger particles experience a larger friction force. This reduces the instability of the largest particles, in the rightmost bin, to some degree, although they still have trouble settling down. The sorting set-up consists in three grids of obstacles with decreasing space between them, acting as particle sieves. The obstacles rotate and exert a tangential force on the particles, in order to decrease clogging of the sieves. The angular speed of the obstacles varies periodically in time, in order to reduce the chance of particles getting stuck. In addition, the obstacles have a circular motion of small amplitude, which reduces the chances of particles getting stuck even more. The conveyor belt effect results from the segments forming the belt exerting a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. The color of the polygons depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #polygons #conveyorUsing seven sources to excite resonant modes in a circleNils Berglund2024-09-20 | Like the videos youtu.be/HawUSO5QYl4 and youtu.be/3fmdJAltpKA , this one shows waves in a circular cavity excited by pulsing sources in other, connected cavities. The difference is that here, there are seven smaller cavities instead of six or three. This video has two parts, showing the same evolution with two different color gradients: Wave height: 0:00 Averaged wave energy: 1:24 In the first part, the color hue depends on the height of the wave. In the second part, it depends on the energy of the wave, slightly averaged over a sliding time window.
Render time: 13 minutes 59 seconds Compression: crf 23 Color scheme: Part 1 - Magma by Nathaniel J. Smith and Stefan van der Walt Part 2 - Plasma by Nathaniel J. Smith and Stefan van der Walt github.com/BIDS/colormap
Music: "Aurora Borealis Expedition" by Asher Fulero@AsherFulero
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorAn asteroid impact in the North Atlantic Ocean, with tsunami-induced floodingNils Berglund2024-09-19 | This is an attempt at modeling an asteroid impact in the North Atlantic Ocean using a nonlinear wave equation. This model allows for some flooding of land areas. The vertical scale of both mountains and waves has been exaggerated. Compared to the earlier simulation youtu.be/th_TzO6RsvI , a mistake in the code has been corrected, which incorrectly computed the influence of the non-constant ocean depth - the east-west component of that force was using the north-south gradient of the depth, instead of the east-west gradient. The display of land masses has also been improved, by using a different criterion than before to distinguish land from sea. The main difference between the nonlinear equation and the linear wave equation is that the wave speed becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. This causes problems in the simulation, because land masses can lead to blow-up of the solution. This problem is circumvented here by replacing the continents by a repelling force field, plus a dissipative term. The initial state features velocities radiating outward from the impact point of the asteroid. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations at two different speeds and with two different visualizations: Time lapse, 3D: 0:00 Time lapse, 2D: 0:14 Original speed, 3D: 0:28 Original speed, 2D: 1:27 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. In the 3D parts, the point of view is slowly rotating around the Earth in a plane containing its center. In parts 1 and 2, the animation has been speeded up by a factor 4. The velocity field is materialized by 2000 tracer particles that are advected by the flow.
Render time: 3D parts - 1 hour 55 minutes 2D parts - 1 hours 29 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "Virtual Light" by Houses of Heaven@felte
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #EarthRattling the sieves in a particle sorter avoids cloggingNils Berglund2024-09-18 | In the previous simulation youtu.be/ZA3gcbNm1l8 of a device sorting particles according to their size, particles sometimes got stuck in the sieves, resulting in other particles ending up in the wrong bin. This simulation implements a suggestion made by several viewers, which is to "rattle" the sieves in order to dislodge stuck particles. The sorting set-up consists in three grids of obstacles with decreasing space between them, acting as particle sieves. The obstacles rotate and exert a tangential force on the particles, in order to decrease clogging of the sieves. The angular speed of the obstacles varies periodically in time, in order to reduce the chance of particles getting stuck. In addition, the obstacles have a circular motion of small amplitude, which reduces the chances of particles getting stuck even more. The conveyor belt effect results from the segments forming the belt exerting a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. The color of the polygons depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Music: "Parakeet" by Quincas Moreira@UCL1zFMJb0sthwdAlGjGbdy
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #polygons #conveyorResonances in a circle, excited by four sourcesNils Berglund2024-09-17 | In this simulation of the wave equation, resonances are excited in a circular cavity, by sources placed in four secondary circular cavities. The design is inspired by cavity magnetrons, which are used to generate microwaves in microwave ovens. The color hue depends on the height of the wave.
Render time: 6 minutes 52 seconds Compression: crf 23 Color scheme: Inferno by Nathaniel J. Smith and Stefan van der Walt github.com/BIDS/colormap
Music: "U Make Me Feel" by MK2
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorAn asteroid impact in the Indian Ocean, with tsunami-induced floodingNils Berglund2024-09-16 | This is an attempt at modeling an asteroid impact in the Indian ocean using a nonlinear wave equation. This model allows for some flooding of land areas. The vertical scale of both mountains and waves has been exaggerated. A mistake in the code has been corrected, which incorrectly computed the influence of the non-constant ocean depth - the east-west component of that force was using the north-south gradient of the depth, instead of the east-west gradient. A version using the linear wave equation appeared previously on this channel, see youtu.be/DRsKobzGCVk The main difference in the nonlinear equation is that the wave speed becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. This causes problems in the simulation, because land masses can lead to blow-up of the solution. This problem is circumvented here by replacing the continents by a repelling force field, plus a dissipative term. The initial state features velocities radiating outward from the impact point of the asteroid. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations at two different speeds and with two different visualizations: Time lapse, 3D: 0:00 Time lapse, 2D: 0:13 Original speed, 3D: 0:27 Original speed, 2D: 1:21 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. In the 3D parts, the point of view is slowly rotating around the Earth in a plane containing its center. In parts 1 and 2, the animation has been speeded up by a factor 4. The velocity field is materialized by 2000 tracer particles that are advected by the flow.
Render time: 3D parts - 1 hour 58 minutes 2D parts - 1 hours 50 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "Mast" by Silent Partner
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #EarthA conveyor belt with shovels at lower frictionNils Berglund2024-09-15 | This simulation uses the same conveyor belt with shovels as in the video youtu.be/beBpMuZ6cn0 , but the friction is four times lower. As a consequence, particles accelerate more when they fall, and also rotate more. Other differences are that the particles are pentagons instead of hexagons, have different radii, and there is no torque aligning neighboring polygons. The conveyor belt effect results from a combination of two factors: the shovels, and the fact that the segments forming the belt exert a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. This simulation has two parts, showing the evolution with two different color gradients: Initial x position: 0:00 Velocity: 2:24 In the first part, the particles' color depends on their initial x position. This allows to get a sense of how particles are mixed while falling through the funnel. In the second part, the due depends on the direction in which the particles are moving, while the luminosity depends on their speed. Both quantities are averaged over a time interval. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #polygons #conveyorRefraction and reflection of a shock wave - Source in the lower speed mediumNils Berglund2024-09-14 | This variant of the simulation youtu.be/fQV6vgF9vSI shows again shock waves created by a source traveling faster than the wave speed in a medium, near an interface to a medium with different wave speed. However, here the wave speeds have been reversed. The lower medium has relative refractive index 0.667 (the wave speed is 1.5 times faster in the lower part). As a result, part of the shock wave is refracted, changing its angle in the second medium, while part of it is reflected. The relative intensity of the reflected and refracted parts depends on the angle between shock wave and interface. This video has six parts, showing the evolution with three different speeds of the source, and two different color gradients for each speed: Speed 1, wave height: 0:00 Speed 1, averaged wave energy: 0:44 Speed 2, wave height: 1:36 Speed 2, averaged wave energy: 2:19 Speed 3, wave height: 3:12 Speed 3, averaged wave energy: 3:56 In parts 1, 3 and 5, the color hue depends on the height of the wave. In the other parts, it depends on the energy of the wave, averaged over a sliding time window. The contrast has been enhanced by a shading procedure, similar to the one I have used on videos of reaction-diffusion equations. The process is to compute the normal vector to a surface in 3D that would be obtained by using the third dimension to represent the field, and then to make the luminosity depend on the angle between the normal vector and a fixed direction.
Render time: Part 1 - 17 minutes 5 seconds Part 2 - 15 minutes 58 seconds Part 3 - 16 minutes 2 seconds Compression: crf 23 Color scheme: Part 1 - Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing Part 2 - Inferno by Nathaniel J. Smith and Stefan van der Walt github.com/BIDS/colormap
Music: "Stardrive" by Jeremy Blake@RedMeansRecording
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #shock_wave #sonic_boomAn asteroid impact in the South Atlantic, modeled with a shallow water equationNils Berglund2024-09-13 | This is an attempt at modeling an asteroid impact in the South Atlantic ocean using a nonlinear wave equation. The main difference with the linear wave equation is that the wave speed becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. This causes problems in the simulation, because land masses can lead to blow-up of the solution. This problem is circumvented here by replacing the continents by a repelling force field, plus a dissipative term. The initial state features velocities radiating outward from the impact point of the asteroid. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The velocity field is materialized by 2000 tracer particles that are advected by the flow.
Render time: 1 hour 51 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "Traversing" by Godmode@GODMODEMUSIC
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #EarthHow does the particle size sorter work at very low friction?Nils Berglund2024-09-12 | Not too well. This simulation uses the same sorting set-up as in the video youtu.be/ZA3gcbNm1l8 , but the friction here is four times weaker. As a result, the particles bounce more, and many of them end up in the wrong bin. The sorting set-up consists in three grids of obstacles with decreasing space between them, acting as particle sieves. The obstacles rotate and exert a tangential force on the particles, in order to decrease clogging of the sieves. The angular speed of the obstacles varies periodically in time, in order to reduce the chance of particles getting stuck. The conveyor belt effect results from the segments forming the belt exerting a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. The color of the polygons depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Music: "Fanta Mankane" by the Mini Vandals@theminivandals1840 featuring Mamadou Kolta and Lasso
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #polygons #conveyorUsing three sources to excite resonant modes in a circleNils Berglund2024-09-11 | Like the video youtu.be/HawUSO5QYl4 , this one shows waves in a circular cavity excited by pulsing sources in other, connected cavities. The difference is that here, there are three smaller cavities instead of six. This video has two parts, showing the same evolution with two different color gradients: Wave height: 0:00 Averaged wave energy: 1:30 In the first part, the color hue depends on the height of the wave. In the second part, it depends on the energy of the wave, slightly averaged over a sliding time window.
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorBloopers 19: Asteroid impact in the Indian Ocean, with a too strong Coriolis forceNils Berglund2024-09-10 | This attempt at simulating an asteroid impact in the Indean Ocean uses a strong Coriolis force. As it turns out, the Coriolis force is so strong that the waves created by the impact tend to move inward after initially moving outward, earning this simulation a spot in my list of bloopers youtube.com/playlist?list=PLAZp3rbgWLo0CUHGuFfPUUrjdRWNCelDr The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The initial state features velocities radiating outward from the impact point of the asteroid. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations at two different speeds and with two different visualizations: Time lapse, 3D: 0:00 Time lapse, 2D: 0:12 Original speed, 3D: 0:25 Original speed, 2D: 1:15 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. In the 3D parts, the point of view is slowly rotating around the Earth in a plane containing its center. In parts 1 and 2, the animation has been speeded up by a factor 4. The velocity field is materialized by 2000 tracer particles that are advected by the flow.
Render time: 3D parts - 2 hour 38 minutes 2D parts - 3 hours 20 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "Grand Avenue" by Text Me Records - Bobby Renz@socialxwork
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #EarthSorting particles at lower frictionNils Berglund2024-09-09 | This simulation uses a similar set-up for sorting particles as in the video youtu.be/-k5cxxNL2po , but the friction (both linear and angular) is about 4 times smaller. This allows the particles to accelerate more when falling, to bounce when hitting a conveyor or other particles, and to rotate more. The drawback is that the largest particles, in the rightmost bin, are more "jumpy", which is probably due to a bit of numerical instability. The sorting set-up consists in three grids of obstacles with decreasing space between them, acting as particle sieves. The obstacles rotate and exert a tangential force on the particles, in order to decrease clogging of the sieves. The angular speed of the obstacles varies periodically in time, in order to reduce the chance of particles getting stuck. The conveyor belt effect results from the segments forming the belt exerting a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. The color of the polygons depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #polygons #conveyorUsing six sources to excite resonant modes in a circleNils Berglund2024-09-08 | Like the video youtu.be/HawUSO5QYl4 , this one shows waves in a circular cavity excited by pulsing sources in other, connected cavities. The difference is that here, there are six smaller cavities instead of only one. In this way, the waves keep a six-fold symmetry (or rather, for the first part, a three-fold symmetry with an inversion). This video has two parts, showing the same evolution with two different color gradients: Wave height: 0:00 Averaged wave energy: 1:20 In the first part, the color hue depends on the height of the wave. In the second part, it depends on the energy of the wave, slightly averaged over a sliding time window.
Render time: 15 minutes 24 seconds Compression: crf 23 Color scheme: Part 1 - Twilight by Bastian Bechtoldgithub.com/bastibe/twilight Part 2 - Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "Alone" by Emmit Fenn@emmitfenn
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorAn improved device sorting particles by sizeNils Berglund2024-09-07 | This variant of the videos youtu.be/qozGp_KR_DA and youtu.be/feEDk9e4HPM of a device sorting particles by size contains two improvements. The first one, suggested in a comment, is to have a conveyor belt bringing the particles from the opposite side, and dropping them more to the left, in order to use a longer stretch of the sieves. The second improvement is that the circular obstacles forming the sieves do not rotate at constant speed, but rotate sometimes faster and sometimes slower. This reduces the number of particles getting stuck in the sieves, in a similar way as "rattling" the sieves now and then would. The sorting set-up consists in three grids of obstacles with decreasing space between them, acting as particle sieves. The conveyor belt effect results from the segments forming the belt exerting a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. The color of the polygons depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #polygons #conveyorAn asteroid impact in the North Atlantic, modeled with a shallow water equationNils Berglund2024-09-06 | This is an attempt at modeling an asteroid impact in the North Atlantic ocean using a nonlinear wave equation. A version using the linear wave equation appeared previously on this channel, see youtu.be/mjSFAVcpglA The main difference in the nonlinear equation is that the wave speed becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. This causes problems in the simulation, because land masses can lead to blow-up of the solution. This problem is circumvented here by replacing the continents by a repelling force field, plus a dissipative term. The initial state features velocities radiating outward from the impact point of the asteroid. One issue of the simulation is that waves tend to slow down as time goes on. This may be related to parameter values used in the equation. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations at two different speeds and with two different visualizations: Time lapse, 3D: 0:00 Time lapse, 2D: 0:16 Original speed, 3D: 0:33 Original speed, 2D: 1:39 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. In the 3D parts, the point of view is slowly rotating around the Earth in a plane containing its center. In parts 1 and 2, the animation has been speeded up by a factor 4. The velocity field is materialized by 2000 tracer particles that are advected by the flow.
Render time: 3D parts - 2 hour 38 minutes 2D parts - 3 hours 20 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "Sink Whole Dream" by the 129ers
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #EarthExciting resonant modes in a circleNils Berglund2024-09-05 | This video is inspired by some recent simulations on this channel, showing resonators shaped like magnetrons. These resonators feature several circular cavities, in which the waves displayed interesting standing wave patterns. In this simulation, the source of the waves is located in a smaller circular cavity, and the waves propagate through a channel to the larger cavity, where they produce interference patterns. Note that some of these patterns are reminiscent of heart-shaped reflections that you can sometimes see in a cup of coffee. This video has two parts, showing the same evolution with two different color gradients: Wave height: 0:00 Averaged wave energy: 1:39 In the first part, the color hue depends on the height of the wave. In the second part, it depends on the energy of the wave, slightly averaged over a sliding time window.
Render time: 21 minutes 47 seconds Compression: crf 23 Color scheme: Part 1 - Twilight by Bastian Bechtoldgithub.com/bastibe/twilight Part 2 - Magma by Nathaniel J. Smith and Stefan van der Walt github.com/BIDS/colormap
Music: "Highway 5" by TrackTribe@TrackTribe
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorSorting hexagons by sizeNils Berglund2024-09-04 | This simulation uses the same set-up as seen in the video youtu.be/qozGp_KR_DA to sort particles according to their size, but with hexagons instead of squares. The set-up consists in three grids of obstacles with decreasing space between them, acting as particle sieves. The obstacles rotate and exert a tangential force on the particles, in order to decrease clogging of the sieves. The conveyor belt effect results from the segments forming the belt exerting a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. The color of the polygons depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #polygons #conveyorVideo #1300: What if the Earths oceans were much shallower?Nils Berglund2024-09-03 | This is the 1300th video published on this channel, not counting some videos published multiple times because of corruption issues. Thanks again to all you viewers for your fidelity, comments and suggestions. This is a first simulation of the shallow water equations on a model for the Earth. The wave speed in these equations becomes larger when the water is shallower, which can lead to build-up of the waves in coastal and other shallow regions. The most important parameter in shallow water equations is the ratio between the size of depth variation and the average depth. This videos uses two different values of this parameter, the last two parts having a larger ratio. In both cases, this ratio is quite large compared to what applies to the Earth, making the effect of shallower parts more important. The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. The equations used here include viscosity and dissipation, as described for instance in en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , including the Coriolis force. One difficulty is to model the wetting boundary, which separates regions that are under water and those which are not. This difficulty has been circumvented here by replacing the continents by a repulsive force field, directed downslope, instead of a sharp boundary. The video has four parts, showing simulations with two different parameter values and two different visualizations: Smaller ratio, 3D: 0:00 Smaller ratio, 2D: 0:48 Larger ratio, 3D: 1:36 Larger ratio, 2D: 2:24 The color hue and radial coordinate show the height of the water, on an exaggerated radial scale. The 2D parts use a projection in equirectangular coordinates. In the 3D parts, the point of view is slowly rotating around the Earth in a plane containing its center. The position of the sphere is represented by a line starting above the north pole, and pointing in a fixed direction. The velocity field is materialized by 2000 tracer particles that are advected by the flow.
Render time: Part 1 - 1 hour 30 minutes Part 2 - 1 hour 14 minutes Part 3 - 1 hour 8 minutes Part 4 - 1 hour 36 minutes Color scheme: Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing github.com/BIDS/colormap
Music: "Gymnopédie No. 1" by Erik Satie
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
The simulation solves the 2D shallow water equation by discretization (finite differences).
#shallowwater #waves #EarthClassics revisited: A hexagonal parabolic resonatorNils Berglund2024-09-02 | This is a remake of the video youtu.be/lVDwH5PfEGY of a parabolic resonator with six sides, in much higher resolution, and with a pulsing source. The resonator is made of six parts of parabolas, which share the central point as a common focus. Whenever a circular wave centered at the focus hits a parabola, it is transformed into a linear wave. When this linear wave hits another parabola, it is transformed back into a circular wave, converging at the focal point. This pattern repeats almost periodically, except that diffraction effects (and probably also some numerical dispersion) slowly degrade the pattern. This video has two parts, showing the same evolution with two different color gradients: Wave height: 0:00 Averaged wave energy: 1:52 In the first part, the color hue depends on the height of the wave. In the second part, it depends on the energy of the wave, slightly averaged over a sliding time window.
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #resonatorA molecular sieve: sorting particles by sizeNils Berglund2024-09-01 | In this simulation, I tried to come up with a system that is able to sort particles according to their size. It consists in three grids of obstacles with decreasing space between them, acting as particle sieves. The obstacles rotate and exert a tangential force on the particles, in order to decrease clogging of the sieves. The conveyor belt effect results from the segments forming the belt exerting a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. The color of the polygons depends on their size. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)
#molecular_dynamics #polygons #conveyorRefraction and reflection of a shock waveNils Berglund2024-08-31 | This simulation has been suggested in a comment to a previous video. It shows the shock wave created by a source traveling faster than the wave speed in a medium. The wave encounters an interface to a different medium of relative refractive index 1.5 (the wave speed is 1.5 times slower in the lower part). As a result, part of the shock wave is refracted, changing its angle in the second medium, while part of it is reflected. This video has six parts, showing the evolution with three different speeds of the source, and two different color gradients for each speed: Speed 1, wave height: 0:00 Speed 1, averaged wave energy: 0:44 Speed 2, wave height: 1:36 Speed 2, averaged wave energy: 2:19 Speed 3, wave height: 3:12 Speed 3, averaged wave energy: 3:56 In parts 1, 3 and 5, the color hue depends on the height of the wave. In the other parts, it depends on the energy of the wave, averaged over a sliding time window. The contrast has been enhanced by a shading procedure, similar to the one I have used on videos of reaction-diffusion equations. The process is to compute the normal vector to a surface in 3D that would be obtained by using the third dimension to represent the field, and then to make the luminosity depend on the angle between the normal vector and a fixed direction.
Render time: Part 1 - 16 minutes 29 seconds Part 2 - 16 minutes 13 secondsPart 3 - 16 minutes 15 seconds Compression: crf 23 Color scheme: Part 1 - Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing Part 2 - Inferno by Nathaniel J. Smith and Stefan van der Walt github.com/BIDS/colormap
Music: "Eye Do" by Jeremy Blake@RedMeansRecording
See also https://images.math.cnrs.fr/des-ondes-dans-mon-billard-partie-i/ for more explanations (in French) on a few previous simulations of wave equations.
#wave #shock_wave #sonic_boomWhat happened to your luggage at the airport?Nils Berglund2024-08-30 | Last time I took a plane, I had a short connection, and guess what? My luggage was delayed. I ended up recovering my luggage all right, but since I have been making videos on conveyor belts recently, I realized that airport luggage sorting systems are a good example of the use of conveyor belts (as we all know thanks to John McClane). The example shown here is of course not to be taken too seriously. The conveyor belt effect results from a combination of two factors: the shovels, and the fact that the segments forming the belt exert a tangential force on the polygons, in addition to the normal force. The tangential force is proportional to the difference between the tangential speed of the polygon and the speed of the belt. To compute the force and torque of polygon j on polygon i, the code computes the distance of each vertex of polygon j to the faces of polygon i. If this distance is smaller than a threshold, the force increases linearly with a large spring constant. In addition, radial forces between the vertices of the polygons have been added, whenever a vertex of polygon j is not on a perpendicular to a face of polygon i. This is important, because otherwise triangles can approach each other from the vertices, and when one vertex moves sideways, it is suddenly strongly accelerated, causing numerical instability. A weak Lennard-Jones interaction between polygons has been added, as it seems to increase numerical stability. Unlike in some previous videos involving interacting polygons, there is no thermostat in this simulation. Instead, friction forces (both linear and angular) have been added for numerical stability. In addition, the particles are subject to a gravitational force directed downwards. The color of the polygons depends on the time they are created, and changes slowly over time. To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential
Current version of the C code used to make these animations: github.com/nilsberglund-orleans/YouTube-simulations https://www.idpoisson.fr/berglund/software.html Some outreach articles on mathematics: https://images.math.cnrs.fr/auteurs/nils-berglund/ (in French, some with a Spanish translation)