codac icon indicating copy to clipboard operation
codac copied to clipboard

Error in gates result of contraction by Lohner Contractor

Open bneveu opened this issue 2 years ago • 4 comments

Le contracteur CtcLohner perd les portes initiales et finales ponctuelles du premier tube d'un tube vector de dimension 2 (BVP) pendant la contraction. la porte initiale [1,1] devient [-92.35, 94.85] la porte finale [0,0] devient [-93.6, 93.6]

code


#include #include #include "codac.h" #include "ibex.h"

using namespace std; using namespace ibex; using namespace codac;

int main(){

IntervalVector bounds (2);

bounds[0]=Interval(-100,100);
bounds[1]=Interval(-100,100);

Interval domain(0.,1);

TubeVector x(domain,0.5,bounds);
Function f("x1", "x2" ,"(x2;x1)");

IntervalVector v(2);
v[0]=Interval(1.,1.);
v[1]=Interval(-100,100);

x.set(v, 0.); // ini

v[0]=Interval(0.,0.);
v[1]=Interval(-100,100);
x.set(v, 1.); // ini
cout << " x avant " << x << endl;

CtcLohner ctclohner(f);
cout << " x before Lohner " << x << endl;
for (int k=0; k< x.size(); k++){

 const Slice *slice = x[k].first_slice();
 while(slice != NULL){
  cout << " slice " << k << *slice << endl;
  slice = slice->next_slice();
 }

} ctclohner.contract(x); cout << " x after Lohner " << x << endl; for (int k=0; k< x.size(); k++){

 const Slice *slice = x[k].first_slice();
 while(slice != NULL){
   cout << " slice " << k << *slice << endl;
   slice = slice->next_slice();
 }

} cout << " x " << x << endl; return 0; }


voici les résultats x avant TubeVector (dim 2) [0, 1]↦([-100, 100] ; [-100, 100]), 2 slices x before Lohner TubeVector (dim 2) [0, 1]↦([-100, 100] ; [-100, 100]), 2 slices slice 0Slice [0, 0.5]↦([1, 1])[-100, 100]([-100, 100]) slice 0Slice [0.5, 1]↦([-100, 100])[-100, 100]([0, 0]) slice 1Slice [0, 0.5]↦([-100, 100])[-100, 100]([-100, 100]) slice 1Slice [0.5, 1]↦([-100, 100])[-100, 100]([-100, 100]) x after Lohner TubeVector (dim 2) [0, 1]↦([-93.6, 94.85] ; [-100, 100]), 2 slices slice 0Slice [0, 0.5]↦([-92.35, 94.85])[-92.35, 94.85]([-92.35, 93.6]) slice 0Slice [0.5, 1]↦([-92.35, 93.6])[-93.6, 93.6]([-93.6, 93.6]) slice 1Slice [0, 0.5]↦([-100, 100])[-100, 100]([-100, 100]) slice 1Slice [0.5, 1]↦([-100, 100])[-100, 100]([-100, 100]) x TubeVector (dim 2) [0, 1]↦([-93.6, 94.85] ; [-100, 100]), 2 slices

bneveu avatar Mar 23 '22 10:03 bneveu