def create_mod_par_setup(para_set): # Provide optimisation parameters to the model parameter setups. ps = pr.ParameterSet(params=set_of_parameters) # Add different heating rates (5, 10, 15). ps.append(pr.Parameter(name='heating_rate_{}K'.format(str(HeatingRatesTGA[ para_set])), place_holder='hr', value=HeatingRatesTGA[para_set])) # Add individual character ID to distinguish the simulation data. ps.append(pr.Parameter(name='chid', place_holder='CHID', value='{}_{}K'.format(CHID, str(HeatingRatesTGA[ para_set])))) return ps
# define variable 'ops': optimisation parameter set # define variable 'setups': simulation setup set # define variable 'optimiser': properties for the optimiser # import just for IDE convenience import propti as pr # fix the chid CHID = 'CONE' # define the optimisation parameter op1 = pr.Parameter(name='thickness1', place_holder='thickness1', min_value=1e-3, max_value=1e-1) op2 = pr.Parameter(name='thickness2', place_holder='thickness2', min_value=1e-3, max_value=1e-1) ops = pr.ParameterSet(params=[op1, op2]) # define general model parameter, including optimisation parameter mps0 = pr.ParameterSet(params=[op1, op2]) mps0.append(pr.Parameter(name='heat flux', place_holder='exflux', value=75)) mps0.append(pr.Parameter(name='tend', place_holder='tend')) mps0.append(pr.Parameter(name='mesh_i', place_holder='i', value=3)) mps0.append(pr.Parameter(name='mesh_j', place_holder='j', value=3)) mps0.append(pr.Parameter(name='mesh_k', place_holder='k', value=4)) mps0.append(pr.Parameter(name='chid', place_holder='filename', value=CHID)) # define empty simulation setup set
# define variable 'optimiser': properties for the optimiser # import just for IDE convenience import propti as pr # fix the chid CHID = 'TGA_analysis_01' TEND = 9360 # use default values for optimiser optimiser = pr.OptimiserProperties(algorithm='sceua', repetitions=10) #ngs=4, # define the optimisation parameter op1 = pr.Parameter(name='ref_temp_comp_01', place_holder='rtc01', min_value=200, max_value=400) op2 = pr.Parameter(name='ref_rate_comp_01', place_holder='rrc01', min_value=0.001, max_value=0.01) op3 = pr.Parameter(name='ref_temp_comp_02', place_holder='rtc02', min_value=300, max_value=600) op4 = pr.Parameter(name='ref_rate_comp_02', place_holder='rrc02', min_value=0.001, max_value=0.01) ops = pr.ParameterSet(params=[op1, op2, op3, op4])
# define variable 'ops': optimisation parameter set # define variable 'setups': simulation setup set # define variable 'optimiser': properties for the optimiser # import just for IDE convenience import propti as pr # fix the chid CHID = 'CONE' # define the optimisation parameter op1 = pr.Parameter(name='density', place_holder='DENSITY', min_value=1e2, max_value=1e4) op2 = pr.Parameter(name='emissivity', place_holder='EMISSIVITY', min_value=0.01, max_value=1) op3 = pr.Parameter(name='conductivity', place_holder='CONDUCTIVITY', min_value=0.01, max_value=1) op4 = pr.Parameter(name='specific_heat', place_holder='SPECIFIC_HEAT', min_value=0.01, max_value=10) ops = pr.ParameterSet(params=[op1, op2, op3, op4]) # define general model parameter, including optimisation parameter mps = pr.ParameterSet(params=[op1, op2, op3, op4])
# Define experimental_data_file_list = ['tga_5K_exp.csv', 'tga_10K_exp.csv', 'tga_15K_exp.csv'] # Define the optimisation parameters. # name: internal reference name # place_holder: what to look for in the template, the '#' are added # automatically by propti # min_value: defines the minimum limit of the range the optimisation is # allowed to sample from # max_value: defines the maximum limit of the range the optimisation is # allowed to sample from op1 = pr.Parameter(name='ref_temp_comp_01', place_holder='rtc01', min_value=200, max_value=400) op2 = pr.Parameter(name='ref_rate_comp_01', place_holder='rrc01', min_value=0.001, max_value=0.01) op3 = pr.Parameter(name='ref_temp_comp_02', place_holder='rtc02', min_value=300, max_value=600) op4 = pr.Parameter(name='ref_rate_comp_02', place_holder='rrc02', min_value=0.001, max_value=0.01) # Collect all the defined parameters from above, just for convenience. set_of_parameters = [op1, op2, op3, op4]