Procedure: Local sensitivity anallysis for matrix-based LCA

Method: Multiplier method (MPM) (Taylor approximation)

Author: Evelyne Groen {evelyne [dot] groen [at] gmail [dot] com}

Last update: 25/10/2016


In [2]:
import numpy as np 

A_det = np.matrix('10 0; -2 100') #A-matrix
B_det = np.matrix('1 10')         #B-matrix
f = np.matrix('1000; 0')          #Functional unit vector f

g_LCA = B_det * A_det.I * f 

print("The deterministic result is:", g_LCA[0,0])


The deterministic result is: 120.0

NB: this is a vectorized implementation of the MatLab code that was originally written by Reinout Heijungs & Sangwong Suh


In [4]:
s = A_det.I * f                                 #scaling vector s: inv(A_det)*f
Lambda = B_det * A_det.I;                       #B_det*inv(A)

dgdA = -(s * Lambda).T                          #Partial derivatives A-matrix
Gamma_A = np.multiply((A_det/g_LCA), dgdA)      #The multipliers of the A-matrix
print("The multipliers of the A-matrix are:")
print(Gamma_A)

dgdB = s.T                                      #Partial derivatives B-matrix
Gamma_B = np.multiply((B_det/g_LCA), dgdB)      #The multipliers of the B-matrix
print("The multipliers of the B-matrix are:")
print(Gamma_B)


The multipliers of the A-matrix are:
[[-1.         -0.        ]
 [ 0.16666667 -0.16666667]]
The multipliers of the B-matrix are:
[[ 0.83333333  0.16666667]]

In [ ]: