Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "CriticalTransitions"
uuid = "251e6cd3-3112-48a5-99dd-66efcfd18334"
authors = ["Reyk Börner, Orjan Ameye, Ryan Deeley, Raphael Römer", "George Datseris"]
repo = "https://github.com/juliadynamics/CriticalTransitions.jl.git"
version = "0.7.0"
version = "0.7.1"

[deps]
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@
A Julia package for the numerical investigation of **noise- and rate-induced transitions in dynamical systems**.

Building on [DynamicalSystems.jl](https://juliadynamics.github.io/DynamicalSystems.jl/stable/) and [DifferentialEquations.jl](https://diffeq.sciml.ai/stable/), this package aims to provide a toolbox for dynamical systems under time-dependent forcing, with a focus on tipping phenomena and metastability.

## Installation
`CriticalTransitions` is a registered Julia package.

```console
julia> ] add CriticalTransitions
```

or

```julia
using Pkg; Pkg.add("CriticalTransitions")
```

## Usage
See [package documentation](https://juliadynamics.github.io/CriticalTransitions.jl/stable/).

Expand Down
14 changes: 8 additions & 6 deletions docs/pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ pages = [
"Getting started" => "quickstart.md",
"Tutorial" => "examples/tutorial.md",
"Examples" => Any[
"Defining stochastic systems" => "examples/stochastic-dynamics.md",
"Large deviations: Maier-Stein system" => "examples/gMAM_Maierstein.md",
"Simple gMAM: Kerr Parametric Oscillator" => "examples/sgMAM_KPO.md",
"Transition Path Theory: Finite element method" => "examples/transition_path_theory_double_well.md",
"Minimal action method: Optimal Control problem" => "examples/OC_mam.md",
"Constructing rate system" => "examples/RateSystem.md",
"Defining a system" => Any[
"Defining stochastic systems" => "examples/stochastic-dynamics.md",
"Constructing a rate system" => "examples/RateSystem.md",],
"System analysis" => Any[
"Large deviations: Maier-Stein system" => "examples/gMAM_Maierstein.md",
"Simple gMAM: Kerr Parametric Oscillator" => "examples/sgMAM_KPO.md",
"Minimal action method: Optimal Control problem" => "examples/OC_mam.md",
"Transition path theory: Finite element method" => "examples/transition_path_theory_double_well.md",],
],
"Manual" => Any[
"Define your system" => "man/system_construction.md",
Expand Down
28 changes: 17 additions & 11 deletions docs/src/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
# Getting started

## Installation
To install the Julia language, we recommend [juliaup](https://github.com/JuliaLang/juliaup).
> To install the Julia language, we recommend [juliaup](https://github.com/JuliaLang/juliaup).

`CriticalTransitions` is a registered Julia package (as of `v0.7`) and can be installed with the Julia package manager:

```console
julia> ]
Pkg> add CriticalTransitions
```
or

The `CriticalTransitions.jl` package can be installed from Github via the Julia package manager:
```julia
using Pkg; Pkg.add(url="https://github.com/juliadynamics/CriticalTransitions.jl.git")
using Pkg; Pkg.add("CriticalTransitions")
```
You can then load the package with `using CriticalTransitions`.

The package is currently tested to be compatible with Julia versions `1.10` and `1.11`.
The package is currently tested to be compatible with Julia versions `1.10-1.12`.

## Basic usage
The general workflow of `CriticalTransitions.jl` essentially follows two steps, similar to `DynamicalSystems.jl`:
The general workflow of CriticalTransitions.jl consists of two steps, similar to DynamicalSystems.jl:

1. Define your dynamical system (see [Defining a forced dynamical system](@ref))
2. Investigate the system by calling functions (see [Index](@ref))
2. Investigate the system by calling methods (see [Index](@ref))

Some functions are only loaded as extensions when loading other dependency packages (see [Extensions](@ref)).
Some methods are only loaded as extensions when loading other dependency packages (see [Extensions](@ref)).

## Documentation
The [Tutorial](@ref) and code examples in the *Examples* section illustrate some use cases of the package. All available functions and types are documented in the *Manual* section (see [Index](@ref) for an overview).
The [Tutorial](@ref) and code examples in the *Examples* section illustrate some use cases of the package. All available methods and types are documented in the *Manual* section (see [Index](@ref) for an overview).

## Index
A quick overview of available features:

**Defining a system and its forcing**
- [`DynamicalSystemsBase.CoupledODEs`](@ref)
- [`DynamicalSystemsBase.CoupledSDEs`](@ref) (alias for `StochSystem`)
- [`RateSystem`](@ref)
- [`ForcingProfile`](@ref)
- [`CriticalTransitions.RateSystem`](@ref)
- [`CriticalTransitions.ForcingProfile`](@ref)

**System analysis and simulation**
```@index
Expand Down
2 changes: 1 addition & 1 deletion src/r_tipping/RateSystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ corresponding to the frozen system of the non-autonomous [`RateSystem`](@ref) `r
time `t`.
"""
function frozen_system(rs::RateSystem, t)
ds = CoupledODEs(rs.forcing.unforced_rule, current_state(ds), get_forcing(rs, t))
ds = CoupledODEs(rs.forcing.unforced_rule, current_state(rs), parameters(rs, t))
return ds
end

Expand Down
4 changes: 2 additions & 2 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Aqua = "0.8.7"
Attractors = "1.19.12"
Attractors = "1.27"
ChaosTools = "3.2.1"
DiffEqNoiseProcess = "5.24"
ExplicitImports = "1.9"
Expand All @@ -38,4 +38,4 @@ OptimizationOptimisers = "0.3"
OrdinaryDiffEq = "6.90"
Statistics = ">=1.9"
StochasticDiffEq = "6.71"
julia = "1.10"
julia = "1.10"
13 changes: 13 additions & 0 deletions test/r_tipping/RateSystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ fp = ForcingProfile(profile, (-5.0, 5.0))

rs = RateSystem(ds, fp, pidx; forcing_start_time, forcing_duration, forcing_scale)

@testset "frozen_system" begin
frozen = frozen_system(rs, rs.forcing.t0)
unforced = rs.forcing.unforced_rule
u = [2.0];
t = 10.0
du_frozen = dynamic_rule(frozen)(u, current_parameters(frozen), t)
du_orig = dynamic_rule(ds)(u, current_parameters(ds), t)
du_unforced = unforced(u, [rs.forcing.p0], t)

@test du_frozen == du_orig
@test du_frozen == du_unforced
end

@testset "RateSystem" begin
@testset "DynamicalSystems API" begin
@test current_state(rs) == x0
Expand Down
Loading