FlipCells: Particle Aggregation

Persistent Identifier

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

Introduction

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.

Description

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$.

Model

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">
        <Description>
            <Title>Example-ParticleAggregation</Title>
            <Details>Shows new FlipCells plugin
    </Details>
        </Description>
        <Global>
            <Variable symbol="sn" value="0" name="Sum of non-isolated cells"/>
            <Constant symbol="s" value="0"/>
        </Global>
        <Space>
            <Lattice class="hexagonal">
                <Size symbol="size" value="40, 40, 0"/>
                <Neighborhood>
                    <Order>2</Order>
                </Neighborhood>
                <BoundaryConditions>
                    <Condition boundary="x" type="periodic"/>
                    <Condition boundary="y" type="periodic"/>
                </BoundaryConditions>
            </Lattice>
            <SpaceSymbol symbol="l"/>
        </Space>
        <Time>
            <StartTime value="0"/>
            <StopTime value="5000"/>
            <!--    <Disabled>
            <RandomSeed value="1415712648"/>
        </Disabled>
    -->
            <TimeSymbol symbol="time"/>
        </Time>
        <CellTypes>
            <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>
                </Function>
                <NeighborhoodReporter>
                    <Input scaling="cell" value="s"/>
                    <Output symbol-ref="s_n" mapping="sum"/>
                </NeighborhoodReporter>
                <FlipCellMotion neighborhood="2" time-step="1">
                    <Condition>s > 0 and rand_uni(0,1) &lt; (1-(s_n/12)*p)</Condition>
                </FlipCellMotion>
                <Mapper>
                    <Input value="ni"/>
                    <Output symbol-ref="sn" mapping="sum"/>
                </Mapper>
            </CellType>
        </CellTypes>
        <CellPopulations>
            <Population size="0" type="spins">
                <InitProperty symbol-ref="s">
                    <Expression>if(rand_uni(0,1) &lt; 0.10, 1, 0)</Expression>
                </InitProperty>
                <InitCellLattice/>
            </Population>
        </CellPopulations>
        <Analysis>
            <Gnuplotter time-step="100" decorate="false">
                <Terminal name="png"/>
                <Plot>
                    <Cells value="s">
                        <ColorMap>
                            <Color value="1" color="black"/>
                            <Color value="0.0" color="white"/>
                        </ColorMap>
                    </Cells>
                </Plot>
            </Gnuplotter>
            <Logger time-step="25">
                <Input>
                    <Symbol symbol-ref="sn"/>
                </Input>
                <Output>
                    <TextOutput/>
                </Output>
                <Plots>
                    <Plot time-step="250">
                        <Style style="lines" line-width="3.0"/>
                        <Terminal terminal="png"/>
                        <X-axis>
                            <Symbol symbol-ref="time"/>
                        </X-axis>
                        <Y-axis>
                            <Symbol symbol-ref="sn"/>
                        </Y-axis>
                    </Plot>
                </Plots>
            </Logger>
        </Analysis>
    </MorpheusModel>
    
    

    Downloads

    Files associated with this model:

    Previous