sol-9.dat: ODEs from Daniel

sol-9-check.dat: ODEs from model.c


In [1]:
import pandas as pd
pd.set_option('display.max_rows', None)
import numpy as np

In [2]:
species_list = ['time','T', 'ADIO', 'ADIOM2', 'ALD3', 'C10H2', 'C10H2M2', 'C10H2M4', 'C2H6', 'C3H4O', 'C3H4O2', 'C3H6', 'C3H6O2', 'C3H8O2', 
                'CH2CO', 'CH3CHO', 'CH3OH', 'CH4', 'CHAR', 'CO', 'CO2', 'COUMARYL', 'ETOH', 'H2', 'H2O', 'KET', 'KETD', 'KETDM2', 'KETM2', 
                'LIG', 'LIGC', 'LIGH', 'LIGM2', 'LIGO', 'MGUAI', 'OH', 'PADIO', 'PADIOM2', 'PC2H2', 'PCH2OH', 'PCH2P', 'PCH3', 'PCHO', 
                'PCHOHP', 'PCHP2', 'PCOH', 'PCOHP2', 'PCOS', 'PFET3', 'PFET3M2', 'PH2', 'PHENOL', 'PKETM2', 'PLIG', 'PLIGC', 'PLIGH', 
                'PLIGM2', 'PLIGO', 'PRADIO', 'PRADIOM2', 'PRFET3', 'PRFET3M2', 'PRKETM2', 'PRLIGH', 'PRLIGH2', 'PRLIGM2A', 'RADIO', 
                'RADIOM2', 'RC3H3O', 'RC3H5O2', 'RC3H7O2', 'RCH3', 'RCH3O', 'RKET', 'RKETM2', 'RLIGA', 'RLIGB', 'RLIGH', 'RLIGM2A', 
                'RLIGM2B', 'RMGUAI', 'RPHENOL', 'RPHENOX', 'RPHENOXM2', 'SYNAPYL', 'VADIO', 'VADIOM2', 'VCOUMARYL', 'VKET', 'VKETD', 
                'VKETDM2', 'VKETM2', 'VMGUAI', 'VPHENOL', 'VSYNAPYL']

In [3]:
daniel_file = pd.read_csv('sol-9.dat',delim_whitespace = True, header = None)
daniel_results = list(daniel_file.iloc[-2])
modelc_file = pd.read_csv('sol-9-check.dat',delim_whitespace = True, header = None)
modelc_results = list(modelc_file.iloc[-2])

In [4]:
results = pd.DataFrame({'species':species_list,'daniel':daniel_results,'modelc':modelc_results}).drop([0,1]).sort_values('species').reset_index(drop=True)

In [5]:
results.daniel[abs(results.daniel) < 1e-11] = 1e-11
results.modelc[abs(results.modelc) < 1e-11] = 1e-11

In [11]:
#error%
results['compare'] = results['daniel'] - results['modelc']

error = (results['daniel'].values - results['modelc'].values.astype(np.float))/results['modelc'].values.astype(float)
errlist = []
for i in error:
    percent = "{0:.2f}%".format(i * 100)
    errlist.append(percent)
results['error(%)'] = errlist

In [ ]:
results_comparison = pd.DataFrame()
results_comparison['species'] = results['species']
results_comparison['ddasac'] = ddasac_resort['ddasac']
#LSODA results and error%
results_comparison['LSODA'] = results['LSODA']
LSODA_error = (results_comparison['LSODA'].values - results_comparison['ddasac'].values.astype(np.float))/results_comparison['ddasac'].values.astype(float)
LSODA_errlist = []
for i in LSODA_error:
    percent = "{0:.2f}%".format(i * 100)
    LSODA_errlist.append(percent)
results_comparison['LSODA_error(%)'] = LSODA_errlist
#VODE results and error%
results_comparison['VODE'] = results['VODE']
VODE_error = (results_comparison['VODE'].values - results_comparison['ddasac'].values.astype(np.float))/results_comparison['ddasac'].values.astype(float)
VODE_errlist = []
for i in VODE_error:
    percent = "{0:.2f}%".format(i * 100)
    VODE_errlist.append(percent)
results_comparison['VODE_error(%)'] = VODE_errlist

#LSODA and VODE error compare%
compare_error = LSODA_error - VODE_error
compare_errlist = []
for i in compare_error:
    percent = "{0:.8f}%".format(i * 100)
    compare_errlist.append(percent)
results_comparison['LSODA-VODE(%)'] = compare_errlist

#results_comparison.to_csv('results_comparison.csv',index = False)

In [12]:
results


Out[12]:
daniel modelc species compare error(%)
0 1e-11 1e-11 ADIO 0 0.00%
1 1e-11 1e-11 ADIOM2 0 0.00%
2 0.396827 0.396827 ALD3 0 0.00%
3 0.000539486 0.000539486 C10H2 0 0.00%
4 0.00374461 0.00374461 C10H2M2 1e-10 0.00%
5 0.0271664 0.0271664 C10H2M4 2e-10 0.00%
6 0.0207198 0.0207198 C2H6 -8e-10 -0.00%
7 0.00122696 0.00122696 C3H4O 0 0.00%
8 0.17845 0.17845 C3H4O2 1.11e-08 0.00%
9 0.0523593 0.0523593 C3H6 0 0.00%
10 0.0177942 0.0177942 C3H6O2 -1e-10 -0.00%
11 0.00209681 0.00209681 C3H8O2 0 0.00%
12 1.41697 1.41697 CH2CO 0 0.00%
13 0.251867 0.251867 CH3CHO 2.5e-09 0.00%
14 0.768701 0.768701 CH3OH -1.22e-08 -0.00%
15 0.00805898 0.00805897 CH4 1.5e-09 0.00%
16 1.56716 1.56716 CHAR -2.1e-09 -0.00%
17 0.096441 0.096441 CO -3e-10 -0.00%
18 0.464419 0.464419 CO2 9e-10 0.00%
19 0.00679501 0.00679501 COUMARYL -2e-10 -0.00%
20 0.0508357 0.0508357 ETOH 2.1e-09 0.00%
21 3.02556 3.02556 H2 -3.2e-09 -0.00%
22 2.42788 2.42788 H2O -4.7e-09 -0.00%
23 3.32e-08 3.32e-08 KET 0 0.00%
24 0.596479 0.596479 KETD -6.3e-09 -0.00%
25 0.0276075 0.0276075 KETDM2 0 0.00%
26 1e-11 1e-11 KETM2 0 0.00%
27 3.32e-08 3.32e-08 LIG 0 0.00%
28 0.000247643 0.000247643 LIGC -1e-10 -0.00%
29 1e-11 1e-11 LIGH 0 0.00%
30 1e-11 1e-11 LIGM2 0 0.00%
31 1e-11 1e-11 LIGO 0 0.00%
32 0.011831 0.011831 MGUAI 1e-10 0.00%
33 4.549e-07 4.549e-07 OH 0 0.00%
34 0.00110623 0.00110623 PADIO -1e-10 -0.00%
35 0.000616318 0.000616318 PADIOM2 0 0.00%
36 0.909904 0.909904 PC2H2 -5.6e-09 -0.00%
37 1e-11 1e-11 PCH2OH 0 0.00%
38 0.208547 0.208547 PCH2P 2e-09 0.00%
39 1.07e-08 1.08e-08 PCH3 -1e-10 -0.93%
40 3.96e-07 3.96e-07 PCHO 0 0.00%
41 1e-11 1e-11 PCHOHP 0 0.00%
42 0.153411 0.153411 PCHP2 5e-10 0.00%
43 1.85988 1.85988 PCOH -7.3e-09 -0.00%
44 1e-11 1e-11 PCOHP2 0 0.00%
45 2.58018 2.58018 PCOS -4e-09 -0.00%
46 1.66e-08 1.66e-08 PFET3 0 0.00%
47 1e-11 1e-11 PFET3M2 0 0.00%
48 2.6015 2.6015 PH2 -8.5e-09 -0.00%
49 0.0453462 0.0453462 PHENOL 2.4e-09 0.00%
50 1e-11 1e-11 PKETM2 0 0.00%
51 4.2e-09 4.2e-09 PLIG 0 0.00%
52 1e-11 1e-11 PLIGC 0 0.00%
53 1e-11 1e-11 PLIGH 0 0.00%
54 1e-11 1e-11 PLIGM2 0 0.00%
55 1e-11 1e-11 PLIGO 0 0.00%
56 0.00448635 0.00448635 PRADIO 0 0.00%
57 0.00145561 0.00145561 PRADIOM2 0 0.00%
58 1.67e-08 1.69e-08 PRFET3 -2e-10 -1.18%
59 1e-11 1e-11 PRFET3M2 0 0.00%
60 1e-11 1e-11 PRKETM2 0 0.00%
61 1e-11 1e-11 PRLIGH 0 0.00%
62 1e-11 1e-11 PRLIGH2 0 0.00%
63 1e-11 1e-11 PRLIGM2A 0 0.00%
64 1e-11 1e-11 RADIO 0 0.00%
65 1e-11 1e-11 RADIOM2 0 0.00%
66 1.38909e-05 1.38909e-05 RC3H3O 0 0.00%
67 6.4e-09 6.4e-09 RC3H5O2 0 0.00%
68 1e-11 1e-11 RC3H7O2 0 0.00%
69 2.0202e-06 2.0202e-06 RCH3 0 0.00%
70 2.16185e-05 2.16185e-05 RCH3O 0 0.00%
71 1.12e-08 1.12e-08 RKET 0 0.00%
72 1e-11 1e-11 RKETM2 0 0.00%
73 1.68e-08 1.67e-08 RLIGA 1e-10 0.60%
74 8.365e-07 8.365e-07 RLIGB 0 0.00%
75 1e-11 1e-11 RLIGH 0 0.00%
76 1e-11 1e-11 RLIGM2A 0 0.00%
77 1e-11 1e-11 RLIGM2B 0 0.00%
78 1e-11 1e-11 RMGUAI 0 0.00%
79 6.73586e-05 6.73586e-05 RPHENOL 0 0.00%
80 0.00165876 0.00165876 RPHENOX 1e-10 0.00%
81 1e-11 1e-11 RPHENOXM2 0 0.00%
82 0.0174843 0.0174843 SYNAPYL 1e-10 0.00%
83 1.0476e-06 1.0476e-06 VADIO 0 0.00%
84 0.000504355 0.000504355 VADIOM2 0 0.00%
85 0.000218649 0.000218649 VCOUMARYL 0 0.00%
86 0.00108214 0.00108214 VKET -1e-10 -0.00%
87 0.0180158 0.0180158 VKETD -2e-10 -0.00%
88 0.261082 0.261082 VKETDM2 6e-10 0.00%
89 3.59538e-05 3.59538e-05 VKETM2 0 0.00%
90 0.00734225 0.00734225 VMGUAI 1e-10 0.00%
91 0.0999733 0.0999733 VPHENOL 7.6e-09 0.00%
92 0.0456204 0.0456204 VSYNAPYL 1e-10 0.00%

In [ ]:


In [ ]:


In [ ]:


In [ ]: