Skip to content

Commit

Permalink
Solve failing tests (validated_integ.jl) (#126)
Browse files Browse the repository at this point in the history
* CompatHelper: bump compat for IntervalArithmetic to 0.20, (keep existing compat)

* Fix eltype -> numtype

* Remove definition of symmetric_box

which is exported in IntervalArithmetics.jl

* Test version in Julia v1.5 at least

* Add docs/Project.toml

* Update IA and julia minimal versions, and bump minimal version

* Update docs.yml

try to fix doc deployment

Co-authored-by: CompatHelper Julia <[email protected]>
Co-authored-by: lucaferranti <[email protected]>
  • Loading branch information
3 people authored Nov 2, 2021
1 parent b624a80 commit 69161c1
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
strategy:
fail-fast: false
matrix:
julia-version: ['1.3', '1', 'nightly']
julia-version: ['1.5', '1', 'nightly']
julia-arch: [x64]
os: [ubuntu-latest, macOS-latest, windows-latest]
# # 32-bit Julia binaries are not available on macOS
# exclude:
# - os: macOS-latest
# julia-arch: x86

steps:
- uses: actions/checkout@v2
- name: "Set up Julia"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
GKSwstype: nul
run: julia --project=docs/ docs/make.jl
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TaylorModels"
uuid = "314ce334-5f6e-57ae-acf6-00b6e903104a"
repo = "https://github.com/JuliaIntervals/TaylorModels.jl.git"
version = "0.4.2"
version = "0.5.0"

[deps]
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
Expand All @@ -15,13 +15,13 @@ TaylorIntegration = "92b13dbe-c966-51a2-8445-caca9f8a7d42"
TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"

[compat]
IntervalArithmetic = "0.16, 0.17, 0.18, 0.19"
IntervalArithmetic = "^0.20"
IntervalRootFinding = "0.5"
RecipesBase = "0.8, 1.0"
Reexport = "0.2, 1.0"
TaylorIntegration = "0.7, 0.8"
TaylorSeries = "0.10, 0.11"
julia = "1.3, 1.4, 1.5, 1.6"
julia = "1.5, 1.6"

[extras]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
7 changes: 0 additions & 7 deletions src/TaylorModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ import IntervalArithmetic: showfull

import LinearAlgebra: norm

# export Taylor1Model, bound, make_Taylor_model, TMcomposition,
# taylor1_var, integrate, degree,
# calculate_set, Taylor_step

export TaylorModel1, RTaylorModel1, TaylorModelN, TMSol

export remainder, polynomial, domain, expansion_point, flowpipe, get_xTM,
Expand All @@ -52,8 +48,5 @@ include("show.jl")
include("validatedODEs.jl")
include("recipe.jl")

# include("Taylor1/Taylor1.jl")
# include("TaylorN/TaylorN.jl")


end # module
1 change: 0 additions & 1 deletion src/auxiliary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ end
# auxiliary constructors for special intervals and boxes
@inline zero_interval(T) = zero(Interval{T})
@inline zero_box(N, T) = IntervalBox(zero_interval(T), Val(N))
@inline symmetric_box(N, T) = IntervalBox(Interval{T}(-1, 1), Val(N))


# TMSol utilities
Expand Down
28 changes: 14 additions & 14 deletions src/validatedODEs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ end
# for its = 1:10
# # Remainder of Picard iteration
# Δ = picard_remainder!(f!, t, x, dx, xxI, dxxI, δI, δt, Δx, Δ0, params)
#
#
# # If contraction doesn't hold, return old bound
# iscontractive(Δ, Δx) || return Δxold
#
Expand Down Expand Up @@ -325,7 +325,7 @@ function validated_step!(f!, t::Taylor1{T}, x::Vector{Taylor1{TaylorN{T}}},
xTMN::Vector{TaylorModelN{N,T,T}}, xv::Vector{IntervalBox{N,T}},
rem::Vector{Interval{T}}, zbox::IntervalBox{N,T}, symIbox::IntervalBox{N,T},
nsteps::Int, orderT::Int, abstol::T, params, parse_eqs::Bool,
adaptive::Bool, minabstol::T, absorb::Bool,
adaptive::Bool, minabstol::T, absorb::Bool,
check_property::Function=(t, x)->true) where {N,T}

# One step integration (non-validated)
Expand Down Expand Up @@ -586,8 +586,8 @@ function validated_integ(f!, X0, t0::T, tmax::T, orderQ::Int, orderT::Int, absto
# Validated step of the integration
(_success, δt, red_abstol) = validated_step!(f!, t, x, dx, xaux, tI, xI, dxI, xauxI,
t0, tmax, sign_tstep, xTMN, xv, rem, zB, S,
nsteps, orderT, red_abstol, params,
parse_eqs, adaptive, minabstol,
nsteps, orderT, red_abstol, params,
parse_eqs, adaptive, minabstol,
absorb, check_property)
δtI = sign_tstep * Interval(zt, sign_tstep*δt)

Expand Down Expand Up @@ -685,7 +685,7 @@ function _validate_step!(xTM1K, f!, dx, x0, params, x, t, box, dof, rem, abstol,
adaptive::Bool, minabstol;
ε=1e-10, δ=1e-6, validatesteps=20, extrasteps=50)
#
T = eltype(box[1])
T = numtype(box[1])
zI = zero_interval(T)
domT = sign_tstep * Interval{T}(0, sign_tstep*δt)
orderT = get_order(t)
Expand Down Expand Up @@ -743,7 +743,7 @@ function _validate_step!(xTM1K, f!, dx, x0, params, x, t, box, dof, rem, abstol,
# E = remainder(x0)
end
else
@warn("Minimum absolute tolerance reached: ", t[0], E′, E,
@warn("Minimum absolute tolerance reached: ", t[0], E′, E,
_success, all(iscontractive.(E′, E)), reduced_abstol)
end
else
Expand All @@ -758,7 +758,7 @@ function _validate_step!(xTM1K, f!, dx, x0, params, x, t, box, dof, rem, abstol,
end

if !all(iscontractive.(E′, E))
@warn("Maximum number of validate steps reached.", t[0], E′, E,
@warn("Maximum number of validate steps reached.", t[0], E′, E,
_success, all(iscontractive.(E′, E)))
return (_success, δt, reduced_abstol)
end
Expand Down Expand Up @@ -786,8 +786,8 @@ end

function validated_integ2(f!, X0, t0::T, tf::T, orderQ::Int, orderT::Int,
abstol::T, params=nothing;
parse_eqs=true, maxsteps::Int=2000,
absorb::Bool=false,
parse_eqs=true, maxsteps::Int=2000,
absorb::Bool=false,
adaptive::Bool=true, minabstol=T(_DEF_MINABSTOL),
validatesteps::Int=30, ε::T=1e-10, δ::T=1e-6,
absorb_steps::Int=3) where {T <: Real}
Expand All @@ -799,7 +799,7 @@ function validated_integ2(f!, X0, t0::T, tf::T, orderQ::Int, orderT::Int,
zB = zero_box(N, T)
S = symmetric_box(N, T)
t = t0 + Taylor1(orderT)

tv = Array{T}(undef, maxsteps+1)
xv = Array{IntervalBox{N,T}}(undef, maxsteps+1)
xTM1v = Array{TaylorModel1{TaylorN{T},T}}(undef, dof, maxsteps+1)
Expand Down Expand Up @@ -840,9 +840,9 @@ function validated_integ2(f!, X0, t0::T, tf::T, orderQ::Int, orderT::Int,
δt = sign_tstep * δt

# Reuse previous TaylorModel1 to save some allocations
(_success, δt, red_abstol) = _validate_step!(xTM1, f!, dxTM1, xTMN, params, x, t,
S, dof, rem, red_abstol, δt, sign_tstep, E, E′,
polv, low_ratiov, hi_ratiov,
(_success, δt, red_abstol) = _validate_step!(xTM1, f!, dxTM1, xTMN, params, x, t,
S, dof, rem, red_abstol, δt, sign_tstep, E, E′,
polv, low_ratiov, hi_ratiov,
adaptive, minabstol,
ε=ε, δ=δ,
validatesteps=validatesteps)
Expand All @@ -853,7 +853,7 @@ function validated_integ2(f!, X0, t0::T, tf::T, orderQ::Int, orderT::Int,
@inbounds tv[nsteps] = t0
t0 += δt
@inbounds t[0] = t0

# Flowpipe
@. begin
rem = remainder(xTM1)
Expand Down

2 comments on commit 69161c1

@lbenet
Copy link
Member Author

@lbenet lbenet commented on 69161c1 Nov 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/47994

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.5.0 -m "<description of version>" 69161c1bc372f350faec0d5952e2994b6a894772
git push origin v0.5.0

Please sign in to comment.