Skip to content

Smooth and stepped piecewise arrhenius - #215

Merged
arm61 merged 10 commits into
kinisi-dev:mainfrom
Lorentyfle:piecewise_arrhenius
Jul 8, 2026
Merged

Smooth and stepped piecewise arrhenius#215
arm61 merged 10 commits into
kinisi-dev:mainfrom
Lorentyfle:piecewise_arrhenius

Conversation

@Lorentyfle

Copy link
Copy Markdown
Contributor

Addition of a piecewise Arrhenius function and a class that allow to use it accordingly. Addition of a smoothed piecewise Arrhenius function and a class using a sigmoid function.

Both cases are set up and documented following what was done with the other Arrhenius classes and functions.

Addition of a piecewise arrhenius function and a class that allow to use it accordingly.
Addition of a smoothed piecewise arrhenius function and a class using a sigmoid function.

Both cases are setup and documented following what was done with the other arrhenius classes and functions.
@arm61

arm61 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

@Lorentyfle, thanks for opening this PR. Would it be possible to include tests to go along with the new functionality?

bounds was exchange with priors and a test function was added for it.
@Lorentyfle

Copy link
Copy Markdown
Contributor Author

@arm61, of course! I also saw that all TemperatureDependent changed from using bounds to priors, so I adapted my functions to be in agreement with this new formalism.

Comment thread kinisi/arrhenius.py Outdated
super().__init__(diffusion, piecewise_smooth_equation, parameter_names, parameter_units, priors=priors)

@property
def activation_energy_low(self) -> VariableLike | Samples:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these the best variable names? Genuinely asking. Is there something that shows up in the literature?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking of keeping 'activation_energy' while adding 'low' and 'high' to show which temperature section it is. But it is true that '_low_temperature' or '_high_temperature' could also work and be far more descriptive.

In literature, it seems the transition temperature is also called Arrhenius Break:
https://pmc.ncbi.nlm.nih.gov/articles/PMC7959718/

Can be stated as "temperature segment":
https://www.osti.gov/servlets/purl/2333851

But low-temperature and high-temperature seem to also be valid:
https://link.springer.com/chapter/10.1007/978-94-009-5167-9_32

I think the latest one is better ('activation_energy_high_temperature' and 'activation_energy_low_temperature') as it would be easier to understand which activation energy it is, instead of stating a numerical description, or the condensed version ('activation_energy_low' and 'activation_energy_high'), and would indicate which location at a glance this activation energy is from.

Comment thread kinisi/arrhenius.py Outdated
Comment thread kinisi/arrhenius.py Outdated
Comment thread kinisi/arrhenius.py Outdated
@arm61

arm61 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Just a few minor documentation things then we can get this merged.

@arm61

arm61 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Also, looks like there are some linting errors. If you run:

pre-commit run --all-files

These should go away.

Corrected some more issues in the change of name.
Make the precision of the expected results better.
Decrease the value of the width for the test of the values as it will change the one extremity of the piecewise result making it less accurate using the current method for computation of the expected result.

If failure will happen again, a more formal computation using the impact of the sigmoid will be done.
A more formal computation using the impact of the sigmoid is done for the computation of the expected calculation that was done by hand.

@arm61 arm61 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer *_temperature. Always better to be verbose. I will merge now.

@arm61
arm61 merged commit 4d4831b into kinisi-dev:main Jul 8, 2026
0 of 4 checks passed
@arm61

arm61 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the contribution @Lorentyfle!

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 this pull request may close these issues.

2 participants