Thursday, December 19, 2019

2D Eddie Currents

There was a nice paper I read about exact solutions of the Navier Stokes equations in 2D for the incompressible fluid case, and for the case of zero viscosity (giving the simpler Euler equations).

The trick is that any 'stream function' Ψ(x,y) such that its mean curvature d^2Ψ(x,y)/dx^2 + d^2Ψ(x,y)/dy^2 = f(Ψ(x,y)) for some simple function f().

When we have f(Ψ) = K*Ψ then we have a nice repeating general solution:

Ψ(x,y) = sum_i k_i*sin(a_i*x + b_i*y + c_i)  such that a_i^2+b_i^2=d for all i.

giving K=-d^2.
This stream function is the sum of 2D planar waves of equal wavelength. It seems capable of approximating a wide range of functions.

The vector field is then velocities: u=dΨ/dy, v=-dΨ/dx, which is:

u = sum_i k_i*b_i*cos(a_i*x + b_i*y + c_i)
v =-sum_i k_i*a_i*cos(a_i*x + b_i*y + c_i)

The waves can then all be moved at the same rate, by replacing c_i with c_i+wt, where t is time. One could also vary the k_i parameters, but I wouldn't vary a_i or b_i over time, as it will cause very fast variation far from the origin.

This is an example vector field for:

u = 2*4*sin(3*0.1*x + 4*0.1*y + a) + 2*5*d*sin(5*0.1*y + b) + 2*3*sin(4*0.1*x + 3*0.1*y + c)
v =-2*3*sin(3*0.1*x + 4*0.1*y + a)                          - 2*4*sin(4*0.1*x + 3*0.1*y + c)

where d = 1.5.

Whenever a,b,d form a pythagorean triple, you can use combinations of these to create vector fields that tile precisely, even when the sinusoids are moving using t.

These appear to represent perfectly valid (but not necessarily stable) persistent vector fields that can change over time. Making a great tool for eddy currents around a boat, or in the atmosphere or just for wind currents.

The flexibility in k,a,b and c may allow the local neighbourhood of the currents to be somewhat interactive. For example, if you have a boat spewing out water as it drives along, maybe we can find the minimal adjustment to the set of sinusoids that matches the desired velocity at that point, or at multiple points.

If you allowed differing wavelengths then the vector field would still be divergence-free, but it would not have a valid pressure field.

Pairs of planar waves always produce rectangular 2D vortex structures:
Triplets of planar waves generally produce irregular wave structures, but you can get a nice triangular grid of vortices like so:
(Wolfram: plot sin(x) + sin(x/2 + y*sqrt(3)/2) + sin(-x/2 + y*sqrt(3)/2))

Local Eddies

Imagine you averaged all the planar cosine waves cos(ax+by) where a^2+b^2=1. The result is a radial Bessel function J0(sqrt(x^2+y^2)). Since it is a sum of sinusoids of equal wavelength, it also is a valid stream function. 

Now, if we sum together these functions (which decay with distance from centre), then our resulting velocity field decays to nothing far from the area in question. This allows local control of the vortices (and even directly specifies a main vortex), and you can add it onto a background vortex field (of planar sinusoids), or just to a constant velocity field. 

Two equal and opposite nearby Besel functions, creates a gush of water through the middle, and two vortices on either side.

There is also a dual function, which represents the linear rather than circular flow, and is also local. It is the integral of cos(r cos(angle))*cos(2*angle + k) with respect to all polar angles. Each k gives a different radial function, but they basically just blend from one Bessel function (J2) to its negative, based on the polar angle:

This gives you a local linear flow 'cross':
(Wolfram: plot cos(2*atan(x/y))*J2(sqrt(x^2+y^2))).

since eddies are made out of combinations of vortices and linear flows, it might work OK to use these two Bessel functions as the atomic generators of local eddy flows.

Tuesday, October 16, 2018

Nested Spheres

This is a new shape that I have made based on sphere inversions. It is a nested set of spheres, such that each level of spheres is a Ford-Farey sphere packing over the Riemann sphere.

The structure is a tree, it has no self contact, but is also probably the densest packing that such a tree can be.
Each level is a graphical depiction of the Eistenstein rationals. So the total shape depicts an infinite cascade of Eisenstein rationals, rather like each nested sphere depicts the rationals over the infinitesimal gap around its parent's location on the complex plane. 

As such, one might describe it as a cascade-like depiction of the complex numbers. 

Saturday, May 12, 2018

Dendrite and cross fractal families

Here are two fractal families that are probably not well known as families despite having well known members. 

The first I'll call the dendrite family because it contains the attractive Pentadendrite. The six sided version is the Hexaflake and the four sided version is the Vicsek fractal and the two sided version is just a line:

The Hausdorff dimension is log(n+1)/log(3) where n are the number of sides, for the n=even case.
The n=odd case is a little higher. The three sided fractal I haven't seen before, so I'll call it the tridendrite. here's a close up:

The fractal is built up from a three pointed star by swinging a copy of itself 180 degrees around each outer point:
For even pointed dendrites the new outer point is simply the new farthest, for odd pointed dendrites like this, there are two equidistant new outer points, we choose either the clockwise, or the anticlockwise and stick with it, repeating the process ad infinitum. 

Consequently there are two resulting fractals, one being a mirror image of the other. So while all the dendrites have n-fold rotational symmetry, the even pointed dendrites also have mirror symmetry. 

A variation is to replace the shape each iteration with n copies, rotated 180 degrees and attached by their outer points to (0,0):
and repeated, giving a denser "cross" family:

The n=3 case is sometimes called a Fudgeflake, or can be built from three terdragons. The four pointed case is just a 90 degree Koch curve or Greek cross fractal. The larger n cases include substantial self-overlap.

By the way, here is a close up of the pentacross, the density variation has some nice patterns:

Friday, April 20, 2018

Co-similarity in fractals

Fractal shapes are self similar, but can you have two shapes that are mutually similar? By that I mean that each is composed of smaller copies of itself and the other shape. This is very similar to the research area of self tiling tile sets but without constraining to just dense shapes, and without allowing reflections of shapes.
To investigate I'll have to create some definitions.

Let us define self-similarity in a strict sense as:

 shape A is composed of a finite number of smaller copies of shape A

I'll then define cross-similarity as:

 distinct shapes A,B,C,.. are composed of a finite number of smaller copies of each shape A,B,C,..

A special case I'll label as:

 distinct shapes A,B,C,.. are composed of one smaller copy of each shape A,B,C,..

So unlike self-similarity, co-similar shapes mutually nest inside each other. The simplest non-trivial special case is for two shapes A,B. Let's label them twin-fractals.

 shape A is composed of a small copy of shape A and shape B
 shape B is composed of a small copy of shape A and shape B

 A = aT1A + bT2B
 B = cT3A + dT4B  for some scalars 0 < a,b,c,d < 1 and Euclidean transforms Ti

If shape B can be placed next to shape A to generate a larger copy of shape A, then B is called a gnomon of A. So a special case of twin-fractals are twin-gnomons, these are twin fractals where shape A and shape B have the same relative scale when composing.

 shape A and shape B compose to a larger copy of shape A
 shape A and shape B compose to a larger copy of shape B

  A = aT1A + aT2B
  B = cT3A + cT4B  for scalars 0 < a,c < 1

We can find these using an Iterated Function System or limit-sets approach. Here are some examples. The white is shape A, yellow and pink are shape B in its two locations: 

A special case of twin-gnomons I'll call twin-tiles, these are twin-gnomons where the same scale is used for composing shapes A and B:

 shape A and shape B compose to a larger copy of shape A
 shape A and shape B compose to a larger copy of shape B, with the same enlargement factor

  A = aT1A + aT2B
  B = aT3A + aT4B  for scalar 0 < a < 1

Here are equivalent twin tiles:
A feature of the twin tiles is that one can grow larger and larger versions of shape A and B by composing in the two ways, so it exhibits co-similarity.

I'm uncertain whether any of these can be made dense, but I am certain that they can be made to be connected. I think the best results come when the composition is just touching without overlap. This is close in the top image of the set above, but the yellow shape B doesn't quite touch at the bottom and the pink shape B overlaps a little. If I tweak the transforms we get something that is more connected:
I think this is an interesting area to explore. White and yellow are mutually similar, rather than self-similar shapes.

As I mentioned, these are very similar to the researched are of self tiling tile sets or setisets for short. These tile sets have any number of tiles, but they are restricted to just dense tiles. Their work presents a solution for the two tile case but it requires reflection so the shapes aren't symmetric through a similarity transform.

Saturday, March 31, 2018

A family of fractal trees

Here is a new two-parameter family of fractal trees. The square of the width follows a Cantor function parameterised by the Cantor ratio c, which is 3/5 here:
the ratio c must be more than 0.5, with large values (here 0.75) giving wide, straight branches: 
and smaller values (here 0.52) giving thin, meandering branches:
The tree is built entirely from triangles which are all junction points. Here I show in white the largest of these triangles (c=0.525) which are all right-angled, making it a relative of the Pythagoras tree:

The right-angled triangles mean the tree obeys Leonardo's rule, maintaining total cross-sectional area if you assume a 3rd dimension for the branches. Like the Pythagoras tree, branches can overlap meaning the tree is immersed in (but not embedded in) 2D space. 

The branching is done by repeatedly splitting the length in half with alternating branching direction. Consequently a single branch is a relative of the Koch curve but with bend angle reducing towards the stem:
It is also possible to tweak the algorithm, for instance by flipping the direction of the offshoot branch:
however this gives very curly results, and I think of tweaks like this as non-standard variations of this tree family. 

The preserving of branch widths to power 2 is defined as the Pythagoras power p=2. But it doesn't have to be 2. "For real trees, the exponent in the equation that describes Leonardo's hypothesis is not always equal to 2 but rather varies between 1.8 and 2.3 depending on the geometry of the specific species of tree." Leonardo's rule
So p is the second adjustable parameter. If we reduce p to 1.4 we get:
making the triangles white we see that they are now less than 90 degree triangles:
Though they still tend to right angles triangles on the smallest offshoots compared to trunk width. 
We can reduce the width by reducing c (from 0.52) as it now can be less than half. Here we set it to 0.25:
Not only is the fork angle less when p is less than 2, but the small branches take up less proportion. Taken to the extreme we get an almost bare tree, (p=1.2, c=0.07):

As you can see, the tree width is affected by both c and p. It is easier to parameterise instead by the tree gradient and p. The gradient is: 
So c can be found to give the required gradient. Now a plot can be made of the 2D space of trees:
Here the triangle edges are drawn in grey. 

This 2D family has a number of sub-families of trees. There is of course the family of zero-area trees, which would sit just above the top row, with gradient=0. There is also the family of trees with symmetric central fork, I'll call these Cantor trees as they also use the exact one-third Cantor ratio c=1/3:
The intersection of these two sub-families is seen at the top of the above image. We might call this the Cantor fractal tree. 

So three sub-families are the thin (gradient 0) trees, the p=2 family (which we might call the Leonardo trees as they obey Leonardo's rule) and the Cantor trees above. A fourth subfamily is the family of balanced trees. These won't fall left or right. A property that is true of all their branches as well, if you pulled them off and stood them up. For low gradient trees the Pythagoras constant seems to be around 1.8:

Here is the family, the p values are approximate. Notice that the dominant branch moves from the left to the right branch as the tree gradient gets higher:

As such the balanced trees cross with the Cantor trees. The intersecting balanced Cantor tree has gradient of about 0.32:

Tuesday, March 27, 2018

Evolution in shapes

In my fractal classification I showed how scale-symmetric structures can be classified as a list and, for more expressive power, as a table. The base list is length 3, 5 and 7 for dimensions 1, 2 and 3. The first and last members are just nothing and solidness respectively and can be ignored as trivial cases. In addition the latter half of the list are negations of the opposite end of the list, where negation means emptiness and solidness are swapped. Consequently there are only 1, 2 and 3 unique shapes for dimensions 1, 2 and 3.

In that page I present a classification of moving structures, which is simply stating the range of classes in the above table or lists which the structure changes between during its lifetime. This has a lot of expressive power, but there is another, more constrained description for such dynamic fractals.

We can generalise the initial classification lists by giving them a time dimension. If the time dimension were like any other spatial dimension then the lists generalise easily. You would use the 3D list for the 2+1D case, and a 4D list for the 3+1D case. The 4D list has 9 elements, or 4 unique non-trivial elements.

anyway, time is different from other spatial dimensions. We can model it as having Lorentz rather than rotational symmetry, in which case the shapes are constrained to acting within light cones. The upshot of this is that (in the time direction) nothing grows to too sharp an angle, and objects don't suddenly appear from nothing. Other than this geometric constraint the list is the same for the +1 spatial dimension list.

So what does it look like?

In 1D we have intervals on the line which either grow from and to nothing, or continuously split.

The equivalent happens in 2D where we can have individual blobs growing and shrinking to nothing, and tree-like blobs that continually split into smaller trees and grow. We might call these two behaviours sporadic and asexual reproduction respectively.

There is a third behaviour in 2D, where network-like blobs split apart and change size, but eventually connect up with some other network-like blob. We might label this 'sexual reproduction' as the new child blobs always come from combined blobs.

The 'sexual reproduction' case is in some sense the special case in 2D, because geometrically it is the same class under negation. And 2D is the smallest dimension where it can happen. We note that most life on earth lives in a fairly 2D world due to the constraint of gravity.

However this is less the case in the ocean, and the 3+1D geometry contains a single new behaviour, which is the special case for 3+1D.

This behaviour looks like a 3D sponge (network of connected arms) where the arms split into two arms, thus making the network more complex, basically growing new mini versions of the network, and also growing in size overall. This behaviour is a little like the asexual case above, as it is unidirectional towards more complexity and growth, but it never separates and arms don't disconnect from their ends. So even though small versions of the network are continually generated and grown, there is no separation and the whole structure expands.

This is actually quite similar to the growth of a sea-sponge. The sea sponge is an unusual life form which many think of as a single organism but is in fact made of millions of unspecialised and quite independent cells.

Anyway it might be interesting to consider this third method of reproduction from an evolution standpoint, and whether it applies to sea sponges. Unlike asexual and sexual reproduction the genetic information is never detached, instead it could vary with location on the network, and the sub-network with effective variations might grow more than defective areas.

Another important area that evolves is the universe at large scales, and here there is perhaps an analogy to the sea sponge: Galaxy filaments and Galaxy walls (or sheets). Here the growth is from inflation and the formation into walls and then sheets is approximated by the Zeldovich pancake dynamics.

Saturday, March 24, 2018

Table of shapes by signed dimension

Here is a table of infinite extent shapes based on their signed-dimension. None of these structures have a Hausdorff or Minkowski dimension that lets them be measured. But the signed-dimension does.

Examples signed-D Type
-3 3D lattice
-2 3D graph
of edges
-2 2D lattice

-1 3D cell complex
of faces
-1 2D path
2D graph

1.26-2 Koch snowflake tiling

Grid of Cantor dust

0 infinite
1.13-1 chain of Gosper islands

2-1.63Tile based Sierpinski hexagon (yellow)
2-1.58 Cellular automata Sierpinski triangle

The Hausdorff and Minkowski formulae only consider the positive component of the dimension, resulting an an infinite measure on all unbounded structures.