Closed lthurner closed 7 years ago
I have added three functions:
create_load_from_cosphi(net, bus, sn_kva, cosphi, mode, kwargs) create_sgen_from_cosphi(net, bus, sn_kva, cosphi, mode, kwargs) create_shunt_as_condensator(net, bus, q_kvar, loss_factor, **kwargs)
The load function creates a load with positive active power, the sgen function adds an sgen with negative active power. The reactive power is specified with the cosphi and mode variable. mode="ind" gives positive reactive power, mode="cap" gives negative reactive power for both elements (consumer viewpoint).
The sunt function creates a shunt with negative reactive power and positive active power p_kw = abs(q_kvar)*loss_factor.
Tests are available for all three functions and the docstrings are included in the documentation (for example here: http://pandapower.readthedocs.io/en/develop/elements/load.html#pandapower.create_load_from_cosphi)
see commit a66b2201baf3b0e356d381c7a2f65eb61dc3d787
We could make additional create functions for loads, sgens, shunts etc to allow different input parameters:
create_load_from_coshphi(s, cosphi)
that would then write the correct p and q values into the load table. Would not be much effort and maybe a nice convenience function