[sage-support] plotting box function

2011-02-04 Thread Renato Budinich
hello, why is the below code plotting a flat function rather than a box one? renato def box(x,c): if abs(x) < c: return 1 else: return 0 var('x') plot(box(x,1),(x,-3,3)) -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group

Re: [sage-support] plotting box function

2011-02-04 Thread Mike Hansen
On Fri, Feb 4, 2011 at 11:37 AM, Renato Budinich wrote: > hello, > why is the below code plotting a flat function rather than a box one? When you do, > plot(box(x,1),(x,-3,3)) it evaluates box(x,1) which returns 0 because the variable x is not always less than 1. You need to delay the evaluati

Re: [sage-support] plotting box function

2011-02-04 Thread D. S. McNeil
> hello, > why is the below code plotting a flat function rather than a box one? There are two things going on. First, in the line plot(box(x,1),(x,-3,3)) box(x,1) is actually being evaluated when the line is executed, and not thereafter. IOW you're computing box(x, 1), which is 0, so the abov

[sage-support] error while building Sage

2011-02-04 Thread Mate Kosor
I am trying to build Sage 4.6.1. on Ubuntu 10.10 notebook with Intel(R) Core(TM) i5 CPU M 430 @ 2.27GHz. I installed all prerequisites, and did export MAKE="make -j5" export SAGE_CHECK="yes" make which produced error message ending with 323 tests OK. 2 tests failed: test_distutils test_zlib

Re: [sage-support] plotting box function

2011-02-04 Thread Renato
On Fri, 4 Feb 2011 19:40:34 +0800 "D. S. McNeil" wrote: > > hello, > > why is the below code plotting a flat function rather than a box > > one? > > There are two things going on. First, in the line > > plot(box(x,1),(x,-3,3)) > > box(x,1) is actually being evaluated when the line is executed

Re: [sage-support] plotting box function

2011-02-04 Thread Laurent
plot(lambda x: box(x,1), (x, -3, 3)) but why does this way the execution of the function get delayed? because lambda is a way to define a function. This works more or less like the following : def MyFunction(x) return box(x,1) plot(MyFunction,(x,-3,3)) See for example http://www.sec

Re: [sage-support] error while building Sage

2011-02-04 Thread Jaap Spies
Mate Kosor wrote: I am trying to build Sage 4.6.1. on Ubuntu 10.10 notebook with Intel(R) Core(TM) i5 CPU M 430 @ 2.27GHz. I installed all prerequisites, and did export MAKE="make -j5" export SAGE_CHECK="yes" make Don't set export SAGE_CHECK="yes" This will fail as you noted. Jaap -- To po

[sage-support] Publishing doesn't always automatically update if you request that

2011-02-04 Thread kcrisman
I can't produce something completely replicable on this, but the 'published' version of a worksheet I put up the other day was definitely older than the one I had saved (and it did save, thankfully).Has anyone had any problems with a 'published' worksheet looking like a previous version of a wo

Re: [sage-support] error while building Sage

2011-02-04 Thread John H Palmieri
On Friday, February 4, 2011 8:50:38 AM UTC-8, jaapspies wrote: > > Mate Kosor wrote: > > I am trying to build Sage 4.6.1. on Ubuntu 10.10 notebook with > > Intel(R) Core(TM) i5 CPU M 430 @ 2.27GHz. > > I installed all prerequisites, and did > > export MAKE="make -j5" > > export SAGE_CHECK="yes"

Re: [sage-support] GF(2) -Grobner Basis - How to force x^2 = x ?

2011-02-04 Thread Francois Maltey
Dear Martin, Many thanks for these explanations... They point exactly what I was looking for. a very last question : Is there a link between ring structure GF(2)[a,b,c] / (a^2-a, b^2-b, c^2-c) where + == xor and * == and and Boolean predicates over variables a, b, c with operators "or == |"

Re: [sage-support] GF(2) -Grobner Basis - How to force x^2 = x ?

2011-02-04 Thread Martin Albrecht
Hi, I know of no elegant way of doing that. There are a few ANF (polynomials) to CNF (ORs and ANFs) strategies which are used for example in cryptography. Those might be of interrest to you. I have a few pointers in my thesis. Cheers, Martin On Feb 4, 2011 6:12 PM, "Francois Maltey" wrote: -- T

[sage-support] Re: Problems with taylor expansion and formal symbolic functions

2011-02-04 Thread C. Kelly
Hi all, I still have not found a solution to this problem. Can anyone help? Thanks, Chris On Jan 26, 5:24 pm, "C. Kelly" wrote: > Hi all, > > I define the following one-parameter functions and their derivatives > > x,y,l,L = var('x,y,l,L') > > d5 = function('d5',nargs=1) > > def d3partderiv(sel

[sage-support] Comparing version 3.4 versus 4.6

2011-02-04 Thread Rolandb
Hi, just FYI. Cleaning up various old notebook files, I came across the following Benchmark. It seems that overall version 4.6 is faster, but not for all tests. 3.4 4.6 Benchmark 0.4s0.4sFactor the following polynomial over the rational numbers: (x^97+19*x+1)*(x^103-19*x^97+14)*(x^

Re: [sage-support] Problems with taylor expansion and formal symbolic functions

2011-02-04 Thread Francois Maltey
C. Kelly wrote : I define the following one-parameter functions and their derivatives x,y,l,L = var('x,y,l,L') d5 = function('d5',nargs=1) def d3partderiv(self,*args,**kwds): arg = args[0]; return L*L*d5(arg); d3 = function('d3',derivative_func=d3partderiv) def d1partderiv(self,*args,**kwds):

Re: [sage-support] Problems with taylor expansion and formal symbolic functions

2011-02-04 Thread Francois Maltey
Hello, I came back... I define the following one-parameter functions and their derivatives x,y,l,L = var('x,y,l,L') d5 = function('d5',nargs=1) def d3partderiv(self,*args,**kwds): arg = args[0]; return L*L*d5(arg); d3 = function('d3',derivative_func=d3partderiv) def d1partderiv(self,*args,**k

[sage-support] Re: error while building Sage

2011-02-04 Thread Donald Alan Morrison
On Feb 4, 6:38 am, Mate Kosor wrote: > I am trying to build Sage 4.6.1. on Ubuntu 10.10 notebook with > Intel(R) Core(TM) i5 CPU M 430  @ 2.27GHz. > I installed all prerequisites, and did > export MAKE="make -j5" > export SAGE_CHECK="yes" > make > [...] Aside: This probably won't make any differe

[sage-support] edges in graphs

2011-02-04 Thread Johannes
Hi list how can i add a new edge (a->b) to a given graph G (n.n. connected), just in the case that there is no path (a -> ... -> b) before? all i found is the all_path(a,b) method wich tooks very long in my case and generates a huge overhead. greatz Johanens -- To post to this group, send email

Re: [sage-support] edges in graphs

2011-02-04 Thread Mike Hansen
On Fri, Feb 4, 2011 at 11:56 PM, Johannes wrote: > Hi list > how can i add a new edge (a->b) to a given graph G (n.n. connected), > just in the case that there is no path (a -> ... -> b) before? You should use "shortest_path" which uses Dijkstra's algorithm under the hood. if g.shortest_path('a'

Re: [sage-support] edges in graphs

2011-02-04 Thread Robert Bradshaw
On Fri, Feb 4, 2011 at 3:26 PM, Mike Hansen wrote: > On Fri, Feb 4, 2011 at 11:56 PM, Johannes wrote: >> Hi list >> how can i add a new edge (a->b) to a given graph G (n.n. connected), >> just in the case that there is no path (a -> ... -> b) before? > > You should use "shortest_path" which uses

[sage-support] Re: edges in graphs

2011-02-04 Thread Nathann Cohen
> > how can i add a new edge (a->b) to a given graph G (n.n. connected), > just in the case that there is no path (a -> ... -> b) before? >From your question, I can not infer whether you are dealing with directed or undirected graphs. So just in case : - If your graph is undirected and there a

Re: [sage-support] edges in graphs

2011-02-04 Thread Nathann Cohen
> > Of course finding the shortest path may be (almost) as expensive as > finding all of them... If you're doing this for a lot of edges you > might want to break it up into components, then the test would be > easy. It would be cool if all_paths were an iterator and you could > just ask for the f