Re: AMBER: note on the molsurf and "Assertion `sarg1 >= 0.0' failed" error

From: David A. Case <case.scripps.edu>
Date: Wed, 28 May 2008 10:27:31 -0700

On Wed, May 28, 2008, Kateryna Miroshnychenko wrote:

> *** 1052,1059 ****
> sarg1 = (ai->rad + aj->rad + probe_diam) * (ai->rad + aj->rad +
> probe_diam) - d_ij * d_ij;
> sarg2 = d_ij * d_ij - (ai->rad - aj->rad) * (ai->rad - aj->rad);
> ! assert( sarg1 >= 0.0 );
> ! assert( sarg2 >= 0.0 );
> t_rad = 0.5 * sqrt (sarg1) * sqrt (sarg2) / d_ij;
>
> t_fact1 = ((ai->rad + probe_rad) * (ai->rad + probe_rad) -
> --- 1052,1059 ----
> sarg1 = (ai->rad + aj->rad + probe_diam) * (ai->rad + aj->rad +
> probe_diam) - d_ij * d_ij;
> sarg2 = d_ij * d_ij - (ai->rad - aj->rad) * (ai->rad - aj->rad);
> ! assert( sarg1 > 0.0 - eps);
> ! assert( sarg2 > 0.0 - eps);
> t_rad = 0.5 * sqrt (sarg1) * sqrt (sarg2) / d_ij;
>
> t_fact1 = ((ai->rad + probe_rad) * (ai->rad + probe_rad) -
>

Thanks for your detailed analysis, but I really don't understand why this
would work. In your case, you are allowing sarg1 to be (slightly) negative,
and then immediately computing sqrt(sarg1). The square root will fail unless
sarg >=0 (as in the original assert).

It is possible that we should allow for very slightly negative values, but
then the "solution" would have to involve setting these to zero before
proceeding to the sqrt() code (at least as far as I can see).

Can you post the structure that is giving the problem?

...thx...dac

-----------------------------------------------------------------------
The AMBER Mail Reflector
To post, send mail to amber.scripps.edu
To unsubscribe, send "unsubscribe amber" (in the *body* of the email)
      to majordomo.scripps.edu
Received on Sun Jun 01 2008 - 06:07:15 PDT
Custom Search