Skip to content

Commit

Permalink
Merge branch 'develop' into pv-batt-compare-cases-macro
Browse files Browse the repository at this point in the history
  • Loading branch information
mjprilliman committed Oct 14, 2024
2 parents 83854ba + 09cc24a commit 0fd33b6
Show file tree
Hide file tree
Showing 478 changed files with 6,909 additions and 3,537 deletions.
550 changes: 408 additions & 142 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

51 changes: 35 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,21 +224,23 @@ endif()
if (${CMAKE_PROJECT_NAME} STREQUAL system_advisor_model)
target_link_libraries(${SAM_EXE} lk wex ssc)
else()
unset(WEX_LIB CACHE)
unset(LK_LIB CACHE)
unset(SSC_LIB CACHE)
find_library( WEX_LIB
NAMES wex.a wex.lib
PATHS $ENV{WEX_LIB} $ENV{WEXDIR}/build $ENV{WEXDIR}/build/Release)
find_library( LK_LIB
NAMES lk.a lk.lib
PATHS $ENV{LK_LIB} $ENV{LKDIR}/build $ENV{LKDIR}/build/Release)
find_library( SSC_LIB
NAMES ssc.dylib ssc.lib ssc.so
PATHS $ENV{SSC_LIB} $ENV{SSCDIR}/build/ssc $ENV{SSCDIR}/build/ssc/Release)
target_link_libraries(${SAM_EXE} optimized ${WEX_LIB} optimized ${SSC_LIB} optimized ${LK_LIB})

if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR MSVC)
if (CMAKE_BUILD_TYPE STREQUAL "Release" OR "Release" IN_LIST CMAKE_CONFIGURATION_TYPES)
unset(WEX_LIB CACHE)
unset(LK_LIB CACHE)
unset(SSC_LIB CACHE)
find_library( WEX_LIB
NAMES wex.a wex.lib
PATHS $ENV{WEX_LIB} $ENV{WEXDIR}/build $ENV{WEXDIR}/build/Release)
find_library( LK_LIB
NAMES lk.a lk.lib
PATHS $ENV{LK_LIB} $ENV{LKDIR}/build $ENV{LKDIR}/build/Release)
find_library( SSC_LIB
NAMES ssc.dylib ssc.lib ssc.so
PATHS $ENV{SSC_LIB} $ENV{SSCDIR}/build/ssc $ENV{SSCDIR}/build/ssc/Release)
target_link_libraries(${SAM_EXE} optimized ${WEX_LIB} optimized ${SSC_LIB} optimized ${LK_LIB})
endif()

if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR "Debug" IN_LIST CMAKE_CONFIGURATION_TYPES)
unset(LKD_LIB CACHE)
unset(WEXD_LIB CACHE)
unset(SSCD_LIB CACHE)
Expand All @@ -249,10 +251,27 @@ else()
NAMES lkd.a lkd.lib
PATHS $ENV{LKD_LIB} $ENV{LKDIR}/build $ENV{LKDIR}/build/Debug)
find_library( SSCD_LIB
NAMES sscd.dylib sscd.lib sscd.so
NAMES sscd.dylib sscd.lib sscd.so libssc.so
PATHS $ENV{SSCD_LIB} $ENV{SSCDIR}/build/ssc $ENV{SSCDIR}/build/ssc/Debug)
target_link_libraries(${SAM_EXE} debug ${SSCD_LIB} debug ${WEXD_LIB} debug ${LKD_LIB})
endif()

if (MSVC)
if ("Release" IN_LIST CMAKE_CONFIGURATION_TYPES)
unset(SHARED_LIB CACHE)
find_library( SHARED_LIB
NAMES shared.lib
PATHS $ENV{SSCDIR}/build/shared/Release)
target_link_libraries(${SAM_EXE} optimized ${SHARED_LIB})
endif()
if ("Debug" IN_LIST CMAKE_CONFIGURATION_TYPES)
unset(SHAREDD_LIB CACHE)
find_library( SHAREDD_LIB
NAMES sharedd.lib
PATHS $ENV{SSCDIR}/build/shared/Debug)
target_link_libraries(${SAM_EXE} debug ${SHAREDD_LIB})
endif()
endif()
endif()

target_link_libraries(${SAM_EXE} ${wxWidgets_LIBRARIES})
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# System Advisor Model (SAM)
![Build](https://github.com/NREL/SAM/actions/workflows/ci.yml/badge.svg)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FNREL%2FSAM.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FNREL%2FSAM?ref=badge_shield)

The SAM Open Source Project repository contains the source code, tools, and instructions to build a desktop version of the National Renewable Energy Laboratory's System Advisor Model (SAM). SAM is a simulation program for electricity generation projects. It has models for different kinds of renewable energy systems and financial models for residential, commercial, and utility-scale projects. For more details about SAM's capabilities, see the SAM website at [https://sam.nrel.gov/](https://sam.nrel.gov/).
The SAM Open Source Project repository contains the source code, tools, and instructions to build a desktop version of the National Renewable Energy Laboratory's System Advisor Model (SAM). SAM is a simulation program for electricity generation projects. It has models for different kinds of renewable energy systems and financial models for residential, commercial, and utility-scale projects. For more details about SAM's capabilities, see the SAM website at [https://sam.nrel.gov/](https://sam.nrel.gov/).

For a short video describing the SAM repositories, see https://youtu.be/E5z1iiZfZ3M.

Expand Down
42 changes: 21 additions & 21 deletions api/api_autogen/builder_PySAM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1178,27 +1178,27 @@ void builder_PySAM::create_PySAM_files(const std::string &cmod, const std::strin
"\t\tdef __init__(self, *args, **kwargs): # real signature unknown\n"
"\t\t\tpass\n"
"\t\n"
"\t\tconstant = float\n"
"\t\ten_hourly = float\n"
"\t\ten_periods = float\n"
"\t\ten_timeindex = float\n"
"\t\thourly = tuple\n"
"\t\tperiods = tuple\n"
"\t\timeindex = tuple\n"
"\t\tdc_constant = float\n"
"\t\tdc_en_hourly = float\n"
"\t\tdc_en_periods = float\n"
"\t\tdc_en_timeindex = float\n"
"\t\tdc_hourly = tuple\n"
"\t\tdc_periods = tuple\n"
"\t\tdc_imeindex = tuple\n"
"\t\tsf_constant = float\n"
"\t\tsf_en_hourly = float\n"
"\t\tsf_en_periods = float\n"
"\t\tsf_en_timeindex = float\n"
"\t\tsf_hourly = tuple\n"
"\t\tsf_periods = tuple\n"
"\t\tsf_timeindex = tuple\n\n";
"\t\tadjust_constant = float\n"
"\t\tadjust_en_hourly = float\n"
"\t\tadjust_en_periods = float\n"
"\t\tadjust_en_timeindex = float\n"
"\t\tadjust_hourly = tuple\n"
"\t\tadjust_periods = tuple\n"
"\t\tadjust_timeindex = tuple\n"
"\t\tdc_adjust_constant = float\n"
"\t\tdc_adjust_en_hourly = float\n"
"\t\tdc_adjust_en_periods = float\n"
"\t\tdc_adjust_en_timeindex = float\n"
"\t\tdc_adjust_hourly = tuple\n"
"\t\tdc_adjust_periods = tuple\n"
"\t\tdc_adjust_timeindex = tuple\n"
"\t\tsf_adjust_constant = float\n"
"\t\tsf_adjust_en_hourly = float\n"
"\t\tsf_adjust_en_periods = float\n"
"\t\tsf_adjust_en_timeindex = float\n"
"\t\tsf_adjust_hourly = tuple\n"
"\t\tsf_adjust_periods = tuple\n"
"\t\tsf_adjust_timeindex = tuple\n\n";
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@
"ur_metering_option": 0,
"ur_monthly_fixed_charge": 30,
"ur_monthly_min_charge": 0,
"ur_nb_apply_credit_current_month": 0,
"ur_nb_credit_expire": 0,
"ur_nm_credit_month": 11,
"ur_nm_credit_rollover": 0,
"ur_nm_yearend_sell_rate": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
"ur_metering_option": 4,
"ur_monthly_fixed_charge": 0,
"ur_monthly_min_charge": 0,
"ur_nb_apply_credit_current_month": 0,
"ur_nb_credit_expire": 0,
"ur_nm_credit_month": 11,
"ur_nm_credit_rollover": 0,
"ur_nm_yearend_sell_rate": 0,
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@
"ur_metering_option": 0,
"ur_monthly_fixed_charge": 0,
"ur_monthly_min_charge": 0,
"ur_nb_apply_credit_current_month": 0,
"ur_nb_credit_expire": 0,
"ur_nm_credit_month": 0,
"ur_nm_credit_rollover": 0,
"ur_nm_yearend_sell_rate": 0,
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"add_om_num_types": 1,
"om_batt_capacity_cost": [6.280000],
"om_batt_fixed_cost": [0.000000],
"om_batt_nameplate": 1199.36,
"om_batt_nameplate": 1200.21,
"om_batt_replacement_cost": [225.060000],
"om_batt_variable_cost": [0.000000],
"om_capacity": [16.000000],
Expand All @@ -32,7 +32,7 @@
"om_production": [0.000000],
"om_production_escal": 0,
"om_replacement_cost_escal": 0,
"total_installed_cost": 2.55344e+06
"total_installed_cost": 2.55375e+06
},
"LandLease": {
},
Expand Down Expand Up @@ -157,7 +157,7 @@
"pbi_uti_term": 0
},
"BatterySystem": {
"batt_computed_bank_capacity": 1199.36,
"batt_computed_bank_capacity": 1200.21,
"batt_replacement_option": 1,
"batt_replacement_schedule_percent": [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000],
"battery_per_kWh": 225.06,
Expand Down Expand Up @@ -199,7 +199,7 @@
},
"LCOS": {
"batt_salvage_percentage": 0,
"battery_total_cost_lcos": 477727
"battery_total_cost_lcos": 477967
},
"ElectricityRates": {
"rate_escalation": [0.000000]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"add_om_num_types": 1,
"om_batt_capacity_cost": [9.680000],
"om_batt_fixed_cost": [0.000000],
"om_batt_nameplate": 12.8102,
"om_batt_nameplate": 12.474,
"om_batt_replacement_cost": [273.520000],
"om_batt_variable_cost": [0.000000],
"om_capacity": [10.000000],
Expand All @@ -34,7 +34,7 @@
"om_production": [0.000000],
"om_production_escal": 0,
"om_replacement_cost_escal": 0,
"total_installed_cost": 52086.5
"total_installed_cost": 51691.6
},
"LandLease": {
},
Expand Down Expand Up @@ -153,7 +153,7 @@
"pbi_uti_term": 0
},
"BatterySystem": {
"batt_computed_bank_capacity": 12.8102,
"batt_computed_bank_capacity": 12.474,
"batt_replacement_option": 1,
"batt_replacement_schedule_percent": [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000],
"battery_per_kWh": 706.24,
Expand Down Expand Up @@ -195,7 +195,7 @@
},
"LCOS": {
"batt_salvage_percentage": 0,
"battery_total_cost_lcos": 14356.3
"battery_total_cost_lcos": 14035
},
"ElectricityRates": {
"rate_escalation": [0.000000]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"add_om_num_types": 1,
"om_batt_capacity_cost": [6.280000],
"om_batt_fixed_cost": [0.000000],
"om_batt_nameplate": 1199.36,
"om_batt_nameplate": 1200.21,
"om_batt_replacement_cost": [225.060000],
"om_batt_variable_cost": [0.000000],
"om_capacity": [22.000000],
Expand All @@ -30,7 +30,7 @@
"om_production": [0.000000],
"om_production_escal": 0,
"om_replacement_cost_escal": 0,
"total_installed_cost": 1.3098e+06
"total_installed_cost": 1.3101e+06
},
"LandLease": {
},
Expand Down Expand Up @@ -155,7 +155,7 @@
"pbi_uti_term": 0
},
"BatterySystem": {
"batt_computed_bank_capacity": 1199.36,
"batt_computed_bank_capacity": 1200.21,
"batt_replacement_option": 1,
"batt_replacement_schedule_percent": [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000],
"battery_per_kWh": 225.06,
Expand Down Expand Up @@ -197,7 +197,7 @@
},
"LCOS": {
"batt_salvage_percentage": 0,
"battery_total_cost_lcos": 449293
"battery_total_cost_lcos": 449584
},
"ElectricityRates": {
"rate_escalation": [0.000000]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"add_om_num_types": 1,
"om_batt_capacity_cost": [9.680000],
"om_batt_fixed_cost": [0.000000],
"om_batt_nameplate": 12.8102,
"om_batt_nameplate": 12.474,
"om_batt_replacement_cost": [273.520000],
"om_batt_variable_cost": [0.000000],
"om_capacity": [28.780000],
Expand All @@ -32,7 +32,7 @@
"om_production": [0.000000],
"om_production_escal": 0,
"om_replacement_cost_escal": 0,
"total_installed_cost": 38632.2
"total_installed_cost": 38458.6
},
"LandLease": {
},
Expand Down Expand Up @@ -151,7 +151,7 @@
"pbi_uti_term": 0
},
"BatterySystem": {
"batt_computed_bank_capacity": 12.8102,
"batt_computed_bank_capacity": 12.474,
"batt_replacement_option": 1,
"batt_replacement_schedule_percent": [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000],
"battery_per_kWh": 273.52,
Expand Down Expand Up @@ -193,7 +193,7 @@
},
"LCOS": {
"batt_salvage_percentage": 0,
"battery_total_cost_lcos": 8331.49
"battery_total_cost_lcos": 8157.89
},
"ElectricityRates": {
"rate_escalation": [0.000000]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
"real_discount_rate": 6.4,
"salvage_percentage": 0,
"state_tax_rate": [7.000000],
"system_capacity": 287.846
"system_capacity": 288.05
},
"SystemCosts": {
"add_om_num_types": 1,
"om_batt_capacity_cost": [15.000000],
"om_batt_fixed_cost": [0.000000],
"om_batt_nameplate": 1199.36,
"om_batt_nameplate": 1200.21,
"om_batt_replacement_cost": [260.280000],
"om_batt_variable_cost": [0.000000],
"om_capacity_escal": 0,
"om_fixed_escal": 0,
"om_production_escal": 0,
"om_replacement_cost_escal": 0,
"total_installed_cost": 662984
"total_installed_cost": 663455
},
"LandLease": {
},
Expand Down Expand Up @@ -152,7 +152,7 @@
"pbi_uti_term": 0
},
"BatterySystem": {
"batt_computed_bank_capacity": 1199.36,
"batt_computed_bank_capacity": 1200.21,
"batt_replacement_option": 1,
"batt_replacement_schedule_percent": [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000],
"battery_per_kWh": 260.28,
Expand Down Expand Up @@ -193,7 +193,7 @@
},
"LCOS": {
"batt_salvage_percentage": 0,
"battery_total_cost_lcos": 662984
"battery_total_cost_lcos": 663455
},
"ElectricityRates": {
"rate_escalation": [0.000000]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
"real_discount_rate": 6.4,
"salvage_percentage": 0,
"state_tax_rate": [7.000000],
"system_capacity": 4.91913
"system_capacity": 4.79002
},
"SystemCosts": {
"add_om_num_types": 1,
"om_batt_capacity_cost": [15.000000],
"om_batt_fixed_cost": [0.000000],
"om_batt_nameplate": 12.8102,
"om_batt_nameplate": 12.474,
"om_batt_replacement_cost": [590.760000],
"om_batt_variable_cost": [0.000000],
"om_capacity_escal": 0,
"om_fixed_escal": 0,
"om_production_escal": 0,
"om_replacement_cost_escal": 0,
"total_installed_cost": 19152.9
"total_installed_cost": 18849
},
"LandLease": {
},
Expand Down Expand Up @@ -148,7 +148,7 @@
"pbi_uti_term": 0
},
"BatterySystem": {
"batt_computed_bank_capacity": 12.8102,
"batt_computed_bank_capacity": 12.474,
"batt_replacement_option": 1,
"batt_replacement_schedule_percent": [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000],
"battery_per_kWh": 590.76,
Expand Down Expand Up @@ -189,7 +189,7 @@
},
"LCOS": {
"batt_salvage_percentage": 0,
"battery_total_cost_lcos": 19152.9
"battery_total_cost_lcos": 18849
},
"ElectricityRates": {
"rate_escalation": [0.000000]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
},
"LCOS": {
"batt_salvage_percentage": 0,
"battery_total_cost_lcos": 9.16799e+07
"battery_total_cost_lcos": 9.16801e+07
},
"ChargesByMonth": {
},
Expand Down
Loading

0 comments on commit 0fd33b6

Please sign in to comment.