Skip to content
Open
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
13 changes: 8 additions & 5 deletions src/Algorithms/A20/A20.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@ inputs in the Krylov subspace from [Althoff20](@citet).

### Fields

- `δ` -- step-size of the discretization
- `max_order` -- (optional, default: `5`) maximum zonotope order
- `δ` -- step-size of the discretization
- `approx_model` -- (optional, default: `FirstOrderZonotope()`) approximation model
- `max_order` -- (optional, default: `5`) maximum zonotope order

### References

See [Althoff20](@citet) and references therein.
"""
struct A20{N} <: AbstractContinuousPost
struct A20{N,AM} <: AbstractContinuousPost
δ::N
approx_model::AM
max_order::Int
end

# convenience constructor using keywords
function A20(; δ::N, max_order::Int=5) where {N}
return A20(δ, max_order)
# TODO change `FirstOrderZonotope` default
function A20(; δ::N, approx_model::AM=FirstOrderZonotope(), max_order::Int=5) where {N,AM}
return A20(δ, approx_model, max_order)
end

step_size(alg::A20) = alg.δ
Expand Down
14 changes: 10 additions & 4 deletions src/Algorithms/A20/post.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
# discrete post
function post(alg::A20{N}, ivp::IVP{<:AbstractDiscreteSystem}, NSTEPS=nothing;
Δt0::TimeInterval=zeroI, kwargs...) where {N}
@unpack δ, max_order = alg
@unpack δ, approx_model, max_order = alg
# TODO define these options in the algorithm struct
static = Val(get(kwargs, :static, false))
reduction_method = LazySets.GIR05()
dim = missing
ngens = missing
preallocate = Val(get(kwargs, :preallocate, true))
disjointness_method = NoEnclosure()

if isnothing(NSTEPS)
if haskey(kwargs, :NSTEPS)
Expand All @@ -25,7 +32,6 @@ function post(alg::A20{N}, ivp::IVP{<:AbstractDiscreteSystem}, NSTEPS=nothing;
Ω0 = reduce_order(Ω0, max_order, reduction_method)

# reconvert the set of initial states and state matrix, if needed
static = get(kwargs, :static, false)
Ω0 = _reconvert(Ω0, static, dim, ngens)
Φ = _reconvert(Φ, static, dim)

Expand All @@ -34,6 +40,7 @@ function post(alg::A20{N}, ivp::IVP{<:AbstractDiscreteSystem}, NSTEPS=nothing;
ZT = typeof(Ω0)
F = Vector{ReachSet{N,ZT}}(undef, NSTEPS)

# TODO currently uses GLGM06 algorithm
if got_homogeneous

#=
Expand All @@ -46,8 +53,7 @@ function post(alg::A20{N}, ivp::IVP{<:AbstractDiscreteSystem}, NSTEPS=nothing;
end
=#

reach_homog_GLGM06!(F, Ω0, Φ, NSTEPS, δ, max_order, X, preallocate, Δt0,
disjointness_method)
reach_homog_GLGM06!(F, Ω0, Φ, NSTEPS, δ, X, preallocate, Δt0, disjointness_method)
else
# TODO: implement preallocate option for this scenario
U = inputset(ivp)
Expand Down
2 changes: 1 addition & 1 deletion src/ReachSets/TaylorModelReachSet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Taylor model reach set
# ================================================================

import ..Overapproximate: _overapproximate, _overapproximate_hparallelotope
import .Overapproximate: _overapproximate, _overapproximate_hparallelotope

"""
TaylorModelReachSet{N, S} <: AbstractTaylorModelReachSet{N}
Expand Down