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

Polytopic overappoximation of a taylor model #1788

Open
mforets opened this issue Apr 14, 2019 · 1 comment
Open

Polytopic overappoximation of a taylor model #1788

mforets opened this issue Apr 14, 2019 · 1 comment
Assignees

Comments

@mforets
Copy link
Member

mforets commented Apr 14, 2019

Let F = (p(x₀, t), I) be an n-dimensional TM flowpipe, x₀ ∈ X₀, t ∈ [0, δ]. Given a set of template directions d1, ..., dr in Rn, we can evaluate the support functions

bi = sup{di^T x} s.t. x = p(x₀, t) + y , x₀ ∈ X₀ , t ∈ [0, δ], y ∈ I
for each i = 1, ..., r.

Note that one can find a value which is larger than bi using techniques from SDP relaxation (*).

Refs:

@mforets mforets transferred this issue from JuliaReach/Reachability.jl Nov 12, 2019
@dfcaporale
Copy link
Member

dfcaporale commented Oct 6, 2021

Our try with @mforets today:

using TaylorModels
const IA = IntervalArithmetic;

I = IA.Interval(-0.5, 0.5) # interval remainder

x₀ = IA.Interval(0.0) # expansion point
D = IA.Interval(-3.0, 1.0)
p1 = Taylor1([2.0, 1.0], 2) # define a linear polynomial
p2 = Taylor1([0.9, 3.0], 2) # define another linear polynomial
vTM = [TaylorModel1(pi, I, x₀, D) for pi in [p1, p2]] # define vector of Taylor models
using LazySets.Approximations:AbstractDirections

function _overapproximate(vTM::Vector{TaylorModel1{T, S}}, dir::AbstractDirections{T}) where {T, S}

    Y2 = Vector{HalfSpace{T, Vector{T}}}();
    m = length(vTM)

    model = Model(Ipopt.Optimizer)
    register(model, :dot, m, dot; autodiff = true)

    dom_vTM = domain(vTM[1]) # asumimos mismo dominio de t en todas las variables
    t = @variable(model, dom_vTM.lo  t  dom_vTM.hi) # variables de estado
    r = @variable(model, r[1:m]) # remainders
    for i = 1:length(vTM)
        set_upper_bound(r[i], remainder(vTM[i]).hi)
        set_lower_bound(r[i], remainder(vTM[i]).lo)
    end    
    
    for d in dirs
        y = dot(d,vTM)
        coefs = y.pol.coeffs
        @NLobjective(model, Max, coefs[1] + sum(coefs[i]*t^(i-1) for i in 2:length(coefs)) + 
                                 sum(r[i]*d[i] for i in 1:m))
        optimize!(model)
        o = objective_value(model)
        push!(Y2, HalfSpace(d, o))
    end
    
    return HPolyhedron(Y2)
end

@mforets mforets self-assigned this Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants