Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add thermodynamic consistency checker #69

Open
nawtrey opened this issue Aug 1, 2023 · 0 comments
Open

ENH: Add thermodynamic consistency checker #69

nawtrey opened this issue Aug 1, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@nawtrey
Copy link
Collaborator

nawtrey commented Aug 1, 2023

Motivation

Largely inspired by @ianmkenney's feedback, it would be useful to have a built-in thermodynamic consistency checker which verifies rates are internally consistent for each cycle in a kinetic diagram. If such a function can be written that is sufficiently low cost, it could be checked by a user at any time, and forced to run before any calculations are executed.

Proposed Solution(s)

We discussed a few solutions, each with their own difficulties:

  1. Use sum of free energy differences around the cycle to check thermodynamic consistency. Since the sum of free energy differences around a kinetic cycle must be equal to zero, this would be one way to handle it. Something like this has already been implemented in the EmrE thermodynamic consistency module.
  2. Another method would be to require a user to input units into their expressions and use SymPy units to find intrinsic rates based on their units. The external parameters should be easy to find since they should be the only rates expressed in units of molar concentration.

Potential Pitfalls

Solution 1 has a caveat -- I think the functions used for EmrE are operating on substitution dictionaries (for SymPy) which do not contain the external concentrations. A general approach would need to distinguish between internal/external parameters on its own so a user can implement complicated external parameters (e.g. membrane potential) without breaking the thermodynamic consistency checker. This might require us to make our API more explicit about internal/external parameters, which we make no distinction between at the moment.

Solution 2 may prove to be cumbersome if users have to input units for all expressions since the expressions will eventually have to be simplified by SymPy, which is already very costly.

@nawtrey nawtrey added the enhancement New feature or request label Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant