[LON-CAPA-users] features of maxima/loncapa

Gerd Kortemeyer lon-capa-users@mail.lon-capa.org
Tue, 18 Nov 2008 20:02:20 -0500


Hi,

On Nov 18, 2008, at 7:48 PM, Jay Sullivan wrote:

> That's what I thought, but I just can't see to get the syntax right.  
> I've written a bunch of problems using the matrix features of maxima  
> that all work fine. I've also used maxima's "subst" feature quite a  
> bit with success, but for the life of me I can't get similar  
> commands to work when using find_root.
>
> I'm guessing it's something with the string quoting that I'm just  
> not getting right.....

Yes, sorry, and I made the same mistake in my example:

>
>  $root=&cas('maxima',"find_root('x^2+3*x+5','x',17,42)");

There simply aren't any quotation marks:

(%i4) find_root(x^2+3*x-100,x,-10,10);
(%o4) 			       8.611874208078342

So

$zero=&cas('maxima',"find_root(x^2+3*x-100,x,-10,10)");

would be the correct syntax ... arghh, it's hard to switch back and  
forth between Perl and MAXIMA syntax ...

Another way would be to randomize the answer first and then construct  
the problem.

- Gerd.