next up previous contents
Next: Errors and Debug Up: Pre-processing and dealing with Previous: Pre-processing   Contents

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:
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 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:

Using MAPLE you may easily change this equation to:
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.

next up previous contents
Next: Errors and Debug Up: Pre-processing and dealing with Previous: Pre-processing   Contents
Jean-Pierre Merlet 2012-12-20