geophires_monte_carlo¶
- class geophires_monte_carlo.SimulationProgram(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Framework for running Monte Carlo simulations using GEOPHIRES v3.0 & HIP-RA 1.0 build date: September 2023 Created on Wed November 16 10:43:04 2017 @author: Malcolm Ross V3 @author: softwareengineerprogrammer
- geophires_monte_carlo.MC_GeoPHIRES3.Write_HTML_Output(html_path: str, df: DataFrame, outputs: list, mins: list, maxs: list, medians: list, averages: list, means: list, std: list, full_names: set, short_names: set) None [source]¶
Write_HTML_Output - write the results of the Monte Carlo simulation to an HTML file :param html_path: the path to the HTML file to write :type html_path: str :param df: the DataFrame with the results :type df: pd.DataFrame :param outputs: the list of output variable names :type outputs: list :param mins: the list of minimum values for each output variable :type mins: list :param maxs: the list of maximum values for each output variable :type maxs: list :param medians: the list of median values for each output variable :type medians: list :param averages: the list of average values for each output variable :type averages: list :param means: the list of mean values for each output variable :type means: list :param std: the list of standard deviation values for each output variable :type std: list :param full_names: the list of full names for each output variable :type full_names: set :param short_names: the list of short names for each output variable :type short_names: set
- geophires_monte_carlo.MC_GeoPHIRES3.check_and_replace_mean(input_value, args) list [source]¶
CheckAndReplaceMean - check to see if the user has requested that a value be replaced by a mean value by specifying a value as “#” :param input_value: the value to check :type input_value: list :param args: the list of arguments passed in from the command line :type args: list :return: the input_value, with the mean value replaced if necessary :rtype: list
- geophires_monte_carlo.MC_GeoPHIRES3.main(command_line_args=None)[source]¶
main - this is the main function that is called when the program is run It gets most of its key values from the command line:
Code_File: Python code to run
Input_file: The base model for the calculations
- MC_Settings_file: The settings file for the MC run:
a) the input variables to change (spelling and case are IMPORTANT), their distribution functions (choices = normal, uniform, triangular, lognormal, binomial - see numpy.random for documentation), and the inputs for that distribution function (Comma separated; If the mean is set to “#”, then value from the Input_file as the mode/mean). In the form:
INPUT, Maximum Temperature, normal, mean, std_dev INPUT, Utilization Factor,uniform, min, max INPUT, Ambient Temperature,triangular, left, mode, right
b) the output variable(s) to track (spelling and case are IMPORTANT), in the form [NOTE: THIS LIST SHOULD BE IN THE ORDER THEY APPEAR IN THE OUTPUT FILE]:
OUTPUT, Average Net Electricity Production OUTPUT, Electricity breakeven price
- the number of iterations, in the form:
ITERATIONS, 1000
d) the name of the output file (it will contain one column for each of the output variables to track), in the form:
MC_OUTPUT_FILE, “D:WorkGEOPHIRES3-masterMC_Result.txt”
- the path to the python executable, it it is not already linked to “python”, in the form:
PYTHON_PATH, /user/local/bin/python3
- Parameters:
enable_geophires_monte_carlo_logging_config (bool) – if True, use the logging.conf file to configure logging