    Next: Wrong results Up: Execution problems Previous: Execution problems   Contents

Interval valuation problems

You have now successfully completed the compilation of your program and you run it. But it just crashes with an error message such as:

BIAS Error: ArcSin argument out of range
BIAS Error: Power: Negative or zero exponent with zero base
BIAS Error: Division by Zero
You have to remember that not all expression may have an interval evaluation according to the ranges of the unknowns (see section 2.1.1.3 for a complete list of the expression that may lead to an evaluation problem.

To solve this problem first consider the expressions you have, determine which of them may lead to an evaluation problem and examine if you may modify the expression to avoid the interval valuation problem (for example for an equation whose terms have a common denominator just consider the numerator of the expression as the interval evaluation of the denominator may include 0, a typical case for which an interval valuation cannot be calculated).

If the problem persist you will have to identify which terms may lead to an interval valuation problem for each expression (we will call them the faulty terms). Then before performing the interval evaluation of the expression you will have to compute the interval evaluation of the faulty terms. If this evaluation leads to interval that will cause an evaluation problem, then instead of performing the interval evaluation of the expression you will affect an interval to the expression that depends on the context.

For example assume that you have to solve the equations system

y/(x-1)+cos(y)=0
arcsin(y)+x*y-1=0
with x, y in the range [-10,10]. The faulty term for the first equation is x-1 whose interval evaluation cannot include 0 (as we divide by x-1). The faulty term for the second equation is y which must lie in the range [-1,1] (as we have arcsin(y)). Now you want to write the procedure that will be used to compute the interval evaluation of these equations that is to be used by the general solving procedure. Initially you will have written this procedure as:

INTERVAL_VECTOR F(int l1,int l2, INTERVAL_VECTOR &X)
{
INTERVAL_VECTOR V(2);
if(l1==1)
V(1)=X(2)/(X(1)-1)+Cos(X(2));
if(l2==2)
V(2)=ArcSin(X(2))+X(1)*X(2);
return V;
}
In that case the procedure will crash immediately as for the initial search domain the first equation cannot be evaluated. Now if the interval evaluation of the faulty term of the first equation includes 0 we must not evaluate the equation. But still we wish to eliminate a box for which the interval evaluation of x-1 includes 0 only if the maximal absolute value of the interval evaluation is very close to 0. We may deal with this problem with the following code:

if(l1==1)
{
U=X(1)-1;
if(Sup(IAbs(U))<1.e-4)V(1)=1;
else
{
if(Inf(U)<=0 && Sup(U)>=0)V(1)=INTERVAL(-1.e8,1.e8);
else V(1)=X(2)/U+Cos(X(2));
}
}
If the interval evaluation of x-1 has a maximal absolute value lower than 1e-4 the interval evaluation of the first equation is 1 and the solving algorithm will discard the corresponding box. On the other hand we set the interval evaluation of the equation to an arbitrary interval that includes 0 so that the solving algorithm will not discard the box.

For the second equation the management of the evaluation problem is somewhat different. If the interval of y has no intersection with the interval [-1,1] then we may discard the box. Otherwise we may change the the interval for y to this intersection and proceed with the evaluation of the equation. To compute this intersection we use the Intersection procedure of BIAS/Profil that returns 0 if two intervals have an empty intersection. The code is

if(l2==1)
{
if(Intersection(U,X(2),INTERVAL(-1,1))==0)V(2)=1;
else
{
X(2)=U;
V(2)=ArcSin(X(2))+X(1)*X(2);
}
}

Clearly managing this process by hand is tedious and prone to errors. ALIAS-Maple offers a procedure that determine all the constraints that must be satisfied by the unknowns for the expressions to be interval-valuable and another procedure that manages automatically the process we have performed in the example.    Next: Wrong results Up: Execution problems Previous: Execution problems   Contents
Jean-Pierre Merlet 2012-12-20