Fix code formatting of some text in tutorial

This commit is contained in:
Bryan W. Weber 2017-09-01 10:48:42 -04:00
parent 4fcaf84563
commit f59c7eb5bb
No known key found for this signature in database
GPG key ID: 3A93E209C87E1FE7

View file

@ -57,7 +57,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"To view the state of the mixture, *call* the **gas1** object as if it were a function:"
"To view the state of the mixture, *call* the `gas1` object as if it were a function:"
]
},
{
@ -102,11 +102,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"What you have just done is created an object **gas1** that implements GRI-Mech 3.0, the 53-species, 325-reaction natural gas combustion mechanism developed by Gregory P. Smith, David M. Golden, Michael Frenklach, Nigel W. Moriarty, Boris Eiteneer, Mikhail Goldenberg, C. Thomas Bowman, Ronald K. Hanson, Soonho Song, William C. Gardiner, Jr., Vitali V. Lissianski, and Zhiwei Qin. See the [GRI-Mech Home Page](http://combustion.berkeley.edu/gri-mech/) for more information.\n",
"What you have just done is created an object `gas1` that implements GRI-Mech 3.0, the 53-species, 325-reaction natural gas combustion mechanism developed by Gregory P. Smith, David M. Golden, Michael Frenklach, Nigel W. Moriarty, Boris Eiteneer, Mikhail Goldenberg, C. Thomas Bowman, Ronald K. Hanson, Soonho Song, William C. Gardiner, Jr., Vitali V. Lissianski, and Zhiwei Qin. See the [GRI-Mech Home Page](http://combustion.berkeley.edu/gri-mech/) for more information.\n",
"\n",
"The **gas1** object has properties you would expect for a gas mixture: a temperature, a pressure, species mole and mass fractions, etc. As we will soon see, it has many more properties.\n",
"The `gas1` object has properties you would expect for a gas mixture: a temperature, a pressure, species mole and mass fractions, etc. As we will soon see, it has many more properties.\n",
"\n",
"The summary of the state of **gas1** that you found above shows that the new objects created from the **gri30.xml** input file start out with a temperature of 300 K, a pressure of 1 atm, and have a composition that consists of only one species, in this case hydrogen. There is nothing special about H2 - it just happens to be the first species listed in the input file defining GRI-Mech 3.0. In general, whichever species is listed first will initially have a mole fraction of 1.0, and all others will be zero."
"The summary of the state of `gas1` that you found above shows that the new objects created from the `gri30.xml` input file start out with a temperature of 300 K, a pressure of 1 atm, and have a composition that consists of only one species, in this case hydrogen. There is nothing special about H2 - it just happens to be the first species listed in the input file defining GRI-Mech 3.0. In general, whichever species is listed first will initially have a mole fraction of 1.0, and all others will be zero."
]
},
{
@ -309,7 +309,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Mass and mole fractions can also be set using the **`dict`** objects, for cases where the composition is stored in a variable or being computed:"
"Mass and mole fractions can also be set using the `dict` object, for cases where the composition is stored in a variable or being computed:"
]
},
{
@ -414,7 +414,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"When setting the state, you can control what properties are held constant by passing the special value **`None`** to the property setter. For example, to change the specific volume to 2.1 m^3/kg while holding entropy constant:"
"When setting the state, you can control what properties are held constant by passing the special value `None` to the property setter. For example, to change the specific volume to 2.1 m<sup>3</sup>/kg while holding entropy constant:"
]
},
{
@ -432,7 +432,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Or to set the mass fractions while holding temperatures and pressure constant:"
"Or to set the mass fractions while holding temperature and pressure constant:"
]
},
{
@ -457,7 +457,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Many properties of a [Solution](http://cantera.github.io/docs/sphinx/html/cython/importing.html#cantera.Solution) provide values for each species present in the phase. If you want to get values only for a subset of these species, you can use Python's \"slicing\" syntax to select data for just the species of interest. To get the mole fractions of just the major species in **`gas1`**, in the order specified, you can write:"
"Many properties of a [`Solution`](http://cantera.github.io/docs/sphinx/html/cython/importing.html#cantera.Solution) provide values for each species present in the phase. If you want to get values only for a subset of these species, you can use Python's \"slicing\" syntax to select data for just the species of interest. To get the mole fractions of just the major species in `gas1`, in the order specified, you can write:"
]
},
{
@ -509,9 +509,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In the previous example, we created an object that models an ideal gas mixture with the species and reactions of GRI-Mech 3.0, using the `gri30.xml` input file included with Cantera. This is a \"pre-processed\" XML input file written in a format that is easy for Cantera to parse. Cantera also supports an input file format that is easier to write, called *CTI*. Several reaction mechanism files in this format are included with Cantera, including ones that model high-temperature air, a hydrogen/oxygen reaction mechanism, and a few surface reaction mechanisms. These files are usually located in the `data` subdirectory of the Cantera installation directory, e.g. `C:\\\\Program Files\\\\Cantera\\\\data` on Windows or `/usr/local/cantera/data/` on Unix/Linux/Mac OS X machines, depending on how you installed Cantera and the options you specified.\n",
"In the previous example, we created an object that models an ideal gas mixture with the species and reactions of GRI-Mech 3.0, using the `gri30.xml` input file included with Cantera. This is a \"pre-processed\" XML input file written in a format that is easy for Cantera to parse, but hard for humans to write. Cantera also supports an input file format that is easier for humans to write, called *CTI*. Several reaction mechanism files in this format are included with Cantera, including ones that model high-temperature air, a hydrogen/oxygen reaction mechanism, and a few surface reaction mechanisms. These files are usually located in the `data` subdirectory of the Cantera installation directory, e.g. `C:\\\\Program Files\\\\Cantera\\\\data` on Windows or `/usr/local/cantera/data/` on Unix/Linux/Mac OS X machines, depending on how you installed Cantera and the options you specified.\n",
"\n",
"If, for some reason, Cantera has difficulty finding where these files are on your system, set environment variable `CANTERA_DATA` to the directory or directories (separated using `;` on Windows or `:` on other operating systems) where they are located. Alternatively, you can call function **[add_directory](http://cantera.github.io/docs/sphinx/html/cython/importing.html#cantera.add_directory)** to add a directory to the Cantera search path:"
"If, for some reason, Cantera has difficulty finding where these files are on your system, set environment variable `CANTERA_DATA` to the directory or directories (separated using `;` on Windows or `:` on other operating systems) where they are located. Alternatively, you can call function [`add_directory`](http://cantera.github.io/docs/sphinx/html/cython/importing.html#cantera.add_directory) to add a directory to the Cantera search path:"
]
},
{
@ -551,7 +551,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that the bulk (i.e., 3D or homogenous) phases that participate in the surface reactions must also be passed as arguments to **[Interface](http://cantera.github.io/docs/sphinx/html/cython/importing.html#cantera.Interface)**."
"Note that the bulk (i.e., 3D or homogenous) phases that participate in the surface reactions must also be passed as arguments to [`Interface`](http://cantera.github.io/docs/sphinx/html/cython/importing.html#cantera.Interface)."
]
},
{
@ -587,9 +587,7 @@
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"g = ct.Solution('gri30.xml')"
@ -1987,9 +1985,9 @@
"metadata": {},
"source": [
"Other options are:\n",
"* 'UV' for fixed specific internal energy and specific volume\n",
"* 'SV' for fixed specific entropy and specific volume\n",
"* 'SP' for fixed specific entropy and pressure\n",
"* `'UV'` for fixed specific internal energy and specific volume\n",
"* `'SV'` for fixed specific entropy and specific volume\n",
"* `'SP'` for fixed specific entropy and pressure\n",
"\n",
"How can you tell if `equilibrate` has correctly found the chemical equilibrium state? One way is to verify that the net rates of progress of all reversible reactions are zero. Here is the code to do this:"
]
@ -2017,313 +2015,313 @@
"name": "stdout",
"output_type": "stream",
"text": [
" 0 -3.523e-16 \n",
" 1 3.517e-15 \n",
" 2 1.968e-15 \n",
" 3 1.667e-15 \n",
" 4 -3.976e-15 \n",
" 5 3.257e-15 \n",
" 6 1.047e-14 \n",
" 7 1.227e-14 \n",
" 8 1.066e-14 \n",
" 9 -7.14e-15 \n",
" 10 -9.658e-15 \n",
" 11 -2.026e-15 \n",
" 12 1.72e-15 \n",
" 13 -3.656e-15 \n",
" 14 3.864e-15 \n",
" 15 -5.203e-15 \n",
" 16 -8.891e-15 \n",
" 17 9.887e-15 \n",
" 18 1.468e-14 \n",
" 19 5.152e-15 \n",
" 20 -8.548e-15 \n",
" 21 -3.979e-15 \n",
" 22 -5.502e-15 \n",
" 23 -3.935e-15 \n",
" 24 7.261e-15 \n",
" 25 1.575e-15 \n",
" 26 5.639e-16 \n",
" 27 1.851e-14 \n",
" 28 -7.515e-15 \n",
" 29 -3.248e-15 \n",
" 30 -1.01e-14 \n",
" 31 1.118e-15 \n",
" 32 1.244e-15 \n",
" 33 1.414e-15 \n",
" 34 1.087e-15 \n",
" 35 1.368e-15 \n",
" 37 2.706e-15 \n",
" 38 3.131e-15 \n",
" 39 3.087e-15 \n",
" 40 -4.038e-16 \n",
" 41 6.529e-15 \n",
" 42 1.232e-15 \n",
" 43 1.752e-16 \n",
" 44 -1.633e-15 \n",
" 45 -1.445e-15 \n",
" 46 -3.294e-15 \n",
" 47 -4.786e-15 \n",
" 48 1.783e-15 \n",
" 49 4.888e-15 \n",
" 50 5.753e-16 \n",
" 51 1.002e-14 \n",
" 52 -1.482e-14 \n",
" 53 -5.721e-15 \n",
" 54 5.229e-15 \n",
" 55 8.253e-15 \n",
" 56 1.293e-14 \n",
" 57 5.256e-15 \n",
" 58 -5.61e-15 \n",
" 59 3.572e-15 \n",
" 60 2.735e-15 \n",
" 61 -3.477e-15 \n",
" 62 -1.641e-14 \n",
" 63 -1.169e-14 \n",
" 64 -8.777e-15 \n",
" 65 -8.647e-15 \n",
" 66 -1.53e-14 \n",
" 67 1.754e-14 \n",
" 68 1.592e-14 \n",
" 69 5.17e-15 \n",
" 70 1.238e-15 \n",
" 71 -5.735e-15 \n",
" 72 -3.452e-15 \n",
" 73 1.267e-14 \n",
" 74 1.141e-14 \n",
" 75 -2.325e-15 \n",
" 76 -7.411e-15 \n",
" 77 -5.045e-15 \n",
" 78 3.647e-15 \n",
" 79 4.799e-16 \n",
" 80 1.113e-14 \n",
" 81 8.567e-16 \n",
" 82 -1.085e-14 \n",
" 83 2.398e-16 \n",
" 84 2.703e-15 \n",
" 85 1.714e-15 \n",
" 86 -1.946e-15 \n",
" 87 -2.819e-15 \n",
" 88 -2.815e-15 \n",
" 89 1.145e-15 \n",
" 90 8.714e-15 \n",
" 91 -3.909e-16 \n",
" 92 7.483e-15 \n",
" 93 -3.751e-15 \n",
" 94 -7.769e-15 \n",
" 95 -5.841e-15 \n",
" 96 -5.887e-15 \n",
" 97 -7.884e-15 \n",
" 98 -6.511e-15 \n",
" 99 -3.743e-15 \n",
" 100 5.4e-15 \n",
" 101 -1.078e-14 \n",
" 102 -1.433e-14 \n",
" 103 1.765e-14 \n",
" 104 1.634e-14 \n",
" 105 -4.961e-15 \n",
" 106 -7.888e-15 \n",
" 107 -8.536e-15 \n",
" 108 -2.246e-15 \n",
" 109 3.43e-15 \n",
" 110 -3.533e-15 \n",
" 111 4.954e-15 \n",
" 112 8.932e-15 \n",
" 113 8.103e-16 \n",
" 114 6.894e-15 \n",
" 115 6.857e-15 \n",
" 116 7.082e-15 \n",
" 117 5.337e-15 \n",
" 118 7.972e-15 \n",
" 119 -7.05e-15 \n",
" 120 8.362e-15 \n",
" 121 8.724e-15 \n",
" 122 3.169e-15 \n",
" 123 1.498e-15 \n",
" 124 5.664e-15 \n",
" 125 -9.18e-16 \n",
" 126 -6.89e-15 \n",
" 127 8.95e-15 \n",
" 128 5.307e-15 \n",
" 129 -1.608e-14 \n",
" 130 -6.056e-15 \n",
" 131 -3.569e-15 \n",
" 132 -2.092e-15 \n",
" 133 1.477e-14 \n",
" 135 2.863e-15 \n",
" 136 6.742e-15 \n",
" 137 -5.457e-15 \n",
" 138 -2e-15 \n",
" 139 9.941e-16 \n",
" 140 1.791e-14 \n",
" 141 1.717e-16 \n",
" 143 1.282e-14 \n",
" 144 7.28e-15 \n",
" 145 3.122e-15 \n",
" 146 -2.349e-15 \n",
" 147 0 \n",
" 148 -5.316e-15 \n",
" 149 -2.234e-15 \n",
" 150 1.498e-16 \n",
" 151 1.669e-16 \n",
" 152 7.176e-15 \n",
" 153 8.489e-15 \n",
" 154 1.237e-14 \n",
" 155 1.843e-15 \n",
" 156 1.168e-14 \n",
" 157 1.859e-15 \n",
" 158 5.272e-15 \n",
" 159 1.908e-14 \n",
" 160 7.055e-15 \n",
" 161 6.168e-15 \n",
" 162 1.769e-14 \n",
" 163 1.363e-14 \n",
" 164 9.954e-15 \n",
" 165 -7.023e-16 \n",
" 166 -9.573e-16 \n",
" 167 1.296e-14 \n",
" 168 -1.298e-15 \n",
" 169 -1.165e-16 \n",
" 170 -3.422e-15 \n",
" 171 2.924e-15 \n",
" 172 -6.997e-15 \n",
" 173 3.826e-15 \n",
" 174 -1.127e-14 \n",
" 175 7.843e-15 \n",
" 176 1.905e-14 \n",
" 177 3.947e-15 \n",
" 178 2.14e-15 \n",
" 179 -1.278e-16 \n",
" 180 5.412e-15 \n",
" 181 -1.486e-15 \n",
" 182 2.376e-15 \n",
" 183 -5.369e-15 \n",
" 184 7.497e-16 \n",
" 185 5.032e-15 \n",
" 186 3.142e-15 \n",
" 187 -1.857e-15 \n",
" 188 1.647e-16 \n",
" 189 0 \n",
" 190 -4.155e-16 \n",
" 191 2.79e-15 \n",
" 192 -9.124e-16 \n",
" 193 5.714e-15 \n",
" 194 1.285e-16 \n",
" 195 -1.533e-15 \n",
" 196 8.673e-15 \n",
" 197 3.874e-15 \n",
" 198 4.242e-15 \n",
" 199 1.016e-15 \n",
" 200 3.335e-15 \n",
" 201 2.287e-15 \n",
" 202 2.877e-15 \n",
" 203 -5.853e-15 \n",
" 204 -5.634e-15 \n",
" 205 -8.771e-15 \n",
" 206 1.975e-15 \n",
" 207 -3.69e-15 \n",
" 208 1.739e-15 \n",
" 209 3.542e-15 \n",
" 210 3.663e-15 \n",
" 211 6.307e-15 \n",
" 212 -5.348e-15 \n",
" 213 1.631e-15 \n",
" 214 -1.077e-14 \n",
" 215 -8.503e-15 \n",
" 216 5.191e-15 \n",
" 217 1.356e-15 \n",
" 218 -6.15e-15 \n",
" 219 1.09e-14 \n",
" 220 -2.553e-15 \n",
" 221 -5.329e-15 \n",
" 222 -2.225e-15 \n",
" 223 -2.79e-15 \n",
" 224 -3.45e-15 \n",
" 225 -7.203e-15 \n",
" 226 -5.324e-15 \n",
" 227 -3.987e-15 \n",
" 228 -3.604e-15 \n",
" 229 1.934e-15 \n",
" 230 5.822e-15 \n",
" 231 3.215e-15 \n",
" 232 4.562e-15 \n",
" 233 4.919e-15 \n",
" 234 -6.439e-15 \n",
" 0 5.285e-16 \n",
" 1 -3.147e-15 \n",
" 2 -2.362e-15 \n",
" 3 -1.667e-15 \n",
" 4 4.733e-15 \n",
" 5 1.065e-14 \n",
" 6 7.075e-15 \n",
" 7 -2.011e-16 \n",
" 8 1.046e-14 \n",
" 9 1.745e-15 \n",
" 10 8.84e-15 \n",
" 11 5.404e-16 \n",
" 12 -3.656e-15 \n",
" 13 -3.441e-15 \n",
" 14 1.932e-15 \n",
" 15 5.203e-15 \n",
" 16 3.312e-15 \n",
" 17 -1.808e-14 \n",
" 18 -1.598e-14 \n",
" 19 -1.07e-14 \n",
" 20 7.04e-15 \n",
" 21 1.265e-14 \n",
" 22 7.091e-15 \n",
" 23 2.623e-16 \n",
" 24 1.028e-14 \n",
" 25 6.891e-15 \n",
" 26 5.921e-15 \n",
" 27 2.879e-15 \n",
" 28 8.738e-16 \n",
" 29 6.928e-15 \n",
" 30 -2.736e-15 \n",
" 31 2.515e-15 \n",
" 32 2.115e-15 \n",
" 33 8.353e-15 \n",
" 34 8.335e-15 \n",
" 35 8.207e-15 \n",
" 37 -2.829e-15 \n",
" 38 1.423e-16 \n",
" 39 3.43e-16 \n",
" 40 3.903e-15 \n",
" 41 -3.341e-15 \n",
" 42 5.475e-16 \n",
" 43 -3.504e-15 \n",
" 44 -5.306e-15 \n",
" 45 -3.81e-15 \n",
" 46 7.042e-15 \n",
" 47 6.951e-15 \n",
" 48 5.15e-15 \n",
" 49 1.929e-15 \n",
" 50 -5.408e-15 \n",
" 51 -4.728e-15 \n",
" 52 4.812e-15 \n",
" 53 -1.395e-15 \n",
" 54 -7.24e-15 \n",
" 55 -1.122e-14 \n",
" 56 -8.41e-15 \n",
" 57 -2.878e-15 \n",
" 58 1.857e-14 \n",
" 59 1.409e-14 \n",
" 60 9.723e-15 \n",
" 61 3.338e-15 \n",
" 62 1.655e-14 \n",
" 63 -1.881e-15 \n",
" 64 1.077e-14 \n",
" 65 7.982e-15 \n",
" 66 1.713e-15 \n",
" 67 -2.162e-14 \n",
" 68 -1.374e-14 \n",
" 69 -1.379e-14 \n",
" 70 5.819e-15 \n",
" 71 7.647e-15 \n",
" 72 -5.403e-15 \n",
" 73 -5.381e-15 \n",
" 74 -7.317e-15 \n",
" 75 -6.764e-15 \n",
" 76 8.83e-15 \n",
" 77 2.803e-15 \n",
" 78 -2.353e-16 \n",
" 79 -3.039e-15 \n",
" 80 8.536e-15 \n",
" 81 -3.427e-15 \n",
" 82 7.58e-15 \n",
" 83 4.796e-15 \n",
" 84 5.406e-16 \n",
" 85 5.275e-16 \n",
" 86 -6.901e-15 \n",
" 87 -1.658e-15 \n",
" 88 -1.72e-15 \n",
" 89 7.25e-15 \n",
" 90 1.447e-14 \n",
" 91 8.796e-15 \n",
" 92 -3.166e-15 \n",
" 93 8.89e-15 \n",
" 94 7.953e-15 \n",
" 95 -6.425e-15 \n",
" 96 -6.243e-15 \n",
" 97 3.487e-15 \n",
" 98 0 \n",
" 99 -1.069e-14 \n",
" 100 1.697e-15 \n",
" 101 1.078e-14 \n",
" 102 1.072e-14 \n",
" 103 -1.094e-14 \n",
" 104 -1.537e-14 \n",
" 105 -5.474e-15 \n",
" 106 1.27e-14 \n",
" 107 1.624e-14 \n",
" 108 1.965e-14 \n",
" 109 2.119e-14 \n",
" 110 3.669e-15 \n",
" 111 -2.852e-15 \n",
" 112 -6.13e-15 \n",
" 113 -4.862e-15 \n",
" 114 -1.206e-14 \n",
" 115 -1.234e-14 \n",
" 116 -3.541e-16 \n",
" 117 -3.296e-15 \n",
" 118 -5.448e-15 \n",
" 119 -1.78e-14 \n",
" 120 -9.215e-15 \n",
" 121 0 \n",
" 122 1.878e-15 \n",
" 123 -1.032e-14 \n",
" 124 1.05e-14 \n",
" 125 8.262e-15 \n",
" 126 1.26e-14 \n",
" 127 -3.641e-15 \n",
" 128 1.434e-16 \n",
" 129 1.269e-14 \n",
" 130 1.397e-15 \n",
" 131 1.414e-14 \n",
" 132 5.977e-16 \n",
" 133 -7.276e-15 \n",
" 135 1.762e-15 \n",
" 136 -1.105e-14 \n",
" 137 3.411e-16 \n",
" 138 9.284e-15 \n",
" 139 -3.977e-16 \n",
" 140 -3.641e-15 \n",
" 141 6.526e-15 \n",
" 143 3.036e-15 \n",
" 144 -3.935e-15 \n",
" 145 4.489e-15 \n",
" 146 1.506e-14 \n",
" 147 -3.013e-16 \n",
" 148 4.12e-15 \n",
" 149 9.76e-15 \n",
" 150 -2.996e-16 \n",
" 151 6.341e-15 \n",
" 152 1.402e-14 \n",
" 153 1.344e-14 \n",
" 154 -1.047e-14 \n",
" 155 -7.371e-15 \n",
" 156 -4.354e-15 \n",
" 157 -1.26e-14 \n",
" 158 -6.794e-15 \n",
" 159 -1.424e-14 \n",
" 160 -9.318e-16 \n",
" 161 -2.685e-14 \n",
" 162 -3.156e-14 \n",
" 163 -1.211e-14 \n",
" 164 3.935e-15 \n",
" 165 -5.618e-15 \n",
" 166 -5.607e-15 \n",
" 167 3.292e-15 \n",
" 168 1.261e-14 \n",
" 169 4.311e-15 \n",
" 170 -3.259e-16 \n",
" 171 -1.154e-14 \n",
" 172 2.461e-14 \n",
" 173 -1.329e-14 \n",
" 174 7.51e-15 \n",
" 175 -9.564e-16 \n",
" 176 -7.937e-16 \n",
" 177 3.23e-15 \n",
" 178 1.637e-15 \n",
" 179 3.705e-15 \n",
" 180 2.004e-16 \n",
" 181 3.797e-15 \n",
" 182 -3.904e-15 \n",
" 183 7.03e-15 \n",
" 184 2.849e-15 \n",
" 185 -2.256e-15 \n",
" 186 2.02e-15 \n",
" 187 3.979e-16 \n",
" 188 -1.811e-15 \n",
" 189 2.02e-15 \n",
" 190 -8.31e-16 \n",
" 191 0 \n",
" 192 2.007e-15 \n",
" 193 -2.79e-15 \n",
" 194 0 \n",
" 195 3.527e-15 \n",
" 196 -5.021e-15 \n",
" 197 -3.874e-15 \n",
" 198 -1.844e-15 \n",
" 199 5.081e-16 \n",
" 200 0 \n",
" 201 -4.036e-15 \n",
" 202 6.85e-16 \n",
" 203 -5.581e-15 \n",
" 204 -5.864e-15 \n",
" 205 1.635e-15 \n",
" 206 -7.294e-15 \n",
" 207 -8.683e-16 \n",
" 208 -3.651e-15 \n",
" 209 -1.312e-16 \n",
" 210 -6.959e-15 \n",
" 211 -4.865e-15 \n",
" 212 1.528e-15 \n",
" 213 -1.928e-15 \n",
" 214 -3.551e-15 \n",
" 215 3.246e-15 \n",
" 216 0 \n",
" 217 3.698e-15 \n",
" 218 1.74e-15 \n",
" 219 4.112e-15 \n",
" 220 -3.154e-15 \n",
" 221 1.719e-16 \n",
" 222 -1.883e-15 \n",
" 223 -1.395e-16 \n",
" 224 3.45e-15 \n",
" 225 3.525e-15 \n",
" 226 -4.259e-16 \n",
" 227 3.692e-15 \n",
" 228 1.502e-16 \n",
" 229 2.901e-15 \n",
" 230 4.818e-15 \n",
" 231 3.617e-15 \n",
" 232 1.173e-15 \n",
" 233 4.679e-15 \n",
" 234 4.893e-15 \n",
" 235 3.684e-15 \n",
" 236 3.923e-15 \n",
" 237 -6.675e-15 \n",
" 238 1.37e-15 \n",
" 239 1.173e-15 \n",
" 240 -2.136e-15 \n",
" 241 6.901e-15 \n",
" 242 6.969e-15 \n",
" 243 3.423e-15 \n",
" 244 6.729e-15 \n",
" 245 1.914e-15 \n",
" 246 8.995e-15 \n",
" 247 4.215e-15 \n",
" 248 -1.757e-15 \n",
" 249 5.52e-15 \n",
" 250 3.859e-15 \n",
" 251 -5.202e-15 \n",
" 252 3.8e-15 \n",
" 253 5.674e-16 \n",
" 254 7.12e-15 \n",
" 255 4.909e-15 \n",
" 256 3.759e-15 \n",
" 257 1.723e-15 \n",
" 258 2.183e-15 \n",
" 259 1.813e-15 \n",
" 260 1.983e-15 \n",
" 261 1.038e-14 \n",
" 262 1.239e-14 \n",
" 263 1.25e-14 \n",
" 264 1.031e-14 \n",
" 265 2.03e-14 \n",
" 266 2.055e-14 \n",
" 267 3.579e-15 \n",
" 268 7.339e-15 \n",
" 269 -5.379e-15 \n",
" 270 1.83e-15 \n",
" 271 5.541e-15 \n",
" 272 -1.147e-14 \n",
" 273 1.457e-14 \n",
" 274 4.302e-15 \n",
" 275 0 \n",
" 276 -3.678e-15 \n",
" 277 3.249e-15 \n",
" 278 -4.618e-15 \n",
" 279 2.648e-15 \n",
" 280 1.873e-15 \n",
" 281 -1.093e-14 \n",
" 282 5.548e-15 \n",
" 284 9.713e-15 \n",
" 285 -1.111e-14 \n",
" 286 -1.856e-15 \n",
" 288 3.514e-15 \n",
" 290 3.42e-15 \n",
" 293 2.601e-15 \n",
" 294 4.142e-16 \n",
" 295 1.82e-14 \n",
" 298 6.152e-15 \n",
" 303 8.282e-15 \n",
" 307 -3.482e-15 \n",
" 308 -4.115e-15 \n",
" 309 -1.471e-14 \n",
" 310 4.189e-16 \n",
" 311 -7.986e-15 \n",
" 312 -9.514e-15 \n",
" 313 -7.831e-15 \n",
" 314 -8.056e-15 \n",
" 315 -7.731e-15 \n",
" 316 6.45e-15 \n",
" 317 -8.62e-15 \n",
" 318 5.689e-15 \n",
" 319 6.368e-15 \n",
" 320 1.457e-14 \n",
" 321 3.124e-14 \n",
" 322 1.235e-14 \n",
" 324 1.931e-14 \n"
" 236 7.41e-15 \n",
" 237 0 \n",
" 238 -1.761e-15 \n",
" 239 7.82e-16 \n",
" 240 1.306e-15 \n",
" 241 -7.974e-15 \n",
" 242 -1.807e-15 \n",
" 243 -7.132e-16 \n",
" 244 0 \n",
" 245 3.281e-15 \n",
" 246 8.649e-15 \n",
" 247 1.048e-14 \n",
" 248 3.319e-15 \n",
" 249 -4.6e-16 \n",
" 250 1.996e-15 \n",
" 251 3.33e-15 \n",
" 252 -1.226e-16 \n",
" 253 2.128e-15 \n",
" 254 -1.405e-14 \n",
" 255 -3.197e-15 \n",
" 256 3.222e-15 \n",
" 257 3.815e-15 \n",
" 258 1.361e-14 \n",
" 259 1.054e-14 \n",
" 260 7.209e-15 \n",
" 261 -7.213e-15 \n",
" 262 -1.652e-15 \n",
" 263 2.016e-16 \n",
" 264 -7.362e-16 \n",
" 265 -4.098e-15 \n",
" 266 -5.895e-15 \n",
" 267 -8.422e-16 \n",
" 268 -4.317e-16 \n",
" 269 3.407e-15 \n",
" 270 -2.196e-15 \n",
" 271 -2.216e-16 \n",
" 272 -3.187e-16 \n",
" 273 1.906e-15 \n",
" 274 4.433e-15 \n",
" 275 -3.722e-15 \n",
" 276 4.478e-15 \n",
" 277 2.749e-15 \n",
" 278 1.997e-15 \n",
" 279 6.178e-15 \n",
" 280 5.352e-15 \n",
" 281 3.816e-15 \n",
" 282 0 \n",
" 284 4.345e-15 \n",
" 285 1.062e-14 \n",
" 286 -7.052e-15 \n",
" 288 9.538e-15 \n",
" 290 6.84e-15 \n",
" 293 1.136e-14 \n",
" 294 2.485e-15 \n",
" 295 -1.321e-14 \n",
" 298 2.783e-15 \n",
" 303 6.31e-15 \n",
" 307 5.697e-15 \n",
" 308 -1.076e-14 \n",
" 309 7.356e-15 \n",
" 310 3.072e-15 \n",
" 311 -6.465e-15 \n",
" 312 6.144e-15 \n",
" 313 8.81e-15 \n",
" 314 7.097e-15 \n",
" 315 -8.59e-15 \n",
" 316 4.047e-15 \n",
" 317 3.918e-16 \n",
" 318 1.038e-14 \n",
" 319 -6.812e-15 \n",
" 320 6.885e-16 \n",
" 321 -1.572e-14 \n",
" 322 -7.739e-15 \n",
" 324 -5.967e-15 \n"
]
}
],
@ -2341,9 +2339,9 @@
"source": [
"If the magnitudes of the numbers in this list are all very small (which in this case they are), then each reversible reaction is very nearly equilibrated, which only occurs if the gas is in chemical equilibrium.\n",
"\n",
"You might be wondering how `equilibrate` works. (Then again, you might not.) Method `equilibrate` invokes Cantera's chemical equilibrium solver, which uses an element potential method. The element potential method is one of a class of equivalent *nonstoichiometric* methods that all have the characteristic that the probelm reduces to solving a set of M nonlinear algebraic equations, where M is the number of elements (not species). The so-called *stoichiometric* methods, on the other hand (including the Gibbs minimization), require solving K nonlinear equations, where K is the number of species (usually K >> M). See Smith and Missen's \"Chemical Reaction Equilibrium Analysis\" for more information on the various algorithms and their characteristics.\n",
"You might be wondering how `equilibrate` works. (Then again, you might not.) Method `equilibrate` invokes Cantera's chemical equilibrium solver, which uses an element potential method. The element potential method is one of a class of equivalent *nonstoichiometric* methods that all have the characteristic that the probelm reduces to solving a set of $M$ nonlinear algebraic equations, where $M$ is the number of elements (not species). The so-called *stoichiometric* methods, on the other hand (including the Gibbs minimization), require solving $K$ nonlinear equations, where $K$ is the number of species (usually $K >> M$). See Smith and Missen's \"Chemical Reaction Equilibrium Analysis\" for more information on the various algorithms and their characteristics.\n",
"\n",
"Cantera uses a damped Newton method to solve these equations, and does a few other things to generate a good starting guess and to produce a reasonably robust algorithm. If you want to know more about the details, look at the on-line documentated source code of Cantera C++ class 'ChemEquil.h'."
"Cantera uses a damped Newton method to solve these equations, and does a few other things to generate a good starting guess and to produce a reasonably robust algorithm. If you want to know more about the details, look at the on-line documentated source code of Cantera C++ class [`ChemEquil.h`](http://cantera.org/docs/doxygen/html/ChemEquil_8h.html)."
]
},
{
@ -2357,9 +2355,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**[Solution](http://cantera.github.io/docs/sphinx/html/cython/importing.html#cantera.Solution)** objects are also **[Kinetics](http://cantera.github.io/docs/sphinx/html/cython/kinetics.html#cantera.Kinetics)** objects, and provide all of the methods necessary to compute the thermodynamic quantities associated with each reaction, reaction rates, and species creation and destruction rates. They also provide methods to inspect the quantities that define each reaction, such as the rate constants and the stoichiometric coefficients. The rate calculation functions are used extensively within Cantera's *[reactor network model](http://cantera.github.io/docs/sphinx/html/cython/zerodim.html#sec-cython-zerodim)* and *[1D flame model](http://cantera.github.io/docs/sphinx/html/cython/onedim.html#sec-cython-onedim)*.\n",
"[`Solution`](http://cantera.github.io/docs/sphinx/html/cython/importing.html#cantera.Solution) objects are also [`Kinetics`](http://cantera.github.io/docs/sphinx/html/cython/kinetics.html#cantera.Kinetics) objects, and provide all of the methods necessary to compute the thermodynamic quantities associated with each reaction, reaction rates, and species creation and destruction rates. They also provide methods to inspect the quantities that define each reaction, such as the rate constants and the stoichiometric coefficients. The rate calculation functions are used extensively within Cantera's *[reactor network model](http://cantera.github.io/docs/sphinx/html/cython/zerodim.html#sec-cython-zerodim)* and *[1D flame model](http://cantera.github.io/docs/sphinx/html/cython/onedim.html#sec-cython-onedim)*.\n",
"\n",
"Information about individual reactions that are independent of the thermodynamic state can be obtained by accessing **[Reaction](http://cantera.github.io/docs/sphinx/html/cython/kinetics.html#cantera.Reaction)** objects with the **[Kinetics.reaction](http://cantera.github.io/docs/sphinx/html/cython/kinetics.html#cantera.Kinetics.reaction)** method:"
"Information about individual reactions that are independent of the thermodynamic state can be obtained by accessing [`Reaction`](http://cantera.github.io/docs/sphinx/html/cython/kinetics.html#cantera.Reaction) objects with the [`Kinetics.reaction`](http://cantera.github.io/docs/sphinx/html/cython/kinetics.html#cantera.Kinetics.reaction) method:"
]
},
{
@ -2448,7 +2446,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"If we are interested in only certain types of reactions, we can use this information to filter the full list of reactions to find just the ones of interest. For example, here we find the indices of just those reactions which convert **`CO`** into **`CO2`**:"
"If we are interested in only certain types of reactions, we can use this information to filter the full list of reactions to find just the ones of interest. For example, here we find the indices of just those reactions which convert `CO` into `CO2`:"
]
},
{
@ -2508,8 +2506,8 @@
{
"data": {
"text/plain": [
"array([ 1.76182853e-19, -5.29395592e-21, 5.55111512e-17,\n",
" 5.08219768e-20])"
"array([ -1.01643954e-19, -5.08219768e-21, -1.77635684e-15,\n",
" 9.91028548e-20])"
]
},
"execution_count": 38,
@ -2593,7 +2591,7 @@
{
"data": {
"text/plain": [
"-58013370.720881224"
"-58013370.720880888"
]
},
"execution_count": 41,
@ -2620,7 +2618,7 @@
{
"data": {
"text/plain": [
"-58013370.720881134"
"-58013370.720880821"
]
},
"execution_count": 42,
@ -2647,7 +2645,7 @@
{
"data": {
"text/plain": [
"-9307123.262565529"
"-9307123.2625650223"
]
},
"execution_count": 43,
@ -2683,7 +2681,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
"version": "3.6.2"
}
},
"nbformat": 4,