After minimization (Python/scipy), I would like to know how to find unused variables in the result. Here is a simple example where the third variable is left untouched. Apart comparing initial value vs result, is there a better way to identify such variable?
from scipy.optimize import minimize
def objective(x):
return -x[0] - x[1]
x0 = 0, 0, 1.234
res = minimize(objective, x0,
bounds = ([-10,+10], [-10,+10], [-10,+10]))
print(res.x)
# output: [10. 10. 1.234]
# res.x[2] has been left untouched compared to x0[2]