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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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)
>
17 matches
Mail list logo