Next: The generic analyzer
Up: Parser, Generic Solver and
Previous: Dealing with parametric system
Contents
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:
- cout(eq): estimates the cost of the computation of eq in terms of number of arithmetic operations. This a rather rough
approximation: it just compute the total number of addition,
multiplication and function calls without any weight between these operators.
- minimal_cout(eq): returns an expression equivalent to
eq but with a minimal cost of computation. Basically it consider
the expanded form of the equation and compute its computational cost
using the cout procedure. Then it consider the Horner forms of
the equation using all possible ordering of the unknowns (if you have
up to 6 unknowns). The cost of
these forms are computed and as soon as a form as a lower cost then it
is stored as the potential return for the function. If two forms have
equal cost, then the form with the lower number of operations
(obtained through the nops procedure) is retained.
- write_equation: this procedure takes as argument an
equation or a list of equations and a name. The equation will be
written in a minimal form in the formula file defined by the name
- write_gradient_equation: this procedures takes as
as argument an
equation or a list of equations and a name. The gradient of the
equations in minimal form will be
written in the formula gradient file defined by the name. If no third
argument is provided the ordering of the gradient matrix with respect
to the unknowns will be the
one provided by the MAPLE procedure indets. A third argument may
be provided and should be a list of unknown names which will be used
for the ordering of the gradient matrix (i.e. if the list is [x1,x2,x3] for the equation eq
the first equation will be deq/dx1, the second deq/dx2..). A fourth argument may be the list of unknowns and is
used for parametric system for which the number of undefined variables
may be larger than the number of unknowns (otherwise the procedure
will return an error message indicating that the equation has more
indeterminate than the number of unknowns given in the third
argument).
- write_hessian_equation: a similar procedure than for the
gradient except it computes the hessian matrix of the equations
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.
Next: The generic analyzer
Up: Parser, Generic Solver and
Previous: Dealing with parametric system
Contents
Jean-Pierre Merlet
2012-12-20