Skip to content

Commit

Permalink
Merge pull request #1 from InCogNiTo124/feature/numpy
Browse files Browse the repository at this point in the history
Switch to Qt5 due to Kivi's slowness
  • Loading branch information
InCogNiTo124 authored Apr 17, 2020
2 parents 70ab47e + 8eef14d commit a4c6719
Show file tree
Hide file tree
Showing 11 changed files with 297 additions and 287 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Created by https://www.gitignore.io/api/vim,python,virtualenv
# Edit at https://www.gitignore.io/?templates=vim,python,virtualenv

Expand Down Expand Up @@ -149,3 +148,4 @@ pip-selfcheck.json

activate
libs/
.flake8
Binary file removed ChaosPlotterScreenshot.png
Binary file not shown.
3 changes: 0 additions & 3 deletions MyKivyNotes.md

This file was deleted.

25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@

# ChaosPlotter
![Screenshot](/ChaosPlotterScreenshot.png)
Plot chaos using Python3/[Kivy](https://kivy.org/)
![](chaosplotter_nochaos_population.png)

![](chaosplotter_chaos_population.png)

![](chaosplotter_nochaos_fft.png)

Plot chaos using Python3/[Qt](https://www.qt.io/)
## What is it?
It's a visualization of iterated maps. A starting population P is selected (by a vertical slider on the far left) and then run through a function (as selected in the upper left). The result is then feeded once again through the same function, over and over again. This is called *MAP ITERATION*. Sequential values are plotted with the red line on the graph in the upper right.
An interesting behaviour can be observed if the value of R (big central horizontal slide) is increased. At first, almost every<sup>1</sup> starting population converges to a fixed number. By increasing the R slider even more, our iterated map starts to oscillate between 2 values. If R keeps getting bigger, we see the period 4, than 8, 16... and so on until it gets chaotic and starts to take any value from [0, 1] interval in a seemingly random fashion.
Expand All @@ -10,7 +15,7 @@ If we plot the values the map converges to as a function of R, we get a [bifurca

## How to use it?
1. Choose a function you wish to iterate. The first one usually gives the best results.
2. Observe the bifurcation diagram slowly<sup>3</sup> appearing in front of you and be amazed.
2. Observe the bifurcation diagram appearing in front of you and be amazed.
3. Change the R with the big slider in the middle. Observe what happens with the population graph. The vertical line in the diagram shows where the population graph from above fits into the bifurcation diagram. Be more amazed.
4. Change the starting population:
1. If you're in the "tame" zone, observe how the oscillating values don't change much with respect to the starting population.
Expand All @@ -35,18 +40,10 @@ and enjoy :)

- <sup>1</sup> This is true for all values in [0, 1], except 0 and 1 (so technically <0, 1>), and maybe some points inside that interval
- <sup>2</sup> Actually, you can find periods of any length: 5, 13, 120497... You name the natural number, the corresponding period is in there somewhere
- <sup>3</sup> Yes, I am aware of how slow it is. It takes, on average, around 60 seconds on my Ryzen 7
## Wish to contribute?
You are very welcome. Just open an issue or push a PR.

### TODO:
- Add more modes for population visualization:
- [ ] Fourier transform of the population
- [ ] Difference from the previous population
- [ ] Fourier transform of the difference
- [ ] Something else?!
- I wish to have a dropdown of functions to iterate rendered either in latex or [Kivy markup](https://kivy.org/doc/stable/api-kivy.core.text.markup.html)
- Speed
- [ ] Integration with numpy
- [ ] Better multithreading / processing

- [x] Integration with numpy and matplotlib
- [x] Using fast Qt gui framework
- [ ] Switch to `pyqtgraph`
116 changes: 0 additions & 116 deletions chaosplotter.kv

This file was deleted.

Loading

0 comments on commit a4c6719

Please sign in to comment.