# Changeset 1342

Ignore:
Timestamp:
May 12, 2014 1:19:21 PM (9 years ago)
Message:

suggested help changes

Location:
trunk/help
Files:
2 edited

Unmodified
Removed
• ## trunk/help/ParametricFitting.htm

 r1340

Step 2. Create a Pseudo Var

Pseudo Vars allow computation of an arbitrarily defined function of combinations of the variables that are

Step 3: Fitting a simple parametric equation to the unit cell volume

In the next few steps we will fit increasingly sophisticated equations of state to different parameters. As a simple example, we can  If a linear relationship had been defined as a constraint (as can be done with other software packages) the unit cell as a constraint (as can be done with other software packages) the unit cell parameters would have been forced onto this line with no obvious indication that this was not a correct result.

that this was not a correct result.

Step 4: Examples of more complex fitting equations

Here we will look at how more sophisticated Python capabilities

Step 5: Fitting to a Pseudo Var

One can fit a function to a pseudo var, just as to a direct variable. If we look at the plot shown in Step 2, it

Use of externally defined routines

The parametric refinement section of GSAS-II is intended to be quite flexible, but for very complex fitting, a user may wish to define a custom Python function. This can be done in a separate module that defines a Python function that can be called here. As an example of that, if we create a file called fittest.py that is in any directory in the Python path (for example in the GSAS-II source directory) and place a routine

As an example of that, if we create a file called fittest.py and locate that file in any directory in the Python path (most simply, in the directory where the project file, SeqTut.gpx, is located) and place a routine fitfxn in that module:

# file fittest.py
def fitfxn(T,o1,o2,a1,a2,k):
if T < 120:
return o1 + (a1*T)**k
else:
return o2 + a2*T

The function fittest is automatically located and loaded, provided it is found in the path. No changes to the standard distributed GSAS-II code is needed. Care to avoid use of a module name already found in GSAS-II or Python is wise.

• ## trunk/help/SequentialTutorial.htm

 r1340 Calculate/Sequential refine menu item. The fits are significantly improved at higher temperatures, with Rwp values between 13.8 and 16.4.

between 13.8 and 16.4. Be sure to save the project file by clicking on the File/Save project menu item, since this will be of use for a later tutorial.

This completes the sequential refinement tutorial, although many more things could be attempted to further improve the refinement quality. Note that the results of this refinement are used for additional analysis in the Parametric Fitting and Pseudo Variables for Sequential Fits tutorial. quality. In the Parametric Fitting and Pseudo Variables for Sequential Fits tutorial, functions of fitted parameters are computed and plotted and results are fitted to equations of state.

Note: See TracChangeset for help on using the changeset viewer.