Direct contributions
Direct contributions are the results that are directly related to the processes of the calculated product system, without their upstream or downstream contributions. For each result element, these results form a matrix with the result elements as rows and the processes (technosphere flows) \(j\) as columns, scaled by the scaling vector \(s\). There are methods for getting a row (the contributions of all processes to a single result element), a column (the direct result of a single process), or a single value of this matrix.
| Method | Parameters | Returns | Formula |
|---|---|---|---|
flow-contributions-of | enviFlow | List[TechFlowValue] | \(G[i, :]\) |
direct-interventions-of | techFlow | List[EnviFlowValue] | \(G[:, j]\) |
direct-intervention-of | enviFlow, techFlow | EnviFlowValue | \(G[i, j]\) |
impact-contributions-of | impactCategory | List[TechFlowValue] | \(H[k, :]\) |
direct-impacts-of | techFlow | List[ImpactValue] | \(H[:, j]\) |
direct-impact-of | impactCategory, techFlow | ImpactValue | \(H[k, j]\) |
cost-contributions | List[TechFlowValue] | \(q^T diag(s)\) | |
direct-costs-of | techFlow | number | \(q_j s_j\) |
Intervention flows
The direct contributions of the processes to the inventory result are given by the scaled intervention matrix \(G\):
$$ G = B \ diag(s) $$
flow-contributions-ofreturns the row \(G[i, :]\): the direct contribution of each process \(j\) in the system to the inventory result of a flow \(i\).direct-interventions-ofreturns the column \(G[:, j]\): the direct intervention flows of a process \(j\) related to the final demand of the product system.direct-intervention-ofreturns the single value \(G[i, j]\).
Try it
You can edit and execute the examples below. Just make sure an openLCA IPC
server is running on port 8080.
Contributions to a flow:
const v = await call("result/flow-contributions-of", {
"@id": "66dcc7d0-ce47-46bf-b77a-ada4b4c95169",
enviFlow: {
flow: {
"@type": "Flow",
"@id": "5f7aad3d-566c-4d0d-ad59-e765f971aa0f",
name: "Methane, fossil",
},
}
});
console.log(v);
// [
// {
// techFlow: { provider: [Object], flow: [Object] },
// amount: 1.5185665316633185e-8
// },
// {
// techFlow: { provider: [Object], flow: [Object] },
// amount: 0.0018045126002407595
// }, ...
Direct interventions of a process:
const v = await call("result/direct-interventions-of", {
"@id": "66dcc7d0-ce47-46bf-b77a-ada4b4c95169",
techFlow: {
provider: {
"@type": "Process",
"@id": "ff6b1c80-03b2-4433-adaf-66c51063b078",
},
flow: {
"@type": "Flow",
"@id": "759b89bd-3aa6-42ad-b767-5bb9ef5d331d",
}
}
});
console.log(v);
// [
// { enviFlow: { flow: [Object], isInput: false },
// amount: 2.4884640352310415e-19 },
// { enviFlow: { flow: [Object], isInput: false },
// amount: 1.0147225898077544e-12 }, ...
Impact categories
The direct contributions of the processes to the impact assessment result are given by the direct impact matrix \(H\):
$$ H = C \ B \ diag(s) $$
impact-contributions-ofreturns the row \(H[k, :]\): the direct contribution of each process \(j\) in the system to the impact assessment result of an impact category \(k\).direct-impacts-ofreturns the column \(H[:, j]\): the direct impacts of a process \(j\) related to the final demand of the product system.direct-impact-ofreturns the single value \(H[k, j]\).
Try it
You can edit and execute the examples below. Just make sure an openLCA IPC
server is running on port 8080.
Contributions to an impact category:
const v = await call("result/impact-contributions-of", {
"@id": "86b36d3b-1dba-4804-bd61-dc5bcaf7c86c",
impactCategory: {
"@id": "dbdd01d5-2be4-3ba4-8127-de89f065fda1",
},
});
console.log(v);
// [
// {
// techFlow: { provider: [Object], flow: [Object] },
// amount: 0.00008582892489209728
// },
// { techFlow: { provider: [Object], flow: [Object] },
// amount: 2.023594297933216 },
// ...
Direct impacts of a process:
const v = await call("result/direct-impacts-of", {
"@id": "86b36d3b-1dba-4804-bd61-dc5bcaf7c86c",
techFlow: {
provider: { "@id": "37eb4bf5-9fbc-4caf-a24a-0e0b71b997dd" },
flow: { "@id": "817c3650-4fed-4ef2-b9b6-404a198834e6" }
}
});
console.log(v);
// [
// {
// impactCategory: {
// "@type": "ImpactCategory",
// "@id": "3bc1c67f-d3e3-3891-9fea-4512107d88ef",
// name: "Climate change",
// category: "EF 3.0 Method (adapted)",
// refUnit: "kg CO2 eq"
// },
// amount: 0.0008854099635082675
// },
// ...
Costs
For costs, there is only a single result row: the net-costs \(q\) of the processes scaled by the scaling vector \(s\):
$$ q^T diag(s) $$
cost-contributionsreturns the direct contribution of each process \(j\) in the system to the total cost result.direct-costs-ofreturns the direct costs \(q_j s_j\) of a process \(j\). Via JSON-RPC, the value is returned as plain number.
Try it
You can edit and execute the example below. Just make sure an openLCA IPC
server is running on port 8080:
const o = await import("https://cdn.jsdelivr.net/npm/olca-ipc@2.6.2/+esm");
const client = o.IpcClient.on(8080);
const result = await client.calculate(o.CalculationSetup.of({
target: o.Ref.of({
refType: o.RefType.ProductSystem,
id: "99ad5640-b73c-4387-b03c-ee0a9c6a7d6b",
}),
withCosts: true,
}));
await result.untilReady();
// the currency code is taken from the total result
const code = (await result.getTotalCosts()).currency?.refUnit;
const contributions = await result.getCostContributions();
for (const c of contributions) {
console.log(`${c.techFlow?.provider?.name}: ${c.amount} ${code}`);
}
// Q: 15 USD
// P: 45 USD
result.dispose();