Repository navigation
Quick start
The fastest way to see what aiphoria does is to run the example scenario that comes with the package. This is also a good way to check that your installation works.
- Create a new text file in your project directory, for example aiphoria_example.py.
- Copy this code into it and save:
from aiphoria.example import run_example
run_example(remove_existing_output_dir=True)- Run it:
python aiphoria_example.pyBy default the results are written to a folder called aiphoria_example in your home directory
(C:\Users\<your-name>\aiphoria_example on Windows, ~/aiphoria_example on Linux/macOS).
To write them somewhere else, give an absolute path:
run_example(r"C:\results\aiphoria_example", remove_existing_output_dir=True)NOTE:
remove_existing_output_dir=Truedeletes the output folder first. Without it, the run stops if the folder already exists.
The example uses illustrative values for a simple sawnwood chain in one country, from 2021 to 2030:
- Industrial roundwood goes to sawmilling, which produces sawnwood and residues.
- Sawnwood is also imported and exported.
- Sawnwood is used in construction (mean lifetime 10 years) and furniture (5 years). These are stocks.
- At end of life, 40% of construction wood is recycled back to sawmilling; the rest, and all furniture, is incinerated.
- An alternative scenario reduces sawmilling residues by 50% between 2025 and 2030.
You can download the example file from Home and open it in Excel to see how it is built.
-
combined_sankey.html: open it in a web browser. Move the year slider from 2021 to 2030 and watch the flows to incineration and the recycling loop appear as the first products reach end of life. -
Baseline/network_graph.html: the same system as a network of processes and flows. -
Baseline/Baseline_dynamic_stocks.xlsx, sheetTotal_stock: the stock in each product, in m³ and in carbon.
All output files are described in Output files.
Next: Running your own scenario or, to understand the model first, How aiphoria works.
Getting started
Concepts
Building a scenario file
Results
Help