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

#818 - Refactor TMJets algorithms #819

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ with position in the interval `0.9 .. 1.1` and velocity in `-0.1 .. 0.1`.
using ReachabilityAnalysis, Plots

const ω = 1.2
const T = 2*pi / ω
const T = 2 * pi / ω

@taylorize function duffing!(du, u, p, t)
local α = -1.0
Expand All @@ -148,7 +148,7 @@ X0 = Hyperrectangle(low=[0.9, -0.1], high=[1.1, 0.1])
prob = @ivp(x' = duffing!(x), x(0) ∈ X0, dim=2)

# solve using a Taylor model set representation
sol = solve(prob, tspan=(0.0, 20*T), alg=TMJets())
sol = solve(prob, tspan=(0.0, 20*T), alg=TMJets21a());

# plot the flowpipe in state-space
plot(sol, vars=(1, 2), xlab="x", ylab="v", lw=0.5, color=:red)
Expand All @@ -165,7 +165,7 @@ plot(sol, vars=(1, 2), xlab="x", ylab="v", lw=0.5, color=:red)
| | |
| ![LaubLoomis](https://github.com/JuliaReach/JuliaReach-website/blob/master/images/reachability/NLN/ARCH-COMP20-JuliaReach-LaubLoomis.png?raw=true) [Laub-Loomis model](https://juliareach.github.io/ReachabilityAnalysis.jl/dev/generated_examples/LaubLoomis/) | ![PD](https://github.com/JuliaReach/JuliaReach-website/blob/master/images/reachability/NLN/ARCH-COMP20-JuliaReach-ProductionDestruction.png?raw=true)<br> [Production-Destruction model](https://juliareach.github.io/ReachabilityAnalysis.jl/dev/generated_examples/ProductionDestruction/)|
| | |
|![vanderpol](https://github.com/JuliaReach/JuliaReach-website/blob/master/images/reachability/NLN/ARCH-COMP20-JuliaReach-VanDerPol.png?raw=true) [Coupled van der pol oscillator model](https://github.com/JuliaReach/ARCH2020_NLN_RE/blob/master/models/VanDerPol/vanderpol.jl) | ![spaccecraft](https://github.com/JuliaReach/JuliaReach-website/blob/master/images/reachability/NLN/ARCH-COMP20-JuliaReach-Spacecraft.png?raw=true) [Spacecraft rendez-vous model](https://juliareach.github.io/ReachabilityAnalysis.jl/dev/generated_examples/Spacecraft/) |
|![vanderpol](https://github.com/JuliaReach/JuliaReach-website/blob/master/images/reachability/NLN/ARCH-COMP20-JuliaReach-VanDerPol.png?raw=true) [Coupled van der Pol oscillator](https://github.com/JuliaReach/ARCH2020_NLN_RE/blob/master/models/VanDerPol/vanderpol.jl) | ![spaccecraft](https://github.com/JuliaReach/JuliaReach-website/blob/master/images/reachability/NLN/ARCH-COMP20-JuliaReach-Spacecraft.png?raw=true) [Spacecraft rendezvous](https://juliareach.github.io/ReachabilityAnalysis.jl/dev/generated_examples/Spacecraft/) |


## :blue_book: Publications
Expand Down
4 changes: 2 additions & 2 deletions docs/src/lib/algorithms/TMJets.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@docs
TMJets
TMJets1
TMJets2
TMJets21a
TMJets21b
```
4 changes: 2 additions & 2 deletions docs/src/tutorials/taylor_methods/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fig = DisplayAs.Text(DisplayAs.PNG(fig)) # hide
```
The divergence observed in the solution is due to using an algorithm which doesn't specialize for intervals hence suffers from dependency problems.

However, specialized algorithms can handle this case without noticeable wrapping effect, producing a sequence of sets whose union covers the true solution for all initial points. We use the [`ReachabilityAnalysis.jl`](https://github.com/JuliaReach/ReachabilityAnalysis.jl) interface to the algorithm [`TMJets1`](@ref), which is itself implemented in
However, specialized algorithms can handle this case without noticeable wrapping effect, producing a sequence of sets whose union covers the true solution for all initial points. We use the [`ReachabilityAnalysis.jl`](https://github.com/JuliaReach/ReachabilityAnalysis.jl) interface to the algorithm [`TMJets21a`](@ref), which is itself implemented in
[`TaylorModels.jl`](https://github.com/JuliaIntervals/TaylorModels.jl).

```@example nonlinear_univariate
Expand All @@ -69,7 +69,7 @@ X0 = -1 .. 1
prob = @ivp(x' = f(x), x(0) ∈ X0, dim=1)

# solve it using a Taylor model method
sol = solve(prob, alg=TMJets1(abstol=1e-10), T=15)
sol = solve(prob, alg=TMJets21a(abstol=1e-10), T=15)

# visualize the solution in time
fig = plot(sol, vars=(0, 1), xlab="t", ylab="x(t)", title="Specialized (Taylor-model based) integrator")
Expand Down
2 changes: 1 addition & 1 deletion examples/Brusselator/Brusselator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ T = 18.0;
# We use the `TMJets` algorithm with sixth-order expansion in time and
# second-order expansion in the spatial variables.

alg = TMJets1(; orderT=6, orderQ=2)
alg = TMJets21a(; orderT=6, orderQ=2)
sol = solve(prob; T=T, alg=alg);

# ## Results
Expand Down
2 changes: 1 addition & 1 deletion examples/DuffingOscillator/DuffingOscillator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ T = 2 * pi / ω;

# ## Analysis

sol = solve(prob; tspan=(0.0, 20 * T), alg=TMJets1());
sol = solve(prob; tspan=(0.0, 20 * T), alg=TMJets21a());

# ## Results

Expand Down
2 changes: 1 addition & 1 deletion examples/SEIR/SEIR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ prob = @ivp(x' = seir!(x), dim:7, x(0) ∈ X0);

# ## Analysis

sol = solve(prob; T=200.0, alg=TMJets1(; orderT=7, orderQ=1))
sol = solve(prob; T=200.0, alg=TMJets21a(; orderT=7, orderQ=1))
solz = overapproximate(sol, Zonotope);

# ## Results
Expand Down
6 changes: 3 additions & 3 deletions examples/Spacecraft/Spacecraft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ function solve_spacecraft(prob; k=25, s=missing)
## transition from mode 1 to mode 2
sol12 = solve(prob;
tspan=(0.0, 200.0),
alg=TMJets1(; abstol=1e-5, maxsteps=10_000, orderT=5, orderQ=1,
disjointness=BoxEnclosure()),
alg=TMJets21a(; abstol=1e-5, maxsteps=10_000, orderT=5, orderQ=1,
disjointness=BoxEnclosure()),
max_jumps=1,
intersect_source_invariant=false,
intersection_method=TemplateHullIntersection(BoxDirections(5)),
Expand All @@ -328,7 +328,7 @@ function solve_spacecraft(prob; k=25, s=missing)
H = system(prob)
sol3 = solve(IVP(mode(H, 3), [set(X) for X in sol12jump_c]);
tspan=(t0, 200.0),
alg=TMJets1(; abstol=1e-10, orderT=7, orderQ=1, disjointness=BoxEnclosure()))
alg=TMJets21a(; abstol=1e-10, orderT=7, orderQ=1, disjointness=BoxEnclosure()))
d = Dict{Symbol,Any}(:loc_id => 3)
F12 = [fp for fp in sol12.F]
F23 = [Flowpipe(fp.Xk, d) for fp in sol3.F]
Expand Down
96 changes: 0 additions & 96 deletions src/Algorithms/TMJets/TMJets.jl

This file was deleted.

46 changes: 0 additions & 46 deletions src/Algorithms/TMJets/TMJets20/TMJets20.jl

This file was deleted.

107 changes: 0 additions & 107 deletions src/Algorithms/TMJets/TMJets20/post.jl

This file was deleted.

Loading
Loading