コード例 #1
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)
コード例 #2
0
ファイル: short_circuit_driver.py プロジェクト: Bengt/GridCal
    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
        ]
コード例 #3
0
ファイル: ptdf_ts_driver.py プロジェクト: ZiiCee/GridCal
    def __init__(self, n, m, nt, start, end, time_array=None):
        """
        TimeSeriesResults constructor
        @param n: number of buses
        @param m: number of branches
        @param nt: number of time steps
        """
        PowerFlowResults.__init__(self)
        self.name = 'PTDF Time series'
        self.nt = nt
        self.m = m
        self.n = n
        self.start = start
        self.end = end

        self.time = time_array

        if nt > 0:

            self.voltage = np.zeros((nt, n), dtype=float)

            self.S = np.zeros((nt, n), dtype=float)

            self.Sbranch = np.zeros((nt, m), dtype=float)

            self.loading = np.zeros((nt, m), dtype=float)

        else:

            self.voltage = None

            self.S = None

            self.Sbranch = None

            self.loading = None

        self.available_results = [ResultTypes.BusVoltageModule,
                                  ResultTypes.BusActivePower,
                                  # ResultTypes.BusReactivePower,
                                  ResultTypes.BranchActivePower,
                                  ResultTypes.BranchLoading]
コード例 #4
0
ファイル: time_series_driver.py プロジェクト: miek770/GridCal
    def __init__(self, n, m, nt, start, end, time=None):
        """
        TimeSeriesResults constructor
        @param n: number of buses
        @param m: number of branches
        @param nt: number of time steps
        """
        PowerFlowResults.__init__(self)

        self.nt = nt
        self.m = m
        self.n = n
        self.start = start
        self.end = end

        self.time = time

        self.bus_types = zeros(n, dtype=int)

        if nt > 0:
            self.voltage = zeros((nt, n), dtype=complex)

            self.S = zeros((nt, n), dtype=complex)

            self.Sbranch = zeros((nt, m), dtype=complex)

            self.Ibranch = zeros((nt, m), dtype=complex)

            self.Vbranch = zeros((nt, m), dtype=complex)

            self.loading = zeros((nt, m), dtype=complex)

            self.losses = zeros((nt, m), dtype=complex)

            self.flow_direction = zeros((nt, m), dtype=float)

            self.error = zeros(nt)

            self.converged = ones(nt, dtype=bool)  # guilty assumption

            self.overloads = [None] * nt

            self.overvoltage = [None] * nt

            self.undervoltage = [None] * nt

            self.overloads_idx = [None] * nt

            self.overvoltage_idx = [None] * nt

            self.undervoltage_idx = [None] * nt

            self.buses_useful_for_storage = [None] * nt

        else:
            self.voltage = None

            self.S = None

            self.Sbranch = None

            self.Ibranch = None

            self.Vbranch = None

            self.loading = None

            self.losses = None

            self.flow_direction = None

            self.error = None

            self.converged = None

            self.overloads = None

            self.overvoltage = None

            self.undervoltage = None

            self.overloads_idx = None

            self.overvoltage_idx = None

            self.undervoltage_idx = None

            self.buses_useful_for_storage = None

        self.available_results = [ResultTypes.BusVoltageModule,
                                  ResultTypes.BusVoltageAngle,
                                  ResultTypes.BusActivePower,
                                  ResultTypes.BusReactivePower,
                                  ResultTypes.BranchPower,
                                  ResultTypes.BranchCurrent,
                                  ResultTypes.BranchLoading,
                                  ResultTypes.BranchLosses,
                                  ResultTypes.BranchVoltage,
                                  ResultTypes.BranchAngles,
                                  ResultTypes.SimulationError]
コード例 #5
0
    def __init__(self, n, m, n_tr, n_hvdc, bus_names, branch_names, transformer_names, hvdc_names,
                 time_array, bus_types):
        """
        TimeSeriesResults constructor
        :param n: number of buses
        :param m: number of branches
        :param n_tr:
        :param n_hvdc:
        :param bus_names:
        :param branch_names:
        :param transformer_names:
        :param hvdc_names:
        :param time_array:
        :param bus_types:
        """
        PowerFlowResults.__init__(self,
                                  n=n,
                                  m=m,
                                  n_tr=n_tr,
                                  n_hvdc=n_hvdc,
                                  bus_names=bus_names,
                                  branch_names=branch_names,
                                  transformer_names=transformer_names,
                                  hvdc_names=hvdc_names,
                                  bus_types=bus_types)

        self.name = 'Time series'
        self.nt = len(time_array)
        self.m = m
        self.n = n

        self.time = time_array

        self.bus_types = np.zeros(n, dtype=int)

        self.voltage = np.zeros((self.nt, n), dtype=complex)

        self.S = np.zeros((self.nt, n), dtype=complex)

        self.Sf = np.zeros((self.nt, m), dtype=complex)

        self.St = np.zeros((self.nt, m), dtype=complex)

        self.Ibranch = np.zeros((self.nt, m), dtype=complex)

        self.Vbranch = np.zeros((self.nt, m), dtype=complex)

        self.loading = np.zeros((self.nt, m), dtype=complex)

        self.losses = np.zeros((self.nt, m), dtype=complex)

        self.hvdc_losses = np.zeros((self.nt, self.n_hvdc))

        self.hvdc_Pf = np.zeros((self.nt, self.n_hvdc))

        self.hvdc_Pt = np.zeros((self.nt, self.n_hvdc))

        self.hvdc_loading = np.zeros((self.nt, self.n_hvdc))

        self.flow_direction = np.zeros((self.nt, m), dtype=float)

        self.error_values = np.zeros(self.nt)

        self.converged_values = np.ones(self.nt, dtype=bool)  # guilty assumption

        self.overloads = [None] * self.nt

        self.overvoltage = [None] * self.nt

        self.undervoltage = [None] * self.nt

        self.overloads_idx = [None] * self.nt

        self.overvoltage_idx = [None] * self.nt

        self.undervoltage_idx = [None] * self.nt

        self.buses_useful_for_storage = [None] * self.nt

        # results available
        self.available_results = [ResultTypes.BusVoltageModule,
                                  ResultTypes.BusVoltageAngle,
                                  ResultTypes.BusActivePower,
                                  ResultTypes.BusReactivePower,

                                  ResultTypes.BranchActivePowerFrom,
                                  ResultTypes.BranchReactivePowerFrom,
                                  ResultTypes.BranchActiveCurrentFrom,
                                  ResultTypes.BranchReactiveCurrentFrom,
                                  ResultTypes.BranchLoading,
                                  ResultTypes.BranchActiveLosses,
                                  ResultTypes.BranchReactiveLosses,
                                  ResultTypes.BranchVoltage,
                                  ResultTypes.BranchAngles,
                                  ResultTypes.SimulationError,

                                  ResultTypes.HvdcLosses,
                                  ResultTypes.HvdcPowerFrom,
                                  ResultTypes.HvdcPowerTo]
コード例 #6
0
    def __init__(self,
                 n,
                 m,
                 nt,
                 n_tr,
                 n_hvdc,
                 bus_names,
                 branch_names,
                 transformer_names,
                 hvdc_names,
                 bus_types,
                 time_array=None,
                 states=None):
        """
        TimeSeriesResults constructor
        @param n: number of buses
        @param m: number of branches
        @param nt: number of time steps
        """
        PowerFlowResults.__init__(self,
                                  n=n,
                                  m=m,
                                  n_tr=n_tr,
                                  n_hvdc=n_hvdc,
                                  bus_names=bus_names,
                                  branch_names=branch_names,
                                  transformer_names=transformer_names,
                                  hvdc_names=hvdc_names,
                                  bus_types=bus_types)

        self.name = 'N-1'

        self.nt = nt

        self.time = time_array

        self.states = states

        self.bus_types = np.zeros(n, dtype=int)

        self.branch_names = None

        if nt > 0:
            self.voltage = np.zeros((nt, n), dtype=complex)

            self.S = np.zeros((nt, n), dtype=complex)

            self.Sbranch = np.zeros((nt, m), dtype=complex)

            self.Ibranch = np.zeros((nt, m), dtype=complex)

            self.Vbranch = np.zeros((nt, m), dtype=complex)

            self.loading = np.zeros((nt, m), dtype=complex)

            self.losses = np.zeros((nt, m), dtype=complex)

            self.flow_direction = np.zeros((nt, m), dtype=float)

            self.error = np.zeros(nt)

            self.converged = np.ones(nt, dtype=bool)  # guilty assumption

            self.overloads = [None] * nt

            self.overvoltage = [None] * nt

            self.undervoltage = [None] * nt

            self.overloads_idx = [None] * nt

            self.overvoltage_idx = [None] * nt

            self.undervoltage_idx = [None] * nt

            self.buses_useful_for_storage = [None] * nt

        else:
            self.voltage = None

            self.S = None

            self.Sbranch = None

            self.Ibranch = None

            self.Vbranch = None

            self.loading = None

            self.losses = None

            self.flow_direction = None

            self.error = None

            self.converged = None

            self.overloads = None

            self.overvoltage = None

            self.undervoltage = None

            self.overloads_idx = None

            self.overvoltage_idx = None

            self.undervoltage_idx = None

            self.buses_useful_for_storage = None

        self.otdf = np.zeros((m, m))

        self.available_results = [
            ResultTypes.OTDF, ResultTypes.BusVoltageModule,
            ResultTypes.BusVoltageAngle, ResultTypes.BusActivePower,
            ResultTypes.BusReactivePower, ResultTypes.BranchPower,
            ResultTypes.BranchCurrent, ResultTypes.BranchLoading,
            ResultTypes.BranchLosses, ResultTypes.BranchVoltage,
            ResultTypes.BranchAngles, ResultTypes.OTDFSimulationError
        ]
コード例 #7
0
ファイル: time_series_driver.py プロジェクト: mzy2240/GridCal
    def __init__(self, n, m, n_tr, n_hvdc, bus_names, branch_names,
                 transformer_names, hvdc_names, time_array, bus_types):
        """
        TimeSeriesResults constructor
        :param n: number of buses
        :param m: number of branches
        :param n_tr:
        :param n_hvdc:
        :param bus_names:
        :param branch_names:
        :param transformer_names:
        :param hvdc_names:
        :param time_array:
        :param bus_types:
        """
        PowerFlowResults.__init__(self,
                                  n=n,
                                  m=m,
                                  n_tr=n_tr,
                                  n_hvdc=n_hvdc,
                                  bus_names=bus_names,
                                  branch_names=branch_names,
                                  transformer_names=transformer_names,
                                  hvdc_names=hvdc_names,
                                  bus_types=bus_types)

        self.data_variables.append(
            'time')  # this is missing from the base class

        # results available (different from the base class)
        self.available_results = [
            ResultTypes.BusVoltageModule, ResultTypes.BusVoltageAngle,
            ResultTypes.BusActivePower, ResultTypes.BusReactivePower,
            ResultTypes.BranchActivePowerFrom,
            ResultTypes.BranchReactivePowerFrom, ResultTypes.BranchLoading,
            ResultTypes.BranchActiveLosses, ResultTypes.BranchReactiveLosses,
            ResultTypes.BranchVoltage, ResultTypes.BranchAngles,
            ResultTypes.SimulationError, ResultTypes.HvdcLosses,
            ResultTypes.HvdcPowerFrom, ResultTypes.HvdcPowerTo
        ]

        self.name = 'Time series'
        self.nt = len(time_array)
        self.m = m
        self.n = n

        self.time = time_array

        self.bus_types = np.zeros(n, dtype=int)

        self.voltage = np.zeros((self.nt, n), dtype=complex)

        self.S = np.zeros((self.nt, n), dtype=complex)

        self.Sf = np.zeros((self.nt, m), dtype=complex)

        self.St = np.zeros((self.nt, m), dtype=complex)

        self.Vbranch = np.zeros((self.nt, m), dtype=complex)

        self.loading = np.zeros((self.nt, m), dtype=complex)

        self.losses = np.zeros((self.nt, m), dtype=complex)

        self.hvdc_losses = np.zeros((self.nt, self.n_hvdc))

        self.hvdc_Pf = np.zeros((self.nt, self.n_hvdc))

        self.hvdc_Pt = np.zeros((self.nt, self.n_hvdc))

        self.hvdc_loading = np.zeros((self.nt, self.n_hvdc))

        self.error_values = np.zeros(self.nt)

        self.converged_values = np.ones(self.nt,
                                        dtype=bool)  # guilty assumption