[sage-support] Evaluation of time spent on each instruction...

2009-09-01 Thread Nathann Cohen
Hello everybody !!!

I would like to test the functions I write to learn which instructions take
most of the time, and if possible find a way around.. There may not be some
tool for this in Sage, but perhaps it already exists for Python Do you
know about such a thing ? :-)

Nathann

--~--~-~--~~~---~--~~
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: Evaluation of time spent on each instruction...

2009-09-01 Thread Robert Bradshaw

On Sep 1, 2009, at 1:34 AM, Nathann Cohen wrote:

> Hello everybody !!!
>
> I would like to test the functions I write to learn which  
> instructions take most of the time, and if possible find a way  
> around.. There may not be some tool for this in Sage, but perhaps  
> it already exists for Python Do you know about such a thing ? :-)

Yes, see http://docs.python.org/library/profile.html

--~--~-~--~~~---~--~~
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: A weird exception?

2009-09-01 Thread Robert Bradshaw

On Aug 29, 2009, at 11:05 PM, Rolandb wrote:

> Hi,
>
> Using math.log has a disadvantage; it is less accurate.
>
> sage: print n(math.log(2),100)
> sage: print n(log(2),100)
> 0.69314718055994528622676398300
> 0.69314718055994530941723212146

Yes, it is. Accuracy vs. speed is a common tradeoff one needs to make.

If you're going for a numerical answer, log(2).n(1000) will give you  
1000 bits of precision. Adjust as you see fit for your application.

- 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: sage -t

2009-09-01 Thread Jan Groenewald

Hi All,

I have a system-wide sage install for all users.
The source lives in /usr/local/src and all of it is owned
by root.root. I chown it after install so that it does not 
have another user's permissions.  A user had this problem:

On Tue, Sep 01, 2009 at 02:41:54PM +0200, Dirk Laurie wrote:
> d...@birlehlou:~/.sage$ sage -t dpl.sage 
> init.sage does not exist ... creating
> Traceback (most recent call last):
>   File "/usr/local/src/sage-4.1.1/local/bin/sage-test", line 49, in 
> os.makedirs(TMP)
>   File "/usr/local/src/sage-4.1.1/local/lib/python/os.py", line 157, in 
> makedirs
> mkdir(name, mode)
> OSError: [Errno 13] Permission denied: '/usr/local/src/sage-4.1.1/tmp/tmp'
> d...@birlehlou:~/.sage$ sudo sage -t dpl.sage 
> [sudo] password for dirk: 
> Sorry, try again.
> [sudo] password for dirk: 
> dirk is not in the sudoers file.  This incident will be reported.

Is "sage -t" used for testing one's own code?
Should /usr/local/src/sage-4.1.1/tmp/tmp be world-writeable? 
Is there then any control on the space used?

regards,
Jan

-- 
   .~. 
   /V\ Jan Groenewald
  /( )\www.aims.ac.za
  ^^-^^ 

--~--~-~--~~~---~--~~
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] Problem with Notebook

2009-09-01 Thread Koch Peer-Joachim
Hi,

we are running a sage notebook on a pc in our network.  Sage is running
under a dedicated uid.
We had to restart the server and I've restarted sage and the notebook.
However all worksheets are now gone. All the files seem's to be there, but
nothing
is shown after a restart.

What must be done to use the old worksheets ?

Bye, Peer

(running sage 4.1 under X86_64)

--~--~-~--~~~---~--~~
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: Problem with Notebook

2009-09-01 Thread William Stein
On Tue, Sep 1, 2009 at 7:29 AM, Koch Peer-Joachim <
koch.peerjoac...@googlemail.com> wrote:

> Hi,
>
> we are running a sage notebook on a pc in our network.  Sage is running
> under a dedicated uid.
> We had to restart the server and I've restarted sage and the notebook.
> However all worksheets are now gone. All the files seem's to be there, but
> nothing
> is shown after a restart.
>
> What must be done to use the old worksheets ?
>

When you restarted the notebook did you use *exactly* the same command?
When you say "all the files seems to be there", where exactly is "there"?
How many worksheets are there?



>
> Bye, Peer
>
> (running sage 4.1 under X86_64)
>
> >
>


-- 
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] Maxima Solve sys

2009-09-01 Thread Mikie

Here is function I am using to solve systems of linear equations.

def MSolveSys(syss):
   eqns=eval(syss)
   solns=maxima.solve(syss)
   return solns

Works great in the notebook, but when I put it in a Python script it
rounds the coeficients of the variables and thus produces bad
solutions.

Is it possible to fix it?
Thanx
--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Robert Bradshaw

On Sep 1, 2009, at 9:17 AM, Mikie wrote:

>
> Here is function I am using to solve systems of linear equations.
>
> def MSolveSys(syss):
>eqns=eval(syss)
>solns=maxima.solve(syss)
>return solns
>
> Works great in the notebook, but when I put it in a Python script it
> rounds the coeficients of the variables and thus produces bad
> solutions.

Perhaps eval here is the culprit. You might have to parse it a bit  
yourself. SR("...") will parse expressions.

- 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: A weird exception?

2009-09-01 Thread Rolandb



On 1 sep, 11:08, Robert Bradshaw  wrote:
> On Aug 29, 2009, at 11:05 PM, Rolandb wrote:
>
> > Hi,
>
> > Using math.log has a disadvantage; it is less accurate.
>
> > sage: print n(math.log(2),100)
> > sage: print n(log(2),100)
> > 0.69314718055994528622676398300
> > 0.69314718055994530941723212146
>
> Yes, it is. Accuracy vs. speed is a common tradeoff one needs to make.
>
> If you're going for a numerical answer, log(2).n(1000) will give you  
> 1000 bits of precision. Adjust as you see fit for your application.
>
> - Robert

Hi Robert,

I tested several solutions and I found that there is a much better
approach.

def expon1(mx,g): return int(ln(mx)/ln(g))+1
def expon2(mx,g): return floor(log(mx)/log(g))+1
def expon3(mx,g): return floor(ln(mx)/ln(g))+1
def expon4(mx,g): return floor(math.log(mx)/math.log(g))+1
def expon5(mx,g): return floor(n(log(mx),100)/n(log(g),100))+1

def expon6(mx,g):
if g>mx: return 1
k=0
m=g
while m*g<=mx:
m=m*g
k+=1
return k+2

1. 625 loops, best of 3: 1.15 ms per loop
2. 625 loops, best of 3: 998 µs per loop
3. 625 loops, best of 3: 993 µs per loop
4. 625 loops, best of 3: 6.77 µs per loop
5. 625 loops, best of 3: 696 µs per loop
6. 625 loops, best of 3: 7.71 µs per loop

Roland

The last method is best, although I didn't expected it to be.

--~--~-~--~~~---~--~~
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: A weird exception?

2009-09-01 Thread Robert Bradshaw

On Sep 1, 2009, at 9:23 AM, Rolandb wrote:

> On 1 sep, 11:08, Robert Bradshaw  wrote:
>> On Aug 29, 2009, at 11:05 PM, Rolandb wrote:
>>
>>> Hi,
>>
>>> Using math.log has a disadvantage; it is less accurate.
>>
>>> sage: print n(math.log(2),100)
>>> sage: print n(log(2),100)
>>> 0.69314718055994528622676398300
>>> 0.69314718055994530941723212146
>>
>> Yes, it is. Accuracy vs. speed is a common tradeoff one needs to  
>> make.
>>
>> If you're going for a numerical answer, log(2).n(1000) will give you
>> 1000 bits of precision. Adjust as you see fit for your application.
>>
>> - Robert
>
> Hi Robert,
>
> I tested several solutions and I found that there is a much better
> approach.
>
> def expon1(mx,g): return int(ln(mx)/ln(g))+1
> def expon2(mx,g): return floor(log(mx)/log(g))+1
> def expon3(mx,g): return floor(ln(mx)/ln(g))+1
> def expon4(mx,g): return floor(math.log(mx)/math.log(g))+1
> def expon5(mx,g): return floor(n(log(mx),100)/n(log(g),100))+1

Note that these may or may not be right, depending on rounding issues.

>
> def expon6(mx,g):
> if g>mx: return 1
> k=0
> m=g
> while m*g<=mx:
> m=m*g
> k+=1
> return k+2
>
> 1. 625 loops, best of 3: 1.15 ms per loop
> 2. 625 loops, best of 3: 998 µs per loop
> 3. 625 loops, best of 3: 993 µs per loop
> 4. 625 loops, best of 3: 6.77 µs per loop
> 5. 625 loops, best of 3: 696 µs per loop
> 6. 625 loops, best of 3: 7.71 µs per loop
>
> Roland
>
> The last method is best, although I didn't expected it to be.

You might want to check out Integer.exact_log()

- 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: A weird exception?

2009-09-01 Thread William Stein
On Tue, Sep 1, 2009 at 9:23 AM, Rolandb  wrote:

>
>
>
> On 1 sep, 11:08, Robert Bradshaw  wrote:
> > On Aug 29, 2009, at 11:05 PM, Rolandb wrote:
> >
> > > Hi,
> >
> > > Using math.log has a disadvantage; it is less accurate.
> >
> > > sage: print n(math.log(2),100)
> > > sage: print n(log(2),100)
> > > 0.69314718055994528622676398300
> > > 0.69314718055994530941723212146
> >
> > Yes, it is. Accuracy vs. speed is a common tradeoff one needs to make.
> >
> > If you're going for a numerical answer, log(2).n(1000) will give you
> > 1000 bits of precision. Adjust as you see fit for your application.
> >
> > - Robert
>
> Hi Robert,
>
> I tested several solutions and I found that there is a much better
> approach.
>
> def expon1(mx,g): return int(ln(mx)/ln(g))+1
> def expon2(mx,g): return floor(log(mx)/log(g))+1
> def expon3(mx,g): return floor(ln(mx)/ln(g))+1
> def expon4(mx,g): return floor(math.log(mx)/math.log(g))+1
> def expon5(mx,g): return floor(n(log(mx),100)/n(log(g),100))+1
>
> def expon6(mx,g):
>if g>mx: return 1
>k=0
>m=g
>while m*g<=mx:
>m=m*g
>k+=1
>return k+2
>
> 1. 625 loops, best of 3: 1.15 ms per loop
> 2. 625 loops, best of 3: 998 µs per loop
> 3. 625 loops, best of 3: 993 µs per loop
> 4. 625 loops, best of 3: 6.77 µs per loop
> 5. 625 loops, best of 3: 696 µs per loop
> 6. 625 loops, best of 3: 7.71 µs per loop
>
> Roland
>
> The last method is best, although I didn't expected it to be.
>

If you are really computing floor(log(a,b)) with a,b integers, you should
use the exact_log function.   It will blow away anything you are doing
above, e.g.,:

sage: timeit('expon6(256,2)')
625 loops, best of 3: 7.03 µs per loop
sage: timeit('256.exact_log(2)')
625 loops, best of 3: 616 ns per loop


Note that exact_log is a method on Sage integers, so you have to do
a.exact_log(b).  Make sure to read a=5; a.exact_log? to make sure it does
what you want.   You can also do a.exact_log?? to appreciate the nontrivial
code David Harvey wrote to make exact_log very fast and correct.
 --
William

--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Jason Grout

Mikie wrote:
> Here is function I am using to solve systems of linear equations.
> 
> def MSolveSys(syss):
>eqns=eval(syss)
>solns=maxima.solve(syss)
>return solns
> 
> Works great in the notebook, but when I put it in a Python script it
> rounds the coeficients of the variables and thus produces bad
> solutions.
> 
> Is it possible to fix it?


Can you post a complete example (with the equations you are using and
the call to MSolveSys) that we can paste into our sage session to see
this problem?

Thanks,

Jason


-- 
Jason Grout


--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Jason Grout

Robert Bradshaw wrote:
> On Sep 1, 2009, at 9:17 AM, Mikie wrote:
> 
>> Here is function I am using to solve systems of linear equations.
>>
>> def MSolveSys(syss):
>>eqns=eval(syss)
>>solns=maxima.solve(syss)
>>return solns
>>
>> Works great in the notebook, but when I put it in a Python script it
>> rounds the coeficients of the variables and thus produces bad
>> solutions.
> 
> Perhaps eval here is the culprit. You might have to parse it a bit  
> yourself. SR("...") will parse expressions.
> 

Mikie effectively isn't using "eval", right?  That line (and the "eqns" 
variable) is not being used.

Jason



-- 
Jason Grout


--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Mikie

Sorry, wrong function

def MSolveSys(syss):
   eqns=eval(syss)
   solns=maxima.solve(eqns)
   return solns

On Sep 1, 10:31 am, Jason Grout  wrote:
> Robert Bradshaw wrote:
> > On Sep 1, 2009, at 9:17 AM, Mikie wrote:
>
> >> Here is function I am using to solve systems of linear equations.
>
> >> def MSolveSys(syss):
> >>    eqns=eval(syss)
> >>    solns=maxima.solve(syss)
> >>    return solns
>
> >> Works great in the notebook, but when I put it in a Python script it
> >> rounds the coeficients of the variables and thus produces bad
> >> solutions.
>
> > Perhaps eval here is the culprit. You might have to parse it a bit  
> > yourself. SR("...") will parse expressions.
>
> Mikie effectively isn't using "eval", right?  That line (and the "eqns"
> variable) is not being used.
>
> Jason
>
> --
> Jason Grout- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Mikie

When I run the server with the function above and the following string
from a text box I get
[y=-1,x=0].  The string is "[3*x-y-1,x+(1/3)*y]"

It is changing the input value to [3*x-y-1,x]

On Sep 1, 10:38 am, Mikie  wrote:
> Sorry, wrong function
>
> def MSolveSys(syss):
>    eqns=eval(syss)
>    solns=maxima.solve(eqns)
>    return solns
>
> On Sep 1, 10:31 am, Jason Grout  wrote:
>
>
>
> > Robert Bradshaw wrote:
> > > On Sep 1, 2009, at 9:17 AM, Mikie wrote:
>
> > >> Here is function I am using to solve systems of linear equations.
>
> > >> def MSolveSys(syss):
> > >>    eqns=eval(syss)
> > >>    solns=maxima.solve(syss)
> > >>    return solns
>
> > >> Works great in the notebook, but when I put it in a Python script it
> > >> rounds the coeficients of the variables and thus produces bad
> > >> solutions.
>
> > > Perhaps eval here is the culprit. You might have to parse it a bit  
> > > yourself. SR("...") will parse expressions.
>
> > Mikie effectively isn't using "eval", right?  That line (and the "eqns"
> > variable) is not being used.
>
> > Jason
>
> > --
> > Jason Grout- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Robert Bradshaw
On Tue, 1 Sep 2009, Mikie wrote:

>
> When I run the server with the function above and the following string
> from a text box I get
> [y=-1,x=0].  The string is "[3*x-y-1,x+(1/3)*y]"
>
> It is changing the input value to [3*x-y-1,x]

1/3 = 0 in Python. Also, I hope you realize how dangerous

eval("random string someone gave you from the web") is!

- Robert

>
> On Sep 1, 10:38 am, Mikie  wrote:
>> Sorry, wrong function
>>
>> def MSolveSys(syss):
>>    eqns=eval(syss)
>>    solns=maxima.solve(eqns)
>>    return solns
>>
>> On Sep 1, 10:31 am, Jason Grout  wrote:
>>
>>
>>
>>> Robert Bradshaw wrote:
 On Sep 1, 2009, at 9:17 AM, Mikie wrote:
>>
> Here is function I am using to solve systems of linear equations.
>>
> def MSolveSys(syss):
>    eqns=eval(syss)
>    solns=maxima.solve(syss)
>    return solns
>>
> Works great in the notebook, but when I put it in a Python script it
> rounds the coeficients of the variables and thus produces bad
> solutions.
>>
 Perhaps eval here is the culprit. You might have to parse it a bit  
 yourself. SR("...") will parse expressions.
>>
>>> Mikie effectively isn't using "eval", right?  That line (and the "eqns"
>>> variable) is not being used.
>>
>>> Jason
>>
>>> --
>>> Jason Grout- Hide quoted text -
>>
>>> - Show quoted text -- Hide quoted text -
>>
>> - Show quoted text -
> >
>
--~--~-~--~~~---~--~~
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] please, help on installation

2009-09-01 Thread Afonso Henriques Silva Leite

I downloaded sage-4.1.1-linux-Ubuntu_9.04-i686-Linux.tar.gz to my
desktop and untar it there. My experience with linux is a little
limited.
The readme file says that if a binary file was downloaded, it was only
necessary to print ./sage command to get things ok, but it wasn't that
easy.
When I use this command, i get
--
| Sage Version 4.1.1, Release Date: 2009-08-14   |
| Type notebook() for the GUI, and license() for information.|
--
/home/portuga/Desktop/sage/sage-4.1.1-linux-Ubuntu_9.04-i686-Linux/local/bin/sage-sage:
 line 199:  7558 Illegal instruction sage-ipython "$@" -i

I tried then a make command, but didn't work out either.
I need a lot more information than these read me files...


--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Mikie

I have tried SR.  I get a malformed value.  Yes, I understand the
problem with eval.  Do you have any suggestions on how to get the
right value into maxima.solve?

On Sep 1, 11:32 am, Robert Bradshaw 
wrote:
> On Tue, 1 Sep 2009, Mikie wrote:
>
> > When I run the server with the function above and the following string
> > from a text box I get
> > [y=-1,x=0].  The string is "[3*x-y-1,x+(1/3)*y]"
>
> > It is changing the input value to [3*x-y-1,x]
>
> 1/3 = 0 in Python. Also, I hope you realize how dangerous
>
> eval("random string someone gave you from the web") is!
>
> - Robert
>
>
>
>
>
> > On Sep 1, 10:38 am, Mikie  wrote:
> >> Sorry, wrong function
>
> >> def MSolveSys(syss):
> >>    eqns=eval(syss)
> >>    solns=maxima.solve(eqns)
> >>    return solns
>
> >> On Sep 1, 10:31 am, Jason Grout  wrote:
>
> >>> Robert Bradshaw wrote:
>  On Sep 1, 2009, at 9:17 AM, Mikie wrote:
>
> > Here is function I am using to solve systems of linear equations.
>
> > def MSolveSys(syss):
> >    eqns=eval(syss)
> >    solns=maxima.solve(syss)
> >    return solns
>
> > Works great in the notebook, but when I put it in a Python script it
> > rounds the coeficients of the variables and thus produces bad
> > solutions.
>
>  Perhaps eval here is the culprit. You might have to parse it a bit  
>  yourself. SR("...") will parse expressions.
>
> >>> Mikie effectively isn't using "eval", right?  That line (and the "eqns"
> >>> variable) is not being used.
>
> >>> Jason
>
> >>> --
> >>> Jason Grout- Hide quoted text -
>
> >>> - Show quoted text -- Hide quoted text -
>
> >> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Mikie

Yes, Robert eval is doing the rounding.  How do I fix it?

On Sep 1, 12:31 pm, Mikie  wrote:
> I have tried SR.  I get a malformed value.  Yes, I understand the
> problem with eval.  Do you have any suggestions on how to get the
> right value into maxima.solve?
>
> On Sep 1, 11:32 am, Robert Bradshaw 
> wrote:
>
>
>
> > On Tue, 1 Sep 2009, Mikie wrote:
>
> > > When I run the server with the function above and the following string
> > > from a text box I get
> > > [y=-1,x=0].  The string is "[3*x-y-1,x+(1/3)*y]"
>
> > > It is changing the input value to [3*x-y-1,x]
>
> > 1/3 = 0 in Python. Also, I hope you realize how dangerous
>
> > eval("random string someone gave you from the web") is!
>
> > - Robert
>
> > > On Sep 1, 10:38 am, Mikie  wrote:
> > >> Sorry, wrong function
>
> > >> def MSolveSys(syss):
> > >>    eqns=eval(syss)
> > >>    solns=maxima.solve(eqns)
> > >>    return solns
>
> > >> On Sep 1, 10:31 am, Jason Grout  wrote:
>
> > >>> Robert Bradshaw wrote:
> >  On Sep 1, 2009, at 9:17 AM, Mikie wrote:
>
> > > Here is function I am using to solve systems of linear equations.
>
> > > def MSolveSys(syss):
> > >    eqns=eval(syss)
> > >    solns=maxima.solve(syss)
> > >    return solns
>
> > > Works great in the notebook, but when I put it in a Python script it
> > > rounds the coeficients of the variables and thus produces bad
> > > solutions.
>
> >  Perhaps eval here is the culprit. You might have to parse it a bit  
> >  yourself. SR("...") will parse expressions.
>
> > >>> Mikie effectively isn't using "eval", right?  That line (and the "eqns"
> > >>> variable) is not being used.
>
> > >>> Jason
>
> > >>> --
> > >>> Jason Grout- Hide quoted text -
>
> > >>> - Show quoted text -- Hide quoted text -
>
> > >> - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Mikie

I took out the eval and for some reason it is working.
Robert, this is function in my API (AlgCalc)
http://pirsqrt.com:1843/
If I would give it to you would you show me how to get JSmath to
work?  I have talked to you before.  You said you were too busy.  I
have loaded load.js, but when it goes for another .js file it cannot
find.

On Sep 1, 12:37 pm, Mikie  wrote:
> Yes, Robert eval is doing the rounding.  How do I fix it?
>
> On Sep 1, 12:31 pm, Mikie  wrote:
>
>
>
> > I have tried SR.  I get a malformed value.  Yes, I understand the
> > problem with eval.  Do you have any suggestions on how to get the
> > right value into maxima.solve?
>
> > On Sep 1, 11:32 am, Robert Bradshaw 
> > wrote:
>
> > > On Tue, 1 Sep 2009, Mikie wrote:
>
> > > > When I run the server with the function above and the following string
> > > > from a text box I get
> > > > [y=-1,x=0].  The string is "[3*x-y-1,x+(1/3)*y]"
>
> > > > It is changing the input value to [3*x-y-1,x]
>
> > > 1/3 = 0 in Python. Also, I hope you realize how dangerous
>
> > > eval("random string someone gave you from the web") is!
>
> > > - Robert
>
> > > > On Sep 1, 10:38 am, Mikie  wrote:
> > > >> Sorry, wrong function
>
> > > >> def MSolveSys(syss):
> > > >>    eqns=eval(syss)
> > > >>    solns=maxima.solve(eqns)
> > > >>    return solns
>
> > > >> On Sep 1, 10:31 am, Jason Grout  wrote:
>
> > > >>> Robert Bradshaw wrote:
> > >  On Sep 1, 2009, at 9:17 AM, Mikie wrote:
>
> > > > Here is function I am using to solve systems of linear equations.
>
> > > > def MSolveSys(syss):
> > > >    eqns=eval(syss)
> > > >    solns=maxima.solve(syss)
> > > >    return solns
>
> > > > Works great in the notebook, but when I put it in a Python script it
> > > > rounds the coeficients of the variables and thus produces bad
> > > > solutions.
>
> > >  Perhaps eval here is the culprit. You might have to parse it a bit  
> > >  yourself. SR("...") will parse expressions.
>
> > > >>> Mikie effectively isn't using "eval", right?  That line (and the 
> > > >>> "eqns"
> > > >>> variable) is not being used.
>
> > > >>> Jason
>
> > > >>> --
> > > >>> Jason Grout- Hide quoted text -
>
> > > >>> - Show quoted text -- Hide quoted text -
>
> > > >> - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: please, help on installation

2009-09-01 Thread David Joyner

On Tue, Sep 1, 2009 at 3:18 PM, Afonso Henriques Silva
Leite wrote:
>
> I downloaded sage-4.1.1-linux-Ubuntu_9.04-i686-Linux.tar.gz to my
> desktop and untar it there. My experience with linux is a little
> limited.

...

> I need a lot more information than these read me files...
>

Can you compile from source using the instructions at
http://www.sagemath.org/doc/installation/source.html ?


>
> >
>

--~--~-~--~~~---~--~~
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] Trouble with Greek characters

2009-09-01 Thread linuxgus

Hello all.

Here is a simple three-liner in notebook:

r=var('rho')
A=matrix(2,[sqrt(3), 1, -1, sqrt(3)])/2
R=matrix(2,[1,r,r,1])
show(  simplify(expand(A*R*A.transpose()))  )

It does the math correctly, but instead of displaying actual rhos
( ρ ) in the final matrix, it displays accented capital Us ( Ú ).
What am I doing wrong?

TIA for your time.

--~--~-~--~~~---~--~~
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: please, help on installation

2009-09-01 Thread Minh Nguyen

Hi Afonso,

On Wed, Sep 2, 2009 at 5:18 AM, Afonso Henriques Silva
Leite wrote:
>
> I downloaded sage-4.1.1-linux-Ubuntu_9.04-i686-Linux.tar.gz to my
> desktop and untar it there. My experience with linux is a little
> limited.
> The readme file says that if a binary file was downloaded, it was only
> necessary to print ./sage command to get things ok, but it wasn't that
> easy.
> When I use this command, i get
> --
> | Sage Version 4.1.1, Release Date: 2009-08-14   |
> | Type notebook() for the GUI, and license() for information.|
> --
> /home/portuga/Desktop/sage/sage-4.1.1-linux-Ubuntu_9.04-i686-Linux/local/bin/sage-sage:
>  line 199:  7558 Illegal instruction sage-ipython "$@" -i

This usually comes up because MPIR and ATLAS were built on a machine
different from yours. David recommended compiling everything from
source, which can take a few hours depending on your hardware. Another
option is to recompile only MPIR and ATLAS. You can do this:

$ cd /home/portuga/Desktop/sage/sage-4.1.1-linux-Ubuntu_9.04-i686-Linux/
$ ./sage -f mpir
$ ./sage -f atlas

This would take some time to complete, especially because ATLAS can
take a long time to tune itself for your specific hardware.

-- 
Regards
Minh Van Nguyen

--~--~-~--~~~---~--~~
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: Trouble with Greek characters

2009-09-01 Thread John H Palmieri

On Sep 1, 5:19 pm, linuxgus  wrote:
> Hello all.
>
> Here is a simple three-liner in notebook:
>
> r=var('rho')
> A=matrix(2,[sqrt(3), 1, -1, sqrt(3)])/2
> R=matrix(2,[1,r,r,1])
> show(  simplify(expand(A*R*A.transpose()))  )
>
> It does the math correctly, but instead of displaying actual rhos
> ( ρ ) in the final matrix, it displays accented capital Us ( Ú ).

I see the right thing on my mac (Mac OS X 10.5, Sage 4.1.1, Safari or
Firefox).

> What am I doing wrong?

You're not telling us your operating system, browser, and version of
Sage.

--~--~-~--~~~---~--~~
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: please, help on installation

2009-09-01 Thread Afonso Henriques Silva Leite

Thanks in advance! I will try this tomorrow.

On Tue, 2009-09-01 at 17:23 -0400, David Joyner wrote:
> On Tue, Sep 1, 2009 at 3:18 PM, Afonso Henriques Silva
> Leite wrote:
> >
> > I downloaded sage-4.1.1-linux-Ubuntu_9.04-i686-Linux.tar.gz to my
> > desktop and untar it there. My experience with linux is a little
> > limited.
> 
> ...
> 
> > I need a lot more information than these read me files...
> >
> 
> Can you compile from source using the instructions at
> http://www.sagemath.org/doc/installation/source.html ?
> 
> 
> >
> > >
> >
> 
> > 


--~--~-~--~~~---~--~~
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: please, help on installation

2009-09-01 Thread Afonso Henriques Silva Leite

Ok mr. Nguyen. I will try it. Thank you.

On Wed, 2009-09-02 at 10:21 +1000, Minh Nguyen wrote:
> Hi Afonso,
> 
> On Wed, Sep 2, 2009 at 5:18 AM, Afonso Henriques Silva
> Leite wrote:
> >
> > I downloaded sage-4.1.1-linux-Ubuntu_9.04-i686-Linux.tar.gz to my
> > desktop and untar it there. My experience with linux is a little
> > limited.
> > The readme file says that if a binary file was downloaded, it was only
> > necessary to print ./sage command to get things ok, but it wasn't that
> > easy.
> > When I use this command, i get
> > --
> > | Sage Version 4.1.1, Release Date: 2009-08-14   |
> > | Type notebook() for the GUI, and license() for information.|
> > --
> > /home/portuga/Desktop/sage/sage-4.1.1-linux-Ubuntu_9.04-i686-Linux/local/bin/sage-sage:
> >  line 199:  7558 Illegal instruction sage-ipython "$@" -i
> 
> This usually comes up because MPIR and ATLAS were built on a machine
> different from yours. David recommended compiling everything from
> source, which can take a few hours depending on your hardware. Another
> option is to recompile only MPIR and ATLAS. You can do this:
> 
> $ cd /home/portuga/Desktop/sage/sage-4.1.1-linux-Ubuntu_9.04-i686-Linux/
> $ ./sage -f mpir
> $ ./sage -f atlas
> 
> This would take some time to complete, especially because ATLAS can
> take a long time to tune itself for your specific hardware.
> 


--~--~-~--~~~---~--~~
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: sage -t

2009-09-01 Thread Minh Nguyen

Hi Jan,

On Tue, Sep 1, 2009 at 11:37 PM, Jan Groenewald wrote:



> Is "sage -t" used for testing one's own code?

Yes.


> Should /usr/local/src/sage-4.1.1/tmp/tmp be world-writeable?

No since from a security point of view you don't want regular users to
write anything there. Think of that tmp directory as being for the
root user or anyone in the sudoer group to write temporary stuff. By
default, testing your custom Sage script with

sage -t /path/to/my/script.sage

using a system-wide Sage installation would result in a permission
error. If you want to test your own Sage script, you can install Sage
under your own home directory or test the script as root or using
sudo.

> Is there then any control on the space used?

I don't understand this question.

-- 
Regards
Minh Van Nguyen

--~--~-~--~~~---~--~~
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: Trouble with Greek characters

2009-09-01 Thread Jason Grout

linuxgus wrote:
> Hello all.
> 
> Here is a simple three-liner in notebook:
> 
> r=var('rho')
> A=matrix(2,[sqrt(3), 1, -1, sqrt(3)])/2
> R=matrix(2,[1,r,r,1])
> show(  simplify(expand(A*R*A.transpose()))  )
> 
> It does the math correctly, but instead of displaying actual rhos
> ( ρ ) in the final matrix, it displays accented capital Us ( Ú ).
> What am I doing wrong?
> 


Let me guess: you're running this in Firefox 3.5 on linux, using the 
jsmath tex fonts, right?

You need to download the new jsmath fonts for firefox 3.5 here: 
http://www.math.union.edu/~dpvc/jsMath/download/TeX-fonts-linux.tgz

Delete the ones you currently have installed and replace it with these. 
  Alternatively, if you have ubuntu, I believe the new fonts are in the 
most current version of the jsmath ttfonts package.

Thanks,

Jason



-- 
Jason Grout


--~--~-~--~~~---~--~~
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: sage -t

2009-09-01 Thread William A. Stein


On Sep 1, 2009, at 6:24 PM, Minh Nguyen wrote:

>
> Hi Jan,
>
> On Tue, Sep 1, 2009 at 11:37 PM, Jan Groenewald wrote:
>
> 
>
>> Is "sage -t" used for testing one's own code?
>
> Yes.
>
>
>> Should /usr/local/src/sage-4.1.1/tmp/tmp be world-writeable?
>
> No since from a security point of view you don't want regular users to
> write anything there. Think of that tmp directory as being for the
> root user or anyone in the sudoer group to write temporary stuff. By
> default, testing your custom Sage script with
>
> sage -t /path/to/my/script.sage
>
> using a system-wide Sage installation would result in a permission
> error. If you want to test your own Sage script, you can install Sage
> under your own home directory or test the script as root or using
> sudo.


Note that this should be considered a workaround.  It should be  
considered a bug that users without write permissions to the Sage  
install directory can't test their scripts.

It would be much better for Sage to use temp space in DOT_SAGE, i.e.,  
$HOME/.sage/temp by default.

William

>
>> Is there then any control on the space used?
>
> I don't understand this question.
>
> -- 
> Regards
> Minh Van Nguyen
>
> >


--~--~-~--~~~---~--~~
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] Problem with simplify

2009-09-01 Thread Mani chandra

Hi,

There seems to be some issue with "simplify" when used in the 
following manner:

sage: var('x, a, b')
(x, a, b)
sage: x = a + I*b
sage: x.conjugate()
conjugate(a) - I*conjugate(b)
sage: x.conjugate().simplify()
a - I*b

Aren't (a, b) complex by default?, then why is SAGE giving out a - I*b 
when I say  x.conjugate().simplify() but conjugate(a) - I*conjugate(b) 
when only x.conjugate() is called?

Thanks,
Mani chandra

--~--~-~--~~~---~--~~
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: Problem with simplify

2009-09-01 Thread Mani chandra

Mani chandra wrote:
> Hi,
>
> There seems to be some issue with "simplify" when used in the 
> following manner:
>
> sage: var('x, a, b')
> (x, a, b)
> sage: x = a + I*b
> sage: x.conjugate()
> conjugate(a) - I*conjugate(b)
> sage: x.conjugate().simplify()
> a - I*b
>
> Aren't (a, b) complex by default?, then why is SAGE giving out a - I*b 
> when I say  x.conjugate().simplify() but conjugate(a) - I*conjugate(b) 
> when only x.conjugate() is called?
>
> Thanks,
> Mani chandra
>
> >
>
>   
Another problem:

sage: x = a + I*b
sage: real(x.conjugate().simplify())
real_part(a) + imag_part(b)
sage: real(x.conjugate())
real_part(a) - imag_part(b)

Something definately seems to be wrong here.

--Mani chandra



--~--~-~--~~~---~--~~
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: sage -t

2009-09-01 Thread Jan Groenewald

Hi

On Wed, Sep 02, 2009 at 11:24:25AM +1000, Minh Nguyen wrote:
> > Is there then any control on the space used?

If they did have write (unadvisable) they could fill the disk
space with logs.

Jan

-- 
   .~. 
   /V\ Jan Groenewald
  /( )\www.aims.ac.za
  ^^-^^ 

--~--~-~--~~~---~--~~
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: sage -t

2009-09-01 Thread Jan Groenewald

Hi

On Tue, Sep 01, 2009 at 06:33:59PM -0700, William A. Stein wrote:
> Note that this should be considered a workaround.  It should be  
> considered a bug that users without write permissions to the Sage  
> install directory can't test their scripts.
> It would be much better for Sage to use temp space in DOT_SAGE, i.e.,  
> $HOME/.sage/temp by default.  

Is there a ticket to fix this? .sage sounds good.

Quickly building a local sage is not even a workaround, it is not feasible.
I know the single user, so will change permissions on the directory in the
syste-wide install. It will only affect the local desktop, out of 127 
desktops imaged from a central image.

Every time I image it will be overwritten. I can exclude it, but it is probably
better to clear it periodically. Is anything written there important to keep?

regards,
Jan


-- 
   .~. 
   /V\ Jan Groenewald
  /( )\www.aims.ac.za
  ^^-^^ 

--~--~-~--~~~---~--~~
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: plotting and float

2009-09-01 Thread William Cauchois

It seems to me that the error comes from feeding a function which uses
i into fast_float (called by the plotting functions to compile the
function to be plotted into an optimized form). I tried a simpler
function using i and got the same error:

sage: plot3d(x + y + i, (x, 0, 1), (y, 0, 1))
Traceback (click to the left for traceback)
...
TypeError: float() argument must be a string or a number
sage: from sage.ext.fast_eval import fast_float
sage: fast_float(x + i, 'x')
Traceback (click to the left for traceback)
...
TypeError: float() argument must be a string or a number

It would make sense for the low-level representation used by
fast_float not to include a concept of imaginary numbers. Have you had
success plotting any other functions that use imaginary numbers? There
should be a mechanism to fall back to using the unmodified function in
the event that fast_float fails to convert the function.

--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Robert Bradshaw

On Sep 1, 2009, at 12:16 PM, Mikie wrote:

> I took out the eval and for some reason it is working.
> Robert, this is function in my API (AlgCalc)
> http://pirsqrt.com:1843/
> If I would give it to you would you show me how to get JSmath to
> work?  I have talked to you before.  You said you were too busy.  I
> have loaded load.js, but when it goes for another .js file it cannot
> find.

You're probably thinking about another Robert--I don't know anything  
about jsmath. What I would do is look for instructions on their site.

- Robert (Bradshaw)

>
> On Sep 1, 12:37 pm, Mikie  wrote:
>> Yes, Robert eval is doing the rounding.  How do I fix it?
>>
>> On Sep 1, 12:31 pm, Mikie  wrote:
>>
>>
>>
>>> I have tried SR.  I get a malformed value.  Yes, I understand the
>>> problem with eval.  Do you have any suggestions on how to get the
>>> right value into maxima.solve?
>>
>>> On Sep 1, 11:32 am, Robert Bradshaw 
>>> wrote:
>>
 On Tue, 1 Sep 2009, Mikie wrote:
>>
> When I run the server with the function above and the following  
> string
> from a text box I get
> [y=-1,x=0].  The string is "[3*x-y-1,x+(1/3)*y]"
>>
> It is changing the input value to [3*x-y-1,x]
>>
 1/3 = 0 in Python. Also, I hope you realize how dangerous
>>
 eval("random string someone gave you from the web") is!
>>
 - Robert
>>
> On Sep 1, 10:38 am, Mikie  wrote:
>> Sorry, wrong function
>>
>> def MSolveSys(syss):
>>eqns=eval(syss)
>>solns=maxima.solve(eqns)
>>return solns
>>
>> On Sep 1, 10:31 am, Jason Grout   
>> wrote:
>>
>>> Robert Bradshaw wrote:
 On Sep 1, 2009, at 9:17 AM, Mikie wrote:
>>
> Here is function I am using to solve systems of linear  
> equations.
>>
> def MSolveSys(syss):
>eqns=eval(syss)
>solns=maxima.solve(syss)
>return solns
>>
> Works great in the notebook, but when I put it in a Python  
> script it
> rounds the coeficients of the variables and thus produces bad
> solutions.
>>
 Perhaps eval here is the culprit. You might have to parse it  
 a bit
 yourself. SR("...") will parse expressions.
>>
>>> Mikie effectively isn't using "eval", right?  That line (and  
>>> the "eqns"
>>> variable) is not being used.
>>
>>> Jason
>>
>>> --
>>> Jason Grout- Hide quoted text -
>>
>>> - Show quoted text -- Hide quoted text -
>>
>> - Show quoted text -- Hide quoted text -
>>
 - Show quoted text -- Hide quoted text -
>>
>>> - Show quoted text -- Hide quoted text -
>>
>> - Show quoted text -
> >


--~--~-~--~~~---~--~~
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: sage -t

2009-09-01 Thread Minh Nguyen

Hi Jan,

On Wed, Sep 2, 2009 at 2:31 PM, Jan Groenewald wrote:



> Is there a ticket to fix this? .sage sounds good.

This issue is now ticket #6861

http://trac.sagemath.org/sage_trac/ticket/6861

-- 
Regards
Minh Van Nguyen

--~--~-~--~~~---~--~~
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: Trouble with Greek characters

2009-09-01 Thread linuxgus

Thank you, Jason!  Your guess was absolutely correct!  I am running 64-
bit Firefox 3.5.2 on Suse 11.1, with an upgraded kernel 2.6.28.

Yes, John, you are right! I forgot to mention my OS and browser.

Thanks to both of you for the help.  Replacing the jsmath fonts, per
Jason's recommendation above, fixed the problem.

Gus Fantanas



--~--~-~--~~~---~--~~
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] integrate(x^n, x) not printing correctly in notebook

2009-09-01 Thread Dan Drake
The following sequence of commands in the notebook...

x = var('x')
n = var('n')
assume(n>0)
integrate(x^n, x)

...results in "n+1" if I don't have the "Typeset" box checked, and if I
do have it checked, I sometimes get "\newcommand{\Bold}[1]{\mathbf{#1}}n
+ 1" and I sometimes get "n + 1", neatly typeset.

If I do something like "integrate(sin(n*x), x, 0, pi)", 
I get "nn" in either case (although with typesetting, the n's are
typeset).

In a terminal, everything works fine. This is with version 4.1 on
Ubuntu. What on earth is happening here?

(I am teaching some basic Fourier series stuff this semester, so I
*need* to be able to integrate stuff with sin(n*x) and cos(n*x) in the
notebook, so I can publish the worksheets for students!)

Dan

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


signature.asc
Description: Digital signature


[sage-support] Re: integrate(x^n, x) not printing correctly in notebook

2009-09-01 Thread Dan Drake
Ack! I checked with 4.1.1 and everything seems to work (except that it
won't print a pi symbol when typesetting is on, but that's not a big
deal). So move along, nothing to see here...

Dan

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


signature.asc
Description: Digital signature


[sage-support] Re: plotting and float

2009-09-01 Thread Robert Bradshaw

On Sep 1, 2009, at 8:58 PM, William Cauchois wrote:

> It seems to me that the error comes from feeding a function which uses
> i into fast_float (called by the plotting functions to compile the
> function to be plotted into an optimized form). I tried a simpler
> function using i and got the same error:
>
> sage: plot3d(x + y + i, (x, 0, 1), (y, 0, 1))
> Traceback (click to the left for traceback)
> ...
> TypeError: float() argument must be a string or a number
> sage: from sage.ext.fast_eval import fast_float
> sage: fast_float(x + i, 'x')
> Traceback (click to the left for traceback)
> ...
> TypeError: float() argument must be a string or a number
>
> It would make sense for the low-level representation used by
> fast_float not to include a concept of imaginary numbers. Have you had
> success plotting any other functions that use imaginary numbers? There
> should be a mechanism to fall back to using the unmodified function in
> the event that fast_float fails to convert the function.

The code leaves a lot to be desired. For example, now that we have  
fast_callable, with CDF support, we should be using that. Actually,  
we're using the helper function setup_for_eval_on_grid (to normalize  
the boundaries) and then ignoring the returned function, so this  
check is completely useless.

As for being a function of one or two variables, it's unclear what  
the best approach is to take here. Clearly we want to allow plotting  
complex functions of a complex variable, but the alternative is  
useful too. For functions, the number (and names) of the arguments  
they take is explicit, but for expressions like sin(z) or x+y+i it's  
not as obvious. Does the x in plot3d(x+1, ...) stand for the real  
part of the complex argument, or the entire thing? Or perhaps the  
bounds should be complex numbers defining the rectangle, like

sage: plot3d(exp(z), (z, -1-i, 1+i))

though I'm not sure I like this notation either.

- 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
-~--~~~~--~~--~--~---