Skip to content

Root finding with interval parameters #158

@jebej

Description

@jebej

I couldn't find an example for this in the docs, but are Interval values (not unknowns) allowed in the root function?

I tried the following (note the interval g1 parameter), but it doesn't appear to finish. Any advice on if this is doable?

Note that the code works great if I plug in a number for g2, but I would like the result interval to reflect the uncertainty in g2.

using IntervalRootFinding, IntervalArithmetic, StaticArrays

function f(z)
    # units in MHz
    f1 = 5303.5  # frequency for resonator 1
    χ1 = 0.34144 # shift for resonator 1
    g1 = 38..42      # estimated coupling for resonator 1

    f2 = 4522.7  # frequency for resonator 2
    χ2 = 0.24841 # shift for resonator 2

    fq, g2 = z   # unknown qubit freq and coupling for resonator 2
    return SVector(
        (fq-f1)*χ1 + g1^2,
        (fq-f2)*χ2 + g2^2
    )
end

rts = roots(f, IntervalBox(0..8000, 0..100))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions