[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 "problem":<br><br><problem><br><script type="loncapa/perl"><br>$zero=&cas('maxima',"find_root(x^2+3*x-100,x,-10,10)");<br>
</script><br>$zero<br/><br></problem><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"><<a href="mailto:korte@lite.msu.edu">korte@lite.msu.edu</a>></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'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.<br>
<br>
I'm guessing it's something with the string quoting that I'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>
$root=&cas('maxima',"find_root('x^2+3*x+5','x',17,42)");<br>
</blockquote>
<br></div>
There simply aren't any quotation marks:<br>
<br>
(%i4) find_root(x^2+3*x-100,x,-10,10);<br>
(%o4) 8.611874208078342<br>
<br>
So<br>
<br>
$zero=&cas('maxima',"find_root(x^2+3*x-100,x,-10,10)");<br>
<br>
would be the correct syntax ... arghh, it'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--