next up previous contents
Next: Example 3 Up: Examples Previous: Example 1   Contents


Example 2

The problem we want to solve has been presented in section 2.3.5.2,15.1.1.

The IntervalGradient procedure is:

 
INTERVAL_MATRIX IntervalGradient (int l1,int l2,INTERVAL_VECTOR & in)
{
INTERVAL_MATRIX Grad(3,3);
INTERVAL x,y,teta;
x=in(1);y=in(2);teta=in(3);
if(l1==1)
  {
    if(l2==1){Grad(1,1)=2*x;return Grad;}
    if(l2==2){Grad(1,2)=2*y;return Grad;}
    if(l2==3){Grad(1,3)=0;return Grad;}
  }
if(l1==2)
  {
    if(l2==1){Grad(2,1)=2.0*x-20.0+8.0*Cos(teta);return Grad;}
    if(l2==2){Grad(2,2)=2.0*y+8.0*Sin(teta);return Grad;}
    if(l2==3){Grad(2,3)=-8.0*x*Sin(teta)+80.0*Sin(teta)+8.0*y*Cos(teta);
      return Grad;}
  }
if(l1==3)
  {
    if(l2==1){Grad(3,1)=2.0*x-6.0+4.0*Cos(teta)-4.0*Sin(teta);
      return Grad;}
    if(l2==2){Grad(3,2)=2.0*y-20.0+4.0*Sin(teta)+4.0*Cos(teta);return Grad;}
    if(l2==3){
      Grad(3,3)=52.0*Sin(teta)-28.0*Cos(teta)+(4.0*Cos(teta)-
              4.0*Sin(teta))*y+(-4.0*Sin(teta)-4.0*Cos(teta))*x;
      return Grad;
             }
  }
}
We may use the same main program as in the previous example (the name of this program is
Test_Solve_General1_Gradient).

Let's assume that we set epsilonf to 0 and epsilon to 0.01 while looking at all the solutions (Stop=0), using the maximum equation ordering and setting Dist to 0.1. The algorithm provide the following solutions after using 55 boxes:

\begin{eqnarray*}
&&x=[3.36607,3.37306]~~~~y=[6.21468,6.21856]~~~\theta
=[-0.808...
...99845,5.00165]~~~~y=[4.99845,5.00146]~~~\theta =[-0.000536641,0]
\end{eqnarray*}

We notice that all of the roots are contained in the solution intervals.

If we use the maximum middle-point equation ordering the algorithm provide the same solution intervals.

With epsilonf=0.001, epsilon=0 the algorithm still find exactly the root with 55 boxes and a computation time of 7010ms. Here Moore test may have failed as the solution in $\theta$ is 0, which correspond exactly to split point in the bisection process: it may be useful to break the symmetry in the test domain.

Using the single bisection mode and setting the flag Single_Bisection to 2 enable to reduce the number of boxes to 33 and the computation time to 3580ms for epsilonf=0.00001.

Note that we may improve the efficiency of the procedure by using simplification procedures such as the 2B (section 2.17) and the 3B method. In that case for epsilonf=1e-6, epsilon=1e-6 the number of boxes will have been reduced to 7. Note that the solution [5,5,0] is still not guaranteed. But using a search space of $[-\pi,\pi+1]$ for $\theta$ allow the Moore test to guarantee both solutions.


next up previous contents
Next: Example 3 Up: Examples Previous: Example 1   Contents
Jean-Pierre Merlet 2012-12-20