Skip to content

Commit

Permalink
HostingCapacity: Incorporated new Sandia modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-nyx committed Nov 5, 2024
1 parent 4a5f5e6 commit 719f899
Show file tree
Hide file tree
Showing 3 changed files with 509 additions and 156 deletions.
3 changes: 2 additions & 1 deletion omf/models/hostingCapacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def run_ami_algorithm( modelDir, inputDict, outData ):
raise Exception(errorMessage)
AMI_end_time = time.time()

AMI_results = AMI_output[0].rename(columns={'kW_hostable': 'voltage_cap_kW'})
AMI_results = pd.read_csv( outputPath )
AMI_results.rename(columns={'kw_hostable': 'voltage_cap_kW'}, inplace=True)
histogramFigure = px.histogram( AMI_results, x='voltage_cap_kW', template="simple_white", color_discrete_sequence=["MediumPurple"] )
histogramFigure.update_layout(bargap=0.5)
# TBD - Needs to be modified when the MoHCA algorithm supports calculating thermal hosting capacity
Expand Down
25 changes: 14 additions & 11 deletions omf/solvers/mohca_cl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@ def sandia1(in_path, out_path):
ret_value = sandia.hosting_cap(in_path, out_path)
return ret_value

def sandia2(in_path, out_path):
return 'stub for lanl algo 2'

def gatech(in_path, out_path):
return 'stub for GA tech algo'

def iastate(in_path, out_path):
''' Execute Sandia hosting capacity algorithm on in_path CSV with output written as CSV to out_path. '''
ret_value = ISU_PINNbasedHCA.PINN_HC(in_path, out_path)
''' Execute ISU hosting capacity algorithm on in_path CSV with output written as CSV to out_path. '''
''' Besides the in_path and out_path, more setting information is needed for the code running. The information of the testing system is shown below.'''
input_csv_path = 'ISU_InputData_realsystem.csv' # input path
output_csv_path = 'Output_csv_path.csv' # output path
system_name = 'AMU_EC3' # system name for model saving
node_list_for_HC = [i for i in range(3)] # selected bus for HC analysis
total_bus_number = 50 # total bus number
model_retrain = 0 # 1 for retraining; 0 for not training
inverter_control_setting = 'var' # two setting mode: var prioirty and watt priority
inverter_advanced_control = 1 # 0->'without control' 1->'constant power factor' 2->'constant reactive power' 3->'active power-reactive power' 4->'voltage-reactive power'
ret_value = ISU_PINNbasedHCA.PINN_HC(system_name, input_csv_path, output_csv_path, total_bus_number, nodes_selected=node_list_for_HC, retrain_indicator=model_retrain, inverter_control=inverter_advanced_control, control_setting=inverter_control_setting)
#ret_value = ISU_PINNbasedHCA.PINN_HC(in_path, out_path)

return ret_value

def run_all_tests():
Expand All @@ -41,7 +46,5 @@ def init_cli():
'add': add,
'hello': hello,
'sandia1': sandia1,
'iastate': iastate,
'gatech': gatech,
'run_all_tests': run_all_tests
})
})
Loading

0 comments on commit 719f899

Please sign in to comment.