-
Notifications
You must be signed in to change notification settings - Fork 10
/
sketch.js
39 lines (32 loc) · 800 Bytes
/
sketch.js
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
// Display options:
const CANVAS_WIDTH = 900//1920;
const CANVAS_HEIGHT = 600//1080;
const FRAME_RATE = 20;
let settings = {
size: 1024,
energy: 3E+4,
median: 0.5,
sigma: 0.01,
timeStep: 1E-6,
stepsPerFrame: 20,
maxFrames: 1000,
potential: x => 2E+4*Math.pow((4*x - 1)*(4*x - 3),2),
label: 'Double Well',
momentumZoom: 4,
scaleFactor: 1,
underlay: null,
dataFile: 'doubleWell',
imageFile: null
};
let quantumParticle;
function setup() {
frameRate(FRAME_RATE);
createCanvas(CANVAS_WIDTH, CANVAS_HEIGHT);
settings.underlay = createGraphics(CANVAS_WIDTH, CANVAS_HEIGHT);
background(0);
quantumParticle = new Schroedinger(settings);
}
// Draw loop:
function draw() {
quantumParticle.simulationStep();
}