Changes

Jump to navigation Jump to search

Tutorial for adding relaxation dispersion models to relax

20 bytes removed, 07:47, 11 October 2013
Small edits of the "The relax library" section.
== The relax library ==
Now the dispersion function needs to be added to the relax library (in the lib.relax_disp package). This should be designed as a simple Python function which takes the dispersion parameters and experimental variables, and calculates the R2eff/R1rho values. The module can contain auxiliary functions for the calculation. Some auxiliary functions, if not specific to relaxation dispersion, may be better placed in other locations within the relax library. Remember to add all new modules to the lib.relax_disp.__init__ package __all__ list.
The relaxation dispersion functions in the library currently take as an argument a data structure for the back-calculated R2eff/R1rho values and populate this structure. This design is not essential if the target function, described in the next point, handles the library function appropriately. Just look at the files in lib/dispersion to get an idea of the design used.
Divisions - always catch zeros in the denominator with if statements, even if you believe that this will never be encountered. Square roots - make sure that the value inside is always > 0. Trigonometric functions - these should be tested for where they are not defined or where the software implementation can no longer handle certain values. For example try cosh(1000) in Python.
 
In the reference example, the M61 model code was copied from the LM63 module and modified appropriately.
=== Reference commits ===
Trusted, Bureaucrats
4,223

edits

Navigation menu