Integrate TSAM mode in oemof.solph #387
Annotations
4 errors
/home/runner/work/oemof-solph/oemof-solph/examples/storage_investment/v6_invest_optimize_all_technologies_using_mp_and_tsam.py#L304
# initialise the operational model
om = solph.Model(energysystem)
# if tee_switch is true solver messages will be displayed
logging.info("Solve the optimization problem")
- om.write('my_model.lp', io_options={'symbolic_solver_labels': True})
+ om.write("my_model.lp", io_options={"symbolic_solver_labels": True})
om.solve(solver="cbc", solve_kwargs={"tee": True})
##########################################################################
# Check and plot the results
##########################################################################
|
/home/runner/work/oemof-solph/oemof-solph/src/oemof/solph/components/_generic_storage.py#L1328
if not m.TSAM_MODE:
self.storage_content = Var(
self.INVESTSTORAGES, m.TIMESTEPS, within=NonNegativeReals
)
else:
- self.storage_content_inter = Var(self.INVESTSTORAGES, m.CLUSTERS_OFFSET)
+ self.storage_content_inter = Var(
+ self.INVESTSTORAGES, m.CLUSTERS_OFFSET
+ )
self.storage_content_intra = Var(
self.INVESTSTORAGES, m.TIMEINDEX_TYPICAL_CLUSTER_OFFSET
)
# set the initial intra storage content
# first timestep in intra storage is always zero
|
/home/runner/work/oemof-solph/oemof-solph/src/oemof/solph/components/_generic_storage.py#L1673
* n.nominal_storage_capacity
* m.timeincrement[t]
)
expr += n.fixed_losses_absolute[t] * m.timeincrement[t]
expr += (
- -m.flow[i[n], n, p, t] * n.inflow_conversion_factor[t]
- ) * m.timeincrement[t]
+ -m.flow[i[n], n, p, t] * n.inflow_conversion_factor[t]
+ ) * m.timeincrement[t]
expr += (
- m.flow[n, o[n], p, t] / n.outflow_conversion_factor[t]
- ) * m.timeincrement[t]
+ m.flow[n, o[n], p, t] / n.outflow_conversion_factor[t]
+ ) * m.timeincrement[t]
return expr == 0
def _intra_storage_balance_rule(block, n, p, k, g):
"""
Rule definition for the storage balance of every storage n and
|
/home/runner/work/oemof-solph/oemof-solph/src/oemof/solph/components/_generic_storage.py#L1699
* self.total[n, p]
* m.timeincrement[t]
)
expr += n.fixed_losses_absolute[t] * m.timeincrement[t]
expr += (
- -m.flow[i[n], n, p, t] * n.inflow_conversion_factor[t]
- ) * m.timeincrement[t]
+ -m.flow[i[n], n, p, t] * n.inflow_conversion_factor[t]
+ ) * m.timeincrement[t]
expr += (
- m.flow[n, o[n], p, t] / n.outflow_conversion_factor[t]
- ) * m.timeincrement[t]
+ m.flow[n, o[n], p, t] / n.outflow_conversion_factor[t]
+ ) * m.timeincrement[t]
return expr == 0
if not m.TSAM_MODE:
self.balance = Constraint(
self.INVESTSTORAGES, m.TIMEINDEX, rule=_storage_balance_rule
|