int len=400; double[] yr = new double[len]; double[] yi = new double[len]; double[] p = new double[len]; double[] v = new double[len]; double timestep=64; double dt=1/8.0; void setup() { size(400, 200); noStroke(); frameRate(0); //smooth(); background(00); // inital displacement if(true){ // set up width of the particle wave packet for(int i=0;i200-1) py=200-1; if(py<0) py=0; pixels[py*len+px] = #6666ff; */ // plot probability density py=100-(int)(p[i]*64.0); px=i; if(py>200-1) py=200-1; if(py<0) py=0; pixels[py*len+px] = #0000ff; // plot imaginary part py=100-(int)(yi[i]*64.0); px=i; if(py>200-1) py=200-1; if(py<0) py=0; pixels[py*len+px] = #8f0000; // plot real part py=100-(int)(yr[i]*64.0); px=i; if(py>200-1) py=200-1; if(py<0) py=0; pixels[py*len+px] = #00ff00; } updatePixels(); }