[sage-support] Re: running R code in SAGE

2011-03-21 Thread kcrisman
On Mar 21, 9:47 pm, Kirill Vankov wrote: > Thank you for quick reply!  It is interesting to consider custom R > modules, I did not think about it.   I was thinking in the direction > of individual parser for expected R output and it is very useful to > have an example.  I'll give it a try. > Gr

[sage-support] Re: running R code in SAGE

2011-03-21 Thread Kirill Vankov
Thank you for quick reply! It is interesting to consider custom R modules, I did not think about it. I was thinking in the direction of individual parser for expected R output and it is very useful to have an example. I'll give it a try. Kirill -- To post to this group, send email to sage-su

[sage-support] Re: Crazy interact madness with jsmath and new Python formatting

2011-03-21 Thread kcrisman
On Mar 21, 4:27 pm, Jason Grout wrote: > On 3/21/11 2:12 PM, kcrisman wrote: > > > > > > > Try this: > > > @interact > > def _(p=(13,[q for q in prime_range(200) if q%4==1])): > >      k=mod(factorial((p-1)/2),p) > >      html("And we can compute that ${0}^2\equiv{1}$ and ${2}^2\equiv > > {3}\te

[sage-support] Re: Crazy interact madness with jsmath and new Python formatting

2011-03-21 Thread Jason Grout
On 3/21/11 2:12 PM, kcrisman wrote: Try this: @interact def _(p=(13,[q for q in prime_range(200) if q%4==1])): k=mod(factorial((p-1)/2),p) html("And we can compute that ${0}^2\equiv{1}$ and ${2}^2\equiv {3}\text{ mod }({4})$".format(k,k^2,-k,(-k)^2,p)) I have seen successful use of th

[sage-support] Crazy interact madness with jsmath and new Python formatting

2011-03-21 Thread kcrisman
Try this: @interact def _(p=(13,[q for q in prime_range(200) if q%4==1])): k=mod(factorial((p-1)/2),p) html("And we can compute that ${0}^2\equiv{1}$ and ${2}^2\equiv {3}\text{ mod }({4})$".format(k,k^2,-k,(-k)^2,p)) I have seen successful use of this new Python string formatting in Sage

[sage-support] Re: Some symbolic functions return python ints

2011-03-21 Thread kcrisman
On Mar 21, 2:14 pm, Alastair Irving wrote: > On 21/03/2011 16:24, kcrisman wrote: > > > This is important to fix, because some Sage code depends on the input > > in integer form being Sage integer or something else with Sage > > methods, not a Python int, and one could imagine someone relying on

[sage-support] Re: running R code in SAGE

2011-03-21 Thread kcrisman
It's definitely possible. It's also somewhat annoying. If you actually have made an R module, you could do r.install_packages(stuff with the repo mentioned) r.library('my_module') and that might be the easiest way to gain access. Unfortunately, it's not very easy to use user-defined functions

Re: [sage-support] Re: Some symbolic functions return python ints

2011-03-21 Thread Alastair Irving
On 21/03/2011 16:24, kcrisman wrote: This is important to fix, because some Sage code depends on the input in integer form being Sage integer or something else with Sage methods, not a Python int, and one could imagine someone relying on this and getting a nasty exception. exactly what happened

[sage-support] running R code in SAGE

2011-03-21 Thread Kirill Vankov
Suppose I have some R code with some functions defined. I would like to be able to call these functions within SAGE. I did not find any examples of someone doing so and I was not able to do so myself... I understand how to initiate R session within SAGE and within notebook cell, however, it is

[sage-support] Units Package Simplification in Exponentiation/Powers

2011-03-21 Thread Mark
I'm trying to use the Sage units package and cannot get expected simplifications with things more complicated than +, -, /, *. For example: sage: a=5*units.length.meter sage: sqrt(a^2) 5*sqrt(meter^2) even though I would expect units of simply "meter". If I try to convert the result to "units.

[sage-support] Re: phase portrait with sage.

2011-03-21 Thread achrzesz
Also introducing lambda function wasn't necessary: import scipy.integrate a=1.0 b=2.0 def fun(t): if t<=-b: return -a elif fhttp://groups.google.com/group/sage-support URL: http://www.sagemath.org

[sage-support] Re: Some symbolic functions return python ints

2011-03-21 Thread kcrisman
On Mar 21, 12:06 pm, Alastair Irving wrote: > HI All > > I'm running Sage 4.6.2.  I've just noticed that if I evaluate various > symbolic expressions which return 0 then the 0 returned is a python int, > rather than a Sage integer.  examples of such expressions are sin(0), > tan(0), ln(0). > > I

[sage-support] Some symbolic functions return python ints

2011-03-21 Thread Alastair Irving
HI All I'm running Sage 4.6.2. I've just noticed that if I evaluate various symbolic expressions which return 0 then the 0 returned is a python int, rather than a Sage integer. examples of such expressions are sin(0), tan(0), ln(0). Is there a reason for this or is it a bug? Best wishes

[sage-support] Re: phase portrait with sage.

2011-03-21 Thread achrzesz
Of course N=100 in "my" code and repeated x0=[[0.5*k,0.5*k] for k in range(-10,10)] in Marshall one are superfluous :) Andrzej Chrzeszczyk On 21 Mar, 13:58, kcrisman wrote: > On Mar 20, 9:55 pm, Marshall Hampton wrote: > > > > > Slightly more Sage-ified version of the above very nice solution

[sage-support] Re: sage server

2011-03-21 Thread Jason Grout
On 3/20/11 12:37 PM, tbensky wrote: Hi Jason- Sorry to keep bugging you about this but I think I'm getting closer to getting this working. I have found a bunch of apache mod_rewrites has taken care of many problems, but I the the ajax calls are still broken. I have identified a javascript functio

[sage-support] Re: Problem in displaying graphs

2011-03-21 Thread kcrisman
On Mar 20, 4:14 pm, pong wrote: > With some fiddling, > > \sageplot{Graph(d).plot(), axes_pad=0.1) > > works around the problem. Can you be more explicit about 'fiddling'? Does that mean you patched SageTeX, or Sage? Also, is there a } or a ) at the end of the command? Thanks! It's true tha

[sage-support] Re: phase portrait with sage.

2011-03-21 Thread kcrisman
On Mar 20, 9:55 pm, Marshall Hampton wrote: > Slightly more Sage-ified version of the above very nice solution: > > import scipy.integrate > a=1.0 > b=2.0 > > def fun(t): >     if t<=-b: >         return -a >     elif f         return t*a/b >     else: >         return a > > g=lambda t:fun(t) >