Getting Started¶
To open the swolfpy, do the following steps:
1- Open the conda command prompt.
2- Activate the environment:
conda activate swolfpy
3- Open python to run swolfpy:
python
4- Run swolfpy in python:
import swolfpy as sp
sp.swolfpy()
swolfpy¶
Here is the swolfpy start screen (Fig. 1). The user interface includes the following tabs:
Start
Import Process Models tab: You can change the default process models through this tab.
Define SWM System tab: You selected the collection and treatment processes to create a SWM system.
Load Project Input Data tab: You load a saved project through this tab and view/update project parameters and processes.
Create Scenario tab: In this tab, you can create a scenario. Scenarios can start from the collection or treatment processes.
LCA tab: You can perform LCA or comparative LCA in this tab.
Monte Carlo Simulation tab: In this tab, you can define/change uncertainty distributions for the input data and perform a Monte Carlo simulation.
Optimization tab: In this tab, you can minimize the selected impact category by optimizing the waste fraction or collection scheme.
If you want to create a new project, click the Start New Project button [10]. You can also load a project[11].
Import Process Models¶
If you activate the radio button for User Defined Process Models, then you will see this (Fig. 2) tab which includes three subtabs:
Process Models: You can select the default or user defined python models for the process models.
Common Data: You can change the common data file.
Technosphere: You can select the user defined LCI data or create a User_Technosphere database with EcoSpold2 files and connect to it.
If you have modified the default process models, then you should set them in this tab. You should select the process model from the drop-down list[4] and click the User Defined radio button[5]. Now you should click the Browse button[5] and find your python file. You can also revise the types of waste that each process models can accept through the Input Flow Type screen [6]. Don’t forget to click the Update button before changing the next process model otherwise your changes will be lost. When you are done, you should click the Import Process Models to import them and go to the next step.
Note
All the python files for the process models should be in swolfpy_processmodels directory. If you don’t know where is your installation, then do the following:
import swolfpy_processmodels
swolfpy_processmodels.__path__
In the Common Data subtab (Fig. 3), you can select the user defined model[1] or data[2] for the Common data.
In the Technosphere subtab (Fig. 4), you can select the user defined model[1] or LCI data [2]. You can also create a User_Technosphere database with EcoSpold2 files. In order to do that, you should select the directory that contains the EcoSpold2 files[4]. You should also add the Reference_activity_id to the Technosphere_References.csv file in the swolfpy_inputdataData directory. Then you should browse the Technosphere_References.csv [3].
Define SWM System¶
Define Collection Processes¶
Note
If you are importing data, the data should be in the csv format and have the same column names as the default data files. We suggest to copy our data files and edit them to keep the structure.
Define Treatment Processes¶
Note
If you are importing data, the data should be in the csv format and have the same column names as the default data files. We suggest to copy our data files and edit them to keep the structure.
Define SWM System¶
Create Scenario¶
LCA¶
Setup LCA¶
LCA Results¶
Contribution Analysis¶
Life Cycle Inventory¶
Monte Carlo Simulation¶
Monte Carlo Results¶
Data¶
Plot¶
Optimization¶
Load Project¶
Uncertainty Distribution¶
Tha stats_arrays package is used to define uncertain input parameters for the process models and waste materials. The table below shows the main uncertainty distributions that are currently used
Name |
|
|
|
|
|
|
---|---|---|---|---|---|---|
Undefined |
0 |
static value |
||||
No uncertainty |
1 |
static value |
||||
Lognormal |
2 |
\(\boldsymbol{\mu}\) |
\(\boldsymbol{\sigma}\) |
Lower bound |
Upper bound |
|
Normal |
3 |
\(\boldsymbol{\mu}\) |
\(\boldsymbol{\sigma}\) |
Lower bound |
Upper bound |
|
Uniform |
4 |
Minimum |
Maximum |
|||
Triangular |
5 |
mode |
Minimum |
Maximum |
||
Discrete Uniform |
7 |
mode |
Minimum |
upper bound |
Guideline to define uncertainty¶
Normal distributions (ID = 3): When there is sufficient published data.
Triangular distribution (ID = 5): When values are based on expert opinions with a reasonable value for the mode.
Uniform Distribution (ID=4): When only the range is known without preference for mode.
Lognormal distributions (ID=2): When only one value is available or there is significant data and the value must be non-negative.
Discrete Uniform (ID=7): For True/False (0,1) parameters.(min=0,max=2).
Note
In Normal distribution, if the mean is too close to lower or upper bound (mostly for parameters that are fractions), use the triangular distribution.
Note
In Lognormal distribution, if the parameter is related to the emission factors, sigma should be in the range of 0.04 to 0.09 based on the quality of the data.
See also
For more information about distributions check stats_arrays website.