Skip to main content

Interface between simulation models and brightway25

Project description

PyPI-Server

SiModIn

Simulation Model Interface

Interface between simulation models and brightway25.

SiModIn can be used to:

  • Create simulation based brightway25 datasets.

  • Calculate the impact of your models.

  • Provide your simulation models for LCA studies.

Installation

Install SiModIn from PyPi:

pip install simodin

Getting started

The basic usage of SiModIn will be presented for an Tespy powerplant model from the offical Tespy documentation.

To use the existing SiModIn model, import and instantiate the SimModel class:

from SimModel_powerplant import tespy_model
from simodin import interface as link

my_model= tespy_model('powerplant')

Then inititate the model and calculate it.

my_model.init_model()
my_model.calculate_model()

Create the technosphere dictionary and pass the model to an modelInterface instance.

my_model.define_flows()

my_interface= link.modelInterface('tespy powerplant',my_model)

For LCA calculation, the needed brightway25 dataset needs to be assigned to the technosphere flows:

import bw2data as bd

bd.projects.set_current('bw_meets_tespy')
my_interface.methods=[('ecoinvent-3.11',  'EF v3.1',  'climate change',  'global warming potential (GWP100)')]
ei=bd.Database('ecoinvent-3.11-cutoff')

ei_heat=[act for act in ei if 'heat production, at hard coal industrial furnace 1-10MW' in act['name']
 and 'Europe without Switzerland' in act['location'] ][0]

ei_water=[act for act in ei if 'market for tap water' in act['name']
 and 'Europe without Switzerland' in act['location'] ][0]

my_interface.add_dataset('heat source', ei_steam)
my_interface.add_dataset('cooling water source', ei_water)
my_model.set_flow_attr('cooling water source', 'dataset_correction', 0.1)

After that, the LCA calculation can be executed or the data exported to a brightway25 database:

my_interface.calculate_background_impact()
my_interface.calculate_impact()
code= my_interface.export_to_bw()

This and further examples how to use SiModIn can be found here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simodin-0.0.5.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simodin-0.0.5-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file simodin-0.0.5.tar.gz.

File metadata

  • Download URL: simodin-0.0.5.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for simodin-0.0.5.tar.gz
Algorithm Hash digest
SHA256 064e6aa9771e5ac525d31e8596f53f922323b3d3e814455ed187a8664d8b2c3e
MD5 aa6821d1e32f305e0db8fd7b5e95a90c
BLAKE2b-256 3f26bb193e6e74f561a53c8a77e982d0796e83af5e9cb42c9ab52c2c40247208

See more details on using hashes here.

File details

Details for the file simodin-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: simodin-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for simodin-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 10d626f6b3ff81d5bb89e1cab88b56b712cfc76009753b2f77bf2cd6a69e07bd
MD5 8b74821f60ce040198adb49e216e60ba
BLAKE2b-256 2135742b068acd1420c4906c61a5b1baa7aa43fe62d6bd02ac5f430b0e650eda

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page