Solar PV Plant#
Both the PVPlant and DetailedPVPlant PV generator classes are based on PySAM’s PVWatts and PVSAM Models
PV Plant#
PV Plant Model#
- class hopp.simulation.technologies.pv.pv_plant.PVPlant(site, config)#
Bases:
PowerSourceRepresents a PV Plant.
- Parameters:
- config_name: str#
- property system_capacity_kw: float#
Gets the system capacity.
- property dc_degradation: float#
Annual DC degradation for lifetime simulations [%/year].
- property dc_ac_ratio: float#
DC to AC inverter loading ratio [ratio].
- property inv_eff: float#
DC to AC inverter efficiency [percent].
- property losses: float#
DC power losses [percent].
- property module_type: int#
standard, premium, thin film [0/1/2]
- Type:
Module type
- __init__(site, config)#
Method generated by attrs for class PVPlant.
- _get_model_dict()#
Convenience method that wraps the attrs.asdict method. Returns the object’s parameters as a dictionary.
- Returns:
dict – The provided or default, if no input provided, model settings as a dictionary.
- Return type:
dict
- property annual_energy_kwh: float#
Annual energy [kWh]
- as_dict()#
Creates a JSON and YAML friendly dictionary that can be save for future reloading. This dictionary will contain only Python types that can later be converted to their proper Turbine formats.
- Returns:
dict – All key, vaue pais required for class recreation.
- Return type:
dict
- assign(input_dict)#
Sets input variables in the PowerSource class or any of its subclasses (system or financial models)
- Parameters:
input_dict (dict)
- property benefit_cost_ratio: float#
Benefit cost ratio [-] = Benefits / Costs
Benefits include (using present values):
PPA, capacity payment, and curtailment revenues
Federal, state, utility, and other production-based incentive income
Salvage value
Costs: uses the present value of annual costs
- calc_capacity_credit_percent(interconnect_kw)#
Calculates the capacity credit (value) using the last simulated year’s max feasible generation profile.
- Parameters:
interconnect_kw (float) – Interconnection limit [kW]
- Returns:
capacity value [%]
- Return type:
float
- calc_gen_max_feasible_kwh(interconnect_kw)#
Calculates the maximum feasible generation profile that could have occurred (year 1)
- Parameters:
interconnect_kw (float) – Interconnection limit [kW]
- Returns:
maximum feasible generation [kWh]
- Return type:
list
- calc_nominal_capacity(interconnect_kw)#
Calculates the nominal AC net system capacity based on specific technology.
- Parameters:
interconnect_kw (float) – Interconnection limit [kW]
- Returns:
system’s nominal AC net capacity [kW]
- calculate_total_installed_cost(cost)#
- Parameters:
cost (float)
- Return type:
float
- property capacity_credit_percent: float#
Capacity credit (eligible portion of nameplate) [%]
- property capacity_payment: list#
Capacity payment revenue [$]
- property capacity_price: list#
Capacity payment price [$/MW]
- property construction_financing_cost: float#
- copy()#
- Returns:
new instance
- property cost_installed: float#
Net capital cost [$]
- property debt_payment: tuple#
Debt total payment [$]
- property degradation: tuple#
Annual energy degradation [%/year]
- property dispatch#
Dispatch object
- property dispatch_factors: tuple#
Time-series dispatch factors normalized by PPA price [-]
- property energy_purchases: tuple#
Energy purchases from grid [$]
- property energy_sales: tuple#
PPA revenue gross [$]
- property energy_value: tuple#
PPA revenue net [$]
- export()#
- Returns:
dictionary of variables for system and financial
- property federal_depreciation_total: tuple#
Total federal tax depreciation [$]
- property federal_taxes: tuple#
Federal tax benefit (liability) [$]
- property footprint_area#
Estimate Total Module Footprint Area [m^2]
- classmethod from_dict(data)#
Maps a data dictionary to an attr-defined class.
TODO: Add an error to ensure that either none or all the parameters are passed in
- Parameters:
data (dict) – dict The data dictionary to be mapped.
- Returns:
- cls
The attr-defined class.
- property gen_max_feasible: list#
Maximum feasible generation profile that could have occurred (year 1)
- property generation_profile: list#
System power generated [kW]
- classmethod get_model_defaults()#
Produces a dictionary of the keyword arguments and their defaults.
- Returns:
Dict[str, Any] – Dictionary of keyword argument: default.
- Return type:
Dict[str, Any]
- static import_financial_model(financial_model, system_model, config_name)#
- initialize_financial_values()#
These values are provided as default values from PySAM but should be customized by user
Debt, Reserve Account and Construction Financing Costs are initialized to 0 Federal Bonus Depreciation also initialized to 0
- property insurance_expense: tuple#
Insurance expense [$]
- property internal_rate_of_return: float#
Internal rate of return (after-tax) [%]
- property levelized_cost_of_energy_nominal: float#
Levelized cost (nominal) [cents/kWh]
- property levelized_cost_of_energy_real: float#
Levelized cost (real) [cents/kWh]
- property logger#
- property net_present_value: float#
After-tax cumulative NPV [$]
- property om_capacity#
Capacity-based O&M amount [$/kWcap]
- property om_capacity_expense#
O&M capacity-based expense [$]
- property om_fixed#
Fixed O&M annual amount [$/year]
- property om_fixed_expense#
O&M fixed expense [$]
- property om_production#
Production-based O&M amount [$/Mwh]
- property om_total_expense#
Total operating expenses [$]
- property om_variable#
Production-based O&M amount [$/kWh] For battery: production-based System Costs amount [$/kWh-discharged]
- Type:
For non-battery technologies
- property om_variable_expense#
O&M production-based expense [$]
- plot(figure=None, axes=None, color='b', site_border_color='k', site_alpha=0.95, linewidth=4.0)#
- property ppa_price: tuple#
PPA price [$/kWh]
- set_overnight_capital_cost(overnight_capital_cost)#
Set overnight capital costs [$/kW].
- setup_performance_model()#
Sets up performance model to before simulating power production. Required by specific technologies
- simulate(interconnect_kw, project_life=25, lifetime_sim=False)#
Run the system and financial model
- Parameters:
project_life (int) –
int, Number of year in the analysis period (execepted project lifetime) [years]lifetime_sim –
bool, For simulation modules which support simulating each year of the project_life, whether or not to do so; otherwise the first year data is repeatedinterconnect_kw (float)
- simulate_financials(interconnect_kw, project_life)#
Runs the finanical model for individual sub-systems
- Parameters:
interconnect_kw (float) –
float, Hybrid interconnect limit [kW]project_life (int) –
int, Number of year in the analysis period (execepted project lifetime) [years]
- Returns:
- simulate_power(project_life, lifetime_sim=False)#
Runs the system models for individual sub-systems
- Parameters:
project_life –
int, Number of year in the analysis period (execepted project lifetime) [years]lifetime_sim –
bool, For simulation modules which support simulating each year of the project_life, whether or not to do so; otherwise the first year data is repeated
- Returns:
- property system_nameplate_mw: float#
System nameplate [MW]
- property tax_incentives: list#
The sum of Federal and State PTC and ITC tax incentives [$]
- property total_installed_cost: float#
Installed cost [$]
- property total_revenue: list#
Total revenue [$]
- value(var_name, var_value=None)#
Gets or Sets a variable value within either the system or financial PySAM models. Method looks in system model first. If unsuccessful, then it looks in the financial model.
Note
If system and financial models contain a variable with the same name, only the system model variable will be set.
value(var_name)Gets variable valuevalue(var_name, var_value)Sets variable value- Parameters:
var_name (str) – PySAM variable name
var_value – (optional) PySAM variable value
- Returns:
Variable value (when getter)
- property system_mass#
Estimate Total Module Mass [kg]
- property capacity_factor: float#
System capacity factor [%]
- property capacity_factor_ac: float#
System capacity factor [%]
- property capacity_factor_dc: float#
System capacity factor [%]
- property panel_tilt_angle#
Tilt angle
PV Plant Configurations#
- class hopp.simulation.technologies.pv.pv_plant.PVConfig(system_capacity_kw, use_pvwatts=True, dc_ac_ratio=1.3, inv_eff=96.0, losses=14.08, layout_params=None, layout_model=None, fin_model=None, dc_degradation=None, approx_nominal_efficiency=0.19, panel_system_design=None, panel_tilt_angle='lat-func', module_unit_mass=11.092, name='PVPlant')#
Bases:
BaseClassConfiguration class for PVPlant.
- Parameters:
system_capacity_kw (float) – Design system capacity
use_pvwatts (bool) – Whether to use PVWatts (defaults to True). If False, this config should be used in a DetailedPVPlant
dc_ac_ratio (float) – Also known as inverter loading ratio; ratio of max DC output of PV to max AC output of inverter, should be slightly above one (max 1.5) for optimal economics
inv_eff (float) – Inverter efficiency in percent; linear power conversion loss from DC to AC
losses (float) – Any “other” linear power losses in percent, broken down into categories in the GUI version of SAM.
layout_params (dict | PVGridParameters | None) – Optional layout parameters
layout_model (dict | PVLayout | None) – Optional layout model instance
fin_model (str | dict | Singleowner | CustomFinancialModel | None) –
Financial model. Can be any of the following:
a string representing an argument to Singleowner.default
a dict representing a CustomFinancialModel
an object representing a CustomFinancialModel or Singleowner.Singleowner instance
dc_degradation (List[float] | None) – Annual DC degradation for lifetime simulations [%/year]
approx_nominal_efficiency (float | None) – approx nominal efficiency depends on module type (standard crystalline silicon 19%, premium 21%, thin film 18%) [decimal]
panel_system_design (Optional[dict]) – Optional dictionary for specifying the design characteristics of the panel system. Design characteristics include:
panel_tilt_angle (Optional[Union[str, float]]) – Panel tilt angle, which can be a fixed angle in degrees and set as a float or set by the str “lat” to match the latitude of the site or “lat-func” which calculates the optimal tilt angle based on the latitude.
module_unit_mass (float | None) – Mass of the individual module unit (default to 11.092). [kg/m2]
name (str)
- system_capacity_kw: float#
- use_pvwatts: bool#
- dc_ac_ratio: float#
- inv_eff: float#
- losses: float#
- layout_params: dict | PVGridParameters | None#
- layout_model: dict | PVLayout | None#
- fin_model: str | dict | Singleowner | CustomFinancialModel | None#
- dc_degradation: List[float] | None#
- approx_nominal_efficiency: float | None#
- panel_system_design: dict | None#
- panel_tilt_angle: str | float | None#
- module_unit_mass: float | None#
- name: str#
- __init__(system_capacity_kw, use_pvwatts=True, dc_ac_ratio=1.3, inv_eff=96.0, losses=14.08, layout_params=None, layout_model=None, fin_model=None, dc_degradation=None, approx_nominal_efficiency=0.19, panel_system_design=None, panel_tilt_angle='lat-func', module_unit_mass=11.092, name='PVPlant')#
Method generated by attrs for class PVConfig.
- Parameters:
system_capacity_kw (float)
use_pvwatts (bool)
dc_ac_ratio (float)
inv_eff (float)
losses (float)
layout_params (dict | PVGridParameters | None)
layout_model (dict | PVLayout | None)
fin_model (str | dict | Singleowner | CustomFinancialModel | None)
dc_degradation (List[float] | None)
approx_nominal_efficiency (float | None)
panel_system_design (dict | None)
panel_tilt_angle (str | float | None)
module_unit_mass (float | None)
name (str)
- Return type:
None
- _get_model_dict()#
Convenience method that wraps the attrs.asdict method. Returns the object’s parameters as a dictionary.
- Returns:
dict – The provided or default, if no input provided, model settings as a dictionary.
- Return type:
dict
- as_dict()#
Creates a JSON and YAML friendly dictionary that can be save for future reloading. This dictionary will contain only Python types that can later be converted to their proper Turbine formats.
- Returns:
dict – All key, vaue pais required for class recreation.
- Return type:
dict
- classmethod from_dict(data)#
Maps a data dictionary to an attr-defined class.
TODO: Add an error to ensure that either none or all the parameters are passed in
- Parameters:
data (dict) – dict The data dictionary to be mapped.
- Returns:
- cls
The attr-defined class.
- classmethod get_model_defaults()#
Produces a dictionary of the keyword arguments and their defaults.
- Returns:
Dict[str, Any] – Dictionary of keyword argument: default.
- Return type:
Dict[str, Any]
- property logger#
Detailed PV Plant#
The DetailedPVPlant allows for a more detailed configuration than the base PV plant described above.
Detailed PV Plant Model#
- class hopp.simulation.technologies.pv.detailed_pv_plant.DetailedPVPlant(site, config)#
Bases:
PowerSourceA detailed PV Plant, typically using Pvsam.
- Parameters:
site (SiteInfo) – The site information.
config (DetailedPVConfig) – Configuration dictionary representing a DetailedPVConfig.
- config: DetailedPVConfig#
- config_name: str#
- processed_assign()#
Assign attributes from dictionaries with additional processing to enforce coherence between attributes.
- get_pv_module(only_ref_vals=True)#
Returns the PV module attributes for either the PVsamv1 or PVWattsv8 models.
- Parameters:
only_ref_vals (bool) – returns only the reference values (e.g., I_sc_ref) if True or model params if False
- Returns:
dict – PV module attributes
- Return type:
dict
- set_pv_module(params)#
Sets the PV module model parameters for either the PVsamv1 or PVWattsv8 models.
- Parameters:
params (dict) – dictionary of parameters
- get_inverter(only_ref_vals=True)#
Returns the inverter attributes for either the PVsamv1 or PVWattsv8 models.
- Parameters:
only_ref_vals (bool) – optional, returns only the reference values (e.g., V_dc_max) if True or model params if False
- Returns:
dict – inverter attributes
- Return type:
dict
- set_inverter(params)#
Sets the inverter model parameters for either the PVsamv1 or PVWattsv8 models.
- Parameters:
params (dict) – dictionary of parameters
- property system_capacity: float#
Pass through to established name property.
- property system_capacity_kw: float#
System’s nameplate capacity [kW]
- property dc_degradation: float#
Annual DC degradation for lifetime simulations [%/year]
- property dc_ac_ratio: float#
- property module_power: float#
Module power in kW.
- property module_width: float#
Module width in meters.
- property module_length: float#
Module length in meters.
- property module_height: float#
Module height in meters.
- property inverter_power: float#
Inverter power in kW.
- __init__(site, config)#
Method generated by attrs for class DetailedPVPlant.
- Parameters:
site (SiteInfo)
config (DetailedPVConfig)
- Return type:
None
- _get_model_dict()#
Convenience method that wraps the attrs.asdict method. Returns the object’s parameters as a dictionary.
- Returns:
dict – The provided or default, if no input provided, model settings as a dictionary.
- Return type:
dict
- property annual_energy_kwh: float#
Annual energy [kWh]
- as_dict()#
Creates a JSON and YAML friendly dictionary that can be save for future reloading. This dictionary will contain only Python types that can later be converted to their proper Turbine formats.
- Returns:
dict – All key, vaue pais required for class recreation.
- Return type:
dict
- assign(input_dict)#
Sets input variables in the PowerSource class or any of its subclasses (system or financial models)
- Parameters:
input_dict (dict)
- property benefit_cost_ratio: float#
Benefit cost ratio [-] = Benefits / Costs
Benefits include (using present values):
PPA, capacity payment, and curtailment revenues
Federal, state, utility, and other production-based incentive income
Salvage value
Costs: uses the present value of annual costs
- calc_capacity_credit_percent(interconnect_kw)#
Calculates the capacity credit (value) using the last simulated year’s max feasible generation profile.
- Parameters:
interconnect_kw (float) – Interconnection limit [kW]
- Returns:
capacity value [%]
- Return type:
float
- calc_gen_max_feasible_kwh(interconnect_kw)#
Calculates the maximum feasible generation profile that could have occurred (year 1)
- Parameters:
interconnect_kw (float) – Interconnection limit [kW]
- Returns:
maximum feasible generation [kWh]
- Return type:
list
- calc_nominal_capacity(interconnect_kw)#
Calculates the nominal AC net system capacity based on specific technology.
- Parameters:
interconnect_kw (float) – Interconnection limit [kW]
- Returns:
system’s nominal AC net capacity [kW]
- calculate_total_installed_cost(cost)#
- Parameters:
cost (float)
- Return type:
float
- property capacity_credit_percent: float#
Capacity credit (eligible portion of nameplate) [%]
- property capacity_factor: float#
System capacity factor [%]
- property capacity_payment: list#
Capacity payment revenue [$]
- property capacity_price: list#
Capacity payment price [$/MW]
- property construction_financing_cost: float#
- copy()#
- Returns:
new instance
- property cost_installed: float#
Net capital cost [$]
- property debt_payment: tuple#
Debt total payment [$]
- property degradation: tuple#
Annual energy degradation [%/year]
- property dispatch#
Dispatch object
- property dispatch_factors: tuple#
Time-series dispatch factors normalized by PPA price [-]
- property energy_purchases: tuple#
Energy purchases from grid [$]
- property energy_sales: tuple#
PPA revenue gross [$]
- property energy_value: tuple#
PPA revenue net [$]
- export()#
- Returns:
dictionary of variables for system and financial
- property federal_depreciation_total: tuple#
Total federal tax depreciation [$]
- property federal_taxes: tuple#
Federal tax benefit (liability) [$]
- classmethod from_dict(data)#
Maps a data dictionary to an attr-defined class.
TODO: Add an error to ensure that either none or all the parameters are passed in
- Parameters:
data (dict) – dict The data dictionary to be mapped.
- Returns:
- cls
The attr-defined class.
- property gen_max_feasible: list#
Maximum feasible generation profile that could have occurred (year 1)
- property generation_profile: list#
System power generated [kW]
- classmethod get_model_defaults()#
Produces a dictionary of the keyword arguments and their defaults.
- Returns:
Dict[str, Any] – Dictionary of keyword argument: default.
- Return type:
Dict[str, Any]
- static import_financial_model(financial_model, system_model, config_name)#
- initialize_financial_values()#
These values are provided as default values from PySAM but should be customized by user
Debt, Reserve Account and Construction Financing Costs are initialized to 0 Federal Bonus Depreciation also initialized to 0
- property insurance_expense: tuple#
Insurance expense [$]
- property internal_rate_of_return: float#
Internal rate of return (after-tax) [%]
- property levelized_cost_of_energy_nominal: float#
Levelized cost (nominal) [cents/kWh]
- property levelized_cost_of_energy_real: float#
Levelized cost (real) [cents/kWh]
- property logger#
- property modules_per_string: float#
Modules per string.
- property net_present_value: float#
After-tax cumulative NPV [$]
- property om_capacity#
Capacity-based O&M amount [$/kWcap]
- property om_capacity_expense#
O&M capacity-based expense [$]
- property om_fixed#
Fixed O&M annual amount [$/year]
- property om_fixed_expense#
O&M fixed expense [$]
- property om_production#
Production-based O&M amount [$/Mwh]
- property om_total_expense#
Total operating expenses [$]
- property om_variable#
Production-based O&M amount [$/kWh] For battery: production-based System Costs amount [$/kWh-discharged]
- Type:
For non-battery technologies
- property om_variable_expense#
O&M production-based expense [$]
- plot(figure=None, axes=None, color='b', site_border_color='k', site_alpha=0.95, linewidth=4.0)#
- property ppa_price: tuple#
PPA price [$/kWh]
- set_overnight_capital_cost(overnight_capital_cost)#
Set overnight capital costs [$/kW].
- setup_performance_model()#
Sets up performance model to before simulating power production. Required by specific technologies
- simulate(interconnect_kw, project_life=25, lifetime_sim=False)#
Run the system and financial model
- Parameters:
project_life (int) –
int, Number of year in the analysis period (execepted project lifetime) [years]lifetime_sim –
bool, For simulation modules which support simulating each year of the project_life, whether or not to do so; otherwise the first year data is repeatedinterconnect_kw (float)
- simulate_financials(interconnect_kw, project_life)#
Runs the finanical model for individual sub-systems
- Parameters:
interconnect_kw (float) –
float, Hybrid interconnect limit [kW]project_life (int) –
int, Number of year in the analysis period (execepted project lifetime) [years]
- Returns:
- simulate_power(project_life, lifetime_sim=False)#
Runs the system models for individual sub-systems
- Parameters:
project_life –
int, Number of year in the analysis period (execepted project lifetime) [years]lifetime_sim –
bool, For simulation modules which support simulating each year of the project_life, whether or not to do so; otherwise the first year data is repeated
- Returns:
- property system_nameplate_mw: float#
System nameplate [MW]
- property tax_incentives: list#
The sum of Federal and State PTC and ITC tax incentives [$]
- property total_installed_cost: float#
Installed cost [$]
- property total_revenue: list#
Total revenue [$]
- value(var_name, var_value=None)#
Gets or Sets a variable value within either the system or financial PySAM models. Method looks in system model first. If unsuccessful, then it looks in the financial model.
Note
If system and financial models contain a variable with the same name, only the system model variable will be set.
value(var_name)Gets variable valuevalue(var_name, var_value)Sets variable value- Parameters:
var_name (str) – PySAM variable name
var_value – (optional) PySAM variable value
- Returns:
Variable value (when getter)
- property subarray1_modules_per_string: float#
Number of modules per string in subarray 1.
- property n_strings: float#
Total number of strings.
- property subarray1_nstrings: float#
Number of strings in subarray 1.
- property n_inverters: float#
Total number of inverters.
Detailed PV Plant Configuration#
- class hopp.simulation.technologies.pv.detailed_pv_plant.DetailedPVConfig(system_capacity_kw=None, tech_config=None, use_pvwatts=True, layout_params=None, layout_model=None, fin_model=None, dc_degradation=None, name='DetailedPVPlant')#
Bases:
BaseClassConfiguration class for DetailedPVPlant.
Converts nested dicts into relevant instances for layout and financial configurations.
- Parameters:
system_capacity_kw (float | None) – Design system capacity
use_pvwatts (bool) – Whether to use PVWatts (defaults to True). If False, this config should be used in a DetailedPVPlant.
layout_params (dict | PVGridParameters | None) – Optional layout parameters
layout_model (dict | PVLayout | None) – Optional layout model instance
fin_model (str | dict | Singleowner | CustomFinancialModel | None) –
Optional financial model. Can be any of the following:
a string representing an argument to Singleowner.default
a dict representing a CustomFinancialModel
an object representing a CustomFinancialModel or Singleowner.Singleowner instance
tech_config (dict | None) – Optional dict with more detailed system configuration
dc_degradation (List[float] | None) – Annual DC degradation for lifetime simulations [%/year]
name (str)
- system_capacity_kw: float | None#
- tech_config: dict | None#
- use_pvwatts: bool#
- layout_params: dict | PVGridParameters | None#
- layout_model: dict | PVLayout | None#
- fin_model: str | dict | Singleowner | CustomFinancialModel | None#
- dc_degradation: List[float] | None#
- name: str#
- __init__(system_capacity_kw=None, tech_config=None, use_pvwatts=True, layout_params=None, layout_model=None, fin_model=None, dc_degradation=None, name='DetailedPVPlant')#
Method generated by attrs for class DetailedPVConfig.
- Parameters:
system_capacity_kw (float | None)
tech_config (dict | None)
use_pvwatts (bool)
layout_params (dict | PVGridParameters | None)
layout_model (dict | PVLayout | None)
fin_model (str | dict | Singleowner | CustomFinancialModel | None)
dc_degradation (List[float] | None)
name (str)
- Return type:
None
- _get_model_dict()#
Convenience method that wraps the attrs.asdict method. Returns the object’s parameters as a dictionary.
- Returns:
dict – The provided or default, if no input provided, model settings as a dictionary.
- Return type:
dict
- as_dict()#
Creates a JSON and YAML friendly dictionary that can be save for future reloading. This dictionary will contain only Python types that can later be converted to their proper Turbine formats.
- Returns:
dict – All key, vaue pais required for class recreation.
- Return type:
dict
- classmethod from_dict(data)#
Maps a data dictionary to an attr-defined class.
TODO: Add an error to ensure that either none or all the parameters are passed in
- Parameters:
data (dict) – dict The data dictionary to be mapped.
- Returns:
- cls
The attr-defined class.
- classmethod get_model_defaults()#
Produces a dictionary of the keyword arguments and their defaults.
- Returns:
Dict[str, Any] – Dictionary of keyword argument: default.
- Return type:
Dict[str, Any]
- property logger#