Exemplo n.º 1
0
    def __init__(self, n, m, n_tr, bus_names, branch_names, transformer_names, bus_types):
        """

        :param n:
        :param m:
        :param n_tr:
        :param bus_names:
        :param branch_names:
        :param transformer_names:
        :param bus_types:
        """
        PowerFlowResults.__init__(self,
                                  n=n,
                                  m=m,
                                  n_tr=n_tr,
                                  n_hvdc=0,
                                  bus_names=bus_names,
                                  branch_names=branch_names,
                                  transformer_names=transformer_names,
                                  hvdc_names=(),
                                  bus_types=bus_types)

        self.name = 'Short circuit'

        self.short_circuit_power = None

        self.available_results = [ResultTypes.BusVoltageModule,
                                  ResultTypes.BusVoltageAngle,
                                  ResultTypes.BranchActivePowerFrom,
                                  ResultTypes.BranchReactivePowerFrom,
                                  ResultTypes.BranchActiveCurrentFrom,
                                  ResultTypes.BranchReactiveCurrentFrom,
                                  ResultTypes.BranchLoading,
                                  ResultTypes.BranchActiveLosses,
                                  ResultTypes.BranchReactiveLosses]
Exemplo n.º 2
0
 def __init__(self,
              Sbus=None,
              voltage=None,
              Sbranch=None,
              Ibranch=None,
              loading=None,
              losses=None,
              error=None,
              converged=None,
              Qpv=None):
     """
     Constructor
     :param Sbus: Bus power injections
     :param voltage: Bus voltages
     :param Sbranch: Branch power flow
     :param Ibranch: Branch current flow
     :param loading: Branch loading
     :param losses: Branch losses
     :param error: error
     :param converged: converged?
     :param Qpv: Reactive power at the PV nodes
     """
     # initialize the
     PowerFlowResults.__init__(self,
                               Sbus=Sbus,
                               voltage=voltage,
                               Sbranch=Sbranch,
                               Ibranch=Ibranch,
                               loading=loading,
                               losses=losses,
                               error=error,
                               converged=converged,
                               Qpv=Qpv)
Exemplo n.º 3
0
    def __init__(self, Sbus=None, voltage=None, Sbranch=None, Ibranch=None, loading=None, losses=None, SCpower=None,
                 error=None, converged=None, Qpv=None):

        """

        Args:
            Sbus:
            voltage:
            Sbranch:
            Ibranch:
            loading:
            losses:
            SCpower:
            error:
            converged:
            Qpv:
        """
        PowerFlowResults.__init__(self, Sbus=Sbus, voltage=voltage, Sbranch=Sbranch, Ibranch=Ibranch,
                                  loading=loading, losses=losses, error=error, converged=converged, Qpv=Qpv)

        self.short_circuit_power = SCpower

        self.available_results = [ResultTypes.BusVoltage,
                                  ResultTypes.BranchPower,
                                  ResultTypes.BranchCurrent,
                                  ResultTypes.BranchLoading,
                                  ResultTypes.BranchLosses,
                                  ResultTypes.BusShortCircuitPower]
Exemplo n.º 4
0
def power_flow_worker(variation,
                      nbus,
                      nbr,
                      calculation_inputs,
                      power_flow,
                      dP,
                      return_dict=dict()):
    """

    :param nbus:
    :param nbr:
    :param calculation_inputs:
    :param power_flow:
    :param dP:
    :param return_dict:
    :return:
    """
    # create new results
    pf_results = PowerFlowResults()
    pf_results.initialize(nbus, nbr)
    logger = list()

    # simulate each island and merge the results
    for i, calculation_input in enumerate(calculation_inputs):

        if len(calculation_input.ref) > 0:
            Vbus = calculation_input.Vbus
            Sbus = calculation_input.Sbus - dP[
                calculation_input.original_bus_idx]
            Ibus = calculation_input.Ibus

            # run circuit power flow
            res = power_flow.run_pf(circuit=calculation_input,
                                    Vbus=Vbus,
                                    Sbus=Sbus,
                                    Ibus=Ibus)

            bus_original_idx = calculation_input.original_bus_idx
            branch_original_idx = calculation_input.original_branch_idx

            # merge the results from this island
            pf_results.apply_from_island(res, bus_original_idx,
                                         branch_original_idx)

        else:
            logger.append('There are no slack nodes in the island ' + str(i))

    return_dict[variation] = (pf_results, logger)