Skip to content
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
.DS_Store
docs/build/
docs/site/

Manifest.toml
22 changes: 13 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
name = "TaylorModels"
uuid = "314ce334-5f6e-57ae-acf6-00b6e903104a"
repo = "https://github.com/JuliaIntervals/TaylorModels.jl.git"
version = "0.8.0"
version = "0.9.0"

[deps]
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
IntervalRootFinding = "d2bf35a9-74e0-55ec-b149-d360ff49b807"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
TaylorIntegration = "92b13dbe-c966-51a2-8445-caca9f8a7d42"
TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"

[compat]
Aqua = "0.8"
IntervalArithmetic = "^0.20"
IntervalRootFinding = "0.5"
LinearAlgebra = "<0.0.1, 1"
Markdown = "<0.0.1, 1"
Random = "<0.0.1, 1"
IntervalArithmetic = "0.22, 0.23, 1"
IntervalRootFinding = "0.6"
LinearAlgebra = "1"
Markdown = "1"
Parameters = "0.12.3"
Random = "1"
RecipesBase = "1"
Reexport = "1"
TaylorIntegration = "0.16"
TaylorSeries = "0.18.4"
Test = "<0.0.1, 1"
StaticArrays = "1.9"
TaylorIntegration = "0.17"
TaylorSeries = "0.20"
Test = "1"
julia = "1.10"

[extras]
Expand Down
12 changes: 6 additions & 6 deletions benchmark/daisy/multivariate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ DAISY["himmilbeau"] = Dict("dom" => a×b,
"numvars" => 2,
"vars" => "x1 x2",
"f" => ((x1, x2) -> (x1*x1 + x2 - 11)*(x1 * x1 + x2 - 11) + (x1 + x2*x2 - 7)*(x1 + x2*x2 - 7)),
"ref" => Interval(85.46830677734748, 221.7338939301446) # MOSEK deg 6
"ref" => interval(85.46830677734748, 221.7338939301446) # MOSEK deg 6
)

DAISY["kepler1"] = Dict("dom" => a×b×c×d×e×f,
"numvars" => 6,
"vars" => "x1 x2 x3 x4 x5 x6",
"f" => ((x1, x2, x3, x4, x5, x6) -> x2 * x5 + x3 * x6 - x2 * x3 - x5 * x6 + x1 * (-x1 + x2 + x3 - x4 + x5 + x6)),
"ref" => Interval(-5.255935494810441, 7.321362422825775) # MOSEK deg 6
"ref" => interval(-5.255935494810441, 7.321362422825775) # MOSEK deg 6
)

DAISY["kepler2"] = Dict("dom" => a×b×c×d,
"numvars" => 4,
"vars" => "x1 x2 x3 x4",
"f" => ((x1, x2, x3, x4) -> x1 * x4 * (-x1 + x2 + x3 - x4) +
x2 * (x1 - x2 + x3 + x4) + x3 * (x1 + x2 - x3 + x4) -x2 * x3 * x4 - x1 * x3 - x1 * x2 - x4),
"ref" => Interval(-195.36974909125482, 78.3669520644375) # MOSEK deg 6
"ref" => interval(-195.36974909125482, 78.3669520644375) # MOSEK deg 6
)

DAISY["kepler3"] = Dict("dom" => a×b×c×d×e×f,
Expand All @@ -29,19 +29,19 @@ DAISY["kepler3"] = Dict("dom" => a×b×c×d×e×f,
"f" => ((x1, x2, x3, x4, x5, x6) -> x1 * x4 * (-x1 + x2 + x3 - x4 + x5 + x6) +
x2 * x5 * (x1 - x2 + x3 + x4 - x5 + x6) +x3* x6 * (x1 + x2 - x3 + x4 + x5 - x6) -
x2 * x3 * x4 -x1* x3* x5 - x1 * x2 * x6 - x4 * x5 * x6),
"ref" => Interval(-309.8484155131222, 17.982082401462407) # MOSEK deg 6
"ref" => interval(-309.8484155131222, 17.982082401462407) # MOSEK deg 6
)

DAISY["Rigidbody1"] = Dict("dom" => a×b×c,
"numvars" => 3,
"vars" => "x1 x2 x3",
"f" => ((x1, x2, x3) -> -x1*x2 - 2*x2*x3 - x1 - x3),
"ref" => Interval(-20.786552979420335, -0.540012836551535) # MOSEK deg 6
"ref" => interval(-20.786552979420335, -0.540012836551535) # MOSEK deg 6
)

DAISY["Rigidbody2"] = Dict("dom" => a×b×c,
"numvars" => 3,
"vars" => "x1 x2 x3",
"f" => ((x1, x2, x3) -> 2*(x1*x2*x3) + (3*x3*x3) - x2*(x1*x2*x3) + (3*x3*x3) - x2),
"ref" => Interval(68.81138021006673, 359.98566570476504) # MOSEK deg 6
"ref" => interval(68.81138021006673, 359.98566570476504) # MOSEK deg 6
)
35 changes: 18 additions & 17 deletions benchmark/daisy/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# The following domains are used throughout the tests in Tables 3-5 in
# [1] Althoff, M., Grebenyuk, D., & Kochdumper, N. (2018). Implementation of Taylor models in CORA 2018.
# In Proc. of the 5th International Workshop on Applied Verification for Continuous and Hybrid Systems.
a = Interval(-4.5, -0.3)
b = Interval(0.4, 0.9)
c = Interval(3.8, 7.8)
d = Interval(8.0, 10.0)
e = Interval(-10.0, 8.0)
f = Interval(1.0, 2.0)
a = interval(-4.5, -0.3)
b = interval(0.4, 0.9)
c = interval(3.8, 7.8)
d = interval(8.0, 10.0)
e = interval(-10.0, 8.0)
f = interval(1.0, 2.0)

# ======================
# Relative precision
Expand All @@ -27,7 +27,7 @@ function relative_precision(x, x_ref)
x_ref_low, x_ref_high = inf(x_ref), sup(x_ref)
rel_low = -(x_low - x_ref_low) / (x_ref_high - x_ref_low)
rel_high = (x_high - x_ref_high) / (x_ref_high - x_ref_low)
return 100 * Interval(rel_low, rel_high)
return 100 * interval(rel_low, rel_high)
end

# ==========================
Expand All @@ -36,37 +36,38 @@ end

# taylor model in one variable
function bounds_TM(func::Function, dom::Interval, ord::Int)
x0 = Interval(mid(dom))
x0 = interval(mid(dom))
x = TaylorModel1(ord, x0, dom)
return evaluate(func(x), dom - x0)
end

# taylor model in N variables
function bounds_TM(func::Function, dom::IntervalBox{N}, ord) where {N}
x0 = mid(dom)
function bounds_TM(func::Function, dom::AbstractVector{<:Interval}, ord)
x0 = mid.(dom)
set_variables(Float64, "x", order=2ord, numvars=N)
x = [TaylorModelN(i, ord, IntervalBox(x0), dom) for i=1:N]
x = [TaylorModelN(i, ord, x0, dom) for i in eachindex(dom)]
return evaluate(func(x...), dom - x0)
end

# normalized taylor model in one variable
function bounds_TM_NORM(func::Function, dom::Interval, ord::Int)
x0 = Interval(mid(dom))
x0 = interval(mid(dom))
x = TaylorModel1(ord, x0, dom)
xnorm = normalize_taylor(x.pol, dom - x0, true)
xnormTM = TaylorModel1(xnorm, 0..0, 0..0, -1..1)
return evaluate(func(xnormTM), -1..1)
end

# normalized taylor model in N variables
function bounds_TM_NORM(func::Function, dom::IntervalBox{N}, ord::Int) where {N}
x0 = mid(dom)
function bounds_TM_NORM(func::Function, dom::AbstractVector{<:Interval}, ord::Int)
x0 = mid.(dom)
N = length(dom)
set_variables(Float64, "x", order=2ord, numvars=N)

zeroBox = IntervalBox(0..0, N)
symBox = IntervalBox(-1..1, N)
zeroBox = fill(0..0, N)
symBox = fill(-1..1, N)

x = [TaylorModelN(i, ord, IntervalBox(x0), dom) for i=1:N]
x = [TaylorModelN(i, ord, x0, dom) for i in eachindex(dom)]
xnorm = [normalize_taylor(xi.pol, dom - x0, true) for xi in x]
xnormTM = [TaylorModelN(xi_norm, 0..0, zeroBox, symBox) for xi_norm in xnorm]
return evaluate(func(xnormTM...), symBox)
Expand Down
10 changes: 5 additions & 5 deletions benchmark/daisy/univariate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@
DAISY["sine"] = Dict("dom" => a,
"numvars" => 1,
"f" => (x -> sin(x)),
"ref" => Interval(-1.0, 0.977530117665097) # (*)
"ref" => interval(-1.0, 0.977530117665097) # (*)
)

DAISY["bspline0"] = Dict("dom" => a,
"numvars" => 1,
"f" => (x -> (1 - x) * (1 - x) * (1 - x) / 6.0),
"ref" => Interval(0.36616666666666675, 27.729166666666668) # (*)
"ref" => interval(0.36616666666666675, 27.729166666666668) # (*)
)

DAISY["bspline1"] = Dict("dom" => a,
"numvars" => 1,
"f" => (x -> (3*x*x*x - 6*x*x + 4) / 6.0),
"ref" => Interval(-65.14583333333333, 0.5631666666666667) # (*)
"ref" => interval(-65.14583333333333, 0.5631666666666667) # (*)
)

DAISY["bspline2"] = Dict("dom" => a,
"numvars" => 1,
"f" => (x -> (-3*x*x*x + 3*x*x + 3*x + 1) / 6.0),
"ref" => Interval(0.07516666666666667, 53.604166666666664) # (*)
"ref" => interval(0.07516666666666667, 53.604166666666664) # (*)
)

DAISY["bspline3"] = Dict("dom" => a,
"numvars" => 1,
"f" => (x -> -x*x*x / 6.0),
"ref" => Interval(0.0045, 15.1875) # (*)
"ref" => interval(0.0045, 15.1875) # (*)
)
2 changes: 1 addition & 1 deletion docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
```

```@autodocs
Modules = [TaylorModels]
Modules = [TaylorModels, TaylorModels.ValidatedInteg]
```
18 changes: 10 additions & 8 deletions src/TaylorModels.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module TaylorModels

using Reexport
@reexport using TaylorSeries, IntervalArithmetic
@reexport using TaylorIntegration
@reexport using TaylorSeries, IntervalArithmetic, IntervalArithmetic.Symbols
# @reexport using TaylorIntegration

using IntervalRootFinding
using LinearAlgebra: norm, mul!, cond, isposdef
using LinearAlgebra: norm, isposdef
using StaticArrays

using RecipesBase

Expand All @@ -29,22 +30,23 @@ import LinearAlgebra: norm
export TaylorModel1, RTaylorModel1, TaylorModelN, TMSol

export remainder, polynomial, domain, expansion_point, flowpipe, get_xTM,
rpa, fp_rpa, bound_remainder, centered_dom,
validated_integ, validated_integ2
rpa, fp_rpa, bound_remainder, centered_dom, symmetric_box

export linear_dominated_bounder, quadratic_fast_bounder


setdisplay(:full)

include("constructors.jl")
include("auxiliary.jl")
include("promotion.jl")
include("bounds.jl")
include("evaluate.jl")
include("rpa_functions.jl")
include("arithmetic.jl")
include("rpa_functions.jl")
include("integration.jl")
include("show.jl")
include("valid_integ/validated_integ.jl")
include("valid_integ/validated_integ2.jl")
include("valid_integ/ValidatedInteg.jl")
include("recipe.jl")


Expand Down
Loading
Loading