5. The Actors

The following section describes the Actor include in Gridsim.

It consists into four actors :

The class gridsim.cyberphysical.element.Actor represents a virtual device that can be connected to an gridsim.cyberphysical.element.AbstractCyberPhysicalSystem to communicate with the real world.

5.1. The battery model

Module author: Yann Maret <yann.maret@hevs.ch>

Code author: Yann Maret <yann.maret@hevs.ch>

class gridsim.cyberphysical.actor.battery.Battery(self, friendly_name, start_energy, max_energy, power, read_params, write_params)

This Actor simulates the behavior of a battery. The charge and discharge is considered equal. The battery reach a max energy when the battery is full and the empty state when the battery is low.

Note

On consumption, the power is considered positive. On injection, the power is considered negative.

Parameters:
  • friendly_name – friendly name for the gridsim.core.AbstractSimulationElement
  • start_energy – amount of energy to start with
  • max_energy – max energy of the battery, the battery will stop storing
  • power – power rate for the storage and discharge
  • read_params – read parameter for the actor
  • write_params – write parameter for the actor
reset()
update(*args, **keywords)
calculate(*args, **keywords)
notify_read_param(*args, **keywords)
get_value(*args, **keywords)
cyberphysical_module_end()

5.2. The domestic hot water model

Module author: Michael Clausen <clm@hevs.ch>

Code author: Michael Clausen <clm@hevs.ch>

Code author: Gillian Basso <gillian.basso@hevs.ch>

Code author: Yann Maret <yann.maret@hevs.ch>

class gridsim.cyberphysical.actor.domestichotwater.BoilerMaterial

Implementation of steel:

  • Thermal capacity: unknown (None)
  • Weight: unknown (None)
  • Thermal conductivity 0.04 W/Km
class gridsim.cyberphysical.actor.domestichotwater.Boiler(*args, **keywords)
Parameters:
  • friendly_name (str, unicode) – Friendly name to give to the process.
  • height (units.metre) – the height of the boiler
  • radius (units.metre) – the radius of the boiler
  • thickness (units.metre) – the thickness of the boiler
  • initial_temperature (units.kelvin) – the initial temperature of the water in the boiler.
  • heat_transfer_coeff (units.watt/(units.kelvin*(units.meter**2)) – the heat transfer coefficient
  • power (units.watt) – the electrical power to heat the boiler
  • temperature_in (units.kelvin) – the temperature of the input water
  • time_series (class:gridsim.timeseries.TimeSeries) – the time_series to load the stream
  • readparamlist – read parameter of the actor
  • writeparamlist – write parameter of the actor
  • time_converter (types.FunctionType or None) –
Returns:

temperature

The water temperature is consider as uniform in the tank.

on

The on parameter allows to turn on or off the boiler. If on is True the boiler is running (maintains the boiler temperature between hysteresis), otherwise the boiler is shutdown (and cannot heat the water).

power

The electrical power of the boiler power if heating, otherwise 0.

reset(self)

Sets the time to default (0).

calculate(*args, **keywords)
notify_read_param(*args, **keywords)
get_value(*args, **keywords)
cyberphysical_module_end()

5.3. The space heating model

Module author: Michael Clausen <clm@hevs.ch>

Code author: Michael Clausen <clm@hevs.ch>

Code author: Gillian Basso <gillian.basso@hevs.ch>

Code author: Yann Maret <yann.maret@hevs.ch>

class gridsim.cyberphysical.actor.spaceheating.ElectroThermalHeaterCooler(self, friendly_name, pwr, efficiency_factor, thermal_process, readparamlist, writeparamlist)

This Actor can either heat of cool a gridsim.thermal.core.ThermalProcess.

Parameters:
  • friendly_name – friendly name for the AbstractElectricalCPSElement
  • pwr – power of the heater/cooler system
  • efficiency_factor – efficiency factor of the system
  • thermal_process – thermal process of the system
  • read_params – read parameter of the actor
  • write_params – write parameter of the actor
on

The on parameter allows to turn on or off the system. If on is True the system is running (change temperature of the gridsim.thermal.core.ThermalProcess), otherwise the system is shutdown (and do not influence the gridsim.thermal.core.ThermalProcess).

reset()
calculate(time, delta_time)
update(time, delta_time)
notify_read_param(*args, **keywords)
get_value(*args, **keywords)
cyberphysical_module_end()

5.4. A file reader model

Module author: Yann Maret <yann.maret@hevs.ch>

Code author: Yann Maret <yann.maret@hevs.ch>

class gridsim.cyberphysical.actor.pqfilereader.PQFileReader(self, friendly_name, infile, outfile, read_params, write_params)

Initialize the PQFileReader Actor with the read_params and write_params dependency list. Data are read from infile, and get to the simulation on getValue function call.

Parameters:
  • friendly_name – Element name id
  • in_file_name – csv file to read value from (P,Q)
  • out_file_name – log the data out
  • read_params – Read param to register on
  • write_params – Write param to register on
initFile(self)

Initialize the File to read data from, and prepare the output file.

reset()
update(time, delta_time)
calculate(time, delta_time)
cyberphysical_read_end()
notify_read_param(*args, **keywords)
get_value(*args, **keywords)
cyberphysical_module_end()