Exchange Sign Conventions¶
This document explains the exchange amount sign conventions used in EcoSemantic and demonstrates how they align with standard LCA practice and the underlying Brightway2 calculation engine.
The Simple Rule¶
Use Positive Values
In EcoSemantic, use positive values for:
- ✅ Material and energy inputs consumed by your process
- ✅ Emissions released to the environment
- ✅ Reference products (outputs) produced by your process
Negative Values are Special Cases
Use negative values only for:
- Avoided burdens (substitution/system expansion)
- Credits from recycling scenarios
- Co-product allocation adjustments
Quick Reference Table¶
| Exchange Type | What it Represents | Amount Sign | Example |
|---|---|---|---|
production |
Reference product output | Positive | amount=1.0 (1 kg product) |
technosphere |
Material/energy input | Positive | amount=5.0 (5 kWh electricity) |
technosphere |
Avoided production | Negative | amount=-2.0 (avoided 2 kg steel) |
biosphere |
Emission to environment | Positive | amount=10.5 (10.5 kg CO₂) |
biosphere |
Resource from nature | Positive | amount=100.0 (100 L water) |
Why Positive Values for Inputs?¶
If you're familiar with LCA matrix mathematics, you might expect inputs to be negative (since they're consumed). Here's why EcoSemantic uses positive values.
Understanding the Two-Level Convention¶
LCA software operates at two distinct levels:
graph TB
subgraph "User/Data Level"
A[User enters: amount = 5.0<br/>type = technosphere]
end
subgraph "EcoSemantic/Brightway2"
B[Recognizes technosphere type]
C[Applies sign transformation]
end
subgraph "Matrix Level"
D[Matrix cell = -5.0]
end
A --> B
B --> C
C --> D
style A fill:#e8f5e9
style D fill:#fff3e0
Level 1: User/Data Level : How practitioners enter and think about data. This is what you interact with in EcoSemantic.
Level 2: Matrix Level
: How the calculation engine represents data mathematically. This is handled automatically.
The Matrix Convention¶
At the matrix level, the technosphere matrix follows the mathematical convention:
- Positive values = Production (outputs)
- Negative values = Consumption (inputs)
This is expressed in the fundamental LCA equation:
$$ \mathbf{s} = \mathbf{A}^{-1}\mathbf{f} $$
Where:
- $\mathbf{A}$ is the technosphere matrix
- $\mathbf{f}$ is the final demand vector
- $\mathbf{s}$ is the scaling vector
Why the Abstraction?¶
At the user level, most LCA software (including Brightway2, which powers EcoSemantic) uses positive values for inputs because:
- It's more intuitive - "I need 5 kg of steel" not "I need -5 kg of steel"
- Reduces errors - Less confusion about when to use negative signs
- Matches data sources - ecoinvent and other databases show positive input values
- Software handles conversion - The sign flip is automatic and consistent
How Brightway2 Handles This¶
When you create an exchange in EcoSemantic:
Brightway2's matrix builder automatically:
- Recognizes this is a "technosphere" type exchange (consumption)
- Applies sign transformation when building the technosphere matrix
- Places
-5.0in the appropriate matrix cell
This behavior is documented in Brightway2's official documentation:
Brightway2 Documentation
"Include consumption edges but multiply the amount times negative one, to get the right sign in the technosphere matrix"
Exchange Type Rules¶
Brightway2 applies different rules based on exchange type:
| Exchange Type | Matrix Behavior |
|---|---|
production |
Value entered directly (no sign change) |
substitution |
Value entered directly (no sign change) |
technosphere |
Value multiplied by -1 (sign flipped) |
biosphere |
Value entered directly (no sign change) |
Consistency with ecoinvent¶
This convention is fully consistent with how data is stored in the ecoinvent database. When you browse ecoinvent datasets:
- Input amounts are shown as positive values
- Production amounts are shown as positive values
- The database structure handles the mathematical transformation
EcoSemantic maintains this same user-facing convention to ensure:
- Seamless integration with ecoinvent data
- Familiar experience for LCA practitioners
- Consistent behavior across all tools
Practical Examples¶
Example 1: Simple Manufacturing Process¶
A process that produces 1 kg of plastic pellets, consuming electricity and emitting CO₂:
Activity: "Plastic pellet production"
Unit: kilogram
Location: GLO
Exchanges:
# Reference product (what we produce)
- name: "Plastic pellets"
amount: 1.0 # ✅ Positive - production
type: production
# Electricity input
- amount: 2.5 # ✅ Positive - consumed input
type: technosphere
input: "market for electricity, low voltage"
# CO₂ emission
- amount: 1.8 # ✅ Positive - emission
type: biosphere
input: "Carbon dioxide, fossil"
Example 2: Recycling with Avoided Burden¶
A recycling process that avoids virgin material production:
Activity: "Steel recycling"
Unit: kilogram
Location: DE
Exchanges:
# Reference product (recycled steel)
- name: "Recycled steel"
amount: 1.0 # ✅ Positive - production
type: production
# Scrap steel input
- amount: 1.05 # ✅ Positive - consumed input
type: technosphere
input: "market for scrap steel"
# Avoided virgin steel (credit)
- amount: -0.9 # ⚠️ Negative - avoided burden
type: technosphere
input: "steel production, converter"
When to Use Negative Values
The avoided virgin steel has a negative amount because it represents a credit - the environmental burden that is avoided by using recycled material instead of virgin production.
Example 3: Multi-Input Manufacturing¶
A more complex process with multiple inputs:
Activity: "Electric motor production"
Unit: unit
Location: CN
Exchanges:
# Reference product
- name: "Electric motor, 10kW"
amount: 1.0 # ✅ Positive
type: production
# Material inputs (all positive)
- amount: 15.0 # ✅ 15 kg copper
type: technosphere
input: "market for copper"
- amount: 25.0 # ✅ 25 kg steel
type: technosphere
input: "market for steel, low-alloyed"
- amount: 5.0 # ✅ 5 kg aluminum
type: technosphere
input: "market for aluminum"
# Energy input
- amount: 50.0 # ✅ 50 kWh electricity
type: technosphere
input: "market for electricity, medium voltage"
# Emissions
- amount: 0.5 # ✅ 0.5 kg VOC emissions
type: biosphere
input: "NMVOC, non-methane volatile organic compounds"
Common Mistakes to Avoid¶
❌ Wrong: Negative Values for Regular Inputs¶
# DON'T DO THIS - This is incorrect!
create_database_exchange(
amount=-5.0, # ❌ Wrong sign
exchange_type="technosphere",
input_activity_code="steel_code"
)
This would result in a positive value in the matrix, representing production instead of consumption. Your LCA results would be wrong.
✅ Correct: Positive Values for Regular Inputs¶
# DO THIS - This is correct!
create_database_exchange(
amount=5.0, # ✅ Correct sign
exchange_type="technosphere",
input_activity_code="steel_code"
)
❌ Wrong: Assuming Matrix-Level Convention¶
Don't try to "help" the software by pre-applying the negative sign:
# DON'T DO THIS
# "I know inputs should be negative in the matrix, so I'll use -5"
amount = -5.0 # ❌ Wrong thinking!
The exchange_type field tells Brightway2 how to handle the value. Trust the system.
EcoSemantic's Warning System¶
To help prevent mistakes, EcoSemantic includes a warning system that alerts you when negative values are used:
{
"id": "exchange-uuid",
"amount": -5.0,
"exchange_type": "technosphere",
"warning": "NEGATIVE AMOUNT DETECTED: You specified a negative value..."
}
This warning:
- ✅ Does not block the exchange creation
- ✅ Allows legitimate credit/recycling scenarios
- ✅ Alerts you to potential mistakes
- ✅ Can be ignored if the negative value is intentional
Technical Deep Dive¶
For those interested in the mathematical details, here's how the computation works.
The Technosphere Matrix¶
The technosphere matrix $\mathbf{A}$ represents the industrial economy:
- Rows = Products (goods and services)
- Columns = Processes (activities)
- Diagonal elements = Production amounts (typically positive)
- Off-diagonal elements = Consumption amounts (typically negative)
Matrix Construction¶
When Brightway2 constructs the matrix from your exchange data:
# Simplified pseudocode of what Brightway2 does internally
for exchange in activity.exchanges:
if exchange.type == "production":
# Enter value directly
matrix[product_row, process_col] = exchange.amount
elif exchange.type == "technosphere":
# Flip the sign for consumption
matrix[product_row, process_col] = -exchange.amount
elif exchange.type == "biosphere":
# Enter in biosphere matrix directly
biosphere_matrix[flow_row, process_col] = exchange.amount
The LCA Calculation¶
The Life Cycle Inventory (LCI) calculation solves:
$$ \mathbf{s} = \mathbf{A}^{-1}\mathbf{f} $$
Then the Life Cycle Impact Assessment (LCIA) applies characterization:
$$ \mathbf{h} = \mathbf{C} \cdot \mathbf{B} \cdot \mathbf{s} $$
Where:
- $\mathbf{C}$ = Characterization matrix
- $\mathbf{B}$ = Biosphere matrix
- $\mathbf{s}$ = Scaling vector from LCI
References¶
- Brightway2 Documentation - Matrix Construction
- Brightway2 Documentation - Inventory Theory
- ecoinvent Methodology
- Heijungs, R., & Suh, S. (2002). The Computational Structure of Life Cycle Assessment. Springer.