Draft

# A wiggling lattice protein

Draft of 2016.11.21

May include: visualizationprogramming&c.

This is a bit of a work-in-progress report:

I’ve spent a few days (in the few moments when I’m not focused on the rise of Actual Fascism in the US) working through some simple ways to represent and draw the lattice proteins I spoke about the other day. This morning I threw several versions away, and Ron and I paired for a couple of hours and built this little sketch:

What’s happening here is this:

So for example, suppose the configuration started as a chain of five beads arranged initially [:east :east :east :east]. This first heuristic just picks one of those four items (with uniform probability) and changes it to a random direction: for example, it might become [:east :east :north :east]. Then we try laying out a chain in that path, and find that it doesn’t contain any collisions, so we accept the change and the animation is updated.
If the next random change attempted produces a chain [:east :west :north :east], when we lay out a chain with those directions we get a collision (the :east followed by :west) in which two beads occupy the same lattice positions. So we discard the random change and the chain remains in the [:east :east :north :east] position, and another random change is attempted next time.