Analysis

acnportal.acnsim.analysis.aggregate_current(sim)

Calculate the time series of aggregate current of all EVSEs within a simulation.

Parameters:sim (Simulator) – A Simulator object which has been run.
Returns:A numpy ndarray of the aggregate current at each time. [A]
Return type:np.Array
acnportal.acnsim.analysis.aggregate_power(sim)

Calculate the time series of aggregate power of all EVSEs within a simulation.

Parameters:sim (Simulator) – A Simulator object which has been run.
Returns:A numpy ndarray of the aggregate power at each time. [kW]
Return type:np.Array
acnportal.acnsim.analysis.constraint_currents(sim, return_magnitudes=False, constraint_ids=None)

Calculate the time series of current for each constraint in the ChargingNetwork for a simulation.

Parameters:
  • sim (Simulator) – A Simulator object which has been run.
  • return_magnitudes (bool) – If true, return constraint currents as real magnitudes instead of complex numbers.
  • constraint_ids (List[str]) – List of constraint names for which the current should be returned. If None, return all constraint currents.
Returns:

A dictionary mapping the name of a constraint to a numpy array of the current subject to

that constraint at each time.

Return type:

Dict (str, np.Array)

acnportal.acnsim.analysis.current_unbalance(sim, phase_ids, unbalance_type='NEMA', type=None)

Calculate the current unbalance for each time in simulation.

Supports two definitions of unbalance. 1) The NEMA definition defined as the ratio of the maximum deviation of an RMS current from the average RMS current

over the average RMS current.
(max(|I_a|, |I_b|, |I_c|) - 1/3 (|I_a| + |I_b| + |I_c|)) / (1/3 (|I_a| + |I_b| + |I_c|))

See https://www.powerstandards.com/Download/Brief%20Discussion%20of%20Unbalance%20Definitions.pdf for more info.

Parameters:
  • sim (Simulator) – A Simulator object which has been run.
  • phase_ids (List[str]) – List of length 3 where each element is the identifier of phase A, B, and C respectively.
  • unbalance_type (str) – Method to use for calculating phase unbalance. Acceptable values are ‘NEMA’.
Returns:

Time series of current unbalance as a list with one value per timestep.

Return type:

List[float]

acnportal.acnsim.analysis.datetimes_array(sim)

Return a numpy array of datetimes over which the simulation was run.

The resolution of the datetimes list is equal to the period of the simulation, and the number of datetimes in the returned list is equal to teh number of iterations of the simulation.

Parameters:sim (Simulator) – A Simulator object which has been run.
Returns:
List of datetimes over which the
simulation was run.
Return type:np.ndarray[np.datetime64]
Warns:UserWarning – If this is called before sim is complete.
acnportal.acnsim.analysis.demand_charge(sim, tariff=None)

Calculate the total demand charge of the simulation.

Note this is only an accurate depiction of true demand charge if the simulation is exactly one billing period long.

Parameters:
  • sim (Simulator) – A Simulator object which has been run.
  • tariff (TimeOfUseTariff) – Tariff structure to use when calculating energy costs.
Returns:

Total demand charge incurred by the simulation ($)

Return type:

float

acnportal.acnsim.analysis.energy_cost(sim, tariff=None)

Calculate the total energy cost of the simulation.

Parameters:
  • sim (Simulator) – A Simulator object which has been run.
  • tariff (TimeOfUseTariff) – Tariff structure to use when calculating energy costs.
Returns:

Total energy cost of the simulation ($)

Return type:

float

acnportal.acnsim.analysis.proportion_of_demands_met(sim, threshold=0.1)

Calculate the percentage of charging sessions where the energy request was met.

Parameters:
  • sim (Simulator) – A Simulator object which has been run.
  • threshold (float) – Close to finished a session should be to be considered finished. Default: 0.1. [kW]
Returns:

Proportion of sessions where the energy demand was fully met.

Return type:

float

acnportal.acnsim.analysis.proportion_of_energy_delivered(sim)

Calculate the percentage of total energy delivered over total energy requested.

Parameters:sim (Simulator) – A Simulator object which has been run.
Returns:Proportion of total energy requested which was delivered during the simulation.
Return type:float