# Try the Examples

## Examples Menu

To explore the potential and modeling features, it is the best to **learn by example**. Morpheus comes with a range of fully functional example models showcasing a number of model formalism and modeling features. You can open these models from the `Examples`

menu:

There are models showing **ordinary differential equations** as well as **reaction-diffusion systems** in 1D, 2D and 3D and cell-based simulations with the **cellular Potts model**. Moreover, there are several **multi-scale models** in which the above models are combined and some other **miscellaneous models**.

We recommend that you have try out a few models, change parameters, add or remove some things, change the visualization, etc. to get a feel of what modeling with Morpheus is like.

**Morpheus Model Repository**.

## Three Basic Models

We suggest that you take a look at the following three basic models. Just press run and pay attention to how the models are defined. Take the chance to change some parameters and see what happens.

### ODE: Predator-Prey

This model implements an extension of the well-known Lotka-Volterra system.

Check out `PredatorPrey.xml`

to try yourself via:

**Morpheus Link**or**Morpheus GUI**:`Examples`

→`ODE`

→`PredatorPrey.xml`

or**Morpheus Model Repository**.

If you look at the model itself, you’ll see that it first specifies the `Space`

and `Time`

of a simulation, here defined as a single lattice site and $5000\ \mathrm{atu}$ (arbitrary time units). In `Global`

(see figure below), two `Variable`

s for predator and prey densities are set up. The differential equations themselves are specified in a `System`

which consists of a number of `Constant`

s and two `DiffEqn`

(differential equations) and are computed using the `runge-kutta`

solver.

Output in terms of a text file as well as a plot is created by a `Logger`

, the plugin in the `Analysis`

section.

**stable steady state**(fixed point, no oscillations) by changing parameters in

`Global`

/`System`

/`Constant`

.
### PDE: Activator-Inhibitor

This is the classic Gierer-Meinhardt model of pattern formation.

Check out `ActivatorInhibitor_2D.xml`

to try yourself via:

**Morpheus Link**or**Morpheus GUI**:`Examples`

→`PDE`

→`ActivatorInhibitor_2D.xml`

or**Morpheus Model Repository**.

In `Space`

, it sets up a square lattice of $150 \times 150$ with `periodic`

`BoundaryConditions`

. The model itself is defined in the `Global`

section where two diffusive `Field`

s are created. The reaction step of the reaction-diffusion is specified in a `System`

containing `Constant`

s and `DiffEqn`

s.

The plot above is created using the `Gnuplotter`

plugin in the `Analysis`

section, showing the concentrations of the two interacting species.

**inhibitor output**just change the

`Field`

in `Gnuplotter`

.
**diffusion coefficients**in

`Global`

/`Field`

/`Diffusion`

to get finer patterns or no patterning at all.
### CPM: Cell Sorting

This reproduces the first cellular Potts model that Graner and Glazier used to study cell sorting based on the differential adhesion hypothesis.

Check out `CellSorting_2D.xml`

to try yourself:

**Morpheus Link**or**Morpheus GUI**:`Examples`

→`CPM`

→`CellSorting_2D.xml`

or**Morpheus Model Repository**.

Apart from specifying `Space`

and `Time`

, a number of `CellType`

s is specified. Each one has a `VolumeConstraint`

to regulate the size of the cells. Remaining plugins are used to track the cell-cell boundary lengths.

In the `CPM`

section, the `Interaction`

energies are specified that control the ‘adhesion’ between cells of different cell types.

CPM-specific parameters such as the `temperature`

of the `MetropolisKinetics`

is also specified here. To define the spatial arrangement of cells in the lattice, in `CellPopulations`

two `Population`

s are described. These are initialized randomly in a circle using the `InitCircle`

plugin.

A `Gnuplotter`

is set up to visualize cells and a `Logger`

is used to log and plot the boundary lengths.

`CPM`

/`Interaction`

.
### Wrapping up

You probably have noticed some similarities and differences among these three models.

Clearly, each model defined the `Space`

and `Time`

of a simulation – even the non-spatial predator-prey model. These sections are indeed **required**. The `Analysis`

section is not obligatory, yet all models use it since a simulation without output of any kind (plots or stats) is incomplete simulation.

Other sections such as `CellTypes`

and `CPM`

are **optional** and only appear when necessary. These are only used in the CPM example and do not appear in the ODE and PDE examples.

`CellTypes`

but without using a cellular Potts model and therefore no optional `CPM`

section (e.g. see `ODE`

→ `LateralSignaling.xml`

).
The models above also show some useful ways to generate output from the simulations using the flexible `Logger`

and `Gnuplotter`

plugins.