Simulation

class SimulatedCogenerationUnit(device_id, env)[source]

The simulation of a cogeneration unit

calculate_new_workload()[source]

Selects right operating mode for workload calculation

consume_and_produce_energy()[source]

Updates currently consumed and produced energy

get_calculated_workload_electric()[source]

Returns workload for electrical driven mode

get_calculated_workload_thermal()[source]

Returns workload for thermal driven mode

get_efficiency_loss_factor()[source]

Computes efficiency loss on modulation and returns left efficiency in percent [0,1]

get_electrical_energy_production()[source]

Returns produced electrical energy in kWh during current time-step

get_thermal_energy_production()[source]

Returns produced thermal energy in kWh during current time-step

off_time = None

Saves the last powered off time to ensure minimal_off_time

overwrite_workload = None

Efficiency is reached only on maximum workload at minumum workload the efficiency is decreased by 15 %

set_workload(calculated_workload)[source]

Sets given workload, detects power-ons and tracks operating time

Parameters:calculated_workload (float) – new workload for the next time-step
step()[source]

Calculates new workload, produce and consume energy for the last time-step

class SimulatedPeakLoadBoiler(device_id, env)[source]

The simulation of a peak load boiler

calculate_workload()[source]

Switches on when the heat storage is undersupplied and off if target temperature is reached. Also detects power-ons and tracks operating time.

consume_and_produce_energy()[source]

Updates currently consumed and produced energy

get_thermal_energy_production()[source]

Returns produced thermal energy in kWh during current time-step

off_time = None

Saves the last power off time to ensure 3 min off-time

overwrite_workload = None

Device can have fixed workload without internal control. Be aware of overheating!

step()[source]

Calculates new workload, produce and consume energy for the last time-step

class SimulatedThermalConsumer(device_id, env)[source]

The simulation of the thermal consume (heating and warm water) of a house

Usied formulas from http://www.model.in.tum.de/um/research/groups/ai/fki-berichte/postscript/fki-227-98.pdf and http://www.inference.phy.cam.ac.uk/is/papers/DanThermalModellingBuildings.pdf

calculate()[source]

Update the heating parameters when a house parameter is changed. Therefore some assumptions are made

get_consumption_energy()[source]

Returns consumed thermal energy for heating in kWh during current time-step

get_outside_temperature()[source]

The thermal energy demand depends on the outside temperature. For the current simulated time (self.env.now) the outside temperature is returned.

get_warmwater_consumption_energy()[source]

Returns needed thermal energy for warm water in kWh during current time-step

get_warmwater_consumption_power()[source]

The energy needed for warm water is calculated by the amount of needed liters in average. For the time step the power is calculated which could heat the needed water of all residents to the given temperature (40 degrees Celsius default).

heat_apartments()[source]

Increases the rooms temperature. With the current heating power an amount of energy for the current time-step is produced. This energy and the specific heat capacity of air (1000 J/(m^3 * K)) is needed for the temperature calculation.

heat_loss_power()[source]

Returns the power in kW by with the house loses thermal energy at outer walls and windows. The outside temperature is needed for the temperature difference.

simulate_consumption()[source]

Determine the heating power of the whole house considerung the rooms target temperature.

step()[source]

Simulate the heating and consume according energy

class SimulatedElectricalConsumer(device_id, env)[source]

The simulation of the electrical consume of a house based on forecasting.

get_consumption_energy()[source]

Returns needed electrical energy in kWh during current time-step

get_consumption_power()[source]

Use the forecast to determine the current power demand

step()[source]

Calculate the current power and consume according energy for current time-step.

class SimulatedHeatStorage(device_id, env)[source]

The simulation of a heat storage

add_energy(energy)[source]

Store energy in the heat storage.

Parameters:energy (float) – in kWh
consume_energy(energy)[source]

Use energy from the heat storage

Parameters:energy (float) – in kWh
empty_count = None

count the steps when mimium temperature is undershot

energy_stored()[source]

Currently available energy in kWh

get_energy_capacity()[source]

Returns the maximal storable amount of energy in kWh

get_required_energy()[source]

Necessary energy in kWh to reach the target temperature.

get_target_energy()[source]

Returns the overall energy needed for reaching the target temperature when the water is cold (base temperature)

get_temperature()[source]

Returns the average temperature of the heat storage

set_temperature(temperature)[source]

When the simulation is initialized to a real system the temperature of the real heat storage must be set

step()[source]

Loose some energy according to isolation

temperature_loss = None

temperature loss per day by default 3 degress Celsius

undersupplied()[source]

Returns True if the minimal temperature is undershot.

class SimulatedPowerMeter(device_id, env)[source]

The simulation of a power meter

add_energy(energy)[source]

Devices should use this method to supply electrical energy.

Parameters:energy (float) – in kWh
consume_energy(energy)[source]

Devices should use this method to consume electrical energy.

Parameters:energy (float) – in kWh
step()[source]

Purchase electrical energy if more energy needed than produced. Otherwise the remaining energy is fed in.