ElericalLine bidirectional

Hello, I wanted to build a model using the electricalline and electricalbus objects. After some testing I realised the electricalline objects are not able to work with bidirectional flows. By bidirectional flows I mean diametrically opposed flows, that are able to repesent an energy flow from Bus A to Bus B and from Bus B to Bus A. After analysing the code I was quite confused, because I found the following codeline:
self.bidirectional = True
This codeline is part of the code for the electricalline object:
class ElectricalLine(Flow):

def __init__(self, *args, **kwargs):
    super().__init__(*args, **kwargs)
    self.reactance = sequence(kwargs.get('reactance', 0.00001))

    # set input / output flow values to -1 by default if not set by user
    if self.nonconvex is not None:
        raise ValueError(
            ("Attribute `nonconvex` must be None for " +
             "component `ElectricalLine` from {} to {}!").format(
                self.input, self.output))
    if self.min is None:
        self.min = -1
    # to be used in grouping for all bidi flows
    self.bidirectional = True

def constraint_group(self):
    return ElectricalLineBlock

Does anyone know what bidirectional stands for if not for bidirectional flows?

Thanks, Philipp

Hey Philipp,

the ElectricalLine in combination with ElectricalBus will model the grid as a LOPF with simple angle formulation. Therefore, on a line the flows will be in the range of -nominal_value < flow < nominal_value.

In oemof edges are directed, meaning they start at one and end at another bus. Generally the flow on these edges will be 0 < flow < nominal_value, However if the bidirectional attribute is set, the flow values will also be allowed to take negative values. Which was necessary for the ElectricalLine to work.

If you have any further questions, do not hesitate :slight_smile: . There is also an example in the oemof example repository for te lopf.

Hope this helps!

Thanks for your answer :wink:
I forgot to set the parameters min and max for the electricallines. Now the system is working as expected.

Best Philipp