Improve my bound

In Bound the joint spectral radius of my system, a De Bruijn graph with four nodes proved stability, and left a gap between its rate and the joint spectral radius. Here the package designs the graph: it proves stability with three nodes, and finds the exact joint spectral radius with ten. Refining the graph explains refinement, and this page runs it.

using PathCompleteCertificates
import Clarabel
import LinearAlgebra
using Plots

const TEMPLATE = QuadraticTemplate()
const OPTIMIZER = Clarabel.Optimizer

The system

The rotation and the shear of Bound the joint spectral radius of my system.

A = [0.75 * [0.0 1.0; -1.0 0.0], 0.75 * [1.0 1.0; 0.0 1.0]]
problem = StabilityProblem(switched_system(A))

One call

refine starts from the common graph and adds nodes where the certificate is tight. By default it splits the node with the most tight outgoing edges (TightestNodeSplitting), and the keyword strategy chooses another (see Refining the graph). depth_max = 10 raises the number of graphs it may visit from its default, 5. For each graph it visits, its number of nodes, the certified rate, and the lower bound read from the tight edges:

trace = refine(TEMPLATE, problem; optimizer = OPTIMIZER, depth_max = 10)

progress = [
    (n_nodes(graph), certificate.rate, jsr_lower_bound(certificate)) for
    (graph, certificate) in zip(graphs(trace), certificates(trace))
]
7-element Vector{Tuple{Int64, Float64, Float64}}:
 (1, 1.0606603622436523, 0.75)
 (2, 1.0050239562988281, 0.75)
 (3, 0.9863557815551758, 0.75)
 (4, 0.9829082489013672, 0.9540147371355517)
 (5, 0.9825611114501953, 0.9760021467165344)
 (9, 0.9765176773071289, 0.9760021467165344)
 (10, 0.9760026931762695, 0.9760021467165344)

The rate goes below one at three nodes. The lower bound then rises to meet the rate, and the run stops at ten nodes with a proof that the rate is the joint spectral radius:

status(trace)
OPTIMAL::RefinementStatus = 0

The De Bruijn graphs, for comparison, go below one only at order 2, with four nodes:

hierarchy = [
    (2^k, certify(TEMPLATE, de_bruijn(k, 2), problem; optimizer = OPTIMIZER).rate) for
    k in 0:3
]
4-element Vector{Tuple{Int64, Float64}}:
 (1, 1.0606603622436523)
 (2, 1.0050239562988281)
 (4, 0.9842119216918945)
 (8, 0.9773092269897461)

The bounds, drawn

On the left, the two bounds of each step against the number of nodes, and the rates of the De Bruijn graphs, whose nodes double with the order. The first lower bounds, $0.75$, fall below the chart. On the right, the last graph, its tight edges in bold: every node keeps at most one tight outgoing edge, which proves the rate exact, and the tight edges form one cycle, which reads the slowest sequence $2, 2, 2, 2, 1$.

left = plot(;
    xlabel = "number of nodes",
    ylabel = "bound on the joint spectral radius",
    legend = :topright,
    ylims = (0.94, 1.07),
    title = "refine against De Bruijn",
)
plot!(
    left,
    first.(progress),
    getindex.(progress, 2);
    marker = :circle,
    lw = 2,
    color = :black,
    label = "refine, upper bound",
)
plot!(
    left,
    first.(progress),
    last.(progress);
    marker = :circle,
    lw = 2,
    ls = :dash,
    color = :black,
    label = "refine, lower bound",
)
plot!(
    left,
    first.(hierarchy),
    last.(hierarchy);
    marker = :square,
    lw = 2,
    color = :steelblue,
    label = "De Bruijn, upper bound",
)
hline!(left, [1.0]; color = :red, ls = :dot, label = "stability threshold")

final = last(certificates(trace))

plot(left, right; layout = (1, 2), size = (900, 500), margin = 5Plots.mm)
Example block output

What it proves

is_jsr_exact confirms the proof, and the rate matches the slowest product of Bound the joint spectral radius of my system, the sequence $2, 2, 2, 2, 1$:

slowest = maximum(abs, LinearAlgebra.eigvals(A[1] * A[2]^4))^(1 / 5)
is_jsr_exact(final), final.rate, slowest
(true, 0.9760026931762695, 0.9760021467165344)

This page was generated using Literate.jl.