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 error modeling to CADET-Process #187

Draft
wants to merge 95 commits into
base: dev
Choose a base branch
from
Draft

Add error modeling to CADET-Process #187

wants to merge 95 commits into from

Conversation

schmoelder
Copy link
Contributor

@schmoelder schmoelder commented Dec 2, 2024

This PR adds basic functionality for error modeling in CADET-Process.
This includes providing different error distributions to Process objects, e.g. to model fluctuations in pump flow rate, valve switching delays, variations in concentrations etc.
Moreover, a Variator class should handle the registration / connection between the individual distributions and the actual parameters of the model (i.e. Process).

To do

  • Add RNGs to distributions to improve reproducibility
  • Handle indices for parameters with multiple entries (e.g. only vary concentration of certain component) (see also in Events or OptimizationVariable)
  • Open question: How to include parameters of the DistributionBase in parameter estimation routines (i.e. the parameters of the distribution need to be exposed somehow)
  • Open question: How to specify errors that don't directly affect the Process but simulation output (e.g. sensor noise?)
  • ...
  • MCMC?

Demo

Here is a little snippet how different distributions could be used

from CADETProcess.errorModel import (
    UniformDistribution,
    NormalDistribution,
    ExponentialDistribution,
    BinomialDistribution,
    PoissonDistribution,

)
# Create instances of different distributions
normal = NormalDistribution(mu=0, sigma=1)
uniform = UniformDistribution(lb=0, ub=10)
exponential = ExponentialDistribution(lambda_=2)
binomial = BinomialDistribution(n=10, p=0.5)
poisson = PoissonDistribution(lambda_=3)

# Example usage
print("Normal Samples:", normal.sample(size=5))
print("Normal Mean:", normal.mean())
print("Normal Variance:", normal.var())

print("Uniform Samples:", uniform.sample(size=5))
print("Exponential Samples:", exponential.sample(size=5))
print("Binomial Samples:", binomial.sample(size=5))
print("Poisson Samples:", poisson.sample(size=5))

ronald-jaepel and others added 30 commits June 18, 2024 21:13
Previously, there were two interfaces in the `OptimizationProblem` for calling evaluation functions (e.g. objectives): one for evaluating individuals, and one for populations.
To simplify the code base, these two methods were now unified.
To ensure backward compatibility, a 1D-Array is returned if a single individual is passed to the function.
Previously, the cadet path set in Cadet(install_path="path") was not inherited into cadet instances created from the run() method.
Fix and extend tests about .calculate_interstitial_rt/velocity
Previously, this was required because CADET-Core was not setting the
PATH correctly.
Now, this can lead to inconsistent behaviour.
Note, this requires CADET>4.4.0
Recently, the option to (not) plot the time axis using minutes was
introduced.
This commit fixes some methods that were not properly implemented.
Moreover, the name of the flag was changed from `use_minutes` to
`x_axis_in_minutes` to make clear that only plotting is affected and not
other parameter values (e.g. start and end times).
Updates and Fixes plot_at_position by adding start, end and
x_axis_in_minutes as parameters in solution.py
schmoelder and others added 11 commits November 14, 2024 15:37
A typo in the paramameters list lead to an issue when querying the
optimizer options.
…hon.

Fix Cadet.get_cadet_version()

Fix create_lwe method of CadetAdapter
With the Miniforge 23.3.1 release, the Miniforge and Mambaforge
installers became essentially identical. The only difference between the
two was their name and, subsequently, the default installation
directory.

For more information, see
https://conda-forge.org/news/2024/07/29/sunsetting-mambaforge/
Forgot to remove this file when migrating to `pyproject.toml`.
The CITATION.bib file serves as an collection of papers that we like to
have cited when CADET-Process is used. Further, it is recognized by
Github and added to the sidebar of the repo.
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.

7 participants