Example #1
0
    def setResults(self, schedule):
        """
        Save resulting state of charge, charging and discharging powers, filled and removed water
        """
        PCharge_schedule=np.zeros(len(schedule))
        PDischarge_schedule=np.zeros(len(schedule))

        PCharge_schedule[schedule<0]=-schedule[schedule<0]
        PDischarge_schedule[schedule>0]=schedule[schedule>0]

        #TODO: Change the length issue
        ff=np.array([self.ffInit*self.energyCapacity]*len(schedule))
        add2ff=np.concatenate((np.array([0]), np.cumsum((PCharge_schedule*self.etaCharge-PDischarge_schedule/self.etaDischarge)*self.dT)[:len(schedule)-1]), axis=0)
        ff_schedule=ff+add2ff

        #Save schedule
        results = handleData.saveResult(self.environment.timer,
                                        self.currentSchedule,
                                        self.totalSchedule,
                                        schedule)
        (self.currentSchedule, self.totalSchedule) = results

        # Save fill factor
        results = handleData.saveResultInit(self.environment.timer,
                                            self.currentFF,
                                            self.totalFF,
                                            ff_schedule/self.energyCapacity)
        (self.currentFF, self.totalFF, self.ffInit) = results

        # Save charging power
        results = handleData.saveResult(self.environment.timer,
                                        self.currentPCharge,
                                        self.totalPCharge,
                                        PCharge_schedule)
        (self.currentPCharge, self.totalPCharge) = results


        # Save discharging power
        results = handleData.saveResult(self.environment.timer,
                                        self.currentPDischarge,
                                        self.totalPDischarge,
                                        PDischarge_schedule)
        (self.currentPDischarge, self.totalPDischarge) = results

        # Save filled water
        results = handleData.saveResult(self.environment.timer,
                                        self.currentWCharge,
                                        self.totalWCharge,
                                        PCharge_schedule*self.etaCharge/(self.d*self.g*self.h))
        (self.currentWCharge, self.totalWCharge) = results

        # Save remowed water
        results = handleData.saveResult(self.environment.timer,
                                        self.currentWDischarge,
                                        self.totalWDischarge,
                                        PDischarge_schedule/(self.etaDischarge*self.d*self.g*self.h))
        (self.currentWDischarge, self.totalWDischarge) = results
Example #2
0
    def _setFInput(self, fInput, emmisionRate=None):
        results = handleData.saveResult(self.environment.timer,
                                        self.currentFInput, self.totalFInput,
                                        fInput)
        (self.currentFInput, self.totalFInput) = results

        if emmisionRate != None:
            results = handleData.saveResult(self.environment.timer,
                                            self.currentEmission,
                                            self.totalEmission,
                                            fInput * emmisionRate)
            (self.currentEmission, self.totalEmission) = results
Example #3
0
    def setResults(self, pInput, pOutput):
        """
        Save electricity input and output of the inverter.
        """
        results = handleData.saveResult(self.environment.timer,
                                        self.currentPInput, self.totalPInput,
                                        pInput)
        (self.currentPInput, self.totalPInput) = results

        results = handleData.saveResult(self.environment.timer,
                                        self.currentPOutput, self.totalPOutput,
                                        pOutput)
        (self.currentPOutput, self.totalPOutput) = results
 def _setNonFlowQuantity(self, nonflowQuantity):
     """ Save the computed non flow quantity drop across the heating device """
     results = handleData.saveResult(self.environment.timer,
                                     self.currentNonFlowQuantity,
                                     self.totalNonFlowQuantity,
                                     nonflowQuantity)
     (self.currentNonFlowQuantity, self.totalNonFlowQuantity) = results
Example #5
0
    def setResults(self, schedule):
        """
        Save resulting fill factor, charging and discharging gas powers
        """
        print()
        print("Schedule assinged to storage")

        GCharge_schedule = np.zeros(len(schedule))
        GDischarge_schedule = np.zeros(len(schedule))

        GCharge_schedule[schedule < 0] = -schedule[schedule < 0]
        GDischarge_schedule[schedule > 0] = schedule[schedule > 0]

        ff = np.array([self.ffInit * self.capacity] * len(schedule))
        add2ff = np.concatenate(
            (np.array([0]),
             np.cumsum((GCharge_schedule * self.etaCharge -
                        GDischarge_schedule / self.etaDischarge) *
                       self.dT)[:len(schedule) - 1]),
            axis=0)
        ff_schedule = ff + add2ff

        #Save schedule
        results = handleData.saveResult(self.environment.timer,
                                        self.currentSchedule,
                                        self.totalSchedule, schedule)
        (self.currentSchedule, self.totalSchedule) = results

        # Save fill factor
        results = handleData.saveResultInit(self.environment.timer,
                                            self.currentFF, self.totalFF,
                                            ff_schedule / self.capacity)
        (self.currentFF, self.totalFF, self.ffInit) = results

        # Save charging power
        results = handleData.saveResult(self.environment.timer,
                                        self.currentGInput, self.totalGInput,
                                        GCharge_schedule)
        (self.currentGInput, self.totalGInput) = results

        # Save discharging power
        results = handleData.saveResult(self.environment.timer,
                                        self.currentGOutput, self.totalGOutput,
                                        GDischarge_schedule)
        (self.currentGOutput, self.totalGOutput) = results
Example #6
0
 def setResults(self, schedule):
     """
     Save resulting gas power output
     """
     # Save gas power removal
     results = handleData.saveResult(self.environment.timer,
                                     self.currentGOutput, self.totalGOutput,
                                     schedule)
     (self.currentGOutput, self.totalGOutput) = results
 def setResults(self, schedule):
     """
     Save resulting water volume output
     """
     # Save water removal
     results = handleData.saveResult(self.environment.timer,
                                     self.currentWOutput, self.totalWOutput,
                                     schedule)
     (self.currentWOutput, self.totalWOutput) = results
Example #8
0
 def setResults(self, pOutput, qOutput, schedule):
     """
     Save resulting electricty, heat output and operational schedule.
     """
     self._setSchedule(schedule)
     self._setQOutput(qOutput)
     result = handleData.saveResult(self.environment.timer,
                                    self.currentPOutput,
                                    self.totalPOutput,
                                    pOutput)
     (self.currentPOutput, self.totalPOutput) = result
Example #9
0
 def setResults(self, schedule):
     """
     Save resulting electricty, heat output, fuel input (also emission indirectly) and operational schedule.
     """
     self._setSchedule(schedule)
     self._setQOutput(schedule * self.pNominal / self.sigma)
     self._setFInput(schedule * self.fNominal, self.specificEmission)
     result = handleData.saveResult(self.environment.timer,
                                    self.currentPOutput, self.totalPOutput,
                                    schedule * self.pNominal)
     (self.currentPOutput, self.totalPOutput) = result
Example #10
0
    def setResults(self, soc, charge, discharge):
        """
        Save resulting state of charge, charging and discharging powers.
        """
        # Save state of charge
        results = handleData.saveResultInit(self.environment.timer,
                                            self.currentSoc, self.totalSoc,
                                            soc)
        (self.currentSoc, self.totalSoc, self.socInit) = results

        # Save charging power
        results = handleData.saveResult(self.environment.timer,
                                        self.currentPCharge, self.totalPCharge,
                                        charge)
        (self.currentPCharge, self.totalPCharge) = results

        # Save discharging power
        results = handleData.saveResult(self.environment.timer,
                                        self.currentPDischarge,
                                        self.totalPDischarge, discharge)
        (self.currentPDischarge, self.totalPDischarge) = results
Example #11
0
    def setResults(self, schedule):
        """
        Save resulting state of charge, charging and discharging powers.
        """
        # Save state of charge
        charge_schedule = np.zeros(len(schedule))
        discharge_schedule = np.zeros(len(schedule))
        soc = np.array([self.socInit * self.capacity] * len(schedule))

        charge_schedule[schedule < 0] = -schedule[schedule < 0]
        discharge_schedule[schedule > 0] = schedule[schedule > 0]

        add2soc = np.concatenate(
            (np.array([0]),
             np.cumsum((charge_schedule * self.etaCharge -
                        discharge_schedule / self.etaDischarge) *
                       self.dT)[:len(schedule) - 1]),
            axis=0)
        soc_schedule = soc + add2soc

        results = handleData.saveResultInit(self.environment.timer,
                                            self.currentSoc, self.totalSoc,
                                            soc_schedule / self.capacity)
        (self.currentSoc, self.totalSoc, self.socInit) = results

        # Save charging power
        results = handleData.saveResult(self.environment.timer,
                                        self.currentPCharge, self.totalPCharge,
                                        charge_schedule)
        (self.currentPCharge, self.totalPCharge) = results

        # Save discharging power
        results = handleData.saveResult(self.environment.timer,
                                        self.currentPDischarge,
                                        self.totalPDischarge,
                                        discharge_schedule)
        (self.currentPDischarge, self.totalPDischarge) = results
Example #12
0
    def setResults(self, flowTemp, schedule):
        #TODO: Ask if this method fits
        """
        Save resulting electricty consumption, heat output and
        operational schedule.
        """
        nominals = self.getNominalValues(flowTemp)

        self._setSchedule(schedule)
        self._setQOutput(schedule * nominals[1])
        result = handleData.saveResult(self.environment.timer,
                                       self.currentPConsumption,
                                       self.totalPConsumption,
                                       schedule * nominals[0])
        (self.currentPConsumption, self.totalPConsumption) = result
 def _setSchedule(self, schedule):
     """ Save the computed schedule to the device """
     results = handleData.saveResult(self.environment.timer,
                                     self.currentSchedule,
                                     self.totalSchedule, schedule)
     (self.currentSchedule, self.totalSchedule) = results
 def _setFlowQuantity(self, flowQuantity):
     """ Save the computed flow through the heating device """
     results = handleData.saveResult(self.environment.timer,
                                     self.currentFlowQuantity,
                                     self.totalFlowQuantity, flowQuantity)
     (self.currentFlowQuantity, self.totalFlowQuantity) = results
 def _setQOutput(self, qOutput):
     """ Save the computed heat output to the heating device """
     results = handleData.saveResult(self.environment.timer,
                                     self.currentQOutput, self.totalQOutput,
                                     qOutput)
     (self.currentQOutput, self.totalQOutput) = results