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

Litter model needs to handle infinite stoichiometric ratios #732

Closed
jacobcook1995 opened this issue Feb 10, 2025 · 2 comments · Fixed by #733
Closed

Litter model needs to handle infinite stoichiometric ratios #732

jacobcook1995 opened this issue Feb 10, 2025 · 2 comments · Fixed by #733
Assignees

Comments

@jacobcook1995
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
In #726 @TaranRallings has started calculating stoichiometries for matter flows being supplied to the litter model (they were previously just constants being fed to the litter model). This is all well and good but introduces the edge case where the input has an infinite stoichiometric ratio, i.e. the input is pure carbon. At present, this edge case (which we only rarely expect) causes the entire model to stall.

Describe the solution you'd like
The litter model can amend its calculation to treat infinite stoichiometric ratios as cases that are 100% carbon. This will complicate some of litter model calculations but should have minimal effect elsewhere.

Describe alternatives you've considered
I did consider adding a step to just crash the model when an infinite stoichiometric ratio is returned, but I think this is probably overly restrictive

@jacobcook1995 jacobcook1995 self-assigned this Feb 10, 2025
@davidorme
Copy link
Collaborator

I did consider adding a step to just crash the model when an infinite stoichiometric ratio is returned, but I think this is probably overly restrictive

That seems like the easiest solution right now? Also, I suspect it's a biologically realistic reason to crash? Unless there is some pure carbohydrate excretion - and even then, can that really be perfectly pure? Depends how hard it is to fix the edge case.

@jacobcook1995
Copy link
Collaborator Author

The annoying case is the zero carbon flow case, where the total flow is zero but the stoichiometric ratio is infinite, but maybe Taran could catch that specific case and I could throw an error if an infinity slips through

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

Successfully merging a pull request may close this issue.

2 participants