# Biomod/2011/Caltech/DeoxyriboNucleicAwesome/Simulation

Friday, February 12, 2016

Home

Members

Project

Protocols

Progress

Discussion

References

# Simulations

## Overview

Our proposed sorting mechanism depends very heavily on a particular random-walking mechanism that has not been demonstrated in literature before. The verification of this mechanism is thus a vital step in our research. Verification of the random walk in one dimension is fairly straightforward: as discussed in SPEX experiments, a one-dimensional track is easy to construct, and will behave like a standard 1D random walk, showing an average translation on the order of $n^{\frac{1}{2}}$ after n steps. Thus, we should expect the time it takes to get to some specific level of fluorescence to be proportional to the square of the number of steps we start the walker from the irreversible substrate. If we can, in an experiment, record the fluorescence over time when the walker is planted at different starting points and show that that fluorescence varies by this relationship, we'll have fairly certainly verified one-dimensional random walking.

Our particular case of 2D random walking, however, is not as easily understood, especially considering the mobility restrictions (ability to move to only 4 of 6 surrounding locations at any particular time) of our particular walker. As a control for the verification of 2D random walking, though, we still need to get an idea how long the random walk should take, and how that time will change as we start the walker at different points on the origami. We opt to do this by simulating the system with a set of movement rules derived from our design. We also use the same basic simulation (with a few alterations and extra features) to simulate our entire sorting system in a one-cargo, one-goal scenario, to give us some rudimentary numbers on how long sorting should take, with one vs multiple walkers.

Basic parameters and assumptions:

• The unit of time is the step, which is the time it takes a walker to attempt to interact with one of the surrounding six locations.
• Every probe on the origami are given coordinates like a grid (which shifts the even columns up by 0.5). The bottom-left is <1, 1>, the top-left <1, n>, and the bottom-right <m, 1>, <m, n> being the number of probes on the origami (which can be anything).
• These layouts are inputted as a matrix in MATLAB, with the top-left being <1,1> and bottom-right being <m, n>; different objects on origami to be mounted on each probe are coded by number:
• 0 = nothing
• 1 = track 1
• 10 = walker on track 1
• 2 = track 2
• 20 = walker on track 2
• 3 = cargo
• 4 = cargo goal
• 40 = filled cargo goal
• 5 = walker goal
• 50 = filled walker goal
• To turn a hexagonal grid into the square one that the grid layout implies, even columns are shifted up by 0.5 in this representation. This leads to the restriction that the first column must be a "high" column, as described in the code's documentation (see below).
• Movement rules are based on column:
• In even columns, a walker can move in directions <0, 1>, <0, -1>, <1, 0>, <-1, -1>, <-1, 1>, <1, 0>.
• In odd columns, a walker can move in directions <0, 1>, <0, -1>, <-1, 0>, <1, 1>, <1, -1>, <-1, 0>.
• Every time step, each walker being simulated takes a step in a random direction, and attempts to interact with whatever it hits:
• If it tries to step off of the origami or onto something that isn't a track, it doesn't move.
• If it tries to step to a track of the same type or an occupied track of either type, it does nothing.
• If it tries to step to a track of the opposite type that's not occupied, it moves there.
• If it tries to step onto a cargo, it'll pick it up but not move.
• If it's carrying a cargo and tries to step onto a goal of the same type as the cargo, it'll drop the cargo but not move.
An illustration of the grid and motion rules (for walking; directions of motion that won't result in a step aren't shown) used in the simulation. The bottom-left is the origin (<1,1> because MATLAB indexes by 1). The 2D platform, including track A (red), track B (blue), the marker (tan), cargo (gold), and goal (green), is shown on the left. The grid on the right -- the grid corresponding to our numbering system and representing viable track for a random walk -- is created by shifting even columns up by 0.5. This arrangement (which is, in essence, a visualization tool) reveals through the vertical symmetry of the arrangement that movement rules are going to vary by column only. The valid moves in even and odd columns shown on the left are mapped onto the grid on the right to derive the moveset listed above.

## MATLAB Code

At the core of the simulation is a function which runs runs one random walk on an origami of specified size. It can run in both a cargo-bearing (one-cargo one-goal) and a purely random-walk mode. The former has cargo positions corresponding to our particular origami pre-programmed and starting with multiple (specified by user) walkers at random locations on the origami, and terminates when all of the cargos have been "sorted" to the goal location (the x axis). The latter runs one walker starting at a specified location, and terminates when that walker reaches the specified irreversible track location. The function returns a log of all walkers positions over time, a log reporting when cargos were picked up and dropped off, a count of the number of steps the simulation took, and if desired, a move of the random walk. This function is utilized by separate cargo-bearing and random-walk data collection programs that call the function many times over a range of parameters.

The function code (saved as randomWalkFunctionGeneric.m): Toggle Code

### Examining Errors in Origami

This code can be used to generate diagrams like those below, visualizing the mobility of the walker. One immediate question is the vulnerability of this layout to errors in the laying of track. We investigate this by, when generating the track layout in the beginning of randomWalkFunction, introducing a small (specified by input) percent chance that any single probe will be omitted. Error rates at around 10% are bearable; error rates greater than that, however, are catastrophic, causing walkers to become permanently trapped in small sections of the track field.

Node graphs showing walker mobility of origami. Each junction represents a track, and each edge represents a step a walker can take. The left diagram shows no error, whereas the other two show increasing error rates. We observe that 10% error rates decrease walker mobility, but tend not to trap the walker in any particular location; 20% error rates or greater, over several tests, tend to cause catastrophic loss of mobility, making the sorting task impossible.

## Random-Walk Simulation

The data we need from this simulator is a rough projection of the fluorescence response from our test of 2D random walking, which should change based on the starting location of the walker. Because this fluorescence is changed by a fluorophore-quencher interaction upon a walker reaching its irreversible track, in the case where we plant all of the walkers on the same starting track, the time it takes (fluorescenceinitialfluorescencecurrent) in the sample to reach some standard value should be proportional to the average time it takes the walkers to reach the irreversible substrate. As this 'total steps elapsed' value is one of the outputs of our simulation function, we can generate a map of these average walk durations by running a large number of simulations at each point on the origami and averaging the results: Toggle Code

A plot of the number of steps (on an average over 2000 iterations) it takes a walker to random walk from any point on the origami to the irreversible track at <15, 7>. The holes are due to omitted, cargo, or goal strands blocking the walker's starting location.

### Results

Results of the bulk data collection at right show that the average random-walk duration, and thus the time for (fluorescenceinitialfluorescencecurrent) to reach some standard level, increases with distance, though it changes less significantly the farther out one gets. Also important to note is that the "effective distance" (in terms of steps) along the short axis of our platform is a significantly less than the same physical distance along the long axis. This difference is due to our arrangement of track A and B: as can be seen in the left half of the diagram at the end of the #Overview section, alternating tracks A and B create a straight vertical highway for the walker to follow. Horizontal movement, in contrast, cannot be accomplished by purely straight-line movement -- it requires a back-and-forth weave that makes motion in that direction slower. The disparity in "effective distances" between the vertical and horizontal dimensions is something, in particular, that we should test for; however, a simple series of tests running random walks at a variety of points across the surface, and the comparison of the resulting fluorescence data to the control provided by this simulation should be sufficient to prove that our walker can, indeed, perform a 2D random walk.

## Cargo Sorting Simulation

This simulation investigates both the overall tractability of our sorting problem, and the degree to which it can be parallelized via the addition of multiple walkers onto a single origami. It runs by making repeated calls to randomWalkFunction in its cargo-bearing mode, testing the number of steps it takes to sort all five cargos to respective goals over a range of number of cooperating walkers: Toggle Code

### Results

A plot of the number of steps (on an average over 250 iterations) it takes n walkers to sort all five cargos to respective goals on a perfectly formed 16x8 track, as detailed above. The jaggedness in the curve is a result of the large spread of results for any given test.

While a single walker takes over a thousand steps to complete the sorting challenge, the addition of even a single walker vastly decreases the completion time, and additional walkers decrease it further, until a critical point is reached where the walkers are more getting in the way than helping with the sorting process. This is visible in the positive slope visible in the diagram at right that starts at around the 20 walker point.