JKinetics — reaction kinetics
Introduction
JKinetics is a desktop application for modeling chemical reaction kinetics in an isothermal batch environment. JKinetics is designed to be easy for the beginner or occasional user, but powerful and flexible enough for the more experienced user.
A JKinetics model is described as a set of chemical equations. The user enters these equations using familiar chemical notation. For example,
xylene + H2 -> toluene + methane, k1 dimethylphenol + H2 -> methylphenol + methane, k2 toluene + H2 -> benzene + methane, k3 methylphenol + H2 -> phenol + methane, k4 toluene + H2 -> other, k5
is the JKinetics syntax which describes a set of reactions. Given starting concentrations for each reactant and product, and values for the kinetic parameters (k1, k2, etc.), the program will integrate the model and predict concentration of each species versus time. When supplied with measured concentrations from one or more experimental runs, JKinetics can also iteratively solve for the rate constants of the set of reactions.
The program is driven by a scripting language, which allows documentation of an analysis and simplifies repetitive analyses. The user can enter scripting commands directly, or use menus and dialog boxes to generate scripting commands.
Other features:
- Reactions can be temperature dependent; when given data collected at different temperatures, JKinetics can iteratively determine the Arrhenius coefficients of the reaction set as well as its rate constants.
- User-defined variables, related by arbitrarily complex mathematical equations, can be used to control or restrict the relationships among the kinetic parameters.
- Integration and data-fitting results can be viewed as graphs or as tables of concentrations versus time. Results can be exported to CSV files for additional processing.
- Plots of any variable (product concentration, reactant concentration, time, etc) or any arbitrary function of any number of variables can be plotted against any other variable. Multiple plot windows can be displayed simultaneously. Plots can be exported for publication.
Notes on the CISC475 project
The entire Fall '08 class of CISC475 will work together to implement JKinetics. Here are some highlights of the project:
- The application will be developed in Java. It must run on Windows, MacOS, and Linux.
- At the end of the semester, JKinetics will be released as an open-source application, probably on SourceForge.
- The overall application design will follow the Model-View-Controller (MVC) pattern. Many other design patterns (Observer, Template Method, etc.) will be applied throughout the code.
- Package names will be com.jkinetics.* (com.jkinetics.base, com.jkinetics.util, com.jkinetics.gui, etc.) The "jkinetics.com" domain name is already registered.
- The project will use a version-control system (Subversion), a bug tracker/punchlist (Trac, Mantis, or equivalent), automated testing (JUnit), and a development wiki. The project will be hosted on a dedicated server, rather than on Sourceforge.
- The project will be built using Ant and command-line tools, rather than an IDE (integrated development environment) such as Eclipse or Netbeans.
- All project code will conform to the project style guidelines.
- The class will be divided into a number of teams, with between two and six students per team. Each team will have a leader, who is responsible for reporting team progress and for coordinating the team's software with other team's work. Some students may be on more than one team (for example, being on the infrastructure team won't be a full-time job).
- Keeping twenty-plus developers moving in the right directions will be a big challenge. Bug/issue tracking will be important, and the punchlist *must* be kept up to date. Team leaders must review the punchlist daily.
- The application will have a 'pluggable' numerical architecture, allowing for multiple implementations of ODE solvers and optimizers. At least two of each will be implemented, to demonstrate that the pluggable architecture actually works.
- At a minimum, the project needs at least two students who know, or can learn, something about numerical methods. Anyone who has taken calculus can handle this part of the project. The instructor will work closely with these students.
- The project also needs at least two or three students who have taken a course in compilers, or are willing to learn a minimum amount about LL(1) parsing. The parsers for the scripting language have already been implemented as recursive descent parsers in C, and the code is available for reference. The instructor will work closely with these students.
Team organization
The teams for the JKinetics project will be organized something like this:
- Infrastructure -- Set up and maintain project server, with Subversion, bug tracker/punchlist (Bugzilla, Mantis, Trac, or equivalent), documentation wiki (PMwiki?), and so forth. Responsible for ensuring nightly backups.
- Design and integration-- Provide overall application architecture (the "controller" part of Model-View-Controller), threading, interfaces, and so forth. Responsible for flow of commands from parsers, included files, etc. Also responsible for integration tests; will develop test scaffolding code to ensure that the pieces fit together.
- Model -- Design, develop, and document the primary data structures: reactions, datasets, result sets, integration and optimization variables, and so forth.
- Parsing -- Create parsers for reaction equations, commands, and CSV files, and a simple algebraic equation 'compiler' and 'interpreter' for use in reaction equations and in plotting. Parsers can be written as dedicated recursive-descent code, or generated using ANTLR or equivalent.
- GUI -- Implement menus, dialogs, and windows (the "View" part of Model-View-Controller). One student on this team will have primary responsibility for a consistent look-and-feel for the application (colors, icons, and so forth). One or two students will be responsible for implementing chart plotting using the 3rd-party JFreeChart plotting package.
- Numerical -- Team members will research existing open-source Java numerical libraries, and adopt one if suitable. If no suitable library is found, this team will implement several simple ODE integrators and optimization routines. If time permits, the team may also investigate using JNI to call Fortran or C numerical libraries.
- Documentation -- Responsible for both developer's and end-user documentation. Must guarantee that examples in documentation actually run.
- Testing -- Each team is expected to write unit tests for its own code using JUnit. If we have enough students to form a testing team, that team will be tasked with breaking everybody else's code. Whether there is a separate testing team or not, all testing will be automated, and all test code will be permanently enshrined in the project source repository. The entire project's test suite should show a "green bar" every morning.
Last modified: Saturday, 6 Sept 2008