https://github.com/ilianpihlajamaa/modecouplingtheory.jl
A generic and fast solver of mode-coupling theory-like integrodifferential equations
https://github.com/ilianpihlajamaa/modecouplingtheory.jl
differential-equations julia
Last synced: 11 months ago
JSON representation
A generic and fast solver of mode-coupling theory-like integrodifferential equations
- Host: GitHub
- URL: https://github.com/ilianpihlajamaa/modecouplingtheory.jl
- Owner: IlianPihlajamaa
- License: mit
- Created: 2022-08-23T13:04:53.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-07-14T14:22:49.000Z (11 months ago)
- Last Synced: 2025-07-22T22:37:31.445Z (11 months ago)
- Topics: differential-equations, julia
- Language: Julia
- Homepage:
- Size: 2.24 MB
- Stars: 18
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
# ModeCouplingTheory.jl
[](https://github.com/IlianPihlajamaa/ModeCouplingTheory.jl/actions)
[](https://codecov.io/github/IlianPihlajamaa/ModeCouplingTheory.jl)
[](https://IlianPihlajamaa.github.io/ModeCouplingTheory.jl/stable)
[](https://IlianPihlajamaa.github.io/ModeCouplingTheory.jl/dev)
[](https://pkgs.genieframework.com?packages=ModeCouplingTheory)
[](https://doi.org/10.21105/joss.05737)
A generic and fast solver of mode-coupling theory-like integrodifferential equations. It uses the algorithm outlined in [Fuchs et al.](https://iopscience.iop.org/article/10.1088/0953-8984/3/26/022/meta) to solve equations of the form
$$\alpha \ddot{F}(t) + \beta \dot{F}(t) + \gamma F(t) + \delta + \int_0^t d\tau K(t-\tau)\dot{F}(\tau) = 0, $$
in which $\alpha$, $\beta$, $\gamma$, and $\delta$ are (possibly time-dependent) coefficients, and $K(t) = K(F(t), t)$ is a memory kernel that may nonlinearly depend on $F(t)$. This package exports some commonly used memory kernels, but it is straightforward to define your own. The solver is differentiable and works for scalar- and vector-valued functions $F(t)$. For more information see the [Documentation](https://IlianPihlajamaa.github.io/ModeCouplingTheory.jl/dev). If you use this software, please consider citing [this paper](https://doi.org/10.21105/joss.05737).
# Installation
To install the package run:
```julia
import Pkg
Pkg.add("ModeCouplingTheory")
```
In order to install and use it from Python, see the [From Python](https://ilianpihlajamaa.github.io/ModeCouplingTheory.jl/dev/FromPython.html) page of the documentation.
# Example usage:
We can use one of the predefined memory kernels
```julia
julia> using ModeCouplingTheory
julia> ν = 3.999
3.999
julia> kernel = SchematicF2Kernel(ν)
SchematicF2Kernel{Float64}(3.999)
```
This kernel evaluates `K(t) = ν F(t)^2` when called.
We can now define the equation we want to solve as follows:
```julia
julia> α = 1.0; β = 0.0; γ = 1.0; δ = 0.0; F0 = 1.0; ∂F0 = 0.0;
julia> equation = MemoryEquation(α, β, γ, δ, F0, ∂F0, kernel);
```
Which we can solve by calling `solve`:
```julia
julia> sol = solve(equation);
julia> using Plots
julia> t = get_t(sol)
julia> F = get_F(sol)
julia> plot(log10.(t), F)
```

# Contributing
Please open an issue if anything is unclear in the documentation, if any unexpected errors arise or for feature requests (such as additional kernels). Pull requests are of course also welcome.