bw2calc.dense_lca
#
Module Contents#
Classes#
A static LCI or LCIA calculation. |
- class bw2calc.dense_lca.DenseLCA(demand, method=None, weighting=None, normalization=None, database_filepath=None, log_config=None, presamples=None, seed=None, override_presamples_seed=False)[source]#
Bases:
bw2calc.lca.LCA
A static LCI or LCIA calculation.
Following the general philosophy of Brightway2, and good software practices, there is a clear separation of concerns between retrieving and formatting data and doing an LCA. Building the necessary matrices is done with MatrixBuilder objects (matrixbuilders). The LCA class only does the LCA calculations themselves.
Create a new LCA calculation.
- Parameters
demand (*) – The demand or functional unit. Needs to be a dictionary to indicate amounts, e.g.
{("my database", "my process"): 2.5}
.method (*) – LCIA Method tuple, e.g.
("My", "great", "LCIA", "method")
. Can be omitted if only interested in calculating the life cycle inventory.
- Returns
A new LCA object
- solve_linear_system()[source]#
Master solution function for linear system \(Ax=B\).
To most numerical analysts, matrix inversion is a sin.
—Nicolas Higham, Accuracy and Stability of Numerical Algorithms, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002, p. 260.
We use UMFpack, which is a very fast solver for sparse matrices.
If the technosphere matrix has already been factorized, then the decomposed technosphere (
self.solver
) is reused. Otherwise the calculation is redone completely.