Re: [sage-support] Re: Sage's running too slowly

2012-09-03 Thread David Kirkby
On 3 September 2012 04:49, Nathann Cohen  wrote:
>> Honestly I don't think it's very constructive to tell users that they
>> should install a different operating system in order to use Sage, and
>> that is basically what this dual-booting suggestion amounts to
>
>
> I totally agree with that. And I think that it is not very constructive to
> say that Sage supports windows either, when it requires users to install a
> virtual machine.
> It does not, and saying the opposite is bad avertisement.

I've had a few disagreements with Nathann before, but in this case I
agree with him. It's probably true that 99% of Windows software would
work on Linux if you run it under a virtual machine, but it's not true
to say it supports Linux.

I run 3 versions of Windows on my OpenSolaris machine  (Windows XP
64-bit, Windows XP and Windows 7). Does it really mean all the
software I run supports OpenSolaris? I would say NO.

As a matter of interest, does this sub-domain need to exist

http://windows.sagemath.org/


Dave

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] how to factorize an expression with constant variables ?

2012-09-03 Thread mazkime
Hello,
I would like to factorize an expression with sage that contains constant 
variables (i.e. parameters), but I cannot figure out how to do that.

Here is an example : x, y are variables and A is a parameter

*
var('A x y')

f = A*x + x + A^2*exp(y) + y
print (f.factor())
*

Sage returns 'A^2*e^y + A*x + x + y'.
Instead, I would like that sage returns '(A+1)*x + (A^2+1)*exp(y)'.

How to do that ?
Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Sage's running too slowly

2012-09-03 Thread Volker Braun
On Monday, September 3, 2012 4:49:05 AM UTC+1, Nathann Cohen wrote:

> It supports Windows as much as any Linux software that does not support 
>> windows -- install a virtual machine and run it inside. And it convices 
>> people that Sage is hard to install, hard to use, and slower than it 
>> actually is :-P
>
>
Given the lack of fork() on windows, running Sage in a virtual machine is 
probably faster than running it under Cygwin. Especially if you have a 
modern CPU with hardware virtualization support. Also, Cygwin is 32-bit 
only.

 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Re: Sage's running too slowly

2012-09-03 Thread David Kirkby
On 3 September 2012 08:49, Volker Braun  wrote:
> On Monday, September 3, 2012 4:49:05 AM UTC+1, Nathann Cohen wrote:
>>>
>>> It supports Windows as much as any Linux software that does not support
>>> windows -- install a virtual machine and run it inside. And it convices
>>> people that Sage is hard to install, hard to use, and slower than it
>>> actually is :-P
>
>
> Given the lack of fork() on windows, running Sage in a virtual machine is
> probably faster than running it under Cygwin. Especially if you have a
> modern CPU with hardware virtualization support. Also, Cygwin is 32-bit
> only.

I don't doubt what you say about speed on Cygwin or the fact Cygwin is
only 32-bit. But Nathann still makes valid points.

I produce software which runs on Unix and Linux, but I never claim it
works on Windows, despite the fact I'm 99.999% sure it would compile
on a virtual machine running Linux, Solaris, OpenBSD, FreeBSD, SCO or
any Unix or Unix-like system.

Dave

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Re: plot color computet by function

2012-09-03 Thread danjo86


Am Freitag, 31. August 2012 12:08:32 UTC+2 schrieb David Joyner:
>
> On Fri, Aug 31, 2012 at 4:53 AM, danjo86 
> > 
> wrote: 
> > Right! It's a remain of tryings... 
> > 
>
> Does this section help? 
> http://www.sagemath.org/doc/reference/sage/plot/colors.html 
>
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sage-support" group. 
> > To post to this group, send email to 
> > sage-s...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > sage-support...@googlegroups.com . 
> > Visit this group at http://groups.google.com/group/sage-support?hl=en. 
> > 
>
>

Hallo,

now i am sure, that i am in the position to specify my problem:

As you has seen, i have the global variables x,y. But I need that the 
plotfunction uses his own local variables. So that the point (-2,1) get the 
color mandel(-2,1).
Maybe now anyone can help me.
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: plot color computet by function

2012-09-03 Thread Jason Grout

On 9/3/12 4:43 AM, danjo86 wrote:



Am Freitag, 31. August 2012 12:08:32 UTC+2 schrieb David Joyner:

On Fri, Aug 31, 2012 at 4:53 AM, danjo86
> wrote:
 > Right! It's a remain of tryings...
 >

Does this section help?
http://www.sagemath.org/doc/reference/sage/plot/colors.html


 >
 > --
 > You received this message because you are subscribed to the
Google Groups
 > "sage-support" group.
 > To post to this group, send email to sage-s...@googlegroups.com
.
 > To unsubscribe from this group, send email to
 > sage-support...@googlegroups.com .
 > Visit this group at
http://groups.google.com/group/sage-support?hl=en
.
 >



Hallo,

now i am sure, that i am in the position to specify my problem:

As you has seen, i have the global variables x,y. But I need that the
plotfunction uses his own local variables. So that the point (-2,1) get
the color mandel(-2,1).
Maybe now anyone can help me.



I think the problem is that the rgbcolor function is not evaluated for 
every point.  It's evaluated once for the entire plot.


Instead, I think using the 2d matrix_plot [1] or density_plot [2] would 
give you the colors you want.  Or you can use complex_plot [3]


There may also be some interesting demos here for you: 
http://wiki.sagemath.org/interact/fractal


Thanks,

Jason



[1] 
http://www.sagemath.org/doc/reference/sage/plot/matrix_plot.html#sage.plot.matrix_plot.matrix_plot


[2] 
http://www.sagemath.org/doc/reference/sage/plot/density_plot.html#sage.plot.density_plot.density_plot


[3] 
http://www.sagemath.org/doc/reference/sage/plot/complex_plot.html#sage.plot.complex_plot.complex_plot


--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] how to factorize an expression with constant variables ?

2012-09-03 Thread Michael Orlitzky
On 09/03/12 03:26, mazkime wrote:
> Hello,
> I would like to factorize an expression with sage that contains constant
> variables (i.e. parameters), but I cannot figure out how to do that.
> 
> Here is an example : x, y are variables and A is a parameter
> 
> *
> var('A x y')
> 
> f = A*x + x + A^2*exp(y) + y
> print (f.factor())
> *
> 
> Sage returns 'A^2*e^y + A*x + x + y'.
> Instead, I would like that sage returns '(A+1)*x + (A^2+1)*exp(y)'.

Did you mean,

  f = A*x + x + A^2*exp(y) + exp(y)

in the input? Your desired output is not equal to f. If you did, this
can sort of be done:

  sage: A,x,y = var('A,x,y')
  sage: f = A*x + x + A^2*exp(y) + exp(y)
  sage: result = 0
  sage: basis = [x, exp(y)]
  sage: for b in basis:
  : coeff = f.collect(b).coefficient(b)
  : f -= coeff*b
  : result += coeff*b
  :
  sage: result
  (A + 1)*x + (A^2 + 1)*e^y

But it relies on collect() doing the right thing, which won't always
happen unfortunately. You may need to call expand() right before
collect() on some expressions. Others just won't work at all.

I suggest sprinkling simplify() in there, and checking that bool(f==0)
at the end so you can at least tell when it has failed (or succeeded
unprovably).

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] how to factorize an expression with constant variables ?

2012-09-03 Thread mazkime
Thank you for your answer and sorry for the typo mistake.
Your solution works well with the example given but doesn't work as I would 
like with exponents (x^2, ...).

What I would like to get is Sage returning expressions with coefficients 
sorted by the value of the exponents, like when using multivariate 
polynomial rings.

Here is an example :

*
var('x y z A B')

f = (1+B*(x+y))^((B-1)/(2*B)) * exp(z/2) / (1+(x-y)/A)

f = taylor(f,(x,0),(y,0),(z,0),2)

#this definition of a polynomial ring is useless
R. = QQ[]
R. = PolynomialRing(QQ[A,B],order='deglex')

print f
*

I want to sort the terms of a polynomial obtained with a Taylor expansion. 
I cannot declare a polynomial ring to have the terms automatically sorted 
because the initial expression is not a polynomial. I tried to ask Sage to 
switch to a polynomial ring after applying the Taylor expansion, but it 
doesn't change anyting.

What I would like to obtain is the following answer (I copied/pasted the 
solution of the Taylor expansion and I worked in a polynomial ring) :

*
R. = QQ[]
R. = PolynomialRing(QQ[A,B],order='deglex')

f = 1/2*(((B - 1)*A - 2)*x + ((B - 1)*A + 2)*y + A*z)/A + 1/8*(A^2*z^2 -
((B^2 - 1)*A^2 - 4*(B - 1)*A - 8)*y^2 - ((B^2 - 1)*A^2 + 4*(B - 1)*A -
8)*x^2 + 2*((B - 1)*A^2 + 2*A)*y*z - 2*(((B^2 - 1)*A^2 + 8)*y - ((B -
1)*A^2 - 2*A)*z)*x)/A^2 + 1

print f
*

Is there a solution to my problem ?
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] how to factorize an expression with constant variables ?

2012-09-03 Thread Michael Orlitzky
On 09/03/12 14:49, mazkime wrote:
> Thank you for your answer and sorry for the typo mistake.
> Your solution works well with the example given but doesn't work as I
> would like with exponents (x^2, ...).

Yeah it's not ideal. I needed to do this with symbolic derivatives, and
the method I posted doesn't work for those either. My workaround was to
replace e.g. f'(-1) with var('d1fx0') before trying the collect() trick.

The same thing might work here -- replacing x^2 by var('x2') or
something -- but it does get ugly after a while.


> What I would like to get is Sage returning expressions with coefficients
> sorted by the value of the exponents, like when using multivariate
> polynomial rings.
> 
> ...
> 
> Is there a solution to my problem ?

If there is, I'd like to know it!

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Sage's running too slowly

2012-09-03 Thread Guilherme Boaviagem Ribeiro
Thank you all, guys!
Mantysalo and Braun, enable VT-x/AMD-V, adding one CPU and increasing the 
memory to 1024 MB worked really well, thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: plot color computet by function

2012-09-03 Thread danjo86
First of all, thanks for help.
You got exactly the point. 
I saw the example you post. But is there a possibility, that i calculate 
mandel within the plotfunction?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Dual of an ideal

2012-09-03 Thread Cindy
Hi,

How can I calculate the dual of an ideal using sage?

Thanks.

Cindy

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Notebook evaluate fails return: OSX 10.6.8

2012-09-03 Thread mazkime
I had the same problem and deleting the 'sage_notebook.sagenb' directory 
from '~/.sage/' resolved it.
Thanks for the tip.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.