Skip to content

Commit 1c107cd

Browse files
committed
Added description and uploaded on main page
1 parent 472b771 commit 1c107cd

File tree

6 files changed

+72
-9
lines changed

6 files changed

+72
-9
lines changed

firefly_synchronization/simulation.html

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ <h1 id="main-heading">Visualize It</h1>
5252

5353
<div class="text">
5454
<h2>Firefly Synchronization</h2>
55-
55+
<center>
56+
<p>Fireflies synchronize their internal flashing clocks by obtaining inputs from nearby fireflies. This simulation
57+
tries to mimic this phenomenon.</p>
58+
</center>
59+
<br>
5660
<div class="container" style="width:90%">
5761
<div class="row">
5862
<div class="col s12 l8">
@@ -76,7 +80,7 @@ <h2>Firefly Synchronization</h2>
7680
<span id="noise-display"></span>
7781
<input id="noise-input" type="range" min="0" max="2" step="0.1" oninput="updateParams('noise')"
7882
onchange="updateParams('noise')">
79-
<br>
83+
<br>
8084
<label>
8185
<input id="phase-toggle" type="checkbox" style="position: relative;" />
8286
<span>Display phase circle</span>
@@ -89,6 +93,34 @@ <h2>Firefly Synchronization</h2>
8993
</div>
9094
</div>
9195

96+
<hr>
97+
98+
<h3>Description</h3>
99+
100+
<p>
101+
This simulation uses the Kuramoto model of phase oscillators for synchronization. For a firefly \(i\)
102+
\[ \theta_i = \omega + \frac{K}{N} \sum_{j \in S} \sin(\theta_j - \theta_i) \]
103+
where &theta; is the phase, &omega; is the phase velocity, \(K\) is the synchronization strength and \(S\) is the
104+
set of fireflies within the synchronization radius of the given firefly. In addition to the above sync mechanism,
105+
there is repulsion between the fireflies. Velocity as well as phase of each firefly is affected by noise.
106+
<br> <br>
107+
Sync strength \( K \) promotes synchronization. Sync radius \( r \) ensures tha synchronization is present over
108+
greater areas. Higher phase noise makes synchronization harder, and represents errors in perception by the
109+
fireflies. Higher the global synchronization, lower the standard deviation of phase. The phase circle collectively
110+
displays the phases of each firefly.
111+
</p>
112+
113+
<br>
114+
<hr>
115+
<br>
116+
117+
<b>Note:</b>
118+
<ol>
119+
<li>Standard deviation of phase has an oscillatory behaviour because of the cyclic nature of phase. Even when all
120+
fireflies are synchronized, SD briefly peaks whenever the phases cross the 360 &deg; threshold.</li>
121+
<li>This simulation is computationally complex, and may lag on lower-end devices.</li>
122+
</ol>
123+
92124
<br>
93125
<hr>
94126

images/firefly_sync.png

77.7 KB
Loading

images_webp/firefly_sync.webp

26.3 KB
Binary file not shown.

index.html

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h1 id="main-heading">Visualize It</h1>
5858
<div class="row">
5959
<div class="row">
6060
<div class="col s12 l5">
61-
<img class="responsive-img" src="images_webp/ising_model.webp" alt="image">
61+
<img class="responsive-img" src="images_webp/ising_model.webp" alt="ising model">
6262
</div>
6363
<div class="col s12 l7">
6464
<h2 style="margin:0">Ising Model</h2>
@@ -76,11 +76,13 @@ <h2 style="margin:0">Ising Model</h2>
7676
</center>
7777
</div>
7878
</div>
79+
</div>
7980

80-
<br>
81-
<hr>
82-
<br>
81+
<br>
82+
<hr>
83+
<br>
8384

85+
<div class="row">
8486
<div class="col s12 l5">
8587
<img class="responsive-img" src="images_webp/trig_functions.webp" alt="trigonometric functions">
8688
</div>
@@ -106,6 +108,32 @@ <h2 style="margin:0">Trigonometric Functions</h2>
106108
<hr>
107109
<br>
108110

111+
<div class="row">
112+
<div class="col s12 l5">
113+
<img class="responsive-img" src="images_webp/firefly_sync.webp" alt="firefly synchronization">
114+
</div>
115+
<div class="col s12 l7">
116+
<h2 style="margin:0">Firefly Synchronization</h2>
117+
<center>
118+
<span>#complex-systems #simulation</span>
119+
</center>
120+
<p class="flow-text">
121+
Fireflies have an internal clock on the basis of which they emit light periodically. However,
122+
they manage to sync up their cycles by observing their neighbours and nudging their phase
123+
accordingly. See this mechanism in action!
124+
</p>
125+
<center>
126+
<a href="firefly_synchronization/simulation.html">
127+
<button class="btn purple darken-4">Visit</button>
128+
</a>
129+
</center>
130+
</div>
131+
</div>
132+
133+
<br>
134+
<hr>
135+
<br>
136+
109137
<div class="row">
110138
<div class="col s12 l5">
111139
<img class="responsive-img" src="images_webp/special_relativity.webp" alt="special relativity">
@@ -132,7 +160,6 @@ <h2 style="margin:0">Special Relativity</h2>
132160
<hr>
133161
<br>
134162

135-
<!-- template -->
136163
<div class="row">
137164
<div class="col s12 l5">
138165
<img class="responsive-img" src="images_webp/sorting_algos.webp" alt="sorting algorithms">

templates/basic.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,16 @@ function step() {
3838
animate(step);
3939
}
4040

41-
window.onload = function() {
41+
window.onload = function () {
42+
defaultParams();
4243
initParams();
4344
animate(step);
4445
}
4546

47+
function defaultParams() {
48+
49+
}
50+
4651
let click_x, click_y, pressed;
4752

4853
if(mobile) {

templates/simulation.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ <h2>Template</h2>
6363

6464
<br>
6565
<hr>
66-
<br>
6766

6867
<p class="center-align">Developed by ChanRT | Fork me at <a href="https://www.github.com/chanrt">GitHub</a></p>
6968
</div>

0 commit comments

Comments
 (0)