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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ SparseArrays = "<0.0.1, 1.6"
StaticArrays = "0.12, 1"
TaylorIntegration = "0.18"
TaylorModels = "0.9.2 - 0.10"
TaylorSeries = "0.21"
TaylorSeries = "0.21.10"
julia = "1.10"
2 changes: 1 addition & 1 deletion src/Algorithms/TMJets/TMJets21a/post.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function post(alg::TMJets21a{N}, ivp::IVP{<:AbstractContinuousSystem}, timespan;

# fix the working variables and maximum order in the global
# parameters struct (_params_TaylorN_)
set_variables("x"; numvars=n, order=2 * orderQ)
variables!("x"; numvars=n, order=2 * orderQ)

# initial set
X0 = initial_state(ivp_norm)
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithms/TMJets/TMJets21b/post.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function post(alg::TMJets21b{N}, ivp::IVP{<:AbstractContinuousSystem}, timespan;

# fix the working variables and maximum order in the global
# parameters struct (_params_TaylorN_)
set_variables("x"; numvars=n, order=2 * orderQ)
variables!("x"; numvars=n, order=2 * orderQ)

# initial set
X0 = initial_state(ivp_norm)
Expand Down
1 change: 1 addition & 0 deletions src/Initialization/init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ using TaylorModels.ValidatedInteg: shrink_wrapping!

# method extensions for Taylor model reach-sets
import TaylorModels: domain, remainder, polynomial, get_order, evaluate
import TaylorSeries

# aliases for set types
const CPA = CartesianProductArray
Expand Down
12 changes: 6 additions & 6 deletions src/ReachSets/TaylorModelReachSet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ end
# `x[i] <- (a[i] + b[i]) / 2 + (b[i] - a[i]) / 2 * x[i]` for each `i = 1, .., n`,
# which amounts to rescaling and shifting the polynomials according to `dom`.
function _taylor_shift(X::Vector{TaylorN{S}}, dom) where {S}
x = get_variables()
x = TaylorSeries.variables()
n = length(x) # number of variables
@assert n == length(X) == length(dom)
(dom == symBox(n)) && return X
Expand Down Expand Up @@ -388,7 +388,7 @@ end
function convert(::Type{<:TaylorModelReachSet}, H::AbstractHyperrectangle{N};
orderQ::Integer=2, orderT::Integer=8, Δt::TimeInterval=zeroT) where {N}
n = dim(H)
x = set_variables("x"; numvars=n, order=orderQ)
x = variables!("x"; numvars=n, order=orderQ)

# preallocations
vTM = Vector{TaylorModel1{TaylorN{N},N}}(undef, n)
Expand Down Expand Up @@ -420,7 +420,7 @@ function overapproximate(Z::AbstractZonotope{N}, ::Type{<:TaylorModelReachSet};
orderQ::Integer=2, orderT::Integer=8, Δt::TimeInterval=zeroT,
indices=1:dim(Z), box_reduction=false) where {N}
n = dim(Z)
x = set_variables("x"; numvars=n, order=orderQ)
x = variables!("x"; numvars=n, order=orderQ)

if order(Z) > 1
if box_reduction
Expand Down Expand Up @@ -475,7 +475,7 @@ function _overapproximate_structured(Z::AbstractZonotope{N}, ::Type{<:TaylorMode
orderQ::Integer=2, orderT::Integer=8,
Δt::TimeInterval=zeroT) where {N}
n = dim(Z)
x = set_variables("x"; numvars=n, order=orderQ)
x = variables!("x"; numvars=n, order=orderQ)

# check structure
order(Z) == 2 ||
Expand Down Expand Up @@ -512,7 +512,7 @@ function _overapproximate_structured(Zcp::CartesianProduct{N,<:Zonotope,<:Interv
orderQ::Integer=2, orderT::Integer=8,
Δt::TimeInterval=zeroT) where {N}
n = dim(Zcp)
x = set_variables("x"; numvars=n, order=orderQ)
x = variables!("x"; numvars=n, order=orderQ)

# check structure
Z = Zcp.X
Expand Down Expand Up @@ -555,7 +555,7 @@ function _overapproximate_structured_full(Zcp::CartesianProduct{N,<:Zonotope,<:I
orderQ::Integer=2, orderT::Integer=8,
Δt::TimeInterval=zeroT) where {N}
n = dim(Zcp) - 1
x = set_variables("x"; numvars=n + 1, order=orderQ)
x = variables!("x"; numvars=n + 1, order=orderQ)

# check structure
# not checking structure
Expand Down
4 changes: 2 additions & 2 deletions test/quality_assurance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ import Aqua, ExplicitImports
:mass_matrix, :state_matrix, :stateset, :stiffness_matrix,
:viscosity_matrix,
# due to reexporting TaylorIntegration:
:TaylorIntegration, :Taylor1, :get_numvars, :get_variables,
:set_variables)
:TaylorIntegration, :Taylor1, :get_numvars, :variables,
:variables!)
ignores_no_stale_explicit_imports = (:AbstractODEScheme, Symbol("@polyvar"))
ExplicitImports.test_explicit_imports(ReachabilityAnalysis;
all_explicit_imports_are_public=(ignore=ignores_all_explicit_imports_are_public,),
Expand Down
6 changes: 3 additions & 3 deletions test/reachsets/reachsets.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ReachabilityAnalysis: zeroI, TimeInterval
using TaylorModels: set_variables, Taylor1, TaylorModel1
using ReachabilityAnalysis: TimeInterval, zeroI
using TaylorModels: Taylor1, TaylorModel1, variables!

@testset "Reach-set constructors" begin
X = BallInf(ones(2), 1.0)
Expand Down Expand Up @@ -125,7 +125,7 @@ end

@testset "Taylor model reach-sets with non-float coefficients" begin
Δt, orderT, orderQ = 0 .. 1, 4, 3
x = set_variables(IntervalArithmetic.Interval{Float64}, "x"; order=orderQ, numvars=2)
x = variables!(IntervalArithmetic.Interval{Float64}, "x"; order=orderQ, numvars=2)
p1 = Taylor1([0, (0 .. 0.1) + (0 .. 0.01) * x[2]], orderT)
p2 = Taylor1([0, (0 .. 0.5) + (0 .. 0.02) * x[1] + (0 .. 0.03) * x[2]], orderT)
vec = [TaylorModel1(p1, zeroI, zeroI, Δt), TaylorModel1(p2, zeroI, zeroI, Δt)]
Expand Down