mailRe: [sr #3154] Implementation of Baldwin (2014) B14 model - 2-site exact solution model for all time scales


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Andrew Baldwin on April 30, 2014 - 12:14:
Hi Edward,

The origin of the code was my fat head.

One thing relevent: the cofactors i've called F0 and F2 turned out the same as used by Carver and Richards. In my hands at least, there is a faster way of computing them using trig functions rather than square-roots-of-square-roots (see my code for details). Also, i'd make triple sure that the definitions you've used for e.g tau_c match mine. There are at least three conventions I know of in the literature. In my code, a CPMG cycle is tau/180/tau/tau/180/tau. That'll be the same as Flemming and Dimitri use. There's a typo in Carver Richard's paper that has propagated nastily throughout the literature. I can send my implementation of CR that I used for direct comparison with my result and the numerical result if that helps keep your headaches down.

You guys are free to use my code (I don't mind the gnu license) or of course implement from scratch as needed.

I'd like to note again though that anyone using this formula to fit data, though exact in the case of 2site exchange/inphase magnetisation, evaluated at double floating point precision should not be doing so! Neglecting scalar coupling/off resonance/spin flips/the details of the specific pulse sequence used will lead to avoidable foobars. I do see value in this, as described in the paper, as being a feeder for initial conditions for a more fancy implemenation. But beyond that, 'tis a bad idea. Ideally this should appear in big red letters in your (very nice!) gui when used.

Best,

Andy.





On 30/04/2014 10:58, Edward d'Auvergne wrote:
Hi Troels and Andy,

It would be great to incorporate this model into relax.  I was
wondering what the origin and history of the code in the Baldwin.py
script was though?

Looking at the code and equations (http://wiki.nmr-relax.com/B14), I'm
wondering if it would be easier for you Troels to simply copy the
lib/dispersion/cr72.py relax file to lib/dispersion/b14.py and then
modify it to implement the new equations.  You could use the
Baldwin.py script as inspiration, but I think it would be harder to
convert the 20 or so lines of interest in this script into the correct
format for relax than to simply convert the CR72 (Carver and Richards)
ones.  If you started with Baldwin.py, the code will anyway change
significantly when you make speed ups anyway - by shifting certain
calculations higher up in the nested looping over the experiment
types, magnetic field strengths, and offsets, by removing all int to
float type conversions that occur in the script (due integer values
being used in a number of places), and by minimising replicated
mathematical operations (g1**2, g2**2, g3**2, g4**2,
(g1**2.0+g2**2.0)**(1/4.0), etc. are all duplicated).  However the
script and the output file it creates would serve as a perfect basis
for a system test - you have numbers to test against.

If this route is taken, then a copyright licensing agreement is not
needed (such as at
http://article.gmane.org/gmane.science.nmr.relax.devel/4279,
http://article.gmane.org/gmane.science.nmr.relax.devel/4276,
http://article.gmane.org/gmane.science.nmr.relax.devel/4271,
http://article.gmane.org/gmane.science.nmr.relax.devel/4138, and
http://article.gmane.org/gmane.science.nmr.relax.devel/4157).  However
if you Andy make such a statement to the relax mailing list, then we
could save the script as is (well with a GPL3+ copyright statement
added with your name) into the relax test suite data directories and
use it to create synthetic data.  This would then be used to test our
implementation.  Troels will also then be able to copy and paste
certain parts of the script for the implementation as well.

Cheers,

Edward


On 30 April 2014 00:51, Troels Emtekær Linnet <tlinnet@xxxxxxxxxxxxx> wrote:
Dear Andrew Baldwin.

Thank you for the submission of your code to me.

For relax to be able to legally incorporate the code, a copyright
licence from all authors is required (as well as which years the code
was developed, for the copyright notice).
relax is an open source software project which relies on the GPLv3+ licence
(the GNU General Public Licence).

You can see an example of the copyright notice at the top of this file:

http://svn.gna.org/viewcvs/*checkout*/relax/branches/relax_disp/lib/dispersion/ns_2site_expanded.py?revision=20464&content-type=text%2Fplain&pathrev=20478

I would like to have your permission to use the code I have submitted
to the tracker.
It requires a statement to one of the relax public mailing
lists, such as this one, similar to:

"I agree to licence my contributions to the code in the file
https://gna.org/support/download.php?file_id=20615 attached to
https://gna.org/support/index.php?3154 under the GNU General Public Licence,
version three or higher.  My copyright covers the years 2013-2014."

For reference, the GPL licence is explained in
detail at http://www.gnu.org/licenses/gpl.html.

The copyright licence allows the code to be used in relax for ever -
the GPL licence to the
code in relax can never be revoked.
But you own the copyright to your code - it is not a copyright transfer.
So you are free license your code as you wish in the future, or to do
as you like with it.
But you cannot re-license the code that is located within relax or revoke the
licence.
This is the standard protection for open source projects.

If you are happy with this, then please respond to this message with
text similar to the above statement (it can be copied and modified).

This will allow the code to remain in relax.
It also allows other relax developers to expand on the code.
I will then add your names with the dates to the copyright notices in
the relevant files in relax.

You are also free to give suggestions as to how you should be
acknowledged in the relax user manual (temporarily at
http://download.gna.org/relax/manual/relax.pdf).

Best
Troels E. Linnet

2014-04-30 0:38 GMT+02:00 Troels E. Linnet <NO-REPLY.INVALID-ADDRESS@xxxxxxx>:
Follow-up Comment #2, sr #3154 (project relax):

Here is the attached code, which forms the basis.

(file #20615)
     _______________________________________________________

Additional Item Attachment:

File name: Baldwin.py                     Size:3 KB


     _______________________________________________________

Reply to this item at:

   <http://gna.org/support/?3154>

_______________________________________________
   Message sent via/by Gna!
   http://gna.org/

_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
relax-devel@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel




Related Messages


Powered by MHonArc, Updated Mon May 19 16:20:14 2014