Zum Inhalt springen

Benutzer:Georg-Johann/Mathematik

aus Wikipedia, der freien Enzyklopädie
Dies ist eine alte Version dieser Seite, zuletzt bearbeitet am 13. Mai 2017 um 11:38 Uhr durch Georg-Johann (Diskussion | Beiträge) (The case Q = 2). Sie kann sich erheblich von der aktuellen Version unterscheiden.
A Julia Set (in white) visualized using CCA

 

Visualising Julia sets

Julia sets and Fatou sets can be nice. Their computergraphical generation can be hard.

In the remainder of this page, we work out a method which can be used to visualise the Julia set of a complex function ƒ. The advantage is that you don't need to know attractors of the iteration

The generated images will be smooth in the Fatou part.

Overview: Imaging methods

Note that there exist other approaches to color complex dynamical systems like

Inverse Iteration Method (IIM)
Compute the preimages of ƒ, i.e. compute the reverse orbit. Because the stability of the fixed points turns from attractive to repelling and vice versa, one just choses a complex number and looks where it goes under the invers iteration. The trouble is that the results will not uniformly distributet in and that you have to compute the inverse of ƒ.
Coloring by speed of attraction (CSA)
Taking a value from the lattice of points to color, perform iterations until the iterative is close to an attractor. Color the point according to the number of iterations needed to bring it close enough to the attractor.
This method is commonly used to visualize Julia sets of polynomials and Julia sets that are attached to Newton's famous method for finding the zeros of a function. Polynomials always have infinity as an attractive fixed point. The rational function that occurs in Newton's method has always the function's roots as attractive fixed points. However, in both cases there may be other attractors, which – moreover – need not to consist of just one point.

A special case of CSA is an approach sometimes called

Escape Time Algorithm (ETA)
If ∞ is an attractor, i.e. a fixed point of the process, then color the point according to the number of iterations – the time – it takes until one sees the point escapes towards ∞. If the point does not escape during the maximum number of iterations, the point is colored as belonging to the Julia set or to the basin of some other attractor. This method works for polynomials. The most prominent Julia sets are the ones for zz2+c where c is an element of the Mandelbrot set or not far away from the mandelbrot set. If you see a picture of such a Julia set, it is likely that ETA had been used to get the picture.
Cauchy Convergence Algorithm (CCA)
In the remainder of this page, I will present a different approach whose idea as basically the same es that of Escape Time Algorithm. However, no basin of attraction must be known in advance and the different basins of attraction can be separated and be colored differently. The approch uses the notion of Cauchys convergence. Instead of observing the orbit of a point, this method observes how the distance of two nearby points z and z+ε evolves as these two values are iterated. If the difference tends to 0, then the point heads for an attractor. If the difference does not approach 0, then the point is close to (or a part of) the Julia set.

The Metric

Let be a canonical projection of the compactified complex plane onto the Riemann sphere S2:

This gives us a metric : As distance between two points in the complex plane we take their distance on the sphere, i.e. the length of the orthodrome. This means that the metric is bounded by and even the distance to ∞ (which is now the north pole) is finite.

In order to compute the distance between two points and we rotate the sphere S2 in such a way that

  1. maps to 0
  2. maps to the positive real axis

After these transformations the distance can be computed quite easily. The rotation can be accomplished by a squence of isometric Möbius transformations. All an all, we get

which is left as an exercise to the reader. The bar denotes complex conjugation. The metric is then

The nice feature that is introduced by d is that sequences that formerly diverged against infinity now converge towards infinity, i.e. towards the north pole of S2.

Stability of Orbits

Recall the definition of the Julia set for a contraction mapping ƒ. The definition implies some facts on the stability of the iteration

where ƒn denotes the n-th iterative of ƒ:

The set

is called Orbit of z (under ƒ).

The orbits of two points z and w behave similar − in some sense − if z and w lie close together and belong to the Fatou set Fƒ which is the complement of the Julia set Jƒ of ƒ. If z is an element of Jƒ then z and w will behave quite different, even if w itself is an element of Jƒ.

To get a notion of the stability of an orbit, we set

for a small ε and with the metric d from above. This means that we take two points which are close together, and then we summarize their distances as ƒ makes them jump around on the Riemann sphere. Note that for any fixed ε the sum can diverge for large n even if z is a Fatou point.

However, we can use Σn to measure how close a point is to Jƒ: the larger the sum is, the more instable is the iteration and the closer is the point to the Julia set of ƒ.

To destinguish points of (or close to) the Julia set from points in the Fatou set, we need a creterion. To get it, we compute all the Σ-values for the points that we want to color, i.e. for all points in a lattice Γ. After computing these values, we do a little bit of statistics to get the expected value E and the standard deviation σ for the set of Σ-values: Let

Remind that

It turns out that the values Σ are widely spread over several scales. Therefore, we do not use Σ directly. Instead, we use the logarithm of Σ. The value δ is just a small constant to avoid the logarithm's input to be zero.

Coloring

Now, we have all we need to color a point:

  1. choose
    1. a lattice of points to color
    2. the number of iterations to perform
    3. a small
  2. for all points, compute
  3. compute and
  4. compute
for some constant . Because will be used to separate points that belong to the Julia set () from points that to not (), reasonable values for are greater than . Try settings like or or the like. If then we color as belonging to the Julia set. If we can use that value to shade the Fatou set. If we know some attractor, we can check if ƒ is close to it and use that information, too.


To map values to the valid ranges for saturation and brightness we use the function from section helper function h.

Modifications

The computation of takes a lot of time. The visualisation process needs two passes:

  1. compute from all
  2. color the points using and recomputed

Alternatively

  1. compute and store all
  2. compute and color the points

An other approach looks like that:

Find the smallest so that is below a given bound for all . If no such can be found, then assume to be an element of the Julia set. Otherwise, use to color the Fatou set.

This algorithm is a variant of the escape time algorithm (ETA). Note that in ETA the point does not really escape (at least if we are on the sphere), it just converges to ∞. This approach is similar. However, we don't need to know an attractive fixed point of ƒ.

Up to now, I didn't try the modified version. One disadvantage may be that the Fatou set will no more appear smooth colored. Then I am not sure if this modification is really an advantage, because the iteration must be done until a given maximum number of iterations is reached. Note that even if is under the bound for some the distance can rise again. I cannot say if this effect is crucial or can be neglected...

denotes the Newton operator

Visualising complex functions

Color space in HSV-projection

Suppose we want to visualise a complex valued function like

In order to color we decompose it into its absolute value and its argument .

Then, we assign the color

to the point representing . In this HSV color space, all values are in the range from 0 to  1. The first component (hue) of the HSV color depends only on the argument of and the second and third component (saturation and value) depend only on the absolute value of . We use a transformation on to map it into the interval . For see section helper functions.

Examples

The values indexed s (saturation) control the transition saturated colors→white (resp. gray scale), i.e. intermediate values → infinity. The values indexed h (value/valenz) control the transition black→bright, i.e. zero→nonzero. Parameter a controls where the transition takes place: a is just the radius of the circle dividing the two regions (dark/bright, saturated/gray, etc.) Parameter b controls how sharp the transition is: b small = soft, b large = sharp.

The following images all show the range [-10,10]×[-10,10] and use (radius of rainbow) and (radius of black disc).

In the image with swapped meanings of S and V zero is printed in white and infinity in black.

Helper functions

Helper function t

some

is a smooth transition from −1 to 1 that satisfies and . There are many choices for it. Some of them are

with gd denoting the gudermannian function.

Helper function h

Helper function is almost the same like but it maps to and we can adjust the speed of transition by parameter .

with . Then is symmetric to the point (0, 1/2) and

Negative values are mapped to values between 0 and 1/2. Positive values are mapped to values between 1/2 and 1. The parameter controls how fast the transition will be.

If we want a falling function, we can use the symmetry

i.e. we negate or .

Helper function g

This function maps the positive numbers to the interval .

for some function that is defined below. If is appropriately chosen then for the following holds

This means that

  • grows continuously from 0 to 1 as grows from to
  • we can control where crosses the middle between 0 and 1 by specifying parameter
  • we can control how fast passes the point by specifying parameter

We are left with determining the finction on with

must satisty

For we set

Another choice for might be . Note that .

Helper function w

This function maps the positive numbers to the interval .

By we can control its slope in the origin:

Bézier-Curves

Quadratic

Suppose we have a smooth function

and like to draw an approximation of it using quadratic Béziers. Obviously, the two end points lie on ƒ and the control point lies on the crosspoint — for simplicity, we assume it exists — of the two tangents through the bounding points. In other words, we have to determine the intersection of the two lines

with canonical abbreviations like

This leads to a determining equation for the λ's

whose solution is

This gives us the intersection, i.e. the control point, by evaluating one of (or the two of) the g's at the end point(s).

Cubic

Suppose we have a smooth function

and like to draw an approximation of it using cubic Béziers

From the two last representations we see immediately the value of the derivatives of b in the end points. We want the first and second derivatives in the end points to point in the same direction as the derivatives of ƒ do. Thus

This method applied to the standard parametrization (cos t, sin t) of a quarter of the unit circle (in black):
We get the coordinates (1, 1/2) and (1/2, 1) for the control points (red). The resulting bézier (orange) does not approximate the circle as good as possible.

and together with ƒ0=P0 and ƒ1=P3 we get the linear system

Note that in the special case of x(t) = t we get

i.e. the x-coordinates of the control points P1 and P2 divide the interval [t0,t1] with ratios 1:2 resp. 2:1. This is quite astonishing because in order to get the control points we do not have to evaluate second derivatives of ƒ. This is due to properties of Bernstein polynomials.

To solve the above system we use standard technique like the adjugate.

Also note that if both second derivatives of x or both second derivatives of y happen to vanish the above system won't have full rank, i.e. the corresponding matrix won't be invertible. However, it's sufficient to determine α and β to get the control points and for vanishing second derivatives we get the less complicated systems

resp.

Solving this yields

and ditto for y.


As you can see in the image above, there is some room for improvement and therefore we work out a second approach. Again, we set P00, P31 and constrain the two control points P1 resp. P2 to lie on the tangent through the end point next to it. This leaves us again with a two dimensional space to search in. Instead of imposing properties on second derivative, we now simply force the bézier to meet the curve ƒ in a third point Q, i.e. we set

for some t in (0,1) and b denoting the bézier. The condition on the end and control points again reads as

This method applied to the standard parametrization (cos t, sin t) of a quarter of the unit circle (in black):
We get the coordinates (1, ω) and (ω, 1) for the control points (red) with
   
The resulting bézier approximation (orange) is fine. There is no visual difference between the circle and the bézier. The additional point Q is indicated halfway on the bow.

Putting this together with the condition on Q we get

Note that we can use more than one point Q. Suppose we like to use n points Qi to guide the bézier. Each Qi will add two more lines in the above linear system, i.e. the system will look like

with a 2n-dimensional vector w and a 2n×2 matrix M. In general, this system is overdetermined and thus has no solution. Therefore, we solve the 2-dimensional system

instead which yields a least-square solution for α and β.

We make the above system a little bit more explicit for the case of one additional point at t = 1/2. The linear sysstem then reduces to

Note that the same matrix already occured in the computation for quadratic bézier curves above, however the matrix now gets multiplied with a vector describing the curvature, whereas in the quadratic case it gets multiplied with a vector descriping the direction.

If the special case of a linear function x we get

noname

Suppose we have a smooth function

from the reals to the plane and like to draw an approximation of it using cubic Béziers.

Let u be a second function with fixed points at t0 and t3 which is smooth and monotone. Then the composition ƒ o u will yield exactly the same plot for any such u. Applying function u means that drawing the curve at different, arbitrarily increasing and descreasing speeds does not change the way the plot of the curve looks like. That is nice from the plotter's point of view. However, this generates some difficulties when we try to approximate the curve, which eventially turns out to be a playing field for calculus of variations that will lead to formulas and partial differential equations much too complex for practical considerations. So we look for some characteristics that are invariant under reparameterisations u.

The derivative of ƒ o u is the velocity[1]

This furmula is the rationale why the first derivative of the bézier curve shall point in the same direction as the first derivative of ƒ: the direction is independent of the parametrisation u. The speed v always points into the same direction, no matter how fast we drive along ƒ. This is no more true for the acceleration

In the remainder of the essay we will only use properties of the curve at its end points. Thus, before we proceed, let's use the fact that u has fixed points in the t-valueas that yield the end points in order so simplify the formulas for v and . The formulas then read

provided we evaluate these quandities at one of the end points.

We can think of as being composed of two orthogonal components: one in direction of motion that speeds up or slows down the pencil, and on perpendicular to v which leads to a change in direction. The projection of onto the direction normal to v is parallel to[2]

  1. In our notations composition of functions has higher priority than multiplication, so we omit parenthesis if appropriate.
  2. we denote "parallel to" as

Sphärengleiche Linear Transforms

Given a linear transfrom in n-dimensional euklidean Space:

We call two linear transforms A and B spärengleich if they map the unit sphere to the same set:

Obviously, this ~ is an equivalence relation and we look for a representant of each equivalence class. We observe that this relation preserves the spectral norm

and that orthogonal matrices don't change the equivalence class:

for any A. The last line is immediately clear because orthogonal transformations map spheres to themselves. The preservation of spectral norm follows from the definition of spectral norm. Let

be the singular value decomposition (svd) of A. Then we have

and

However, the converse is not true.

Arcsin

arccos and its asymptote in orange.

In order to approximate arcsin and arccos if the argument is close to 1 the following expansions might be useful:

with a rational power series

The radius of convergence of a is 2. We start by observing that

which can easily verified by differentiaton. It follows that

Also note the following half-argument relations for –2 ≤ x ≤ 2:

Dobble Spot It

Dobble is a card game to have a nice time with fast pattern recognition. Each card shows 8 different icons, and any two cards have exactly one icon in common. The task is to find this common icon as fast as possible.

This essay is about how such a deck of cards can be constructed, and it supplies some mathematical background. As Dobble is famous about that mathematical background, we won't get too much into the theory as many arcticels found on the net address the background. A deck of card consists of 55 cards each showing 8 different icons out of a set of 57 icons. So how do we have to arrange these icons on the cards so that any two card picked at random have exactly one icon in common?

The property

any two cards have exactly one icon in common

reminds of a theorem in plane geometry:

any two different lines in the plane meet in exactly one point

Well, almost. In Euclidean geometry there are lines in the plane that don't meet, namely parallel lines. The way out is projective projective geometry which comes without that shortcoming. Whereas points in the Euclidean plane can be regarded as pairs of numbers (x,y), points in the projective plane are triples (x : y : z) such that not all three are equal to zero. In addition, we consider two triples P and P' as the same if they are multiples of each other, i.e. if there is a number λ ≠ 0 such that

A line g in the plane is given by a triple (gx : gy : gz) and a point P = (x : y : z) is incident on the line provided

This is similar to the Euclidean case where a point is incident on a line if

but in projective space the additional symmetry in the formulae for the point-on-a-line relation has its counterpart in the additional symmetry of any two distinct lines meet in exactly one point. Notice that if z ≠ 0 we can divide the projective condition by z, and the outcome is basically the condition for Euclidean space. However, in the projective case there are also points with z = 0 which don't have a counterpart in Euclidean geometry. These points are sometimes called the horizon or points at infinity, but we don't need such fuzzy wording or any distinction of different classes of points to construct a deck of Dobble.

The second difference to ordinary geometry is that a deck of cards consists only of finitely many items: a finite number of icons, a finite number of cards, and a finite number of icons per card. This is handled by considering geometry over a finite field instead of geometry over the Reals. A field is an entity which features addition and multiplication, both commutative and connected by the distributive law. The addition of any element can be undone, and the element that doesn't change the result of an addition is called zero and denoted as 0. The multiplication with any element except 0 can be undone, and the element that doesn't change the result of a multiplication is called one and denoted as 1.

So let's switch to a finite field F with Q elements. The first observation is that there are only finitely many points in the plane. There are Q3 triples of the form (x : y : z) with x, y and z in F. As not all three coordinates shall be zero, we are left with Q3−1 non-zero triples. Triples which are a multiple of each other are regarded as the same point, and because there are Q−1 non-zero values in F which can serve as the factor λ from above, we get the total number of points of the projective plane over the finite field F of order Q as

This is also the number of lines in that plane because the lines are also represented as triples. In order to see how many points are incident on each line, let's enumerate the points as

If the x-coordinate is non-zero, we can divide all coordinates by x which gets us the points of the form (1 : y : z). If x is zero and y is non-zero, then divide by y to get the points of the form (0 : 1 : z). If both x and y are zero, that point can be represented as (0 : 0 : 1) because z must be non-zero then.

In order to compute which points are incident on which line, we could just do brute force and iterate over all lines and all points and test whether the relation from above is satisfied. But we can do better by working out explicit formulae. To that end we use a different relation to determine whether a point is incident on a line:

This is just a rearrangement of points which does not change the global structure. The advantage is that in our enumeration of points and lines, the first coordinates, i.e. x and gx, are always 0 or 1 which will simplify the computation.

Lines and Points incident on it
Line g = (gx : gy : gz) Constraint(s) on
coordinates of P
P = (x : y : z) Case
(1)
(2)
(3)

In either case, there are Q+1 points on each line, and it's easy to verify that any two distinct lines have exactly one point in common. Due to the duality of points and lines, each point is incident on Q+1 different lines.

The case Q = 2

Image 1

Let's work out the simplest case of Q = 2, the Fano plane. We expect 22+2+1 = 7 lines and hence also 7 points, each line consisting of 2+1 = 3 points, and each point incident on 3 lines.