diff --git a/README.md b/README.md index 5c3bd27..0466b2c 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Click on the badge to get to the compiled version of the mathematical documentat To write the documentation, use an editor of your choice and add your formulas in the respective rst file in `doc/source/frameworks`. +Graph descriptions written in the DOT language are rendered with a sphinx extension, that requires Graphviz, a cross-platform open source graph visualization software, that can be downloaded from [here](https://graphviz.org/). + Compiling is done by sphinx, therefore you need a python environment. If you use conda, you can install the necessary packages doing the following steps: @@ -14,6 +16,6 @@ If you use conda, you can install the necessary packages doing the following ste 3. Install it via conda by `conda env create -f mathdoc.yml`. 4. Each time you open a new terminal for compiling, you can activate the environment by `conda activate mathdoc`. -You can build the html pages by simply running while you are in the `doc` folder (ensure that you have a subfolder in `doc` named `build` and a subfolder named `_static` in `doc/source`): +You can build the html pages with the following command while you are in the `doc` folder (ensure that you have a subfolder in `doc` named `build` and a subfolder named `_static` in `doc/source`). Make sure to update the `graphviz_dot` argument to point to the correct location of the `dot` executable on your system: - sphinx-build -b html source build + sphinx-build -b html -D graphviz_dot=C:\path\to\dot.exe source build diff --git a/doc/source/conf.py b/doc/source/conf.py index 18d8918..6a1d2fe 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -29,7 +29,8 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'fluiddoc.mathmacro' + 'fluiddoc.mathmacro', + 'sphinx.ext.graphviz' ] # Add any paths that contain templates here, relative to this directory. diff --git a/doc/source/frameworks/technologies.rst b/doc/source/frameworks/technologies.rst index 92d2774..a0f30b5 100644 --- a/doc/source/frameworks/technologies.rst +++ b/doc/source/frameworks/technologies.rst @@ -7,6 +7,16 @@ representing a unique parameter or variable name. The definition of sets is also part of `../notation.rst`. +.. sphinx.ext.graphviz + +.. Sources + https://graphviz.org/doc/info/attrs.html + https://stackoverflow.com/questions/14873205/horizontal-trees-in-graphviz + https://stackoverflow.com/questions/6450765/how-do-you-center-a-title-for-a-diagram-output-to-svg-using-dot + +.. `dot2tex` could perhaps be integrated in the graphviz extension to allow + for LaTEX labels. + Modelling of technologies ========================= Here the framework's representations of technologies are shown @@ -14,16 +24,67 @@ Here the framework's representations of technologies are shown VRE-units ********* +.. graphviz:: + + digraph G { + rankdir="LR"; + node [ shape=box ]; + + i -> box [ label="Curtailment" ]; + box -> o [ label="Electricity\nproduction" ]; + + i [ style="invis" ]; + o [ style="invis" ]; + box [ label="Parameters:\nProfile\nFull load hours"]; + + label="Used in: Balmorel" + } + .. figure:: images/balmorel_VRE.png :width: 70 % Used in: Balmorel - + +.. graphviz:: + + digraph G { + rankdir="LR"; + node [ shape=box ]; + + i1 -> box ; + i2 -> box ; + box -> o1 ; + box -> o2 ; + + i1 [ label="Capacity Factor" ]; + i2 [ label="Electricity Demand" ]; + o1 [ label="Electricity Output" ]; + o2 [ label="Cost (FixOM, VarOM)" ]; + box [ label="Parameters:\ncapacity\nefficiency\ncost\nlifetime\nOaM-rate\nbidirectional"]; + + label="Used in: GENESYS_2" + } + .. figure:: images/vre_unit_genesys2.png :width: 70 % Used in: GENESYS_2 +.. graphviz:: + + digraph G { + rankdir="LR"; + node [ shape=box ]; + + box -> o [ label="Electricity production" ]; + + o [ style="invis" ]; + box [ label="bus\ncapacity\nprofile\nmarginal_cost\ncapacity_cost\nexpandable\noutput_parameters\ncapacity_potential" ]; + + label="Used in: oemof.tabular" + } + + Balmorel '''''''' The related equation for this technology is (TO BE UPDATED):