[sage-support] Print exp(x) instead of e^x in symbolic expressions

2012-11-27 Thread Serge Torres
Hi,

I'm pretty sure this question has been answered over and over but
despite intensive googling I could not find these answers.

I have expressions (say, f = exp(x)) that want to export to another
computing system.

str(f) is 'e^x' but the target system does not understand it.

Is there a way to have a string version of f with the exp() notation
preserved?

Thanks in advance and sorry for being so dumb.

-- 
Regards,

Serge Torres


-- 
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] Print exp(x) instead of e^x in symbolic expressions

2012-11-27 Thread Burcin Erocal
On Tue, 27 Nov 2012 11:23:01 +0100
Serge Torres serge.tor...@laposte.net wrote:

 I'm pretty sure this question has been answered over and over but
 despite intensive googling I could not find these answers.
 
 I have expressions (say, f = exp(x)) that want to export to another
 computing system.
 
 str(f) is 'e^x' but the target system does not understand it.
 
 Is there a way to have a string version of f with the exp() notation
 preserved?

This is #11428 on trac.

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

The patch on the ticket does not work. It needs to go through the
registry of functions stored in Pynac and update the name or the
printing functions there. Unfortunately I don't have time to implement
that right now.


As a workaround in your case, you can modify the definition of
Function_exp in sage/functions/log.py to set a latex_name in the
initializer, or if that doesn't work, define a _print_latex_ method.


Cheers,
Burcin

-- 
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] Print exp(x) instead of e^x in symbolic expressions

2012-11-27 Thread Burcin Erocal
On Tue, 27 Nov 2012 12:16:20 +0100
Burcin Erocal bur...@erocal.org wrote:

 On Tue, 27 Nov 2012 11:23:01 +0100
 Serge Torres serge.tor...@laposte.net wrote:
 
  I'm pretty sure this question has been answered over and over but
  despite intensive googling I could not find these answers.
  
  I have expressions (say, f = exp(x)) that want to export to another
  computing system.
  
  str(f) is 'e^x' but the target system does not understand it.
  
  Is there a way to have a string version of f with the exp() notation
  preserved?
 
 This is #11428 on trac.
 
 http://trac.sagemath.org/sage_trac/ticket/11428
 
 The patch on the ticket does not work. It needs to go through the
 registry of functions stored in Pynac and update the name or the
 printing functions there. Unfortunately I don't have time to implement
 that right now.
 
 
 As a workaround in your case, you can modify the definition of
 Function_exp in sage/functions/log.py to set a latex_name in the
 initializer, or if that doesn't work, define a _print_latex_ method.

Here is a simpler solution:

Create a symbolic function fn that prints as '\exp', replace e^x in your
expression with fn, translate the new expression to latex:

# the top level function method injects the name of the function into
# the name space. I don't want to overwrite the exp method in the top
# level. Hence the import
sage: from sage.symbolic.function_factory import function
sage: fn = function('exp', latex_name='\exp')
sage: fn
exp
sage: type(exp)
class 'sage.functions.log.Function_exp'
sage: latex(fn(x))
\exp\left(x\right)


sage: t = exp(x^2) + (x+1)*exp(a^2+b)
sage: latex(t)
{\left(x + 1\right)} e^{\left(a^{2} + b\right)} + e^{\left(x^{2}\right)}
sage: latex(t.substitute_function(exp, myfn))  
{\left(x + 1\right)} \exp\left(a^{2} + b\right) + \exp\left(x^{2}\right)



Cheers,
Burcin

-- 
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 v5.4.1 linux 32bit, twistd error when starting notebook(dir=..)

2012-11-27 Thread Jason Grout

On 11/23/12 3:19 PM, Andre, der Besonnene wrote:

  When I start a notebook without giving a directory parameter
everything works fine. But when I try to add a directory parameter sage
refuses to start a webinterface server:

sage: notebook(directory=/home/sage/s,interface='')
..
Executing twistd  --pidfile=s/sagenb.pid -ny s.sagenb/twistedconf.tac
/\/\/\/\/\/\
2012-11-23 21:31:23+0100 [-]   File
/opt/sage/sage-5.4.1-linux-32bit-ubuntu_12.04.1_lts-i686-Linux/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-i686.egg/twisted/scripts/_twistd_unix.py,
line 293, in setupEnvironment
2012-11-23 21:31:23+0100 [-] f = open(pidfile,'wb')
2012-11-23 21:31:23+0100 [-] IOError: [Errno 2] No such file or
directory: '/home/sage/s/sagenb.pid'
..

I guess the pidfile should be
/home/sage/s.sagenb/sagenb.pid,
/\/\/\/\/\/\/\/\/\/\

Liebe Grüße aus einen nebeligen Seewinkel, regards
Andre


I've filed a bug here: https://github.com/sagemath/sagenb/issues/116. 
Can anyone confirm this?  I don't have a copy of 5.4.1 up yet.


Thanks,

Jason



--
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 v5.4.1 linux 32bit, twistd error when starting notebook(dir=..)

2012-11-27 Thread Kannappan Sampath
On Wed, Nov 28, 2012 at 12:27 AM, Jason Grout
jason-s...@creativetrax.comwrote:

 On 11/23/12 3:19 PM, Andre, der Besonnene wrote:

   When I start a notebook without giving a directory parameter
 everything works fine. But when I try to add a directory parameter sage
 refuses to start a webinterface server:

 sage: notebook(directory=/home/**sage/s,interface='')
 ..
 Executing twistd  --pidfile=s/sagenb.pid -ny s.sagenb/twistedconf.tac
 /\/\/\/\/\/\
 2012-11-23 21:31:23+0100 [-]   File
 /opt/sage/sage-5.4.1-linux-**32bit-ubuntu_12.04.1_lts-i686-**
 Linux/local/lib/python2.7/**site-packages/Twisted-12.1.0-**
 py2.7-linux-i686.egg/twisted/**scripts/_twistd_unix.py,
 line 293, in setupEnvironment
 2012-11-23 21:31:23+0100 [-] f = open(pidfile,'wb')
 2012-11-23 21:31:23+0100 [-] IOError: [Errno 2] No such file or
 directory: '/home/sage/s/sagenb.pid'
 ..

 I guess the pidfile should be
 /home/sage/s.sagenb/sagenb.**pid,
 /\/\/\/\/\/\/\/\/\/\

 Liebe Grüße aus einen nebeligen Seewinkel, regards
 Andre


 I've filed a bug here: 
 https://github.com/sagemath/**sagenb/issues/116https://github.com/sagemath/sagenb/issues/116.
 Can anyone confirm this?  I don't have a copy of 5.4.1 up yet.


Well, here, when I tried to do this on my machine, sage raises an error
(the socket.error is being triggered). When monitoring the browser (chrome
beta) log from the terminal:

Browser log:
[1146:830] Got cookie response, socket is authorized
[1146:830] AUTHORIZED; socket handshake complete
[1151:743] HandleOnlineCheck: Starting check
[1151:743] HandleOnlineCheck: OK; current state: 3
[3439:368] Read port file, port=48650
[3439:368] WebSocket connect info: 48650:GfTvpAdQGj+HKZa/
[3573:998] Read port file, port=48650
[3573:998] WebSocket connect info: 48650:GfTvpAdQGj+HKZa/

Here's Sage's complaint (I am running Sage 5.4.1, of course):

**
**
* Open your web browser to http://localhost:8080 *
**
**
Executing twistd  --pidfile=Test_Note_book/sagenb.pid -ny
Test_Note_book.sagenb/twistedconf.tac
2012-11-28 01:07:02+0530 [-] Log opened.
2012-11-28 01:07:02+0530 [-] twistd 12.1.0
(/usr/lib/sagemath/local/bin/python 2.7.3) starting up.
2012-11-28 01:07:02+0530 [-] reactor class:
twisted.internet.epollreactor.EPollReactor.
2012-11-28 01:07:02+0530 [-] Traceback (most recent call last):
2012-11-28 01:07:02+0530 [-]   File /usr/lib/sagemath/local/bin/twistd,
line 5, in module
2012-11-28 01:07:02+0530 [-]
pkg_resources.run_script('Twisted==12.1.0', 'twistd')
2012-11-28 01:07:02+0530 [-]   File
/usr/lib/sagemath/local/lib/python2.7/site-packages/distribute-0.6.16-py2.7.egg/pkg_resources.py,
line 468, in run_script
2012-11-28 01:07:02+0530 [-]
self.require(requires)[0].run_script(script_name, ns)
2012-11-28 01:07:02+0530 [-]   File
/usr/lib/sagemath/local/lib/python2.7/site-packages/distribute-0.6.16-py2.7.egg/pkg_resources.py,
line 1201, in run_script
2012-11-28 01:07:02+0530 [-] execfile(script_filename, namespace,
namespace)
2012-11-28 01:07:02+0530 [-]   File
/usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/EGG-INFO/scripts/twistd,
line 14, in module
2012-11-28 01:07:02+0530 [-] run()
2012-11-28 01:07:02+0530 [-]   File
/usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/scripts/twistd.py,
line 27, in run
2012-11-28 01:07:02+0530 [-] app.run(runApp, ServerOptions)
2012-11-28 01:07:02+0530 [-]   File
/usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/application/app.py,
line 652, in run
2012-11-28 01:07:02+0530 [-] runApp(config)
2012-11-28 01:07:02+0530 [-]   File
/usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/scripts/twistd.py,
line 23, in runApp
2012-11-28 01:07:02+0530 [-] _SomeApplicationRunner(config).run()
2012-11-28 01:07:02+0530 [-]   File
/usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/application/app.py,
line 390, in run
2012-11-28 01:07:02+0530 [-] self.postApplication()
2012-11-28 01:07:02+0530 [-]   File
/usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/scripts/_twistd_unix.py,
line 230, in postApplication
2012-11-28 01:07:02+0530 [-] self.startApplication(self.application)
2012-11-28 01:07:02+0530 [-]   File
/usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/scripts/_twistd_unix.py,
line 338, in startApplication
2012-11-28 01:07:02+0530 [-] self.config['pidfile'])
2012-11-28 01:07:02+0530 [-]   File
/usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/scripts/_twistd_unix.py,
line 293, in setupEnvironment
2012-11-28 01:07:02+0530 

Re: [sage-support] Re: sage v5.4.1 linux 32bit, twistd error when starting notebook(dir=..)

2012-11-27 Thread Kannappan Sampath
And, let me add one more observation:

The problem is that although sage prompts password for setting up admin
account on the nb server, I am afraid it is not doing it! For instance,
there is no folder called admin in the directory specified.

Apologies for not writing up one single mail.

~KnS


On Wed, Nov 28, 2012 at 1:14 AM, Kannappan Sampath kntri...@gmail.comwrote:


 On Wed, Nov 28, 2012 at 12:27 AM, Jason Grout jason-s...@creativetrax.com
  wrote:

 On 11/23/12 3:19 PM, Andre, der Besonnene wrote:

   When I start a notebook without giving a directory parameter
 everything works fine. But when I try to add a directory parameter sage
 refuses to start a webinterface server:

 sage: notebook(directory=/home/**sage/s,interface='')
 ..
 Executing twistd  --pidfile=s/sagenb.pid -ny s.sagenb/twistedconf.tac
 /\/\/\/\/\/\
 2012-11-23 21:31:23+0100 [-]   File
 /opt/sage/sage-5.4.1-linux-**32bit-ubuntu_12.04.1_lts-i686-**
 Linux/local/lib/python2.7/**site-packages/Twisted-12.1.0-**
 py2.7-linux-i686.egg/twisted/**scripts/_twistd_unix.py,
 line 293, in setupEnvironment
 2012-11-23 21:31:23+0100 [-] f = open(pidfile,'wb')
 2012-11-23 21:31:23+0100 [-] IOError: [Errno 2] No such file or
 directory: '/home/sage/s/sagenb.pid'
 ..

 I guess the pidfile should be
 /home/sage/s.sagenb/sagenb.**pid,
 /\/\/\/\/\/\/\/\/\/\

 Liebe Grüße aus einen nebeligen Seewinkel, regards
 Andre


 I've filed a bug here: 
 https://github.com/sagemath/**sagenb/issues/116https://github.com/sagemath/sagenb/issues/116.
 Can anyone confirm this?  I don't have a copy of 5.4.1 up yet.


 Well, here, when I tried to do this on my machine, sage raises an error
 (the socket.error is being triggered). When monitoring the browser (chrome
 beta) log from the terminal:

 Browser log:
 [1146:830] Got cookie response, socket is authorized
 [1146:830] AUTHORIZED; socket handshake complete
 [1151:743] HandleOnlineCheck: Starting check
 [1151:743] HandleOnlineCheck: OK; current state: 3
 [3439:368] Read port file, port=48650
 [3439:368] WebSocket connect info: 48650:GfTvpAdQGj+HKZa/
 [3573:998] Read port file, port=48650
 [3573:998] WebSocket connect info: 48650:GfTvpAdQGj+HKZa/

 Here's Sage's complaint (I am running Sage 5.4.1, of course):

 **
 **
 * Open your web browser to http://localhost:8080 *
 **
 **
  Executing twistd  --pidfile=Test_Note_book/sagenb.pid -ny
 Test_Note_book.sagenb/twistedconf.tac
 2012-11-28 01:07:02+0530 [-] Log opened.
 2012-11-28 01:07:02+0530 [-] twistd 12.1.0
 (/usr/lib/sagemath/local/bin/python 2.7.3) starting up.
 2012-11-28 01:07:02+0530 [-] reactor class:
 twisted.internet.epollreactor.EPollReactor.
 2012-11-28 01:07:02+0530 [-] Traceback (most recent call last):
 2012-11-28 01:07:02+0530 [-]   File /usr/lib/sagemath/local/bin/twistd,
 line 5, in module
 2012-11-28 01:07:02+0530 [-]
 pkg_resources.run_script('Twisted==12.1.0', 'twistd')
 2012-11-28 01:07:02+0530 [-]   File
 /usr/lib/sagemath/local/lib/python2.7/site-packages/distribute-0.6.16-py2.7.egg/pkg_resources.py,
 line 468, in run_script
 2012-11-28 01:07:02+0530 [-]
 self.require(requires)[0].run_script(script_name, ns)
 2012-11-28 01:07:02+0530 [-]   File
 /usr/lib/sagemath/local/lib/python2.7/site-packages/distribute-0.6.16-py2.7.egg/pkg_resources.py,
 line 1201, in run_script
 2012-11-28 01:07:02+0530 [-] execfile(script_filename, namespace,
 namespace)
 2012-11-28 01:07:02+0530 [-]   File
 /usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/EGG-INFO/scripts/twistd,
 line 14, in module
 2012-11-28 01:07:02+0530 [-] run()
 2012-11-28 01:07:02+0530 [-]   File
 /usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/scripts/twistd.py,
 line 27, in run
 2012-11-28 01:07:02+0530 [-] app.run(runApp, ServerOptions)
 2012-11-28 01:07:02+0530 [-]   File
 /usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/application/app.py,
 line 652, in run
 2012-11-28 01:07:02+0530 [-] runApp(config)
 2012-11-28 01:07:02+0530 [-]   File
 /usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/scripts/twistd.py,
 line 23, in runApp
 2012-11-28 01:07:02+0530 [-] _SomeApplicationRunner(config).run()
 2012-11-28 01:07:02+0530 [-]   File
 /usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/application/app.py,
 line 390, in run
 2012-11-28 01:07:02+0530 [-] self.postApplication()
 2012-11-28 01:07:02+0530 [-]   File
 /usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/scripts/_twistd_unix.py,
 line 230, in postApplication
 2012-11-28 01:07:02+0530 [-] self.startApplication(self.application)
 2012-11-28 

Re: [sage-support] LDAP (or AD or...) again

2012-11-27 Thread Tim Joseph Dumol
On Nov 22, 2012 3:45 PM, Thierry Dumont tdum...@math.univ-lyon1.fr
wrote:

 Le 22/11/2012 08:53, Jori Mantysalo a écrit :

 Getting back to this old question... Version 5.4. has been released. How
 to set up ldap? Or some kind of external authentication, like CAS or AD?

 Has anyone made this? I'm stuck with old errors (this time Failed to
 load application: No module named flask_version) and don't quite know
 where to start debugging.


 I am also intersted by this old question. I used to patch the old
 notebook to get an ldap access and identification). I recognize that what I
 did is neither clean nor generic, but it works since some years in my
 University server, and in a national server for French Mathematicians.

 I do not understand where to patch the new Notebook, and thus I am stuck
 to 4.* versions. If somebody can give some hints, It would be nice.

 Yours
 t.d.

 --
 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+unsubscribe@**
 googlegroups.com sage-support%2bunsubscr...@googlegroups.com.
 Visit this group at 
 http://groups.google.com/**group/sage-support?hl=enhttp://groups.google.com/group/sage-support?hl=en
 .




-- 
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] Strange behaviour when generating SVG files for (combinatorial) graphs

2012-11-27 Thread Rogério Brito
Hi there.

I was just trying to get my feet wet with Sage by generating some SVG files of 
graphs for use with my LaTeX documents, but I noticed a problem:

In the following session, with Sage 5.4.1 (actually, 
sage-5.4.1-linux-32bit-ubuntu_12.04.1_lts-i686-Linux) running on a Debian sid 
machine, I get a strange error:

g = graphs.PetersenGraph()
g.plot().save('petersen.png') # generated OK
g.plot().save('petersen.pdf') # also generated OK
g.plot().save('petersen.svg') # not OK

In the case of the SVG file, the edges of the graph are OK, as with the PNG and 
PDF format (when viewed with Gnome's eog), but all the vertices are collapsed 
on the top left corner of the figure.

BTW, my original intention was to generate some drawings of graphs with Sage so 
that I could shift back and forth between SVG and tikz (via Inkscape), once 
they are created by Sage, but that strategy didn't work. :(

Is this a known bug?


Thanks,

Rogério Brito.

-- 
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] am I doing something wrong

2012-11-27 Thread Alan
my first attempt at using the online version was to move from polar to 
cartesian coods. I tried

var('r theta psi x y z')
(r,theta,psi,x,y,z)
e1 = r == +sqrt(x^2+y^2+z^2)
e2 = theta == arccos(z/sqrt(x^2+y^2+z^2))
e3 = psi == arctan(y/x)
solve([e1,e2,e3],x,y,z)

with the  result


Traceback (most recent call last):
  File stdin, line 1, in module
  File _sage_input_53.py, line 10, in module
exec compile(u'open(___code___.py,w).write(# -*- coding: utf-8 -*-\\n 
+ 
_support_.preparse_worksheet_cell(base64.b64decode(dmFyKCdyIHRoZXRhIHBzaSB4IHkgeicpCihyLHRoZXRhLHBzaSx4LHkseikKZTEgPSByID09ICtzcXJ0KHheMit5XjIrel4yKQplMiA9IHRoZXRhID09IGFyY2Nvcyh6L3NxcnQoeF4yK3leMit6XjIpKQplMyA9IHBzaSA9PSBhcmN0YW4oeS94KQpzb2x2ZShbZTEsZTIsZTNdLHgseSx6KQ==),globals())+\\n);
 execfile(os.path.abspath(___code___.py))
  File , line 1, in module

  File /tmp/tmpCMmv9N/___code___.py, line 8, in module
exec compile(u'solve([e1,e2,e3],x,y,z)
  File , line 1, in module

  File 
/sagenb/sage_install/sage-5.4-sage.math.washington.edu-x86_64-Linux/local/lib/python2.7/site-packages/sage/symbolic/relation.py,
 line 753, in solve
sol_list = string_to_list_of_solutions(repr(s))
  File 
/sagenb/sage_install/sage-5.4-sage.math.washington.edu-x86_64-Linux/local/lib/python2.7/site-packages/sage/symbolic/relation.py,
 line 457, in string_to_list_of_solutions
v = symbolic_expression_from_maxima_string(s, equals_sub=True)
  File 
/sagenb/sage_install/sage-5.4-sage.math.washington.edu-x86_64-Linux/local/lib/python2.7/site-packages/sage/calculus/calculus.py,
 line 1791, in symbolic_expression_from_maxima_string
raise TypeError, unable to make sense of Maxima expression '%s' in Sage%s
TypeError: unable to make sense of Maxima expression 
'[If(and(-pi/2parg(-r),-pi/2parg(r),parg(-r)==pi/2,parg(r)==pi/2,-r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))!=0,sqrt(r^2*(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))+r^2*cos(theta)^2+tan(psi)^2*r^2*(1-cos(theta))*(cos(theta)+1)/(tan(psi)^2+1))!=0),[x==-r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1)),y==-tan(psi)*r*sqrt(1-cos(theta))*sqrt(cos(theta)+1)/sqrt(tan(psi)^2+1),z==-r*cos(theta)],union()),If(and(-pi/2parg(-r),-pi/2parg(r),parg(-r)==pi/2,parg(r)==pi/2,r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))!=0,sqrt(r^2*(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))+r^2*cos(theta)^2+tan(psi)^2*r^2*(1-cos(theta))*(cos(theta)+1)/(tan(psi)^2+1))!=0),[x==r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1)),y==tan(psi)*r*sqrt(1-cos(theta))*sqrt(cos(theta)+1)/sqrt(tan(psi)^2+1),z==-r*cos(theta)],union()),If(and(-pi/2parg(r),parg(r)==pi/2,-r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))!=0,sqrt(r^2*(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))+r^2*cos(theta)^2+tan(psi)^2*r^2*(1-cos(theta))*(cos(theta)+1)/(tan(psi)^2+1))!=0),[x==-r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1)),y==-tan(psi)*r*sqrt(1-cos(theta))*sqrt(cos(theta)+1)/sqrt(tan(psi)^2+1),z==r*cos(theta)],union()),If(and(-pi/2parg(r),parg(r)==pi/2,r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))!=0,sqrt(r^2*(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))+r^2*cos(theta)^2+tan(psi)^2*r^2*(1-cos(theta))*(cos(theta)+1)/(tan(psi)^2+1))!=0),[x==r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1)),y==tan(psi)*r*sqrt(1-cos(theta))*sqrt(cos(theta)+1)/sqrt(tan(psi)^2+1),z==r*cos(theta)],union())]'
 in Sage 


It seems to be objecting to in Sage in the return value from Maxima

-- 
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: Strange behaviour when generating SVG files for (combinatorial) graphs

2012-11-27 Thread Jason Grout

On 11/27/12 11:43 PM, Rogério Brito wrote:

Hi there.

I was just trying to get my feet wet with Sage by generating some SVG files of 
graphs for use with my LaTeX documents, but I noticed a problem:

In the following session, with Sage 5.4.1 (actually, 
sage-5.4.1-linux-32bit-ubuntu_12.04.1_lts-i686-Linux) running on a Debian sid 
machine, I get a strange error:

g = graphs.PetersenGraph()
g.plot().save('petersen.png') # generated OK
g.plot().save('petersen.pdf') # also generated OK
g.plot().save('petersen.svg') # not OK

In the case of the SVG file, the edges of the graph are OK, as with the PNG and 
PDF format (when viewed with Gnome's eog), but all the vertices are collapsed 
on the top left corner of the figure.

BTW, my original intention was to generate some drawings of graphs with Sage so 
that I could shift back and forth between SVG and tikz (via Inkscape), once 
they are created by Sage, but that strategy didn't work. :(

Is this a known bug?


Can you try opening the svg file up in inkscape?  It may be a problem 
with eog.  When I open the file in inkscape, the graph looks great. 
When I try to view the svg in chrome, the vertices look fine, but 4 
edges are missing.  Those edges appear just fine in inkscape.


Thanks,

Jason



--
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: Strange behaviour when generating SVG files for (combinatorial) graphs

2012-11-27 Thread P Purkayastha

On 11/28/2012 01:43 PM, Rogério Brito wrote:

Hi there.

I was just trying to get my feet wet with Sage by generating some SVG files of 
graphs for use with my LaTeX documents, but I noticed a problem:

In the following session, with Sage 5.4.1 (actually, 
sage-5.4.1-linux-32bit-ubuntu_12.04.1_lts-i686-Linux) running on a Debian sid 
machine, I get a strange error:

g = graphs.PetersenGraph()
g.plot().save('petersen.png') # generated OK
g.plot().save('petersen.pdf') # also generated OK
g.plot().save('petersen.svg') # not OK



The svg graph shows up fine when viewed in my file browser (as a 
thumbnail), when viewed using display (from imagemagick), when viewed 
using feh (uses imlib2), and when viewed using inkscape. So, I suspect 
it is a problem with your viewer.



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