# MAKDAT: help and advice

Consult the reference manual for further details and worked examples.
W.G.Bardsley, University of Manchester, U.K.

General Information

This program generates exact data sets for models defined by equations such as

         u = f(x, p(1), p(2), ..., p(n))
         v = g(x, y, p(1), p(2), ..., p(n))
         w = h(x, y, z, p(1), p(2), ..., p(n))
         dy/dx = F(x, y, p(1), p(2), ..., p(n))

where p(1), p(2), ..., p(n) are parameters.
Then program ADDERR can be used with this exact data to simulate experimental data with error.
Either user-defined models or library models can be used to generate exact data sets for plotting or adding error. Typical steps would be as follows.

1. Choose the type of model or family of models required
2. Select the particular model equation for simulation
3. Fix the values for parameters p(1), p(2), ..., p(n)
4. Input the range of independent variables (or else input y values and calculate x values if y = f(x))
5. Examine tables and graphs for the data simulated
6. Save ASCII text coordinate files for program SIMPLOT
7. Save curve-fit files with exact data for program ADDERR
8. User defined parametric equations such as:

            r = r(theta),
            [x(t), y(t)], or
            [x(t), y(t), z(t)],

   can also be simulated.

X_start and X_stop (lowest and highest x values) when y = f(x)

You can simply input values for X_start and X_stop if you know in advance the range of x required and also the behaviour of y = f(x). However sometimes, as with differential equations, you will only know y at X_start and y at X_stop, and will want to estimate X_start and X_stop. To use this more advanced option you must supply an interval containing the x value required. For example, you might wish to find an x where the equation y = 1.0 + 2.5x equals 1.5. If you choose A = 0.0 B = 2.0, and say y = 1.5, then the program will refine your guess until the correct value is found for X_start where 1.5 = 1.0 + 2.5(X_start). Similarly, a guess of A = 8.0, B = 12.0 and y = 26.5 leads to a value for X_stop where 26.5 = 1.0 + 2.5(X_stop). Now you can calculate y values for x values linearly or geometrically spaced between X_start and X_stop. The central idea is that you input a y value (say Y_input) together with a guess for two starting values A (below X_required) and B (above X_required), then let the program find a root (say x = X_required) of

         F(x) = Y_input - f(X_required)
              = 0.

The program will succeed if

         A =< X_required =< B,
         F(A)*F(B) < 0,

and f(x) is a monotonic function of x between A and B.

Success with this root finding is clearly dependent on knowledge of the function behaviour in the neighbourhood of the root, as will be clear from the next diagram. Note that, if your initial guess for A and B is not satisfactory, the program will decrease A and increase B to try an alternative starting range. However, the program will not change the sign of A or B; that is up to you.

Diagram to illustrate the function of A and B

    f(x) |                                      *       *
         |                                 *    |               *
         |                             *        |
         |                                      |
         |                         *            |
         |    Y_input                           |
         |----------------------*               |
         |                      |               |
         |                  *   |               |
         |                      |               |
         |               *      |               |
         |*          *          |               |
         |  *    *              |               |
         |       |              |               |
         --------#--------------#---------------#----------------
                 A           X_required         B               x
             (X_below)                      (X_above)
             ------>                   <------