[LON-CAPA-users] Extracting the numerical value from a solve()Maxima command

Gerd Kortemeyer korte at lite.msu.edu
Wed Feb 8 21:41:29 EST 2012


Hi,

On Feb 8, 2012, at 9:29 PM, Seema Ali wrote:

> 
> I can't tell what is causing the error.  It works with other negative solutions.
> 
>  
> ERROR: Computer's answer is incorrect ("-1.24"). It is likely that the tolerance range [-1.24200376392202, -1.24000376392203] needs to be adjusted.
> This error occurred while processing response 1_7 in part 0

The problem indeed is the interplay between your answer format and your tolerance:

<numericalresponse answer="$answer" format="2F">
<responseparam name="tol" type="tolerance" description="Numerical Tolerance" default="0.001" />

* You have "2F" as the answer format, which means two digits right of the decimal, as in -1.24.
* Your tolerance is set to "0.001", which is three digits right of the decimal.

MAXIMA apparently calculated -1.24100376392202 as the answer. Your tolerance of 0.001 gives you  [-1.24200376392202, -1.24000376392203] as the accepted interval. The "2F"-rounded solution is -1.24, which is outside your own tolerance.

I would suggest to either use "3F" for the format or "0.01" for the tolerance, so that the computer's calculated answer is actually graded as correct.

- Gerd.



More information about the LON-CAPA-users mailing list