Put the title of the example as the first cell, so the website example
renderer shows something useful as the example summary. Fix small typos
in some math content. Use notebook matplotlib magic for plots.
Use 2.5.0a2 (git hash 471041a2) to run the examples. Update some
formatting in comments and docstrings. Move imports to the top of
Notebooks. Set the matplotlib magic before importing matplotlib.
Fix deprecation warnings from Pandas about argmax and set_value.
The new example demonstrates use of the BinarySolutionTabulatedThermo
class, to calculate the open circuit potential for a standard Li ion
battery (graphite anode, LCO cathode) for a range of anode and cathode
Li stoichiometries.
The notebook demonstrates cell potential calculations via two methods:
a kinetic method where the current is set to zero and the correct
electric potentials are fit using scipy.optimize.fsolve, and a
thermodynamic method whereby the equilibrium potential at each
electrode interface is calculated according to the gibbs free energy
of reaction.
The notebook can readily be extended to simulate charge-discharge of
the battery, and preliminary functionality for such an extension is
already programmed into the notebook.
The correct midpoint temperature is 1000 K, despite what it says in the original
input file. This can be easily verified by plotting the high and low temperature
polynomials and noting that the differences in cp/R, h/RT, and s/R are all zero
at 1000 K, but not at the stated midpoint temperature of 600 K.
All that was done here was the Cantera Python Tutorial from the Cantera
website was transferred into a Jupyter Notebook. Some language was
changed in order to keep things sensible, but most was kept the same as
the original.
Notebooks from the 'reactors' folder are exported as py files, and
moved to interfaces/cython/cantera/examples/reactors in the main
Cantera repository.
This PR has two main changes:
1. Adding a jupyter notebook example to the reactors folder for
a constant-volume, adiabatic reactor. This is employed within
the context of IDT calculations in high-pressure shock tubes.
I'd be happy to add Comparison to experimental data, pending
publication of a manuscript currently under consideration (and
coauthor permission).
This largely follows the routines established in the batch reactor
example, and states as much in the notebook.
2. It occurs to me that some users might be interested in seeing
the examples as py files, but don't want to bother with installing
Jupyter and figuring out how to use it (while these steps are easy,
they still might represent a barrier to some users).
For the three notebooks in this folder, then, I've saved the notebooks
as simple py files and added them to a folder labeled as such.
The original figure labeled the y-axis as plotting mole fractions of OH. But this was a value obtained from get_state() and hence should be mass-fractions.