Post-simulation Analysis

Module contents

This module runs the post-simulation cost calculations for DER assets and transformer aging. This module also estimates the voltage violations within the distribution network.

Submodules

analysis.cost_analysis module

This module contains the CostEstimator Class, which estimates the cost of the different grid and DER components from the simulation. This is used for the post-simulation cost calculations

class analysis.cost_analysis.CostEstimator(num_days)

Bases: object

This class is used to calculate levelized cost of DER assets in EV-Ecosim. The LCOE is the levelized cost of energy, which is defined as the estimated revenue or total net expenditure required to build and operate an energy system over a specified cost recovery period. The LCOE normalizes the entire system cost by the energy throughput to compare the economics energy devices that would otherwise be challenging to compare.

Parameters:

num_days – The number of days for which the calculation is run.

calculate_battery_cost(result_dir)

Calculates the battery costs and updates the different cost components, including LCOE.

Parameters:

result_dir – Directory in which to save the results dictionary.

Return dict result_dict:

Dictionary of results.

calculate_electricity_cost_PGEBEV2s(result_dir, PGE_separate_file=True)

Calculates the overall electricity PGEBEV2S cost for a given scenario.

Parameters:
  • result_dir (str) – Directory in which the result is saved.

  • PGE_separate_file

Return dict result_dict:

A dictionary comprising all the cost components and their dollar amounts.

calculate_solar_cost()

Values are pulled from the NREL solar cost calculator. Ref: https://www.nrel.gov/solar/market-research-analysis/solar-levelized-cost.html To be deprecated soon.

Returns:

None

calculate_trans_loss_of_life(result_dir)

Estimates the expected transformer loss of life. The transformer loss of life (or LOL) is modelled as a function of the hot-spot temperature.

Reference:

  • 5.11.3 of IEEE Std C57.12.00-2010 a minimum normal insulation life expectancy of 180 000 hours is expected.

Parameters:

result_dir – Directory in which the loss results is saved.

Returns:

Dictionary of transformer losses.

static plot_loads(total_load, net_load, prefix=None, labels: Optional[list] = None, total_load_color='blue', net_load_color='orange')

Creates plots overlaying load and net loads for post-simulation visualization.

Parameters:
  • total_load – Overall EV load demand at node_name, can include building load if controllable.

  • net_load – total_load minus DER buffer.

  • prefix – Plot file label prefix.

  • labels – Legend labels for each plotted curve.

  • total_load_color (str) – Color to plot total load.

  • net_load_color (str) – Color to plot net load.

Returns:

None.

static plot_power(power, power_pred, prefix=None, labels: Optional[list] = None)

Plots the controller predicted and true power of the battery system. This is used to compare the controller anticipated state of charge with the true state of charge.

Parameters:
  • power – True power.

  • power_pred – Controller predicted power.

  • prefix – Plot file label prefix.

  • labels – Legend labels for each plotted curve.

Returns:

None.

static plot_soc(soc, soc_pred, prefix=None, labels: Optional[list] = None)

Plots the controller predicted and true state of charge of the battery system. This is used to compare the controller anticipated state of charge with the true state of charge.

Parameters:
  • soc – True state of charge.

  • soc_pred – Controller predicted state of charge.

  • prefix – Plot file label prefix.

  • labels – Legend labels for each plotted curve.

Returns:

None.

solar_cost(result_dir)

Calculates the overall capital cost of the solar system. This will give the dollar cost of the solar system used for the charging station design problem.

Not fully implemented.

Parameters:

result_dir (str) – Location to save the result.

Returns:

Solar PV capital cost.

transformer_cost()

Cannot find good resource data for this yet.

analysis.load_post_opt_costs module

analysis.plot_results module

Overview

This module is used post-simulation to parse the voltages from the power-simulation to calculate the percentage voltage violations per ANSI C84.1. The file also generates voltage distribution plots. A user can modify the SIMULATION_FOLDER variable which is the string of the path where the powerflow simulation output voltages at each node_name exist.

analysis.plot_results.run()

This function is used to parse the voltages from the power-simulation to calculate the percentage voltage violations per ANSI C84.1. The file also generates voltage distribution plots. A user can modify the SIMULATION_FOLDER variable which is the string of the path where the powerflow simulation output voltages at each node_name exist. The function will iterate through all the folders in the SIMULATION_FOLDER and generate the plots for each folder. The plots will be saved in the same folder as the voltages.csv file.

Returns:

None