[sage-support] Re: Strange construction in autogenerated Python

2009-03-27 Thread Dan Drake
On Thu, 26 Mar 2009 at 10:24PM -0700, Timothy Clemans wrote:
 Instead of actually modifying Python to fix some annoyances Sage uses
 IPython to preparse the code. For example in Sage 4 ^ 6 is preparsed
 into 4 ** 6.

I think he's curious about Integer() being applied twice, when once is
obviously enough.

I just looked at an autogenerated .py file, and I only see things like
_sage_const_1 = Integer(1)...Greg, where do you have 2's in your
original .sage file?

Dan


 On Thu, Mar 26, 2009 at 9:52 PM, Greg Kuperberg
 greg.kuperb...@gmail.com wrote:
 
  Hi.  I see that when I make file called foo.sage, sage precompiles it
  into another file called foo.py.  The code statement in this file is:
 
  _sage_const_2 = Integer(Integer(2))
 
  Surely this is wrong?  Maybe it does not matter if this Python code is
  only executed once.  But still it looks strange.

-- 
---  Dan Drake dr...@kaist.edu
-  KAIST Department of Mathematical Sciences
---  http://mathsci.kaist.ac.kr/~drake


signature.asc
Description: Digital signature


[sage-support] avatars.py (and others): which one ?

2009-03-27 Thread Thierry Dumont

I need to make changes to avatars.py

I find 3 versions of this script in the sage tree:

./devel/sage-main/build/lib.linux-x86_64-2.5/sage/server/notebook/avatars.py
./devel/sage-main/build/sage/server/notebook/avatars.py
./devel/sage-main/sage/server/notebook/avatars.py

(the same is true for notebook.py and many other scripts).

Which one is used by the notebook?

I cannot find where all this is described in the documentation... can
you give me a hint?

Yours,
t.d.

-
French universities are on a permanent strike!
Have a look at the International Call:
http://math.univ-lyon1.fr/appel
-


begin:vcard
fn:Thierry Dumont
n:Dumont;Thierry
org;quoted-printable:CNRS - Universit=C3=A9 Lyon 1. / Villeurbanne France.;Institut Camille Jordan
adr:;;43 Bd du 11 Novembre;Villeurbanne Cedex;F;69621;France
email;internet:tdum...@math.univ-lyon1.fr
title;quoted-printable:Ing=C3=A9nieur de Recherche/Research Ingineer
tel;work:(33) 4 72 44 85 23
x-mozilla-html:FALSE
url:http://math.univ-lyon1.fr/~tdumont
version:2.1
end:vcard



smime.p7s
Description: S/MIME Cryptographic Signature


[sage-support] Re: avatars.py (and others): which one ?

2009-03-27 Thread Timothy Clemans

./devel/sage-main/sage/server/notebook/avatars.py

Usually one clones the main branch sage --clone nameofclone
sage -br takes your changes live

On Fri, Mar 27, 2009 at 1:25 AM, Thierry Dumont
tdum...@math.univ-lyon1.fr wrote:

 I need to make changes to avatars.py

 I find 3 versions of this script in the sage tree:

 ./devel/sage-main/build/lib.linux-x86_64-2.5/sage/server/notebook/avatars.py
 ./devel/sage-main/build/sage/server/notebook/avatars.py
 ./devel/sage-main/sage/server/notebook/avatars.py

 (the same is true for notebook.py and many other scripts).

 Which one is used by the notebook?

 I cannot find where all this is described in the documentation... can
 you give me a hint?

 Yours,
 t.d.

 -
 French universities are on a permanent strike!
 Have a look at the International Call:
 http://math.univ-lyon1.fr/appel
 -




--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: avatars.py (and others): which one ?

2009-03-27 Thread Thierry Dumont
Timothy Clemans a écrit :
 ./devel/sage-main/sage/server/notebook/avatars.py
 
Ok thank you...

 Usually one clones the main branch sage --clone nameofclone
 sage -br takes your changes live
 

I do not really understand this. I apologize, but is there a link to
some place where it is explained?
Do tou mean:
sage --clone nameofclone= creates a copy
the we make changes in nameofclone
and sage -br  tranfers the changes in the main branch ?

Yours
t.

 On Fri, Mar 27, 2009 at 1:25 AM, Thierry Dumont
 tdum...@math.univ-lyon1.fr wrote:
 I need to make changes to avatars.py

 I find 3 versions of this script in the sage tree:

 ./devel/sage-main/build/lib.linux-x86_64-2.5/sage/server/notebook/avatars.py
 ./devel/sage-main/build/sage/server/notebook/avatars.py
 ./devel/sage-main/sage/server/notebook/avatars.py

 (the same is true for notebook.py and many other scripts).

 Which one is used by the notebook?

 I cannot find where all this is described in the documentation... can
 you give me a hint?

 Yours,
 t.d.

 -
 French universities are on a permanent strike!
 Have a look at the International Call:
 http://math.univ-lyon1.fr/appel
 -



 
 --~--~-~--~~~---~--~~
 To post to this group, send email to sage-support@googlegroups.com
 To unsubscribe from this group, send email to 
 sage-support-unsubscr...@googlegroups.com
 For more options, visit this group at 
 http://groups.google.com/group/sage-support
 URLs: http://www.sagemath.org
 -~--~~~~--~~--~--~---
 


-- 

-
French universities are on a permanent strike!
Have a look at the International Call:
http://math.univ-lyon1.fr/appel
-


begin:vcard
fn:Thierry Dumont
n:Dumont;Thierry
org;quoted-printable:CNRS - Universit=C3=A9 Lyon 1. / Villeurbanne France.;Institut Camille Jordan
adr:;;43 Bd du 11 Novembre;Villeurbanne Cedex;F;69621;France
email;internet:tdum...@math.univ-lyon1.fr
title;quoted-printable:Ing=C3=A9nieur de Recherche/Research Ingineer
tel;work:(33) 4 72 44 85 23
x-mozilla-html:FALSE
url:http://math.univ-lyon1.fr/~tdumont
version:2.1
end:vcard



smime.p7s
Description: S/MIME Cryptographic Signature


[sage-support] Re: avatars.py (and others): which one ?

2009-03-27 Thread Timothy Clemans

On Fri, Mar 27, 2009 at 3:38 AM, Thierry Dumont
tdum...@math.univ-lyon1.fr wrote:
 Timothy Clemans a écrit :
 ./devel/sage-main/sage/server/notebook/avatars.py

 Ok thank you...

 Usually one clones the main branch sage --clone nameofclone
 sage -br takes your changes live


 I do not really understand this. I apologize, but is there a link to
 some place where it is explained?
 Do tou mean:
 sage --clone nameofclone    = creates a copy
 the we make changes in nameofclone
 and sage -br  tranfers the changes in the main branch ?


sage -br builds Sage using the modified code in the current clone

to go back to the old code you would do sage -b main

See http://sagemath.org/doc/developer/producing_patches.html

 Yours
 t.

 On Fri, Mar 27, 2009 at 1:25 AM, Thierry Dumont
 tdum...@math.univ-lyon1.fr wrote:
 I need to make changes to avatars.py

 I find 3 versions of this script in the sage tree:

 ./devel/sage-main/build/lib.linux-x86_64-2.5/sage/server/notebook/avatars.py
 ./devel/sage-main/build/sage/server/notebook/avatars.py
 ./devel/sage-main/sage/server/notebook/avatars.py

 (the same is true for notebook.py and many other scripts).

 Which one is used by the notebook?

 I cannot find where all this is described in the documentation... can
 you give me a hint?

 Yours,
 t.d.

 -
 French universities are on a permanent strike!
 Have a look at the International Call:
 http://math.univ-lyon1.fr/appel
 -




 


 --

 -
 French universities are on a permanent strike!
 Have a look at the International Call:
 http://math.univ-lyon1.fr/appel
 -




--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: When absolutely must declare vars?

2009-03-27 Thread kcrisman


  On Mar 26, 1:44 pm, kcrisman kcris...@gmail.com wrote:
  Incidentally, that is a good argument for always declaring your
  functions as callable; it relieves one of this tedious var business.
  I will make a mental note of it for intro material in Sage.

  That would be a good idea if it was natural to ALWAYS define callable
  functions.

  The problem is that when the first thing a student types into his/her
  notebook is

  integrate(sin(x),x,2,44)

  then an error will occur.

 That is why we make a single exception for the variable x.


And I wasn't implying one should always define callable functions, I
just meant it is an argument for doing so as often as possible when it
is reasonable.  I do not personally always like callable functions,
but this is an argument for doing it fairly consistently if you're
using variables other than x and you are actually defining functions,
not expressions.   That's it.

- kcrisman
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How use substitute method in function definitions?

2009-03-27 Thread kcrisman

 sage: n(a) # Why doesn't this return the result of numerical_integral?
 ---
 TypeError                                 Traceback (most recent call last)

 /home/jason/.sage/temp/littleone/29880/_home_jason__sage_init_sage_0.py
 in module()

 /home/jason/sage/local/lib/python2.5/site-packages/sage/misc/functional.pyc
 in numerical_approx(x, prec, digits)
      765             prec = int((digits+1) * 3.32192) + 1
      766     try:
 -- 767         return x.numerical_approx(prec)
      768     except AttributeError:
      769         from sage.rings.complex_double import
 is_ComplexDoubleElement

 /home/jason/sage/local/lib/python2.5/site-packages/sage/calculus/calculus.p yc
 in numerical_approx(self, prec, digits)
     1514         except TypeError:
     1515             # try to return a complex result
 - 1516             approx = self._complex_mpfr_field_(ComplexField(prec))

Here's the problem: the only TypeError it recognizes is to try to
evaluate a complex integral, but since sin(cos(x)) doesn't have an
antiderivative Maxima knows about, it tries this.  Maybe one
(you? :) ) can implement a catch for the event that the integral does
not completely resolve symbolically (e.g. try sage: integrate(1/
(1+x^8)) versus sage: integrate(1/(1+x^7)), where the first just
returns the question but the second did the only piece of the partial
fraction it could, yet both should probably have numerical_integral
applied somehow when n() is called.)

- kcrisman
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: counting iterations of a loop by evaluating a sum

2009-03-27 Thread Patrick

That's perfect.  Thanks!

On Mar 26, 5:41 pm, Jason Grout jason-s...@creativetrax.com wrote:
 Burcin Erocal wrote:
  Hi,

  On Thu, 26 Mar 2009 09:31:09 -0700 (PDT)
  Patrick patrick.j.cla...@gmail.com wrote:

  I'd like to count the iterations of a loop nest by evaluating a sum.
  Consider the following loop nest:

     for (k = 0; k  N; k++)
        for (i = k+1; i  N; i++)
            for (j = k+1; j = i; j++)
               ...

  I'd like to count the total number of iterations of that loop nest.
  I've used mathematica a bit, and you could solve this problem with
  something like this:

      Sum[1, {k, 0, N}, {i, k+1, N}, {j, k+1, i-1}]

  The result should be in terms of N.  For this loop nest the closed
  form is:

     1 / 6 * (1 + N) * (N^2 - N)

  I've been trying to figure out how to do this sort of problem in Sage,
  but I have been unsuccessful.  Any help would be greatly appreciated.

  Unfortunately Sage doesn't have native code to find closed forms for
  sums at the moment. You will have to use maxima directly to solve this 
  problem.

 You can use maxima as illustrated in William's message here:

 http://groups.google.com/group/sage-support/browse_thread/thread/4584...

 sage: a=maxima('sum(sum(sum(1,j,k+1,i-1), i, k+1, N), k, 0, N),
 simpsum').sage()
 sage: a
 (2*N^3 + 3*N^2 + N)/12 - (N^3 + N^2)/2 + (N^2 + N)/4 + N^2*(N + 1)/2 -
 N*(N + 1)/2
 sage: a.simplify_full()
 (N^3 - N)/6

 Jason
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: avatars.py (and others): which one ?

2009-03-27 Thread William Stein

On Fri, Mar 27, 2009 at 1:25 AM, Thierry Dumont
tdum...@math.univ-lyon1.fr wrote:

 I need to make changes to avatars.py

 I find 3 versions of this script in the sage tree:

 ./devel/sage-main/build/lib.linux-x86_64-2.5/sage/server/notebook/avatars.py
 ./devel/sage-main/build/sage/server/notebook/avatars.py
 ./devel/sage-main/sage/server/notebook/avatars.py

Change the file

./devel/sage-main/sage/server/notebook/avatars.py

then type

  sage -br

to make it live.

William


 (the same is true for notebook.py and many other scripts).

 Which one is used by the notebook?

 I cannot find where all this is described in the documentation... can
 you give me a hint?

 Yours,
 t.d.

 -
 French universities are on a permanent strike!
 Have a look at the International Call:
 http://math.univ-lyon1.fr/appel
 -






-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How use substitute method in function definitions?

2009-03-27 Thread cseberino



On Mar 26, 7:16 pm, Robert Bradshaw rober...@math.washington.edu
wrote:
 def Y(t):
      return 2500+numerical_integral(S(u)-R(u),0,t)[0]

 but then it won't be a symbolic object. (It will be a Python function.)

Wait.  What is the difference between a symbolic object and a
Python function ?

Not sure whey the def way works but not the Y(t) = ... way.

cs
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Apache configure

2009-03-27 Thread nerak99

I have compiled and installed sage on a server and it is working
fine.
To access the server from home, I have to go through a firewall and so
I need to use port 80 to access the server and so far as I can tell,
use mod_proxy to redirect requests to sage to port 8000.

Unfortunately, in sage the html links are all absolute rather tha
relative  so I can redirect http://myserver/sage to port 8000 but the
the links go to http://myserver/login (say) rather than 
http://myserver/sage/login.

Any ideas, is a rewrite fo the html a huge job from me to undertake?

Brian
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How use substitute method in function definitions?

2009-03-27 Thread Robert Bradshaw

On Mar 27, 2009, at 10:36 AM, cseber...@gmail.com wrote:

 On Mar 26, 7:16 pm, Robert Bradshaw rober...@math.washington.edu
 wrote:
 def Y(t):
  return 2500+numerical_integral(S(u)-R(u),0,t)[0]

 but then it won't be a symbolic object. (It will be a Python  
 function.)

 Wait.  What is the difference between a symbolic object and a
 Python function ?

A symbolic object can be manipulated, reasoned about, and has a bunch  
of methods attached.

sage: f(x) = x^3-x
sage: f + 1
x |-- x^3 - x + 1
sage: f.integrate(x)
x |-- x^4/4 - x^2/2
...

A Python function can just be called (pretty much). It's just a chunk  
of executable code (for example, could include loops, branching, look  
stuff up in a file/online, etc.).

sage: def f(x): x^3-x
:
sage: f.integrate()

Traceback (most recent call last):
   File ipython console, line 1, in module
AttributeError: 'function' object has no attribute 'integrate'

 Not sure whey the def way works but not the Y(t) = ... way.

The body of a function is not executed until it is called. In the  
latter case, when you call Y(3) the t is specialized at 3 and the  
numerical integration actually can evaluate at a given point.

- Robert


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Apache configure

2009-03-27 Thread Robert Bradshaw

On Mar 27, 2009, at 12:00 PM, nerak99 wrote:

 I have compiled and installed sage on a server and it is working
 fine.
 To access the server from home, I have to go through a firewall and so
 I need to use port 80 to access the server and so far as I can tell,
 use mod_proxy to redirect requests to sage to port 8000.

 Unfortunately, in sage the html links are all absolute rather tha
 relative  so I can redirect http://myserver/sage to port 8000 but the
 the links go to http://myserver/login (say) rather than http:// 
 myserver/sage/login.

 Any ideas, is a rewrite fo the html a huge job from me to undertake?

I think you can use apache to be a proxy and reverse proxy, using re- 
write rules to map the urls both directions (as well as ports). This  
is probably the best bet (correct me if I'm wrong, but doesn't  
sagenb.org work this way?).

- Robert


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Apache configure

2009-03-27 Thread William Stein

On Fri, Mar 27, 2009 at 12:35 PM, Robert Bradshaw
rober...@math.washington.edu wrote:

 On Mar 27, 2009, at 12:00 PM, nerak99 wrote:

 I have compiled and installed sage on a server and it is working
 fine.
 To access the server from home, I have to go through a firewall and so
 I need to use port 80 to access the server and so far as I can tell,
 use mod_proxy to redirect requests to sage to port 8000.

 Unfortunately, in sage the html links are all absolute rather tha
 relative  so I can redirect http://myserver/sage to port 8000 but the
 the links go to http://myserver/login (say) rather than http://
 myserver/sage/login.

 Any ideas, is a rewrite fo the html a huge job from me to undertake?

 I think you can use apache to be a proxy and reverse proxy, using re-
 write rules to map the urls both directions (as well as ports). This
 is probably the best bet (correct me if I'm wrong, but doesn't
 sagenb.org work this way?).

This is how sagenb.org works.  This is in httpd.conf.  It's maybe even
more complicated because the computer serving the page isn't even the
same computer where the notebook server is running.

VirtualHost *
  RewriteEngine On
  ServerName sagenb.org
  ProxyPass/ http://sagenb.org:8000/
  ProxyPassReverse / http://sagenb.org:8000/
  DocumentRoot /
Location /
   DefaultType text/html
/Location
/VirtualHost

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange construction in autogenerated Python

2009-03-27 Thread Greg Kuperberg

1) I am using sage 3.2.3, which was current when I installed it in
January.  It was convenient for me to compile it from scratch, but it
then takes a long time to install.

2) Here is my sage code.  The program estimates the probability of
ever getting a 6-way tie if you repeatedly roll a die and count the
number of times that you get each result.

n = 100
s = 0.
for k in xrange(1,n+1):
t = float(factorial(6*k)/factorial(k)^6/6^(6*k))
s += t
print k,s,float(t),t*float(k)^(2.5)
c = sqrt(6.)*float(2*pi)^(-2.5)
print Limit by Stirling's approx:,c
tu = 2*c/3.*float(n)^(-1.5)
print Tail upper bound:,tu
s += tu
print Total upper bound:,s
print Estimate for chance ever:,s/(1.+s)

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange construction in autogenerated Python

2009-03-27 Thread simon . king

Hi Greg,

On 27 Mrz., 21:21, Greg Kuperberg greg.kuperb...@gmail.com wrote:
 1) I am using sage 3.2.3, which was current when I installed it in
 January.  It was convenient for me to compile it from scratch, but it
 then takes a long time to install.

Side note: In order to change to the latest sage version, it is not
needed to compile from scratch again. Just do
  sage -upgrade
on the command line. Provided that you are connected with internet, it
will retrieve the changes from sage 3.2.3 to the latest version and re-
compile (only) the necessary bits. So, this is much faster than
compiling from scratch.

Cheers,
  Simon

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How use substitute method in function definitions?

2009-03-27 Thread Chris Seberino



On Mar 27, 6:04 am, kcrisman kcris...@gmail.com wrote:
 Maybe one
 (you? :) ) can implement a catch...

At first I was interested in this change but now I'm wondering if it
is best the way it is now.

f(x) =  defines a symbolic object as was previously mentioned.  A
symbolic object is for analytical results.

It doesn't seem like it would make sense to add any approximation
relationed functions like n(..) or numerical_integral(..) to a
symbolic object.

On the other hand,some may argue that it is best to let the Sage
user have the freedom to add anything he/she wants to a symbolic
function.

I'm curious what others think.

Chris
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How use substitute method in function definitions?

2009-03-27 Thread Jason Grout

Chris Seberino wrote:
 
 
 On Mar 27, 6:04 am, kcrisman kcris...@gmail.com wrote:
 Maybe one
 (you? :) ) can implement a catch...
 
 At first I was interested in this change but now I'm wondering if it
 is best the way it is now.
 
 f(x) =  defines a symbolic object as was previously mentioned.  A
 symbolic object is for analytical results.
 
 It doesn't seem like it would make sense to add any approximation
 relationed functions like n(..) or numerical_integral(..) to a
 symbolic object.
 
 On the other hand,some may argue that it is best to let the Sage
 user have the freedom to add anything he/she wants to a symbolic
 function.
 
 I'm curious what others think.
 

We already have plenty of approximation functions attached to the 
symbolic functions.  I think it's extremely valuable.  For example, it's 
very handy for plotting things.

sage: sin(1)
sin(1)
sage: sin(1).numerical_approx()
0.841470984807897


In fact, the first thing n() tries is the numerical_approx() method of 
the object.  I think all we have to do is define an 
integral.numerical_approx() function that returns the results of 
numerical_integral()

Jason


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How use substitute method in function definitions?

2009-03-27 Thread Jason Grout

Jason Grout wrote:
 Chris Seberino wrote:

 On Mar 27, 6:04 am, kcrisman kcris...@gmail.com wrote:
 Maybe one
 (you? :) ) can implement a catch...
 At first I was interested in this change but now I'm wondering if it
 is best the way it is now.

 f(x) =  defines a symbolic object as was previously mentioned.  A
 symbolic object is for analytical results.

 It doesn't seem like it would make sense to add any approximation
 relationed functions like n(..) or numerical_integral(..) to a
 symbolic object.

 On the other hand,some may argue that it is best to let the Sage
 user have the freedom to add anything he/she wants to a symbolic
 function.

 I'm curious what others think.

 
 We already have plenty of approximation functions attached to the 
 symbolic functions.  I think it's extremely valuable.  For example, it's 
 very handy for plotting things.
 
 sage: sin(1)
 sin(1)
 sage: sin(1).numerical_approx()
 0.841470984807897
 
 
 In fact, the first thing n() tries is the numerical_approx() method of 
 the object.  I think all we have to do is define an 
 integral.numerical_approx() function that returns the results of 
 numerical_integral()


Um, duh, that's where the TypeError occurs above.  Okay, I guess I 
meant: one should just fix the numeric_approx function for integral...

Jason


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How use substitute method in function definitions?

2009-03-27 Thread Chris Seberino



On Mar 27, 6:20 pm, Jason Grout jason-s...@creativetrax.com wrote:
 We already have plenty of approximation functions attached to the
 symbolic functions.

 sage: sin(1).numerical_approx()

Yes.  I was unclear.  What I meant was it wouldn't make sense to use
approximation function in the *definition* of a symbolic function...

e.g. f(x) = numerical_integral(...)

Do people want that? Or is that easy to do?

Chris
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: When absolutely must declare vars?

2009-03-27 Thread Chris Seberino



On Mar 27, 5:58 am, kcrisman kcris...@gmail.com wrote:
 And I wasn't implying one should always define callable functions, I
 just meant it is an argument for doing so as often as possible when it
 is reasonable.  I do not personally always like callable functions,
 but this is an argument for doing it fairly consistently if you're
 using variables other than x and you are actually defining functions,
 not expressions.   That's it.

I'm considering var(a b c  z) for students' notebook
initialization and telling them to just use single letter vars just
like in pencil/paper work.

cs
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: When absolutely must declare vars?

2009-03-27 Thread Jason Grout

Chris Seberino wrote:
 
 
 On Mar 27, 5:58 am, kcrisman kcris...@gmail.com wrote:
 And I wasn't implying one should always define callable functions, I
 just meant it is an argument for doing so as often as possible when it
 is reasonable.  I do not personally always like callable functions,
 but this is an argument for doing it fairly consistently if you're
 using variables other than x and you are actually defining functions,
 not expressions.   That's it.
 
 I'm considering var(a b c  z) for students' notebook
 initialization and telling them to just use single letter vars just
 like in pencil/paper work.
 

Actually, this is how Sage used to be.  Now, you can just do:

sage: from sage.calculus.predefined import *
sage: type(b)
class 'sage.calculus.calculus.SymbolicVariable'
sage: type(B)
class 'sage.calculus.calculus.SymbolicVariable'

to automatically define all single lowercase and uppercase letters as 
variables.

However, it might be good for students to see the var() function, like 
you proposed.  Then it would be easy for them to extrapolate how to 
create a variable theta, for example.

Jason


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange construction in autogenerated Python

2009-03-27 Thread Greg Kuperberg

On Mar 27, 1:39 pm, simon.k...@uni-jena.de wrote:
 Side note: In order to change to the latest sage version, it is not
 needed to compile from scratch again. Just do
   sage -upgrade
 on the command line. Provided that you are connected with internet, it
 will retrieve the changes from sage 3.2.3 to the latest version and re-
 compile (only) the necessary bits. So, this is much faster than
 compiling from scratch.

That's a good suggestion.  But I just did that, and it still took 90
minutes, although starting the process was trivial.

On the bright side, in Sage 3.4, the Integer(Integer(n)) bug is
fixed.

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---