Archive for the ‘Software’ Category
So far I’ve been using Qt 4.8 on both Linux and Windows 7. The compiler used on Windows 7 was Microsoft Visual Studio C++ version 10.0 which came with Visual Studio 2010 Express. The Microsoft compiler had poor support for C++11 features which meant I had to code my fractal software such that it would successfully compile on Linux and Windows.
Fed up with not being able to use C++11 fully on Windows led me to upgrade to Visual Studio 2015 Community. Since Windows 8, 8.1 and 10 have been released since I first released my software for Windows I went the whole hog and upgraded to Windows 10, upgraded to Qt5 built for 32-bit and Qt5 built for 64-bit using Visual Studio 2015 and upgraded QtCreator to version 4.0.0.
Over on Linux Mint the shift to Qt5 was easy, all I had to do was install the Qt5-default package:
If need be I can easily switch back to Qt4 by uninstalling Qt5-default and installing Qt4-default instead.
Building SaturnQt using Qt5 required just one change to its NetBeans project:
Select project properties
The location of Qt classes has been rearranged so QtWidgets is required for Qt5 but not for Qt4.
The project built without any problems and when SaturnQt was started some differences in appearance were evident, first the main window and the settings window for the Qt5 build:
Main window using Qt5
Settings window using Qt5
and these are main and settings windows for the Qt4 build:
Main window using Qt4
Settings window using Qt4
There are some obvious differences:
- The window background colour is lighter using Qt5.
- The height of the iterations box is the same as the zoom selection combobox using Qt5, they are not when using Qt4.
- The list cursor is blue instead of green using Qt5.
There are other minor differences. In short Qt5 doesn’t match the MATE theme I’m currently using with Linux Mint. It should be possible to solve this issue and when I do I’ll post it on this blog.
Back to Windows. The project file for SaturnQt already had a check for Qt5 and automatically adds QtWidgets. QtCreator was then configured to use the 32-bit build of Qt 5.6 and to use the Visual Studio C++ version 14.0 compiler. The first build failed as std::max requires the inclusion of <algorithm> which is not required for Linux it has been added to the source code causing no issues for the Linux build. In addition there were a large number of warnings, I’ll cover these when I compare g++, clang++ and the Microsoft compiler in an other post.
Running the project successfully started SaturnQt on Windows 10:
Main window on Windows 10
Settings window on Windows 10.
I haven’t yet built a 64-bit version for Windows 10 as I need 64-bit libraries for MPIR and MPFR (for multi-precision arithmetic) and the QtCreator project file needs to be modified to support 64-bit builds. There will be a post on building 64-bit versions of my software for Windows in due course.
Qt5 versions of my software will not be available until I’ve finished the next versions and sorted out the release packages which will be affected by the transition to Qt5.
This is the final part of the series of posts on Octic fractals as currently implemented in Neptune and Triton. The formulae featured so far have been tailored to allow the critical points to be found relatively easily and to optimise the calculation of the fractals. The final formula is called MC 18.104.22.168.22.214.171.124 i.e. all terms of the polynomial are in play.
The formula is:
z = αz8 + βz7 + γz6 + δz5 + εz4 + ζz3 + ηz2 + θz + c
The critical points are found by solving f'(z) = 0:
f(z) = αz8 + βz7 + + γz6 + δz5 + εz4 + ζz3 + ηz2 + θz + c
f'(z) = 8αz7 + 7βz6 + 6γz5 + 5δz4 + 4εz3 + 3ζz2 + 2ηz + θ
Solving f'(z) = 0 involves finding the roots of a complex number polynomial, the mathematics used to solve these equations is complicated and I am not going to detail how the solutions are derived. The necessary numerical routines for finding the roots of complex number polynomials don’t appear to be readily available for C++ so I had to translate Fortran 90 routines. As with all critical points Neptune and Triton handle them automatically so you don’t have to. My other fractal programs Saturn and Titan also feature a general octic formula called over there Octic, version 5.0.0 will include critical point solving but only a single critical point can be used to produce a fractal picture.
Setting all parameters to 1 produces the following component and composite fractals:
Critical Point 1
Critical Point 2
Critical Point 3
Critical Point 4
Critical Point 5
Critical Point 6
Critical Point 7
The general formula allows combinations of powers of z that aren’t provided by the 3 and two term versions of the Octic formulae. I could have implemented every single possible combination of powers available as octic formulae but that would have led to a great deal more than nine versions.
Cancelling out the fourth power of z by setting ε to zero produces this composite:
ε = 0
Changing ε to 2.25 produces this:
ε = 2.25
Changing a sign of a parameter also has a significant affect on the appearance of the fractal, all parameters set to 1 except β which set to -1 produces this composite:
β = -1
Now with two parameters set to -1:
β = -1 δ = -1
And three parameters set to -1:
β = δ = ζ = -1
And four parameters set to – 1:
β = δ = ζ = ι = -1
A different set of four parameters set to -1, the other parameters set to 1:
α = γ = ε = η = -1
Now with five:
α = γ = ε = η = ι = -1
And back to four:
γ = ε = η = ι = -1
So that’s shown the great variety of weird and wonderful variations possible with the general octic formula mostly by just changing the signs of parameters.
To conclude the series of posts:
- I’ve only scratched the surface of what’s possible with Octic fractals.
- The number of critical points varies from 2 to 7.
- M2 Mandelbrot features always appear in the fractals.
- One of M3 to M7 Mandelbrot features appear depending on the number of critical points, 6 critical points have M3 features, 5 critical points have M4 features and so on.
- Where there is only one critical point the fractal is a standard M8 Mandelbrot and as such is not a multiple critical point fractal.
Development of Neptune and Triton continues, version 2.0 will allow parameters to be modified by multiplying or dividing by the location in the complex plane, where c is explicitly used in a formula it’ll be replaced with a parameter. The rule is that at least one parameter MUST be modified by multiplying or dividing by the location in the complex plane otherwise the Mandelbrot algorithm can’t be used. The effect of these changes will be that already immense possibilities will be enhanced still further.
There is a bug fix release for Saturn and Titan:
- Saturn: the filter for saving parameter files referred to .npf files (Neptune parameters) not .spf files.
- Saturn: changing inner/outer colour selection now affects the picture displayed. The changes were registered but the picture was unchanged, one way to update the picture was to select a different fractal type and return to the original fractal type.
- Titan: parameter theta was displayed in the summary as zeta.
- Titan: the Compasses fractal formula displayed in the summary was missing a z from the second term.
- Versions for both programs upped to 4.2.1.
Three of the bugs are typographical and were missed just by “failing to see”. Failure to see a mistake is all too easy, often when text has been written you know what you thought you wrote and that is what you see even when it has blatant errors in it. Similarly when tackling cryptic crossword anagrams, sometimes, they just will not unjumble themselves and at other times they are solved with the greatest of ease.
The remaining bug was a feature that simply wasn’t tested.
Updated splash screen
This post refers to Saturn and Neptune, they are programs for exploring fractals and are available from the download page.
Octic fractals are generated using an eighth order polynomial, the eighth power Mandelbrot is a special case where all coefficients except that for z8 are zero. It has a single critical point at zero in common with all Mandelbrots defined using the following general formula:
z = zn + c
where n is an integer greater than or equal to 2.
The eighth power Mandelbrot can be found in the list of Saturn fractal types under the name M08 Mandelbrot. It looks like this:
Eighth power Mandelbrot
Saturn also has a fractal type called Octic which is a full polynomial, its formula is:
z = αz8 + βz7 + γz6 + δz5 + εz4 + ζz3 + ηz2 + θz + ι
For use with Mandelbrot algorithm at least one of the parameters (or coefficients) must be the location in the complex plane (usually denoted as c) for convenience ι is set to c. When using the Mandelbrot algorithm the initial value of z is set to a critical point, other values can be used and resulting pictures are “perturbed”. So what are the critical points of an “Octic”? Critical points are the roots of the first derivative of the fractal formula.
So, for Octic:
f(z) = αz8 + βz7 + γz6 + δz5 + εz4 + ζz3 + ηz2 + θz + c
the first derivative is:
f'(z) = 8αz7 + 7βz6 + 6γz5 + 5δz4 + 4εz3 + 3ζz2 + 2ηz + θ
The critical points are the roots of:
f'(z) = 0
I mentioned earlier that any of the coefficients of the polynomial can be the location in the complex plane, in which case, the critical points have to be calculated for every location. Neither Saturn nor Neptune can do this which is why ι was set to c. Saturn only allows a number or the location in the complex plane to be used as the initial value for z. So what value should be used? It is possible to zero out some of the terms so that some critical points can be found relatively easily but that precludes the use of all the terms, solving f'(z) = 0 where all the terms of the polynomial are present isn’t easy, fortunately you don’t have to work them out as Neptune can do it for you. Neptune was specifically designed to produce pictures of fractals with multiple critical points, its version of Octic is MC 126.96.36.199.188.8.131.52.
To start the exploration of Octic fractals all parameters except ι are set to 1, i.e.:
f(z) = z8 + z7 + z6 + z5 + z4 + z3 + z2 + z + c
Neptune produces this picture:
Octic f(z) = z8 + z7 + z6 + z5 + z4 + z3 + z2 + z + c
Saturn can only produce pictures using one critical value at a time, the z0 value to be used can be found on Neptune’s settings window:
Neptune’s settings window
Using the first and sixth critical points Saturn produces:
First critical point
Sixth critical point
Zooming into an area at the left hand size of the sixth critical point picture standard second power Mandelbrot islands can be found.
There are no eighth power Mandelbrot islands (multibrots) as found in the first picture of this post.
Saturn can also generate Octic Julias, the Julia algorithm uses c as the initial value where all parameters have fixed values. Here is an example Julia using the Julia form of the formula used for the pictures above:
Octic Julia ι = 0.17 – 0.33i
There is an enormous variety of Octic “Mandelbrot sets” here are two examples using different coefficients:
Octic f(z) = z8 + z7 + 3z6 + z5 – 0.5z4 + z3 – 2z2 – 0.6z + c
Octic f(z) = z8 + z7 + z6 + 2z5 + z4 + z3 + z2 – z + c
Where all terms of the polynomial are present only Octic Mandelbrot sets will contain second power Mandelbrot islands. Zeroing out various terms other than z8 and c results in sets that contain both Mandelbrot and cubic Mandelbrot islands. Higher order Mandelbrot islands are also found, I don’t know whether more than two types of Mandelbrot islands can be present in the same set, over the course of the next parts I intend to find out.
Neptune will be exclusively used from now on, so no more Julias. Neptune has 9 version of the Octic formula with the number of critical points varying from 7 to 2:
- MC 8.1 z = αz8 + βz + c
- MC 8.2 z = αz8 + βz2 + c
- MC 8.3 z = αz8 + βz3 + c
- MC 8.4 z = αz8 + βz4 + c
- MC 8.5 z = αz8 + βz5 + c
- MC 8.6 z = αz8 + βz6 + c
- MC 8.7 z = αz8 + βz7 + c
- MC 8.7.6 z = αz8 + βz7 + γz6 + c
- MC 184.108.40.206.220.127.116.11 z = αz8 + βz7 + γz6 + δz5 + εz4 + ζz3 + ηz2 + θz + c
Part 2 will focus on MC 8.1.
Saturn and Titan 4.2.0 has been released, it has 4 new fractal types. In addition Neptune and Triton 1.1.0 has been released, it has 11 new fractal types.
Here are the new splash screens for Saturn and Neptune.
As usual versions for Linux and Windows are available.
A bug fix release of Saturn and Titan (4.1.1) and the first release of Neptune and Triton (1.0.0) are now available for download from the software downloads page. Release notes are available on the Saturn and Titan Release Notes and Neptune and Triton Release Notes pages.
Neptune’s splash screen, icon and Triton’s icon are shown below:
Neptune’s splash screen
Note: the splash screen and icon’s are “multiple critical point fractals”. A multiple critical point fractal is constructed out of the pictures produced using different critical points.
The critical points of fractal formulae are usually just a set of numbers (mostly including complex numbers). The following formula is different:
zn+1 = cos(czn) + c
As usual c is a constant representing the location in the complex plane.
This formula has critical points that are an expression.
To find the critical points for this fractal the following equation needs to be solved:
f'(z) = 0
f(z) = cos(cz) + c
f'(z) = c(-sin(cz)) = 0
The c outside the brackets can be ignored and the minus sign disappears because we’re dealing with zero (hint: multiply both sides by -1).
When does the sin of a value equal zero?
sin(0) = 0
sin(π) = 0
sin(2π) = 0
In fact the sin of any integer multiple of π is zero.
So the critical point must be when
z = n&pi/c
where n is an integer.
When n is zero the critical point is zero which is a nice simple number, if n is not zero there is an expression, effectively the critical point is dependent on the location in the complex plan.
The picture for a critical point of zero is:
Now what does the picture for π/c look like? My software Saturn only allows the initial value of z to be set to a number so the expression can’t be used. I’ll look at the allowing the initial value of z to be set to an expression in a future version of Saturn.
In order to produce a picture using the critical points other than 0 for this fractal I’m resorting to a program called Gnofract4d.
Critical Point π/c
The next critical value at 2π/c results in:
Critical Point 2π/c
The picture looks the same as the picture for the critical point at zero. The critical points at 2nπ/c produce the same pictures as do the critical points at (2n + 1)π/c. So only two critical points are needed to give an idea of what the multiple critical point version of the fractal looks like.
Multiple critical point version
Note: a relatively high bailout of 300 is needed to produce these pictures.