Hi Ed, Fine, thanks for the tips.
I have a question, though. You say gradients are not used for relaxation exponential curve fitting. However, the code for the function linear_constraints() in present in 'specific_fns/relax_fit.py'... Is that normal ? Can this be used, i.e. are the partial derivatives of the chi-squared equation for relaxation (R1, R2) calculated ? If not used, should we remove the code ? Thanks. Séb :) Edward d'Auvergne wrote: > Hi, > > As an aside, these linear constraints can only be used if the > relaxation dispersion gradients are calculated. These gradients are > not present for the relaxation exponential curve-fitting as it is not > necessary. For model-free analysis, both the gradients and Hessians > have been calculated and are coded into python functions. At the > start, the relaxation dispersion may not need parameter constraints > but the gradient may be very useful for better optimisation. With no > gradients, only the simplex optimisation algorithm can be used. So in > the future if you'd like the gradients, you need to calculate the > first partial derivatives of the chi-squared equation/relaxation > dispersion equation for each parameter and code these as separate > functions. > > Regards, > > Edward > > > On Tue, Jan 13, 2009 at 4:13 AM, <[email protected]> wrote: > >> Author: semor >> Date: Tue Jan 13 04:13:54 2009 >> New Revision: 8428 >> >> URL: http://svn.gna.org/viewcvs/relax?rev=8428&view=rev >> Log: >> Converted the function linear_constraints() for relaxation dispersion needs. >> >> >> Modified: >> branches/relax_disp/specific_fns/relax_disp.py >> >> Modified: branches/relax_disp/specific_fns/relax_disp.py >> URL: >> http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_fns/relax_disp.py?rev=8428&r1=8427&r2=8428&view=diff >> ============================================================================== >> --- branches/relax_disp/specific_fns/relax_disp.py (original) >> +++ branches/relax_disp/specific_fns/relax_disp.py Tue Jan 13 04:13:54 2009 >> @@ -725,27 +725,34 @@ >> Standard notation >> ================= >> >> - The relaxation rate constraints are:: >> - >> - Rx >= 0 >> - >> - The intensity constraints are:: >> - >> - I0 >= 0 >> - Iinf >= 0 >> + The different constraints are:: >> + >> + R2 >= 0 >> + Rex >= 0 >> + kex >= 0 >> + >> + R2A >= 0 >> + kA >= 0 >> + dw >= 0 >> >> >> Matrix notation >> =============== >> >> - In the notation A.x >= b, where A is an matrix of coefficients, x >> is an array of parameter >> + In the notation A.x >= b, where A is a matrix of coefficients, x is >> an array of parameter >> values, and b is a vector of scalars, these inequality constraints >> are:: >> >> - | 1 0 0 | | Rx | | 0 | >> + | 1 0 0 | | R2 | | 0 | >> | | | | | | >> - | 1 0 0 | . | I0 | >= | 0 | >> + | 1 0 0 | . | Rex | | 0 | >> | | | | | | >> - | 1 0 0 | | Iinf | | 0 | >> + | 1 0 0 | | kex | | 0 | >> + | | | | >= | | >> + | 1 0 0 | | R2A | | 0 | >> + | | | | | | >> + | 1 0 0 | | kA | | 0 | >> + | | | | | | >> + | 1 0 0 | | dw | | 0 | >> >> >> @keyword spin: The spin data container. >> @@ -764,17 +771,25 @@ >> >> # Loop over the parameters. >> for k in xrange(len(spin.params)): >> - # Relaxation rate. >> - if spin.params[k] == 'Rx': >> - # Rx >= 0. >> + # Relaxation rates and Rex. >> + if search('^R', spin.params[k]): >> + # R2, Rex, R2A >= 0. >> A.append(zero_array * 0.0) >> A[j][i] = 1.0 >> b.append(0.0) >> j = j + 1 >> >> - # Intensity parameter. >> - elif search('^I', spin.params[k]): >> - # I0, Iinf >= 0. >> + # Exchange rates. >> + elif search('^k', spin.params[k]): >> + # kex, kA >= 0. >> + A.append(zero_array * 0.0) >> + A[j][i] = 1.0 >> + b.append(0.0) >> + j = j + 1 >> + >> + # Chemical exchange difference. >> + elif spin.params[k] == 'dw': >> + # dw >= 0. >> A.append(zero_array * 0.0) >> A[j][i] = 1.0 >> b.append(0.0) >> >> >> _______________________________________________ >> relax (http://nmr-relax.com) >> >> This is the relax-commits mailing list >> [email protected] >> >> 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-commits >> >> > > _______________________________________________ > relax (http://nmr-relax.com) > > This is the relax-devel mailing list > [email protected] > > 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 > > _______________________________________________ relax (http://nmr-relax.com) This is the relax-devel mailing list [email protected] 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

