Enclosing Sliding Surfaces of a Specific Class of Uncertain Hybrid Systems




This microsite presents an a Python program to help the reader of the paper
Enclosing Sliding Surfaces of a Specific Class of Uncertain Hybrid Systems, SNR 2020.

The simplest is to use Python online (easy, but not very efficient)

We use PyGame (Python online) :


Copy-paste the following lines in the program window. Run.

#########################################################################
import os
os.system('[ ! -d squashfs-root ] && wget https://github.com/ENSTABretagneRobotics/VIBES/releases/download/0.2.3/VIBes-0.2.3-linux.AppImage && chmod +x ./VIBes-0.2.3-linux.AppImage && ./VIBes-0.2.3-linux.AppImage --appimage-extract')
os.system('cd squashfs-root && chmod +x ./VIBes-viewer && ./VIBes-viewer &')
import time
time.sleep(1)
#########################################################################
# Your program here
from pyibex import *
from pyibex.thickset import *

class ThickSep:
    def __init__(self, Ssub, Ssup): self.Ssub, self.Ssup = Ssub, Ssup
    def separate(self, X):
       xin_sub, xout_sub = X.copy(), X.copy()
       xin_sup, xout_sup = X.copy(), X.copy()
       self.Ssub.separate(xin_sub, xout_sub)
       self.Ssup.separate(xin_sup, xout_sup)
       return (xin_sup, xin_sub | xout_sup, xout_sub)
    def __and__(self, thickSep_y): return ThickSep(self.Ssub & thickSep_y.Ssub, self.Ssup & thickSep_y.Ssup)
    def __invert__(self): return ThickSep(~self.Ssup, ~self.Ssub)
    def __or__(self, thickSep_y): return ThickSep(self.Ssub | thickSep_y.Ssub, self.Ssup | thickSep_y.Ssup)

def ThickSep_from_function(f, p, y):
    S = SepFwdBwd(f, y)
    Ssub = ~SepProj(~S, p)
    Ssup = SepProj(S, p)
    return ThickSep(Ssup, Ssub)

def ThickTest_from_ThickSep(S):
    def test(X):
       Xin, Xu, Xout = S.separate(X)
       if Xin.is_empty(): return IN
       elif Xout.is_empty(): return OUT
       elif Xu.is_empty(): return MAYBE
       return UNK
    return test

E,Y=[-0.1, 0.1],[-oo, 0]
P1,P2 = IntervalVector(1,E),IntervalVector(2,E)
c1 = Function("x1", "x2", "p2", "p3", "(x1+p2)^2 + (x2+p3)^2-1")
A1 = ThickSep_from_function(c1, p=P2, y=Y)
La1 = Function("x1", "x2", "p1", "x1*x2-x2*(sin(x1)+p1)")
Lb1 = Function("x1", "x2", "p1", "x1*x2-x2*(sin(x1)+x2+p1)")
SLa1 = ThickSep_from_function(La1, p=P1, y=Y)
SLb1 = ThickSep_from_function(Lb1, p=P1, y=Y)
S1 = A1&~A1 & ~SLa1 & SLb1
c2=Function("x1","x2","p1","x2+p1+0.1")
A2 = ThickSep_from_function(c2, p=P1, y=Y)
La2 = Function("x1", "x2", "p1", "p1-sin(x1)")
Lb2 = Function("x1", "x2", "p1", "p1-sin(x1)-x2")
SLa2 = ThickSep_from_function(La2, p=P1, y=Y)
SLb2 = ThickSep_from_function(Lb2, p=P1, y=Y)
S2 = A2&~A2 & ~SLa2 & SLb2
S = (S1 & ~A2)|(S2 & ~A1)
X0 = IntervalVector(2, [-2, 2])
P =ThickPaving(X0, ThickTest_from_ThickSep(S), 0.01, display=True)
#########################################################################
import sys; sys.stdin.read(1) # Without that the GUI closes...
########################################################################