FlipCells: Particle Aggregation

Persistent Identifier

Use this permanent link to cite or share this Morpheus model:


This models approximates an interacting particle system (IPS) model of particle aggregation. Each black dot represents a particle that moved due to spin flips with random neighbors. The particles perform random walks in which the probability of moving depends on the number of neighboring cells.

Aggregation of moving particles.
Aggregation of moving particles.


Each lattice site (white or black) counts the number of particles (black neighboring sites) using a NeighborsReporter.

The probability of movement of each particle is made dependent on its number of neighbors by using it in the Condition of FlipCells. When this condition is satisfied, the particle changes positions with a random neighboring lattice site.

A PopulationReporter is used to return the fraction of isolated black particles. This number is logged and plotted using the Logger.

Things to try

  • Change the parameter $p$.


Get this model via:

  • Morpheus-Link or
  • Morpheus GUI: ExamplesMiscellaneousParticleAggregation.xml or
  •  Download: ParticleAggregation.xml
  • XML Preview

    <?xml version='1.0' encoding='UTF-8'?>
    <MorpheusModel version="3">
            <Details>Shows new FlipCells plugin
            <Variable symbol="sn" value="0" name="Sum of non-isolated cells"/>
            <Constant symbol="s" value="0"/>
            <Lattice class="hexagonal">
                <Size symbol="size" value="40, 40, 0"/>
                    <Condition boundary="x" type="periodic"/>
                    <Condition boundary="y" type="periodic"/>
            <SpaceSymbol symbol="l"/>
            <StartTime value="0"/>
            <StopTime value="5000"/>
            <!--    <Disabled>
            <RandomSeed value="1415712648"/>
            <TimeSymbol symbol="time"/>
            <CellType class="biological" name="spins">
                <Property symbol="s" value="0.0" name="state"/>
                <DelayProperty symbol="s_n" value="0.0" delay="1" name="state_neighbors"/>
                <Property symbol="p" value="2.25" name="probability"/>
                <Function symbol="ni" name="non-isolated">
                    <Expression>if(s==1 and s_n > 1, 1, 0)</Expression>
                    <Input scaling="cell" value="s"/>
                    <Output symbol-ref="s_n" mapping="sum"/>
                <FlipCellMotion neighborhood="2" time-step="1">
                    <Condition>s > 0 and rand_uni(0,1) &lt; (1-(s_n/12)*p)</Condition>
                    <Input value="ni"/>
                    <Output symbol-ref="sn" mapping="sum"/>
            <Population size="0" type="spins">
                <InitProperty symbol-ref="s">
                    <Expression>if(rand_uni(0,1) &lt; 0.10, 1, 0)</Expression>
            <Gnuplotter time-step="100" decorate="false">
                <Terminal name="png"/>
                    <Cells value="s">
                            <Color value="1" color="black"/>
                            <Color value="0.0" color="white"/>
            <Logger time-step="25">
                    <Symbol symbol-ref="sn"/>
                    <Plot time-step="250">
                        <Style style="lines" line-width="3.0"/>
                        <Terminal terminal="png"/>
                            <Symbol symbol-ref="time"/>
                            <Symbol symbol-ref="sn"/>


    Files associated with this model: