From 486ec2fc0da472514fe24936ee9a41b4728ec383 Mon Sep 17 00:00:00 2001 From: mforets Date: Mon, 11 Mar 2019 21:52:22 -0300 Subject: [PATCH 01/14] add TMJets --- src/ReachSets/ContinuousPost/TMJets/TMJets.jl | 23 +++++++ src/ReachSets/ContinuousPost/TMJets/check.jl | 0 src/ReachSets/ContinuousPost/TMJets/init.jl | 29 ++++++++ src/ReachSets/ContinuousPost/TMJets/post.jl | 68 +++++++++++++++++++ src/ReachSets/ContinuousPost/TMJets/reach.jl | 0 .../ContinuousPost/TMJets/require.jl | 3 + 6 files changed, 123 insertions(+) create mode 100644 src/ReachSets/ContinuousPost/TMJets/TMJets.jl create mode 100644 src/ReachSets/ContinuousPost/TMJets/check.jl create mode 100644 src/ReachSets/ContinuousPost/TMJets/init.jl create mode 100644 src/ReachSets/ContinuousPost/TMJets/post.jl create mode 100644 src/ReachSets/ContinuousPost/TMJets/reach.jl create mode 100644 src/ReachSets/ContinuousPost/TMJets/require.jl diff --git a/src/ReachSets/ContinuousPost/TMJets/TMJets.jl b/src/ReachSets/ContinuousPost/TMJets/TMJets.jl new file mode 100644 index 00000000..770d546f --- /dev/null +++ b/src/ReachSets/ContinuousPost/TMJets/TMJets.jl @@ -0,0 +1,23 @@ +export TMJets + +using IntervalArithmetic: IntervalBox + +struct TMJets <: ContinuousPost + options::TwoLayerOptions + + function TMJets(𝑂::Options) + 𝑂new = validate_and_wrap_options(𝑂, options_TMJets()) + return new(𝑂new) + end +end + +# convenience constructor from pairs of symbols +TMJets(𝑂::Pair{Symbol,<:Any}...) = TMJets(Options(Dict{Symbol,Any}(𝑂))) + +# default options (they are added in the function validate_and_wrap_options) +TMJets() = TMJets(Options()) + +include("init.jl") +include("post.jl") +include("reach.jl") +include("check.jl") diff --git a/src/ReachSets/ContinuousPost/TMJets/check.jl b/src/ReachSets/ContinuousPost/TMJets/check.jl new file mode 100644 index 00000000..e69de29b diff --git a/src/ReachSets/ContinuousPost/TMJets/init.jl b/src/ReachSets/ContinuousPost/TMJets/init.jl new file mode 100644 index 00000000..e33dcbd8 --- /dev/null +++ b/src/ReachSets/ContinuousPost/TMJets/init.jl @@ -0,0 +1,29 @@ +# out-of-place initialization +init(𝒫::TMJets, 𝑆::AbstractSystem, 𝑂::Options) = init!(𝒫, 𝑆, copy(𝑂)) + +function options_TMJets() + + 𝑂spec = Vector{OptionSpec}() + + # step size and termination criteria + push!(𝑂spec, OptionSpec(:abs_tol, 1e-10, domain=Float64, info="absolute tolerance")) + push!(𝑂spec, OptionSpec(:max_steps, 500, domain=Int, info="use this maximum number of steps in the validated integration")) + + # approximation options + push!(𝑂spec, OptionSpec(:orderT, 10, domain=Int, info="order of the Taylor model in t")) + push!(𝑂spec, OptionSpec(:orderQ, 2, domain=Int, info="order of the Taylor model for Jet transport variables")) + + return 𝑂spec +end + +# in-place initialization +function init!(𝒫::TMJets, 𝑆::AbstractSystem, 𝑂::Options) + + # state dimension + 𝑂[:n] = statedim(𝑆) + + # adds default values for unspecified options + 𝑂init = validate_solver_options_and_add_default_values!(𝑂) + + return 𝑂init +end diff --git a/src/ReachSets/ContinuousPost/TMJets/post.jl b/src/ReachSets/ContinuousPost/TMJets/post.jl new file mode 100644 index 00000000..e2fa63aa --- /dev/null +++ b/src/ReachSets/ContinuousPost/TMJets/post.jl @@ -0,0 +1,68 @@ +using TaylorModels: validated_integ + +function post(𝒫::TMJets, + 𝑆::AbstractSystem, # {<:ImplicitContinuousSystem} + invariant::Union{LazySet, Nothing}, + 𝑂::Options)::ReachSolution{Zonotope} + + # ================================== + # Initialization + # ================================== + + 𝑂 = TwoLayerOptions(merge(𝑂, 𝒫.options.specified), 𝒫.options.defaults) + + # system of ODEs + f! = 𝑆.s + n = 𝑂[:n] + + # initial and final times, and maximum allowed number of steps + t0 = 0.0 + T = 𝑂[:T] + max_steps = 𝑂[:max_steps] + + # unrap algorithm-specific options + abs_tol, orderQ, orderT = 𝑂[:abs_tol], 𝑂[:orderQ] 𝑂[:orderT] + + # initial sets + X0 = convert(IntervalBox, 𝑆.x0) + q0 = mid(X0) + Ξ΄q0 = sup.(X0) - mid(X0) + + # returns a TaylorN vector, each entry corresponding to an indep variable + set_variables("x", numvars=length(q0), order=2*orderQ) + + # define the property + property = haskey(𝑂, :property) ? 𝑂[:property] : (t, x) -> true + + # ===================== + # Flowpipe computation + # ===================== + + # preallocate output + RSets = Vector{ReachSet{Hyperrectangle, Float64}}(undef, N) + + info("Reachable States Computation...") + @timing begin + tTM, xTM = validated_integ(f!, q0, Ξ΄q0, t0, T, orderQ, orderT, abs_tol, + maxsteps=max_steps, check_property=property) + end + + # convert to hyperrectangle to wrap around the reach solution + N = length(xTM) + RSets = Vector{Hyperrectangle}(undef, N) + @inbounds for i in eachindex(xTM) + RSets[i] = convert(Hyperrectangle, xTM) + end + + # =========== + # Projection + # =========== + if 𝑂[:project_reachset] || 𝑂[:projection_matrix] != nothing + info("Projection...") + RsetsProj = @timing project(RSets, 𝑂) + else + RsetsProj = RSets + end + + return ReachSolution(RsetsProj, 𝑂) +end diff --git a/src/ReachSets/ContinuousPost/TMJets/reach.jl b/src/ReachSets/ContinuousPost/TMJets/reach.jl new file mode 100644 index 00000000..e69de29b diff --git a/src/ReachSets/ContinuousPost/TMJets/require.jl b/src/ReachSets/ContinuousPost/TMJets/require.jl new file mode 100644 index 00000000..1269be78 --- /dev/null +++ b/src/ReachSets/ContinuousPost/TMJets/require.jl @@ -0,0 +1,3 @@ +function __init__() + @require TaylorModels = "314ce334-5f6e-57ae-acf6-00b6e903104a" include("TMJets.jl") +end # function From a0daa39ea2ee7b492a597d6004c19d88be7e7dea Mon Sep 17 00:00:00 2001 From: Christian Schilling Date: Wed, 20 Mar 2019 13:25:55 -0300 Subject: [PATCH 02/14] Update src/ReachSets/ContinuousPost/TMJets/post.jl Co-Authored-By: mforets --- src/ReachSets/ContinuousPost/TMJets/post.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReachSets/ContinuousPost/TMJets/post.jl b/src/ReachSets/ContinuousPost/TMJets/post.jl index e2fa63aa..1b196669 100644 --- a/src/ReachSets/ContinuousPost/TMJets/post.jl +++ b/src/ReachSets/ContinuousPost/TMJets/post.jl @@ -51,7 +51,7 @@ function post(𝒫::TMJets, N = length(xTM) RSets = Vector{Hyperrectangle}(undef, N) @inbounds for i in eachindex(xTM) - RSets[i] = convert(Hyperrectangle, xTM) + RSets[i] = convert(Hyperrectangle, xTM[i]) end # =========== From f2457dc812a182ccbb44b9946e9488bb11be3bb3 Mon Sep 17 00:00:00 2001 From: Christian Schilling Date: Wed, 20 Mar 2019 13:26:12 -0300 Subject: [PATCH 03/14] Update src/ReachSets/ContinuousPost/TMJets/post.jl Co-Authored-By: mforets --- src/ReachSets/ContinuousPost/TMJets/post.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ReachSets/ContinuousPost/TMJets/post.jl b/src/ReachSets/ContinuousPost/TMJets/post.jl index 1b196669..6fafec0d 100644 --- a/src/ReachSets/ContinuousPost/TMJets/post.jl +++ b/src/ReachSets/ContinuousPost/TMJets/post.jl @@ -2,7 +2,6 @@ using TaylorModels: validated_integ function post(𝒫::TMJets, 𝑆::AbstractSystem, # {<:ImplicitContinuousSystem} - invariant::Union{LazySet, Nothing}, 𝑂::Options)::ReachSolution{Zonotope} # ================================== From d3592ae7c265f5f3174f2704c472cd9344c549f0 Mon Sep 17 00:00:00 2001 From: Christian Schilling Date: Wed, 20 Mar 2019 13:43:35 -0300 Subject: [PATCH 04/14] Update src/ReachSets/ContinuousPost/TMJets/post.jl Co-Authored-By: mforets --- src/ReachSets/ContinuousPost/TMJets/post.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReachSets/ContinuousPost/TMJets/post.jl b/src/ReachSets/ContinuousPost/TMJets/post.jl index 6fafec0d..b9001cec 100644 --- a/src/ReachSets/ContinuousPost/TMJets/post.jl +++ b/src/ReachSets/ContinuousPost/TMJets/post.jl @@ -56,7 +56,7 @@ function post(𝒫::TMJets, # =========== # Projection # =========== - if 𝑂[:project_reachset] || 𝑂[:projection_matrix] != nothing + if 𝑂[:project_reachset] info("Projection...") RsetsProj = @timing project(RSets, 𝑂) else From 041f9ce291a42ce57af21a90ef37e45799e4caca Mon Sep 17 00:00:00 2001 From: mforets Date: Wed, 20 Mar 2019 22:38:02 -0300 Subject: [PATCH 05/14] update TMJets --- REQUIRE | 3 + src/ReachSets/ContinuousPost/TMJets/TMJets.jl | 2 +- src/ReachSets/ContinuousPost/TMJets/init.jl | 2 +- src/ReachSets/ContinuousPost/TMJets/post.jl | 59 +++++++++++-------- .../ContinuousPost/TMJets/require.jl | 6 +- src/ReachSets/ReachSets.jl | 5 ++ src/Utils/normalization.jl | 3 + src/Utils/systems.jl | 5 +- 8 files changed, 55 insertions(+), 30 deletions(-) diff --git a/REQUIRE b/REQUIRE index 75070ac4..05fedfb0 100644 --- a/REQUIRE +++ b/REQUIRE @@ -11,3 +11,6 @@ ProgressMeter RecipesBase Reexport Suppressor +Requires +IntervalArithmetic +TaylorModels diff --git a/src/ReachSets/ContinuousPost/TMJets/TMJets.jl b/src/ReachSets/ContinuousPost/TMJets/TMJets.jl index 770d546f..13f7f839 100644 --- a/src/ReachSets/ContinuousPost/TMJets/TMJets.jl +++ b/src/ReachSets/ContinuousPost/TMJets/TMJets.jl @@ -12,7 +12,7 @@ struct TMJets <: ContinuousPost end # convenience constructor from pairs of symbols -TMJets(𝑂::Pair{Symbol,<:Any}...) = TMJets(Options(Dict{Symbol,Any}(𝑂))) +TMJets(𝑂::Pair{Symbol, <:Any}...) = TMJets(Options(Dict{Symbol, Any}(𝑂))) # default options (they are added in the function validate_and_wrap_options) TMJets() = TMJets(Options()) diff --git a/src/ReachSets/ContinuousPost/TMJets/init.jl b/src/ReachSets/ContinuousPost/TMJets/init.jl index e33dcbd8..187d6723 100644 --- a/src/ReachSets/ContinuousPost/TMJets/init.jl +++ b/src/ReachSets/ContinuousPost/TMJets/init.jl @@ -12,7 +12,7 @@ function options_TMJets() # approximation options push!(𝑂spec, OptionSpec(:orderT, 10, domain=Int, info="order of the Taylor model in t")) push!(𝑂spec, OptionSpec(:orderQ, 2, domain=Int, info="order of the Taylor model for Jet transport variables")) - + return 𝑂spec end diff --git a/src/ReachSets/ContinuousPost/TMJets/post.jl b/src/ReachSets/ContinuousPost/TMJets/post.jl index b9001cec..a2cdd080 100644 --- a/src/ReachSets/ContinuousPost/TMJets/post.jl +++ b/src/ReachSets/ContinuousPost/TMJets/post.jl @@ -1,67 +1,78 @@ using TaylorModels: validated_integ +using TaylorSeries: set_variables +using LazySets.Approximations: box_approximation +using IntervalArithmetic: mid, sup -function post(𝒫::TMJets, - 𝑆::AbstractSystem, # {<:ImplicitContinuousSystem} - 𝑂::Options)::ReachSolution{Zonotope} +function post(π’œ::TMJets, + 𝑃::InitialValueProblem{<:AbstractContinuousSystem}, + 𝑂::Options) # ================================== # Initialization # ================================== - 𝑂 = TwoLayerOptions(merge(𝑂, 𝒫.options.specified), 𝒫.options.defaults) + 𝑂 = merge(π’œ.options.defaults, 𝑂, π’œ.options.specified) # system of ODEs - f! = 𝑆.s - n = 𝑂[:n] + f! = 𝑃.s.f + n = statedim(𝑃) - # initial and final times, and maximum allowed number of steps + # initial time and time horizon t0 = 0.0 T = 𝑂[:T] + + # maximum allowed number of steps max_steps = 𝑂[:max_steps] # unrap algorithm-specific options - abs_tol, orderQ, orderT = 𝑂[:abs_tol], 𝑂[:orderQ] 𝑂[:orderT] + abs_tol, orderQ, orderT = 𝑂[:abs_tol], 𝑂[:orderQ], 𝑂[:orderT] # initial sets - X0 = convert(IntervalBox, 𝑆.x0) + box_x0 = box_approximation(𝑃.x0) + X0 = convert(IntervalBox, box_x0) q0 = mid(X0) - Ξ΄q0 = sup.(X0) - mid(X0) + Ξ΄q0 = IntervalBox(sup.(X0) - mid(X0)) - # returns a TaylorN vector, each entry corresponding to an indep variable + # fix the working variables and maximum order in the global + # parameters struct (_params_TaylorN_) set_variables("x", numvars=length(q0), order=2*orderQ) # define the property - property = haskey(𝑂, :property) ? 𝑂[:property] : (t, x) -> true + if 𝑂[:mode] == "check" + property = 𝑂[:property] + elseif 𝑂[:mode] == "reach" + property = (t, x) -> true + end # ===================== # Flowpipe computation # ===================== - # preallocate output - RSets = Vector{ReachSet{Hyperrectangle, Float64}}(undef, N) - info("Reachable States Computation...") @timing begin tTM, xTM = validated_integ(f!, q0, Ξ΄q0, t0, T, orderQ, orderT, abs_tol, - maxsteps=max_steps, check_property=property) + maxsteps=max_steps, check_property=property) end - # convert to hyperrectangle to wrap around the reach solution + # convert to hyperrectangle and wrap around the reach solution N = length(xTM) - RSets = Vector{Hyperrectangle}(undef, N) - @inbounds for i in eachindex(xTM) - RSets[i] = convert(Hyperrectangle, xTM[i]) + Rsets = Vector{ReachSet{Hyperrectangle, Float64}}(undef, N-1) + @inbounds for i in 1:N-1 + Hi = convert(Hyperrectangle, xTM[i]) + t0 = tTM[i]; t1 = tTM[i+1] + Rsets[i] = ReachSet{Hyperrectangle, Float64}(Hi, t0, t1) end + Rsol = ReachSolution(Rsets, 𝑂) + # =========== # Projection # =========== + if 𝑂[:project_reachset] info("Projection...") - RsetsProj = @timing project(RSets, 𝑂) - else - RsetsProj = RSets + Rsol = @timing project(Rsol) end - return ReachSolution(RsetsProj, 𝑂) + return Rsol end diff --git a/src/ReachSets/ContinuousPost/TMJets/require.jl b/src/ReachSets/ContinuousPost/TMJets/require.jl index 1269be78..ac14267c 100644 --- a/src/ReachSets/ContinuousPost/TMJets/require.jl +++ b/src/ReachSets/ContinuousPost/TMJets/require.jl @@ -1,3 +1,3 @@ -function __init__() - @require TaylorModels = "314ce334-5f6e-57ae-acf6-00b6e903104a" include("TMJets.jl") -end # function +#function __init__() +# @require TaylorModels = "314ce334-5f6e-57ae-acf6-00b6e903104a" include("TMJets.jl") +#end # function diff --git a/src/ReachSets/ReachSets.jl b/src/ReachSets/ReachSets.jl index 4d612b41..af6e0db8 100644 --- a/src/ReachSets/ReachSets.jl +++ b/src/ReachSets/ReachSets.jl @@ -100,6 +100,11 @@ include("ContinuousPost/BFFPSV18/reach_blocks_wrapping_effect.jl") include("ContinuousPost/GLGM06/GLGM06.jl") +include("ContinuousPost/TMJets/TMJets.jl") +#function __init__() +# @require TaylorModels = "314ce334-5f6e-57ae-acf6-00b6e903104a" include("TMJets.jl") +#end # function + # ======================== # Reachability Algorithms # ======================== diff --git a/src/Utils/normalization.jl b/src/Utils/normalization.jl index 5564ebcd..b80c997e 100644 --- a/src/Utils/normalization.jl +++ b/src/Utils/normalization.jl @@ -61,6 +61,9 @@ function normalize(system::AbstractSystem) throw(ArgumentError("the system type $(typeof(system)) is currently not supported")) end +# "black-box" like systems are not normalized; algorithms should handle this +normalize(S::BBCS) = S + # x' = Ax, in the continuous case # x+ = Ax, in the discrete case for (L_S, CL_S) in ((:LCS, :CLCS), (:LDS, :CLDS)) diff --git a/src/Utils/systems.jl b/src/Utils/systems.jl index e9ccd39d..2ebd43bb 100644 --- a/src/Utils/systems.jl +++ b/src/Utils/systems.jl @@ -14,8 +14,11 @@ const CACCS = ConstrainedAffineControlContinuousSystem const CACDS = ConstrainedAffineControlDiscreteSystem const CACS = ConstrainedAffineContinuousSystem const CADS = ConstrainedAffineDiscreteSystem +const BBCS = Union{BlackBoxContinuousSystem, + ConstrainedBlackBoxContinuousSystem, + ConstrainedBlackBoxControlContinuousSystem} -export LCS, LDS, CLCS, CLDS, CLCCS, CLCDS, CACCS, CACDS, IVP +export LCS, LDS, CLCS, CLDS, CLCCS, CLCDS, CACCS, CACDS, IVP, BBCS import Base: * import LazySets.constrained_dimensions From 063e144614576aa6317448d0e4b82b311b64a724 Mon Sep 17 00:00:00 2001 From: mforets Date: Wed, 20 Mar 2019 22:39:04 -0300 Subject: [PATCH 06/14] add test --- test/Reachability/solve_continuous.jl | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/Reachability/solve_continuous.jl b/test/Reachability/solve_continuous.jl index 63625cde..91756d21 100644 --- a/test/Reachability/solve_continuous.jl +++ b/test/Reachability/solve_continuous.jl @@ -192,3 +192,30 @@ X = HalfSpace([-1.0, 0.0, 0.0, 0.0], 0.0) X0 = BallInf(zeros(4), 0.5) p = IVP(ConstrainedAffineContinuousSystem(A, b, X), X0) sol = solve(p, :T=>0.1) + +# ================================== +# Test TMJets with Van der Pol model +# ================================== +using TaylorIntegration +using TaylorModels: @taylorize +using Reachability: solve + +@taylorize function vanderPol!(t, x, dx) + local ΞΌ = 1.0 + dx[1] = x[2] + dx[2] = (ΞΌ * x[2]) * (1 - x[1]^2) - x[1] + return dx +end + +𝑆 = BlackBoxContinuousSystem(vanderPol!, 2) +X0 = Hyperrectangle(low=[1.25, 2.35], high=[1.55, 2.45]) +𝑃 = InitialValueProblem(𝑆, X0) + +# reach mode +𝑂 = Options(:T=>7.0, :mode=>"reach") +solve(𝑃, 𝑂, op=TMJets(:abs_tol=>1e-10, :orderT=>10, :orderQ=>2)); + +# check mode +𝑂 = Options(:T=>7.0, :mode=>"check") +property=(t,x)->x[2] <= 2.75 +solve(𝑃, 𝑂, op=TMJets(:abs_tol=>1e-10, :orderT=>10, :orderQ=>2)) From a1974c71ff3013a83f36cb736603d01af878a0b9 Mon Sep 17 00:00:00 2001 From: mforets Date: Wed, 20 Mar 2019 22:39:49 -0300 Subject: [PATCH 07/14] add TaylorSeries to requires --- REQUIRE | 1 + 1 file changed, 1 insertion(+) diff --git a/REQUIRE b/REQUIRE index 05fedfb0..e4eaae67 100644 --- a/REQUIRE +++ b/REQUIRE @@ -14,3 +14,4 @@ Suppressor Requires IntervalArithmetic TaylorModels +TaylorSeries From 6384fb76f674a3a7fc499aadf74a3543532c0be2 Mon Sep 17 00:00:00 2001 From: mforets Date: Wed, 20 Mar 2019 22:52:55 -0300 Subject: [PATCH 08/14] fix property default --- src/Options/default_options.jl | 2 +- test/Reachability/solve_continuous.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Options/default_options.jl b/src/Options/default_options.jl index eb70ee4d..fd8ab9d1 100644 --- a/src/Options/default_options.jl +++ b/src/Options/default_options.jl @@ -92,7 +92,7 @@ function validate_solver_options_and_add_default_values!(options::Options)::Opti error("No property has been defined.") end elseif key == :property - expected_type = Union{Nothing, Property, Dict{Int, <:Property}} + expected_type = Union{Nothing, Property, Dict{Int, <:Property}, Function} elseif key == :T expected_type = Float64 domain_constraints = (v::Float64 -> v > 0.) diff --git a/test/Reachability/solve_continuous.jl b/test/Reachability/solve_continuous.jl index 91756d21..297536c6 100644 --- a/test/Reachability/solve_continuous.jl +++ b/test/Reachability/solve_continuous.jl @@ -216,6 +216,6 @@ X0 = Hyperrectangle(low=[1.25, 2.35], high=[1.55, 2.45]) solve(𝑃, 𝑂, op=TMJets(:abs_tol=>1e-10, :orderT=>10, :orderQ=>2)); # check mode -𝑂 = Options(:T=>7.0, :mode=>"check") property=(t,x)->x[2] <= 2.75 +𝑂 = Options(:T=>7.0, :mode=>"check", :property=>property) solve(𝑃, 𝑂, op=TMJets(:abs_tol=>1e-10, :orderT=>10, :orderQ=>2)) From 9dfabdb2b4738f51f0bdd05e0916e68fc943d83c Mon Sep 17 00:00:00 2001 From: mforets Date: Thu, 21 Mar 2019 08:22:46 -0300 Subject: [PATCH 09/14] review --- REQUIRE | 3 +-- src/ReachSets/ContinuousPost/TMJets/post.jl | 6 +++--- src/ReachSets/ContinuousPost/TMJets/require.jl | 3 --- src/ReachSets/ReachSets.jl | 3 --- src/Utils/systems.jl | 8 ++++---- 5 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 src/ReachSets/ContinuousPost/TMJets/require.jl diff --git a/REQUIRE b/REQUIRE index e4eaae67..237c051d 100644 --- a/REQUIRE +++ b/REQUIRE @@ -3,7 +3,7 @@ Compat Expokit HybridSystems LazySets -MathematicalSystems 0.6.3 +MathematicalSystems 0.6.4 Memento Optim Plots @@ -11,7 +11,6 @@ ProgressMeter RecipesBase Reexport Suppressor -Requires IntervalArithmetic TaylorModels TaylorSeries diff --git a/src/ReachSets/ContinuousPost/TMJets/post.jl b/src/ReachSets/ContinuousPost/TMJets/post.jl index a2cdd080..d5b34036 100644 --- a/src/ReachSets/ContinuousPost/TMJets/post.jl +++ b/src/ReachSets/ContinuousPost/TMJets/post.jl @@ -4,14 +4,14 @@ using LazySets.Approximations: box_approximation using IntervalArithmetic: mid, sup function post(π’œ::TMJets, - 𝑃::InitialValueProblem{<:AbstractContinuousSystem}, - 𝑂::Options) + 𝑃::InitialValueProblem{<:Union{BBCS, CBBCS, CBBCCS}, <:LazySet}, + 𝑂_global::Options) # ================================== # Initialization # ================================== - 𝑂 = merge(π’œ.options.defaults, 𝑂, π’œ.options.specified) + 𝑂 = merge(π’œ.options.defaults, 𝑂_global, π’œ.options.specified) # system of ODEs f! = 𝑃.s.f diff --git a/src/ReachSets/ContinuousPost/TMJets/require.jl b/src/ReachSets/ContinuousPost/TMJets/require.jl deleted file mode 100644 index ac14267c..00000000 --- a/src/ReachSets/ContinuousPost/TMJets/require.jl +++ /dev/null @@ -1,3 +0,0 @@ -#function __init__() -# @require TaylorModels = "314ce334-5f6e-57ae-acf6-00b6e903104a" include("TMJets.jl") -#end # function diff --git a/src/ReachSets/ReachSets.jl b/src/ReachSets/ReachSets.jl index af6e0db8..9d912224 100644 --- a/src/ReachSets/ReachSets.jl +++ b/src/ReachSets/ReachSets.jl @@ -101,9 +101,6 @@ include("ContinuousPost/BFFPSV18/reach_blocks_wrapping_effect.jl") include("ContinuousPost/GLGM06/GLGM06.jl") include("ContinuousPost/TMJets/TMJets.jl") -#function __init__() -# @require TaylorModels = "314ce334-5f6e-57ae-acf6-00b6e903104a" include("TMJets.jl") -#end # function # ======================== # Reachability Algorithms diff --git a/src/Utils/systems.jl b/src/Utils/systems.jl index 2ebd43bb..e600c8fb 100644 --- a/src/Utils/systems.jl +++ b/src/Utils/systems.jl @@ -14,11 +14,11 @@ const CACCS = ConstrainedAffineControlContinuousSystem const CACDS = ConstrainedAffineControlDiscreteSystem const CACS = ConstrainedAffineContinuousSystem const CADS = ConstrainedAffineDiscreteSystem -const BBCS = Union{BlackBoxContinuousSystem, - ConstrainedBlackBoxContinuousSystem, - ConstrainedBlackBoxControlContinuousSystem} +const BBCS = BlackBoxContinuousSystem +const CBBCS = ConstrainedBlackBoxContinuousSystem +const CBBCCS = ConstrainedBlackBoxContinuousSystem -export LCS, LDS, CLCS, CLDS, CLCCS, CLCDS, CACCS, CACDS, IVP, BBCS +export LCS, LDS, CLCS, CLDS, CLCCS, CLCDS, CACCS, CACDS, IVP, BBCS, CBBCS, CBBCCS import Base: * import LazySets.constrained_dimensions From f97e8d447f4701c5e282b8b3fab0e50d4ae72557 Mon Sep 17 00:00:00 2001 From: mforets Date: Thu, 21 Mar 2019 08:40:00 -0300 Subject: [PATCH 10/14] update travis for validatedODEs branch --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 033148db..8cf8066c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ script: Pkg.develop("LazySets"); Pkg.develop("MathematicalSystems"); Pkg.develop("HybridSystems"); + Pkg.add(PackageSpec(name="TaylorModels", rev="validatedODEs")); Pkg.clone(pwd()); Pkg.build("Reachability"); Pkg.test("Reachability"; coverage=true)' From cc78109fbd184b49a09c4e8160b5b87d443890a6 Mon Sep 17 00:00:00 2001 From: mforets Date: Thu, 21 Mar 2019 09:02:32 -0300 Subject: [PATCH 11/14] use develop version of TaylorSeries --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 8cf8066c..c4630139 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ script: Pkg.develop("MathematicalSystems"); Pkg.develop("HybridSystems"); Pkg.add(PackageSpec(name="TaylorModels", rev="validatedODEs")); + Pkg.develop("TaylorSeries"); Pkg.clone(pwd()); Pkg.build("Reachability"); Pkg.test("Reachability"; coverage=true)' From bcb27a342af53ec2f9804db2af95d3ec5e1a4c82 Mon Sep 17 00:00:00 2001 From: mforets Date: Thu, 21 Mar 2019 10:45:17 -0300 Subject: [PATCH 12/14] remove empty files --- src/ReachSets/ContinuousPost/TMJets/check.jl | 0 src/ReachSets/ContinuousPost/TMJets/reach.jl | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/ReachSets/ContinuousPost/TMJets/check.jl delete mode 100644 src/ReachSets/ContinuousPost/TMJets/reach.jl diff --git a/src/ReachSets/ContinuousPost/TMJets/check.jl b/src/ReachSets/ContinuousPost/TMJets/check.jl deleted file mode 100644 index e69de29b..00000000 diff --git a/src/ReachSets/ContinuousPost/TMJets/reach.jl b/src/ReachSets/ContinuousPost/TMJets/reach.jl deleted file mode 100644 index e69de29b..00000000 From 2b244199cfb50aef8245136e488293dcfc7522ea Mon Sep 17 00:00:00 2001 From: mforets Date: Thu, 21 Mar 2019 11:13:35 -0300 Subject: [PATCH 13/14] fix initial set conversion --- src/ReachSets/ContinuousPost/TMJets/TMJets.jl | 2 -- src/ReachSets/ContinuousPost/TMJets/post.jl | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ReachSets/ContinuousPost/TMJets/TMJets.jl b/src/ReachSets/ContinuousPost/TMJets/TMJets.jl index 13f7f839..048f2e27 100644 --- a/src/ReachSets/ContinuousPost/TMJets/TMJets.jl +++ b/src/ReachSets/ContinuousPost/TMJets/TMJets.jl @@ -19,5 +19,3 @@ TMJets() = TMJets(Options()) include("init.jl") include("post.jl") -include("reach.jl") -include("check.jl") diff --git a/src/ReachSets/ContinuousPost/TMJets/post.jl b/src/ReachSets/ContinuousPost/TMJets/post.jl index d5b34036..a2817009 100644 --- a/src/ReachSets/ContinuousPost/TMJets/post.jl +++ b/src/ReachSets/ContinuousPost/TMJets/post.jl @@ -29,9 +29,8 @@ function post(π’œ::TMJets, # initial sets box_x0 = box_approximation(𝑃.x0) - X0 = convert(IntervalBox, box_x0) - q0 = mid(X0) - Ξ΄q0 = IntervalBox(sup.(X0) - mid(X0)) + q0 = center(box_x0) + Ξ΄q0 = IntervalBox(low(box_x0)-q0, high(box_x0)-q0) # fix the working variables and maximum order in the global # parameters struct (_params_TaylorN_) From 284d943db36cab6125f27a4545c86778a0591ad7 Mon Sep 17 00:00:00 2001 From: mforets Date: Thu, 21 Mar 2019 11:28:32 -0300 Subject: [PATCH 14/14] remove usings --- src/ReachSets/ContinuousPost/TMJets/post.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ReachSets/ContinuousPost/TMJets/post.jl b/src/ReachSets/ContinuousPost/TMJets/post.jl index a2817009..b8d45514 100644 --- a/src/ReachSets/ContinuousPost/TMJets/post.jl +++ b/src/ReachSets/ContinuousPost/TMJets/post.jl @@ -1,7 +1,6 @@ using TaylorModels: validated_integ using TaylorSeries: set_variables using LazySets.Approximations: box_approximation -using IntervalArithmetic: mid, sup function post(π’œ::TMJets, 𝑃::InitialValueProblem{<:Union{BBCS, CBBCS, CBBCCS}, <:LazySet},