-
Notifications
You must be signed in to change notification settings - Fork 0
/
ising.html
49 lines (48 loc) · 2.22 KB
/
ising.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>Ising model</title>
<link rel="stylesheet" href="ising.css">
</head>
<body>
<div id="model">
<p>This is a 2D Ising model simulation. It uses Metropolis criterion, where a magnetic
domain is always flipped when Δ<i>E</i><0, otherwise with probability
<img src="metropolis.gif">. Domain oriented "up" is orange, "down" is white.
Domains are selected one by one, each with probability (1-"randomness").
Metropolis criterion is applied only to selected domains, so that randomness=0 applies metropolis criterion
to every domain, which may result in artificial, oscillation-like behaviour.
Randomness close to one slows down the algorithm.
Additional parameter Fr, responsible for friction,
can be added to Δ<i>E</i>. Coupling constant J describes interaction between domains.
Buttons on the bottom can be used to control simulation speed or reset it.
I used <a href="http://rileyjshaw.com/terra/" target="_blank">terra.js</a>.
Here is the <a href="ising.js" target="_blank">simulation code</a>.</p>
<p> Author: Łukasz Mioduszewski</p>
<div id="placeholder"></div>
<div>
<script src="mainfile.js"></script>
<script src="ising.js"></script>
</div>
<div id="parameters">
<p>Magnetization per domain m=<span class="value" id="printm">0</span></p>
<p>Total magnetization M=<span class="value" id="printM">0</span></p>
<p>Coupling J=<span class="value" id="printJ">0.1</span></p>
<p>Temperature T=<span class="value" id="printT">0.1</span></p>
<p>External field h=<span class="value" id="printH">0</span></p>
<p>Friction Fr=<span class="value" id="printF">0</span></p>
<form id="input">
Randomness:<input id="R" value="0.9" step="0.1" type="number"><br>
Coupling:<input id="J" value="1.0" step="0.1" type="number"><br>
Temperature:<input id="T" value="0.2" step="0.1" type="number"><br>
External field:<input id="H" value="0.0" step="0.1" type="number"><br>
Friction:<input id="F" value="0.0" step="0.1" type="number">
</form>
</div>
</div>
<button onclick="stop()">Stop</button>
<button onclick="play()">Play</button>
<button onclick="next()">Next Frame</button>
<button onclick="reset()">Reset</button>
</body></html>