ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 08 Dec 2012 17:43:56 -0600Comparing Sage and Mathematica for an Introductory Coursehttp://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/I'm working with a committee that's revising the undergraduate math curriculum for UCLA biology majors. We're getting rid of a lot of paper and pencil calculation that's hardly ever used in mathematical biology and introducing a lot of modeling, dynamical systems and computer work. Earlier, we decided to use Mathematica for the course, but I recently learned about Sage and like the idea of using a free program with similar features to Mathematica.
While the students will be learning some programming during the course, that's not our emphasis and they need to be able to use a fairly high level of interactivity from the beginning. (For example, they should be able to interactively manipulate function parameters in the first or at worst second lab session.) Since I'm very much a newcomer to Sage, I want to ask more experienced users how hard it would be to reproduce the functionality of [this Mathematica notebook](http://db.tt/d332CVVs) in Sage. I've seen the slider examples, but they use quite a bit of code. An equivalent to Equation Trekker, which allows you to specify initial condition for a two-ODE system by clicking on the phase plane, would also be very useful. Has anyone coded such a thing for Sage?Sun, 06 May 2012 18:25:09 -0500http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/Answer by calc314 for <p>I'm working with a committee that's revising the undergraduate math curriculum for UCLA biology majors. We're getting rid of a lot of paper and pencil calculation that's hardly ever used in mathematical biology and introducing a lot of modeling, dynamical systems and computer work. Earlier, we decided to use Mathematica for the course, but I recently learned about Sage and like the idea of using a free program with similar features to Mathematica.</p>
<p>While the students will be learning some programming during the course, that's not our emphasis and they need to be able to use a fairly high level of interactivity from the beginning. (For example, they should be able to interactively manipulate function parameters in the first or at worst second lab session.) Since I'm very much a newcomer to Sage, I want to ask more experienced users how hard it would be to reproduce the functionality of <a href="http://db.tt/d332CVVs">this Mathematica notebook</a> in Sage. I've seen the slider examples, but they use quite a bit of code. An equivalent to Equation Trekker, which allows you to specify initial condition for a two-ODE system by clicking on the phase plane, would also be very useful. Has anyone coded such a thing for Sage?</p>
http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?answer=13549#post-id-13549I used Sage with my advanced math modeling course this semester and did a fair amount of biology in there. Generally, I did not ask the students to do much "from the ground up" coding, although most of them in that group could have. I focused on making worksheets that the students could interact with fairly easily. You can see some samples published at the links below. Most of these use code similar to what Jason mentions above. I've added some options that were needed for my class (nullclines, direction fields, access to the solution coordinates, etc.). This part of the code is lengthy, but it is hidden using "%hide" and automatically executed using "%auto".
Note that the SIR Lab (http://sage.maa.org/home/pub/126/ ) uses the SciPy leastsqrs function to fit the data. This is a useful tool for a course in which you want students to fit data but not have to deal with the details.
Budworm model: http://sage.maa.org/home/pub/110/
Modeling a parachutist: http://sage.maa.org/home/pub/106/
Bifurcations: http://sage.maa.org/home/pub/109/
Solving systems: http://sage.maa.org/home/pub/101/
Linearization: http://sage.maa.org/home/pub/116/
Vector Fields: http://sage.maa.org/home/pub/115/
Advection-Diffusion-Reaction Equation: http://sage.maa.org/home/pub/119/
Mon, 07 May 2012 05:46:34 -0500http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?answer=13549#post-id-13549Comment by calc314 for <p>I used Sage with my advanced math modeling course this semester and did a fair amount of biology in there. Generally, I did not ask the students to do much "from the ground up" coding, although most of them in that group could have. I focused on making worksheets that the students could interact with fairly easily. You can see some samples published at the links below. Most of these use code similar to what Jason mentions above. I've added some options that were needed for my class (nullclines, direction fields, access to the solution coordinates, etc.). This part of the code is lengthy, but it is hidden using "%hide" and automatically executed using "%auto".</p>
<p>Note that the SIR Lab (<a href="http://sage.maa.org/home/pub/126/">http://sage.maa.org/home/pub/126/</a> ) uses the SciPy leastsqrs function to fit the data. This is a useful tool for a course in which you want students to fit data but not have to deal with the details.</p>
<p>Budworm model: <a href="http://sage.maa.org/home/pub/110/">http://sage.maa.org/home/pub/110/</a></p>
<p>Modeling a parachutist: <a href="http://sage.maa.org/home/pub/106/">http://sage.maa.org/home/pub/106/</a></p>
<p>Bifurcations: <a href="http://sage.maa.org/home/pub/109/">http://sage.maa.org/home/pub/109/</a></p>
<p>Solving systems: <a href="http://sage.maa.org/home/pub/101/">http://sage.maa.org/home/pub/101/</a></p>
<p>Linearization: <a href="http://sage.maa.org/home/pub/116/">http://sage.maa.org/home/pub/116/</a></p>
<p>Vector Fields: <a href="http://sage.maa.org/home/pub/115/">http://sage.maa.org/home/pub/115/</a></p>
<p>Advection-Diffusion-Reaction Equation: <a href="http://sage.maa.org/home/pub/119/">http://sage.maa.org/home/pub/119/</a></p>
http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19786#post-id-19786Thanks! :)Tue, 15 May 2012 15:16:32 -0500http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19786#post-id-19786Comment by matrimc for <p>I used Sage with my advanced math modeling course this semester and did a fair amount of biology in there. Generally, I did not ask the students to do much "from the ground up" coding, although most of them in that group could have. I focused on making worksheets that the students could interact with fairly easily. You can see some samples published at the links below. Most of these use code similar to what Jason mentions above. I've added some options that were needed for my class (nullclines, direction fields, access to the solution coordinates, etc.). This part of the code is lengthy, but it is hidden using "%hide" and automatically executed using "%auto".</p>
<p>Note that the SIR Lab (<a href="http://sage.maa.org/home/pub/126/">http://sage.maa.org/home/pub/126/</a> ) uses the SciPy leastsqrs function to fit the data. This is a useful tool for a course in which you want students to fit data but not have to deal with the details.</p>
<p>Budworm model: <a href="http://sage.maa.org/home/pub/110/">http://sage.maa.org/home/pub/110/</a></p>
<p>Modeling a parachutist: <a href="http://sage.maa.org/home/pub/106/">http://sage.maa.org/home/pub/106/</a></p>
<p>Bifurcations: <a href="http://sage.maa.org/home/pub/109/">http://sage.maa.org/home/pub/109/</a></p>
<p>Solving systems: <a href="http://sage.maa.org/home/pub/101/">http://sage.maa.org/home/pub/101/</a></p>
<p>Linearization: <a href="http://sage.maa.org/home/pub/116/">http://sage.maa.org/home/pub/116/</a></p>
<p>Vector Fields: <a href="http://sage.maa.org/home/pub/115/">http://sage.maa.org/home/pub/115/</a></p>
<p>Advection-Diffusion-Reaction Equation: <a href="http://sage.maa.org/home/pub/119/">http://sage.maa.org/home/pub/119/</a></p>
http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=18560#post-id-18560For each of the above links I getting a page with the message "The worksheet does not exist". How do I see any of the links? I want my daughter who is in highschool to take a look at these. Fri, 07 Dec 2012 11:19:15 -0600http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=18560#post-id-18560Comment by kcrisman for <p>I used Sage with my advanced math modeling course this semester and did a fair amount of biology in there. Generally, I did not ask the students to do much "from the ground up" coding, although most of them in that group could have. I focused on making worksheets that the students could interact with fairly easily. You can see some samples published at the links below. Most of these use code similar to what Jason mentions above. I've added some options that were needed for my class (nullclines, direction fields, access to the solution coordinates, etc.). This part of the code is lengthy, but it is hidden using "%hide" and automatically executed using "%auto".</p>
<p>Note that the SIR Lab (<a href="http://sage.maa.org/home/pub/126/">http://sage.maa.org/home/pub/126/</a> ) uses the SciPy leastsqrs function to fit the data. This is a useful tool for a course in which you want students to fit data but not have to deal with the details.</p>
<p>Budworm model: <a href="http://sage.maa.org/home/pub/110/">http://sage.maa.org/home/pub/110/</a></p>
<p>Modeling a parachutist: <a href="http://sage.maa.org/home/pub/106/">http://sage.maa.org/home/pub/106/</a></p>
<p>Bifurcations: <a href="http://sage.maa.org/home/pub/109/">http://sage.maa.org/home/pub/109/</a></p>
<p>Solving systems: <a href="http://sage.maa.org/home/pub/101/">http://sage.maa.org/home/pub/101/</a></p>
<p>Linearization: <a href="http://sage.maa.org/home/pub/116/">http://sage.maa.org/home/pub/116/</a></p>
<p>Vector Fields: <a href="http://sage.maa.org/home/pub/115/">http://sage.maa.org/home/pub/115/</a></p>
<p>Advection-Diffusion-Reaction Equation: <a href="http://sage.maa.org/home/pub/119/">http://sage.maa.org/home/pub/119/</a></p>
http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=18558#post-id-18558I'm not sure - I think that @calc314 must have taken them down, because that server does have public worksheets, but these particular ones are no longer up. Actually, calc314, if you could put all of those together into one resource that would make an excellent "thematic tutorial" http://sagemath.org/doc/thematic_tutorials/ for using Sage in modeling...Sat, 08 Dec 2012 01:09:14 -0600http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=18558#post-id-18558Comment by calc314 for <p>I used Sage with my advanced math modeling course this semester and did a fair amount of biology in there. Generally, I did not ask the students to do much "from the ground up" coding, although most of them in that group could have. I focused on making worksheets that the students could interact with fairly easily. You can see some samples published at the links below. Most of these use code similar to what Jason mentions above. I've added some options that were needed for my class (nullclines, direction fields, access to the solution coordinates, etc.). This part of the code is lengthy, but it is hidden using "%hide" and automatically executed using "%auto".</p>
<p>Note that the SIR Lab (<a href="http://sage.maa.org/home/pub/126/">http://sage.maa.org/home/pub/126/</a> ) uses the SciPy leastsqrs function to fit the data. This is a useful tool for a course in which you want students to fit data but not have to deal with the details.</p>
<p>Budworm model: <a href="http://sage.maa.org/home/pub/110/">http://sage.maa.org/home/pub/110/</a></p>
<p>Modeling a parachutist: <a href="http://sage.maa.org/home/pub/106/">http://sage.maa.org/home/pub/106/</a></p>
<p>Bifurcations: <a href="http://sage.maa.org/home/pub/109/">http://sage.maa.org/home/pub/109/</a></p>
<p>Solving systems: <a href="http://sage.maa.org/home/pub/101/">http://sage.maa.org/home/pub/101/</a></p>
<p>Linearization: <a href="http://sage.maa.org/home/pub/116/">http://sage.maa.org/home/pub/116/</a></p>
<p>Vector Fields: <a href="http://sage.maa.org/home/pub/115/">http://sage.maa.org/home/pub/115/</a></p>
<p>Advection-Diffusion-Reaction Equation: <a href="http://sage.maa.org/home/pub/119/">http://sage.maa.org/home/pub/119/</a></p>
http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=18550#post-id-18550Yes, I took them down when I had to move much of my work off of that server before the next class of PREP workshop folks started. I'll work on getting those together for a "thematic tutorial." Might be a few days before I can pull this off, though.Sat, 08 Dec 2012 17:43:56 -0600http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=18550#post-id-18550Comment by kcrisman for <p>I used Sage with my advanced math modeling course this semester and did a fair amount of biology in there. Generally, I did not ask the students to do much "from the ground up" coding, although most of them in that group could have. I focused on making worksheets that the students could interact with fairly easily. You can see some samples published at the links below. Most of these use code similar to what Jason mentions above. I've added some options that were needed for my class (nullclines, direction fields, access to the solution coordinates, etc.). This part of the code is lengthy, but it is hidden using "%hide" and automatically executed using "%auto".</p>
<p>Note that the SIR Lab (<a href="http://sage.maa.org/home/pub/126/">http://sage.maa.org/home/pub/126/</a> ) uses the SciPy leastsqrs function to fit the data. This is a useful tool for a course in which you want students to fit data but not have to deal with the details.</p>
<p>Budworm model: <a href="http://sage.maa.org/home/pub/110/">http://sage.maa.org/home/pub/110/</a></p>
<p>Modeling a parachutist: <a href="http://sage.maa.org/home/pub/106/">http://sage.maa.org/home/pub/106/</a></p>
<p>Bifurcations: <a href="http://sage.maa.org/home/pub/109/">http://sage.maa.org/home/pub/109/</a></p>
<p>Solving systems: <a href="http://sage.maa.org/home/pub/101/">http://sage.maa.org/home/pub/101/</a></p>
<p>Linearization: <a href="http://sage.maa.org/home/pub/116/">http://sage.maa.org/home/pub/116/</a></p>
<p>Vector Fields: <a href="http://sage.maa.org/home/pub/115/">http://sage.maa.org/home/pub/115/</a></p>
<p>Advection-Diffusion-Reaction Equation: <a href="http://sage.maa.org/home/pub/119/">http://sage.maa.org/home/pub/119/</a></p>
http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19810#post-id-19810Now I finally know who @calc314 is! You have been quietly building a substantial presence here :) Maybe someday I'll get to teach such a course - great resources!Mon, 07 May 2012 15:48:16 -0500http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19810#post-id-19810Answer by Jason Grout for <p>I'm working with a committee that's revising the undergraduate math curriculum for UCLA biology majors. We're getting rid of a lot of paper and pencil calculation that's hardly ever used in mathematical biology and introducing a lot of modeling, dynamical systems and computer work. Earlier, we decided to use Mathematica for the course, but I recently learned about Sage and like the idea of using a free program with similar features to Mathematica.</p>
<p>While the students will be learning some programming during the course, that's not our emphasis and they need to be able to use a fairly high level of interactivity from the beginning. (For example, they should be able to interactively manipulate function parameters in the first or at worst second lab session.) Since I'm very much a newcomer to Sage, I want to ask more experienced users how hard it would be to reproduce the functionality of <a href="http://db.tt/d332CVVs">this Mathematica notebook</a> in Sage. I've seen the slider examples, but they use quite a bit of code. An equivalent to Equation Trekker, which allows you to specify initial condition for a two-ODE system by clicking on the phase plane, would also be very useful. Has anyone coded such a thing for Sage?</p>
http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?answer=13548#post-id-13548See [this cell](http://aleph.sagemath.org/?z=eJxlUEGKwzAMvPsVgl7srGKUZHNZKPQnwcRON1Cakoau09dXtmtIs75oJKSZ8RygtvBw_TLNcLtMixikx1UdZaXrtvAlxVKsCKQpIh5VxapE2O7SZTeM7mLlgMDHQAgVKcZrxkrff6c_qYQ4QPMpdw5y-GTBVP_TNlaeI3HZYKOQWd_gmcCWfLwubjb9Mj4c3MdrkjjlqbBugE6aoyRslfoRwC-sSN6V5sszqUfCneMt6db6nnfm0PCbPx4ENFVIuuWu_-jspns7yInPhYcSTErbFH0APLAh7Ox0H3j0W1OMJYJs_AUCm4MH) for the main calculations in that notebook.
# 2d vector plot
f(x,y)=(1.25*x-0.25*x*y, 0.05*x*y-0.1*y)
plot_vector_field(f, (x, 0, 10), (y, 0, 10)).show()
# 3d vector plot
g(x,y,z)=(x,y,z)
plot_vector_field3d(g, (x,-3,3),(y,-3,3),(z,-3,3)).show()
# interactive sin plot
@interact
def _(a=(0,5)):
plot(sin(a+x),(x,0,10)).show()
# interactive vector plot
@interact
def _(r=(1,4), a=(0.01,0.5), c=(0.01,0.5), d=(0.01,0.5)):
f(x,y)=(r*x - a*x*y, a*c*x*y - d*y)
plot_vector_field(f,(x,0,20),(y,0,20)).show()
You might also be interested in [this worksheet](http://sage.cs.drake.edu/home/pub/87/), which involves some custom code at the top, which I hope we can polish and submit to Sage sometime.
Right now, we don't have an easy way to make a plot clickable to create initial conditions. You can set initial conditions using sliders, though. Help is welcome to make plots clickable!
You might be interested in the MAA PREP course, which introduces faculty to using Sage in the classroom, helps them design interacts, etc. See http://www.maa.org/prep/2012/sage.htmlMon, 07 May 2012 03:43:47 -0500http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?answer=13548#post-id-13548Comment by jaia for <p>See <a href="http://aleph.sagemath.org/?z=eJxlUEGKwzAMvPsVgl7srGKUZHNZKPQnwcRON1Cakoau09dXtmtIs75oJKSZ8RygtvBw_TLNcLtMixikx1UdZaXrtvAlxVKsCKQpIh5VxapE2O7SZTeM7mLlgMDHQAgVKcZrxkrff6c_qYQ4QPMpdw5y-GTBVP_TNlaeI3HZYKOQWd_gmcCWfLwubjb9Mj4c3MdrkjjlqbBugE6aoyRslfoRwC-sSN6V5sszqUfCneMt6db6nnfm0PCbPx4ENFVIuuWu_-jspns7yInPhYcSTErbFH0APLAh7Ox0H3j0W1OMJYJs_AUCm4MH">this cell</a> for the main calculations in that notebook. </p>
<pre><code># 2d vector plot
f(x,y)=(1.25*x-0.25*x*y, 0.05*x*y-0.1*y)
plot_vector_field(f, (x, 0, 10), (y, 0, 10)).show()
# 3d vector plot
g(x,y,z)=(x,y,z)
plot_vector_field3d(g, (x,-3,3),(y,-3,3),(z,-3,3)).show()
# interactive sin plot
@interact
def _(a=(0,5)):
plot(sin(a+x),(x,0,10)).show()
# interactive vector plot
@interact
def _(r=(1,4), a=(0.01,0.5), c=(0.01,0.5), d=(0.01,0.5)):
f(x,y)=(r*x - a*x*y, a*c*x*y - d*y)
plot_vector_field(f,(x,0,20),(y,0,20)).show()
</code></pre>
<p>You might also be interested in <a href="http://sage.cs.drake.edu/home/pub/87/">this worksheet</a>, which involves some custom code at the top, which I hope we can polish and submit to Sage sometime.</p>
<p>Right now, we don't have an easy way to make a plot clickable to create initial conditions. You can set initial conditions using sliders, though. Help is welcome to make plots clickable!</p>
<p>You might be interested in the MAA PREP course, which introduces faculty to using Sage in the classroom, helps them design interacts, etc. See <a href="http://www.maa.org/prep/2012/sage.html">http://www.maa.org/prep/2012/sage.html</a></p>
http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19814#post-id-19814Thanks, that looks really good. Since the clickable phase plane will only be used for a few weeks of a year-long course, that probably doesn't justify Mathematica use, especially since XPP has the same functionality. BTW, there's a Python XPP interface http://seis.bris.ac.uk/~enxjn/xppy/ that may be useful to people trying to code clickable plots.
One thing I'm concerned about now is jumpiness. When I use sliders, say in the sin plot example, there's a noticeable delay between my moving the slider and seeing the new plot. This happens even when I run Sage on my own computer. Can anything be done about it? (I'm using Firefox 12.0.)Mon, 07 May 2012 09:17:23 -0500http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19814#post-id-19814Comment by chaesloc2 for <p>See <a href="http://aleph.sagemath.org/?z=eJxlUEGKwzAMvPsVgl7srGKUZHNZKPQnwcRON1Cakoau09dXtmtIs75oJKSZ8RygtvBw_TLNcLtMixikx1UdZaXrtvAlxVKsCKQpIh5VxapE2O7SZTeM7mLlgMDHQAgVKcZrxkrff6c_qYQ4QPMpdw5y-GTBVP_TNlaeI3HZYKOQWd_gmcCWfLwubjb9Mj4c3MdrkjjlqbBugE6aoyRslfoRwC-sSN6V5sszqUfCneMt6db6nnfm0PCbPx4ENFVIuuWu_-jspns7yInPhYcSTErbFH0APLAh7Ox0H3j0W1OMJYJs_AUCm4MH">this cell</a> for the main calculations in that notebook. </p>
<pre><code># 2d vector plot
f(x,y)=(1.25*x-0.25*x*y, 0.05*x*y-0.1*y)
plot_vector_field(f, (x, 0, 10), (y, 0, 10)).show()
# 3d vector plot
g(x,y,z)=(x,y,z)
plot_vector_field3d(g, (x,-3,3),(y,-3,3),(z,-3,3)).show()
# interactive sin plot
@interact
def _(a=(0,5)):
plot(sin(a+x),(x,0,10)).show()
# interactive vector plot
@interact
def _(r=(1,4), a=(0.01,0.5), c=(0.01,0.5), d=(0.01,0.5)):
f(x,y)=(r*x - a*x*y, a*c*x*y - d*y)
plot_vector_field(f,(x,0,20),(y,0,20)).show()
</code></pre>
<p>You might also be interested in <a href="http://sage.cs.drake.edu/home/pub/87/">this worksheet</a>, which involves some custom code at the top, which I hope we can polish and submit to Sage sometime.</p>
<p>Right now, we don't have an easy way to make a plot clickable to create initial conditions. You can set initial conditions using sliders, though. Help is welcome to make plots clickable!</p>
<p>You might be interested in the MAA PREP course, which introduces faculty to using Sage in the classroom, helps them design interacts, etc. See <a href="http://www.maa.org/prep/2012/sage.html">http://www.maa.org/prep/2012/sage.html</a></p>
http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19802#post-id-19802@jaia I wrote an ad-hoc javascript solution for the delay a while ago - see my answer to http://ask.sagemath.org/question/517/fast-show-for-cached-plots-for-interact . It isn't nearly good enough for distribution, but assuming you don't care about generality, it shouldn't take too much fiddling to make it do what you want.Wed, 09 May 2012 13:58:58 -0500http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19802#post-id-19802Comment by Jason Grout for <p>See <a href="http://aleph.sagemath.org/?z=eJxlUEGKwzAMvPsVgl7srGKUZHNZKPQnwcRON1Cakoau09dXtmtIs75oJKSZ8RygtvBw_TLNcLtMixikx1UdZaXrtvAlxVKsCKQpIh5VxapE2O7SZTeM7mLlgMDHQAgVKcZrxkrff6c_qYQ4QPMpdw5y-GTBVP_TNlaeI3HZYKOQWd_gmcCWfLwubjb9Mj4c3MdrkjjlqbBugE6aoyRslfoRwC-sSN6V5sszqUfCneMt6db6nnfm0PCbPx4ENFVIuuWu_-jspns7yInPhYcSTErbFH0APLAh7Ox0H3j0W1OMJYJs_AUCm4MH">this cell</a> for the main calculations in that notebook. </p>
<pre><code># 2d vector plot
f(x,y)=(1.25*x-0.25*x*y, 0.05*x*y-0.1*y)
plot_vector_field(f, (x, 0, 10), (y, 0, 10)).show()
# 3d vector plot
g(x,y,z)=(x,y,z)
plot_vector_field3d(g, (x,-3,3),(y,-3,3),(z,-3,3)).show()
# interactive sin plot
@interact
def _(a=(0,5)):
plot(sin(a+x),(x,0,10)).show()
# interactive vector plot
@interact
def _(r=(1,4), a=(0.01,0.5), c=(0.01,0.5), d=(0.01,0.5)):
f(x,y)=(r*x - a*x*y, a*c*x*y - d*y)
plot_vector_field(f,(x,0,20),(y,0,20)).show()
</code></pre>
<p>You might also be interested in <a href="http://sage.cs.drake.edu/home/pub/87/">this worksheet</a>, which involves some custom code at the top, which I hope we can polish and submit to Sage sometime.</p>
<p>Right now, we don't have an easy way to make a plot clickable to create initial conditions. You can set initial conditions using sliders, though. Help is welcome to make plots clickable!</p>
<p>You might be interested in the MAA PREP course, which introduces faculty to using Sage in the classroom, helps them design interacts, etc. See <a href="http://www.maa.org/prep/2012/sage.html">http://www.maa.org/prep/2012/sage.html</a></p>
http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19813#post-id-19813How long is the delay you are talking about?Mon, 07 May 2012 12:45:33 -0500http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19813#post-id-19813Comment by jaia for <p>See <a href="http://aleph.sagemath.org/?z=eJxlUEGKwzAMvPsVgl7srGKUZHNZKPQnwcRON1Cakoau09dXtmtIs75oJKSZ8RygtvBw_TLNcLtMixikx1UdZaXrtvAlxVKsCKQpIh5VxapE2O7SZTeM7mLlgMDHQAgVKcZrxkrff6c_qYQ4QPMpdw5y-GTBVP_TNlaeI3HZYKOQWd_gmcCWfLwubjb9Mj4c3MdrkjjlqbBugE6aoyRslfoRwC-sSN6V5sszqUfCneMt6db6nnfm0PCbPx4ENFVIuuWu_-jspns7yInPhYcSTErbFH0APLAh7Ox0H3j0W1OMJYJs_AUCm4MH">this cell</a> for the main calculations in that notebook. </p>
<pre><code># 2d vector plot
f(x,y)=(1.25*x-0.25*x*y, 0.05*x*y-0.1*y)
plot_vector_field(f, (x, 0, 10), (y, 0, 10)).show()
# 3d vector plot
g(x,y,z)=(x,y,z)
plot_vector_field3d(g, (x,-3,3),(y,-3,3),(z,-3,3)).show()
# interactive sin plot
@interact
def _(a=(0,5)):
plot(sin(a+x),(x,0,10)).show()
# interactive vector plot
@interact
def _(r=(1,4), a=(0.01,0.5), c=(0.01,0.5), d=(0.01,0.5)):
f(x,y)=(r*x - a*x*y, a*c*x*y - d*y)
plot_vector_field(f,(x,0,20),(y,0,20)).show()
</code></pre>
<p>You might also be interested in <a href="http://sage.cs.drake.edu/home/pub/87/">this worksheet</a>, which involves some custom code at the top, which I hope we can polish and submit to Sage sometime.</p>
<p>Right now, we don't have an easy way to make a plot clickable to create initial conditions. You can set initial conditions using sliders, though. Help is welcome to make plots clickable!</p>
<p>You might be interested in the MAA PREP course, which introduces faculty to using Sage in the classroom, helps them design interacts, etc. See <a href="http://www.maa.org/prep/2012/sage.html">http://www.maa.org/prep/2012/sage.html</a></p>
http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19809#post-id-19809Maybe a second or so, maybe a bit less. Definitely noticeable. Part of it seems to be the plot refreshing.Mon, 07 May 2012 20:11:22 -0500http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19809#post-id-19809Comment by Jason Grout for <p>See <a href="http://aleph.sagemath.org/?z=eJxlUEGKwzAMvPsVgl7srGKUZHNZKPQnwcRON1Cakoau09dXtmtIs75oJKSZ8RygtvBw_TLNcLtMixikx1UdZaXrtvAlxVKsCKQpIh5VxapE2O7SZTeM7mLlgMDHQAgVKcZrxkrff6c_qYQ4QPMpdw5y-GTBVP_TNlaeI3HZYKOQWd_gmcCWfLwubjb9Mj4c3MdrkjjlqbBugE6aoyRslfoRwC-sSN6V5sszqUfCneMt6db6nnfm0PCbPx4ENFVIuuWu_-jspns7yInPhYcSTErbFH0APLAh7Ox0H3j0W1OMJYJs_AUCm4MH">this cell</a> for the main calculations in that notebook. </p>
<pre><code># 2d vector plot
f(x,y)=(1.25*x-0.25*x*y, 0.05*x*y-0.1*y)
plot_vector_field(f, (x, 0, 10), (y, 0, 10)).show()
# 3d vector plot
g(x,y,z)=(x,y,z)
plot_vector_field3d(g, (x,-3,3),(y,-3,3),(z,-3,3)).show()
# interactive sin plot
@interact
def _(a=(0,5)):
plot(sin(a+x),(x,0,10)).show()
# interactive vector plot
@interact
def _(r=(1,4), a=(0.01,0.5), c=(0.01,0.5), d=(0.01,0.5)):
f(x,y)=(r*x - a*x*y, a*c*x*y - d*y)
plot_vector_field(f,(x,0,20),(y,0,20)).show()
</code></pre>
<p>You might also be interested in <a href="http://sage.cs.drake.edu/home/pub/87/">this worksheet</a>, which involves some custom code at the top, which I hope we can polish and submit to Sage sometime.</p>
<p>Right now, we don't have an easy way to make a plot clickable to create initial conditions. You can set initial conditions using sliders, though. Help is welcome to make plots clickable!</p>
<p>You might be interested in the MAA PREP course, which introduces faculty to using Sage in the classroom, helps them design interacts, etc. See <a href="http://www.maa.org/prep/2012/sage.html">http://www.maa.org/prep/2012/sage.html</a></p>
http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19808#post-id-19808Yes, that delay is normal. The calculation is done on the server, a new image is saved on the server, then the new image is downloaded. We are working on a way to make things faster by using javascript plots, but it will probably be a while before that is in Sage.Mon, 07 May 2012 22:16:29 -0500http://ask.sagemath.org/question/8957/comparing-sage-and-mathematica-for-an-introductory-course/?comment=19808#post-id-19808