<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>worldmaking</title>
	<atom:link href="http://moniker.name/worldmaking/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://moniker.name/worldmaking</link>
	<description>fantastic plastic virtual</description>
	<lastBuildDate>Thu, 26 Aug 2010 20:55:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>TopoSynth: Incorporating Cosm</title>
		<link>http://moniker.name/worldmaking/?p=138</link>
		<comments>http://moniker.name/worldmaking/?p=138#comments</comments>
		<pubDate>Thu, 26 Aug 2010 13:55:32 +0000</pubDate>
		<dc:creator>moniker</dc:creator>
				<category><![CDATA[Computational Composition]]></category>
		<category><![CDATA[Computational Technique]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[cosm]]></category>
		<category><![CDATA[dynamics]]></category>
		<category><![CDATA[topology]]></category>
		<category><![CDATA[TopoSynth]]></category>

		<guid isPermaLink="false">http://moniker.name/worldmaking/?p=138</guid>
		<description><![CDATA[I&#8217;ve finally completed all of the basic topological operations for TopoSynth and am now moving on to treating the dynamics of the system.  This last rule involved figuring out how to connect two extended vertices together when they collide. For &#8230; <a href="http://moniker.name/worldmaking/?p=138">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally completed all of the basic topological operations for TopoSynth and am now moving on to treating the dynamics of the system.  This last rule involved figuring out how to connect two extended vertices together when they collide.</p>
<p><a href="http://moniker.name/worldmaking/wp-content/uploads/2010/08/dlfl.cosm_.halfway.png"><img class="alignnone size-full wp-image-139" title="dlfl.cosm.halfway" src="http://moniker.name/worldmaking/wp-content/uploads/2010/08/dlfl.cosm_.halfway.png" alt="" width="541" height="580" /></a></p>
<p>For example, in the above image, there are 2 vertices that have been progressively extended, leaving a tail behind.  The vertices being extended are at the tip.  If these vertices happen to collide (or any other vertices for that matter), I want a way to merge them in such a way as to create a handle and thus preserve the 2-manifold nature of the mesh.  Simply connecting them with an edge isn&#8217;t a solution since that would either break the 2-manifold or create an extremely awkward face.  Instead, what I do is a multi-step process of deleting each vertex, which leaves 2 faces behind.  This is a kind of reversestellate operation.  Then, I join the 2 faces together with a pipe creating a seamless connection between the previously disjoint sections of the mesh.</p>
<p><span style="font-size: 13px; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px;"><img class="alignnone size-full wp-image-143" title="op.delete.vertex" src="http://moniker.name/worldmaking/wp-content/uploads/2010/08/op.delete.vertex.png" alt="" width="527" height="282" /></span></p>
<p>As an illustration of the delete-vertex operation, imagine the mesh on the left and we want to delete vertex 93 in the middle.  When the operation is done, vertex 93 will be gone and a new face consisting of all of the vertices connected to vertex 93 by an edge will be left behind.  This operation is easily carried out by circulating around all of the face vertices of vertex 93 and successively adding the face vertices <strong>not</strong> connected by and edgeto vertex 93 to the new face.  To finish, simply delete the vertex, all of its face vertices as well as the edges and the face vertices they link to vertex 93.  The face vertices in dark blue circles are the ones that will be deleted in addition to the vertex 93 face vertices.</p>
<h2>Cosm</h2>
<p>One of the problems that came up when testing this out was how to direct the vertices near enough to each other to connect them in a nice way.  There&#8217;s the typical procedural methods using splines to model the transition, but in TopoSynth, mesh vertices are more like a kind of super-particle that contain their own ways of interacting with the environment.  Eventually, I&#8217;m going to be incorporating fields and other forces into the system, so I decided to integrate some previous particle dynamics work we&#8217;ve done in <a title="Cosm" href="http://www.allosphere.ucsb.edu/cosm/">Cosm</a>.  Cosm already incorporates basic dynamics and most importantly collision detection.  This allows me to direct the topological operations based on particle movements and collision events.</p>
<p>I incorporated Cosm into TopoSynth by replacing the notion of a vertex with a particle aka a cosm.nav (with nav being a directed point in space).</p>
<p><a href="http://moniker.name/worldmaking/wp-content/uploads/2010/08/dlfl.cosm_.base_.png"><img class="alignnone size-full wp-image-142" title="dlfl.cosm.base" src="http://moniker.name/worldmaking/wp-content/uploads/2010/08/dlfl.cosm_.base_.png" alt="" width="506" height="461" /></a></p>
<p>A cosm.nav consists of a position in world space and an orientation defined by a <a title="Quaternions and Spatial Rotation" href="http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation">quaternion</a>.  This is why vertices are not drawn as points, but instead as circles with a perpendicular line.  The line depicts the direction the nav is facing while the circle indicates xy-plane of the local coordinate system.</p>
<p>Right now, I&#8217;m trying to get more control over the dynamics (e.g. how one vertex meets another while both are moving), thinking over how rule definitions for dynamics and behavior will be described, and what the overall control flow of the system needs to be to make sure the mesh stays valid as do the elements rules are operating on.  For example, if a rule deletes two vertices, that rule gets killed, but what happens to other rules that might refer to the vertex in some way?  Another big challenge is figuring out how to provide a high-level interface to placing rules on the mesh without having to assign them individually by hand.  There&#8217;s a lot of approaches to play around with, and now that the nitty-gritty of the topological operations is taken care of, the fun part of figuring out how to compose with the system begins.  Here&#8217;s a first render of an example, perhaps a little hard to read, but I&#8217;ll post it anyway.  Expect more soon&#8230;</p>
<p><span style="font-size: 13px; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px;"><img class="alignnone size-full wp-image-145" title="dlfl.cosm.s" src="http://moniker.name/worldmaking/wp-content/uploads/2010/08/dlfl.cosm_.s-e1282856060376.jpg" alt="" width="600" height="600" /></span></p>
]]></content:encoded>
			<wfw:commentRss>http://moniker.name/worldmaking/?feed=rss2&amp;p=138</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TopoSynth: Topological Structure</title>
		<link>http://moniker.name/worldmaking/?p=127</link>
		<comments>http://moniker.name/worldmaking/?p=127#comments</comments>
		<pubDate>Mon, 23 Aug 2010 10:20:16 +0000</pubDate>
		<dc:creator>moniker</dc:creator>
				<category><![CDATA[Computational Composition]]></category>
		<category><![CDATA[Computational Technique]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[DLFL]]></category>
		<category><![CDATA[generative]]></category>
		<category><![CDATA[Structure Synth]]></category>
		<category><![CDATA[TopMod]]></category>
		<category><![CDATA[topology]]></category>
		<category><![CDATA[TopoSynth]]></category>

		<guid isPermaLink="false">http://moniker.name/worldmaking/?p=127</guid>
		<description><![CDATA[DLFL Background As I had mentioned in the last post, the topological inspiration for TopoSynth is derived from TopMod and particularly the doubly-linked face list (DLFL) data structure.  The DLFL makes it particularly straightforward to always maintain a 2-manifold mesh &#8230; <a href="http://moniker.name/worldmaking/?p=127">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>DLFL Background</h2>
<p>As I had mentioned in the last post, the topological inspiration for TopoSynth is derived from TopMod and particularly the <a title="DLFL" href="http://www.viz.tamu.edu/faculty/ergun/research/topology/papers/ijsm99.pdf">doubly-linked face list (DLFL) data structure</a>.  The DLFL makes it particularly straightforward to always maintain a 2-manifold mesh structure as mesh transformation operations can all be expressed in terms of 4 primitive operations:</p>
<ol>
<li>Insert vertex</li>
<li>Remove vertex</li>
<li>Insert edge</li>
<li>Remove edge</li>
</ol>
<p>Any other operation can be constructed in terms of these primitive operations.</p>
<p>A lot of mesh representation structures maintain double representations of edges, which are typically called half-edges, where each half-edge is opposite in direction to its other half (e.g. v1-&gt;v2 and v2-&gt;v1).  The idea here is that each half-edge belongs to a different face.  To get to the other face, one simply uses moves from one half-edge to the other.  In contrast, the DLFL maintains a single edge for any pair of connected vertices, saving memory.  The difference compared to the half-edge representation is that the vertices on either edge belong to different faces.  In fact, the trickiest conceptual leap to make in understanding the DLFL is that there are actually two different types of vertices: actual vertices and face vertices that shadow the actual vertices.  When I say that an edge connects vertices on different faces, I mean face vertices not actual vertices since actual vertices effectively belong to many faces whereas face vertices belong to a single face.  Face vertices are basically a per-face proxy for actual vertices.  Thus, if a mesh is made of quadrilaterals, each vertex will belong to 4 faces and have 4 face vertices.</p>
<p><a href="http://moniker.name/worldmaking/wp-content/uploads/2010/08/dlfl.structure.png"><img class="alignnone size-full wp-image-128" title="dlfl.structure" src="http://moniker.name/worldmaking/wp-content/uploads/2010/08/dlfl.structure.png" alt="" width="450" height="431" /></a></p>
<p>Here, each actual vertex is given a unique number and the black face vertices are clustered together.  Edges are the dotted blue lines.  Notice how they connect face vertices across faces.  This is the key attribute of the DLFL.  Each face in the DLFL also maintains a doubly-linked list of its boundary face vertices.  The direction of the pink and grey arrows indices the sense of the face boundary.  Pink arrows are in the direction of the blue edges while grey arrows are not.</p>
<p>For the DLFL to work properly, the mesh must always be a 2-manifold geometric complex.  This means that not only must every edge belong to two faces, but the orientations of edge-abutting faces must be opposite in direction.  One way to think about it is that when circulating a face, if traversing from v1-&gt;v2 is given a value +1, then when traversing another face that goes from v2-&gt;v1 the value -1 is given and v1-&gt;v2 + v2-&gt;v1 will sum to 0.  If all such traversals sum to 0, then the mesh is a geometric complex.  Effectively this means that face normals must all face either outward or inward.  There can&#8217;t be a mixture.  The four primitive operations listed above are implemented such that these conditions always hold.</p>
<h2>TopoSynth Operations</h2>
<p>TopoSynth operations, as in TopMod, are implemented over the primitive operations such that the 2-manifold condition is always maintained.  Unlike in TopMod, however, the operations are not simply applied as mesh sculpting events one at a time, but instead are micro programs attached to mesh elements such as vertices, faces, and edges.  In this sense, they are akin to rules in StructureSynth with the addition of a more elaborate context sensitivity.  StructureSynth is context sensitive in the sense that rules terminate under certain global conditions related to primitive size (is the rule producing visible shapes) and total number of primitives (has the max number of shapes been generated).  TopoSynth rules have an additional context sensitivity related to their immediate spatial neighborhood.  For example, a rule can be written such that a face is pulled in a particular direction, but when it approaches another face, it attaches itself, creating a handle.</p>
<p>The more involved TopoSynth operations are built on a combination of spatial partitioning and standard mesh operations.  The basic operations include face extrude, vertex extend, stellate, etc.  How these are built into TopoSynth operations is the subject for another post.  Below are the basic extension and extrusion operations.  Extend pulls a vertex in a direction, splitting each edge in half that links to the vertex and forming a ring of edges to connect the new midpoints.  Extrude pulls a face out in a direction, creating a new ring of faces.</p>
<p><img class="alignnone size-full wp-image-131" title="op.extend" src="http://moniker.name/worldmaking/wp-content/uploads/2010/08/op.extend.png" alt="" width="646" height="276" /></p>
<p><a href="http://moniker.name/worldmaking/wp-content/uploads/2010/08/op.extrude.png"><img class="alignnone size-full wp-image-132" title="op.extrude" src="http://moniker.name/worldmaking/wp-content/uploads/2010/08/op.extrude.png" alt="" width="643" height="328" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://moniker.name/worldmaking/?feed=rss2&amp;p=127</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TopoSynth</title>
		<link>http://moniker.name/worldmaking/?p=115</link>
		<comments>http://moniker.name/worldmaking/?p=115#comments</comments>
		<pubDate>Mon, 16 Aug 2010 18:23:00 +0000</pubDate>
		<dc:creator>moniker</dc:creator>
				<category><![CDATA[Computational Composition]]></category>
		<category><![CDATA[Computational Technique]]></category>
		<category><![CDATA[generative]]></category>
		<category><![CDATA[grammar]]></category>
		<category><![CDATA[Structure Synth]]></category>
		<category><![CDATA[TopMod]]></category>
		<category><![CDATA[topology]]></category>
		<category><![CDATA[TopoSynth]]></category>

		<guid isPermaLink="false">http://moniker.name/worldmaking/?p=115</guid>
		<description><![CDATA[Ever since I found out about the excellent Structure Synth program, I wondered what it would be like to apply the same concept to topological operations.  Structure Synth works by writing rules that describe a pattern of transformations.  The transformations &#8230; <a href="http://moniker.name/worldmaking/?p=115">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ever since I found out about the excellent <a title="Structure Synth" href="http://structuresynth.sourceforge.net/">Structure Synth</a> program, I wondered what it would be like to apply the same concept to topological operations.  Structure Synth works by writing rules that describe a pattern of transformations.  The transformations can be spatial or they can operate on the colors.  When the interpreter processes a rule, it applies the transformations to a terminal node, which can be a primitive shape like a box or sphere, or more interestingly, another rule.</p>
<p>The beauty of Structure Synth, and similar systems like <a title="Context Free" href="http://www.contextfreeart.org/">Context Free</a>, is that a simple rules can end up building complex and surprising forms by virtue of how they are connected.</p>
<p style="text-align: center;"><a title="scout by superhirschgold, on Flickr" href="http://www.flickr.com/photos/superhirschgold/4585964017/"><img class="aligncenter" src="http://farm5.static.flickr.com/4069/4585964017_dc6c691f9d.jpg" alt="scout" width="500" height="500" /></a></p>
<p>While these structure can be quite stunning, there are quite a number of reasons why one would want to move beyond a haphazard collection of objects in space to something more reified such as 2-manifold meshes or a at least a guarantee of non-intersecting objects.  Instead of just repeating primitive shapes under transformation, I&#8217;d like to see how this could work by operating on mesh vertices themselves.</p>
<p>As a paradigm for operating on the mesh, topological operations are going to be both the most interesting and generally applicable.  One need only look at what the topological meshing software <a title="TopMod" href="http://code.google.com/p/topmod/">TopMod</a> is capable of to imagine the power of topological processes.</p>
<p style="text-align: center;"><a title="Whishboneahedron by Schmiegel [gone Deviant], on Flickr" href="http://www.flickr.com/photos/schmiegl/3868815820/"><img class="aligncenter" src="http://farm3.static.flickr.com/2531/3868815820_bd482c31eb.jpg" alt="Whishboneahedron" width="500" height="500" /></a></p>
<p>After doing some research about this, it seems I&#8217;m not the only one with this ideas.  In a <a href="http://hvidtfeldts.net/Structure-Synth-GA2009.pdf">paper on grammar-based approaches to pattern making</a>, the author of Structure Synth mentions as much when speculating about possible directions it could go in the future.</p>
<p>I&#8217;ve been working on TopoSynth for about a week now and have a pretty good handle on how it&#8217;s going to work.  The most difficult part was finally coming to a clear understanding of how TopMod works and getting to the point where I know enough to easily write my own topological operations.  For background research, there&#8217;s the sill-in-draft <a href="http://www.viz.tamu.edu/faculty/ergun/research/topology/book/book.pdf">TopMod book</a>, but truth be told, nothing is better than stepping through the source code or better yet, writing your own version.  I ended up writing my own take on TopMod in Lua, which is what I&#8217;m using to prototype TopoSynth.  I&#8217;ll be posting my findings shortly, but first here&#8217;s a teaser rendered with <a title="Physically Based Rendering" href="http://www.pbrt.org/">PBRT</a>:</p>
<p style="text-align: center;"><a href="http://moniker.name/worldmaking/wp-content/uploads/2010/08/topo.synth.jpg"><img class="size-large wp-image-116 aligncenter" title="topo.synth" src="http://moniker.name/worldmaking/wp-content/uploads/2010/08/topo.synth-730x1024.jpg" alt="" width="640" height="897" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://moniker.name/worldmaking/?feed=rss2&amp;p=115</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facing Autotools</title>
		<link>http://moniker.name/worldmaking/?p=109</link>
		<comments>http://moniker.name/worldmaking/?p=109#comments</comments>
		<pubDate>Thu, 29 Jul 2010 20:16:21 +0000</pubDate>
		<dc:creator>moniker</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[autotools]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[build system]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://moniker.name/worldmaking/?p=109</guid>
		<description><![CDATA[One of the essential features of a good software package is that it is both portable and straightforward to build.  When working on a system (Linux or even OS X) with a UNIX shell, the most common build tools are &#8230; <a href="http://moniker.name/worldmaking/?p=109">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the essential features of a good software package is that it is both portable and straightforward to build.  When working on a system (Linux or even OS X) with a UNIX shell, the most common build tools are the dreaded <a href="http://en.wikipedia.org/wiki/GNU_build_system">Autotools</a>.  I say dreaded from a developer&#8217;s perspective.  From a user&#8217;s perspective, it&#8217;s usually only takes invoking</p>
<pre>./configure &amp;&amp; make</pre>
<p>to build a well-designed software package.</p>
<p>On the developer&#8217;s end, there&#8217;s the seemingly Byzantine world of <a href="http://www.gnu.org/software/autoconf/">autoconf</a>, <a href="http://www.gnu.org/software/automake/">automake</a>, auto-whatever and the unfamiliar world of <a href="http://en.wikipedia.org/wiki/M4_(computer_language)">M4</a> macros and under the hood magic.  At first, when faced with setting up a portable build system, I tried to roll my own using Lua scripts.  It worked quite well &#8230; until other people needed to use it.  When that happened, things started to fall apart under the weight of all of the contingencies I had to keep track of, so I dove into the world of Autotools.</p>
<p>Going through the manuals and trying to understand the terminology with no reference points is incredibly frustrating.  I managed to get a decent understanding of how things works, but I still wasn&#8217;t able to setup a build system to handle the complicated structure of LuaAV.  Fortunately, John Calcote has just published a book called <a href="http://nostarch.com/autotools.htm">Autotools: A Practitioner&#8217;s Guide to GNU Autoconf, Automake, and Libtool</a>.  I highly recommend it.  It&#8217;s clear, explains the terminology well, and is as much of a pleasure to read as such things can be.</p>
]]></content:encoded>
			<wfw:commentRss>http://moniker.name/worldmaking/?feed=rss2&amp;p=109</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fast Multipole Method</title>
		<link>http://moniker.name/worldmaking/?p=81</link>
		<comments>http://moniker.name/worldmaking/?p=81#comments</comments>
		<pubDate>Tue, 20 Jul 2010 10:42:59 +0000</pubDate>
		<dc:creator>moniker</dc:creator>
				<category><![CDATA[Computational Technique]]></category>
		<category><![CDATA[Research Literature]]></category>
		<category><![CDATA[fast multipole method]]></category>
		<category><![CDATA[FMM]]></category>
		<category><![CDATA[nbody]]></category>
		<category><![CDATA[spatial hierarchy]]></category>

		<guid isPermaLink="false">http://moniker.name/worldmaking/?p=81</guid>
		<description><![CDATA[To get a better intuition for how the Fast Multipole Method (FMM) approximates n-body interactions, I implemented the equations in Mathematica along with the exact solution. Below are some plots for different situations.  The thing to keep in mind is &#8230; <a href="http://moniker.name/worldmaking/?p=81">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>To get a better intuition for how the Fast Multipole Method (FMM) approximates n-body interactions, I implemented the equations in Mathematica along with the exact solution. Below are some plots for different situations.  The thing to keep in mind is that the FMM is valid only a certain distance from the center of the particle cluster, so it&#8217;s expected that the approximation will not be accurate in that region.<br />
<a href="http://moniker.name/worldmaking/wp-content/uploads/2010/07/potential.plot_.panel_.png"><img class="alignnone size-full wp-image-88" title="potential.plot.panel" src="http://moniker.name/worldmaking/wp-content/uploads/2010/07/potential.plot_.panel_.png" alt="" width="600" height="638" /></a></p>
<p>The first row shows contour plots of clusters of 3 and 40 points and a difference between them.  With the difference plot, I was trying to get a sense of how the potential field varies under differing conditions.</p>
<p>The second row is again for 3 and 40 points with a difference.  The cutoff spike in the difference surface is an artifact of numerical evaluation.  Since the potential in 2D is logarithmic, near the particles it tends to blow up.  The coloring of the surfaces follows the phase of the potential.  With 3 particles, there potential wave has 3 clear periods while with 40 particles, it starts to get noisier (an artifact of sampling), but there are likewise 40 periods.  The reason the number of particles matches the number of cycles is from the linear summing of the phase term.</p>
<p>The last row shows the electrical field as derived from the complex potential.  The two images are for 3 particles with the one on the left being exact and on the right calculated from the FMM method.  These plots only show the calculation of the multipole expansion.  To actually implement the FMM as a solution of the n-body problem, someadditional techniques for manipulating the multipole expansion are required.</p>
<p>The FMM simplifies the n-body problem by relating clusters of particles to other clusters of particles.  As the multipole expansion shows, the affect on the potential field a cluster of particles generates can be easily calculated.  The trick now is to figure out how to incorporate the multipole expansion into a hierarchical data structure without having to recalculate it at every single level.  Instead, what we&#8217;d like to do is calculate the multipole expansion at the lowest level and accumulate the expansions up the hierarchy through a simple summing of terms.  The problem is that each low-level expansion is centered at a different point, so we need to be able to translate the expansions to the center of higher-level (parent) cells.</p>
<p><span style="font-size: 13px; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px;"><img class="alignnone size-full wp-image-93" title="multipole.translation" src="http://moniker.name/worldmaking/wp-content/uploads/2010/07/multipole.translation.png" alt="" width="600" height="932" /></span></p>
<p><span style="font-size: 13px; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px;">The translation lemma shows how to accumulate the multipole expansion into coarser clusters, which can dramatically speed up the calculation for faraway clusters.  This is the bottom up step of the FMM technique.  As has been emphasized a number of times, however, the multipole expansion is only valid for well-separated clusters that are a certain distance from each other.  This means that only clusters that are faraway can be treated this way or, alternatively, we can reduce the size of the clusters in order to apply the technique to closer in clusters.  In order to do this, each box in the hierarchy is given an interaction list..  The interaction list says which boxes interact with each other.  The interaction list consists of all of the child nodes of the neighbors of a box&#8217;s parent node not bordering it.</span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><a href="http://moniker.name/worldmaking/wp-content/uploads/2010/07/interaction.list_.png"><img class="alignnone size-full wp-image-100" title="interaction.list" src="http://moniker.name/worldmaking/wp-content/uploads/2010/07/interaction.list_.png" alt="" width="600" height="195" /></a></span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;">At each level, the interaction list covers a smaller and more refined area of the space.  Any area not covered by the interaction list, which is essentially those boxes at the finest level bordering the box under consideration, are calculated using the O(N^2) n-body method directly, but these calculations should be quite minimal.</span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;">In the diagram above, the pink box affects affects the blue boxes.  In order to make use of the multipole expansion, the expansion within the blue boxes has to be recentered on the pink box since expansions can only be summed in a simple way if they are centered on the same location.  This process is described as converting a multipole expansion into a local expansion where local is the pink box.</span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;"><a href="http://moniker.name/worldmaking/wp-content/uploads/2010/07/multipole.local_.png"><img class="alignnone size-full wp-image-102" title="multipole.local" src="http://moniker.name/worldmaking/wp-content/uploads/2010/07/multipole.local_.png" alt="" width="600" height="870" /></a></span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;">Once this calculation is done, we have a description for the effects of every particle outside the box, except for those nearest neighbors, and can evaluate their effects simply by plugging in the locations of the particles in the box into the sum of all of the multipole expansions.  This sounds like a lot of work compared to the O(N^2) formulation, but for thousands or millions of particles, it&#8217;s vastly more scalable.  The trickiest part is all of the bookkeeping that has to be done to shift the multipole expansions around the space and up and down the spatial hierarchy.  The payoff though, once it&#8217;s encoded in a easy to use software package should be significant and we won&#8217;t have to think about the hairy details so much anymore and can get to figuring out what massively detailed particle simulations can be used for in terms of spatial composition.</span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;">Note: The lemmas posted above were taken from <a href="http://math.nyu.edu/faculty/greengar/shortcourse_fmm.pdf">Greengard and Beatson, A Short Course in Fast Multipole Methods.</a></span></span></p>
<p><span style="font-size: small;"><span style="line-height: 19px;">Download: <a title="FMM Mathematica Files" href="http://moniker.name/downloads/fmm.mathematica.zip">FMM Mathematica Files</a></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://moniker.name/worldmaking/?feed=rss2&amp;p=81</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>N-Body Problems</title>
		<link>http://moniker.name/worldmaking/?p=60</link>
		<comments>http://moniker.name/worldmaking/?p=60#comments</comments>
		<pubDate>Thu, 08 Jul 2010 20:36:31 +0000</pubDate>
		<dc:creator>moniker</dc:creator>
				<category><![CDATA[Computational Technique]]></category>
		<category><![CDATA[Research Literature]]></category>
		<category><![CDATA[complex number]]></category>
		<category><![CDATA[electrostatics]]></category>
		<category><![CDATA[fast multipole method]]></category>
		<category><![CDATA[field]]></category>
		<category><![CDATA[FMM]]></category>
		<category><![CDATA[harmonics]]></category>
		<category><![CDATA[n-body]]></category>

		<guid isPermaLink="false">http://moniker.name/worldmaking/?p=60</guid>
		<description><![CDATA[N-Body problems inevitably come up when doing any most any kind of physical simulation work, particularly when particles are involved.  N-Body problems appear whenever the particles in a system construct a field that in turn determines their dynamics.  The classic &#8230; <a href="http://moniker.name/worldmaking/?p=60">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>N-Body problems inevitably come up when doing any most any kind of physical simulation work, particularly when particles are involved.  N-Body problems appear whenever the particles in a system construct a field that in turn determines their dynamics.  The classic examples are typically gravitational, but the n-body problem equally applies to electrostatic, electromagnetic, fluid dynamics, and even acoustic scattering problems.  All can be formulated in essentially the same way just with different constants.</p>
<p>At first sight, n-body problems have a runtime complexity of O(N^2) since every particle interacts with every other particle.  While this is not a big deal for small numbers of particles on the order of a few hundred, the amount of calculations required quickly exceeds what even the speediest of computers can handle.  The challenge is to somehow reduce the complexity to something like O(N log N), which is actually tractable for millions or even billions of particles, making something like the <a title="Millenium Simulation Project" href="http://www.mpa-garching.mpg.de/galform/virgo/millennium/">Millenium Simulation Project</a> possible.</p>
<p><a href="http://moniker.name/worldmaking/wp-content/uploads/2010/07/universe.simulation.small_.jpg"><img class="alignnone size-full wp-image-70" title="Millenium Simulation" src="http://moniker.name/worldmaking/wp-content/uploads/2010/07/universe.simulation.small_.jpg" alt="" width="512" height="384" /></a></p>
<p>Fortunately, there has been a lot of work done in this area since the late 80&#8242;s and 90&#8242;s for cosmological and electrostatic simulations, particularly by <a title="Leslie Greengard" href="http://www.math.nyu.edu/faculty/greengar/">Greengard</a> and Rokhlin.  Together, they developed the Fast Multipole Method (FMM), which makes use of the math of complex analysis of <a title="Harmonic Functions" href="http://en.wikipedia.org/wiki/Harmonic_function">harmonic functions</a> to reformulate the n-body problem as O(N log N).</p>
<p>While this might sound complicated, the essential insight is straightforward and rather enlightening.  The simplification the FMM is based on recognizes that the field a clusters of particles generates, when viewed from a certain distance, can be simplified to a single point that approximates the actual field.  It&#8217;s akin to performing a simulation of the earth and sun where the mass of each body is taken to be at a point located the center of mass instead of spread out in space in a sphere.</p>
<p><a href="http://moniker.name/worldmaking/wp-content/uploads/2010/07/multipole.png"><img class="alignnone size-full wp-image-74" title="multipole" src="http://moniker.name/worldmaking/wp-content/uploads/2010/07/multipole.png" alt="FMM" width="534" height="302" /></a></p>
<p>The above images were generated using the FMM technique.  The red points in the middle are the particles, each with an equal charge.  The surface represents the potential generated by the points withe the coloring representing the phase.  With one particle, there&#8217;s one cycle of a wave around the place.  With 7 particles, there are more cycles as the waves generated by each particle interfere.  The FMM approximation is akin to a spatial <a title="Wavelet" href="http://en.wikipedia.org/wiki/Wavelet">wavelet transform</a>.  This is the 2D case.  In 3D, the FMM method uses <a title="Spherical Harmonics" href="http://en.wikipedia.org/wiki/Spherical_harmonics">spherical harmonics</a> to approximate the potential.</p>
<p>While the above surfaces represent electrical potential, what we actually want is the electric field.  The electric field gives the forces acting on the particles and is used to update the simulation.  Fortunately, the electric field can be derived directly from the potential by taking its derivative.  This works because we&#8217;re working with complex numbers.  With purely real numbers, the phase information is missing, and the electric field cannot be determined without phase.</p>
<p>One useful way to think about simulations is in terms of <a title="Lagrangian and Eulerian simulations" href="http://en.wikipedia.org/wiki/Lagrangian_and_Eulerian_specification_of_the_flow_field">Lagrangian and Eulerian paradigms</a>.  The Lagrangian perspective is essentially that of the particle.  Information moves through space according to the dynamics involved.  The Eulerian perspective is of a lattice or field, where fixed discrete points in space sample the dynamics.</p>
<p>In the case of the FMM, the n-body problem is simplified by converting the usual Lagrangian formulation into a hybrid Lagrangian-Eulerian algorithm where clusters of particles become instead waves in space.  This conversion only holds a certain distance away from the cluster, so nearby particles must be treated in an purely Lagrangian manner.</p>
<p>This technique is of course not new.  Spectral methods are used in all kinds of ways to quickly process point-wise spatial information, but such techniques have yet to be placed in the context of spatial composition where there is a continuum between field and particle.  FMM lies at the boundary between the two, and it will be interesting to see how working with the diametrically opposed conceptualization of spatial information can be brought together in a rigorous yet intuitive manner.</p>
<p>References:</p>
<ul>
<li><a href="http://math.nyu.edu/faculty/greengar/shortcourse_fmm.pdf">Greengard and Beatson, A Short Course in Fast Multipole Methods.</a></li>
<li><a href="http://www.sciencedirect.com/science?_ob=ArticleURL&amp;_udi=B6WHY-4DD1T30-K7&amp;_user=10&amp;_coverDate=12/31/1987&amp;_rdoc=1&amp;_fmt=high&amp;_orig=search&amp;_sort=d&amp;_docanchor=&amp;view=c&amp;_searchStrId=1391070121&amp;_rerunOrigin=google&amp;_acct=C000050221&amp;_version=1&amp;_urlVersion=0&amp;_userid=10&amp;md5=c6b932e8512460823383718bcd29770b">Greengard and Rokhlin, A Fast Algorithm for Particle Simulations.</a></li>
<li><a href="http://amath.colorado.edu/courses/7400/2008fall/001/ChengGreengardRokhlin.pdf">Cheng, Greengard, and Rokhlin,  A Fast Adaptive Multipole Algorithm in Three Dimensions.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://moniker.name/worldmaking/?feed=rss2&amp;p=60</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chemical Automata</title>
		<link>http://moniker.name/worldmaking/?p=42</link>
		<comments>http://moniker.name/worldmaking/?p=42#comments</comments>
		<pubDate>Mon, 05 Jul 2010 01:02:18 +0000</pubDate>
		<dc:creator>moniker</dc:creator>
				<category><![CDATA[Research Literature]]></category>
		<category><![CDATA[autopoiesis]]></category>
		<category><![CDATA[chemoton]]></category>
		<category><![CDATA[ganti]]></category>

		<guid isPermaLink="false">http://moniker.name/worldmaking/?p=42</guid>
		<description><![CDATA[I first came across Chemoton (Chemical Automaton) Theory a few months ago when reading a paper entitled Software Replica of Minimal Living Processes, and ever since it has been an inspiration.  At the time, I was trying to figure out &#8230; <a href="http://moniker.name/worldmaking/?p=42">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://moniker.name/worldmaking/wp-content/uploads/2010/07/chemoton.theory.vol1_.png"><img class="alignnone size-full wp-image-52" title="chemoton.theory.vol1" src="http://moniker.name/worldmaking/wp-content/uploads/2010/07/chemoton.theory.vol1_.png" alt="" width="198" height="312" /></a></p>
<p>I first came across Chemoton (Chemical Automaton) Theory a few months ago when reading a paper entitled <a href="http://www.springerlink.com/content/753w172h26864v21/">Software Replica of Minimal Living Processes</a>, and ever since it has been an inspiration.  At the time, I was trying to figure out how I could possibly build a system that spanned the range of complexity from Chemistry to a minimal Biology.  I was going off of Walter Fontana&#8217;s incredible<a href="http://fontana.med.harvard.edu/www/Documents/WF/Papers/alchemy.pdf"> Algorithmic Chemistry</a> work, trying to find a way that his Lambda Calculus approach could become spatial.  It was Ganti&#8217;s Chemoton Theory that finally got me there.</p>
<p>Incredibly, the publication of Chemoton Theory in 1971 and subsequent refinement in the early 70&#8242;s was practically simultaneous with Maturana and Varela&#8217;s <a href="http://www.lapetus.uchile.cl/lapetus/archivos/1208975754Autopoiesis,areviewandareappraisal.pdf">Autopoiesis</a> work and Manfred Eigen&#8217;s <a href="http://www.springerlink.com/content/r133207n06736808/">RNA Hypercycles Theory</a>.  Chemoton Theory, unlike Autopoiesis, is based on a very precise model, though simplified, model of chemistry.  In recent years, Ganti has even gone so far as to detail what actual chemical reactions could possibly realize a Chemoton.  Autopoiesis provides no such precision although the work of <a href="http://www.plluisi.org/">Pier Luigi Luisi</a> has taken it much further in that direction.</p>
<p><a href="http://moniker.name/worldmaking/wp-content/uploads/2010/07/chemoton.png"><img class="alignnone size-full wp-image-54" title="chemoton" src="http://moniker.name/worldmaking/wp-content/uploads/2010/07/chemoton.png" alt="" width="481" height="460" /></a></p>
<p>A Chemoton is a network of 3 autocatalytic cycles: the metabolic (energy), template replication (information), and membrane (boundary/dynamics).  Together, they model a minimal living entity as they meet Ganti&#8217;s basic criteria of a living system:</p>
<ul>
<li>it&#8217;s an individual unit</li>
<li>it performs metabolism</li>
<li>it&#8217;s inherently stable despite constant transformation</li>
<li>it has an information subsystem that programs the whole</li>
<li>it&#8217;s processes are regulated and controlled</li>
</ul>
<p>I&#8217;m, of course, leaving out a lot of the details so this may not seem like a full definition of a living system.  For the complete explanation, see Ganti&#8217;s paper <a href="http://www.sciencedirect.com/science?_ob=ArticleURL&amp;_udi=B6WMD-45KKS26-36&amp;_user=10&amp;_coverDate=08/21/1997&amp;_rdoc=1&amp;_fmt=high&amp;_orig=search&amp;_sort=d&amp;_docanchor=&amp;view=c&amp;_searchStrId=1390351486&amp;_rerunOrigin=google&amp;_acct=C000050221&amp;_version=1&amp;_urlVersion=0&amp;_userid=10&amp;md5=86b615ecb10429cb52a65f3768537d26">Biogenesis Itself</a> or even better his book <a href="http://www.amazon.com/Principles-Life-Oxford-Biology/dp/0198507267">The Principles of Life</a>.</p>
<p>What&#8217;s most intriguing about the Chemoton from a worldmaking standpoint is it&#8217;s fluid nature.  Chemical reactions function best in a fluid environment where spatiality is subsumed by chemical concentrations and statistical tendencies.  There doesn&#8217;t need to be a strict spatial ordering for Chemotons to function, just the appropriate chemical concentrations bounded inside a membrane.</p>
<p>Chemoton Theory shows in precise detail how to go from chemistry to a minimal biological unit, but it doesn&#8217;t say much about the structure of the membrane or how networks of membranes might form into more complex biological structures.  In the end of <a href="http://www.chemoton.com/">Chemoton Theory vol. 1</a>, Ganti speculates about how computers might be built from such objects, but doesn&#8217;t link it to Morphogenesis or <a href="http://www.amazon.com/Topobiology-Introduction-Embryology-Gerald-Edelman/dp/0465086535">Topobiology</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://moniker.name/worldmaking/?feed=rss2&amp;p=42</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>worldmaking</title>
		<link>http://moniker.name/worldmaking/?p=6</link>
		<comments>http://moniker.name/worldmaking/?p=6#comments</comments>
		<pubDate>Sun, 27 Jun 2010 11:29:51 +0000</pubDate>
		<dc:creator>moniker</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://moniker.name/worldmaking/?p=6</guid>
		<description><![CDATA[worldmaking is a site dedicated to exploring how to make worlds: spaces and systems that accumulate complexity.  The site weaves together the spaces of computation, cybernetics, poetics, mathematics, biology, among others, through observations, musings, and, above all, software experiments and techniques. &#8230; <a href="http://moniker.name/worldmaking/?p=6">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>worldmaking is a site dedicated to exploring how to make worlds: spaces and systems that accumulate complexity.  The site weaves together the spaces of computation, cybernetics, poetics, mathematics, biology, among others, through observations, musings, and, above all, software experiments and techniques.  The best way of knowing is making.</p>
]]></content:encoded>
			<wfw:commentRss>http://moniker.name/worldmaking/?feed=rss2&amp;p=6</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
