WeBWorK Problems

Answer Evaluators for Complex Numbers

Answer Evaluators for Complex Numbers

by Liz Brauer -
Number of replies: 1
Does anyone have suggestions for answer evaluators for complex numbers? I am writing problems for ac analysis of electric circuits. I am presently using cplx_cmp but the tolerance is very tight and students are having trouble getting correct answers approved by WW.

I am using this from PGcomplexmacros.pl.

ANS(cplx_cmp($Sa, reltol=>20, format=>'%4.4g'));

Thanks!

In reply to Liz Brauer

Re: Answer Evaluators for Complex Numbers

by Gavin LaRose -
Hi Liz,

I haven't done much with complex numbers, so I might not be the best person to try a response to this. I'm also not quite sure where the problem is coming in, so I'm hoping this moves in a helpful direction even if it doesn't answer your question.

The times I've had trouble with tolerance, I've sometimes found that I can get around it by picking relative or absolute tolerance levels depending on the situation. In particular, if sometimes it's worked best to allow a number of decimal places error in the students' solutions rather than a specified relative tolerance (which is the default). There's information on numerical tolerance at this page in the WeBWorK documentation that should be appropriate to complex numbers as well as reals.

(That page considers using MathObjects, as well; if you want to use those you may need to set the Context to "Complex" instead of "Numeric" as is show in the preceding page.)

Post a follow-up if that misses the boat (likely) or isn't helpful.

Gavin