Re: [LON-CAPA-users] Code to accept multiple answers

2015-06-18 Thread Peter Dencker
But it is not completely equivalent to use $result = 4*ln(1/2); or $result = "4*ln(1/2)"; To compare in the latter case mathematical expressions the use of '(rat(radcan(...))' seems to be more appropriate here. our $result = "4*ln(1/2)"; ln(x):= log(x);

Re: [LON-CAPA-users] Code to accept multiple answers

2015-06-17 Thread Justin Gray
One could also do this using mathresponse with the same idea to define ln(x):=log(x) $answer=4*log(1/2); Enter an answer equivalent to $4*\ln(1/2)$. ln(x):= log(x); is ( trigsimp(trigreduce(RESPONSE[1] - LONCAPALIST[1])) < 0.01 ); This accepts 4*ln(1/2), 4*log(1/2), 4*(ln

Re: [LON-CAPA-users] Code to accept multiple answers

2015-06-17 Thread Peter Dencker
Hi David, define 'ln(x):=log(x)'. (See my example below.) The maxima function 'radcan' simplifies expressions in maxima, which can contain logs, exponentials, and radicals, so it may helpful. (It is not needed in your specific example but can help to compare more subtle examples. - Peter