Grace Usage Instructions

Fitting breakthrough curves with GRACE

This tutorial describes how to fit experimental data with the CTRW library and GRACE. The commands are valid for the the Linux-version of GRACE, but should work on other Unix-versions and under Windows too.

Before you start GRACE

  1. Copy library into "~/CTRW_FOR_GRACE" or wherever your Grace directory is located:
    cp ctrw.so ~/CTRW_FOR_GRACE
     
  2. Copy the hist.com file into your working directory. This file contains commands to load functions from the CTRW library into GRACE.
     
  3. Please check if the path of the CTRW library is correct. If not, you have to adjust the path of the CTRW library for each command,
    i.e., in "hist.com":

    USE "FPTD" TYPE f_of_pppd FROM "/users2/gennady/CTRW_FOR_GRACE/ctrw.so"
    USE "CFPTD" TYPE f_of_pppd FROM "/users2/gennady/CTRW_FOR_GRACE/ctrw.so"
    USE "SCD" TYPE f_of_pppd FROM "/users2/gennady/CTRW_FOR_GRACE/ctrw.so"
    USE "CSCD" TYPE f_of_pppd FROM "/users2/gennady/CTRW_FOR_GRACE/ctrw.so"
    USE "MEAN" TYPE f_of_pppd FROM "/users2/gennady/CTRW_FOR_GRACE/ctrw.so"
    USE "ST_D" TYPE f_of_pppd FROM "/users2/gennady/CTRW_FOR_GRACE/ctrw.so"

     

  4. Start xmgrace: "xmgrace -batch /users2/gennady/CTRW_FOR_GRACE/hist.com". You can also define alias to xmgrace: in .login or .aliases file, write a line:
    alias xmgrace ' xmgrace -batch /users2/gennady/CTRW_FOR_GRACE/hist.com'
    and then it will be sufficient to start GRACE by typing "xmgrace".

Starting GRACE and loading data

You start GRACE in your shell.
GRACE will start and you see this:

Grace: main window

  • First you load the experimental data into GRACE.
  • Choose data - > Import
  • Choose ASCII or BINARY format

Grace: file box

After selecting the filename and pressing "OK" the file will be loaded. This box will not close automatically after you loaded a file. You can simply choose another filename and load this file too or press "Cancel" to close this box.
After loading data of a cumulative breakthrough curve your screen should look like this:

Grace: main window with data

Fitting the data

Now you choose Data  Transformations  Nonlinear Curve Fitting.
Grace: nonlinear curve fitting

  • In the field formula you type:
    y=CFPTD(A0,A1,A2,x)
    (because in our example we work with cumulative data)
    "A0", "A1" and "A2" are fitting parameters.
     
  • You choose "3" Parameters and provide initial guesses for A0, A1 and A2. You can also give boundaries for the parameters.
     
  • You have to choose the data set you would like to fit and you can choose a destination data set for the fitted values. If you choose no destination set, a new set will be created.
     
  • The number of iterations for the fitting routine is set by default to 5 iterations, if necessary you have to increase this number.
     
  • If you press "Apply" the values will be fitted and after some time (depending on the number of measurement points and the number of iterations) the fit will be shown and a message window with the fitting parameters will open. Note that sometimes GRACE may crash (not because of our software).
     

Grace: fitted data