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

Jay Sullivan lon-capa-users@mail.lon-capa.org
Tue, 18 Nov 2008 20:14:32 -0500


------=_Part_84531_23833766.1227057272131
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Does that example work on your server?

This is my "problem":

<problem>
<script type="loncapa/perl">
$zero=&cas('maxima',"find_root(x^2+3*x-100,x,-10,10)");
</script>
$zero<br/>
</problem>

When I run this on the screen I get:

find_root(x^2+3*x-100,x,-10,10)


Perplexed in NC,
Jay

PS: This is on the VCU server.

>


On Tue, Nov 18, 2008 at 8:02 PM, Gerd Kortemeyer <korte@lite.msu.edu> wrote:

> 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.
>
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
>

------=_Part_84531_23833766.1227057272131
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Does that example work on your server?<br><br>This is my &quot;problem&quot;:<br><br>&lt;problem&gt;<br>&lt;script type=&quot;loncapa/perl&quot;&gt;<br>$zero=&amp;cas(&#39;maxima&#39;,&quot;find_root(x^2+3*x-100,x,-10,10)&quot;);<br>
&lt;/script&gt;<br>$zero&lt;br/&gt;<br>&lt;/problem&gt;<br><br>When I run this on the screen I get:<br><br>find_root(x^2+3*x-100,x,-10,10)<br><div><br><br>Perplexed in NC,<br>Jay<br><br>PS: This is on the VCU server.<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"></blockquote><br></div><br><br><div class="gmail_quote">On Tue, Nov 18, 2008 at 8:02 PM, Gerd Kortemeyer <span dir="ltr">&lt;<a href="mailto:korte@lite.msu.edu">korte@lite.msu.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<div class="Ih2E3d"><br>
<br>
On Nov 18, 2008, at 7:48 PM, Jay Sullivan wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
That&#39;s what I thought, but I just can&#39;t see to get the syntax right. I&#39;ve written a bunch of problems using the matrix features of maxima that all work fine. I&#39;ve also used maxima&#39;s &quot;subst&quot; feature quite a bit with success, but for the life of me I can&#39;t get similar commands to work when using find_root.<br>

<br>
I&#39;m guessing it&#39;s something with the string quoting that I&#39;m just not getting right.....<br>
</blockquote>
<br></div>
Yes, sorry, and I made the same mistake in my example:<div class="Ih2E3d"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
&nbsp;$root=&amp;cas(&#39;maxima&#39;,&quot;find_root(&#39;x^2+3*x+5&#39;,&#39;x&#39;,17,42)&quot;);<br>
</blockquote>
<br></div>
There simply aren&#39;t any quotation marks:<br>
<br>
(%i4) find_root(x^2+3*x-100,x,-10,10);<br>
(%o4) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8.611874208078342<br>
<br>
So<br>
<br>
$zero=&amp;cas(&#39;maxima&#39;,&quot;find_root(x^2+3*x-100,x,-10,10)&quot;);<br>
<br>
would be the correct syntax ... arghh, it&#39;s hard to switch back and forth between Perl and MAXIMA syntax ...<br>
<br>
Another way would be to randomize the answer first and then construct the problem.<div><div></div><div class="Wj3C7c"><br>
<br>
- Gerd.<br>
<br>
_______________________________________________<br>
LON-CAPA-users mailing list<br>
<a href="mailto:LON-CAPA-users@mail.lon-capa.org" target="_blank">LON-CAPA-users@mail.lon-capa.org</a><br>
<a href="http://mail.lon-capa.org/mailman/listinfo/lon-capa-users" target="_blank">http://mail.lon-capa.org/mailman/listinfo/lon-capa-users</a><br>
</div></div></blockquote></div><br>

------=_Part_84531_23833766.1227057272131--