|
114 | 114 | "\n", |
115 | 115 | "$$\\Delta G = \\frac{1}{\\sqrt{12}}(G_{max} - G_{min})$$\n", |
116 | 116 | "\n", |
117 | | - "Several parameters are used to formulate $\\Delta G$. These are $\\Delta G_\\mathrm{library}$, $\\Delta G_\\mathrm{QM}$, $\\Delta G_\\mathrm{GAV}$, and $\\Delta _\\mathrm{group}$.\n", |
| 117 | + "But first, to formulate $G$, we need to compile all the uncertainty sources. These are $ G_\\mathrm{library}$, $ G_\\mathrm{QM}$, $ G_\\mathrm{GAV}$, and $G _\\mathrm{group}$. We treat each as continuous random variable and add them to get the species uncertainty.\n", |
118 | 118 | " \n", |
119 | | - "$$\\Delta G = \\delta_\\mathrm{library} \\Delta G_\\mathrm{library} + \\delta_\\mathrm{QM} \\Delta G_\\mathrm{QM} + \\delta_\\mathrm{GAV} \\left( \\Delta G_\\mathrm{GAV} + \\sum_{\\mathrm{group}\\; j} d_{j} \\Delta G_{\\mathrm{group},j} \\right)$$\n", |
| 119 | + "$$G = \\delta_\\mathrm{library} G_\\mathrm{library} + \\delta_\\mathrm{QM} G_\\mathrm{QM} + \\delta_\\mathrm{GAV} \\left( G_\\mathrm{GAV} + \\sum_{\\mathrm{group}\\; j} d_{j} G_{\\mathrm{group},j} \\right)$$\n", |
| 120 | + "\n", |
| 121 | + "Here $\\delta$ is the Kronecker delta function which equals one if the species thermochemistry parameter contains the particular source type and $d_{j}$ is the degeneracy (number of appearances) of the thermo group used to construct the species thermochemistry in the group additivity method.\n", |
| 122 | + "\n", |
| 123 | + "To compute $\\Delta G$, we'll use the property that the variance of the sum of two random variables, $X$ and $Y$, is:\n", |
| 124 | + "$$Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y)$$\n", |
| 125 | + "\n", |
| 126 | + "If we assume that each uncertainty source is uncorrelated with the others, then the covariance term drops out:\n", |
| 127 | + "\n", |
| 128 | + "$$Var(X+Y)=Var(X)+Var(Y), \\ \\ \\ \\ \\ X \\neq Y$$\n", |
| 129 | + "\n", |
| 130 | + "And we can compute the variance of $G$:\n", |
| 131 | + "\n", |
| 132 | + "$$Var(G) = \\delta_\\mathrm{library} Var(G_\\mathrm{library}) + \\delta_\\mathrm{QM} Var(G_\\mathrm{QM})+\\delta_\\mathrm{GAV} \\left(Var(G_\\mathrm{GAV}) +\\sum_{group\\ j} d_j^2 Var(G_\\mathrm{group\\ j}) \\right)$$\n", |
| 133 | + "\n", |
| 134 | + "\n", |
| 135 | + "The standard deviation $\\Delta G$ is then the square root of that (this is an example of adding in quadrature):\n", |
| 136 | + "$$\\Delta(G) = \\sqrt{\\delta_\\mathrm{library} Var(G_\\mathrm{library}) + \\delta_\\mathrm{QM} Var(G_\\mathrm{QM})+\\delta_\\mathrm{GAV} \\left(Var(G_\\mathrm{GAV}) +\\sum_{group\\ j} d_j^2 Var(G_\\mathrm{group\\ j}) \\right)}$$\n", |
| 137 | + "\n", |
| 138 | + "\n", |
120 | 139 | "\n", |
121 | | - "where $\\delta$ is the Kronecker delta function which equals one if the species thermochemistry parameter contains the particular source type and $d_{j}$ is the degeneracy (number of appearances) of the thermo group used to construct the species thermochemistry in the group additivity method.\n", |
122 | 140 | "\n", |
123 | 141 | "### Kinetics Uncertainty\n", |
124 | 142 | "\n", |
|
130 | 148 | "\n", |
131 | 149 | "$$\\Delta \\ln(k) = \\frac{1}{\\sqrt{12}}(\\ln k_{max} - \\ln k_{min})$$\n", |
132 | 150 | "\n", |
133 | | - "The parameters used to formulate $\\Delta \\ln k$ are $\\Delta \\ln k_\\mathrm{library}$, $\\Delta \\ln k_\\mathrm{training}$, $\\Delta \\ln k_\\mathrm{pdep}$, $\\Delta \\ln k_\\mathrm{family}$, $\\Delta \\ln k_\\mathrm{non-exact}$, and $\\Delta \\ln k_\\mathrm{rule}$.\n", |
| 151 | + "The sources used to formulate $ \\ln k$ are $ \\ln k_\\mathrm{library}$, $ \\ln k_\\mathrm{training}$, $ \\ln k_\\mathrm{pdep}$, $ \\ln k_\\mathrm{family}$, $ \\ln k_\\mathrm{non-exact}$, and $ \\ln k_\\mathrm{rule}$.\n", |
| 152 | + "\n", |
| 153 | + "For library, training, and pdep reactions, the kinetic uncertainty is assigned according to their uncertainty type. For kinetics estimated using RMG's rate rules, the following formula is used to calculate the uncertainty:\n", |
| 154 | + "\n", |
| 155 | + "$$ \\ln k_\\mathrm{rate\\; rules} = \\ln k_\\mathrm{family} + \\log_{10}(N+1) \\left(\\ln k_\\mathrm{non-exact}\\right) + \\sum_{\\mathrm{rule}\\; i} w_i \\ln k_{\\mathrm{rule},i}$$\n", |
134 | 156 | "\n", |
135 | | - "For library, training, and pdep reactions, the kinetic uncertainty is assigned according to their uncertainty type. For kinetics estimated using RMG's rate rules, the following formula is used to calculate the uncertainty:\n", |
| 157 | + "where N is the total number of rate rules used and $w_{i}$ is the weight of the rate rule in the averaging scheme for that kinetics estimate.\n", |
136 | 158 | "\n", |
137 | | - "$$\\Delta \\ln k_\\mathrm{rate\\; rules} = \\Delta\\ln k_\\mathrm{family} + \\log_{10}(N+1) \\left(\\Delta\\ln k_\\mathrm{non-exact}\\right) + \\sum_{\\mathrm{rule}\\; i} w_i \\Delta \\ln k_{\\mathrm{rule},i}$$\n", |
| 159 | + "Once again we use the property of adding variances with the assumption that sources are uncorrelated to each other. The standard deviation then adds in quadrature.\n", |
138 | 160 | "\n", |
139 | | - "where N is the total number of rate rules used and $w_{i}$ is the weight of the rate rule in the averaging scheme for that kinetics estimate. " |
| 161 | + "$$\\Delta\\ln k_\\mathrm{rate\\; rules} = \\sqrt{(\\Delta \\ln k_\\mathrm{family})^2 + \\left(\\log_{10}(N+1) \\right)^2\\left(\\Delta \\ln k_\\mathrm{non-exact}\\right)^2 + \\sum_{\\mathrm{rule}\\; i} w_i^2 (\\Delta \\ln k_{\\mathrm{rule},i})^2}$$\n", |
| 162 | + "\n", |
| 163 | + "\n", |
| 164 | + "\n" |
140 | 165 | ] |
141 | 166 | }, |
142 | 167 | { |
143 | 168 | "cell_type": "code", |
144 | 169 | "execution_count": null, |
145 | 170 | "metadata": {}, |
146 | | - "outputs": [], |
| 171 | + "outputs": [ |
| 172 | + { |
| 173 | + "name": "stderr", |
| 174 | + "output_type": "stream", |
| 175 | + "text": [ |
| 176 | + "WARNING:root:Cphigh is above the theoretical CpInf value for ThermoData object\n", |
| 177 | + "ThermoData(Tdata=([300,400,500,600,800,1000,1500],'K'), Cpdata=([60.2599,68.0494,74.7775,80.9311,90.8846,97.4337,105.393],'J/(mol*K)'), H298=(-477.191,'kJ/mol'), S298=(269.551,'J/(mol*K)'), Cp0=(33.2579,'J/(mol*K)'), CpInf=(103.931,'J/(mol*K)'), comment=\"\"\"Thermo group additivity estimation: group(O2s-(Cds-Cd)(Cds-Cd)) + group(O2s-(Cds-O2d)H) + group(Cds-OdOsOs) + group(Li-OCOdO) + radical(OC=OOJ)\"\"\").\n", |
| 178 | + "The thermo for this species is probably wrong! Setting CpInf = Cphigh for Entropy calculationat T = 1666.6666666666665 K...\n" |
| 179 | + ] |
| 180 | + } |
| 181 | + ], |
147 | 182 | "source": [ |
148 | 183 | "# NOTE: You must load the database with the same settings which were used to generate the model.\n", |
149 | 184 | "# This includes any thermo or kinetics libraries which were used.\n", |
|
178 | 213 | { |
179 | 214 | "cell_type": "code", |
180 | 215 | "execution_count": null, |
181 | | - "metadata": { |
182 | | - "scrolled": true |
183 | | - }, |
| 216 | + "metadata": {}, |
184 | 217 | "outputs": [], |
185 | 218 | "source": [ |
186 | 219 | "result = uncertainty.local_analysis(sensitive_species, correlated=False, number=5, fileformat='.png')\n", |
|
190 | 223 | { |
191 | 224 | "cell_type": "code", |
192 | 225 | "execution_count": null, |
193 | | - "metadata": { |
194 | | - "scrolled": true |
195 | | - }, |
| 226 | + "metadata": {}, |
196 | 227 | "outputs": [], |
197 | 228 | "source": [ |
198 | 229 | "# Show the uncertainty plots\n", |
|
230 | 261 | { |
231 | 262 | "cell_type": "code", |
232 | 263 | "execution_count": null, |
233 | | - "metadata": { |
234 | | - "scrolled": true |
235 | | - }, |
| 264 | + "metadata": {}, |
236 | 265 | "outputs": [], |
237 | 266 | "source": [ |
238 | 267 | "uncertainty.assign_parameter_uncertainties(correlated=True)\n", |
|
243 | 272 | { |
244 | 273 | "cell_type": "code", |
245 | 274 | "execution_count": null, |
246 | | - "metadata": { |
247 | | - "scrolled": true |
248 | | - }, |
| 275 | + "metadata": {}, |
249 | 276 | "outputs": [], |
250 | 277 | "source": [ |
251 | 278 | "# Show the uncertainty plots\n", |
|
0 commit comments