Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve failing tests (validated_integ.jl) #126

Merged
merged 7 commits into from Nov 2, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
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
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
@@ -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
@@ -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
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
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
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