Ejemplo n.º 1
0
    def __init__(self):

        # Integrate simulatable class for time indexing
        Simulatable.__init__(self)
        # Integrate load demand data_loader for csv load profile integration
        self.load_demand = data_loader.LoadDemand()
        #Initialize power of load profile
        self.power = 0
        self.load_data = None
    def __init__(self,
                 timestep,
                 peak_power,
                 controller_type,
                 env,
                 file_path=None):

        # Read component parameters from json file
        if file_path:
            self.load(file_path)
        else:
            print('Attention: No json file for photovoltaic model specified')

            self.controller_method = "mppt"  # [-] Specification of photvoltaic charge controller (needed to call apropriate power method)
            self.temperature_a = -3.47  # [0] Thermal model: Numeric parameter a of Sandia PV Array Performance Model
            self.temperature_b = -0.0594  # [0] Thermal model: Numeric parameter b of Sandia PV Array Performance Model
            self.temperature_deltaT = 3  # [0] Thermal model: Numeric parameter dT of Sandia PV Array Performance Model
            self.params_name = "A10Green_Technology_A10J_S72_185"  # [-] Photovoltaic module specification
            self.params_V_mp_ref = 36.72  # [V] Photovoltaic voltage at MPP
            self.params_alpha_sc = 0.002253  # [A/C] Short-circuit current temperature coefficient
            self.params_a_ref = 1.98482  # [V] Product of the usual diode ideality factor (n, unitless), number of cells in series (Ns), and cell thermal voltage at reference conditions
            self.params_I_L_ref = 5.43568  # [A] The light-generated current (or photocurrent) at reference conditions
            self.params_I_o_ref = 1.16164e-09  # [A] The dark or diode reverse saturation current at reference conditions
            self.params_R_sh_ref = 298.424  # [Ohm] The shunt resistance at reference conditions
            self.params_R_s = 0.311962  # [Ohm] The series resistance at reference conditions
            self.params_pdc0 = 184.7016  # [W] Photovoltaic power of the modules at 1000 W/m2 and cell reference temperature
            self.params_gamma_pdc = -0.005  # [1/C] The temperature coefficient. Typically -0.002 to -0.005
            self.degradation_pv = 1.58154e-10  # [1/s] Photovoltaic degradation per second: deg_yearly=0.5% --> 0.005 / (8760*3600)
            self.investment_costs_specific = 0.8  # [$/Wp] Photovoltaic specific investment costs

        # Integrate simulatable class for time indexing
        Simulatable.__init__(self)
        # Integrate environment class
        self.env = env
        # Charge controller type
        self.controller_type = controller_type
        # [s] Timestep
        self.timestep = timestep

        ## Basic parameters
        self.peak_power = peak_power
        # [W] Current PV peak power dependent on aging
        self.peak_power_current = self.peak_power
        # [V] Battery voltage for PWM PV model
        self.battery_voltage = 12

        ## PV aging model
        # [W] End-of-Life condition of PV module
        self.end_of_life_photovoltaic = 0.8 * self.peak_power  #eingelesen

        ## Economic model
        # Nominal installed pv size for economic calculation
        self.size_nominal = self.peak_power
    def __init__(self,
                 input_link_1,
                 input_link_2,
                 load):

        # Integrate simulatable class and connected component classes
        Simulatable.__init__(self)
        self.load = load
        self.input_link_1 = input_link_1
        self.input_link_2 = input_link_2

        # Initialize power flow of junction
        self.power = 0
Ejemplo n.º 4
0
    def __init__(self,
                 timestep,
                 peak_power,
                 env,
                 file_path=None):

        # Read component parameters of wind turbine from json file
        if file_path:
            self.load(file_path)
        else:
            print('Attention: No json file for wind turbine model specified')
            self.turbine_type = "Enair 30PRO"                                   # [-] Wind turbine specification
            self.hub_height = 13                                                # [m] The height of the hub
            self.diameter = 3.8                                                 # [m] The diameter of the rotor
            self.nominal_power = 2500                                           # [m] Nominal turbine power
            self.power_curve_data = {"value": [0.0, 10.0, 100.0, 300.0, 1000.0, 1450.0, 1850.0, 2100.0, 2300.0, 2500.0, 2500.0, 2500.0, 2500.0],
                                     "wind_speed": [2.0, 3.0, 4.0, 5.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0]}
            self.degradation = 5.0736e-10                                       # [1/s] Wind turbine degradation per second: deg_yearly=1.6%
            self.investment_costs_specific = 2.5168                             # [$/Wp] Wind turbine specific investment costs

        # Transfer power curve data into DataFrame
        self.power_curve = pd.DataFrame(self.power_curve_data)

        # Integrate simulatable class for time indexing
        Simulatable.__init__(self)
        # [s] Timestep
        self.timestep = timestep
        # Integrate environment class
        self.env = env

        ## Basic parameters  
        self.peak_power = peak_power
        # [W] Current PV peak power dependent on aging
        self.peak_power_current = self.peak_power

        ## Wind turbine aging model
        # [W] End-of-Life condition of wind turbine module
        self.end_of_life_wind_turbine = 0.7 * self.peak_power

        ## Wind turbine economic model
        # Nominal installed wind turbine size for economic calculation
        self.size_nominal = self.peak_power
    def __init__(self, timestep, power_nominal, input_link, file_path=None):

        # Read component parameters from json file
        if file_path:
            self.load(file_path)

        else:
            print(
                'Attention: No json file for power component efficiency specified'
            )

            self.specification = "MPPT_HQST_40A_12V_34V"  # [-] Specification of power component
            self.efficiency_nominal = 0.951  # [1] Nominal power component efficeincy
            self.voltage_loss = 0.009737  # [-] Dimensionless parameter for component model
            self.resistance_loss = 0.031432  # [-] Dimensionless parameter for component model
            self.power_self_consumption = 0.002671  # [-] Dimensionless parameter for component model
            self.end_of_life_power_components = 315360000  # [s] End of life time in seconds
            self.investment_costs_specific = 0.036  # [$/Wp] Specific investment costs

        # Integrate Serializable for serialization of component parameters
        Serializable.__init__(self)  # not needed !?
        # Integrate Simulatable class for time indexing
        Simulatable.__init__(self)  # not needed !?
        # Integrate input power
        self.input_link = input_link
        # [s] Timestep
        self.timestep = timestep

        #Calculate star parameters of efficeincy curve
        self.voltage_loss_star = self.voltage_loss
        self.resistance_loss_star = self.resistance_loss / self.efficiency_nominal
        self.power_self_consumption_star = self.power_self_consumption * self.efficiency_nominal

        ## Power model
        # Initialize power
        self.power = 0
        # set nominal power of power component
        self.power_nominal = power_nominal

        ## Economic model
        # Nominal installed component size for economic calculation
        self.size_nominal = power_nominal
Ejemplo n.º 6
0
    def __init__(self, timestep, power_nominal, input_link, file_path=None):
        '''
        Parameters
        ----------
        timestep: int. Simulation timestep in seconds
        power_nominal : int. Nominal power of power component in watt [W]
        input_link : class. Class of component which supplies input power
        file_path : json file to load power component parameters
        '''

        # Read component parameters from json file
        if file_path:
            self.load(file_path)

        else:
            print(
                'Attention: No json file for power component efficiency specified'
            )

            self.specification = "Generic system controller"  # [-] Specification of power component
            self.end_of_life_power_components = 315360000  # [s] End of life time in seconds
            self.investment_costs_specific = 0.036  # [$/Wp] Specific investment costs

        # Integrate Serializable for serialization of component parameters
        Serializable.__init__(self)  # not needed !?
        # Integrate Simulatable class for time indexing
        Simulatable.__init__(self)  # not needed !?
        # Integrate input power
        self.input_link = input_link
        # [s] Timestep
        self.timestep = timestep

        ## Power model
        # Initialize power
        self.power = 0
        # set nominal power of power component
        self.power_nominal = power_nominal

        ## Economic model
        # Nominal installed component size for economic calculation
        self.size_nominal = power_nominal
    def __init__(self, simulation_steps, timestep, pv_peak_power,
                 wt_nominal_power, battery_capacity):
        '''
        Parameters can be defined externally or inside class
        ----------
        pv_peak_power : int. Installed phovoltaic peak power in Watt peak [Wp]
        battery capacity : int. Installed nominal battery capacity in Watthours [Wh]
        pv_orientation : tuble of floats. PV oriantation with:
            1. tuble entry pv azimuth in degrees from north [°] (0°=north, 90°=east, 180°=south, 270°=west).
            2. tuble entry pv inclination in degrees from horizontal [°]
        system_location : tuble of floats. System location coordinates:
            1. tuble entry system longitude in degrees [°]
            2. tuble entry system latitude in degrees [°]
        simulation_steps : int. Number of simulation steps
        timestep: int. Simulation timestep in seconds
        '''

        #%% Define simulation settings

        # System specifications
        # [Wp] Installed PV power
        self.pv_peak_power = pv_peak_power
        # [Wp] Installed nominal Wind power
        self.wt_nominal_power = wt_nominal_power
        # [Wh] Installed battery capacity
        self.battery_capacity = battery_capacity

        #  PV orientation : tuble of floats. PV oriantation with:
        # 1. pv azimuth in degrees [°] (0°=north, 90°=east, 180°=south, 270°=west). & 2. pv inclination in degrees [°]
        self.pv_orientation = (0, 0)

        # System location
        # Latitude: Positive north of equator, negative south of equator.
        # Longitude: Positive east of prime meridian, negative west of prime meridian.
        self.system_location = pvlib.location.Location(
            latitude=-3.386925,
            longitude=36.682995,
            tz='Africa/Dar_es_Salaam',
            altitude=1400)

        ## Define simulation time parameters
        # Number of simulation timesteps
        self.simulation_steps = simulation_steps
        # [s] Simulation timestep
        self.timestep = timestep

        #%% Initialize classes

        # load class
        self.load = Load()

        ## Photovoltaic system componnets
        # Environment class
        self.env = Environment(timestep=self.timestep,
                               system_orientation=self.pv_orientation,
                               system_location=self.system_location)

        # Photovoltaic panel
        self.pv = Photovoltaic(
            timestep=self.timestep,
            peak_power=self.pv_peak_power,
            controller_type='mppt',
            env=self.env,
            file_path='data/components/photovoltaic_resonix_120Wp.json')

        # Photovoltaic charge controller
        self.pv_charger = Power_Component(
            timestep=self.timestep,
            power_nominal=self.pv_peak_power,
            input_link=self.pv,
            file_path='data/components/power_component_mppt_pv.json')

        ## Windturbine system components
        # Environment class - WIND
        #self.env_wt = Environment_Wind(timestep=self.timestep)

        # Windturbine
        self.wt = Wind_Turbine(
            timestep,
            peak_power=self.wt_nominal_power,
            env=self.env,
            file_path='data/components/windturbine_Enair_30PRO.json')

        self.wt_charger = Power_Component(
            timestep=self.timestep,
            power_nominal=self.wt_nominal_power,
            input_link=self.wt,
            file_path='data/components/power_component_mppt_wt.json')

        ## Central power knot
        self.power_junction = Power_Junction(input_link_1=self.pv_charger,
                                             input_link_2=self.wt_charger,
                                             load=self.load)

        ## Battery system components
        self.battery_management = Power_Component(
            timestep=self.timestep,
            power_nominal=self.pv_peak_power,
            input_link=self.power_junction,
            file_path='data/components/power_component_bms.json')

        self.battery = Battery(timestep=self.timestep,
                               capacity_nominal_wh=self.battery_capacity,
                               input_link=self.battery_management,
                               env=self.env,
                               file_path='data/components/battery_lfp.json')

        ## Initialize Simulatable class and define needs_update initially to True
        self.needs_update = True

        Simulatable.__init__(self, self.load, self.env, self.pv,
                             self.pv_charger, self.wt, self.wt_charger,
                             self.power_junction, self.battery_management,
                             self.battery)
Ejemplo n.º 8
0
    def __init__(self,
                 timestep,
                 capacity_nominal_wh,
                 input_link,
                 env,
                 file_path=None):

        # Read component parameters from json file
        if file_path:
            self.load(file_path)

        else:
            print('Attention: No json file for battery model specified')

            self.specification = "lithium_lfp"  # [-] Specification of battery
            self.voltage_nominal = 3.2  # [V] Nominal battery voltage
            self.power_self_discharge_rate = 3.8072e-09  # [1/s] Battery self discharge rate, e.g. 1%/monat = 1/(30.4*24*3600)
            self.energy_density_kg = 256.0  # [Wh/kg] Batery mass specific energy density
            self.energy_density_m2 = 5843.0  # [Wh/m2] Battery surface specific energy density
            self.charge_power_efficiency_a = -0.0224  # [1] Battery charge efficiency parameter - gradient of linear function
            self.charge_power_efficiency_b = 1.0  # [1] Battery charge efficiency parameter - intercept of linear function
            self.discharge_power_efficiency_a = -0.0281  # [1] Battery discharge efficiency parameter - gradient of linear function
            self.discharge_power_efficiency_b = 1.0  # [1] Battery discharge efficiency parameter - intercept of linear function
            self.end_of_discharge_a = 0.0394  # [1] Battery end of discharge parameter - gradient of linear function
            self.end_of_discharge_b = -0.0211  # [1] Battery end of discharge parameter - itercept of linear function
            self.end_of_charge_a = -0.0361  # [1] Battery end of charge parameter - gradient of linear function
            self.end_of_charge_b = 1.1410  # [1] Battery end of charge parameter - itercept of linear function
            self.temperature_operation_min = 233.15  # [K] Minimal battery temperature
            self.temperature_operation_max: 343.15  # [K] Maximum battery temperature
            self.heat_transfer_coefficient = 2  # [W/m2K] Heat transfer coefficeint battery - environment
            self.heat_capacity = 850  # [J/kgK] Battery heat capacity
            self.counter_mc = 0  # [1] Aging model: Initialization counter for
            self.energy_mc = 0  # [Wh] Aging model: Initialization of energy of micro cacle
            self.depth_of_discharge_mc = 0  # [1] Aging model: Initialization of depth of discharge of micro cycle
            self.temperature_mc = 0  # [1] Aging model: Initialization of temperature of micro cycle
            self.cycle_life_loss = 0  # [Wh] Aging model: Initialization capacity loss
            self.cycle_aging_p4 = 0.0  # [1] Cycle aging model: polynomial parameter 4th degree
            self.cycle_aging_p3 = -19047.619  # [1] Cycle aging model: polynomial parameter 3th degree
            self.cycle_aging_p2 = 47142.8571  # [1] Cycle aging model: polynomial parameter 2th degree
            self.cycle_aging_p1 = -43380.9523  # [1] Cycle aging model: polynomial parameter 1th degree
            self.cycle_aging_p0 = 17285.7142  # [1] Cycle aging model: polynomial parameter 0th degree
            self.cycle_aging_pl0 = 1.0  # [1] Cycle aging model: linear temperature function - intersection
            self.cycle_aging_pl1 = 0.0  # [1] Cycle aging model: linear temperature function - gradient
            self.calendric_aging_p5 = 0.0  # [1] Calendric aging model: polynomial parameter 5th degree
            self.calendric_aging_p3 = 0.0  # [1] Calendric aging model: polynomial parameter 3th degree
            self.calendric_aging_p1 = 0.0  # [1] Calendric aging model: polynomial parameter 1th degree
            self.calendric_aging_p0 = 0.0  # [1] Calendric aging model: polynomial parameter 0th degree
            self.voltage_charge_a = -0.50580  # [1] Voltage model: charge case parameter a
            self.voltage_charge_b = -7.92750e-07  # [1] Voltage model: charge case parameter b
            self.voltage_charge_c = 0.00021  # [1] Voltage model: charge case parameter c
            self.voltage_charge_d = 0.73013  # [1] Voltage model: charge case parameter d
            self.voltage_charge_e = 0.00079  # [1] Voltage model: charge case parameter e
            self.voltage_charge_f = 3.17644  # [1] Voltage model: charge case parameter f
            self.voltage_discharge_a = -0.41009  # [1] Voltage model: discharge case parameter a
            self.voltage_discharge_b = 2.13015e-06  # [1] Voltage model: discharge case parameter b
            self.voltage_discharge_c = -0.00013  # [1] Voltage model: discharge case parameter c
            self.voltage_discharge_d = 0.69962  # [1] Voltage model: discharge case parameter d
            self.voltage_discharge_e = -0.00161  # [1] Voltage model: discharge case parameter e
            self.voltage_discharge_f = 3.03234  # [1] Voltage model: discharge case parameter f
            self.investment_costs_specific = 0.16  # [$/Wh] Battery specific investment costs

        # Integrate simulatable class for time indexing
        Simulatable.__init__(self)
        # Integrate environment class
        self.env = env
        # Integrate input power
        self.input_link = input_link
        # [s] Timestep
        self.timestep = timestep

        ##Basic parameters
        ##Power model
        # [Wh] Battery nominal capacity at nominal C-Rate
        self.capacity_nominal_wh = capacity_nominal_wh
        # [Wh] Current battery nominal capacity at nominal C-Rate
        self.capacity_current_wh = capacity_nominal_wh
        # Initialize initial paremeters
        self.state_of_charge = 0.8

        ## Temperature model
        # [kg] Mass of the battery
        self.mass = self.capacity_nominal_wh / self.energy_density_kg
        # [m^2] Battery area
        self.surface = self.capacity_nominal_wh / self.energy_density_m2
        # Initialize initial parameters
        self.temperature = 298.15
        self.power_loss = 0.

        ## Aging model
        # [Wh] End-of-Life condition of battery
        self.end_of_life_battery_wh = 0.8 * self.capacity_nominal_wh

        ## Economic model
        self.size_nominal = self.capacity_nominal_wh