OcelotProject / Ocelot

Ocelot is open-source linking for life cycle assessment. See https://ocelot.space/ for more information.
Other
25 stars 7 forks source link

Cutoff function 7: Subdivide combined production with formulas #17

Closed cmutel closed 8 years ago

cmutel commented 8 years ago

Treats variable properties of reference product exchanges.

The first check in the algorithm identifies datasets whose reference product contains variable properties. A variable property is a property that is not set as a “defining value” and used in a mathematical relation of one or more exchanges in the same activity dataset.

The next step checks if another activity dataset with the same reference product as an input and a different value of the variable property exists. In this case, the algorithm converts the variable property into a by-product of this dataset with the name “[property name] of [reference product name]” and an amount of one. The reference product is renamed to “[reference product name], property-independent” and the variable property is removed.

All mathematical relations of the dataset are changed to refer to the amount of the new by- product instead of the amount of the variable property. All exchanges that were originally expressed as fixed amounts are reformulated as mathematical expressions referencing the reference product, e.g. the fixed amount “40” is changed to “40 / [sum of amount of reference products]”.

Likewise, the market activity datasets for the reference products are subdivided. A property- independent market with all exchanges of the original market is created. For each variable property, a property-specific market is created that has the exchange corresponding to the variable property as its reference product.

For all datasets that consume the reference product as an input, this input is also subdivided into a property-independent and a property-specific part using the property value of the consuming activity dataset.

All datasets that supply the same reference product to the same market and do not have the same property as a variable property are changed to supply the property-independent reference product. The exchanges of these datasets are interpreted as independent of this property and their fixed amount is reformulated as mathematical expressions referencing the property-independent reference product. Finally, all variable properties of a reference product are added to the corresponding ValidIntermediateExchange with their value set to zero.

cmutel commented 8 years ago

Flowcharts from technical documentation:

screen shot 2016-08-22 at 11 21 50

screen shot 2016-08-22 at 11 22 17

cmutel commented 8 years ago

The first check in the algorithm identifies datasets whose reference product contains variable properties. A variable property is a property that is not set as a “defining value” and used in a mathematical relation of one or more exchanges in the same activity dataset.

@ecoinvent So, the XML attribute isDefiningValue is basically the same as asking whether this object has a formula, right? Is there ever a case with isDefiningValue could be false, but there would be nor formula?

ecoinvent commented 8 years ago

@cmutel The defining property options were not implemented. This is not something we have to worry about.

cmutel commented 8 years ago

@ecoinvent I think we have to talk through this again, I can't understand the motivation or actual actions in this test from the technical documentation.

I am also unclear what to do in cases where there is combined production but no variable parameters, e.g. rare earth oxide production. Mass based allocation? It seems crazy, but isn't that what

All exchanges that were originally expressed as fixed amounts are reformulated as mathematical expressions referencing the reference product, e.g. the fixed amount “40” is changed to “40 / [sum of amount of reference products]”.

is saying?

ecoinvent commented 8 years ago

@cmutel There are many things in the technical documentation and DQG that are not up to date. We need to ask ifu at each turn to make sure we are doing the right thing.

cmutel commented 8 years ago

After some more discussion, the quoted technical discussion is simply out of date. The current code for combined production is correct (and much simpler).