Exemple #1
0
numer_of_iterations = 2
cti_file = 'masten_paper_gri_thermo.cti'
working_directory = 'MSI/data/automating_HO2_masten'
reaction_uncertainty_csv = 'reaction_uncertainty_masten.csv'

#rate_constant_target_value_data = 'burke_target_value_single_reactions.csv'
#rate_constant_target_value_data = 'target_reactions_test.csv'
rate_constant_target_value_data = ''
#this would be an empty string '' if you do not want to include it
run_with_k_target_values = 'Off'
#this could be 'On'

rate_constant_target_value_data_for_plotting = 'target_reactions_test.csv'

MSI_st_instance_one = stMSI.MSI_shocktube_optimization(
    cti_file, .01, 1, 1, working_directory, files_to_include,
    reaction_uncertainty_csv, rate_constant_target_value_data)
MSI_st_instance_one.one_run_shock_tube_optimization()

S_matrix_original = MSI_st_instance_one.S_matrix
exp_dict_list_original = MSI_st_instance_one.experiment_dictonaries
original_covariance = MSI_st_instance_one.covarience
X_one_itteration = MSI_st_instance_one.X
MSI_st_instance_one.deltaXAsNsEas

#need to fix this and return _s_matrix and y_matrix

MSI_st_instance_two = stMSI.MSI_shocktube_optimization(
    cti_file, .01, 1, 1, working_directory, files_to_include,
    reaction_uncertainty_csv, rate_constant_target_value_data)
#
Exemple #2
0
import sys
sys.path.append(
    '.'
)  #get rid of this at some point with central test script or when package is built

import MSI.simulations.instruments.shock_tube as st
import MSI.cti_core.cti_processor as pr
import MSI.optimization.matrix_loader as ml
import MSI.optimization.opt_runner as opt
import MSI.simulations.absorbance.curve_superimpose as csp
import MSI.simulations.yaml_parser as yp
import MSI.optimization.shock_tube_optimization_shell as stMSI
import cantera as ct

MSI_st_instance = stMSI.MSI_shocktube_optimization(
    'FFCM1.cti', .01, 1, 1, 'MSI/data/test_data',
    [['Hong_4.yaml', 'Hong_4_abs.yaml'], ['Hong_1.yaml'],
     ['Troe_6.yaml', 'Troe_6_abs.yaml']], 'uncertainty_test.csv',
    'FFCM1_target_values.csv')
MSI_st_instance.one_run_shock_tube_optimization()
X = MSI_st_instance.X
Exemple #3
0
import numpy as np
#burke_target_value_test.csv
files_to_include = [['Hong_1.yaml']]
numer_of_iterations = 3
cti_file = 'chem_original_burke.cti'
working_directory = 'MSI/data/test_data'
reaction_uncertainty_csv = 'burke_uncertainty_test.csv'

rate_constant_target_value_data = ''
#this would be an empty string '' if you do not want to include it

#this could be 'On'

MSI_st_instance_one = stMSI.MSI_shocktube_optimization(
    cti_file, .01, 1, 1, working_directory, files_to_include,
    reaction_uncertainty_csv, '')
MSI_st_instance_one.one_run_shock_tube_optimization()

S_matrix_original = MSI_st_instance_one.S_matrix
exp_dict_list_original = MSI_st_instance_one.experiment_dictonaries
X_one_itteration = MSI_st_instance_one.X
experimental_dict_uncertainty_original = MSI_st_instance_one.experiment_dict_uncertainty_original
Y_matrix_original = MSI_st_instance_one.Y_matrix
OH = exp_dict_list_original[0]['simulation'].timeHistories[0]['OH']
time = exp_dict_list_original[0]['simulation'].timeHistories[0]['time']

Sij_list = []
Y_difference_list = []
S_new_list = []
S_percent_difference_list = []
file_list,folder_list = testing_class_instance.get_files_in_working_directory()

sigma_original_list = []
sigma_optimized_list = []
Y_comarison_list = []

for i,files in enumerate(file_list):

    
    yaml_file,cti_file,reaction_uncertainty_file,absorption_yaml_file = testing_class_instance.sorting_files(files)
    print(yaml_file,absorption_yaml_file)
    if absorption_yaml_file == None:
        MSI_st_instance_one = stMSI.MSI_shocktube_optimization(cti_file,
                                                           .01,
                                                           1,
                                                           1,
                                                           macroscopic_test_data_directory+'/'+folder_list[i],
                                                           [[yaml_file]],                 
                                                           reaction_uncertainty_file,'' )
        MSI_st_instance_one.one_run_shock_tube_optimization()
    else:
        MSI_st_instance_one = stMSI.MSI_shocktube_optimization(cti_file,
                                                           .01,
                                                           1,
                                                           1,
                                                           macroscopic_test_data_directory+'/'+folder_list[i],
                                                           [[yaml_file,absorption_yaml_file]],                 
                                                           reaction_uncertainty_file,'' )
        MSI_st_instance_one.one_run_shock_tube_optimization()