next up previous contents Next: Parallel processing Up: ALIAS-C++ Previous: Miscellaneous procedures

  • La page de J-P. Merlet
  • J-P. Merlet home page
  • La page Présentation de HEPHAISTOS
  • HEPHAISTOS home page
  • La page "Présentation" de l'INRIA
  • INRIA home page

    Subsections



    Parser, Generic Solver and Analyzer


    The ALIAS parser

    As it has been seen in the previous chapters the interval evaluation of an equation is highly dependent upon its formulation (for example the evaluation of $x^2+x$ may be quite different from the evaluation of $x(x+1)$ for the same range on $x$). For testing purposes it may therefore be interesting to change the formulation of an equation (for example by using MAPLE), write its analytical form in a file and test what will be the interval evaluation of this equation in this analytical form: this is one objective of the ALIAS parser. Basically this parser takes as input: and will then produces as output the interval evaluation of the equations. In the formula file you may indicate an arbitrary number of equations, each of them being prefixed by eq=. For example
     
    eq=(y^2-1)*z+(2*y*t-2)*x
    eq=2+(-10*t+(-10+2*y*t)*y)*y+((4+4*y^2)*z+(4+4*y*t-x*z)*x)*x
    eq=(2*y*t-2)*z+(t^2-1)*x
    eq=2+(4*x+(4-x*z)*z)*z+((-10+4*z^2)*y+(-10+4*x*z+2*y*t)*t)*t
    
    is a valid formula file in parser format. There is however a limitation on the number of unknowns which cannot exceed 200. Note that the variable names in a formula file may be any name composed with lower and upper cases, integer numbers and underscore, with the constraint that the first character should be a letter. Note also that a MAPLE library enables to produce a formula file directly from MAPLE equations (see section 12.3).

    The parser may handle almost any complex analytical equation based on the most classical mathematical functions, using MAPLE notation. Currently you may use the following operators:

    Beside these functions we have added a few more operators:

    The parser may also handle intervals. For example you may evaluate an equation in which some coefficients are intervals. In the equation these coefficients should be indicated using the MAPLE notation as in the following example:

     
    INTERVAL(0.1 .. sin(1))
    


    Using the ALIAS parser in a program

    The formula file name will be used as an input in all the procedures described in the following sections. As for the variable you must fill the text variable variable_name_IS defined by

     
    char variable_name_IS[200][200];
    
    with the name of you variable and set the integer variable Unknowns_Number_IS to the number of unknowns in your equations as in
     
    strcpy(variable_name_IS[0],"x");
    strcpy(variable_name_IS[1],"y");
    Unknowns_Number_IS=2;
    
    Note that the variable names may be any name composed with lower and upper cases, integer numbers and underscore, with the constraint that the first character should be a letter.

    In the following procedures we will then use an interval vector to define the ranges for the unknowns. In this vector the ranges are ordered so that this order will correspond to the order in the declaration of the variable name (in the previous example the first range will be the range for x and the second range will be the range for y).

    Evaluating a single formula

    An equation may be evaluated by using the procedure
    Evaluate_Interval_With_Parser with the following syntax:
     
    int Evaluate_Interval_With_Parser(
            char *texte,INTERVAL_VECTOR &P,int Unknowns,INTERVAL &Value)
    
    The parameters are: This procedure returns 1 if the equation has been successfully evaluated, 0 otherwise.

    Evaluating multiple equations

    Using the parser you may evaluate more than one equation described in a single formula file. Each equation in the file should be prefixed by the symbol eq= like in:
     
    eq=-x1^2-x2+x3
    eq=x1^2-x2+x3
    eq=round(x3)
    
    All equations in a system of equations may be evaluated by using the procedure
    Evaluate_Interval_With_Parser with the following syntax:
     
    int Evaluate_Interval_With_Parser(
            char *texte,INTERVAL_VECTOR &P,int Unknowns,int NbEq,INTERVAL_VECTOR &Value)
    
    The parameters are: This procedure returns 1 if the equations have been successfully evaluated, 0 or a negative number otherwise.

    Thus for evaluating the formula described by the formula file toto:

     
    eq=-x1^2-x2+x3
    eq=x1^2-x2+x3
    eq=round(x3)
    
    for the ranges x1 in [-1,1], x2 in [0,2], x3 in [1.1,2.3] you may use the following piece of code:
     
    INTERVAL_VECTOR P(3);
    INTERVAL_VECTOR F(3);
    strcpy(variable_name_IS[0],"x1");
    strcpy(variable_name_IS[1],"x2");
    strcpy(variable_name_IS[1],"x3");
    Unknowns_Number_IS=3;
    
    P(1)=INTERVAL(-1,1);//range for x1
    P(2)=INTERVAL(0,2);//range for x2
    P(3)=INTERVAL(1.1,2.3);//range for x3
    
    Evaluate_Interval_With_Parser("toto",P,3,3,F);
    cout<<F<<endl;//interval evaluation of the 3 equations
    
    Instead of evaluating the whole system of equations we may have to evaluate one or more particular equation(s) of the system. The following procedures enable to evaluate efficiently particular equations in a system but before using them we need to do some initialization. This is done by calling once the procedure
    Init_Evaluate_Equations_With_Parser with the syntax:
     
    int Init_Evaluate_Equations_With_Parser(char *texte,int *EqStart)
    
    The parameters are: This procedure returns the number of equations of the system described in the formula file and -1 if the formula file does not exist. It must be used on each formula file with one particular CharEq per file.

    After this initialization the following procedure may be used to evaluate one particular equation in a system:

     
    int Evaluate_Equations_With_Parser(char *texte,INTERVAL_VECTOR &P,int Unknowns,
                    int NbEq,int EqToRead,int *EqStart,INTERVAL &Value)
    
    The parameters are: This procedure will return 1 on a successful completion. It returns 0 if there was a problem in the evaluation and -1 if the numbering of the equations as indicated in EqToRead is not correct. We may also evaluate more than one equation in a system with:
     
    int Evaluate_Equations_With_Parser(char *texte,INTERVAL_VECTOR &P,int Unknowns,
                    int NbEq,int EqToRead1,int EqToRead2,int *EqStart,INTERVAL &Value)
    
    The parameters are: This procedure will return 1 on a successful completion. It returns 0 if there was a problem in the evaluation and -1 if the numbering of the equations as indicated in EqToRead1 or EqToRead2 is not correct. We may also use the gradient of the equations to improve the evaluation. The syntax is:
     
    int Evaluate_Equations_With_Parser_Gradient(int Unknowns,int NbEq,char *texte,
                       char *gradient,INTERVAL_VECTOR &P, INTERVAL_VECTOR &Value,int Exact)
    
    The parameters are:

    Example of use of the parser

    The program Evaluation provided in the ALIAS distribution is a simple example of the use of the evaluation through the parser. In its simplest form it takes as first argument a formula file and as second argument a range file (see section 12.2 for the definition of a range file) and print the interval evaluation of all the equations:

     
    Evaluation [formula file] [range file]
    
    A third integer argument n1 may be the number of the equation we want to evaluate (the number start at 1), while if a fourth integer argument n2 is present the evaluation of the equations from n1 to n2 will be printed.


    The generic Solver

    A generic solver, called Interval_Solver, based on the parser is available in the ALIAS distribution. The basic arguments of this program is a formula file which defines the equations to be solved and a range file which describe the possible ranges for each of the unknowns in the equations. A line of this range file starts by the name of the variable, followed by two numbers which indicate the range for the variable. For example the following lines define a valid range file
     
    psi 0 0.2
    x 1 2.5
    
    If f denotes a formula file and r a range file then you may run:
     
    Interval_Solver -F f -R r
    
    In that case the program will call the procedure Solve_General_Interval12.1 of the ALIAS library.

    Instead of using the Solve_General_Interval procedure of ALIAS you may use the
    Solve_General_Gradient_Interval procedure which requires the gradient of the equations. The gradient equations are defined in a formula file (e.g. g) and you may then run:

     
    Interval_Solver -F f -G g -R r
    
    Note that the equations in the gradient formula file should be ordered with respect to the unknowns using the same ordering than the one used in the range file. Thus for the range file:
     
    x 1 2.5
    y 0 0.2
    
    and the formula file f:
     
    eq=y+3*x
    eq=x^2+x*y
    
    denoted eq1, eq2, the first line of the gradient formula file should be deq1/dx, the second line deq1/dy and so on, which will lead to the following gradient file:
     
    eq=3
    eq=1
    eq=2*x+y
    eq=x
    

    Similarly, instead of using the Solve_General_Gradient_Interval procedure of ALIAS you may use the Solve_General_JH_Interval procedure which requires the gradient and hessian of the equations. The hessian equations are defined in a formula file (e.g. h) and you may then run:

     
    Interval_Solver -F f -G g -H h -R r
    
    Note that the hessian formula file should respect the same ordering than for the gradient formula file. For our previous example the hessian file will be:
     
    eq=0
    eq=0
    eq=0
    eq=0
    eq=2
    eq=1
    eq=1
    eq=0
    
    Note also that the various formula files may be easily obtained by using the MAPLE procedures described in the next section (12.3).

    The result of the computation will be written in a result file. Each line of the result file gives the range for one of the unknowns, using the same ordering than for the range file (in our example the range of x, followed by the range for y). A range is indicated by two reals separated by a blanc character. If instead of range the result file contain the keyword FAILED it means that the solver has been unable to solve the equations. This keyword is followed by an integer which indicate the reason of the failure:

    The default name for the result file is .result_IS.

    Whatever the used solving procedure, some parameters are to be set. The solver will prompt you to give the values of these parameters. If you want to avoid this interactive behavior you may define the parameters in a configuration file and the solver will proceed directly to the solution. A configuration file consists in a list of keywords followed by a value. Most of these keywords refers to parameters in the solving procedure of ALIAS, please refer to the corresponding section for their meaning:


    Dealing with inequalities

    The generic solver may deal also with inequalities. Here we will add an argument to the generic solver whose syntax will be
     
    -I [inequalities file]
    
    inequalities file is a formula file, called the inequalities file that describe equations in the same manner than a formula file. But the solver will output as solutions only the ranges for which all the equations in the inequalities file may be positive or equal to 0 and eliminate the solutions ranges for which at least one equation is strictly negative. Note that the algorithm stops only according to the values of the equations or the diameter of the ranges and not according to the values of the inequalities.


    Dealing with parametric system

    It may also be interesting to investigate the case of parametric systems, i.e. of systems for which some coefficients will be described in analytical form in the formula file, but which are not unknowns. An additional argument for the generic solver will be a file, called the parameter file which will give specific values for the parameter. For example in the equation:
     
    eq1:=x^2-x*cos(y)-x1:
    
    x1 may be considered as a parameter while x, y are the unknowns. Each line of the parameter file indicates a name of a parameter and its value. Thus
     
    x1 1
    
    is a valid parameter file. Then you may use the programs of the MAPLE library (see section 12.3) to generate the parser files for the solver: these programs enable to specify that x1 is not an unknown. The generated files will contain the parameter x1 and if you want to solve a particular occurrence of the parametric system you just have to add an argument to the command line of the generic solver:
     
    -P [parameter file]
    
    and if you want to study another occurrence (for example when the value of x1 is 2) you just have to change the value in the parameter file.

    Some specific parameters with special names may also be used to speed up the computation, see section 12.4.4.2.


    MAPLE library for the Interval Solver

    All these procedures are available in The lib_IS.m library contains various procedures that may be useful for producing files for the parser. The following MAPLE programs are available: An example of the use of this library follows:
     
    readlib(lib_IS):
    eq1:=y**2*z+2*x*y*t-2*x-z:
    eq2:=-x**3*z+4*x*y**2*z+4*x**2*y*t+2*y**3*t+4*x**2-10*y**2+4*x*z-10*y*t+2:
    eq3:=2*y*z*t+x*t**2-x-2*z:
    eq4:=-x*z**3+4*y*z**2*t+4*x*z*t**2+2*y*t**3+4*x*z+4*z**2-10*y*t-10*t**2+2:
    write_equation([eq1,eq2,eq3,eq4],"fcap"):
    write_gradient_equation([eq1,eq2,eq3,eq4],"gcap",[x,y,z,t]):
    write_hessian_equation([eq1,eq2,eq3,eq4],"hcap",[x,y,z,t]):
    
    The formula file for the 4 equations will be written in the file fcap while the jacobian and hessian will be written in the file gcap, hcap. Note that the range file should define the ranges for the unknowns in the order x,y,z,t.


    The generic analyzer

    Principle

    The purpose of the generic analyzer is to try to refine a box and to propose smaller sub-intervals which may contain real roots of the system of equations (which may be algebraic or not). Two types of tools are used for that purpose: More precisely consider the system in two unknowns:

    \begin{eqnarray*}
&&x^2+x\cos(y)+0.5=0\\
&&y^2- y+\sin(x)-0.1=0
\end{eqnarray*}

    In a first step the first equation is considered: it will be considered as a polynomial in $x$ with the interval coefficients $1,
\cos(y), 0.5$. Bounds on the real roots of this polynomial will be computed and the range on $x$ will be updated if necessary. Then the second equation will be considered as a polynomial in $y$ with interval coefficients $1,-1,\sin(x),-0.1$ Bounds on the real roots of this polynomial will be computed and the range on $y$ will be updated if necessary. After these two steps if a range has been improved we will reiterate the process until no further improvement is obtained.

    We will then try to improve the obtained ranges by using Kantorovitch theorem. We consider the middle point of the ranges and test if Kantorovitch is able to determine a ball centered at this point for which Newton method will converge toward the unique solution in the ball. If the answer is positive we will use Newton with as starting point the center of the ball: the result, a point, is stored as one of the result ranges. The intersection of the ball with the initial range will then be computed and if non empty will be stored for further processing.

    We may indeed perform an in-depth analysis. The previous process is applied on the initial range and will lead to a set of ranges (possibly to the same ranges than the initial one); we may then bisect the obtained ranges and reiterate the process on the resulting ranges, discarding those for which the interval evaluation for at least one of the equations does not include 0. We define a depth level for the algorithm as the number of bisection steps that will be used in the process (a depth 0 means that no bisection will be done).

    Practical implementation


    The generic analyzer

    The purpose of the generic analyzer is to consider as input any system defined in a MAPLE file and an initial set of ranges for the unknowns and to produce as output a set of ranges, strictly included in the initial set, that may contain real roots of the system. The output is presented as a file that can be used directly as input for the generic solver.

    A formal-numerical approach has been used to develop this generic analyzer. Basically it takes as input a MAPLE file, called the formula file, which define the analytical form of the equations of the system and a range file in in which are defined both the names of the variables and their initial ranges (a range file may contain more than one set of ranges for the unknowns). The convention in the formula file is to define each equation of the system in the MAPLE file as a sentence prefixed by the key-word eqn where n is the number of the equation starting at 1. For example

     
    eq1:=y**2*z+2*x*y*t-2*x-z:
    eq2:=-x**3*z+4*x*y**2*z+4*x**2*y*t+2*y**3*t+4*x**2-10*y**2+4*x*z-10*y*t+2:
    eq3:=2*y*z*t+x*t**2-x-2*z:
    eq4:=-x*z**3+4*y*z**2*t+4*x*z*t**2+2*y*t**3+4*x*z+4*z**2-10*y*t-10*t**2+2:
    
    is a valid formula file, describing a set of 4 equations. The range file has as many lines as unknowns and each line start by the name of the variable followed by two numbers indicating the range for the variable. For example
     
    x -100 100
    y -100 100
    z -100 100
    t -100 100
    
    is a valid range file for the previous formula file. The analyzer is able to deal with infinity in the ranges: instead of using numbers you may indicate infinity or -infinity. In a first step the analyzer will use MAPLE to produce various intermediary files which are needed for the algorithm to proceed (see section 12.4.4.1). For example it will write in the /tmp/Equation file a description of the system compatible with the syntax used by the parser. Similarly you will find in the /tmp/Gradient_Equation and Hessian_Equation files a description of the gradient and hessian of the system. As soon as all the necessary files have been written, the algorithms described in the previous section will be used.

    The result of the analyzer is a file (by default .result_IA) that describe the possibles ranges which may contain real roots of the system. This file may then be used as input for the solver. The analyzer will also produced the .gradient_IA file that indicate the value of the gradient matrices for each of the out ranges.

    The analyzer is run by using the syntax:

     
    Interval_Analyzer -F [formula file] [-G] [-H] -R [range file]
    
    In this list of argument only the -F, -R are compulsory. The -G option indicates that you will use the monotonicity of the equations (evaluated through an interval evaluation of the gradient) to improve the interval evaluation of the equations. The -H indicates that you will also use Kantorovitch theorem to isolate the real roots of the equations. In that case if you have $m$ equations and $n$ unknowns with $m>n$, then Kantorovitch will be applied on the $n$ first equations.

    This program will then ask you the maximum number of ranges that may be created by the algorithm, an accuracy $\epsilon_f$ on the value of the equations that will be used to stop the computation of the Newton scheme, a minimal value for the maximal diameter for the output ranges (which is not used right now), a depth level, a maximal diameter for the ranges over which Kantorovitch is not used and the value of the debug level (0 if the program is to be run quietly, 1 to see how many boxes are dealt with and 2 for a full debug). Note that if you are using the -H option and have $m$ equations and $n$ unknowns, with $m>n$ and if the algorithm returns roots of the system (i.e. the output ranges are reduced to a point) it will mean that these points are guaranteed roots of the $n$ first equations (you may use the Newton scheme with a lower $\epsilon_f$ on these roots and you will still get a root), while the absolute values of the $m-n$ remaining equations at these points will be lower than $\epsilon_f$ but there is no guarantee that these points are effectively roots of these equations.

    Alternatively you may use a configuration file to give values for these parameters.

    A configuration file consists in a list of keywords followed by a value.

    For example
     
    Iteration 1000
    AccuracyF 0.00001
    Debug 0
    Kanto 0.5
    Level 2
    Location_IS /u/ALIAS/Maple
    
    is a valid configuration file. It indicates that at most 1000 ranges may be created (this is not the maximal number of ranges at the end of the algorithm but the maximal number of ranges that may be created at any time in the algorithm), that the accuracy for the Newton scheme is 0.00001, that the algorithm will run quietly, that Kantorovitch will be used as soon as the maximal diameter of the considered range is lower than 0.5 and that the depth level will be 2. We indicate also in which directory is located the library lib_IS. files are located.

    You use the configuration file with the syntax:

     
    Interval_Analyzer -F [formula file] -G -H -R [range file] -C
    [configuration file]
    
    So a typical analysis and solving process will be done by using the two following command lines (which are basically identical to what is used in the script script_solver provided in the standard distribution of ALIAS):
     
    Interval_Analyzer -F equation.maple -G -H -R range -C conf_analyzer
    Interval_Solver -F /tmp/Equation -G /tmp/Gradient_Equation -H
    /tmp/Hessian_Equation -R .result_IA -GI .gradient_IA -C conf_solver
    
    You will then have the result of the solution of your system in the file .result_IS.


    Dealing with inequalities

    The generic analyzer may deal also with inequalities. Here we will add an argument to the generic analyzer whose syntax will be
     
    Interval_Analyzer -F [formula] [-G -H] -R [range] -I [inequalities]
    
    inequalities is a MAPLE file, called the inequalities file that describe equations in the same manner than a formula file. But the analyzer will output as possible ranges only the ranges for which all the equations in the inequalities file may be positive or equal to 0 and eliminate the ranges for which at least one equation is strictly negative.

    Pre-processing and dealing with parametric equations


    Pre-processing

    In some cases it may be interesting to analyze a given system of equations with various initial input ranges. In the current state the system will be processed again and again for each input ranges. If this system is large this result in unnecessary computation time. When processing for the first time a system the generic analyzer will produce intermediary files in parser format in the /tmp directory. If you use the -G and -H option of the analyzer the intermediary files will be: Note also that you may have to be careful when stopping the analyzer when it is generating these files. Indeed on some systems these files may be read-write protected even for the owner. If you run again the analyzer MAPLE will not be able to write the same files and will produce an error message: you will then need to remove by hand each of the created files and start again.

    As soon as these files have been generated once it is not necessary to re-compute them. To indicate that these quantities have been already processed it is is sufficient to include the following sentence in the configuration file:

     
    Directory name
    
    Instead of computing these files the analyzer will look for them in the directory name. Thus for example after running the analyzer for the first time without this sentence in the configuration file you may analyze the same system without processing the file by indicating in your configuration file:
     
    Directory /tmp
    


    Parametric equations

    It may also be interesting to use the pre-processing for parametric systems, i.e. for systems for which some coefficients will be described in analytical form in the MAPLE formula file, but which are not unknowns. An additional argument for the generic analyzer will be a file, called the parameter file which will give specific values for the parameter. For example in the equation:
     
    eq1:=x^2-x*cos(y)-x1:
    
    x1 may be considered as a parameter. On the first run of the analyzer the intermediary files described in the previous section will be generated and at run time the value of x1 will be substituted by the value indicated in the parameter file. After this first run and if you want to analyze the system with another value for x1 you may use the pre-processing mechanism described in the previous section and just change the value of x1 in the parameter file. See section 12.4.6.1 for an example of the analysis of parametric system.

    Each line of the parameter file indicates a name of a parameter and its value. Thus

     
    x1 1
    
    is a valid parameter file. To indicate a parameter file to the analyzer use the -P argument followed by the name of the parameter file.

    A special case of parameter may be used to speed up the computation. Assume that you have a system with large numerical constants (by "large" we mean that the string representing the numerical values has a large number of characters). Each evaluation of your system will require first to read the strings representing the numerical constants and then to convert it in a float number. It may therefore be interesting to store once the constants values and to substitute them in the analytical form of the equations by symbols which may be attached to these values. This may be done by substituting the numerical constants by symbols of the form _IA$n$ where $n$ is an integer starting from 0. These parameters have then to be stored in a parameter file. Thus, for example, consider the equations:

     
    eq1:=1.12345678901*x1+4.563213456789222:
    
    Using MAPLE you may easily change this equation to:
     
    eq1:=_IA0*x1+_IA1:
    
    and store the values in a parameter file:
     
    _IA0 1.12345678901
    _IA1 4.563213456789222
    
    When reading the parameter file the program will store in a special array the value of the parameters whose name start by the symbol _IA. Then, when the parser find a symbol starting with this symbol it will determine the number following this keyword (which is the value of the index in the parameter table) and will just substitute the corresponding value found in the parameter table. Hence when evaluating an expression the parser will have to read less character and avoid unnecessary conversion from a string to a double. Note that these parameters must be numbered in sequence, starting from 0.


    Errors and Debug

    The analyzer may generate the following error code: You may get some debug information by setting the variable
    Debug_Level_Solve_General_Interval to 1 (minimal level of debug information) or 2 (full debug).

    Examples


    Non algebraic equations

    Let consider the following system
     
    eq1:=x^2-x*cos(y)-1:
    eq2:=y^2-cos(x)-1:
    
    for which we want to determine if real roots exist in the range [-5,5], [-5,5]. With a depth level 0 (no bisection is done) the analyzer proposes the following ranges as possibly containing a real root:
     
    Range 1( x y)
    [-0.86812856880248989722,-0.86812856880248989722]
    [-1.28306500467802298,-1.28306500467802298]
    Range 2( x y)
    [1.219833908062562422,1.219833908062562422]
    [-1.1592247392497665448,-1.1592247392497665448]
    Range 3( x y)
    [1.2198350997243703198,1.2198367316341245381]
    [-1.159223547587958647,-1.1592195879408853099]
    Range 4( x y)
    [-0.86812856880248978619,-0.86812856880248978619]
    [1.28306500467802298,1.28306500467802298]
    Range 5( x y)
    [1.219833908062562422,1.219833908062562422]
    [1.1592247392497667668,1.1592247392497667668]
    Range 6( x y)
    [1.2198352388536839452,1.2198367316341249822]
    [1.1592195879408850878,1.1592236867169092296]
    
    this 6 ranges, 4 are reduced to point and are therefore a result of the application of the Newton scheme. The other 4 ranges are very close to one of the solution, but the algorithm has not been able to eliminate them. With a depth level of 1 the algorithm proposes directly the four solutions of this system:
     
    Range 1( x y)
    [-0.86812741994331155126,-0.86812741994331155126]
    [-1.2830653469203250339,-1.2830653469203250339]
    Range 2( x y)
    [1.2198339926936523359,1.2198339926936523359]
    [-1.1592245852349318813,-1.1592245852349318813]
    Range 3( x y)
    [-0.86812741994331166229,-0.86812741994331166229]
    [1.2830653469203250339,1.2830653469203250339]
    Range 4( x y)
    [1.219833901899016082,1.219833901899016082]
    [1.159224777165462017,1.159224777165462017]
    
    Note that the initial range [-5,5] may be largely expanded without modifying the result and with only a low amount of additional computation time. For example for the range [-1000,1000] for both variables the computation time remains the same.

    The previous system may be considered as a special occurrence of the system:

     
    eq1:=x^2-x*cos(y)-x1:
    eq2:=y^2-cos(x)-1:
    
    where the parameter x1 has value 1. This special case of the generic system may be analyzed by indicating in a parameter file:
     
    x1 1
    
    Now just by changing the value of x1 in this file to
     
    x1 2
    
    and modifying the configuration file to include the sentence:
     
    Directory /tmp
    
    we will get the solutions:
     
    Range 1( x y)
    [-1.2271026453420417202,-1.2271026453420417202]
    [-1.1562745250557344701,-1.1562745250557344701]
    Range 2( x y)
    [1.757647484313144215,1.757647484313144215]
    [-0.90234927430355182931,-0.90234927430355182931]
    Range 3( x y)
    [-1.2271026453420417202,-1.2271026453420417202]
    [1.1562722309470763182,1.1562722309470763182]
    Range 4( x y)
    [1.757647484313144215,1.757647484313144215]
    [0.90234927430355205136,0.90234927430355205136]
    

    Using the generic analyzer in a program

    You may use directly the analyzer in a program using the following syntax:
    int Equation_Analyzer(int Dimension,int Dimension_Eq,int MaxBox,
             char *formula_file,char *gradient_file,char *hessian_file,
             char *inequalities_file,char *dimension_file,char *coeff_file,
             char *gradient_coeff_file,
                          int method,int nb_inequalities,int equation_processed,
                          INTERVAL_VECTOR &Input,
                          double Acc_Var,double Acc_Eq,double Acc_Kanto,
                          int Depth_Level,
                          INTERVAL_MATRIX &Range,
                          int *Nb_Range);
    
    with:

    Beside these arguments you must fill the string array variable_name_IS with the name of the unknowns. If you have a parametric system you must indicate the name of the parameters in the string array parameter_name_IS, their values in the array of doubles parameter_value_IS and set the integer variable Nb_Parameter_IA to the number of parameters.

    Using the parser programs

    The parser programs are available in the library lib_Parser.a. You will have to include the following header files:
     
    header_parser.h
    header_Solve_General_Interval.h
    header_Utilities_Interval.h
    
    If you are planing to use the analyzer you must include the library lib_UP.a. In your program you must avoid to use variables whose name include the symbols _IA and _IS.

    The following programs are equivalent to the standard ALIAS programs except that they use the parser.

     
    int Kantorovitch_Analyzer(int Dimension,  
                     char *Function_File,char *Gradient_File,
                     char *Hessian_File,
                     VECTOR &Input,double *eps);
    
    int Newton(int Dimension,
              char * TheIntervalFunction_File,
              char * Gradient_File,
              VECTOR &Input,double Accuracy,int Max_Iter,VECTOR &Residu);
    
    int Solve_General_Interval(int Dimension_Var,int Dimension_Eq,
            char * TheIntervalFunction_File,
                    INTERVAL_VECTOR & TheDomain, 
                    int Order,
                    int Iteration,
                    int Stop_First_Sol,
                    double Accuracy_Variable,
                    double Accuracy,
                    double Dist_Sol_Diff,
                    INTERVAL_MATRIX & Solution,int Nb_Max_Solution,
                    int nb_inequalities,char *Ineq_File);
    int Solve_General_Gradient_Interval(int Dimension,int Dimension_Eq,
            char * TheIntervalFunction_File,
                    char * Gradient_File,
                    INTERVAL_VECTOR & TheDomain, 
                    int Order,
                    int Iteration,
                    int Stop_First_Sol,
                    double Accuracy_Variable,
                    double Accuracy,
                    double Dist_Sol_Diff,
                    INTERVAL_MATRIX & Solution,int Nb_Max_Solution,
                    int nb_inequalities,char *Ineq_File);
    int Solve_General_Gradient_Interval(int Dimension,int Dimension_Eq,
            char * TheIntervalFunction_File,
                    char * Gradient_File,
                    INTERVAL_VECTOR & TheDomain, 
                    int Order,
                    int Iteration,
                    int Stop_First_Sol,
                    double Accuracy_Variable,
                    double Accuracy,
                    double Dist_Sol_Diff,
                    INTERVAL_MATRIX & Solution,int Nb_Max_Solution,
                    INTEGER_VECTOR &Init_Grad,
                    int nb_inequalities,
                    char *Ineq_File);
    int Solve_General_JH_Interval(int Dimension,int Dimension_Eq,
            char * TheIntervalFunction_File,
                    char * Gradient_File,
                    char * Hessian_File,
                    INTERVAL_VECTOR & TheDomain, 
                    int Order,
                    int Iteration,
                    int Stop_First_Sol,
                    double Accuracy_Variable,
                    double Accuracy,
                    INTERVAL_MATRIX & Solution,
                    INTEGER_VECTOR & Is_Kanto,
                    int Apply_Kanto,
                    int Nb_Max_Solution,
                    int nb,char *file);
    


    next up previous contents Next: Parallel processing Up: ALIAS-C++ Previous: Miscellaneous procedures
  • J-P. Merlet home page
  • La page Présentation de HEPHAISTOS
  • HEPHAISTOS home page
  • La page "Présentation" de l'INRIA
  • INRIA home page

    jean-pierre merlet
    2018-07-25