Let's look into a sample plot,
out/manual/plotOut/svg_plots/massFractionSummary.svg
, and try to understand as much as we can about what it means and how it was generated.This plot contains how much of each type of mass is present in all cells. Since we simulated just one cell, it will be the same as the results for that cell.
We can see that all of them grow more or less linearly, perhaps as the start of an exponential. We can see that all of them grow more or less linearly, perhaps as the start of an exponential. We can see that all of them grow more or less linearly, perhaps as the start of an exponential.which must correspond to the different
By grepping the title "Cell mass fractions" in the source code, we see the files:
models/ecoli/analysis/cohort/massFractionSummary.py
models/ecoli/analysis/multigen/massFractionSummary.py
models/ecoli/analysis/variant/massFractionSummary.py
massFractionSummary
plots throughout different levels of the hierarchy.By reading
models/ecoli/analysis/variant/massFractionSummary.py
a little bit, we see that:- the plotting is done with Matplotlib, hurray
- it is reading its data from files under
./out/manual/wildtype_000000/000000/generation_000000/000000/simOut/Mass/
, more precisely./out/manual/wildtype_000000/000000/generation_000000/000000/simOut/Mass/columns/<column-name>/data
. They are binary files however.Looking at the source forwholecell/io/tablereader.py
shows that those are just a standard NumPy serialization mechanism. Maybe they should have used the Hierarchical Data Format instead.We can also take this opportunity to try and find where the data is coming from.Mass
from the./out/manual/wildtype_000000/000000/generation_000000/000000/simOut/Mass/
looks like an ID, so wegrep
that and we reachmodels/ecoli/listeners/mass.py
.From this we understand that all data that is to be saved from a simulation must be coming from listeners: likely nothing, or not much, is dumped by default, because otherwise it would take up too much disk space. You have to explicitly say what it is that you want to save via a listener that acts on each time step.
More plot types will be explored at time series run variant, where we will contrast two runs with different growth mediums.
One big advantage over FreeFem is that it uses plain old Python to describe the problems instead of a domain-specific language. Matplotlib is used for plotting by default, so we get full Python power out of the box!
Also uses variational formulation of a partial differential equation like FreeFem which is a pain.
One downside is that its documentation is a Springer published PDF link.springer.com/content/pdf/10.1007%2F978-3-319-52462-7.pdf which is several years out-of-date (tested with FEnics 2016.2. Newbs. This causes problems e.g.: stackoverflow.com/questions/53730427/fenics-did-not-show-figure-nameerror-name-interactive-is-not-defined/57390687#57390687
system of partial differential equations are mentioned at: link.springer.com/content/pdf/10.1007%2F978-3-319-52462-7.pdf 3.5 "A system of advection–diffusion–reaction equations". You don't need to manually iterate between the equations.
On Ubuntu 20.04 as per fenicsproject.org/download/Before 2020-06, it was failing with:but they seem to have created the Ubuntu 20.04 package as of 2020-06, so it now worked! askubuntu.com/questions/866901/what-can-i-do-if-a-repository-ppa-does-not-have-a-release-file
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt-get update
sudo apt-get install --no-install-recommends fenics
sudo apt install fenics
python3 -m pip install -u matplotlib
E: The repository 'http://ppa.launchpad.net/fenics-packages/fenics/ubuntu focal Release' does not have a Release file.
TODO heat equation hello world.
Tends to be Ciro Santilli's first attempt for quick and dirty graphing: github.com/cirosantilli/gnuplot-cheat.
domain-specific language. When it get the jobs done, it is in 3 lines and it feels great.
When it doesn't, you Google for an hours, and then you give up in frustration, and fall back to Matplotlib.
Couldn't handle exploration of large datasets though: Survey of open source interactive plotting software with a 10 million point scatter plot benchmark by Ciro Santilli
The major problem with SVG is text computer fonts. If you make an image with text that depends on one computer font and it is not present in the viewer's machine, it will use some other font, which may overlap with other elements of the image. Some libraries Matplotlib solve this by writing characters as curves, but this produces large files and unsearchable text. The inability of different computer platforms to standardize fonts that must always be present is a major issue.