Re: [sage-support] Re: Emacs support for visiting spkg files?

2011-11-15 Thread Ivan Andrus
Okay, I lied.  It is trivial, but not very efficient, and it probably won't 
work on Windows.  

By adding the following redefinition of jka-compr-get-compression-info it will 
check that it starts with the magic bytes before trying to uncompress.  It 
starts a whole new process though for every file whose name matches something 
in jka-compr-compression-info-list so it _will_ be a performance hit, but since 
opening compressed files is generally slow anyway it might not be noticeable.  
Unfortunately there isn't really any good way to do this in an advice, so if 
the definition changes this will have to be updated manually.

-Ivan

(defun jka-compr-get-compression-info (filename)
 Return information about the compression scheme of FILENAME.
The determination as to which compression scheme, if any, to use is
based on the filename itself and `jka-compr-compression-info-list'.
 (catch 'compression-info
   (let ((case-fold-search nil))
 (dolist (x jka-compr-compression-info-list)
   (and (string-match (jka-compr-info-regexp x) filename)
(if (not (jka-compr-info-file-magic-bytes x))
t ;; No bytes to check so assume it's compressed
  (string= (jka-compr-info-file-magic-bytes x)
   (shell-command-to-string
(format head -c %s %s
(length (jka-compr-info-file-magic-bytes x))
(shell-quote-argument filename)
(throw 'compression-info x)))
 nil)))

On Nov 15, 2011, at 8:50 AM, Ivan Andrus wrote:

 I thought that was what it did, but just adding the magic number leaves it 
 broken for non-compressed spkg's (I checked).  The magic number is only used 
 (as near as I can tell from looking at the emacs source) to decide if the 
 file is already compressed or if it needs to be compressed when it's saving 
 the file.
 
 Honestly, the whole thing seems like an emacs bug, but I'm not sure the 
 maintainers will agree.  It wasn't completely trivial to fix it last night, 
 so I didn't. :-)  If you want I can file a bug report (I would like to be 
 CC'ed if you send one).
 
 -Ivan
 
 On Nov 15, 2011, at 1:47 AM, Bill Janssen wrote:
 
 I see that in John's formulation, there's also a space for a magic
 number for the file.  Maybe that could be used to switch between
 bunzip2 and tar, versus just tar.
 
 On Nov 12, 6:20 pm, Michael Orlitzky mich...@orlitzky.com wrote:
 On 11/12/2011 08:47 PM, Bill Janssen wrote:
 
 You can visit a .tar.bz2 file with GNU Emacs 23, and it works.  If I
 rename the .spkg file to .tar.bz2, it works.  But I don't see how to
 tell Emacs that .spkg == .tar.bz2...
 
 John beat me to it, but this works in your .emacs file.
 
 ;; We have to disable auto-compression-mode first,
 ;; don't ask me why.
 (auto-compression-mode 0)
 
 ;; Add the spkg extension to the list of stuff we want to
 ;; decompress automatically (with bzip2).
 (add-to-list 'jka-compr-compression-info-list
 [\\.spkg$
  zippingbzip2 ()
  unzipping  bzip2 (-d)
  nil t])
 
 ;; Re-enable auto-compression mode.
 (auto-compression-mode 1)
 
 ;; Auto-compression will bunzip2 the spkg file, but then Emacs
 ;; needs to know that it should use tar-mode on what bunzip2 spits
 ;; out.
 (setq auto-mode-alist
  (append
   (list
'(\\.spkg$ . tar-mode)
)
 
   auto-mode-alist))
 

-- 
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
URL: http://www.sagemath.org


Re: [sage-support] Re: Sage 4.7.2 graphics_array incorrect plot sizes

2011-11-15 Thread v_2e
  Hello!

On Mon, 14 Nov 2011 17:29:24 -0600
Jason Grout jason-s...@creativetrax.com wrote:
 ...
 As a work-around, you can do (in the last statement):
 
 curves_plot.show(ymin=0, ymax=0.7, figsize=
 [8,4],aspect_ratio='automatic')
 
  Thank you! That hint really helped! :)

Regards,
  Vladimir

- 
 v...@ukr.net

-- 
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
URL: http://www.sagemath.org


Re: [sage-support] Re: Emacs support for visiting spkg files?

2011-11-15 Thread Michael Orlitzky
On 11/14/11 17:41, Ivan Andrus wrote:
 On Nov 14, 2011, at 8:09 PM, Michael Orlitzky wrote:
 On 11/14/11 08:34, Keshav Kini wrote:
 Will this work for uncompressed SPKGs too?


 Not without modification. If you can't rely on the extension to tell you
 what's in the file, you'll have to use something else.
 
 Don't tell anyone that I showed you how to do this but if you change it to 
 
 ;; Add the spkg extension to the list of stuff we want to
 ;; decompress automatically (with bzip2).
 (add-to-list 'jka-compr-compression-info-list
  [\\.spkg\\'
   zipping   bzip2 ()
   unzipping (bzip2 -d || cat) ()
   nil t BZh])

What a clever non-useless useless use of cat =)

-- 
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
URL: http://www.sagemath.org


[sage-support] Sage Days 36--Bug days near Boston after Joint Meetings in January

2011-11-15 Thread Jason Grout

We are pleased to announce Sage Days 36:

http://wiki.sagemath.org/days36

to be held immediately after the Joint Mathematics Meetings, at Gordon 
College in Wenham, Mass.  This will be, like Sage Days 19 and 27, a 
post-Joint Math Meetings Bug Days event.


We expect the primary emphasis to be fixing AND *reviewing* bugs in
calculus, symbolics, the notebook, and graphics, so we especially
encourage people interested in these to consider attending.  Of
course, as always, any fixing and reviewing of bugs will be welcome! 
There are currently 250 tickets needing review  [1], so there is 
plenty of work to do just in reviewing.


The official days of operation for the event will be Monday-Wednesday,
January 9-11.  However, we anticipate that some people will already
want to get cracking in informal groups on Sunday, January 8th, and we 
will have comfortable oceanside accommodations [2] near Gordon with
wireless to facilitate that; likewise, we expect some continuing 
bug-squashing action on Thursday for those with later flights.   For 
those who are local or would like to stay in Boston, we should have 
shuttle service for specific commuter rail options to the college.


There is funding available to help with travel and accommodations.  The 
number of participants we can cover will depend on how many will need 
flight reimbursement (presumably many people will already be at the 
Joint meetings), so please let Karl-Dieter Crisman know, or reply to 
this email, very soon if you are interested in coming and do not have a 
different source of funding for travel.


Jason Grout
Karl-Dieter Crisman

[1] http://trac.sagemath.org/sage_trac/report/10
[2] http://www.wyliecenter.com/

--
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
URL: http://www.sagemath.org


[sage-support] complex eigenvalues not supported?

2011-11-15 Thread samuel
Hi,

I have the following matrix and want to determine the eigenvalues of
it.

M3=matrix(RR,[
[0, 0.095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.905],
[0.255, 0, 0.745, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0.255, 0, 0.745, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0.905, 0, 0.095, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0.255, 0, 0.745, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0.255, 0, 0.745, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0.905, 0, 0.095, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0.255, 0, 0.745, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0.255, 0, 0.745, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0.905, 0, 0.095, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0.255, 0, 0.745],
[0.745, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.255,0]])
M3.eigenvalues()

I got the following message:

NotImplementedError: eigenvalues() is not implemented for matrices
with
eigenvalues that are not in the fraction field of the base ring or in
QQbar

I have no idea what the message mean as I don't have enough math
backgrounds to make sense of it. I tried to do the same thing on
Mathematica and I got several complex eigenvalues. I wonder if sage
does not support determining complex eigenvalues.

-- 
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
URL: http://www.sagemath.org


Re: [sage-support] complex eigenvalues not supported?

2011-11-15 Thread David Joyner
On Tue, Nov 15, 2011 at 10:59 AM, samuel samuelan...@gmail.com wrote:
 Hi,

 I have the following matrix and want to determine the eigenvalues of
 it.

 M3=matrix(RR,[
 [0, 0.095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.905],
 [0.255, 0, 0.745, 0, 0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0.255, 0, 0.745, 0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0.905, 0, 0.095, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0.255, 0, 0.745, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0.255, 0, 0.745, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0.905, 0, 0.095, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0.255, 0, 0.745, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0.255, 0, 0.745, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0, 0.905, 0, 0.095, 0],
 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0.255, 0, 0.745],
 [0.745, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.255,0]])
 M3.eigenvalues()

 I got the following message:

 NotImplementedError: eigenvalues() is not implemented for matrices
 with
 eigenvalues that are not in the fraction field of the base ring or in
 QQbar

 I have no idea what the message mean as I don't have enough math
 backgrounds to make sense of it. I tried to do the same thing on
 Mathematica and I got several complex eigenvalues. I wonder if sage
 does not support determining complex eigenvalues.


I think you want this:

sage: M3=matrix(CC,[
[0, 0.095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.905],
[0.255, 0, 0.745, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0.255, 0, 0.745, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0.905, 0, 0.095, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0.255, 0, 0.745, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0.255, 0, 0.745, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0.905, 0, 0.095, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0.255, 0, 0.745, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0.255, 0, 0.745, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0.905, 0, 0.095, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0.255, 0, 0.745],
[0.745, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.255,0]])
sage: M3.eigenvalues()
[0.981, 0.942581873717902 + 0.00344425422968659*I,
0.942581873717902 - 0.00344425422968659*I,
0.872055103445802, 0.127944896554073, 0.00688850845748007*I,
-0.00688850845748007*I, -0.127944896554073,
-0.872055103445802, -0.942581873717902 + 0.00344425422968659*I,
-0.942581873717902 - 0.00344425422968659*I, -0.981]
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
 URL: http://www.sagemath.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
URL: http://www.sagemath.org


[sage-support] Re: complex eigenvalues not supported?

2011-11-15 Thread Jason Grout

On 11/15/11 10:09 AM, David Joyner wrote:

On Tue, Nov 15, 2011 at 10:59 AM, samuelsamuelan...@gmail.com  wrote:

Hi,

I have the following matrix and want to determine the eigenvalues of
it.

M3=matrix(RR,[
[0, 0.095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.905],
[0.255, 0, 0.745, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0.255, 0, 0.745, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0.905, 0, 0.095, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0.255, 0, 0.745, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0.255, 0, 0.745, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0.905, 0, 0.095, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0.255, 0, 0.745, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0.255, 0, 0.745, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0.905, 0, 0.095, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0.255, 0, 0.745],
[0.745, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.255,0]])
M3.eigenvalues()

I got the following message:

NotImplementedError: eigenvalues() is not implemented for matrices
with
eigenvalues that are not in the fraction field of the base ring or in
QQbar

I have no idea what the message mean as I don't have enough math
backgrounds to make sense of it. I tried to do the same thing on
Mathematica and I got several complex eigenvalues. I wonder if sage
does not support determining complex eigenvalues.



I think you want this:


Or this:

http://sagenb.org/home/pub/3678/

I think the point here is that by default, the characteristic polynomial 
of a matrix over RR is a polynomial over RR, and it tries to find roots 
in RR.  Of course, these eigenvalues don't all lie in RR, so you get the 
complaint.


I'd also highly suggest that you use either RDF as the field (which uses 
stable numerical algorithms for finding eigenvalues), or use QQ as the 
field (which converts to exact rational numbers, then finds the 
eigenvalues exactly).


I also think it's embarrassing to Sage that if you don't specify the 
field (i.e., just do matrix([...]) with the above matrix), then it 
automatically constructs a matrix over RR and then complains that it 
can't find the eigenvalues.  It really does look like Sage can't find 
the eigenvalues of a simple numeric matrix.  Maybe a RR matrix (53-bit 
precision) should use the scipy routines (like RDF does) to find the 
eigenvalues, at least until a possible alglib interface or something of 
that nature is finished.


Thanks,

Jason


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


[sage-support] Re: Building Sage from source fails on OS X with NFS-mounted home directory

2011-11-15 Thread Bill Janssen
This is a Python bug.  Fixed in late March 2010.

http://bugs.python.org/issue7512

On Nov 14, 4:56 pm, Bill Janssen bill.jans...@gmail.com wrote:
 make test fails as well.  This is Sage 4.7.2 on OS X 10.5.

 Bill

 On Nov 14, 4:44 pm, Bill Janssen bill.jans...@gmail.com wrote:







  I just tried building Sage from source on a PARC machine.  On this
  machine, my home directory is an NFS-mounted share.  The build fails
  with a shower of messages of this form:

  Build finished.  The built documents can be found in /local/sage-4.7.2/
  devel/sage/doc/output/html/en/numerical_sage
  Traceback (most recent call last):
    File /local/sage-4.7.2/devel/sage/doc/common/builder.py, line
  1059, in module
      getattr(get_builder(name), type)()
    File /local/sage-4.7.2/devel/sage/doc/common/builder.py, line 243,
  in _wrapper
      getattr(get_builder(document), name)(*args, **kwds)
    File /local/sage-4.7.2/devel/sage/doc/common/builder.py, line 354,
  in _wrapper
      self.write_auto_rest_file(module_name)
    File /local/sage-4.7.2/devel/sage/doc/common/builder.py, line 593,
  in write_auto_rest_file
      title = self.get_module_docstring_title(module_name)
    File /local/sage-4.7.2/devel/sage/doc/common/builder.py, line 563,
  in get_module_docstring_title
      import sage.all
    File /local/sage-4.7.2/local/lib/python2.6/site-packages/sage/
  all.py, line 321, in module
      sage.misc.lazy_import.save_cache_file()
    File lazy_import.pyx, line 817, in
  sage.misc.lazy_import.save_cache_file (sage/misc/lazy_import.c:4503)
    File /local/sage-4.7.2/local/lib/python/shutil.py, line 264, in
  move
      copy2(src, real_dst)
    File /local/sage-4.7.2/local/lib/python/shutil.py, line 100, in
  copy2
      copystat(src, dst)
    File /local/sage-4.7.2/local/lib/python/shutil.py, line 77, in
  copystat
      os.chflags(dst, st.st_flags)
  OSError: [Errno 45] Operation not supported: '/tilde/janssen/.sage/
  _Volumes_data_local_sage-4.7.2_devel_sage-main-
  lazy_import_cache.pickle'
  make: *** [doc-html] Error 1
  %

  Can this safely be ignored?

-- 
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
URL: http://www.sagemath.org


[sage-support] Re: Error on variables used by find_fit

2011-11-15 Thread Aran
V is a List of x,y-Tuples, here is some original data:

V=[[0, 3.4902], [10, 36.297], [20,
70.297], [30, 101.3], [40, 128.41], [50,
153.41], [60, 176.69], [70, 202.0], [80,
228.0],
[90, 255.0], [100, 281.0], [110, 306.0], [120, 334.0], [130, 365.0],
[140, 392.0], [150, 415.0], [160, 444.0], [170, 469.0], [180, 493.0],
[190, 516.0], [200, 538.0], [210, 559.0], [220, 579.0], [230, 599.0],
[240, 616.0], [250, 633.0], [260, 649.0], [270, 661.0], [280, 675.0],
[290, 686.0], [300, 699.0], [310, 711.0], [320, 719.0], [330, 727.0],
[340, 735.0], [350, 741.0], [360, 746.0], [370, 750.0], [380, 754.0],
[390, 757.0], [400, 760.0], [410, 762.0], [420, 764.0], [450, 772.0],
[480, 777.0]]

As far as I tested it, it's not data related (used lots of other data
with the same structure,)

Info on my system: Im using sage 4.7.1/ubuntu 11.10 on a Core i3
370M@6GByte Ram

On 14 Nov., 17:23, kcrisman kcris...@gmail.com wrote:
 I was trying to reproduce this failure, but I think you may have
 forgotten to add something.  What is V?

 Thanks - hopefully we can get to the bottom of this.

 - kcrisman

 On Nov 13, 6:21 pm, Aran arant...@freenet.de wrote:







  I'm using sage for data analysis and number crunching in my physical
  chemistry class and stumbled on a curiosity while replacing the
  variables that are used by find_fit:

  When replacing variables like 'a, b ,c' for 'c1, c2, c3' on a 11th
  degree polynomial the whole find_fit-function goes nuts and the former
  nicely fitting function doesn't fit at all anymore.

  Example:
  While the following code works perfectly:

  var('a b c d f g j h k l n o')
  model(x) = a*x
  +b*x^(2)+c*x^(3)+d*x^(4)+f*x^(5)+g*x^(6)+h*x^(7)+j*x^(8)+k*x^(9)+l*x^(10)+n 
  *x^(11)+o
  m=find_fit(V,model)
  Temp(x)=model(a=m[0].rhs(),b=m[1].rhs(),c=m[2].rhs(),d=m[3].rhs(),f=m[4].rh 
  s(),g=m[5].rhs(),h=m[6].rhs(),j=m[7].rhs(),k=m[8].rhs(),l=m[9].rhs(),n=m[10 
  ].rhs(),o=m[11].rhs())

  The following code does not (replaced only 'a' by 'k1') and Temp(x)
  shoots off to infinity at some point:

  var('k1 b c d f g j h k l n o')
  model(x) = k1*x
  +b*x^(2)+c*x^(3)+d*x^(4)+f*x^(5)+g*x^(6)+h*x^(7)+j*x^(8)+k*x^(9)+l*x^(10)+m 
  *x^(11)+o
  m=find_fit(V,model)
  Temp(x)=model(k1=m[0].rhs(),b=m[1].rhs(),c=m[2].rhs(),d=m[3].rhs(),f=m[4].r 
  hs(),g=m[5].rhs(),h=m[6].rhs(),j=m[7].rhs(),k=m[8].rhs(),l=m[9].rhs(),n=m[1 
  0].rhs(),o=m[11].rhs())

-- 
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
URL: http://www.sagemath.org


[sage-support] Re: Building Sage from source fails on OS X with NFS-mounted home directory

2011-11-15 Thread Maarten Derickx
Ah, then this issue will hopefully be fixed with changing the python in 
sage to 2.7. There is already work being done on that issue 
at http://trac.sagemath.org/sage_trac/ticket/9958 . You can also find a new 
spkg there, so with that spkg you might be able to build from source. But 
the doctest will give probably still a lot of failures.

-- 
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
URL: http://www.sagemath.org


[sage-support] problems launching Sage on a Mac

2011-11-15 Thread Raymond N. Greenwell
Although I got Sage working on my home computer (an iMac), I haven't
had similar success at my office (a similar iMac). When I launch Sage,
the following messages appear in Terminal on my Mac:
Last login: Tue Nov 15 09:16:27 on console
'/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/'/
sage --notebook
dhcp-147-4-180-138:~ matrngnew$ '/Applications/Sage-4.7.2-
OSX-64bit-10.6.app/Contents/Resources/sage/'/sage --notebook
/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/
local/bin/sage-sage: line 597: sage-notebook: command not found
dhcp-147-4-180-138:~ matrngnew$

In Sage, when I selected New Worksheet (whether under the File menu or
the Server menu), I got the following message in my browser:
Oops! Google Chrome could not connect to localhost:8000

What am I doing wrong?

Thanks!

-- 
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
URL: http://www.sagemath.org


[sage-support] Elliptic Jacobi functions

2011-11-15 Thread Oscar Lazo

Hi

Is there some way to calculate elliptic Jacobi functions in sage?

http://en.wikipedia.org/wiki/Jacobi_elliptic_function

thanks!

Oscar

--
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
URL: http://www.sagemath.org


Re: [sage-support] problems launching Sage on a Mac

2011-11-15 Thread Justin C. Walker
I think the second error occurs due to the first: there is no notebook server 
listening for requests from your browser.

I think you get th

iPhone, therefore I am.


On Nov 15, 2011, at 15:48, Raymond N. Greenwell mat...@gmail.com wrote:

 Although I got Sage working on my home computer (an iMac), I haven't
 had similar success at my office (a similar iMac). When I launch Sage,
 the following messages appear in Terminal on my Mac:
 Last login: Tue Nov 15 09:16:27 on console
 '/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/'/
 sage --notebook
 dhcp-147-4-180-138:~ matrngnew$ '/Applications/Sage-4.7.2-
 OSX-64bit-10.6.app/Contents/Resources/sage/'/sage --notebook
 /Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/
 local/bin/sage-sage: line 597: sage-notebook: command not found
 dhcp-147-4-180-138:~ matrngnew$
 
 In Sage, when I selected New Worksheet (whether under the File menu or
 the Server menu), I got the following message in my browser:
 Oops! Google Chrome could not connect to localhost:8000
 
 What am I doing wrong?
 
 Thanks!
 
 -- 
 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
 URL: http://www.sagemath.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
URL: http://www.sagemath.org


Re: [sage-support] Re: Error on variables used by find_fit

2011-11-15 Thread D. S. McNeil
You're assuming that the fit function is going to return the variables
in the same order in both cases, so that (e.g.) a and k1 will be the
first in both cases.  That's not true, though.  I found:

[a == 3.4102956225507519, b == 0.010344876276231638, c ==
-0.00094076216744204172, d == (1.8097013599216266e-05), f ==
(-1.7547848824431721e-07), g == (1.0168442135198695e-09), h ==
(-3.7548063250237949e-12), j == (8.9493796546766707e-15), k ==
(-1.3366803967120946e-17), l == (1.1398034585075684e-20), n ==
(-4.2382572237693009e-24), o == 3.0511588067264963]

[b == 0.010358179948437265, c == -0.00094126295808369734, d ==
(1.8106258279315326e-05), f == (-1.7557568485259962e-07), g ==
(1.0174721357045694e-09), h == (-3.7573869398464435e-12), j ==
(8.9561476716220824e-15), k == (-1.331928232302e-17), k1 ==
3.4101714386786477, l == (1.1408041039846924e-20), n ==
(-4.242187409468519e-24), o == 3.0512548011942671]

so the indexing is all off.  Not surprising the second one explodes.
Return order looks to be alphabetical, but I'm too lazy to find out if
that's guaranteed.  In any case, we can use a solution_dict instead to
make life much easier.

So what I'd recommend, given your V, is something like this:

sage: N_order = 12
sage:
sage: # make a list of symbolic variables
sage: coeffs = list(var(c_%d % i) for i in range(N_order))
sage: coeffs
[c_0, c_1, c_2, c_3, c_4, c_5, c_6, c_7, c_8, c_9, c_10, c_11]
sage:
sage: # build the model [here just a polynomial]
sage: model(x) = sum(c_i*x**i for i, c_i in enumerate(coeffs))
sage: model
x |-- c_11*x^11 + c_10*x^10 + c_9*x^9 + c_8*x^8 + c_7*x^7 + c_6*x^6 +
c_5*x^5 + c_4*x^4 + c_3*x^3 + c_2*x^2 + c_1*x + c_0
sage:
sage: # actually fit it, returning a dictionary
sage: mfit = find_fit(V, model, solution_dict=True)
sage: mfit
{c_7: -3.7564661583891436e-12, c_0: 3.0514755095206816, c_6:
1.0172525553243703e-09, c_11: -4.2407560895324755e-24, c_10:
1.1404399242138324e-20, c_3: -0.00094112724266502126, c_9:
-1.3373790954916053e-17, c_2: 0.010355836374653954, c_4:
1.8103350226003258e-05, c_1: 3.4101603849319178, c_8:
8.9537056388588457e-15, c_5: -1.7554291229990257e-07}
sage:
sage: # substitute these values into the model, getting a function
sage: mfunc = model.subs(mfit)
sage: mfunc
x |-- -(4.2407560895324755e-24)*x^11 + (1.1404399242138324e-20)*x^10
- (1.3373790954916053e-17)*x^9 + (8.9537056388588457e-15)*x^8 -
(3.7564661583891436e-12)*x^7 + (1.0172525553243703e-09)*x^6 -
(1.7554291229990257e-07)*x^5 + (1.8103350226003258e-05)*x^4 -
0.00094112724266502126*x^3 + 0.010355836374653954*x^2 +
3.4101603849319178*x + 3.0514755095206816
sage:

This way I don't have to worry about keeping all those letters
straight.  Note though that unless you're sure it really is a
polynomial, in general fitting data with a high-order polynomial is a
very bad idea (pretty unstable).

Does that help?


Doug

-- 
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
URL: http://www.sagemath.org


Re: [sage-support] problems launching Sage on a Mac

2011-11-15 Thread Justin C. Walker
Oops.  Premature transmission.  Sorry about that.

To continue: I'm not sure why you get that failure; I can't reproduce it here.  
I'll try to get it to happen, but I hope someone on the list will leap in with 
the answer.

Justin

iPhone, therefore I am.


On Nov 15, 2011, at 15:48, Raymond N. Greenwell mat...@gmail.com wrote:

 Although I got Sage working on my home computer (an iMac), I haven't
 had similar success at my office (a similar iMac). When I launch Sage,
 the following messages appear in Terminal on my Mac:
 Last login: Tue Nov 15 09:16:27 on console
 '/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/'/
 sage --notebook
 dhcp-147-4-180-138:~ matrngnew$ '/Applications/Sage-4.7.2-
 OSX-64bit-10.6.app/Contents/Resources/sage/'/sage --notebook
 /Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/
 local/bin/sage-sage: line 597: sage-notebook: command not found
 dhcp-147-4-180-138:~ matrngnew$
 
 In Sage, when I selected New Worksheet (whether under the File menu or
 the Server menu), I got the following message in my browser:
 Oops! Google Chrome could not connect to localhost:8000
 
 What am I doing wrong?
 
 Thanks!
 
 -- 
 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
 URL: http://www.sagemath.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
URL: http://www.sagemath.org


[sage-support] Re: problems launching Sage on a Mac

2011-11-15 Thread kcrisman
Hi Ray!  Good to hear from you in this venue.

Yes, somehow the server didn't start.  Here are a few things to try.

1) Try going to the menu item on the bar (the mini-icon) and choosing
the option which starts a command line session (I don't have it
installed, so I don't remember the exact wording) and then typing 2+2
or something to verify that works.

2) Do the following in Terminal:

cd /Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage
./sage

This will test if Sage starts as well, I think.

3) Try looking for sage-notebook by doing

cd /Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/
local/bin
ls sage-notepress tab key

The file should be there, hopefully.

- kcrisman

On Nov 15, 6:48 pm, Raymond N. Greenwell mat...@gmail.com wrote:
 Although I got Sage working on my home computer (an iMac), I haven't
 had similar success at my office (a similar iMac). When I launch Sage,
 the following messages appear in Terminal on my Mac:
 Last login: Tue Nov 15 09:16:27 on console
 '/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/'/
 sage --notebook
 dhcp-147-4-180-138:~ matrngnew$ '/Applications/Sage-4.7.2-
 OSX-64bit-10.6.app/Contents/Resources/sage/'/sage --notebook
 /Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/
 local/bin/sage-sage: line 597: sage-notebook: command not found
 dhcp-147-4-180-138:~ matrngnew$

 In Sage, when I selected New Worksheet (whether under the File menu or
 the Server menu), I got the following message in my browser:
 Oops! Google Chrome could not connect to localhost:8000

 What am I doing wrong?

 Thanks!

-- 
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
URL: http://www.sagemath.org


[sage-support] Re: Elliptic Jacobi functions

2011-11-15 Thread kcrisman
There are some examples at 
http://www.sagemath.org/doc/reference/sage/functions/special.html
- not sure they are ideal for you, but you can look.

You can also use Maxima in Sage to do so.

http://maxima.sourceforge.net/docs/manual/en/maxima_16.html

- kcrisman

On Nov 15, 6:53 pm, Oscar Lazo algebraicame...@gmail.com wrote:
 Hi

 Is there some way to calculate elliptic Jacobi functions in sage?

 http://en.wikipedia.org/wiki/Jacobi_elliptic_function

 thanks!

 Oscar

-- 
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
URL: http://www.sagemath.org


[sage-support] Re: Elliptic Jacobi functions

2011-11-15 Thread Jason Grout

On 11/15/11 8:15 PM, kcrisman wrote:

There are some examples at 
http://www.sagemath.org/doc/reference/sage/functions/special.html
- not sure they are ideal for you, but you can look.

You can also use Maxima in Sage to do so.

http://maxima.sourceforge.net/docs/manual/en/maxima_16.html


You could also use mpmath, which is included in Sage:

http://mpmath.googlecode.com/svn/tags/0.17/doc/build/index.html


In particular: 
http://mpmath.googlecode.com/svn/tags/0.17/doc/build/functions/elliptic.html#jacobi-elliptic-functions


Jason

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