tum-ens / urbs

A linear optimisation model for distributed energy systems
GNU General Public License v3.0
177 stars 132 forks source link

Bidirectional transmission in the same time step #280

Open TDiaconu opened 4 years ago

TDiaconu commented 4 years ago

The transmission constraints allow a bidirectional power flow at the same time, at the maximum capacity from region A to region B and at the maximum capacity from B to A. Therefore, a power flow two times the value of the actual transmission capacity is allowed. While this is not an optimal situation when the lines have losses, it can still happen when the lines are used as a curtailment by urbs.

My sugestion to eliminate this unwanted situation is to replace the two existing equations:

pi_in(from A to B) <= maximum capacity and pi_in(from B to A) <= maximum capacity

with the following equation:

pi_in(from A to B) + pi_in(from B to A) <= maximum capacity.

maxhock commented 3 years ago

Could you attach an example input file please as I am not aware of this issue in the existing input files. I think some models use a defined curtailment process, so that this does not happen.

Alternatively I would assume it is fine to modify res_transmission_input_by_capacity_rule() like this: # transmission input <= transmission capacity def res_transmission_input_by_capacity_rule(m, tm, stf, sin, sout, tra, com): return (m.e_tra_in[tm, stf, sin, sout, tra, com] + m.e_tra_in[tm, stf, sout, sin, tra, com] <= m.dt * m.cap_tra[stf, sin, sout, tra, com])

Zhanwei-Liu commented 2 years ago

I think the constraints mentioned above are not enough to limit possible bidirectional transmission. At least one of pi_in(from A to B) and pi_in(from B to A) equals 0 in the optimal result. We need to add a binary variable (dir) to guarantee results to meet reality. That dir is equals to 1 means the transmission direction is from A to B. That dir equals 0 means the transmission direction is from B to A. The required constraints are as follows:

ojdo commented 1 year ago

I would even say: if your mathematically optimal solution has bidirectional flow, then the scenario is broken. There should always be another process/storage/demand avenue for some MWh to be consumed than it being "burned" in transmission losses because the energy has no other way to go. Even a near-zero (or even negative) revenue energy sell option would be a better.

This is the counter-side of the "Slack" power plant process that used to be present in most vertices, to prevent mathematically impossible scenarios, but clearly indicating that not enough other options are present.

I would therefore vote for allowing bidirectional flow, but possibly implement a warning that is emitted whenever it is present in an LP optimal solution - similar to the use of Slack power plants.