Team:Valencia Biocampus/Demonstration/Diffusion3
From 2013.igem.org
(Difference between revisions)
Beta3designs (Talk | contribs) |
Beta3designs (Talk | contribs) (→Proof of a Group Behavior Diffusion Model from a Random Walk Model) |
||
Line 63: | Line 63: | ||
<html> | <html> | ||
</div> | </div> | ||
+ | </html> | ||
+ | |||
+ | <html> | ||
+ | <script type="text/javascript"> | ||
+ | $(document).ready(function() { | ||
+ | // cache the id | ||
+ | var navbox = $('#myTab'); | ||
+ | // activate tab on click | ||
+ | navbox.on('click', 'a', function (e) { | ||
+ | // add a hash to the URL when the user clicks on a tab | ||
+ | history.pushState(null, null, $(this).attr('href')); | ||
+ | var $this = $(this); | ||
+ | // prevent the Default behavior | ||
+ | e.preventDefault(); | ||
+ | // set the hash to the address bar | ||
+ | window.location.hash = $this.attr('href'); | ||
+ | // activate the clicked tab | ||
+ | $this.tab('show'); | ||
+ | //return false; | ||
+ | }) | ||
+ | |||
+ | // if we have a hash in the address bar | ||
+ | if(window.location.hash){ | ||
+ | // show right tab on load (read hash from address bar) | ||
+ | $('a[href="'+window.location.hash+'"]').tab('show'); | ||
+ | } | ||
+ | |||
+ | // navigate to a tab when the history changes | ||
+ | window.addEventListener("popstate", function(e) { | ||
+ | var activeTab = $('[href=' + location.hash + ']'); | ||
+ | if (activeTab.length) { | ||
+ | activeTab.tab('show'); | ||
+ | } else { | ||
+ | $('.nav-tabs a:first').tab('show'); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
+ | |||
+ | |||
</html> | </html> |
Revision as of 10:53, 3 October 2013
Proof of a Group Behavior Diffusion Model from a Random Walk Model
Considerations for the Random Walk:
- Step lenghts ($l_t$) in the order of a pixel in size. That implies, $ \Delta t $ as small as possible.
-
Perfect Random Walk, with uniform probabilistic distributions either for $ v_t $, $\dot{\theta_t}$ and $\delta$.
Discretizing the whole space into pixels, and assuming, the worm can, either occupy one or not, we can assure that, at each time step, it can only move in four different directions: up, down, right or left from its position. As we considered that each random variable follows an uniform probabilistic distribution, it is equipossible to move in any of these directions, with a probability of $ \frac{1}{4} $ each.
Now, we can compute, the probability that the worm is at position $(x_m,y_m)$ at the iteration $n+1$ as follows:
$$ P_{n+1}(x_m,y_m)\;=\;\frac{1}{4}\;\left(P_{n}(x_m,y_{m+1}) + P_{n}(x_{m+1},y_m) + P_{n}(x_m,y_{m-1}) + P_{n}(x_{m-1},y_m)\right) $$
If we now subtract $ P_{n}(x_m,y_m) $ from both sides:
$$ P_{n+1}(x_m,y_m) - P_{n}(x_m,y_m)\;=\;\frac{1}{4}\;\left(P_{n}(x_m,y_{m+1}) + P_{n}(x_{m+1},y_m) + P_{n}(x_m,y_{m-1}) + P_{n}(x_{m-1},y_m) - 4\;P_{n}(x_m,y_m)\right) $$ $$ P_{n+1}(x_m,y_m) - P_{n}(x_m,y_m)\;=\;\frac{1}{4}\;\left(P_{n}(x_{m+1},y_m) - 2\;P_{n}(x_m,y_m) + P_{n}(x_{m-1},y_m) + P_{n}(x_m,y_{m+1}) - 2\;P_{n}(x_m,y_m) + P_{n}(x_m,y_{m-1})\right) $$
Multiplying and dividing by $q$ (time step) and $h^2$ (space step squared) we then get:
$$ \frac{P_{n+1}(x_m,y_m) - P_{n}(x_m,y_m)}{q}\;=\;\frac{h^2}{4\;q}\;\left(\frac{P_{n}(x_{m+1},y_m) - 2\;P_{n}(x_m,y_m) + P_{n}(x_{m-1},y_m)}{h^2} + \frac{P_{n}(x_m,y_{m+1}) - 2\;P_{n}(x_m,y_m) + P_{n}(x_m,y_{m-1})}{h^2}\right) $$
And, defining the constant $D\;=\;\frac{h^2}{4\;q}$:
$$ \frac{P_{n+1}(x_m,y_m) - P_{n}(x_m,y_m)}{q}\;=\;D\;\left(\frac{P_{n}(x_{m+1},y_m) - 2\;P_{n}(x_m,y_m) + P_{n}(x_{m-1},y_m)}{h^2} + \frac{P_{n}(x_m,y_{m+1}) - 2\;P_{n}(x_m,y_m) + P_{n}(x_m,y_{m-1})}{h^2}\right) $$
That can be approximated as a Diffusion Equation, by recalling the definition for the first and second derivates:
$$\frac{\partial P}{\partial t} = D \; \left(\frac{\partial^2 P}{\partial x^2} + \frac{\partial^2 P}{\partial y^2}\right) $$
Okopinska A. (2002) Fokker-Planck equation for bistable potential in the optimized expansion. Physical review E, Volume 65, 062101