
<!--------------------------------------------------------->
Relaxation Calculation: 
<a href="#calcSpecDens">calcSpecDens</a> | 
<a href="#calcR1">calcR1</a> | 
<a href="#calcR2">calcR2</a> | 
<a href="#calcSSNOE">calcSSNOE</a> | 
<a href="#calcR1_R2_SSNOE">calcR1_R2_SSNOE</a><br>
Parameter Minimization:
<a href="#calcMin_Dyn">calcMin_Dyn</a> | 
<a href="#calcMin_Rot_Dyn">calcMin_Rot_Dyn</a>
<p>
These are the subroutines that perform NMR relaxation calculations.

<!--------------------------------------------------------->
<a name="calcSpecDens">
<hr>
<h4>&calcSpecDens</h4>
<b>Summary:</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Calculates the rigid body spectral densities of the
molecule described by the associative array %YarmModel.
<p>

<b>Usage:</b><br>
&writeSpecDens( \%YarmModel );<br>
or<br>
&writeSpecDens( \%YarmModel, "ascii" );
<p>

<b>Description:</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
If you want to see a humanly readable version of the binary output
file, specify "ascii" as the second input parameter, as shown above.
This will generate a file named "spec_dens_mt.asc" in the yarm_working 
subrdirectory that can be examined with a text editor.  Additionally, a
number of test calculations will be performed that can be examined to
insure the calculations are working correctly.
<p>

<b>Example:</b><br>

<!--------------------------------------------------------->
<a name="calcR1">
<hr>
<h4>&calcR1</h4>
<b>Summary:</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Calculates the R1 relaxation rates of the nuclei contained in the %YarmModel.
<p>

<b>Usage:</b><br>
%R1 = &calcR1( \%YarmModel );<br>
or<br>
%R1 = &calcR1( \%YarmModel, "time" );
<p>

<b>Description:</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
This routine calculates the R1 relaxation rates for all 
nuclei contained in $YarmModel{xyz_nmr} (the NMR active nuclei).
The spectral densities must be contained in a file called 
"yarm_working/spec_dens_mt.bin", created previously 
using the calcSpecDens subroutine.

<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
If "time" is specified, then the relaxation values are returned as 
times rather than rates.
<p>
<b>Example:</b><br>

<!--------------------------------------------------------->
<a name="calcR2">
<hr>
<h4>&calcR2</h4>
<b>Summary:</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Calculates the R2 relaxation rates
<p>

<b>Usage:</b><br>
%R2 = &calcR2( \%YarmModel );<br>
or<br>
%R2 = &calcR2( \%YarmModel, "time" );
<p>

<b>Description:</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
This routine calculates the R2 relaxation rates for all 
nmr active nuclei contained in $YarmModel{xyz_nmr}.  
The spectral densities must have been created previously 
using the calcSpecDens subroutine.
<p>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
If "time" is specified, then the relaxation values are returned as 
times rather than rates.
<p>
<b>Example:</b><br>

<!--------------------------------------------------------->
<a name="calcSSNOE">
<hr>
<h4>&calcSSNOE</h4>
<b>Summary:</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Calculates the steady state NOE enhancement
<p>

<b>Usage:</b><br>
%ssNOE = &calcSSNOE( \%YarmMode );<br>
or<br>
%ssNOE = &calcSSNOE( \%YarmModel, "time" );
<p>

<b>Description:</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
This routine calculates the ssNOE relaxation rates for all 
nmr active nuclei contained in $YarmModel{xyz_nmr}.  
The spectral densities must have been created previously 
using the calcSpecDens subroutine.
<p>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
If "time" is specified, then the relaxation values are returned as 
times rather than rates.
<p>
<b>Example:</b><br>


<!--------------------------------------------------------->
<a name="calcR1_R2_SSNOE">
<hr>
<h4>&calcR1_R2_SSNOE</h4>
<b>Summary:</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Calculates all three relaxation rates, R1, R2, ssNOE simultaneously

<b>Usage:</b><br>
($refR1, $refR2, $refNOE ) = &calcR1_R2_SSNOE( \%YarmMode );<br>
or<br>
($refR1, $refR2, $refNOE ) = &calcR1_R2_SSNOE( \%YarmModel, "time" );
<p>

<b>Description:</b><br>
<p>

If "time" is specified, then the relaxation values are returned as 
times rather than rates.
<p>
<b>Example:</b><br>


<!--------------------------------------------------------->
<a name="calcMin_Dyn">
<hr>
<h4>&calcMin_Dyn</h4>
<b>Summary:</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Calculates the intramolecular dynamics variables
<p>

<b>Usage:</b><br>
( $ref_Sf2, $ref_ti, $ref_X2 ) = <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&calcMin_Dyn( \%YarmModel, \%R1exp, \%R2exp, \%ssNOEexp, $exp_type, $nruns );<p>
%Sf2 = %$ref_Sf2;<br>
%ti  = %$ref_ti;<br>
%X2  = %$ref_X2;<br>
<p>

<b>Description:</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
This routine calculates the best intramolecular dynamics for the molecule 
specified by %YarmModel by using comparing simulated and experimentally
measured R1, R2 and ssNOE rates.  Returned are the Sf2, ti and X2 values for 
each nucleus, and their associate error.  
<p>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$nruns determines how many Monte Carlo simulations to perform in the error
analysis.  If set to 1, no Monte Carlo is performed, and the error is returned
as "-1".
<p>
<b>Example:</b><br>

<!--------------------------------------------------------->
<a name="calcMin_Rot_Dyn">
<hr>
<h4>&calcMin_Rot_Dyn</h4>
<b>Summary:</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p>

<b>Usage:</b><br>
( $txx, $tyy, $tzz, $x2, $txx_err, $tyy_err, $tzz_err, $x2_err ) = <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&calcMin_Rot_Dyn( \%YarmModel, \%R1exp, \%R2exp, $nfit, $nruns );
<p>

<b>Description:</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
This routine calculates the best correlation time for the molecule 
specified by %YarmModel by using comparing the simulated R2/R1 relaxation 
times to those measured experimentally.
%R1exp and %R2exp are 1D hashes containing the experimetnal R1 and R2 rates, 
and their associated errors.  $nruns is the number of Monte Carlo runs to
perform to generate the error values.  If $nruns is set to 1, 
the Monte Carlo is not performed, and the error is returned as "-1".
<p>
<b>Example:</b><br>

