Skip to content

Unexpected library error message when finding roots of simple function #232

@brianguenter

Description

@brianguenter

I was testing interval root finding to see if it would work for my application and created this simple problem:

using IntervalArithmetic, IntervalRootFinding
using LinearAlgebra: norm
using StaticArrays: SVector
using IntervalArithmetic.Symbols
using Plots

function one_root()
    p(t, p0::AbstractVector, d::AbstractVector) = p0 .+ d .* t

    f(t) = norm(p(t, SVector(-2.0, 0.0, 0.0), SVector(1.0, 0.0, 0.0))) - 1.0

    plot(f, 0.0:0.01:4.0)
    roots(f, 0.0 .. 10)
end

When I run one_root I get this error:

ERROR: ArgumentError: < is purposely not supported for overlapping intervals. See instead strictprecedes

f(t) is not that weird a function. It has a zero at 1 and at 3:

Image

Am I misusing the IntervalRootFinding library? Or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions