# 6. The GDS window¶

The Big Trick in Artemis

The parameters of the EXAFS equation are not the parameters of the fit.
The parameters of the EXAFS equation are written *in terms of* the
parameters of the fit.

As a consequence, path parameter values (see Fig. 5.5) are *math expressions*. These math expressions
are functions of the actual fitting parameters.

Some of these math expressions are quite simple. For example, in the
gold metal example in the previous chapter,
the math expressions for S^{2}_{0} and E_{0} were
simple functions, each of a single parameter. The math expression for
ΔR, however, was a function of `alpha`

and `reff`

, while
the σ^{2} math expression used the `debye`

function and
two parameters.

All of these parameters **must** be defined in the GDS window. This
window contains a grid with a series of buttons down the right side.
It is displayed and hidden using the GDS button on the left side of
the Main window. Here are the contents of the GDS window from the
gold metal example. The four variable parameters in the fit along
with the fixed sample temperature needed by the `debye`

function are
shown. A new variable parameter is being defined in line 6.

The second, third, and fourth columns in the grid are filled by simple text boxes. The first column contains a drop down menu from which the parameter types can be chosen.

## 6.1. Parameter types¶

Every parameter of any type used in any math expression must be defined on the GDS widow. Any variable parameter defined on the GDS window must be used in a math expression.

There are 9 types of parameters in ARTEMIS. They are color coded in the grid to give you a visual indication of each parameter's type.

- guess
- This is a parameter of the fit. Its value will be adjusted to find the best fit of the model to your data. Its initial value is usually a number, but can be a math expression. In that case, the initial value will be the initial evaluation of the math expression.
- def
- This is a parameter that is defined as a math expression dependent upon other guess, def, or set parameters. Its value is updated throughout the fit. As discussed elsewhere in this manual, sophisticated use of def parameters is key to successful model building and effective use of ARTEMIS.
- set
- A set parameter is one that is evaluated at the beginning of the fit, but not evaluated subsequently. Although a set parameter can take a math expression as its value, it is more typically used to represent a constant (i.e. a number) used elsewhere in the fitting model.
- lguess
- An lguess parameter is a tool used to simplify model
creation for a multiple data set fit. It can be used in math
expressions for two or more data sets. When the fit is started,
an actual guess parameter will be created for each data set in
which the lguess is used. As an example, suppose your
multiple data set fit includes data on a series of binary alloys.
If
`x`

is a mixing parameter between the two alloys and is different for each sample, you might then use math expressions containing`x`

and`(1-x)`

for S^{2}_{0}parameters of paths representing the two metallic species in each fit. With`x`

an lguess parameter, independent mixing parameters will be floated for each data set. The point, then, of an lguess is to facilitate the chore of editing path parameter math expressions using ARTEMIS' tools for pushing path parameter values across paths. This is discussed in more detail in the discussion of the characteristic value. - skip
- A skip parameter is one that is not used in any capacity in the fit, but which you do not want to discard from your fitting project. Changing a parameter to skip is rather like “commenting it out”.
- restrain
- A restraint is a math expression that is evaluated and
added in quadrature to χ
^{2}to evaluate the fit. That is, the fit is optimized in the presence of the restraint. The point of this is to add prior knowledge to a fit. Restraints will be discussed in more detail later in this document. - after
- An after parameter is very similar to a def parameter in that it takes a math expression that depends on other parameters. It is not, however, used in any way in the fit. Instead, it is evaluated at the end of the fit and reported to the log file. This is used to make interesting calculations based on other parameters as part of the record of the fit. An after parameter should never be used in the math expression for a path parameter. Here's an example.
- penalty
- This takes a math expression representing a user defined
penalty to the happiness calculation.
*This feature has not yet been implemented in*ARTEMIS. - merge
- A merge parameter is a parameter which has been
multiply defined under the same name as part of combining fitting
projects or importing structural units. A fit cannot proceed with
any parameters in this state.
*This feature has not yet been implemented in*ARTEMIS.

Todo

Penalty and merge parameters have not been implemented.

## 6.2. User interaction¶

Todo

Explain drag and drop

### 6.2.1. Button bar¶

The stack of buttons on the right side of the GDS window contains many of the main functions of the GDS window.

`Use best fit`- This button makes the most recent best fit value into the initial guess for every guess parameter in the grid.
`Reset all`- This button tells IFEFFIT or LARCH to reset all parameters to their initial values.
`Highlight`- This button prompts you for a string. All parameters with names or
math expressions matching the string provided will be highlighted
with a yellow background. This feature is particularly useful in
large fitting models with many parameters. In the image above, you
can see that all parameters matching
`brc1`

have been highlighted. The string to match can actually be any valid Perl regular expression. `Evaluate`- Clicking this button will evaluate all parameters and insert their evaluations into the fourth column of the grid. This is used to “spell-check” your math expressions for def and other parameters. In the image above, this button has been clicked and the evaluations have been inserted into the fourth column.
`Import GDS`,`Export GDS`- The next two buttons are used to import or export a simple text file with the names and definitions of all the parameters.
`Discard all`- This button does just that, after prompting to be sure that is what you want to do.
`Add a site`- This button appends a blank row to the end of the grid.

### 6.2.2. Keyboard shortcuts¶

When one or more rows are selected, you can use the following keyboard shortcuts to change the parameter type of that set of parameters.

`Alt`-`g`: convert to guess`Alt`-`d`: convert to def`Alt`-`s`: convert to set`Alt`-`l`: convert to lguess`Alt`-`k`: convert to skip`Alt`-`r`: convert to restrain`Alt`-`a`: convert to after`Alt`-`p`: convert to penalty

### 6.2.4. Creating parameters from math expressions on the path page¶

Parameters can be created from the path page. When you right click on a word in a math expression for the one of the path parameters, a menu pops up which allows you to set the word you clicked upon as GDS parameter.

If you have not yet defined the word you right click on, then the GDS window will appear on screen, and the parameter will be inserted into the GDS table as the type of parameter selected from the menu.

If the word has already been defined, then its type will be changed to the type you select from the menu.

If the word is something that is not allowed in IFEFFIT as
a parameter name (things like `dr1`

and `cos`

are reserved words
and cannot be used as parameter names) then the menu will not be
posted. Likewise, the menu will not be posted if you
right click on a number.

DEMETER is copyright © 2009-2016 Bruce Ravel – This document is copyright © 2016 Bruce Ravel

This document is licensed under The Creative Commons Attribution-ShareAlike License.

If DEMETER and this document are useful to you, please consider supporting The Creative Commons.