Monday, May 31, 2021

Dynamic Foam App Linux (Installation update)

There were some issues with installing the program on a Linux computer (Ubuntu).

Nick made some changes and the new updated repositories can be downloaded at:

https://github.com/weigert/TinyEngine (The underlying engine)

https://github.com/weigert/DynamicFoam (The actual program)

I have a topic on the Ubuntu-forums that gives a rundown of the installation:


Here are also two new clips, one with inverse colors.
(The quality of the recording is a bit shaky but I advice you to install the program yourself and have fun!)
Some more background info can be found on the Wiki-page:



Dynamic Space Foam

(Best to open in YouTube at 1080pHD)

Monday, May 10, 2021

Dynamic ‘Equilibrium’ Foam Model

New Dynamic Foam simulator made by Nick McDonald.

Github page with the code:

https://github.com/weigert/DynamicFoam

Wiki-page with all the details about the model:

https://github.com/weigert/DynamicFoam/wiki/System-Dynamics

Pressurized flow (currents) running through the edges of the Voronoi cells, regulated by the pressure distribution in the network (graphs) and the angularity at the junctions, affect the size (temperature) of the cells they pass. Currents can heat up or cool down the cells expand vs shrink.



The program can be downloaded at:

The program explores the concept of "angle blocking" behavior and what the theoretical dynamics of particles / mass packets in lagrangian form would be. The underlying system is the Delaunator, a Vorono-ish cell system based on a delaunay triangulation mesh. 

The program executes an equilibrium model that corresponds to a linearized approach of a Steady-state model. A drop in the flow-rate in the edges acts as a restorative force to the cell size, relaxation. A higher flow-rate leads to a deviation from the steady-state, as a result the foam then continuously reforms with the flow.

So depending on the flow rate, the restorative force increases, and can eventually become equal. By defining the steady-state we can get linear transportation. As pictured in te following differential equation:

dx/dt = k*(x-f(v)) 
  • x : Cell-size / Expansion Factor / Distance
  • k : Rate-constant, which scales a "repelling force" proportional to the size of itself. It affects the cell from all directions in the foam, leading in itself to a stable size x. From this we can subtract some function of the flow at a position on the cell edge. 
  • v : Flow / Current
Note, when we shrink the scale, the cells are pressured equally from all sides as the outer boundary shrinks, this leads to the regularization of the size. Once the pressure is released, it no longer dominates and the flow-dynamics take over again, were f(v) can vary. 

The equilibrium model assumes the flow is constant, it leads to an approach of a standard foam without dependency on the flow, the force can increase or decrease with v (expanding / contracting flow). A linear form was assumed for simplicity, because anything else would just be extra unjustified assumptions.

The linear form of the differential equation above corresponds to a linearization - a classic assumption made in e.g. systems control theory that is valid for small deviations around any point. The steady state f(v)/k itself can then result from yet another more complex differential equation which depends on other dynamics of e.g. "cell temperature".

While the system attempts to approach a local steady-state by linearization, that does not mean that it is steady, it just performs a miniscule step towards that theoretical point using a classic numerical discretization (e.g. of the form x_{i+1} = x_{i} + dt*dx, which is what is used, with dx given be the RHS of the differential equation above). 

Of course gradual things can happen in a system like this - it's highly dynamic and even almost chaotic. The system stores a vast amount of states on which the differential system of this form acts, and the direction of the force and amount of flow is constantly changing. It just uses a linearization of the dynamics at every time-step.

The system is by definition self regulating given that it is stable. Note, this wasn't the case for every form of the dynamics explored, and is not strictly the case for a linearized dynamics system. The most simple textbook example of an unstable dynamic system which can be accurately described by linearization is the inverse pendulum.

——

The potential flow paths are based on the angle rule and are visualised after N theoretical steps along the nodes.

The program has the options to chose for Barycenter and incenter, but they don't give very nice flow paths compared to the circumcenter foam.

The barycenter map does give more well-behaved periodic orbits because of its smoother edges. There is less "long-distance-pathing" and "mode-switching" happening.

The paths converge to periodic orbits at every "frozen time frame" - the alternative would be that they would never reach a point which they have reached before, which would imply an infinite domain. No motion rule was imposed based on the flow directions.

It is possible to turn on/off different aspects of the dynamics. The flow-rate passing a cell that makes the cells growth/shrink accordingly.

The "energy" parameter determines how quickly flow-rate transfers to scaling (a kind of inverse growth inertia)

The "convergence" parameter determines how the equilibrium distance scales with the amount of flow.