Created
February 21, 2015 01:24
-
-
Save lovasoa/9ab8f948eb6b597b6bf3 to your computer and use it in GitHub Desktop.
Cooperativity-driven singularities in asymmetric exclusion (probabilistic version)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lambda = .5; | |
var p = new Array(10); | |
for(var i=0; i<p.length;i++) p[i]=0; | |
p[2]=1; | |
var niter = 3; | |
for (var k=0;k<niter;k++){ | |
var p2 = [0,0]; | |
for(var i=2; i<p.length-1;i++) { | |
// The current particle stays + the previous one spontaneously bounces + the previous one is pushed | |
p2[i] = (p[i]*p[i+1] + (1-p[i+1])*p[i]*(1-p[i-1])*(1-lambda)) | |
+ (1-p[i-2])*p[i-1]*(1-p[i])*lambda | |
+ p[i-2]*p[i-1]*(1-p[i]); | |
} | |
p=p2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment