Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Feb 9, 2024
1 parent aeda1d1 commit 45e8ceb
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
6 changes: 4 additions & 2 deletions docs/src/man/algorithms/ORBIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ Before considering the computation of $\Phi$ and $\Phi_1$, note that the method
x(k\delta) = \Phi^k x_0 + \sum_{i=0}^{k-1} \Phi^i v_{k-i},\qquad k = 1,\ldots, N
```

The matrix $\Phi = e^{A\delta}$ can be evaluated in different ways, using the function [`_exp`](@ref):
The matrix $\Phi = e^{A\delta}$ can be evaluated in different ways, using the function
[`ReachabilityAnalysis.Exponentiation._exp`](@ref):

(1) `method=:base` uses Julia's built-in implementation (if `method = :base`),

(2) `method = :lazy` uses a lazy wrapper of the matrix exponential which is then evaluated using Krylov subspace methods.

Method (1) is the default method. Method (2) is particularly useful to work with very large and sparse matrices (e.g. typically of order `n > 2000`). Evaluation of $\Phi_1(u, \delta)$ is available through the function [`Φ₁`](@ref). Two implementations are available:
Method (1) is the default method. Method (2) is particularly useful to work with very large and sparse matrices (e.g. typically of order `n > 2000`). Evaluation of $\Phi_1(u, \delta)$ is available through the function
[`ReachabilityAnalysis.Exponentiation.Φ₁`](@ref). Two implementations are available:

(1) If the coefficients matrix $A$ is invertible, then the integral is equivalent to computing $A^{-1}(e^{A\delta} - I)$.

Expand Down
7 changes: 4 additions & 3 deletions docs/src/tutorials/linear_methods/dense_time.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,15 @@ $\delta \to 0$ (in Hausdorff distance).
```

Algorithms implementing conservative time discretization can be used from the
[`discretize(ivp::IVP, δ, alg::AbstractApproximationModel)`](@ref) function.
[`discretize(ivp::IVP, δ, alg::ReachabilityAnalysis.DiscretizationModule.AbstractApproximationModel)`](@ref)
function.
Set-based conservative discretization of a continuous-time initial value problem
into a discrete-time problem.
This function receives three inputs: the initial value problem (``ivp`) for a
linear ODE in canonical form, (e.g. the system returned by `normalize`);
the step-size (`δ`), and the algorithm (`alg`) used to compute the approximation model.
Do `subtypes(ReachabilityAnalysis.AbstractApproximationModel)` to see the
available approximation models.
Do `subtypes(ReachabilityAnalysis.DiscretizationModule.AbstractApproximationModel)`
to see the available approximation models.

The output of a discretization is a new initial value problem of a discrete system.
Different approximation algorithms and their respective options are described
Expand Down
9 changes: 5 additions & 4 deletions src/Discretization/BackwardModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module BackwardModule

using ..DiscretizationModule
using ..Exponentiation: _alias
using ..Exponentiation: _alias, BaseExp

export Backward

Expand Down Expand Up @@ -55,11 +55,12 @@ function Base.show(io::IO, alg::Backward)
print(io, " - set operations method: $(alg.setops)\n")
print(io, " - symmetric interval hull method: $(alg.sih)\n")
print(io, " - invertibility assumption: $(alg.inv)\n")
return print(io, " - polyhedral computations backend: $(alg.backend)\n")
print(io, " - polyhedral computations backend: $(alg.backend)\n")
return nothing
end

Base.show(io::IO, m::MIME"text/plain", alg::Backward) = print(io, alg)
Base.show(io::IO, ::MIME"text/plain", alg::Backward) = print(io, alg)

# TODO: add corresponding `discrete` methods <<<<<

end
end # module
2 changes: 1 addition & 1 deletion src/Discretization/DiscretizationModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ function discretize(ivp::IVP, δ, alg::AbstractApproximationModel)
return error("discretization not implemented for the given arguments: $ivp, $alg")
end

end
end # module
2 changes: 1 addition & 1 deletion src/Discretization/Exponentiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -486,4 +486,4 @@ function __init__()
@require ExponentialUtilities = "d4d017d3-3776-5f7e-afef-a10c40355c18" include("init_ExponentialUtilities.jl")
end

end # module
end # module
3 changes: 1 addition & 2 deletions src/Discretization/discretization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# =========================================

using Reexport

include("DiscretizationModule.jl")

include("ApplySetops.jl")
Expand All @@ -11,8 +12,6 @@ include("Overapproximate.jl")
@reexport using ..Overapproximate

# Approximation model in discrete time, i.e. without bloating
using ..DiscretizationModule # TODO Remove
using ..Exponentiation # TODO Remove
include("NoBloatingModule.jl")
@reexport using ..NoBloatingModule

Expand Down
1 change: 0 additions & 1 deletion src/Initialization/init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import LazySets: dim, overapproximate, box_approximation, project, Projection,
intersection, directions, linear_map, LinearMap, split!,
set, array, _isapprox

import MathematicalSystems: discretize
import Base: , , convert, isdisjoint
import LinearAlgebra: normalize

Expand Down
2 changes: 1 addition & 1 deletion test/algorithms/ASB07.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ReachabilityAnalysis: IntervalExpAlg
using ..Exponentiation: IntervalExpAlg
using ..Overapproximate: _convert_or_overapproximate

@testset "ASB07 algorithm: homogeneous case" begin
Expand Down

0 comments on commit 45e8ceb

Please sign in to comment.