[[attachment:Workshops/Workshop11/Materials/CellDiffusionCalculatorSteppable.py|Cell Diffusion Calculator Steppable]] [[attachment:Workshops/Workshop11/Materials/cellsort2D_negative_J.py|cellsort2d_negative_J.py]] == Function: == This python steppable calculates diffusion coefficient of GGH cells by tracking their center of masses. The diffusion coefficient is cluster averaged. This steppable is compatible with periodic boundary conditions. Summary of the code: 1. attach a list to cells (type 1) 1. store the location of CM of cells in the lists (length of the list is equal to dt_max) 1. if MCS>dt_max(buffering CM locations) 1. while dt=2^n <= dt_max 1. calculate and store displacement (d(0,dt)^2/4) during dt interval 1. average d(0,dt)^2/4 over cells 1. calculate y(dt)=log2(d(0,dt)^2/4) 1. calculate x(dt)=log2(2^n)=n 1. fit a line to y vs. x and calculate slope and intercept 1. Diffusion constant=2^(intercept) 1. slope<1 --> sub-diffusive 1. slope>1 --> super-diffusive 1. slope=1 --> random walk