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

Add solubility limit for species #910

Open
TorkelE opened this issue Jun 4, 2024 · 2 comments
Open

Add solubility limit for species #910

TorkelE opened this issue Jun 4, 2024 · 2 comments

Comments

@TorkelE
Copy link
Member

TorkelE commented Jun 4, 2024

So, a thing that you have in chemistry is that you have a solution, within which your species are. However, there is a limit to how much of each species the liquid can solve, and the amount of a species above this limit seprates (i.e. might become solid form at the bottom of the liquid's container). However, if the species amount go down, this can again become soluble.

Practically, there are two values for a species:

  • The actual amount present in the system.
  • The amount that is a soluble, i.e. which can participate in a reaction.

Modelling this is something which would be useful fo chemists, and if we can support this, Catalyst would become a lot more attractive for chemists. Implementing the solubility limit for a species is easy, we would just make it a metadata:

rn = @reaction_network begin
    @parameters Xmax
    @species X(t) [solutbilitylimit = Xmax]
    (p,d), 0 <--> X
end

Practically, the most direct way to implement it would then be to, throughout the ODEs (or similar terms) replace all occurrences of X with min(X, getsolutbilitylimit(X)). There are of additional considerations though (i.e. does this make the ODE functions non-smooth in certain points, and is this bad for performance). Another question is if we can implement this by introducing equations.

We will have to discuss the best way to do this, but it would definitely be a feature we should add at some point.

(I only really know the terminology in Swedish for this kinds of thing, so the technical language is a bit crude)

@isaacsas
Copy link
Member

isaacsas commented Jun 4, 2024

Can you add some literature references showing the equations one wants to solve for some simple examples?

@TorkelE
Copy link
Member Author

TorkelE commented Jun 5, 2024

It came up when I discussed with my collaborator. I am not sure if there are any standardise approaches for this (will ask around) or just a frequent phenomena that people have to deal with (or don't deal with)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants