Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next gen profiles #15

Open
wants to merge 81 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
2e30627
Merge pull request #4 from idaholab/issue_linuxcompilebug_2022_12_21_…
steven-schmidt-inl Dec 21, 2022
d8399a3
Add static to cmake to build ICM libs as static libs
manoj1511 Jan 4, 2023
d261daa
Adding non-const operator< functions so that std::sort works on macOS
steven-schmidt-inl Feb 16, 2023
b078fbd
Merge pull request #5 from idaholab/static_build
steven-schmidt-inl Mar 6, 2023
cfeffd7
updated enums to use both numbers and strings
manoj1511 Mar 24, 2023
39f9f40
Merge pull request #6 from idaholab/DirectXFC_enum_name_updates
steven-schmidt-inl Mar 24, 2023
2715304
updated to make TOU period work with intraday times
manoj1511 Mar 28, 2023
ca68388
Merge pull request #7 from idaholab/Fix_intraday_TOU_period
steven-schmidt-inl Apr 19, 2023
05ecfea
EV EVSE charging models input files
manoj1511 Apr 23, 2023
3bb135c
new EV EVSE data structures to relflect input files
manoj1511 Apr 23, 2023
c54c956
load EV model inpputs
manoj1511 Apr 24, 2023
477d293
EVSE model inputs loader
manoj1511 Apr 25, 2023
eb75f7e
EV_EVSE_inventory loader, some renaming and cleanup
manoj1511 Apr 25, 2023
c5648a8
All unorganized chanes clumped together
manoj1511 May 9, 2023
4620dbb
cleanups and formatting
manoj1511 May 10, 2023
97e6294
changed filenames and classes to start with factory
manoj1511 May 10, 2023
32d9b2e
Integration of dynamic charging models with rest of the ICM
manoj1511 May 12, 2023
d953042
bug fixes
manoj1511 May 17, 2023
b3bf5da
bug fixes
manoj1511 May 21, 2023
1b6695d
unittest and some cleanups
manoj1511 May 22, 2023
06f8c4c
update gitignore
manoj1511 May 22, 2023
4c659dd
Updated python interface for new ICM updates
manoj1511 May 23, 2023
9c626a4
added python interfaces for charing models and some re org of files t…
manoj1511 May 23, 2023
59a7a53
added load_EV_EVSE_inventory to have python interface and added const…
manoj1511 May 24, 2023
3b5e98a
added some missing functions in pybind python interface
manoj1511 May 24, 2023
e8b1d5c
added utility function to check if EV is compatible with EVSE
manoj1511 May 24, 2023
fb504a0
python interface for the new utility function to check if EV is compa…
manoj1511 May 24, 2023
69b61a6
Added pickling functionality for EV_EVSE_inventory
manoj1511 May 24, 2023
8839849
bug fix in pickling functionality
manoj1511 May 24, 2023
bdce401
Fixing compile-errors on Mac (using the clang compiler)
steven-schmidt-inl May 26, 2023
a8dcfb4
Removed PROJECT flag in cmake as Upgraded ICM doesn't need it anymore
manoj1511 May 26, 2023
e6d8869
complete DirectXFC charging models Unit test and some improvements re…
manoj1511 May 30, 2023
6f24c27
Unit test for the eMosaic project charging models
manoj1511 May 30, 2023
0a2b73f
unit test for EVs at Risk charging models. Minor inconsistensies betw…
manoj1511 May 30, 2023
d27608b
Updates in preparation for Caldera_CDM using new ICM version. Also, d…
steven-schmidt-inl May 30, 2023
a75b5bb
Fixing word-misspelling. It is spelled 'threshold' not 'threashold'.
steven-schmidt-inl May 31, 2023
169927f
Added the original project models inputs to the inputs folder
manoj1511 May 31, 2023
26ef5ea
cleanups
manoj1511 Jun 5, 2023
8da3d39
Fixing some linux-compile errors by adding some additional #includes.
steven-schmidt-inl Jun 8, 2023
57a913b
Adding two columns 'EVSE_user_facing_name' and 'EVSE_user_facing_desc…
steven-schmidt-inl Aug 15, 2023
4a55306
Adding .DS_Store to the .gitignore file
steven-schmidt-inl Aug 15, 2023
11c79c7
Updating example input files for DirectXFC, EVs_at_Risk, eMosaic, aft…
steven-schmidt-inl Aug 16, 2023
52e94e5
Adding CalderaCast charing models and a test script
manoj1511 Sep 1, 2023
4bfdc9b
Reverting the addition of two new columns in 'EVSE_inputs'. Putting i…
steven-schmidt-inl Sep 8, 2023
05842b0
Fixing one last place where I forgot to remove the user-facing string…
steven-schmidt-inl Nov 6, 2023
22656d5
Adding a useful descriptive comment.
steven-schmidt-inl Nov 8, 2023
faff074
Adding the executable created when we run make install, to the .gitig…
steven-schmidt-inl Nov 8, 2023
ee55c39
Useful descriptive comments and TODOs in the comments.
steven-schmidt-inl Nov 17, 2023
9cb73e6
If there is no EVSEs on a node then we return zero (instead of an emp…
steven-schmidt-inl Nov 20, 2023
4cce763
updated CalderaCast Example EVSE and EV inputs
manoj1511 Dec 13, 2023
0998cb9
added inverter models for EVSEs above 500kW
manoj1511 Jun 8, 2023
f3c3c8f
TE changes for ICM
manoj1511 Jan 31, 2024
b50a18d
adding cmath as GCC throws an error
manoj1511 Feb 1, 2024
4d43434
Fixing bug when catching charge-events that end within a minute or ar…
steven-schmidt-inl Feb 6, 2024
07ac52c
make charge_time info available in active CE
manoj1511 Mar 18, 2024
49951ec
Formatting and 'const' clean up in Caldera_ICM (more of this to come)
steven-schmidt-inl Jan 11, 2024
9ec71c9
Clean up to replace vec[i] with vec.at(i) in ICM_interface.cpp
steven-schmidt-inl Jan 12, 2024
90ceb5a
Another round of 'const' clean-up in Caldera_ICM
steven-schmidt-inl Jan 22, 2024
8167929
Clean-up in a few more files.
steven-schmidt-inl Jan 24, 2024
c9a9d1a
Fixed initialization bugs in 'datatypes_global.h' and other clean-ups.
steven-schmidt-inl Feb 1, 2024
ebb2282
More clean-ups. Also throwing an exception in one spot if it's bad i…
steven-schmidt-inl Feb 5, 2024
bd21329
Small change -- a few more curly brackets added.
steven-schmidt-inl Feb 6, 2024
af31faf
Fixing const bug/issue after rebase in 'supply_equipment_load.h' and …
steven-schmidt-inl Feb 7, 2024
0f99b59
Fixing bug preventing correct charge-event-id from being printed
steven-schmidt-inl Feb 7, 2024
dba8d5c
HPC compilation fix
manoj1511 Mar 28, 2024
c541966
changes to timeseries
manoj1511 Apr 1, 2024
5c4f07e
Saving EV peak power in EV_characteristics
manoj1511 Apr 3, 2024
ab695fc
Adding utility function 'get_val_from_time_with_default' to timeseres…
steven-schmidt-inl Apr 4, 2024
9566fca
Created templated data type object 'time_series_v2' which will eventu…
steven-schmidt-inl Apr 10, 2024
5ed3d39
Forgot an #include in unittests/test_datatypes/test_datatypes.cpp
steven-schmidt-inl Apr 10, 2024
80d1075
updated process doc
manoj1511 May 15, 2024
8e4deee
install a test executable in test folder instead of main folder
manoj1511 May 15, 2024
25327dd
brought a test in source dir to running state
manoj1511 May 15, 2024
5b6ea68
delete some junk from python bind file
manoj1511 May 15, 2024
1cf9a69
a new folder with example script for next gen profile project
manoj1511 May 15, 2024
7f75a88
Update .gitignore
skallajeINL May 15, 2024
59b0020
Remove test folder
manoj1511 Jun 3, 2024
7cd3f1d
create examples to use ICM for Next gen project
manoj1511 Jun 4, 2024
a378a1a
Minor bug
manoj1511 Jun 4, 2024
7ca8b43
Another minor bug
manoj1511 Jun 4, 2024
a4d07a4
Making sure output file name matches executable name (same capitaliza…
steven-schmidt-inl Jun 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ __pycache__/

# C extensions
*.so
*.exe
*.editorconfig

# Distribution / packaging
build/
*.vs*
CMakeSettings.json
CMakeSettings.json

# MacOS stuff
.DS_Store

# Executables that get created when we run make install
run_models

15 changes: 3 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ project(ICM)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if (NOT DEFINED PROJECT)
message(WARNING "PROJECT cmake variable not set defaulting to emosiac project")
endif()

SET(PROJECT "eMosaic" CACHE STRING "Project to compile for")

if (NOT (${PROJECT} STREQUAL "eMosaic" OR ${PROJECT} STREQUAL "EVs_at_Risk" OR ${PROJECT} STREQUAL "DirectXFC"))
message(FATAL_ERROR "PROJECT cmake variable must be equal to eMosaic or EVs_at_Risk or DirectXFC")
endif()

if (NOT DEFINED INSTALL_DIR)
message(STATUS "setting local install dir")
set(INSTALL_DIR ${PROJECT_SOURCE_DIR}/libs)
Expand All @@ -23,5 +13,6 @@ message(STATUS "Install dir is ${INSTALL_DIR}")

find_package(pybind11 CONFIG)

add_subdirectory(source/charging_models)
add_subdirectory(source/base)
add_subdirectory(source)
add_subdirectory(unittests)
add_subdirectory(misc)
Binary file added docs/charging_model_process.pptx
Binary file not shown.
Binary file added docs/model assumptions.xlsx
Binary file not shown.
Binary file added docs/~$model assumptions.xlsx
Binary file not shown.
Binary file added docs/~$new_interface.pptx
Binary file not shown.
11 changes: 11 additions & 0 deletions inputs/CalderaCast/EVSE_inputs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
EVSE_type,EVSE_level,EVSE_phase_connection,AC/DC_power_limit_kW,AC/DC_voltage_limits_V,AC/DC_current_limit_A,standby_real_power_kW,standby_reactive_power_kVAR
L2_7200,L2,1,6.624,-1,-1,0,0
L2_11520,L2,1,10.5984,-1,-1,0,0
L2_17280,L2,1,15.8976,-1,-1,0,0
L2_19200,L2,1,17.664,-1,-1,0,0
dcfc_50,DCFC,3,50,600,125,0.1,-0.59
xfc_150,DCFC,3,150,920,200,0.17,-0.445
xfc_150T,DCFC,3,150,500,300,0.17,-0.445
xfc_200,DCFC,3,200,920,300,0.17,-0.445
xfc_250,DCFC,3,250,920,500,0.17,-0.445
xfc_350,DCFC,3,350,920,500,0.17,-0.445
15 changes: 15 additions & 0 deletions inputs/CalderaCast/EV_inputs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
EV_type,battery_chemistry,usable_battery_size_kWh,range_miles,efficiency_Wh/Mile,AC_charge_rate_kW,DCFC_capable,max_c_rate,pack_voltage_at_peak_power_V
bev250_400kW,LTO,87.5,250,350,10.58,TRUE,3.85,900
bev300_575kW,LTO,142.5,300,475,17.66,TRUE,3.41,900
bev300_400kW,LTO,97.5,300,325,17.66,TRUE,3.46,900
bev250_350kW,NMC,118.75,250,475,10.58,TRUE,2.29,900
bev300_300kW,NMC,97.5,300,325,10.58,TRUE,2.38,900
bev150_150kW,NMC,45,150,300,8.832,TRUE,2.56,900
bev250_ld2_300kW,NMC,87.5,250,350,10.58,TRUE,2.64,900
bev200_ld4_150kW,NMC,95,200,475,8.832,TRUE,1.22,900
bev275_ld1_150kW,NMC,82.5,275,300,8.832,TRUE,1.41,900
bev250_ld1_75kW,NMC,75,250,300,6.072,TRUE,0.76,460
bev150_ld1_50kW,NMC,45,150,300,6.072,TRUE,0.85,460
phev_SUV,NMC,23.75,50,475,8.832,FALSE,-1,-1
phev50,NMC,15.5,50,310,3.016365,FALSE,-1,-1
phev20,NMC,5,20,250,3.016365,FALSE,-1,-1
10 changes: 10 additions & 0 deletions inputs/DirectXFC/EVSE_inputs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
EVSE_type,EVSE_level,EVSE_phase_connection,AC/DC_power_limit_kW,AC/DC_voltage_limits_V,AC/DC_current_limit_A,standby_real_power_kW,standby_reactive_power_kVAR
L1_1440,L1,1,1.289338,-1,-1,0,0
L2_3600,L2,1,3.30192,-1,-1,0,0
L2_7200,L2,1,6.624,-1,-1,0,0
L2_9600,L2,1,8.832,-1,-1,0,0
L2_11520,L2,1,10.5984,-1,-1,0,0
L2_17280,L2,1,15.8976,-1,-1,0,0
dcfc_50,DCFC,3,50,500,125,0.1,-0.59
xfc_150,DCFC,3,150,882.3529412,170,0.17,-0.445
xfc_350,DCFC,3,350,700,500,0.17,-0.445
15 changes: 15 additions & 0 deletions inputs/DirectXFC/EV_inputs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
EV_type,battery_chemistry,usable_battery_size_kWh,range_miles,efficiency_Wh/Mile,AC_charge_rate_kW,DCFC_capable,max_c_rate,pack_voltage_at_peak_power_V
bev250_400kW,LTO,87.5,250,350,10.58,TRUE,3.85,900
bev300_575kW,LTO,142.5,300,475,10.58,TRUE,3.41,900
bev300_400kW,LTO,97.5,300,325,10.58,TRUE,3.46,900
bev250_350kW,NMC,118.75,250,475,10.58,TRUE,2.29,900
bev300_300kW,NMC,97.5,300,325,10.58,TRUE,2.38,900
bev150_150kW,NMC,45,150,300,8.832,TRUE,2.56,900
bev250_ld2_300kW,NMC,87.5,250,350,10.58,TRUE,2.64,900
bev200_ld4_150kW,NMC,95,200,475,8.832,TRUE,1.22,900
bev275_ld1_150kW,NMC,82.5,275,300,8.832,TRUE,1.41,900
bev250_ld1_75kW,NMC,75,250,300,6.072,TRUE,0.76,460
bev150_ld1_50kW,NMC,45,150,300,6.072,TRUE,0.85,460
phev_SUV,NMC,23.75,50,475,8.832,FALSE,-1,-1
phev50,NMC,15.5,50,310,3.016365,FALSE,-1,-1
phev20,NMC,5,20,250,3.016365,FALSE,-1,-1
10 changes: 10 additions & 0 deletions inputs/EVs_at_Risk/EVSE_inputs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
EVSE_type,EVSE_level,EVSE_phase_connection,AC/DC_power_limit_kW,AC/DC_voltage_limits_V,AC/DC_current_limit_A,standby_real_power_kW,standby_reactive_power_kVAR
L2_7200,L2,1,6.624,240,30,0,0
L2_17280,L2,1,15.8976,240,71,0,0
xfc_150,DCFC,3,150,882.3529412,170,0.17,-0.445
xfc_350,DCFC,3,350,700,500,0.17,-0.445
xfc_500kW,DCFC,3,500,1000,500,0.2,-0.03
xfc_1000kW,DCFC,3,1000,1365.001365,732.6,0.2,-0.03
xfc_2000kW,DCFC,3,2000,1363.636705,1466.6663,0.2,-0.03
xfc_3000kW,DCFC,3,3000,1363.636364,2200,0.2,-0.03
dwc_100kW,DCFC,3,100,800,125,0.2,-0.03
9 changes: 9 additions & 0 deletions inputs/EVs_at_Risk/EV_inputs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
EV_type,battery_chemistry,usable_battery_size_kWh,range_miles,efficiency_Wh/Mile,AC_charge_rate_kW,DCFC_capable,max_c_rate,pack_voltage_at_peak_power_V
ld_50kWh,NMC,50,200,250,15.8976,TRUE,2.9,1000
ld_100kWh,NMC,100,300,333,15.8976,TRUE,2.9,1000
md_200kWh,NMC,200,250,800,15.8976,TRUE,2.9,1000
hd_300kWh,NMC,300,150,2000,15.8976,TRUE,2.9,1500
hd_400kWh,NMC,400,200,2000,15.8976,TRUE,2.9,1500
hd_600kWh,NMC,600,300,2000,15.8976,TRUE,2.9,1500
hd_800kWh,NMC,800,400,2000,15.8976,TRUE,2.9,1500
hd_1000kWh,NMC,1000,500,2000,15.8976,TRUE,2.5,1500
9 changes: 9 additions & 0 deletions inputs/eMosaic/EVSE_inputs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
EVSE_type,EVSE_level,EVSE_phase_connection,AC/DC_power_limit_kW,AC/DC_voltage_limits_V,AC/DC_current_limit_A,standby_real_power_kW,standby_reactive_power_kVAR
L2_7200W,L2,1,7.2,240,30,0,0
L2_17280W,L2,1,17.28,240,71,0,0
xfc_20kW,DCFC,3,19.5,325,60,0.1,-0.59
xfc_50kW,DCFC,3,50,625,80,0.1,-0.59
xfc_90kW,DCFC,3,90,600,150,0.1,-0.59
xfc_150kW,DCFC,3,150,750,200,0.17,-0.445
xfc_180kW,DCFC,3,180,600,300,0.17,-0.445
xfc_450kW,DCFC,3,450,750,600,0.17,-0.445
7 changes: 7 additions & 0 deletions inputs/eMosaic/EV_inputs.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
EV_type,battery_chemistry,usable_battery_size_kWh,range_miles,efficiency_Wh/Mile,AC_charge_rate_kW,DCFC_capable,max_c_rate,pack_voltage_at_peak_power_V
ld_50kWh,NMC,50,200,250,15.8976,TRUE,2.9,1000
ld_100kWh,NMC,100,300,333,15.8976,TRUE,2.9,1000
md_200kWh,NMC,200,250,800,15.8976,TRUE,2.9,1000
hd_300kWh,NMC,300,150,2000,15.8976,TRUE,2.9,1500
hd_400kWh,NMC,400,200,2000,15.8976,TRUE,2.9,1500
hd_600kWh,NMC,600,300,2000,15.8976,TRUE,2.9,1500
1 change: 1 addition & 0 deletions misc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(next_gen_prof_testing)
2 changes: 2 additions & 0 deletions misc/next_gen_prof_testing/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.csv
*.exe
22 changes: 22 additions & 0 deletions misc/next_gen_prof_testing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
add_executable(ICM_Full ICM_Full.cpp)
target_link_libraries(ICM_Full Charging_models Load_inputs factory Base)
target_compile_features(ICM_Full PUBLIC cxx_std_17)
target_include_directories(ICM_Full PUBLIC ${PROJECT_SOURCE_DIR}/source/base)
target_include_directories(ICM_Full PUBLIC ${PROJECT_SOURCE_DIR}/source/charging_models)
target_include_directories(ICM_Full PUBLIC ${PROJECT_SOURCE_DIR}/source/factory)
target_include_directories(ICM_Full PUBLIC ${PROJECT_SOURCE_DIR}/source/load_inputs)

install(TARGETS ICM_Full
DESTINATION ${PROJECT_SOURCE_DIR}/misc/next_gen_prof_testing)

add_executable(ICM_Aux ICM_Aux.cpp )
target_link_libraries(ICM_Aux Charging_models Load_inputs factory Base_aux)
target_compile_features(ICM_Aux PUBLIC cxx_std_17)
target_include_directories(ICM_Aux PUBLIC ${PROJECT_SOURCE_DIR}/source/base)
target_include_directories(ICM_Aux PUBLIC ${PROJECT_SOURCE_DIR}/source/charging_models)
target_include_directories(ICM_Aux PUBLIC ${PROJECT_SOURCE_DIR}/source/factory)
target_include_directories(ICM_Aux PUBLIC ${PROJECT_SOURCE_DIR}/source/load_inputs)

install(TARGETS ICM_Aux
DESTINATION ${PROJECT_SOURCE_DIR}/misc/next_gen_prof_testing)

161 changes: 161 additions & 0 deletions misc/next_gen_prof_testing/ICM_Aux.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
#include "Aux_interface.h"
#include <filesystem>


int build_entire_charge_profile_using_ICM()
{

std::string path_to_inputs = "./inputs";

//######################################################
//# Build Charge Profile Given Start and End SOC
//######################################################

double L1_timestep_sec = 1; // Timestep for Level 1 charger
double L2_timestep_sec = 1; // Timestep for Level 2 charger
double HPC_timestep_sec = 1; // Timestep for High Power charger
EV_ramping_map ramping_by_pevType_only{}; // Custom Ramping
EV_EVSE_ramping_map ramping_by_pevType_seType{}; // Custom Ramping

CP_interface_v2 ICM_v2{
path_to_inputs,
L1_timestep_sec,
L2_timestep_sec,
HPC_timestep_sec,
ramping_by_pevType_only,
ramping_by_pevType_seType
};

std::string pev_type = "bev250_350kW";
std::string SE_type = "xfc_350";
double start_soc = 10;
double end_soc = 90;

all_charge_profile_data all_profile_data = ICM_v2.get_all_charge_profile_data(start_soc, end_soc, pev_type, SE_type);

double start_time_sec = 0;

// Write output
// build the files header
std::string header = "time | hrs,SOC | ,P1 | kW, P2 | kW, P3 | kW, Q3 | kVAR\n";

std::string data = "";

for (int i = 0; i < all_profile_data.soc.size(); i++)
{
data += std::to_string((start_time_sec + i* all_profile_data.timestep_sec)/3600.0) + ",";
data += std::to_string(all_profile_data.soc[i]) + ",";
data += std::to_string(all_profile_data.P1_kW[i]) + ",";
data += std::to_string(all_profile_data.P2_kW[i]) + ",";
data += std::to_string(all_profile_data.P3_kW[i]) + ",";
data += std::to_string(all_profile_data.Q3_kVAR[i]) + "\n";

}

std::ofstream f_out;
f_out.open("./outputs/ICM_Aux_output.csv");
f_out << header << data;
f_out.close();

return 0;
}

int estimate_charging_parameters_using_ICM()
{
std::string path_to_inputs = "./inputs";
CP_interface ICM_v1{ path_to_inputs, false };

double setpoint_P3kW = 1000;
std::string pev_type = "bev250_350kW";
std::string SE_type = "xfc_350";


double startSOC, endSOC, charge_time_hrs;
std::vector<double> endSOC_vec, charge_time_hrs_vec;
//----------------------------------------
// find_result_given_startSOC_and_endSOC
//----------------------------------------

startSOC = 20;
endSOC = 85;
pev_charge_profile_result X0 = ICM_v1.find_result_given_startSOC_and_endSOC(pev_type, SE_type, setpoint_P3kW, startSOC, endSOC);

std::cout << "-----------------------------------" << "\n";
std::cout << "find_result_given_startSOC_and_endSOC" << "\n";
std::cout << "------------------------------------" << "\n";
std::cout << "startSOC: " << startSOC << " endSOC: " << endSOC << "\n";
std::cout << "soc_increase: " << X0.soc_increase << " total_time_hrs: " << X0.total_charge_time_hrs << " incr_time_hrs : " << X0.incremental_chage_time_hrs << "\n";
std::cout << "\n" << "\n";


//-------------------------------------------
// find_result_given_startSOC_and_chargeTime
//-------------------------------------------
startSOC = 20;
charge_time_hrs = 15.0 / 60.0;
pev_charge_profile_result X1 = ICM_v1.find_result_given_startSOC_and_chargeTime(pev_type, SE_type, setpoint_P3kW, startSOC, charge_time_hrs);

std::cout << "-----------------------------------" << "\n";
std::cout << "find_result_given_startSOC_and_chargeTime" << "\n";
std::cout << "------------------------------------" << "\n";
std::cout << "startSOC: " << startSOC << " charge_time_hrs: " << charge_time_hrs << "\n";
std::cout << "soc_increase: " << X1.soc_increase << " total_time_hrs: " << X1.total_charge_time_hrs << " incr_time_hrs : " << X1.incremental_chage_time_hrs << "\n";
std::cout << "\n" << "\n";


//------------------------------------------------
// find_chargeProfile_given_startSOC_and_endSOCs
//------------------------------------------------
startSOC = 20;
endSOC_vec = { 30, 40, 50, 60, 70, 80, 90, 100 };
std::vector<pev_charge_profile_result> X2 = ICM_v1.find_chargeProfile_given_startSOC_and_endSOCs(pev_type, SE_type, setpoint_P3kW, startSOC, endSOC_vec);

std::cout << "-----------------------------------" << "\n";
std::cout << "find_chargeProfile_given_startSOC_and_endSOCs" << "\n";
std::cout << "------------------------------------" << "\n";
std::cout << "startSOC: " << startSOC << " endSOCs: ";
for ( double endSOC : endSOC_vec )
{
std::cout << endSOC << " ";
}
std::cout << "\n";
for (pev_charge_profile_result x : X2)
{
std::cout << "soc_increase: " << x.soc_increase << " total_time_hrs: " << x.total_charge_time_hrs << " incr_time_hrs : " << x.incremental_chage_time_hrs << "\n";
}
std::cout << "\n" << "\n";


//------------------------------------------------
// find_chargeProfile_given_startSOC_and_chargeTimes
//------------------------------------------------
startSOC = 20;
charge_time_hrs_vec = { 5.0 / 60.0, 10.0 / 60.0, 15.0 / 60.0, 20.0 / 60.0, 25.0 / 60.0, 30.0 / 60.0, 35.0 / 60.0, 40.0 / 60.0, 45.0 / 60.0, 50.0 / 60.0, 60.0 / 60.0 };
std::vector<pev_charge_profile_result> X3 = ICM_v1.find_chargeProfile_given_startSOC_and_chargeTimes(pev_type, SE_type, setpoint_P3kW, startSOC, charge_time_hrs_vec);

std::cout << "-----------------------------------" << "\n";
std::cout << "find_chargeProfile_given_startSOC_and_chargeTimes" << "\n";
std::cout << "------------------------------------" << "\n";
std::cout << "startSOC: " << startSOC << " charge_time_hrs: ";
for (double charge_time_hrs : charge_time_hrs_vec)
{
std::cout << charge_time_hrs << " ";
}
std::cout << "\n";
for (pev_charge_profile_result x : X3)
{
std::cout << "soc_increase: " << x.soc_increase << " total_time_hrs: " << x.total_charge_time_hrs << " incr_time_hrs : " << x.incremental_chage_time_hrs << "\n";
}
std::cout << "\n" << "\n";

return 0;
}

int main()
{
int return_code = 0;
return_code += build_entire_charge_profile_using_ICM();
return_code += estimate_charging_parameters_using_ICM();

return 0;
}
49 changes: 49 additions & 0 deletions misc/next_gen_prof_testing/ICM_Aux.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
import os
import sys
import pandas as pd
import numpy as np

path_to_here = os.path.abspath(os.path.dirname(sys.argv[0]))
path_to_libs = os.path.join(path_to_here, "..", "..", "libs")
path_to_inputs = os.path.join(path_to_here, "inputs")

index = 1
sys.path.insert( index+0, path_to_libs )

from Caldera_ICM_Aux import CP_interface_v2
from Caldera_globals import all_charge_profile_data


######################################################
# Build Charge Profile Given Start and End SOC
######################################################

L1_timestep_sec = 1
L2_timestep_sec = 1
HPC_timestep_sec = 1
ramping_by_pevType_only = {}
ramping_by_pevType_seType = {}

ICM = CP_interface_v2(path_to_inputs, L1_timestep_sec, L2_timestep_sec, HPC_timestep_sec, ramping_by_pevType_only, ramping_by_pevType_seType)

pev_type = "bev250_350kW"
SE_type = "xfc_350"
start_soc = 10
end_soc = 90

all_profile_data = ICM.get_all_charge_profile_data(start_soc, end_soc, pev_type, SE_type)

start_time = 0
end_time = len(all_profile_data.P1_kW) * all_profile_data.timestep_sec

df = pd.DataFrame()
df["time | sec"] = np.arange(start_time, end_time, all_profile_data.timestep_sec)
df["SOC | "] = all_profile_data.soc
df["P1 | kW"] = all_profile_data.P1_kW
df["P2 | kW"] = all_profile_data.P2_kW
df["P3 | kW"] = all_profile_data.P3_kW
df["Q3 | kVAR"] = all_profile_data.Q3_kVAR

df.to_csv("{}_{}_{}_{}.csv".format(pev_type, SE_type, start_soc, end_soc), index = False)

Loading