Value Error Oemof Investment

Hello,

during modelling an new Scenario in my actual model Version, a value error occurs. I tried a lot to find out, what is the reason for it. I have implemented an minimal and maximal capacity for the investment-module. I have no idea, why there’s that value error.
Has anybody an idea, what could be the problem?

ValueError: No value for uninitialized NumericValue object InvestmentFlow.invest[PtH2,b_hydro]

Thanks!

Best regards Cj

These are not enough information to help. You should reduce the problem to the minimal number of components and time steps, that are needed to reproduce the error. Then you can show the example and the full error message here.

Hi @ChJa,

I have the same value error, which occurs after using solph.processing.meta_results(om) using oemof v0.4.1.

File ~\Documents\GitHub\laendv031\laend_module.py:345 in optimizeForObjective
esys.results[“meta”] = solph.processing.meta_results(om)

File ~.conda\envs\laend_v031\lib\site-packages\oemof\solph\processing.py:206 in meta_results
meta_res = {‘objective’: om.objective()}

File ~.conda\envs\laend_v031\lib\site-packages\pyomo\core\base\expression.py:54 in call
return self.expr(exception=exception)

File pyomo\core\expr\numeric_expr.pyx:224 in pyomo.core.expr.numeric_expr.ExpressionBase.call

File ~.conda\envs\laend_v031\lib\site-packages\pyomo\core\expr\visitor.py:1057 in evaluate_expression
return visitor.dfs_postorder_stack(exp)

File ~.conda\envs\laend_v031\lib\site-packages\pyomo\core\expr\visitor.py:587 in dfs_postorder_stack
flag, value = self.visiting_potential_leaf(_sub)

File ~.conda\envs\laend_v031\lib\site-packages\pyomo\core\expr\visitor.py:965 in visiting_potential_leaf
return True, value(node)

File pyomo\core\expr\numvalue.pyx:244 in pyomo.core.expr.numvalue.value

File pyomo\core\expr\numvalue.pyx:231 in pyomo.core.expr.numvalue.value

ValueError: No value for uninitialized NumericValue object InvestmentFlow.invest[PV_facade_2022,bus_el]

The optimization model seems to be successfully solved but processing the meta results leads to an error. Processing of main results was no problem. Unless the results look a little bit strange: they contain only results for sinks.
The error occured after changing some parameters of the model like investment costs for storage (became very small). When changing the costs again to higher values no error occurs.
Have you found a reason for your problem?

Best regards
Heidi

To reproduce the error you have to provide a minimal example with the working and not-working parameters, otherwise I do not know how to help.