[sage-support] Re: Help-- bound a 3D plot

2008-07-18 Thread David Joyner

Could you be more specific? When I do something like

sage: u,v=var(u,v)
sage: parametric_plot3d((cos(u), sin(u) + cos(v), sin(v)), (u, 0,
2*pi), (v, -pi, pi), color='green', opacity=0.1, plot_points=[30,30])

I think get the [x,y,z] limits on the framed axes, which seems to be
what you are saying
you want.


On Thu, Jul 17, 2008 at 8:34 PM, Rose [EMAIL PROTECTED] wrote:

 Hi,
   I asked this question 3 days ago, but got no answer. This problem
 hinder me in my project. I would appreciate an answer, even if what I
 want to do is impossible.

 On 14 juil, 10:37, Rose [EMAIL PROTECTED] wrote:
  Hi,

 I am drawing some parametric_plot3d, but when I display them, I would
 prefer to see the result in a box centered at the origin of side of
 length 4 instead of all my plot, because the plot can be too large.

 In other words, I want to bound the Cartesian coordinates [x,y,z] of
 the plot, and not the parametric space.

 Is there a way to do that?

 Rose

 Rose
 


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



[sage-support] Re: raw picture manipulation

2008-07-18 Thread jwmerr...@gmail.com

On Jul 17, 8:40 pm, David Joyner [EMAIL PROTECTED] wrote:

 I would try
 sage: im.show(command=/opt/local/bin/xv)
 based on what you say below. Does this help?


Unfortunately not,

im.show(command=/opt/local/bin/xv) and im.show(command=/opt/local/
bin/display) both still result in the same traceback,

Traceback (click to the left for traceback)
...
IOError: decoder jpeg not available

JM

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



[sage-support] firefox crash

2008-07-18 Thread rob.braswell


Hi-

I'm trying to get started, sorry in advance if I'm just doing
something dumb.

I installed SAGE 3.0.3 on my Mac OS X (intel) 10.5.4. and am using
Firefox 2.0.0.16.

If I type notebook() or inotebook() at the sage prompt, I see the sage
admin page in my browser and it looks fine. When I click on new
worksheet then Firefox immediately dies with no error message in the
console. Ctl-c will return the sage console to the prompt. I tried
turning popup blocking off. Is there a browser setting that I need to
check? Is there some other thing that may be the culprit?

This looks cool, can't wait to check it out for real.

Thanks,
Rob Braswell
University of New Hampshire

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



[sage-support] Re: firefox crash

2008-07-18 Thread William Stein

On Fri, Jul 18, 2008 at 4:30 PM, rob.braswell [EMAIL PROTECTED] wrote:


 Hi-

 I'm trying to get started, sorry in advance if I'm just doing
 something dumb.

 I installed SAGE 3.0.3 on my Mac OS X (intel) 10.5.4. and am using
 Firefox 2.0.0.16.



 If I type notebook() or inotebook() at the sage prompt, I see the sage
 admin page in my browser and it looks fine. When I click on new
 worksheet then Firefox immediately dies with no error message in the
 console. Ctl-c will return the sage console to the prompt. I tried
 turning popup blocking off. Is there a browser setting that I need to
 check? Is there some other thing that may be the culprit?

Maybe you should install Firefox 3.0?

 This looks cool, can't wait to check it out for real.

You could use Sage with Safari.  Just open Safari to the same
url -- probably http://localhost:8000

William

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



[sage-support] Re: Help-- bound a 3D plot

2008-07-18 Thread Rose



On Jul 18, 12:37 am, William Stein [EMAIL PROTECTED] wrote:
 On Fri, Jul 18, 2008 at 3:04 AM, David Joyner [EMAIL PROTECTED] wrote:

  Could you be more specific? When I do something like

  sage: u,v=var(u,v)
  sage: parametric_plot3d((cos(u), sin(u) + cos(v), sin(v)), (u, 0,
  2*pi), (v, -pi, pi), color='green', opacity=0.1, plot_points=[30,30])

  I think get the [x,y,z] limits on the framed axes, which seems to be
  what you are saying
  you want.

I think what I want to do is not to bound but to clip the plot to a
specific (3D) window, smaller than the entire plot.


 Yes, Rose, could you be more specific?  E.g., give a particular
 example of code that draws a 3d plot,

For exemple:

t1, t2 = var('t1,t2')
r=1/sqrt(2)
w=r*cos(t2)
fx=sqrt(1-r^2)*sin(t1)/(w+1)
fy=sqrt(1-r^2)*cos(t1)/(w+1)
fz=r*sin(t2)/(w+1)
A=parametric_plot3d([fx,fy,fz], (t1,0,2*pi), (t2,0,2*pi),
rgbcolor=(0,0,1), opacity=0.4)

r, t2 = var('r,t2')
t1=0
w=sqrt(1-r^2)*cos(t2)
fx=r*sin(t1)/(w+1)
fy=r*cos(t1)/(w+1)
fz=sqrt(1-r^2)*sin(t2)/(w+1)
B=parametric_plot3d([fx,fy,fz], (r,0.001,1/sqrt(2)), (t2,0,2*pi),
color=hue(0), opacity=0.8)

(A+B).show()

 and what you *wish*
 it would draw instead.

I would like to clip this in a box of side of length 4. I want the
torus to be in the center of the image even if I lose a part of the
other object.

Rose

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



[sage-support] about functions evaluation

2008-07-18 Thread aniura

Hi,

I have no experience in sage, I began to use it two days ago because I
need arbitrary precision arithmetic and Octave is not so god for
that.

I wanted to write a script where I evaluate a function which is also
written in a script. this can be done in Octave , f. ex. by using
feval, but I have not found anything similar in sage. could anybody
give some suggestion?

thanks in advance,

Aniura

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



[sage-support] System of (linear) equations with values in a specific ring/field.

2008-07-18 Thread Stefano Maggiolo

I'd like to solve some systems of linear equation with coefficients
and unknown in the integers modulo Z_n. I'm aware of solve_mod, but:
1. it's slow;
2. returns a list of solutions and not a list of generators/relations
for the solutions.

Is there anything better suited for me?

Thanks,
Stefano Maggiolo

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



[sage-support] Re: about functions evaluation

2008-07-18 Thread Justin C. Walker


On Jul 18, 2008, at 12:04 , aniura wrote:

 I have no experience in sage, I began to use it two days ago because I
 need arbitrary precision arithmetic and Octave is not so god for
 that.

There are a number of good Python tutorials and other doc available.   
Check the site
   http://www.python.org
(I can't tell whether you have Python experience; Python is the  
implementation language for most of Sage).

 I wanted to write a script where I evaluate a function which is also
 written in a script. this can be done in Octave , f. ex. by using
 feval, but I have not found anything similar in sage. could anybody
 give some suggestion?

I'm not sure what you want from your description.  However:

sage: def foo(x):
...: return bar(x)
...:
sage: def bar(y):
: return y*y
:
sage: foo(10)
  100

Is this what you mean?  'foo' and 'bar' can be defined in different  
files, as long as you have both files loaded when you call foo().  You  
can also pass functions as arguments:

sage: def foo(x, f):
: return f(x)
:
sage: def bar(y):
: return y*y
:
sage: foo(10, bar)
  100

Does this help?  If not, please clarify; we're happy to help.

Justin

--
They said it couldn't be done, but sometimes,
it doesn't work out that way.
   - Casey Stengel
--




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



[sage-support] Re: about functions evaluation

2008-07-18 Thread Harald Schilly

On Jul 18, 9:04 pm, aniura [EMAIL PROTECTED] wrote:
 feval,...

import filename (without .py)

and now filename.function() calles it

(there is also from filename import * (or list of function names))

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



[sage-support] Re: about functions evaluation

2008-07-18 Thread aniura

I wanted to pass functions as arguments, so your example solved my
problem,

thank you!

On Jul 18, 5:52 pm, Justin C. Walker [EMAIL PROTECTED] wrote:
 On Jul 18, 2008, at 12:04 , aniura wrote:

  I have no experience in sage, I began to use it two days ago because I
  need arbitrary precision arithmetic and Octave is not so god for
  that.

 There are a number of good Python tutorials and other doc available.
 Check the site
http://www.python.org
 (I can't tell whether you have Python experience; Python is the
 implementation language for most of Sage).

  I wanted to write a script where I evaluate a function which is also
  written in a script. this can be done in Octave , f. ex. by using
  feval, but I have not found anything similar in sage. could anybody
  give some suggestion?

 I'm not sure what you want from your description.  However:

 sage: def foo(x):
 ...: return bar(x)
 ...:
 sage: def bar(y):
 : return y*y
 :
 sage: foo(10)
   100

 Is this what you mean?  'foo' and 'bar' can be defined in different
 files, as long as you have both files loaded when you call foo().  You
 can also pass functions as arguments:

 sage: def foo(x, f):
 : return f(x)
 :
 sage: def bar(y):
 : return y*y
 :
 sage: foo(10, bar)
   100

 Does this help?  If not, please clarify; we're happy to help.

 Justin

 --
 They said it couldn't be done, but sometimes,
 it doesn't work out that way.
- Casey Stengel
 --
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Help-- bound a 3D plot

2008-07-18 Thread William Stein

On Fri, Jul 18, 2008 at 6:01 PM, Rose [EMAIL PROTECTED] wrote:



 On Jul 18, 12:37 am, William Stein [EMAIL PROTECTED] wrote:
 On Fri, Jul 18, 2008 at 3:04 AM, David Joyner [EMAIL PROTECTED] wrote:

  Could you be more specific? When I do something like

  sage: u,v=var(u,v)
  sage: parametric_plot3d((cos(u), sin(u) + cos(v), sin(v)), (u, 0,
  2*pi), (v, -pi, pi), color='green', opacity=0.1, plot_points=[30,30])

  I think get the [x,y,z] limits on the framed axes, which seems to be
  what you are saying
  you want.

 I think what I want to do is not to bound but to clip the plot to a
 specific (3D) window, smaller than the entire plot.


 Yes, Rose, could you be more specific?  E.g., give a particular
 example of code that draws a 3d plot,

 For exemple:

 t1, t2 = var('t1,t2')
 r=1/sqrt(2)
 w=r*cos(t2)
 fx=sqrt(1-r^2)*sin(t1)/(w+1)
 fy=sqrt(1-r^2)*cos(t1)/(w+1)
 fz=r*sin(t2)/(w+1)
 A=parametric_plot3d([fx,fy,fz], (t1,0,2*pi), (t2,0,2*pi),
 rgbcolor=(0,0,1), opacity=0.4)

 r, t2 = var('r,t2')
 t1=0
 w=sqrt(1-r^2)*cos(t2)
 fx=r*sin(t1)/(w+1)
 fy=r*cos(t1)/(w+1)
 fz=sqrt(1-r^2)*sin(t2)/(w+1)
 B=parametric_plot3d([fx,fy,fz], (r,0.001,1/sqrt(2)), (t2,0,2*pi),
 color=hue(0), opacity=0.8)

 (A+B).show()

 and what you *wish*
 it would draw instead.

 I would like to clip this in a box of side of length 4. I want the
 torus to be in the center of the image even if I lose a part of the
 other object.

 Rose

Amazingly, it looks like we never implemented this capability.
Moreover, I don't see an easy way to do it, though maybe carefully
reading the jmol scripting language docs (which sage uses):
   http://jmol.sourceforge.net/
would yield a command for clipping a scene.  If so, then I bet
we could very easily add this functionality to Sage.

Robert Bradshaw -- any thoughts?

 -- William

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



[sage-support] Re: System of (linear) equations with values in a specific ring/field.

2008-07-18 Thread Robert Bradshaw

On Jul 18, 2008, at 1:05 PM, Stefano Maggiolo wrote:

 I'd like to solve some systems of linear equation with coefficients
 and unknown in the integers modulo Z_n. I'm aware of solve_mod, but:
 1. it's slow;
 2. returns a list of solutions and not a list of generators/relations
 for the solutions.

 Is there anything better suited for me?


Yes, there's certainly faster ways about going about this, though  
they might take a bit more work. I'm not sure what the equations  
you're trying to solve look like, but I would try using linear  
algebra over Z_p for each p dividing n, and then use Chinese  
Remainder and Hensel lifting. to lift to solutions mod n.

For example, to solve the following mod 1147 = 31*37

5x + y = 1
x + 4y = 2

sage: M = matrix(2, 2, [5,1,1,4]); M
[5 1]
[1 4]
sage: M.change_ring(GF(31)) \ vector([1,2])
(5, 7)
sage: M.change_ring(GF(37)) \ vector([1,2])
(4, 18)

sage: crt(5, 4, 31, 37) % 1147
966
sage: crt(7, 18, 31, 37) % 1147
906

gives the solution x=996, y=906. If M were singular for any of the  
divisors of your n, then you would get a lift of each solution.

- Robert


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



[sage-support] Fractional powers for polynomial variables

2008-07-18 Thread Andrey Novoseltsev

Hello,

I need to substitute some variable in a polynomial ring with a
fractional power of another one. I know that the result still will be
a polynomial, however I have discovered the following behaviour (v.
3.0.5 on sage.math):

sage: pr = PolynomialRing(QQ, u,v)
sage: pr.injvar()
Defining u, v
sage: u^(1/2)
1
sage: pr = PolynomialRing(QQ, w)
sage: pr.injvar()
Defining w
sage: w^(1/2)
---
TypeError Traceback (most recent call
last)

/home/novoselt/ipython console in module()

/home/novoselt/polynomial_element.pyx in
sage.rings.polynomial.polynomial_element.Polynomial.__pow__ (sage/
rings/polynomial/polynomial_element.c:8179)()

/home/novoselt/element.pyx in
sage.structure.element.RingElement.__mul__ (sage/structure/element.c:
8814)()

/home/novoselt/coerce.pyx in
sage.structure.coerce.CoercionModel_cache_maps.bin_op_c (sage/
structure/coerce.c:5582)()

TypeError: unsupported operand parent(s) for '*': 'type 'list'' and
'Rational Field'
sage: sqrt(w)
sqrt(w)

Is it how things were supposed to work for some reason or a bug?

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



[sage-support] hyper-v-sage-deluxe-3.0.5

2008-07-18 Thread Adam Getchell

Hello all,

I have uploaded a 64-bit Hyper-V image of SAGE 3.0.5 built from source
running on (X)Ubuntu 8.0.4 Server LTS, patched as of 7/15/2008.

Hyper-V requires 64-bit Windows 2008 (any version) running on a
processor with the AMD/Pacifica or Intel VT hardware virtualization
support.

It's 75% smaller than the vmware-sage-deluxe image, and (IMHO) runs better.

I haven't had time to put instructions on how to use it, but it uses
the same login/password combo as the VMWare version of SAGE, and
requires the (free) 7-Zip tool to extract it.

It can be found here:

http://sage.math.washington.edu/home/acgetchell/

Let me know if you run into any problems, and I'll see what I can do.

Enjoy!

Adam
-- 
Invincibility is in oneself, vulnerability in the opponent. -- Sun Tzu

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



[sage-support] Normalizing symbolic polynomial

2008-07-18 Thread Andrey Novoseltsev

Hello,

I have a symbolic expression which is a polynomial in t and t^(-1). I
want to multiply it by some power of t so that it is a polynomial of
t. How can I determine this power? Coefficients are some symbolic
expressions in other variables, e.g. sqrt(a)*t+1/t^2.

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



[sage-support] No VMWare virtual machine at mirrors

2008-07-18 Thread murray

I wanted to download the current VMWare virtual version from a local
mirror, but neither of the closest two mirrors (Boston, Virginia)
seems to have that.  They do have a link to a Windows binary
distribution page, but of course there is not Windows binary yet.

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