Simulation time series plotting (basics)

Author: Lukas Breitwieser
In this tutorial we show how to collect data during the simulation and plot it at the end.
To this extent, we create a simulation where cells divide rapidly leading to exponential growth.

Let's start by setting up BioDynaMo notebooks.

Let's create a behavior which divides cells with $10\%$ probability in each time step.
New cells should also get this behavior.
Therefore, we have to call AlwaysCopyToNew().
Otherwise, we would only see linear growth.

Let's create a function that creates a cell at a specific position, with diameter = 10, and the rapid_division behavior.

As starting condition we want to create 100 cells randomly distributed in a cube with $min = 0, max = 200$

Before we start the simulation, we have to tell BioDynaMo which data to collect.
We can do this with the TimeSeries::AddCollector function. In this example we are interested in the number of agents.

Now let's simulate until there are 4000 agents in the simulation

Now we can plot how the number of agents (in this case cells) evolved over time.