Re: [sage-support] Re: Sage and IPython: inline graphics?

2015-05-19 Thread Jose Guzman
I've just checked ask.sagemath.org and this is already implemented in 
Sage 6.6 and above. Just simply by calling sage with IPython (either by
'sage -n ipython'  or by 'sage -ipython notebook') you can choose in the 
New popup window the option Sage


This is such a nice feature

Thanks a lot!

Jose

On 19/05/15 15:25, Jose Guzman wrote:

Well, the only trick I found until now was this:

http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/




On 19/05/15 14:54, Volker Braun wrote:

Does work now! Try "sage --notebook=ipython"



On Tuesday, May 19, 2015 at 1:01:28 PM UTC+2, Jose Guzman wrote:

Hi everybody,

After a long time out, I'm coming back to use Sage. Is there
development
about the inline plotting of Sage in Ipython notebook?
Is it possible now?

Last post I found is here:
https://groups.google.com/forum/#!topic/sage-support/9pUhO8wO4nE
<https://groups.google.com/forum/#!topic/sage-support/9pUhO8wO4nE>


Thanks

Jose
--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google
Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sage-support+unsubscr...@googlegroups.com
<mailto:sage-support+unsubscr...@googlegroups.com>.
To post to this group, send email to sage-support@googlegroups.com
<mailto:sage-support@googlegroups.com>.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.






--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Sage and IPython: inline graphics?

2015-05-19 Thread Jose Guzman

Well, the only trick I found until now was this:

http://ask.sagemath.org/question/10988/in-line-graphics-for-sage-in-ipython-notebook/



On 19/05/15 14:54, Volker Braun wrote:

Does work now! Try "sage --notebook=ipython"



On Tuesday, May 19, 2015 at 1:01:28 PM UTC+2, Jose Guzman wrote:

Hi everybody,

After a long time out, I'm coming back to use Sage. Is there
development
about the inline plotting of Sage in Ipython notebook?
Is it possible now?

Last post I found is here:
https://groups.google.com/forum/#!topic/sage-support/9pUhO8wO4nE
<https://groups.google.com/forum/#!topic/sage-support/9pUhO8wO4nE>


Thanks

    Jose
    --
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google
Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sage-support+unsubscr...@googlegroups.com
<mailto:sage-support+unsubscr...@googlegroups.com>.
To post to this group, send email to sage-support@googlegroups.com
<mailto:sage-support@googlegroups.com>.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.



--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Sage and IPython: inline graphics?

2015-05-19 Thread Jose Guzman

Hi everybody,

After a long time out, I'm coming back to use Sage. Is there development 
about the inline plotting of Sage in Ipython notebook?

Is it possible now?

Last post I found is here: 
https://groups.google.com/forum/#!topic/sage-support/9pUhO8wO4nE



Thanks

Jose
--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Error in "warning" directive when installing

2014-06-02 Thread Jose Guzman

On 01/06/14 17:59, leif wrote:

Jose Guzman wrote:

When trying to install Sage 6.2 from sources I got the following error:


   File "/home/jguzman/sage-6.2/src/doc/common/builder.py", line 1477,
in 
 getattr(get_builder(name), type)()
   File "/home/jguzman/sage-6.2/src/doc/common/builder.py", line 276, in
_wrapper
 getattr(get_builder(document), 'inventory')(*args, **kwds)
   File "/home/jguzman/sage-6.2/src/doc/common/builder.py", line 487, in
_wrapper
 x.get(9)
   File
"/home/jguzman/sage-6.2/local/lib/python/multiprocessing/pool.py", line
554, in get
 raise self._value
OSError: [matrices ] docstring of sage.matrix.matrix1.Matrix:10: ERROR:
Error in "warning" directive:

make: *** [doc-html] Error 1

Is there anything I'm missing?


Probably depends on what exactly you did... ;-)

Does the error persist when you retry 'make doc' (or 'make doc-clean &&
make doc' -- note that the latter currently requires a system-wide
version of git to be installed, cf. #16303)?

I've seen similar on an apparently /somehow/^TM broken installation
where I tried upgrading from a late 6.2.beta to an early 6.3.beta, but
only when running './sage --docbuild reference html' directly; with
'make doc' (or 'all' instead of just 'reference'), docbuilding simply
gets stuck, i.e., hangs indefinitely; cf. recent threads on sage-devel
(and probably better post there).

My impression is that docbuilding with Python's multiprocessing doesn't
work reliably, but so far failed to really track this down.


-leif



What I did is simply untar the sources and type make -j4.

I did as you suggested, and typed make doc-clean && make doc, and found 
the following problem:


Error building the documentation.

Traceback (most recent call last):
  File "/home/jguzman/sage-6.2/src/doc/common/builder.py", line 1477, 
in 

getattr(get_builder(name), type)()
  File "/home/jguzman/sage-6.2/src/doc/common/builder.py", line 276, in 
_wrapper

getattr(get_builder(document), 'inventory')(*args, **kwds)
  File "/home/jguzman/sage-6.2/src/doc/common/builder.py", line 487, in 
_wrapper

x.get(9)
  File 
"/home/jguzman/sage-6.2/local/lib/python/multiprocessing/pool.py", line 
554, in get

raise self._value
OSError: [combinat ] 
/home/jguzman/sage-6.2/local/lib/python2.7/site-packages/sage/combinat/abstract_tree.py:docstring 
of sage.combinat.abstract_tree:6: ERROR: Error in "NOTE" directive:


make: *** [doc-html] Error 1


I have git installed system wide

$> which git
$> /usr/bin/git

Any other suggestion?

I would be happy to review a patch after getting the installation done.

Jose
--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Error in "warning" directive when installing

2014-06-01 Thread Jose Guzman

When trying to install Sage 6.2 from sources I got the following error:


  File "/home/jguzman/sage-6.2/src/doc/common/builder.py", line 1477, 
in 

getattr(get_builder(name), type)()
  File "/home/jguzman/sage-6.2/src/doc/common/builder.py", line 276, in 
_wrapper

getattr(get_builder(document), 'inventory')(*args, **kwds)
  File "/home/jguzman/sage-6.2/src/doc/common/builder.py", line 487, in 
_wrapper

x.get(9)
  File 
"/home/jguzman/sage-6.2/local/lib/python/multiprocessing/pool.py", line 
554, in get

raise self._value
OSError: [matrices ] docstring of sage.matrix.matrix1.Matrix:10: ERROR: 
Error in "warning" directive:


make: *** [doc-html] Error 1

Is there anything I'm missing?

Thanks

--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] integrating an expression with a dirac_delta function.

2013-11-28 Thread Jose Guzman

Hey David,

thank you very much for your answer. Finally, i decided to solve it 
numerically just implementing an implicit Euler rule.


Thanks a lot!

Jose

On 28/11/13 14:14, David Joyner wrote:

On Thu, Nov 28, 2013 at 4:37 AM, Jose Guzman  wrote:

Hi everybody,

I want to solve the following ODE:

dp/dt = (1-p)/tau - u*p*delta(t-tOn)

In principle, desolve_odeint should be able to do it. However, in sage

sage: import numpy as np
sage: from sage.calculus.desolvers import desolve_odeint

sage: p = var('p')
sage: t = var('t')
sage: tau = 2
sage: u = 0.8

sage: myode(t) = (1-p)/tau - u*p*dirac_delta(t)

sage: tlist = np.arange(0,10,0.01)

sage: desolve_odeint(des = myode, ics = [0,1], times = tlist, dvars =[p])

desolve_odeint is a numerical routine and delta is not a function, so
I don't see how you can solve it this way.

Does this entry in the ref manual help?
http://sage.math.washington.edu/tmp/sage-2.8.12.alpha0/doc/ref/node125.html



The error is that expression does not support indexing. Then,  how can I
define the array of vectors that contain the independent variable in sage?

Thanks in advance

Jose

--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.



--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] integrating an expression with a dirac_delta function.

2013-11-28 Thread Jose Guzman

Hi everybody,

I want to solve the following ODE:

dp/dt = (1-p)/tau - u*p*delta(t-tOn)

In principle, desolve_odeint should be able to do it. However, in sage

sage: import numpy as np
sage: from sage.calculus.desolvers import desolve_odeint

sage: p = var('p')
sage: t = var('t')
sage: tau = 2
sage: u = 0.8

sage: myode(t) = (1-p)/tau - u*p*dirac_delta(t)

sage: tlist = np.arange(0,10,0.01)

sage: desolve_odeint(des = myode, ics = [0,1], times = tlist, dvars =[p])

The error is that expression does not support indexing. Then,  how can I 
define the array of vectors that contain the independent variable in sage?


Thanks in advance

Jose

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-support] Re: Syntax highlighting in sage notebook

2013-11-26 Thread Jose Guzman




http://pub.ist.ac.at/~jguzman/doc/neuron/tutorial/Tutorial0.html#to-build-the-neuron-shared-library-for-python


Thanks -- so it's a library for "Computational Neuroscience"?  Cool.
Maybe I should just make it available systemwide for everybody, and
update it regularly?



Yes, it's a platform for simulations of the electrical properties of 
neurons based on the cable equation. I use it a lot in combination with 
Sage. To have it all together in the cloud would be awesome!


Jose

--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-support] Re: Syntax highlighting in sage notebook

2013-11-26 Thread Jose Guzman

On 26/11/13 19:01, William Stein wrote:

On Tue, Nov 26, 2013 at 9:47 AM, Jose Guzman  wrote:

On 26/11/13 16:47, William Stein wrote:


On Tue, Nov 26, 2013 at 7:36 AM, Jose Guzman  wrote:


On 26/11/13 16:18, Jason Grout wrote:



On 11/26/13 9:11 AM, Volker Braun wrote:



IHMO overhauling the notebook code is one of the important problems to
attach once the git transition is done... But I don't think it would be
a good use of developer time to make sweeping changes to the current
codebase.



I see (at least at the current rate of development) a personal version
of cloud replacing the current notebook as the best direction to go.
That's part of the reason why I'm not currently working on the sagenb
codebase.

Thanks,

Jason




Wov, I did not know about sage cloud. Did I understand correctly that the
current notebook will be replaced by something like the sage cloud?



Yes, or at least supplemented by it (so both are an option).

If you login to an https://cloud.sagemath.com account, create a
project, then open a terminal and look in the .sagemathcloud
directory, you'll see some python and coffeescript code.   If you
combine that with the Javascript code running in the browser,
then do a bunch of extra work to improve local_hub.coffee to directly
serve client requests, you'll end up with a simple one-project
version of cloud.sagemath, which should be BSD licensed (when
possible).   I'm not planning to do this project until I've finished
my
main goals with the public cloud.sagemath site, though I could
possibly encourage other people to do so...

There is also the rewrite of the sagenb UI that Samuel wrote, which
should presumably go into the git sage soon?



The sage cloud is fantastic, this is exactly what I was expecting from a
notebook!

However,  at some point I would like to run some scripts in my local machine
(due to dependencies with some python modules).



You can install (essentially) any possible python modules into SMC.   See, e.g.,

https://github.com/sagemath/cloud/wiki/FAQ#wiki-pip

and several other related answers (e.g., about building Sage, etc.).



Very nice FAQ, however, the package I would like to use is not that easy 
to install. Look at how I installed it so far:


http://pub.ist.ac.at/~jguzman/doc/neuron/tutorial/Tutorial0.html#to-build-the-neuron-shared-library-for-python


--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-support] Re: Syntax highlighting in sage notebook

2013-11-26 Thread Jose Guzman

On 26/11/13 16:47, William Stein wrote:

On Tue, Nov 26, 2013 at 7:36 AM, Jose Guzman  wrote:

On 26/11/13 16:18, Jason Grout wrote:


On 11/26/13 9:11 AM, Volker Braun wrote:


IHMO overhauling the notebook code is one of the important problems to
attach once the git transition is done... But I don't think it would be
a good use of developer time to make sweeping changes to the current
codebase.



I see (at least at the current rate of development) a personal version
of cloud replacing the current notebook as the best direction to go.
That's part of the reason why I'm not currently working on the sagenb
codebase.

Thanks,

Jason




Wov, I did not know about sage cloud. Did I understand correctly that the
current notebook will be replaced by something like the sage cloud?


Yes, or at least supplemented by it (so both are an option).

If you login to an https://cloud.sagemath.com account, create a
project, then open a terminal and look in the .sagemathcloud
directory, you'll see some python and coffeescript code.   If you
combine that with the Javascript code running in the browser,
then do a bunch of extra work to improve local_hub.coffee to directly
serve client requests, you'll end up with a simple one-project
version of cloud.sagemath, which should be BSD licensed (when
possible).   I'm not planning to do this project until I've finished
my
main goals with the public cloud.sagemath site, though I could
possibly encourage other people to do so...

There is also the rewrite of the sagenb UI that Samuel wrote, which
should presumably go into the git sage soon?



The sage cloud is fantastic, this is exactly what I was expecting 
from a notebook!


However,  at some point I would like to run some scripts in my local 
machine (due to dependencies with some python modules).


--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-support] Re: Syntax highlighting in sage notebook

2013-11-26 Thread Jose Guzman

On 26/11/13 16:18, Jason Grout wrote:

On 11/26/13 9:11 AM, Volker Braun wrote:

IHMO overhauling the notebook code is one of the important problems to
attach once the git transition is done... But I don't think it would be
a good use of developer time to make sweeping changes to the current
codebase.



I see (at least at the current rate of development) a personal version
of cloud replacing the current notebook as the best direction to go.
That's part of the reason why I'm not currently working on the sagenb
codebase.

Thanks,

Jason




Wov, I did not know about sage cloud. Did I understand correctly that 
the current notebook will be replaced by something like the sage cloud?


--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Syntax highlighting in sage notebook

2013-11-26 Thread Jose Guzman
I wondered if it there is some effort (e.g a patch in the track system) 
to provide some kind of syntax highlighting in the Sage notebook, just 
like the one shown in the Sage cell server.


I'm using Sage 5.11 compiled from sources in Debian use the notebook 
with Iceweasel.


Thanks

Jose
--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-support] Sage crashed after installing IPython

2013-09-08 Thread Jose Guzman

On 08/09/13 16:09, William Stein wrote:

On Sun, Sep 8, 2013 at 6:54 AM, Jose Guzman  wrote:

I've just installed Sage from sources and it crashed. I'm not sure if this
may be an issue, but I've just  installed IPython from sources as user too.

Attached you can find the crash report as suggested by the message

Thanks in advance



Sage -- as shipped -- is not compatible with IPython 1.0.0, which
makes some significant API changes.

See http://trac.sagemath.org/ticket/14713

and apply this patch to the SAGE_ROOT/devel/sage/  hg repo:

  http://wstein.org/home/wstein/tmp/trac-14713.patch



It worked like a charm! Thanks a lot!

Jose

--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Sage crashed after installing IPython

2013-09-08 Thread Jose Guzman
I've just installed Sage from sources and it crashed. I'm not sure if 
this may be an issue, but I've just  installed IPython from sources as 
user too.


Attached you can find the crash report as suggested by the message

Thanks in advance

Jose
--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.
***

IPython post-mortem report

{'codename': 'An Afternoon Hack',
 'commit_hash': '02da31c',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/home/jguzman/.local/lib/python2.7/site-packages/IPython',
 'ipython_version': '1.0.0',
 'os_name': 'posix',
 'platform': 'Linux-3.2.0-36-generic-x86_64-with-debian-wheezy-sid',
 'sys_executable': '/home/jguzman/sage-5.11/local/bin/python',
 'sys_platform': 'linux2',
 'sys_version': '2.7.5 (default, Aug 26 2013, 12:55:34) \n[GCC 4.6.3]'}

***



***

Crash traceback:

---
TypeErrorPython 2.7.5: /home/jguzman/sage-5.11/local/bin/python
   Sun Sep  8 15:49:08 2013
A problem occured executing Python code.  Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/home/jguzman/sage-5.11/local/bin/sage-ipython in ()
  2 # -*- coding: utf-8 -*-
  3 """
  4 Sage IPython startup script.
  5 """
  6 from sage.misc.interpreter import SageTerminalApp
  7 
  8 # installs the extra readline commands before the IPython 
initialization begins.
  9 from sage.misc.readline_extra_commands import *
 10 
 11 # Make sure we're using the Sage profile if one isn't specified.
 12 import sys
 13 if '--profile' not in sys.argv:
 14 sys.argv.extend(['--profile', 'sage'])
 15 
 16 app = SageTerminalApp.instance()
---> 17 app.initialize()
global app.initialize = >
 18 app.start()

/home/jguzman/.local/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.pyc
 in initialize(self=, argv=None)

/home/jguzman/.local/lib/python2.7/site-packages/IPython/config/application.pyc 
in catch_config_error(method=, 
app=, *args=(None,), **kwargs={})
 74 
 75 
#-
 76 # Application class
 77 
#-
 78 
 79 @decorator
 80 def catch_config_error(method, app, *args, **kwargs):
 81 """Method decorator for catching invalid config 
(Trait/ArgumentErrors) during init.
 82 
 83 On a TraitError (generally caused by bad config), this will print 
the trait's
 84 message, and exit the app.
 85 
 86 For use on init methods, to prevent invoking excepthook on invalid 
input.
 87 """
 88 try:
---> 89 return method(app, *args, **kwargs)
method = 
app = 
args = (None,)
kwargs = {}
 90 except (TraitError, ArgumentError) as e:
 91 app.print_help()
 92 app.log.fatal("Bad config encountered during initialization:")
 93 app.log.fatal(str(e))
 94 app.log.debug("Config at the time: %s", app.config)
 95 app.exit(1)
 96 
 97 
 98 class ApplicationError(Exception):
 99 pass
100 
101 class LevelFormatter(logging.Formatter):
102 """Formatter with additional `highlevel` record
103 
104 This field is empty if log level is less than highlevel_limit,

/home/jguzman/.local/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.pyc
 in initialize(self=, argv=None)
309 
310 @catch_config_error
311 def initialize(self, argv=None):
312 """Do actions after construct, but before starting the app."""
313 super(TerminalIPythonApp, self).initialize(argv)
314 if self.subapp

[sage-support] Ipython Error after install sage 5.11

2013-08-26 Thread Jose Guzman

Hi everybody

I've newly installed IPython 1.0 and sage 5.11 from sources and found 
everything OK. However, when starting sage, I found the following the error:


http://pastebin.com/PP09gGd4

I would appreciate some hint

Thanks

Jose
--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-support] Re: Sage does not solve system of symbolic equations

2013-08-14 Thread Jose Guzman
Very impressive Emmanuel!


On 13 August 2013 23:45, Emmanuel Charpentier  wrote:

> See enclosed file (it's long enough to be worth of \LaTeX{}ing it, and
> this does not easily cuts'npastes...).
>
> HTH,
>
> Emmanuel Charpentier
>
> PS: \sagetex has currently some serious problems. More on this after a bit
> of exploration...
>
> Le vendredi 9 août 2013 19:21:58 UTC+2, jamedrano a écrit :
>
>> I'm trying to use Sage for optimization using the Lagrange multipliers
>> method, but it does not solve this apparently simple problem:
>>
>> var('x y l')
>>
>> f = x + 2*y
>>
>> g = 2*x^(1/4)*y^(1/2)
>>
>> L = f - l * (16 - g)
>>
>> dfdx = L.diff(x)
>>
>> dfdy = L.diff(y)
>>
>> dfdl = L.diff(l)
>>
>> solve([dfdx == 0, dfdy == 0, dfdl == 0], x,y,l)
>>
>> First Sage takes a very long time and then it just returns the equations,
>> not the solutions.
>>
>> Is this a bug or am I doing something wrong?
>>
>>
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-support] Re: Limit with gamma function gives incorrect answer

2013-08-11 Thread Jose Guzman

On 07/08/13 15:35, kcrisman wrote:



On Wednesday, August 7, 2013 12:01:49 AM UTC-4, Ed Scheinerman wrote:

When I try this:

sage: y = gamma(x+1/2)/gamma(x)/sqrt(x)
sage: limit(y,x=oo)
0
sage: plot(y,x,1,50)

I observe that the limit appears to be 1, not 0.


This is how it happens in Maxima.

(%i2) y:gamma(x+1/2)/(sqrt(x)*gamma(x));
1
  gamma(x + -)
2
(%o2)  
sqrt(x) gamma(x)
(%i3) limit(y,x,0);
(%o3)  0


I've reported this at https://sourceforge.net/p/maxima/bugs/2621/ - if
someone can open a Sage ticket for this, it would be helpful, as I don't
have tons of internet time right now.




Reported in http://trac.sagemath.org/ticket/15033#ticket

#15033: Wrong limit value of expression involving gamma function


--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Displaying plots in inline mode for IPython notebook

2013-06-06 Thread Jose Guzman
This was a very good idea!

Now I generate the plots as you mentioned:

The trick was to use IPython.display to take the png files. Like this:


x = var('x')
plot(sin(x), 0, 2*pi).save('/path/to/directory/file.png')
from IPython.display import display, Image
display(Image('/path/to/directory/file.png'))

On Sunday, June 2, 2013 11:34:06 AM UTC+2, P Purkayastha wrote:
>
> In Sage the plots appear "inline", but the plots are saved as files in a 
> directory structure within the working worksheet directory. From my reading 
> here:
>
> http://ipython.org/ipython-doc/dev/interactive/htmlnotebook.html#the-notebook-format
> it appears that the ipython notebook saves everything inside a single json 
> file, which is probably also how one gets everything "inline". I am just 
> thinking out loud; not sure if this is exactly how it works - but it does 
> look like it is not compatible with how the Sage plots work.
>
> There are two possible solutions:
> 1. Find out how matplotlib plots are handled. They must be saved in some 
> directory as png files before they are displayed in the ipython notebook. 
> If you can find that directory, then give that path along with a file name 
> to the Sage's plot command, like this:
>
> plot(x).save('/path/to/directory/file.png')
>
>
> 2. Use Sage to plot, but at the last step, take the matplotlib Figure 
> object out of sage. Then use some direct matplotlib calls to show this 
> figure (I don't know exactly what they should be), like this:
>
> p = plot(x) + plot(x^2) + list_plot(range(5))
> pm = p.matplotlib() # This is a 
> matplotlib Figure object
> from matplotlib import pyplot as plt
> # Some matplotlib commands which can incorporate this Figure object into 
> the plt object
> plt.show()
>
>
> On Friday, May 31, 2013 9:41:34 PM UTC+8, Jose Guzman wrote:
>>
>> Hi everyboydy! 
>>
>>
>> Is there any way to display Sage plots in inline mode? I've tried sage 
>> ipython notebook -pylab=inline but It did not work. 
>>
>>
>> Declaring %pylab inline does not help, for example: 
>>
>>  >>> from sage.all import* 
>>  >>> t = var('t') 
>>  >>> plot(sin(t), 0, 2*pi) 
>>
>> n _plot_args(self, tup, kwargs) 
>>  290 tup = tup[:-1] 
>>  291 elif len(tup) == 3: 
>> --> 292 raise ValueError('third arg must be a format string') 
>>  293 else: 
>>  294 linestyle, marker, color = None, None, None 
>>
>> ValueError: third arg must be a format string 
>>
>> Thanks! 
>>
>> Jose 
>>
>> -- 
>> Jose Guzman 
>> http://www.ist.ac.at/~jguzman/ 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Displaying plots in inline mode for IPython notebook

2013-05-31 Thread Jose Guzman

Hi everyboydy!


Is there any way to display Sage plots in inline mode? I've tried sage 
ipython notebook -pylab=inline but It did not work.



Declaring %pylab inline does not help, for example:

>>> from sage.all import*
>>> t = var('t')
>>> plot(sin(t), 0, 2*pi)

n _plot_args(self, tup, kwargs)
290 tup = tup[:-1]
291 elif len(tup) == 3:
--> 292 raise ValueError('third arg must be a format string')
293 else:
294 linestyle, marker, color = None, None, None

ValueError: third arg must be a format string

Thanks!

Jose

--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] how to set figsize=[4,3]

2013-05-10 Thread Jose Guzman

Hi everybody!

When plotting in the sage notebook, I like using the argument figsize to 
a smaller size than the default one, like here:


>> p = plot(sin(x), 0, 2*pi)
>> p.show(figsize=[4,3])

Is there any way to set the default figsize for notebooks? something 
like editing a file as  matplotlibrc?


thanks!

Jose
--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] derivative solution within an interval

2013-02-27 Thread Jose Guzman

I am trying to find the maximun of an exponential expression of the form:

sage: t=var('t')
sage: g(t) = e**(-t/10)-e^(-t/2)

between 0 and say 50. My idea is to get the maximun to normalize the 
function to that maximum and obtain the algebraic. For that:


sage: diff(g,t)==0,t)

But sage returns:
[e^(1/2*t) == 5*e^(1/10)*t]

How can I restrict this value to the interval between 0 and 50?

Thanks in advance

Jose
--
Jose Guzman
http://www.ist.ac.at/~jguzman/

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Fast Fourier Transform

2013-01-20 Thread Jose Guzman
Would anyone we so kind to provide a minimal example with Sage?

On 20 January 2013 19:48, David Joyner  wrote:

> On Sun, Jan 20, 2013 at 12:29 PM, Santanu Sarkar
>  wrote:
> > Dear all,
> >   We know using Fast Fourier Transform we can evaluate a polynomial f(x)
> > of degree n at n points x_1, .., x_n in O(n) time. Is it implemented in
> > Sage?
>
> It is in the gsl module
> http://hg.sagemath.org/sage-main/file/9519a7bb2f42/sage/gsl
>
> >
> > --
> > 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.
> >
> >
>
> --
> 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.
>
>
>

-- 
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: Error installing package pynac-0.2.4 on Sage-5.2.

2012-08-18 Thread Jose Guzman
sudo apt-get install gcc-multilib g++-multilib solved it

On Saturday, 18 August 2012 18:40:23 UTC+2, Jose Guzman wrote:
>
> When installing Sage-5.2 from sources I've got "Error installing package 
> pynac-0.2.4", 
>
> I could not figure out how to solve it, after reading the warning: 
> """ 
> checking for style of include used by make... GNU 
> checking for gcc... gcc 
> checking whether the C compiler works... no 
> configure: error: in `/home/nin/sage-5.2/spkg/build/pynac-0.2.4/src': 
> configure: error: C compiler cannot create executables 
> See `config.log' for more details 
> "" 
> and check the config.log 
>
> """ 
> Thread model: posix 
> gcc version 4.6.1 (Debian 4.6.1-4) 
> configure:3580: $? = 0 
> configure:3569: gcc -V >&5 
> gcc: error: unrecognized option '-V' 
> gcc: fatal error: no input files 
> compilation terminated. 
> configure:3580: $? = 1 
> configure:3569: gcc -qversion >&5 
> gcc: error: unrecognized option '-qversion' 
> gcc: fatal error: no input files 
> compilation terminated. 
> configure:3580: $? = 1 
> configure:3600: checking whether the C compiler works 
> configure:3622: gccconftest.c >&5 
> /usr/lib/i386-linux-gnu/gcc/i486-linux-gnu/4.6.1/cc1: symbol lookup 
> error: /usr/lib/i386-linux-gnu/libppl_c.so.4: undefined symbol: 
> _ZN23Parma_Polyhedra_Library13have_sse_unitE 
> configure:3626: $? = 1 
> configure:3664: result: no 
> configure: failed program was: 
> | /* confdefs.h */ 
> | #define PACKAGE_NAME "pynac" 
> | #define PACKAGE_TARNAME "pynac" 
> | #define PACKAGE_VERSION "0.2.4" 
> | #define PACKAGE_STRING "pynac 0.2.4" 
> | #define PACKAGE_BUGREPORT ">" 
> | #define PACKAGE_URL "" 
> | #define PACKAGE "pynac" 
> | #define VERSION "0.2.4" 
> | /* end confdefs.h.  */ 
> | 
> | int 
> | main () 
> | { 
> | 
> |   ; 
>
> """ 
>
> Is there any thing I could do? Thanks in advance 
>
> Jose 
>
>

-- 
-- 
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] Error installing package pynac-0.2.4 on Sage-5.2.

2012-08-18 Thread Jose Guzman
When installing Sage-5.2 from sources I've got "Error installing package 
pynac-0.2.4",


I could not figure out how to solve it, after reading the warning:
"""
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/nin/sage-5.2/spkg/build/pynac-0.2.4/src':
configure: error: C compiler cannot create executables
See `config.log' for more details
""
and check the config.log

"""
Thread model: posix
gcc version 4.6.1 (Debian 4.6.1-4)
configure:3580: $? = 0
configure:3569: gcc -V >&5
gcc: error: unrecognized option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3580: $? = 1
configure:3569: gcc -qversion >&5
gcc: error: unrecognized option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3580: $? = 1
configure:3600: checking whether the C compiler works
configure:3622: gccconftest.c >&5
/usr/lib/i386-linux-gnu/gcc/i486-linux-gnu/4.6.1/cc1: symbol lookup 
error: /usr/lib/i386-linux-gnu/libppl_c.so.4: undefined symbol: 
_ZN23Parma_Polyhedra_Library13have_sse_unitE

configure:3626: $? = 1
configure:3664: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "pynac"
| #define PACKAGE_TARNAME "pynac"
| #define PACKAGE_VERSION "0.2.4"
| #define PACKAGE_STRING "pynac 0.2.4"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "pynac"
| #define VERSION "0.2.4"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;

"""

Is there any thing I could do? Thanks in advance

Jose

--
--
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] How to make scipy.integrate.odeint to return a Sage function

2012-06-21 Thread Jose Guzman

Dear Sage users,


How can I make the the scipy.integrate odeint function returns a Sage 
function as a function of the independent variable (e.g t)?


In my example (see 
http://aleph.sagemath.org/?q=e1bf244c-6518-4637-8d3e-d32de7ab0367 or the 
code bellow) i obtain a NumPy array that I have to zip with the 
independent variable to get a plot. Ideally, i would like to obtain a 
Sage function to operate on it.


Thanks a lot in advance!

-- Code --


# Two-state kinetic model
#
#alpha*[cc]
# (1-n) --> n
# <--
#  beta

from numpy import linspace
from scipy.integrate import odeint

# define a square pulse with the concentration of Glu

def pulse(t):
""" t in ms """
if t<=2 or t>=3:
return 0.0
else:
return 1.0 # in mM

# Plot Glu concentration
time = linspace(0,10, 1000) # 10 ms


# define differential equation

def diff(n, t, alpha, beta):
"""
alpha in 1/(mM*ms)
betha in 1/ms
"""
cc = pulse(t) # square pulse
return alpha*cc*(1-n)-beta*n

# and solve it for alpha = 1 and beta = 1
y = odeint(func = diff, y0=0, t= time, args=(1,1))

# and plot the conductance
list_plot(zip(time, y), figsize=[4,3], plotjoined=True)


--
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] C compiler error when compiling sage 5.0.2 from sources

2012-06-19 Thread Jose Guzman

On 19/06/12 14:36, Jeroen Demeyer wrote:

On 2012-06-19 14:31, Jose Guzman wrote:

This is what I get after installing ppl-0.11.2.p2.spkg

Yes, this obviously fails with the same error.

Instead try the following: delete that whole Sage install and re-extract
it from source.  Remove spkg/standard/ppl-0.11.2.p1.spkg and put
ppl-0.11.2.p2.spkg (from
http://boxen.math.washington.edu/home/SimonKing/SAGE/spkgs/ppl-0.11.2.p2.spkg)
in spkg/standard.  Then restart the build.


This solved the problem! Thanks a lot!

Jose

--
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] C compiler error when compiling sage 5.0.2 from sources

2012-06-19 Thread Jose Guzman

On 19/06/12 14:19, Jeroen Demeyer wrote:

Could you try
./sage -f
http://boxen.math.washington.edu/home/SimonKing/SAGE/spkgs/ppl-0.11.2.p2.spkg

And then continue the build?

See http://trac.sagemath.org/sage_trac/ticket/12672


This is what I get after installing ppl-0.11.2.p2.spkg

patching file tests/Makefile.in
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/nin/sage-5.0.1/spkg/build/ppl-0.11.2.p2/src':
configure: error: C compiler cannot create executables
See `config.log' for more details.
Error configuring the Parma Polyhedra Library.

real0m1.449s
user0m0.132s
sys 0m0.052s

Error installing package ppl-0.11.2.p2


Should I install 
https://github.com/downloads/aginiewicz/spkgs/ppl-0.11.2.p2.spkg ? If 
yes, how? 


Thanks a lot!

Jose


--
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] C compiler error when compiling sage 5.0.2 from sources

2012-06-19 Thread Jose Guzman

On 19/06/12 13:35, Jeroen Demeyer wrote:

On 2012-06-19 13:23, Jose Guzman wrote:

Does anyone have an idea?

Please attach the file
/home/nin/sage-5.0.1/spkg/build/pynac-0.2.3.p1/src/config.log


Find attached!

Thanks in advance!

Jose

--
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
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by pynac configure 0.2.3, which was
generated by GNU Autoconf 2.65.  Invocation command line was

  $ ./configure --disable-static --prefix=/home/nin/sage-5.0.1/local --libdir=/home/nin/sage-5.0.1/local/lib

## - ##
## Platform. ##
## - ##

hostname = neurohost
uname -m = i686
uname -r = 2.6.36
uname -s = Linux
uname -v = #1 SMP Wed Nov 3 00:07:29 CET 2010

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch  = unknown
/usr/bin/arch -k   = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo  = unknown
/bin/machine   = unknown
/usr/bin/oslevel   = unknown
/bin/universe  = unknown

PATH: /home/nin/sage-5.0.1/spkg/bin
PATH: /home/nin/sage-5.0.1/local/bin
PATH: /home/nin/sage-5.0.1/spkg/bin
PATH: /home/nin/sage-5.0.1/local/bin
PATH: /home/nin/neuron/iv/i686/bin
PATH: /home/nin/neuron/nrn/i686/bin
PATH: /home/nin/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/local/games
PATH: /usr/games
PATH: /home/nin/bin
PATH: /home/nin/sage-4.7.2


## --- ##
## Core tests. ##
## --- ##

configure:2683: checking for a BSD-compatible install
configure:2751: result: /usr/bin/install -c
configure:2762: checking whether build environment is sane
configure:2812: result: yes
configure:2953: checking for a thread-safe mkdir -p
configure:2992: result: /bin/mkdir -p
configure:3005: checking for gawk
configure:3021: found /usr/bin/gawk
configure:3032: result: gawk
configure:3043: checking whether make sets $(MAKE)
configure:3065: result: yes
configure:3156: checking for python
configure:3174: found /home/nin/sage-5.0.1/local/bin/python
configure:3186: result: /home/nin/sage-5.0.1/local/bin/python
configure:3207: checking for python version
configure:3214: result: 2.7
configure:3226: checking for python platform
configure:3233: result: linux2
configure:3240: checking for python script directory
configure:3269: result: ${prefix}/lib/python2.7/site-packages
configure:3278: checking for python extension module directory
configure:3307: result: ${exec_prefix}/lib/python2.7/site-packages
configure:3332: checking for style of include used by make
configure:3360: result: GNU
configure:3430: checking for gcc
configure:3457: result: gcc
configure:3686: checking for C compiler version
configure:3695: gcc --version >&5
gcc (Debian 4.6.1-4) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3706: $? = 0
configure:3695: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i486-linux-gnu/4.6.1/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.1-4' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib/i386-linux-gnu --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.6.1 (Debian 4.6.1-4) 
configure:3706: $? = 0
configure:3695: gcc -V >&5
gcc: error: unrecognized option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3706: $? = 1
configure:3695: gcc -qversion >&5
gcc: error: unrecognized option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3706: $? = 1
configure:3726: checking whether the C compiler works
configure:3748: gccconftest.c  >&5
/usr/lib/i386-linux-gnu/gcc/i486-linux-gnu/4.6.1/cc1: symbol lookup error: /usr/lib/i386-linux-gnu/libppl_c.so.4: undefined symbol: _ZN23Parma_Polyhedra_Library13have_sse_unitE
configure:3752: $? = 1
configure:3790: result: no
configure: failed program was:
| /* confdefs.h *

[sage-support] C compiler error when compiling sage 5.0.2 from sources

2012-06-19 Thread Jose Guzman

Dear Sage friends;

I found the following error when installing sage:

make[1]: *** [installed/pynac-0.2.3.p1] Error 1
make[1]: Leaving directory `/home/nin/sage-5.0.1/spkg'


when checking the config file I found that the C compiler does not work:

Starting build...
Running build_pynac...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for python... /home/nin/sage-5.0.1/local/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... 
${prefix}/lib/python2.7/site-packages
checking for python extension module directory... 
${exec_prefix}/lib/python2.7/site-packages

checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/nin/sage-5.0.1/spkg/build/pynac-0.2.3.p1/src':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make[2]: Entering directory 
`/home/nin/sage-5.0.1/spkg/build/pynac-0.2.3.p1/src'

make[2]: *** No targets specified and no makefile found.  Stop.
make[2]: Leaving directory 
`/home/nin/sage-5.0.1/spkg/build/pynac-0.2.3.p1/src'

Error building pynac.

My version of g++ and gcc are:
gcc version 4.6.1 (Debian 4.6.1-4)

Does anyone have an idea?

Thanks

Jose

--
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] Solving second degree ODE with constants in sage

2012-05-10 Thread Jose Guzman
Hi Priyanka,

I would first define well the problem and the equation (you have terms like
c, and d that you are not using). It seems like you are trying to solve the
equation of a undampened string with a constant attached to it.

I would do it like this:


x = var('x') # independent variable
b =  var('b')   # constant

y = function('y', x) # unknown function

# define 2nd order ODE; (undampened spring with unit of mass attached)
myode = diff(y,x,2)+b*y == 0 # define 2order ODE

assume(b>0) # mass is always possitive

f = desolve_laplace(de = myode,dvar = y, ivar=x)

I should return an expression like:

cos(sqrt(b)*x)*y(0) + sin(sqrt(b)*x)*D[0](y)(0)/sqrt(b)


Best

Jose


On 10 May 2012 13:05, Priyanka Kapoor wrote:

> Can anyone help me out in this question?
>
> x,a,c,d=var('x,b,c,d')
> y = function('y', x)
> de=diff(y,x,x)+b*y==0
> c=desolve(de,y,ivar=x)
> print c
>
>
>
> --
> Priyanka Kapoor
> http://kapoorpriyanka.in
> Linux User Group, Ludhiana
>
> --
> 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: plotting functions with onsets

2012-04-27 Thread Jose Guzman

On 27/04/12 21:55, Jason Grout wrote:

On 4/27/12 2:38 PM, Jose Guzman wrote:

On 27/04/12 20:52, Jason Grout wrote:

On 4/27/12 10:15 AM, Jose Guzman wrote:

Dear colleagues,

I am trying to manipulate an expression that starts at a time =
"tonset". Everything works nice until I try to plot.

#define independent variable
sage: t = var('t')

# define parameters
sage: taum, tauh = var('taum, tauh')
sage: tonset=var('tonset')

# normalize the equation
sage: f(t) = -e^(-t/taum)*(1-e^(-t/tauh))
sage: Tmax = solve(diff(f(t),t)==0,t)[0].rhs()
sage: norm_f(t) = (f(t-tonset) / f(Tmax))


Right here, aren't you shifting the plot of f to the right by tonset?
norm_f(t+tonset)=f((t+tonset)-tonset)/f(Tmax)=f(t)/f(Tmax), so that
norm_f(0+3)=f(0)/f(Tmax)? I think that horizontal shift may be the
problem?


Yes, this is exactly what I wanted; to have an offset, where the
function starts. Obviously, I want to plot between t=0 and a large t, so
that I can see where the onset begining.I find anyoing having to change
the axis, and I cannot get it with the Piecewise function


So do you just want norm_f(t)=f(t)/f(Tmax)?


I want a function that I can start at every tonset that i get:

f(t) =-e^(-(t-tonset)/taum)*(1-e^(-(t-tonset)/tauh))
Tmax = solve(diff(f(t),t)==0,t)[0].rhs()
norm(t) = f(t)/f(Tmax)

plot(epsc.subs(taum=0.3, tauh=5, tonset=3), 0+3, 5+3, figsize=[6,3])

Ideally, I would like to call the function plot with xmin=0 and
xmax=whatever.


Ah, I think I understand.  Use the show command and specify the axis 
limits there.  If you use the xmin/xmax commands inside the plot 
command, you can't tell the axes to start one place and the plotting 
to start another.


plot(norm_f.subs(taum=0.3, tauh=5, tonset=3), (t,0+3, 
5+3)).show(xmin=0,xmax=10)


Wov, this is extremely useful. However, I wanted to get a function to 
have all values including the zeros. Now, I realized how to do it with 
Piecewise:


def biexp_norm(tonset):
h =piecewise([[(0, 3), lambda x :0],[(tonset, 10),g.subs(taum=0.3, 
tauh=5)(t-tonset)]])

return(h)

You can see my example here: 
http://aleph.sagemath.org/?q=cb61e4be-15d6-4d98-b773-07a6cb334185


I have only to figure out how to __add__ different piecewise objects to 
have the sumation function.



See http://aleph.sagemath.org/?q=c42287ee-a155-4c90-b09e-d1a0c083fd44 
for some more examples.



Amazing to have a single cell evaluation to share with other people!

Thanks a lot

Jose

--
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: plotting functions with onsets

2012-04-27 Thread Jose Guzman

On 27/04/12 20:52, Jason Grout wrote:

On 4/27/12 10:15 AM, Jose Guzman wrote:

Dear colleagues,

I am trying to manipulate an expression that starts at a time =
"tonset". Everything works nice until I try to plot.

#define independent variable
sage: t = var('t')

# define parameters
sage: taum, tauh = var('taum, tauh')
sage: tonset=var('tonset')

# normalize the equation
sage: f(t) = -e^(-t/taum)*(1-e^(-t/tauh))
sage: Tmax = solve(diff(f(t),t)==0,t)[0].rhs()
sage: norm_f(t) = (f(t-tonset) / f(Tmax))


Right here, aren't you shifting the plot of f to the right by tonset? 
norm_f(t+tonset)=f((t+tonset)-tonset)/f(Tmax)=f(t)/f(Tmax), so that 
norm_f(0+3)=f(0)/f(Tmax)?  I think that horizontal shift may be the 
problem?


Yes, this is exactly what I wanted; to have an offset, where the 
function starts. Obviously, I want to plot between t=0 and a large t, so 
that I can see where the onset begining.I find anyoing having to change 
the axis, and I cannot get it with the Piecewise function



So do you just want norm_f(t)=f(t)/f(Tmax)?


I want a function that I can start at every tonset that i get:

f(t) =-e^(-(t-tonset)/taum)*(1-e^(-(t-tonset)/tauh))
Tmax = solve(diff(f(t),t)==0,t)[0].rhs()
norm(t) = f(t)/f(Tmax)

plot(epsc.subs(taum=0.3, tauh=5, tonset=3), 0+3, 5+3, figsize=[6,3])

Ideally, I would like to call the function plot with xmin=0 and 
xmax=whatever.


Thanks to yoU!

Jose

--
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] plotting functions with onsets

2012-04-27 Thread Jose Guzman

Dear colleagues,

I am trying to manipulate an expression that starts at a time = 
"tonset". Everything works nice until I try to plot.


#define independent variable
sage: t = var('t')

# define parameters
sage: taum, tauh = var('taum, tauh')
sage: tonset=var('tonset')

# normalize the equation
sage: f(t) = -e^(-t/taum)*(1-e^(-t/tauh))
sage: Tmax = solve(diff(f(t),t)==0,t)[0].rhs()
sage: norm_f(t) = (f(t-tonset) / f(Tmax))

# standard plotting gives wrong values
plot(norm_f.subs(taum=0.3, tauh=5, tonset=3), 0, 5, figsize=[6,3])

# tonset should be given to the plotting to return the real values
plot(norm_f.subs(taum=0.3, tauh=5, tonset=3), 0+3, 5+3, figsize=[6,3])

Would it be possible to manipulate the equation so that plot does not 
have to be corrected for tonset every  time? . I tried with Piecewise 
but this does not allow to plot


Any ideas?

Thanks so much in advance

Jose

--
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] Deconvolution examples.

2012-02-02 Thread Jose Guzman

On 02/02/12 01:27, David Joyner wrote:

On Wed, Feb 1, 2012 at 5:21 PM, Jose Guzman  wrote:

Is there any documentation about performing deconvolution with Sage?

Essentially, you want to take LTs or FTs, divide by a factor, then
take inverse LTs or
inverse FTs?

Yes. Basically interestend in both methdos (Laplace and Fourier) but I 
am currently working the latest.

In the LT case, symbolic inverse LTs are implemented, via maxima. In
really simple examples,
I guess you could just use them to try to solve your problem. You
might be more interested
in the discrete FT case. Sage has some functionality for that, but I
don't know anyone
working out details.

Yes, I would like to see some examples for the discrete Fast-Fourier 
transform with examples.


Thanks a lot


--
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] Deconvolution examples.

2012-02-01 Thread Jose Guzman

Is there any documentation about performing deconvolution with Sage?

I did not find anythign on sagemath.org or in the wiki.

I am trying to become familiar with the deconvolution method (like in
http://terpconnect.umd.edu/~toh/spectrum/Deconvolution.html), and I 
would like to test how to perform it with Sage.


Thanks in advance.

Jose

--
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] 'unable to simplify to float approximation' error in Logistic equation

2011-11-16 Thread Jose Guzman
I am having some troubles to get the logistic equation from its 
differential form. For example:


sage: tau = var('tau') # proportionality constant
sage: k = var('k') # max population size
sage: t = var('t') # independent variable
sage: p = function('p', t) # dependent variable

sage: myode = tau*diff(p,t) == p*(1-p/k)
sage: sol(t) = desolve(de=myode, ivar=t, dvar=p)

sage returns:
 -tau*log(-k + p(t)) + tau*log(p(t)) == c + t

Now, when I try to show the solution to the equation:

sage: plot(sol.subs(tau=20, k=10, c=1), 0, 100)

i've got the following error:

verbose 0 (4075: plot.py, generate_plot_points) WARNING: When plotting, 
failed to evaluate function at 200 points.
verbose 0 (4075: plot.py, generate_plot_points) Last error message: 
'unable to simplify to float approximation'


I would appreciate some help here.

Thanks in advance

Jose

--
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] Numerical solution of systems of nonlinear (in)equalities

2011-11-03 Thread Jose Guzman

On 31/10/11 16:01, Urs Hackstein wrote:

Hi all,

maybe it is a silly question, but I wonder whether there is a routine
in sage to find a numerical solution of a system of nonlinear
(in)equalities which can not be computed directly.

Thanks a lot in advance.

Urs Hackstein

It would be very helpful if you simply show us a small example. I was 
trying to solve a system of non-linear differential equations and found 
an example in the sage reference 
(http://www.sagemath.org/doc/reference/sage/calculus/desolvers.html). 
Not sure if this is what you need.


Jose

--
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] Creating Arrays in sage, and then writing a programme which refers back to the array and uses it.

2011-11-01 Thread Jose Guzman

On 31/10/11 23:09, Chappman wrote:

to find a method in of creating a n x n array, with probabilities as
the entries of this array .

Here's the tricky part, then I have to create a coding program which
uses the values in this array.

  For i=1 to 5;
For j=1 to i-1;
   total_prob= (some type of simple formula which refers back
to entries in the array)
end;
end;

I recently programmed something similar in Sage to create random 
matrices. What I basically did, is create NumPy arrays and transform 
them to Sage matrices to perform algebraic computations. Here some examples:


sage: import numpy as np
sage: n = 5 # where n is the number of row/columns of a square matrix
sage: W = np.empty((n,n), dtype=int) # n x n matrix of intergers

# Example 1: a n x n matrix whose ij elements are all zeros, and 
diagonal is one.

sage: for i in range(n):
sage: for j in range(n):
sage: if i==j:
sage: W[i,j]=1 # diagonal
sage: else:
sage: W[i,j]=0

# to see it:
sage: show( matrix(ZZ,W) )

# Example 2: a random matrix whose diagonal is zero, and the ij element 
has 50% of probability of bein zero:


sage: S = np.empty((n,n), dtype=int)
sage: c = 0.5 # probability that the ij element is zone, P(S_ij=1)

sage: for i in range(n):
sage: for j in range(n):
sage: if i==j:
sage: S[i,j]=0 # diagonal
sage: else:
sage: if np.random.random()>c
sage: S[i,j]=1
sage: else:
sage: S[i,j]=0

# to see the result

sage: show( matrix(ZZ, S) )

You will see that approximately 50% of the non-diagonal elements are one 
(the higher n, the most accurate this 50%)


Note that if you want to have "reproducible" random matrices (for 
instance to evaluate the algorith), you should set a seed (with for 
example np.random.seed(int(10))), before calling np.random


There are probably more efficient ways to create a matrix, but this is 
the one I implemented for my models. Hope you find it useful.


Best

Jose



--
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] ValueError when using np.random.seed()

2011-10-26 Thread Jose Guzman

Hi everybody,

When trying to set a seed in Sage:
sage: import numpy as np
sage: np.random.seed(10)

I've got the following error:

sage: np.random.seed(10)
---
ValueError Traceback (most recent call last)

$HOME/programming/Sage/tests/ in ()
$HOME/sage-4.7/local/lib/python2.6/site-packages/numpy/random/mtrand.so 
in mtrand.RandomState.seed (numpy/random/mtrand/mtrand.c:4842)()


ValueError: object of too small depth for desired array

However, if I do:
sage: import numpy as np
sage: np.random.seed(int(10))

everything works nicely.

Not sure if we should set a seed in a different way in Sage (I am 
running Sage 4.7.1). I wonder if is there any easy way to solve this 
small bug (I would be happy to submit a patch).


Thanks al lot

Jose.

--
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: How to set 'location' in Normal distribution?

2011-10-25 Thread Jose Guzman

On 24/10/11 16:48, kcrisman wrote:


Unless the Gaussian distribution is only the one centered at zero and
the normal is able to be centered anywhere?   But I've never heard of
that as a distinction...

I though (not sure about that) that normal is a type of Gaussian 
distribution with location =0 and scale=1

For sure we want to start unifying this behavior.  Scipy is good to
have as an option, of course, but we want more Sage-"native" wrapping
of things like GSL (which I think #11572 is going for?).  Thanks for
catching this and working on that ticket; kamhamea/Mato did a lot of
good work on that ticket, and it would be a real shame to have it
bitrot further.


I am working on that.

I tend to use Sage when possible and use the following implementation

def norm_pdf(mu, sigma):
"""
returns a Sage function with the probability density function
of a gaussian distribution
mu-- mean
sigma -- standard deviation

Examples:

>>> mynorm = norm_pdf(mu=0, sigma =1)
>>> mynorm(0)
>>> 1/2*sqrt(2)/sqrt(pi)
>>> mynorm(0).n()
>>> 0.398942280401433
"""

z = 1.0*(x-mu)/sigma
exp = e^(-0.5*z^2)
C = sqrt(2*pi)*sigma

f(x) = 1.0*exp/C
return f

--
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] How to set 'location' in Normal distribution?

2011-10-23 Thread Jose Guzman

Hi everybody,

I am making a revision of ticket #11572 and wanted to become familiar 
with the way that Sage handle probability distributions . I realized 
that the normal distribution is implemented as follows in Sage:


sage: T=RealDistribution('gaussian',sigma=20)

Is there any reason why this class does not include the mean as a 
parameter for the gaussian distribution?


Are we supposed to use scipy.stats.norm instead?

Thanks in advance

Jose

--
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] Sagetex fails to interpret input

2011-10-12 Thread Jose Guzman

On 12/10/11 02:24, Dan Drake wrote:

On Tue, 11 Oct 2011 at 11:09PM +0200, Jose Guzman wrote:

AttributeError: 'sage.rings.integer.Integer' object has no attribute
'rstrip'

 Running Sage on example.sage failed! Fix example.tex and try again.

I moved $SAGEROOT/local/share/texmf/tex/ to /usr/local/share/texmf
following the instructions to install sagetex.

Does anybody knows what's wrong here?

Your TeX installation is finding an old version of sagetex.sty. Do

  kpsewhich sagetex.sty


Hi Dan,!

Thanks a lot for your answer, that worked!

--
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] Sagetex fails to interpret input

2011-10-11 Thread Jose Guzman

I am trying a minimal example of Sage to start using it for my lectures:

When I try the following file (example.text)
\documentclass{article}
\usepackage{sagetex}

\begin{document}
 one plus two is $\sage{1+2}$

\end{document}

>>> pdflatex example.text
>>> sage example.sage

it gives me the following error:

Processing Sage code for example.tex...
Inline formula 0

 Error in Sage code on line 5 of example.tex! Traceback follows.
Traceback (most recent call last):
  File "example.py", line 7, in 
_st_.inline(_sage_const_0 , _sage_const_1 +_sage_const_2 )
  File 
"/home/nin/sage-4.7/local/lib/python2.6/site-packages/sagetex.py", line 
73, in inline

s.rstrip() + '}{}{}{}{}}\n')
  File "element.pyx", line 328, in 
sage.structure.element.Element.__getattr__ (sage/structure/element.c:2790)
  File "parent.pyx", line 277, in 
sage.structure.parent.getattr_from_other_class 
(sage/structure/parent.c:2930)
  File "parent.pyx", line 175, in 
sage.structure.parent.raise_attribute_error (sage/structure/parent.c:2699)
AttributeError: 'sage.rings.integer.Integer' object has no attribute 
'rstrip'


 Running Sage on example.sage failed! Fix example.tex and try again.

I moved $SAGEROOT/local/share/texmf/tex/ to /usr/local/share/texmf 
following the instructions to install sagetex.


Does anybody knows what's wrong here?

Thanks

Jose

--
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] Where are the environment variables in Sage.

2011-08-10 Thread Jose Guzman



Hi Jose,

On Tue, Aug 9, 2011 at 5:21 PM, Jose Guzman  wrote:
   

I would like to change my $SAGE_BROWSER environment variable but do not know
where it is. Where are the environment variables ?
 

See this thread:

http://groups.google.com/group/sage-support/browse_thread/thread/a2fac6ef05e24074


   

would it be nice to have
this question in the Sage FAQ? (see ticket #8464)
 

Yes, you're right. Would you like to open a ticket and post a patch? I
promise to review the patch.

   
Here we go!!!: ticket #11675. It took me a little bit, I wanted to be 
sure to follow strictly the devel-doc . It is my first patch, I hope 
everything was appropriate.


@John: I was not aware of the Sage installation guide. I added a link to 
that page in the FAQ as well.


Thanks a lot for your help!

Jose



--
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] Where are the environment variables in Sage.

2011-08-09 Thread Jose Guzman
I would like to change my $SAGE_BROWSER environment variable but do not 
know where it is. Where are the environment variables ? would it be nice 
to have this question in the Sage FAQ? (see ticket #8464)


Best!

--
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] Symbolic integration: AttributeError: 'float' object has no attribute 'variables'

2011-08-08 Thread Jose Guzman
To debug ticket #11653, I am trying to see the integral of the sing 
function,


For that I do:

sage: t=var('=t')
sage: v=function('v',t)


sage: myode =  diff(v,t) - ( sign(t) ) == 0
sage: mysol = desolve(de=myose, ivar=t, dvar=y) # do not add ics 
argument, cause it fails, see ticket #11653


it returns  c + integrate(sgn(t), t)

Is it possible to plot this function? I tryed:

sage: plot(mysol.subs(c=0))

but it retuns
 74 # Check for x
 75 if not is_SymbolicVariable(x):
---> 76 if len(x.variables()) == 1:
 77 nx = x.variables()[0]
 78 f = f*x.diff(nx)

AttributeError: 'float' object has no attribute 'variables'


Note that other integrals are easy to plot
sage: plot(integrate(sin(t),t), 0, 2*pi)

Is this a bug (i.e the integral of the sign function is not 
implemented), or am I missing something here.


Thanks a lot in advance!

Jose

--
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: How do I make sage to solve a ODE that includes a time-dependent function?

2011-08-05 Thread Jose Guzman

On 05/08/11 22:00, kcrisman wrote:


Great!  We always welcome new help of any kind :)



   
Here my (first) ticket submission: 
http://trac.sagemath.org/sage_trac/ticket/11653


hope its OK

I will try to have a look carefully to that code, to see if I could 
provide any help!


Thanks!

Jose


--
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: How do I make sage to solve a ODE that includes a time-dependent function?

2011-08-05 Thread Jose Guzman

On 05/08/11 18:20, kcrisman wrote:


On Aug 5, 12:07 pm, Nils Bruin  wrote:
   

On Aug 5, 8:41 am, Jose Guzman  wrote:

 

In either case, Sage returns the same error:
TypeError: unable to make sense of Maxima expression
'v(t)=-e^-(t*gL/cm)*(at(integrate((EL*gL+signum(t-5)-signum(t-13))*e^(t*gL/ 
cm),t),[t=0,v(t)=-65])-integrate((EL*gL+signum(t-5)-signum(t-13))*e^(t*gL/c 
m),t)+65*cm)/cm'
in Sage
   

That seems a bug to me. It is probably because maxima's "at" function
 

Hmm.  Maxima's at function IS translated, as you can see in that the
final error has 'at' in it.  In calculus.py:

 delayed_functions = maxima_qp.findall(s)
 if len(delayed_functions)>  0:
 for X in delayed_functions:
 if X == '?%at': # we will replace Maxima's "at" with
symbolic evaluation, not an SFunction
 pass
 else:
 syms[X[2:]] = function_factory(X[2:])
 s = s.replace("?%","")

Probably the problem is that this was too naive.  The thing you did
with M(expr).sage() bypasses this, because this 'at' is not
universally imported into the global namespace.  Maybe it should be?

- kcrisman


   

similar functionality is available in the form of "substitute" and
"call". Here is a more direct way of arriving at a similar error
(requires 4.7.1 for interfacing with the LISP below, but that should
not be essential for exposing the problem):

sage: M=sage.calculus.calculus.maxima
sage: E=sage.libs.ecl.ecl_eval
sage: expr=E("#$at(derivative(f(x),x),[x=0])$")
sage: M(expr)
?%at('diff(f(x),x,1),[x=0])
sage: M(expr).sage()
[...]
TypeError: unable to make sense of Maxima expression 'at(diff(f(x),x,
1),[x=0])' in Sage

You can help sage by filing a bug report.
 
   
I would be willing to 1) submit a bug report,  and even 2) try to solve 
it if somebody would assist me with whole process of submitting a track 
(maybe in #sagemath channel on freenode. That would be a fantastic 
opportunity to collaborate with the Sage development. I would be very 
happy to have the option of integrating this kind of functions in 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


[sage-support] How do I make sage to solve a ODE that includes a time-dependent function?

2011-08-05 Thread Jose Guzman

Hi everybody,

I am starting to learn how to solve ODEs analytically/numerically with 
Sage, which to my understanding, implies using Maxima functions. I 
followed the docu here:  
http://maxima.sourceforge.net/docs/manual/en/maxima_22.html.


Now, i wanted to solve analytically the following equation:
cm*dV/dt =  iM - gL*(v(t) - EL) , where cm, iM, gL and EL are parameters.

This works nicely assuming that these parameters are constant. However, 
I would like to solve the equation for iM being a  time-dependent 
function (for example a square/sin pulse). Something like this:


cm*dV/dt =  iM(t) - gL*(v(t) - EL), where iM(t) is the time-dependent 
function


# define independent/dependent variables
sage: t=var('t')
sage: v=function('v',t)

# equation parameters
sage: iM, gL, EL, cm = var('iM, gL, EL, cm')

# define equation
sage: eq = diff(v,t) - 1/cm*(iM-gL*(v-EL) ) == 0

# solve it analytically
sage: desolve(de=eq, dvar=v, ivar=t, ics=[0,-65])

Then Sage returns this:->  (EL*gL*e^(gL*t/cm) + (e^(gL*t/cm) - 1)*iM - (EL 
+65)*gL)*e^(-gL*t/cm)/gL

which is correct.

If I now define a function of the form:

def pulse(tonset, tdur, amp):
""" returns a square pulse as a function of t, f(t)
the pulse is defined as follows:
tonset -- start of pulse
tdur   -- duration of pulse
amp-- amplitude of pulse
"""
t=var('t') # do i need this?

f(t)= amp*(sign(t-tonset)/2-sign(t-tonset-tdur)/2)
return f

I tried to define iM as a function of t
sage: mypulse = pulse(tonset =5, tdur = 10, amp =2 )

and redefined the equation (not sure if I wrote correctly
sage: eq = diff(v,t) - 1/cm*(mypulse - gL*(v-EL) ) == 0
sage:  eq = diff(v,t) - 1/cm*(diff(mypulse,t) - gL*(v-EL) ) == 0 # this 
is probably wrong


In either case, Sage returns the same error:
TypeError: unable to make sense of Maxima expression 
'v(t)=-e^-(t*gL/cm)*(at(integrate((EL*gL+signum(t-5)-signum(t-13))*e^(t*gL/cm),t),[t=0,v(t)=-65])-integrate((EL*gL+signum(t-5)-signum(t-13))*e^(t*gL/cm),t)+65*cm)/cm' 
in Sage


What I am missing here. I got a similar problem with desolve_laplace. 
Should I use another ODE solver?


I got it running with Mathematica (using DSolve), but it would be great 
to have it with Sage!


Thanks a lot in advance

Jose.

--
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: How to plot histograms with Sage.

2011-07-29 Thread Jose Guzman

On 29/07/11 20:31, Jason Grout wrote:

On 7/29/11 11:07 AM, William Stein wrote:
On Fri, Jul 29, 2011 at 10:56 AM, Jose 
Guzman  wrote:
I was a looking around the documentation and  in google and I could 
not find

any reference to histograms in Sage.


There are ways to plot histograms in Sage, but this is a weekness in 
Sage.



Just out of curiosity how did you search?   For example, you could go
to http://sagemath.org/ and type "histogram" in the box in the upper
right corner does yield some results, e.g.,


http://sagemath.org/doc/reference/sage/finance/time_series.html?highlight=histogram#sage.finance.time_series.TimeSeries.plot_histogram 



I am sure that the question was addressed here before but... Is it 
possible
to plot an histogram from a  Numpy array in Sage (ideally in the 
notebook)


You could do

sage: import numpy
sage: v = numpy.array([1..10])
sage: stats.TimeSeries(v).plot_histogram()

Do

sage: t = stats.TimeSeries(v)
sage: t.plot_histogram?

to see options for dividing your data into bins, etc.


By the way, I would *REALLY* like to see the following implemented in 
Sage:


sage: histogram(...)

I.e., a function called "histogram" with options/semantics that are
very close to the ones here:


http://reference.wolfram.com/mathematica/Histograms/ref/Histogram.html


Who wants to do it?


Please see http://trac.sagemath.org/sage_trac/ticket/9671 for a patch 
for a histogram command.


Jason


Hey Jason, I have just import this ticket and it makes a very nice job! 
As soon as I finish to read the developer guide I will try to send you 
some feedback! There are a couple of arguments necessary for that function!



Thanks for your help!

--
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] How to plot histograms with Sage.

2011-07-29 Thread Jose Guzman
I was a looking around the documentation and  in google and I could not 
find any reference to histograms in Sage.


I am sure that the question was addressed here before but... Is it 
possible to plot an histogram from a  Numpy array in Sage (ideally in 
the notebook)


Thanks!

Jose.

--
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] including a python module built with autotools in Sage

2011-07-20 Thread Jose Guzman

Hi everybody,

I am trying to install a Python module in Sage that uses autotools as 
its build system. I would like to install it in my local Sage, so I type:


>>> ./configure --prefix=$HOME/sage-4.7/local 
PYTHON=$HOME/sage-4.7/local/bin/python

>>> make
>>> make install

which returns:
>>> /bin/bash $HOME/dev/stfio/./shave-libtool '/bin/bash ./libtool'   
--mode=install /usr/bin/install -c   libstfio.la 
'$HOME/sage-4.7/local/lib/python2.6/dist-packages/stfio'


libtool: install: warning: remember to run `libtool --finish 
/usr/local/lib/python2.6/dist-packages/stfio'


However, when executing Sage, the package is not recognized. Is this the 
correct subdirectory to install the package? Should I configure any Sage 
variable?


Thanks in advance.

Jose

--
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: how to choose return values from solve

2011-07-15 Thread Jose Guzman

On 15/07/11 21:49, achrzesz wrote:

t=var('t')
taum, tauh, m = var('taum, tauh, m')
f(t) = (1-e^(-t/taum))^m*(e^(-t/tauh))
d=diff(f(t),t)
d1=(d==0).full_simplify()
print d1.solve(t)

   
awesome! I guess one will have first to simplify the equation if this 
looks complicated before executing the solver.


--
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: How to plot X array versus Y array

2010-10-17 Thread Jose Guzman

On 10/17/2010 10:25 PM, John H Palmieri wrote:


On Oct 17, 12:27 pm, Jose Guzman  wrote:
   

Hi everybody,

I want to plot a x versus y plot in Sage. Unfortunately , i do not know
if plot() or list_plot() can do it.
 

The documentation for list_plot contains this:

If you have separate lists of x values and y values which you
want
to plot against each other, use the ``zip`` command to make a
single list whose entries are pairs of (x,y) values, and feed
the
result into ``list_plot``:

   sage: x_coords = [cos(t)^3 for t in srange(0, 2*pi, 0.02)]
   sage: y_coords = [sin(t)^3 for t in srange(0, 2*pi, 0.02)]
   sage: list_plot(zip(x_coords, y_coords))

Is that what you want?

   
Thanks John! This was exactly what I was looking for! I did think about 
the zip option

--
John

   


--
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] How to plot X array versus Y array

2010-10-17 Thread Jose Guzman

Hi everybody,

I want to plot a x versus y plot in Sage. Unfortunately , i do not know 
if plot() or list_plot() can do it. Until now, I used the 
FigureCanvasAgg object of the matplotlib library, but I would rather 
like to have the plot inside a sage notebook. Is there anyway to plot a 
x array, versus y array with Sage (having both same size)?


This is how I do it now in Sage:

from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.pyplot import figure, show

import numpy as np
# see http://linuxgazette.net/115/misc/andreasen/sunspots.dat to 
donwload the data.

data = np.loadtxt('/home/user/tmp/sunspots.dat')
year = data[:,0]
wolfer = data[:,1]

fig = figure()
ax = fig.add_subplot(111)
ax.plot(year, wolfer)
show()

Best,

Jose

--
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: Is Solve adequate to solve y values?

2010-08-02 Thread Jose Guzman

Ok, i got the point! It worked to me, thanks a lot Harald!

On 08/02/2010 10:39 AM, Harald Schilly wrote:

On Aug 2, 8:09 am, Jose Guzman  wrote:
   

I am doing something wrong here? Is the command Solve adequate to solve
this kind of task?
 

I think you are better off with a numerical solution.
There are two functions, find_minimum_on_interval (and
find_maximum_on_interval) and find_root ... You can use the first one
to find the maximum of your y(t) and the second one to solve fopt(t) =
y-maximum*0.2


sage: var('t')
sage: y(t)=-17.6* ...
sage: find_maximum_on_interval(y, 0, 5)
(1.34942587519059, 0.27864045000420612)
sage: fopt = y - 1.34942587519059 * 0.2
sage: find_root(fopt, 0, 5)
...
RuntimeError: f appears to have no zero on the interval
which is confirmed by
sage: plot(fopt, 0,5)

Or maybe I did something wrong, but I hope you got the point ;)

H

   


--
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] Is Solve adequate to solve y values?

2010-08-02 Thread Jose Guzman

Lieber Eckhard,

Thanks a lot for your . This is exactly what I was looking for! thanks a 
bunch!!!


On 08/02/2010 05:24 PM, Eckhard Kosin wrote:

Hi Jose,

Am Montag, den 02.08.2010, 08:09 +0200 schrieb Jose Guzman:
   

I am trying to solve at which x-values the function takes a given y
value. In its most simplistic case, this is easy to get with Solve:

sage: var('t')
sage: y=1-e**(-t/5)
sage: sol = solve(y==0.632,t)
sage: n(sol[0].rhs())



Which gives me 4.9983, the value I was looking for is 5, so it is OK.
However, in more complicated expressions (a biexponential of the from:

sage: y=-17.6*(e^(-1/5*t) - 1)*e^(-3.33*t
+0.971148468732930)


which varies between 0 an 1 in the interval between x=0 and x=5, the
task becomes complicated:
Trying to get the value at which the functions is 20% of its maximum I get

sage: solve(y==.2,t)
sage: [e^(1/5*t) == 265*e^(-10/3*t + 3467/3570)/(265*e^(-10/3*t +
3467/3570) - 3)]

which is indeed another equation which depends on t?
 

sage didn't find a better algebraic solution.  Try to find solutions
numerically.

sage: plot(y, (t,0,5))

shows that y==0.2 will have one solution in [0,0.5] and another solution
in [1,1.5].  You'll get them numerically with

sage: t1 =  find_root(y==0.2, 0,0.5); t1
0.023210775112474515
sage: t2 =  find_root(y==0.2, 1,1.5); t2
1.1642130321591619

Verify the result:
sage: y.subs(t=t1)
0.2000621
sage: y.subs(t=t2)
0.200

Regards,

   Eckhard

   


--
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] Is Solve adequate to solve y values?

2010-08-01 Thread Jose Guzman


I am trying to solve at which x-values the function takes a given y 
value. In its most simplistic case, this is easy to get with Solve:


sage: var('t')
sage: y=1-e**(-t/5)
sage: sol = solve(y==0.632,t)
sage: n(sol[0].rhs())



Which gives me 4.9983, the value I was looking for is 5, so it is OK. 
However, in more complicated expressions (a biexponential of the from:


sage: y=-17.6*(e^(-1/5*t) - 1)*e^(-3.33*t 
+0.971148468732930)



which varies between 0 an 1 in the interval between x=0 and x=5, the 
task becomes complicated:

Trying to get the value at which the functions is 20% of its maximum I get

sage: solve(y==.2,t)
sage: [e^(1/5*t) == 265*e^(-10/3*t + 3467/3570)/(265*e^(-10/3*t + 
3467/3570) - 3)]


which is indeed another equation which depends on t?

I am doing something wrong here? Is the command Solve adequate to solve 
this kind of task?


Thank you very much in advance!

Jose

--
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] NEURON + hands-on tutorial using Sage in San Diego 2010.

2010-07-07 Thread Jose Guzman

Dear Sage list-members,

For those interested in computational neuroscience and the Neuron 
simulation environment; next 13 Nov an initiation course about Neuron 
using SAGE will be hold in San Diego. The course will be use SAGE as 
interface to access the different scientific Python packages and to 
process the Neuron computations.


You can read some preliminary details there.

http://www.neuron.yale.edu/phpBB/viewtopic.php?f=22&t=1993

I think, some people in the list might be interested in attending to the 
course (I applied myself). In any case, this is a very good example on 
how Sage spreads to other areas (applied mathematics, computational 
neuroscience, etc...), where platforms like mathematica or mapple were 
the state of the art.


Best.

Jose.

PS: to William Stein, do you think we should announce the course in the 
webpage?


--
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: XPPAUT and Sage

2010-06-13 Thread Jose Guzman

On 06/12/2010 12:25 AM, Jeff Post wrote:

On Friday 11 June 2010 14:30, Rob wrote:
   

It's easy to find Bard's email address on the web. He's very happy to
help with build issues.
 

Oops! Mea culpa. I inadvertently entered it as b...@pitt.edu (wonder how that
could have happened - sheepish grin)

Thanks,
Jeff

   

Hey Jeff,

Let me know the solution to the makefile problem, I am also interested 
in compiling from the sources, and found problems with the library Vector.o


--
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] XPPAUT and Sage

2010-06-11 Thread Jose Guzman

On 06/11/2010 10:59 PM, Jeff Post wrote:

On Thursday 10 June 2010 21:59, Jan Groenewald wrote:
   

xppaut has always been very fast at DE solving,

 

I tried compiling xppaut on CentOS 4.8 and make issues this error:

make: *** No rule to make target `parserslow2.o', needed by `xppaut'.  Stop.

After editing the Makefile to fix that problem, make issues the same error on
another file, then another and another. After editing the Makefile about half
a dozen times, I just gave up. I tried to contact the author but apparently
the email address given in the README file is defunct.

Does anyone have a Makefile for xppaut that actually works on Linux? Past
experience has shown it to be unwise to run distributed binaries (Bad Things
can happen), so I'd like to compile from source.

   
The same happened to me under GNU/Debian Linux. In the end, I decided to 
install from the binary. It was the only way for me to have try it.

Thanks,
Jeff

   


--
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] XPPAUT and Sage

2010-06-11 Thread Jose Guzman

Thanks for the nice replies!

I think I will give XPP a try. The syntax does not look complicated. One 
of the first things I will try is to write some Python routines to read 
the XPP output to plot it within Matplotlib. Maybe in a long run, I 
could try to include some XPP in Sage. Rob, would it be possible to 
implement your PyDSTool package in Sage?


As Jan suggested, trying Sage/XPP in parallel would give me a nice 
overview , and I could try to add some documentation and examples about 
how to solve ODEs with Python/Sage.


Thanks!

On 06/10/2010 11:01 PM, Jose Guzman wrote:

Dear Sage users,

I am going to take a course on computational neuroscience soon. Tutors 
suggested us to use xppaut (or similar) to solve ODEs. Since I am a 
little bit more familiar with Sage, I was wondering if I could simply 
use Sage in stead of xppaut. I would really appreciate if somebody 
with experience in xppaut and/or Sage would give me some ideas about 
the advantages/disadvantages of xppaut versus Sage . Until now, I did 
not have any necessity to solve ODEs, so I  cannot judge very much if 
it is really worthy to move to xppaut.

Thanks a lot in advance

Jose.



--
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] XPPAUT and Sage

2010-06-10 Thread Jose Guzman

Dear Sage users,

I am going to take a course on computational neuroscience soon. Tutors 
suggested us to use xppaut (or similar) to solve ODEs. Since I am a 
little bit more familiar with Sage, I was wondering if I could simply 
use Sage in stead of xppaut. I would really appreciate if somebody with 
experience in xppaut and/or Sage would give me some ideas about the 
advantages/disadvantages of xppaut versus Sage . Until now, I did not 
have any necessity to solve ODEs, so I  cannot judge very much if it is 
really worthy to move to xppaut.

Thanks a lot in advance

Jose.

--
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 when importing matplotlib from sage -python

2010-05-24 Thread Jose Guzman

On 05/23/2010 10:04 AM, Adam Webb wrote:


On May 22, 11:12 pm, Jose Guzman  wrote:
   

Hi everybody

When I tried to import matplotlib from the Python version that is
bundled with Sage, I found that the moduled tkagg was not present.

  >>>  import matplotlib.pyplot as plt
  >>>  No module named _tkagg

Would anybody tell me how to install this module in the Python version
of Sage. I am using Debian/GNU Linux and Sage 4.3.5

Thanks a lot in advance!

Jose.

 

Hi,

As I recall, you need to set an environment variable before building
matplotlib. In bash:
$ export SAGE_MATPLOTLIB_GUI='yes'

You will also need the dev pakages installed.
$ sudo apt-get install tk-dev tcl-dev

After installing the dev packages you should only have to reinstall
matplotlib.
$ sage -f matplotlib

HTH

Adam

   

Dear Adam,

Absolutely fantastic, I just followed your instructions and Matplotlib 
is working under my Sage.


Thanks a lot

Jose.

--
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] Error when importing matplotlib from sage -python

2010-05-22 Thread Jose Guzman

Hi everybody

When I tried to import matplotlib from the Python version that is 
bundled with Sage, I found that the moduled tkagg was not present.



>>> import matplotlib.pyplot as plt
>>> No module named _tkagg

Would anybody tell me how to install this module in the Python version 
of Sage. I am using Debian/GNU Linux and Sage 4.3.5


Thanks a lot in advance!

Jose.

--
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] Unsupported operand for numpy.ndarray

2010-05-22 Thread Jose Guzman

Hi there!

When trying to plot the probability density function of a skew 
normal-distribution as a function of an "alpha" skewness I found the 
following error:


sage: from scipy.stats import norm
sage: var('alpha')
sage: skew_norm(x, alpha) = 2*norm.pdf(x)*norm.cmd(x*alpha)

TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and 
'numpy.bool_'


I know that Sage had some issues with numpy/scipy , and in the past I 
updated some patches (5081, 6497, and 6506)  to solve these kind of 
problems. However, my current version of Sage (4.3.5) does not admit 
these patches anymore, and the problem seems to be partially solved (see 
bellow):


sage: sin(np.arrange(5))
sage: array([ 0. , 0.84147098, 0.90929743, 0.14112001, -0.7568025 ])

Do I have to update other patches, install the latest Sage version or 
something else?


Any suggestion would be greatly appreciated!

Thanks a lot

Jose.

--
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] How to define a function in command line mode?

2010-04-04 Thread Jose Guzman

Hi there,

Although I love the notebook() option, I would like to start using Sage 
more from the command line. Using Sage to import *.sage scripts is 
relatively easy, but I found problems when I try to define a function in 
the command line. For example, if I do:


$./sage -ipython -nobanner
>>> from sage.all import *
>>> f(x) = x**2

I found the following error:

  File "", line 1
SyntaxError: can't assign to function call (, line 1

However, if I write a sage script and define the function on it, i can 
easily use it:


>>> load("simple.sage")
>>> f(3)
>>> 9

By the way, I did not find much documentation regarding the use of the 
Sage in command-line mode, or about how to call Sage as a Python 
library. If this is not already present, I will try to add this (after 
reading the developers guide) to the standard Sage documentation.


Thanks a lot for your help.


Jose

--
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] reduce() of empty sequence with no initial value

2010-03-31 Thread Jose Guzman
Ok, this seems to be corrected in the new version. I tried this with the 
version 4.1, but with the new 4.3.3 on line works ok.


Thanks a lot!

Jose Guzman wrote:

Hi everybody,

I am trying to plot a function called 'r' defined as :

sage: var('r,alpha,beta')
sage: r = alpha/(alpha + beta)

whose components are:

sage: r_alpha = 1.0/(1.7 + e**(-(x+28.2)/13.5) )
sage: r_beta = e**(-(x+63.0)/7.8) / e**(-(x+28.8)/13.1+1.7)

However if I try now to plot r as as function of these equations, for 
example as follows


sage: plot(r.subs(alpha = r_alpha, beta =r_beta),-100,100)

I get this error message:

sage: TypeError: reduce() or empty sequence with no initial value

Strange enough, I can plot both r_alpha and r_beta independently, and 
resolve/plot the function numerically. Moreover, if I substitute


sage: r_alpha = 1.0/(1.7 + e**(-(x+28.2)/13.5) ) # remove numerator
sage : r_alpha = (1.7 + e**(-(x+28.2)/13.5) )

I can plot the function r (obviously this is not the desired 
function). Does anybody has an idea about how to solve that?




--
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 unsubscribe, reply using "remove me" as the subject.


Re: [sage-support] Re: newbie: plot() questions

2010-03-31 Thread Jose Guzman

ma...@mendelu.cz wrote:

On 26 bře, 09:43, Jose Guzman  wrote:

  

Inhttp://wiki.sagemath.org/days13/projects/sagenewbie


Hi Robert, thanks a lot for your comments. Actually I was not working the 
differential calculus (I collaborate with some basic ploting, limits 
calculation and basic algebra). However, I took a look to the notebook:



I tried the differential calculus and have some remarks:

1) I got several times a warning:
__main__:3: DeprecationWarning: Substitution using function-call
syntax
and unnamed arguments is deprecated and will be removed from a future
release of Sage; you can use named arguments instead, like EXPR(x=...,
y=...)
  

sage: f = x**2 + 3*x -1
sage: f(2)
warning...

This is a warning comming in the last versions of Sage. This is because 
now it is recommended that you describe explicitly the independent 
variable, like this:


sage: f(x) = x**2 + 3*x -1
sage: f(2)
sage: 9

Then, simply substitute f by f(x) in every function declaration


3) The last computation gives RuntimeError: power::eval(): division by
zero
  
You are right, I think it does not make much sense to look for the 
continuity of the function f(x)=1/x, since 1/0 is undefined. I would 
suggest to catch the exception when the function f(x) is not defined in 
x first, just before calculate the limit of the function . Something 
with this:


def continous(f,a):
""" test if a the function f is continous in value a
Returns True if continuous, False otherwise"""
   try:
   f(a)
   except:
   return False

if limit(f, x=a)==f(a):
   return True
else:
   return False

Best!

Jose


--
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 unsubscribe, reply using "remove me" as the subject.


Re: [sage-support] Re: newbie: plot() questions

2010-03-31 Thread Jose Guzman
It is simple:in the page you entered simply click on "get" on the 
attached file that you want to download.


After that, in your Sage notebook click "upload file" from the directory 
where you download the previous file.


If you find complications I could send you the files, or share them via 
sagenb.org


Best.

Jose


Renato wrote:
1) Basic 2D plotting with Sage Ploting_with_Sage_v1.0.1.sws 
 

2) Solving basic equations with Sage Ball_motion.sws 
 



Can't understand if I'm doing something wrong, but I can't upload these
two worksheets in my locally installed sage. (sage says they are not
valid). I haven't tried number 3).

I can though download Plotting_with_Sage_v1.0.1 do a tar -xvzf on it
and upload the file 42/worksheet.txt as a sage worksheet


cheers
renato

  


--
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 unsubscribe, reply using "remove me" as the subject.


[sage-support] reduce() of empty sequence with no initial value

2010-03-31 Thread Jose Guzman

Hi everybody,

I am trying to plot a function called 'r' defined as :

sage: var('r,alpha,beta')
sage: r = alpha/(alpha + beta)

whose components are:

sage: r_alpha = 1.0/(1.7 + e**(-(x+28.2)/13.5) )
sage: r_beta = e**(-(x+63.0)/7.8) / e**(-(x+28.8)/13.1+1.7)

However if I try now to plot r as as function of these equations, for 
example as follows


sage: plot(r.subs(alpha = r_alpha, beta =r_beta),-100,100)

I get this error message:

sage: TypeError: reduce() or empty sequence with no initial value

Strange enough, I can plot both r_alpha and r_beta independently, and 
resolve/plot the function numerically. Moreover, if I substitute


sage: r_alpha = 1.0/(1.7 + e**(-(x+28.2)/13.5) ) # remove numerator
sage : r_alpha = (1.7 + e**(-(x+28.2)/13.5) )

I can plot the function r (obviously this is not the desired function). 
Does anybody has an idea about how to solve that?


--
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 unsubscribe, reply using "remove me" as the subject.


[sage-support] Plot problem: reduce() of empty sequence with no initial value

2010-03-30 Thread Jose Guzman

Hi everybody,

I am trying to plot a function called 'r' defined as :

sage: var('r,alpha,beta')
sage: r = alpha/(alpha + beta)

whose components are:

sage: r_alpha = 1.0/(1.7 + e**(-(x+28.2)/13.5) )
sage: r_beta = e**(-(x+63.0)/7.8) / e**(-(x+28.8)/13.1+1.7)

However if I try now to plot r as as function of these equations, for 
example as follows


sage: plot(r.subs(alpha = r_alpha, beta =r_beta),-100,100)

I get this error message:

sage: TypeError: reduce() or empty sequence with no initial value

Strange enough, I can plot both r_alpha and r_beta independently, and 
resolve/plot the function numerically. Moreover, if I substitute


sage: r_alpha = 1.0/(1.7 + e**(-(x+28.2)/13.5) ) # remove numerator
sage : r_alpha = (1.7 + e**(-(x+28.2)/13.5) )

I can plot the function r (obviously this is not the desired function). 
Does anybody has an idea about how to solve that?


--
José Guzmán
Physiologisches Institut der Universität Freiburg
Engesser Str. 4
Phone: +49-761-203-5165
Telefax: +49-761-203-5104
D-79108 Freiburg Germany

--
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 unsubscribe, reply using "remove me" as the subject.


Re: [sage-support] Re: newbie: plot() questions

2010-03-26 Thread Jose Guzman

Jason Grout wrote:

On 03/25/2010 02:43 AM, Jose Guzman wrote:

Jose Guzman wrote:





Some time ago I wrote a Sage worksheet to get familiar with the
plotting possibilities of Sage. You can find it here:
www.*sage*nb.org/home/pub/399/


Actually the page does not display the graphics, if you want to have a
copy of the worksheet just mail me and I can share it in sagebn.org or
simply send you.



This is a very nice page!  If you give permission, we should add this 
page to the Sage documentation somewhere (the tutorial, maybe?)


Thanks,

Jason


Dear Jason,

feel free to use the notebook just as if were yours. I created this as a 
guide to myself in the beginning, and though that it would be useful for 
other as well.


In principle, I wanted to add a couple of things to the Sage 
documentation (especially regarding numerical analysis), but I did not 
have the time to learn "how to submit a patch" (I will probably ask you 
guys in the IRC channel to guide me a little bit). In any case, I 
prepared a wiki where you can find the following guide for people 
starting to use Sage.


In http://wiki.sagemath.org/days13/projects/sagenewbie

1) Basic 2D plotting with Sage Ploting_with_Sage_v1.0.1.sws 
<http://wiki.sagemath.org/days13/projects/sagenewbie?rename=Ploting_with_Sage_v1.0.1.sws&action=AttachFile> 

2) Solving basic equations with Sage Ball_motion.sws 
<http://wiki.sagemath.org/days13/projects/sagenewbie?action=AttachFile&do=view&target=Ball_motion.sws> 

3) Limits Calculus Analysis_tutorial_Limits_v1.0.2.sws 
<http://wiki.sagemath.org/days13/projects/sagenewbie?action=AttachFile&do=view&target=Analysis_tutorial_Limits_v1.0.2.sws> 



At some point I will write more. I cannot be enough thankful Sage and 
the help of its members, and I thought this would be a nice way to give 
something back.


Best

Jose.


--
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 unsubscribe from this group, send email to sage-support+unsubscribegooglegroups.com or 
reply to this email with the words "REMOVE ME" as the subject.


Re: [sage-support] problems saving images from notebook

2010-03-25 Thread Jose Guzman

Renato wrote:

Hello, I'm using sage notebook and I'm having some headache to save the
images generated by show(). The problem is that 3/4 of the time if i
right click on the image and do "open image" I get a page with:

  

Why don't you try for example this?

sage: figure = plot(sin(x),0,2*pi)
sage: figure.save('/home/user/sin.pdf', dpi=300)

Best.

Jose

--
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 unsubscribe from this group, send email to sage-support+unsubscribegooglegroups.com or 
reply to this email with the words "REMOVE ME" as the subject.


Re: [sage-support] newbie: plot() questions

2010-03-25 Thread Jose Guzman

Jose Guzman wrote:


 
Some time ago I wrote a Sage worksheet to get familiar with the 
plotting possibilities of Sage. You can find it here:

www.*sage*nb.org/home/pub/399/

Actually the page does not display the graphics, if you want to have a 
copy of the worksheet just mail me and I can share it in sagebn.org or 
simply send you.


Best.

Jose

--
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 unsubscribe from this group, send email to sage-support+unsubscribegooglegroups.com or 
reply to this email with the words "REMOVE ME" as the subject.


Re: [sage-support] greek letters and underscores in graphics

2010-03-25 Thread Jose Guzman

Renato wrote:

and it works fine. The problem is I'd like to use greek letters in the
text, and also underscore indexes. Here's the latex code of what I'd
like:

$\lambda_{0}$

can I somehow display that as text next to the plot??

thanks
Renato

  

Something like this should work:

sage: equation = text('$\\lambda_{0}$', fontsize=20)

Remember to write an additional "\" in the string when inserting the \ 
before any latex.


Best.

--
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 unsubscribe from this group, send email to sage-support+unsubscribegooglegroups.com or 
reply to this email with the words "REMOVE ME" as the subject.


Re: [sage-support] newbie: plot() questions

2010-03-24 Thread Jose Guzman



Ok, this was as simple as using the 'ymin' and 'ymax' options of plot
(I had done something else wrong previously when G B suggested this
cause it didn't work) 

  

Ok, I was about to answer your question, but you found the solution faster.

BTW I didn't find any mention of these plot options in the docs,
worth adding?

  
Some time ago I wrote a Sage worksheet to get familiar with the plotting 
possibilities of Sage. You can find it here:

www.*sage*nb.org/home/pub/399/

You may find it interestings

Best.

Jose

--
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 unsubscribe from this group, send email to sage-support+unsubscribegooglegroups.com or 
reply to this email with the words "REMOVE ME" as the subject.


Re: [sage-support] newbie: plot() questions

2010-03-18 Thread Jose Guzman

Hi Nareto,

would you mind to write a simple and minimal example of your f(t) and 
plot options? This would be the best way to try to help you




Nareto wrote:

Hello, I have to plot an exponential function with vertical asymptote
in point tc, but

plot(f(t), (tc  - e, tc + e));

gives me unreadable plots for any values of e - if e is to large the
curvature is not apreciable (i.e. the plot is confused with the axes)
but if it's too small I'm getting things like 4 on the y axis.

So, how can I force the y axis range? I tried this but it doesn't
change anything:

P = plot(f(t));
P.set_range_axes(tc - 0.2, tc + 0.2, f(tc - 0.2), f(tc + 0.2));
show(P);

Question #2, how can I tell sage not to 'break' the axes? for example,

plot(1/(x + 3));

doesn't show me the last bit of the y axis, it ends approximately at
0.25


thanks for any help
Renato

  


--
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: How to use the result of solve

2010-03-17 Thread Jose Guzman

Dear BFJ,

thanks a lot for your answer. It works very nice!

Alternatively, I found that using the rhs() method also works. My idea 
was to substitute the algebraic expression of the solution, and inserted 
as denominator of a new function:


sage: f(x) = ( 1-e**(t/tau0) )*(e**(-x/tau1)) # this is the origin function
sage: S = solve(derivative(f,x)==0,x) # this is the solution at the peak
sage: tpeak = S[0].rhs() # this is the algebraic solution
sage: ypeak = f(tpeak) # y-value expressed as tau0 and tau1
sage: f_norm(x) = f(x)/ypeak # we nor normalize the function to the 
ypeak value


It works like a charm!!! I love Sage!

Best

JOse.



BFJ wrote:

To get the value of 'x' from solve you can use the option
solultion_dict = true as follows:

sage: S = solve(derivative(f,x)==0,x, solution_dict=true)
sage: S[0][x]
tau0*log(tau1/tau0 + 1)
sage: S[0][x].subs(tau0=0.5, tau1=5.0)
1.19894763639919

Also, using the 'N' function will evaluate numerical expressions to a
desired level of accuracy

sage: N(S[0][x].subs(tau0=0.5, tau1=5.0), digits=25)
1.198947636399185334710182

-BFJ

On Mar 16, 5:32 pm, Jose Guzman  wrote:
  

Hi everybody again.

Does anybody if it is possible to use the result of the function solve
to insert it in a function to resolve it analitically.

For example, I want to get the peak of the following function

 >>> var('tau0,tau1')
 >>> f(x) = (1-e**(-x/tau0))*(e**(-x/tau1))

For that, I simply derive it and equal to zero

 >>> solve(derivative(f,x)==0,x)
 >>> [x == tau0*log(tau1/tau0 + 1), e^(-(tau0 + tau1)*x/(tau0*tau1)) == 0]

I would like to take the first expression of that list
 >>> xpeak = solve(derivative(f,x)==0,x)[0]

for example, to calculate its value when tau0=0.5 and tau1=5.0

 >>> xpeak.subs(tau0=.5, tau1=5.0)

but this returns a symbolic expresion ,



t == 0.500*log(11.0)
  

and not the scalar 1.1989

More importantly, I would like to use this expression to solve
analytically the y value of that equation as a function of tau0 and tau1

Any suggestion would be greatly appreciated!

Best

Jose.



  


--
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] How to use the result of solve

2010-03-16 Thread Jose Guzman

Hi everybody again.

Does anybody if it is possible to use the result of the function solve 
to insert it in a function to resolve it analitically.


For example, I want to get the peak of the following function

>>> var('tau0,tau1')
>>> f(x) = (1-e**(-x/tau0))*(e**(-x/tau1))

For that, I simply derive it and equal to zero

>>> solve(derivative(f,x)==0,x)
>>> [x == tau0*log(tau1/tau0 + 1), e^(-(tau0 + tau1)*x/(tau0*tau1)) == 0]

I would like to take the first expression of that list
>>> xpeak = solve(derivative(f,x)==0,x)[0]

for example, to calculate its value when tau0=0.5 and tau1=5.0

>>> xpeak.subs(tau0=.5, tau1=5.0)

but this returns a symbolic expresion ,


t == 0.500*log(11.0)


and not the scalar 1.1989

More importantly, I would like to use this expression to solve 
analytically the y value of that equation as a function of tau0 and tau1


Any suggestion would be greatly appreciated!

Best

Jose.

--
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] Plotting within an interval.

2010-03-16 Thread Jose Guzman

Thanks a lot David, this is what I needed.

Just if somebody else might need it, i will resolve the problem:

# declare t and tau as symbolic variables
var('t')
var('tau')

# monoexponential equation
g(t) = e**(-t/tau)

# 2-piece result (one from 0 to t0, the second from t0 to 1000
t0 = 0.2 # this is the onset of the exponential function
MNTB_g  = piecewise([[(0,t0),lambda t:0],[(t0,1000),g.subs(tau=0.9)]])

# plots!
fig = list_plot([MNTB_g(t) for t in xrange(1000)], plotjoined = True, 
rgbcolor='red')

fig.show(xmax=25)

The figure looks a little weird though, I guess I would have to solve it 
analytically.


Thanks a lot for your help

Jose.

David Joyner wrote:

Use Piecewise. Type Piecewise? For examples.


On Tuesday, March 16, 2010, Jose Guzman  wrote:
  

Hi everybody,

i was wondering, which is the best method to plot a conditional function within 
an interval. For example, a function whose values are:

0 if tt0

where f(t) is a simple monoexponential decay that starts at t0. I tried the 
following in Sage:

t = var('t')

def f(t,t0):
if thttp://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] Plotting within an interval.

2010-03-16 Thread Jose Guzman

Hi everybody,

i was wondering, which is the best method to plot a conditional function 
within an interval. For example, a function whose values are:


0 if tt0

where f(t) is a simple monoexponential decay that starts at t0. I tried 
the following in Sage:


t = var('t')

def f(t,t0):
if thttp://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: how to find solutions with fsolve

2010-02-27 Thread Jose Guzman

Dear Jason,

first of all, thank you very much for your kind help and time.

Could you post a self-contained example that gives the error you get 
below?




here my running example. I got to solve it late  last night...

>>> from scipy.stats import binom
>>> from scipy.optimize import fsolve

>>> def mybinom(N):
>>> returns the probability of finding 40 or more successes in 
a population of N samples 

>>>return 1-binom(N, 0.15).cdf(40)

>>> mybinom(200) # I know the value should be around 200 (solved by 
brute-force)

>>> 0.02199927

>>> fsolve(lambda N: mybinom(N)-0.020, 100)
>>> 199.5458489705228

a float value of N=199.54 does not make much sense for a binomial 
experiment. I am new here but it seems that fsolve changes depending on 
the starting estimation parameter.


>>> int(round(fsolve(lambda N: mybinom(N) - 0.02, 100)))
>>> 200

>>> int(round(fsolve(lambda N: mybinom(N) - 0.02, 90)))
>>> 199

.. is there any optimize better method to get an integer? I did not get 
find_root() to work :/



It seems like your mathematica code got cut off in the definition of g.

Sage has a find_root command.  See 
http://www.sagemath.org/doc/reference/sage/numerical/optimize.html#sage.numerical.optimize.find_root 



However, I think it depends on the function being continuous.  I 
assume that's why the mathematica code appears to find the root of an 
interpolated function?


Exactly, this is how the mathematica code solve it, but I became a big 
fan of Sage!


Thank you very much!

Jose.

--
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] how to find solutions with fsolve

2010-02-26 Thread Jose Guzman
This probably has not much to do with Sage, but I need some help. I am 
using the binom package of scipy.stats to solve how many trials (N) I 
would need to get 40 or more successes at least in 2% of the times. 
Basically what I am doing with sage is:


from scipy.stats import binom
from scipy.stats import fsolve

def mybinom(N):
   return 1-binom(N,p).cdf(40)

fsolve(mybinomial(N)-0.02, 100)

however this returns an error:

TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and 'numpy.bool_'


is there anything similar to the command FindRoot in mathematica ???

g[N_] := Interpolation[Table
FindRoot[g[x] == 0.02 , n, {x, 100, 101}, MaxIterations -> 1000]

I tried some of the scalar optimizations of scipy.optimize but I could 
not get it working.


Thanks a lot in advance!

--
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: leastsq problem: array cannot be safely cast to required type.

2009-07-27 Thread Jose Guzman

Dear Ahmed Fasih

Thanks a lots for and for the instructions to insert a patch. I would 
have not never thought it was so easy to insert a patch in Sage! You 
save me a lot of time !!!

And even the code inserted in the patch does not look to difficult... I 
am looking forward to collaborating with Sage.

Thanks a lot!

Jose
wrote:
> Jose, I just tried this in a Notebook for a Sage having applied the
> patch as described in 
> http://groups.google.com/group/sage-support/msg/00d0b4c724473e3c
> and it works:
> <<<
> import numpy as np
> from scipy.optimize import leastsq
> x = np.arange(0,3.0,0.25)
> y = np.array
> ([0.0,0.3066,1.2263,2.7591,4.9050,7.6641,11.0363,15.0216,19.6200,24.8316,30.6562,37.0941],dtype=float)
>
> # define a residuals function
> def residuals(p,x,y):
> k,degree = p
> err = y -(k*(x**degree))
> return err
>
> # initial guess, k = 4.0, exp = 3?
> pinit = [4.0,3]
>
> #compute the leastsq algorithm
> leastsq(residuals,pinit,args=(x,y))
>   
>
> produces:
>
> (array([ 4.90502425,  1.9494]), 3)
>
> See the thread for details, but for completeness, I am copying the
> relevant bit from wstein's mail:
> <<<
> sage: hg_sage.apply('http://trac.sagemath.org/sage_trac/attachment/
> ticket/5081/5081-numpy-types.patch')
> sage: quit
> $ sage -br
> ... wait a few minutes
>   
>
> On Jul 27, 10:29 am, Jose Guzman  wrote:
>   
>> HI Minh Nguyen"!
>>
>>
>>
>> 
>>> I got this far:
>>>   
>>> --
>>> | Sage Version 4.1, Release Date: 2009-07-09 |
>>> | Type notebook() for the GUI, and license() for information.|
>>> --
>>> sage: import numpy as np
>>> sage: import scipy.optimize
>>> sage: x = np.arange(0, 3.0, 0.25)
>>> sage: y = np.array([0.0, 0.3066, 1.2263, 2.7591, 4.9050, 7.6641,
>>> 11.0363, 15.0216, 19.6200, 24.8316, 30.6562, 37.0941], dtype=float)
>>> sage: def residuals(p, x, y):
>>> : k, degree = p
>>> : err = y -(k*(x^degree))
>>> : return err
>>> :
>>> sage: pinit = [4.0, 3]
>>> sage: scipy.optimize.leastsq(residuals, pinit, args=(x,y))
>>> ---
>>> TypeError Traceback (most recent call last)
>>>   
>>> /home/mvngu/.sage/temp/sage.math.washington.edu/28595/_home_mvngu__sage_init_sage_0.py
>>> in ()
>>>   
>>> /usr/local/sage/local/lib/python2.6/site-packages/scipy/optimize/minpack.pyc
>>> in leastsq(func, x0, args, Dfun, full_output, col_deriv, ftol, xtol,
>>> gtol, maxfev, epsfcn, factor, diag, warning)
>>> 268 if (maxfev == 0):
>>> 269 maxfev = 200*(n+1)
>>> --> 270 retval =
>>> _minpack._lmdif(func,x0,args,full_output,ftol,xtol,gtol,maxfev,epsfcn,factor,diag)
>>> 271 else:
>>> 272 if col_deriv:
>>>   
>>> TypeError: array cannot be safely cast to required type
>>>   
>>> As mentioned at the thread
>>>   
>>> http://groups.google.com/group/sage-devel/browse_thread/thread/fd1414...
>>>   
>>> the problem is that at the moment there is little support for
>>> automatic data conversion between NumPy and Sage. Here are some
>>> tickets to make this happen:
>>>   
>>> #6497
>>> http://trac.sagemath.org/sage_trac/ticket/6497
>>>   
>>> #5081
>>> http://trac.sagemath.org/sage_trac/ticket/5081
>>>   
>>> #6506
>>> http://trac.sagemath.org/sage_trac/ticket/6506
>>>   
>> ok, I got it, I will have a look to that. I guess this might be a good
>> occasion to contribute to the Sage code. I will have a look to the
>> developers guide.
>> 
> >
>   


--~--~-~--~~~---~--~~
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: leastsq problem: array cannot be safely cast to required type.

2009-07-27 Thread Jose Guzman

HI Minh Nguyen"!

> I got this far:
>
> --
> | Sage Version 4.1, Release Date: 2009-07-09 |
> | Type notebook() for the GUI, and license() for information.|
> --
> sage: import numpy as np
> sage: import scipy.optimize
> sage: x = np.arange(0, 3.0, 0.25)
> sage: y = np.array([0.0, 0.3066, 1.2263, 2.7591, 4.9050, 7.6641,
> 11.0363, 15.0216, 19.6200, 24.8316, 30.6562, 37.0941], dtype=float)
> sage: def residuals(p, x, y):
> : k, degree = p
> : err = y -(k*(x^degree))
> : return err
> :
> sage: pinit = [4.0, 3]
> sage: scipy.optimize.leastsq(residuals, pinit, args=(x,y))
> ---
> TypeError Traceback (most recent call last)
>
> /home/mvngu/.sage/temp/sage.math.washington.edu/28595/_home_mvngu__sage_init_sage_0.py
> in ()
>
> /usr/local/sage/local/lib/python2.6/site-packages/scipy/optimize/minpack.pyc
> in leastsq(func, x0, args, Dfun, full_output, col_deriv, ftol, xtol,
> gtol, maxfev, epsfcn, factor, diag, warning)
> 268 if (maxfev == 0):
> 269 maxfev = 200*(n+1)
> --> 270 retval =
> _minpack._lmdif(func,x0,args,full_output,ftol,xtol,gtol,maxfev,epsfcn,factor,diag)
> 271 else:
> 272 if col_deriv:
>
> TypeError: array cannot be safely cast to required type
>
> As mentioned at the thread
>
> http://groups.google.com/group/sage-devel/browse_thread/thread/fd1414514c5d83b2
>
> the problem is that at the moment there is little support for
> automatic data conversion between NumPy and Sage. Here are some
> tickets to make this happen:
>
> #6497
> http://trac.sagemath.org/sage_trac/ticket/6497
>
> #5081
> http://trac.sagemath.org/sage_trac/ticket/5081
>
> #6506
> http://trac.sagemath.org/sage_trac/ticket/6506
>
>   

ok, I got it, I will have a look to that. I guess this might be a good 
occasion to contribute to the Sage code. I will have a look to the 
developers guide.

--~--~-~--~~~---~--~~
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] leastsq problem: array cannot be safely cast to required type.

2009-07-27 Thread Jose Guzman

Hi there!

I am trying to find some parameters with the least squares algorithm 
within Sage (v 4.0.2) . Unfortunately, when I try to use the 
scipy.optimize.leastsq() method within Sage I get the following error:

 >>> array cannot be safely cast to required type.

Strange enough,  if I do the same directly with iPython I can perform 
the computation properly.  Do I have to cast my original data to some 
special type in Sage (i.e RealNumbers)???. If yes, how? I tried lists, 
tuples and NumPy arrays but  It did not work.

here the simplified code:

# some dummy  x,y data for testing
x = np.arange(0,3.0,0.25)
y = 
np.array([0.0,0.3066,1.2263,2.7591,4.9050,7.6641,11.0363,15.0216,19.6200,24.8316,30.6562,37.0941],dtype=float)

# define a residuals function
def residuals(p,x,y):
k,degree = p
err = y -(k*(x**degree))
return err

# initial guess, k = 4.0, exp = 3?
pinit = [4.0,3]

#compute the leastsq algorithm
leastsq(residuals,pinit,args=(x,y))

Thank you very much in advance!

Jose.

--~--~-~--~~~---~--~~
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: How to return a tangent line.

2009-05-24 Thread Jose Guzman


>
> sage: def secant(xpoint):
> : df = f.differentiate(x)
> : m = df(xpoint)
> : a = f(xpoint) - m*(xpoint)
> : g(x) = a + m*x
> : return g
>
> The trick is to define the function, and the, make the return of the 
> "abstract" function.
>
>   
Yeah! That was it!  Now I can call it with @interact
>   
>> I guess I am doing something essentially wrong from the pythonic point 
>> of view, but I cannot figure out how to create this function to call it 
>> later in a interactive cell with @interact.
>>   
>> 
> I don't really understand neither ;)
>   
Sorry, what I meant is that now I can call the function secant(x) with 
the @interact method of Sage. This present a menu that the user can 
easily control.

for example in a cell of a notebook (assuming f(x) and tangent(x) are 
already defined)


@interact

def plot_example(xtangent = (2,(2..10)) ):

lpar = plot(f,-1,100) # plot the function f(x) = x**2
lsec = plot(tangent(xtangent),rgbcolor='red',-1,100) # plot 
tangen(x) = a + bx
figure = (lpar + lsec)

figure.show(xmin=0,xmax=100,ymin=-1,ymax=100)

in this example the values xsecant are chosen by the user in a menu, and 
plotted accordingly in the figure. I will add my worksheet to the wiki 
(in the Sage days 13 there is a nice project to introduce Sage for 
undergraduate students, which would be very valuable for the Sage 
beginner too)

Once again, thank you very much for your help!

Jose.


--~--~-~--~~~---~--~~
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] How to return a tangent line.

2009-05-23 Thread Jose Guzman

Hi everybody,

I am pretty new to symbolic math and Sage but I love it.

I am trying create a function which returns an tangent line at a given 
point (xpoint) in a function f(x) already known as follows:

var('x')
f(x): x**2

def tangent(xpoint):

def secant(xpoint):
# function of the form f(x) = a + bx
df = f.differentiate(x)
m = df(xpoint) # slope is the derivative of the function in that point
a = f(xpoint) - m*(xpoint) # coordinate
   
return g(x) = a + m*x

however this returns \none and I cannot use it later.

I guess I am doing something essentially wrong from the pythonic point 
of view, but I cannot figure out how to create this function to call it 
later in a interactive cell with @interact.


def 
plot_example(r=range_slider(0,10,step_size=1),xtangent=(2,(0..10)),xsecant=(7,(0..10))):


show(plot(tangent(xtangent)))

Thank you very much for your help, and my apologizes in advance if the 
question is too trivial.

Jose.

--~--~-~--~~~---~--~~
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: beginner problems

2009-04-20 Thread Jose Guzman

hi Florian

Florian Beutler wrote:
> hallo
> I just installed sage today and probably the problem I have at the
> moment is a typical beginner problem, but unfortunately the tutorial
> was not helpful concerning this points.
>   
I was in the same situation 3 weeks ago. I have the same feeling with 
the manual, and as soon as I get a little bit more familiar with Sage 
and the programming/documentation I will try to make some contributions 
to the manual. I would recommend you 2 things.

1.- Take a look to "Sage For Newbies". Google it, its for free and it 
takes approximately 20 min to read the guide and become familiar with 
the easy things of Sage.

2.- Log in into the Sage database (sagenb.org) and have a look to the 
literally thousands of worksheets there. Many people (included myself) 
leave its guides and ways to solve certain task with Sage.

> if I use
> rho = 0.0058/((r/2.4)*(1+(r/2.4))^2)
> integral(rho,r,0,10)
>
> this does not work because for r=0 rho is not defined. But anyway I
> want to integrate over the complete radius. What do I have to do?
> I can avoid the problem by using
>   
Use the following to define r as symbolic variable
r=var('r')

rho = 0.0058/((r/2.4)*(1+(r/2.4))^2


and solve the integral numerically with the n() method (see The Sage 
Tutorial page 6)

sage: integral(rho,r,1E-5,1E5).n()
0.158526563291981

> integral(rho,r,0.01,10)
> this gives:
> 0.01392*(10.6953303525 - (125003*log(500012) - 125003*log(10) - 3)/
> 125003)
> how is it possible to force sage to give me one value and not this
> helpless term above?
> thanks
> regards
> florian
>
> >
>   


--~--~-~--~~~---~--~~
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: Collaborate with Sage primers (Sage days 13).

2009-04-18 Thread Jose Guzman

Jose Guzman wrote:
> William Stein wrote:
>   
>> On Sat, Apr 18, 2009 at 8:07 AM, Jose Guzman  wrote:
>>   
>> 
>>> After reading "The Sage Tutorial" carefully,  I realized that this
>>> manual, although extremely useful, is not for the absolute new comer (I
>>> am considering to add some more documentation in the near future to the
>>> Sage tutorial, if you allow me), I heard already a couple of times that
>>> with this guide alone is a little bit difficult to figure out how to do
>>> what one has in mind.
>>>
>>> For that reason I decided to create "howto guides" in a sage worksheet
>>> format  to introduce the colleagues of my group into Sage, so that we
>>> can move from mathematica to Sage/Phyton. I tried a couple of examples,
>>> that you can visit here:
>>>
>>> How to plot with Sage: http://sagenb.org/home/pub/399
>>> How to solve limits with Sage: http://sagenb.org/home/pub/398
>>>
>>> I found that the sage days 13
>>> (http://wiki.sagemath.org/days13/projects/sagenewbie) were actually
>>> doing something very similar applied to different topics that I want to
>>> cover too. I was wondering if any of you know about it. I would not mind
>>> to collaborate with that and share my worksheets to help other people to
>>> become more familiar with Sage.
>>> 
>>>   
>> +1
>>
>> I am also creating similar worksheets, which I'm posting here:
>>
>> http://wiki.wstein.org/09/480b/schedule
>>
>> William
>>   
>> 
I've just realized that everybody can create an account and edit in this 
wiki. I added a couple of worksheets to the site, i hope somebody find 
it useful.


> added to my favorites... :D nice worksheets, and by the way, nice videos 
> explaining the basis of Sage, (this is what a very beginner needs)  I 
> will show them  in my course.
>   
>> >
>   


--~--~-~--~~~---~--~~
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: Collaborate with Sage primers (Sage days 13).

2009-04-18 Thread Jose Guzman

William Stein wrote:
> On Sat, Apr 18, 2009 at 8:07 AM, Jose Guzman  wrote:
>   
>> After reading "The Sage Tutorial" carefully,  I realized that this
>> manual, although extremely useful, is not for the absolute new comer (I
>> am considering to add some more documentation in the near future to the
>> Sage tutorial, if you allow me), I heard already a couple of times that
>> with this guide alone is a little bit difficult to figure out how to do
>> what one has in mind.
>>
>> For that reason I decided to create "howto guides" in a sage worksheet
>> format  to introduce the colleagues of my group into Sage, so that we
>> can move from mathematica to Sage/Phyton. I tried a couple of examples,
>> that you can visit here:
>>
>> How to plot with Sage: http://sagenb.org/home/pub/399
>> How to solve limits with Sage: http://sagenb.org/home/pub/398
>>
>> I found that the sage days 13
>> (http://wiki.sagemath.org/days13/projects/sagenewbie) were actually
>> doing something very similar applied to different topics that I want to
>> cover too. I was wondering if any of you know about it. I would not mind
>> to collaborate with that and share my worksheets to help other people to
>> become more familiar with Sage.
>> 
>
> +1
>
> I am also creating similar worksheets, which I'm posting here:
>
> http://wiki.wstein.org/09/480b/schedule
>
> William
>   
added to my favorites... :D nice worksheets, and by the way, nice videos 
explaining the basis of Sage, (this is what a very beginner needs)  I 
will show them  in my course.
> --~--~-~--~~~---~--~~
> 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
> -~--~~~~--~~---
>   


--~--~-~--~~~---~--~~
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 installing Sage in Debian

2009-04-18 Thread Jose Guzman

Thank you for your answer William!

I guess this would improve the Sage performance in the server, which is 
also a good thing!

Thank you

Jose.

William Stein wrote:
> On Sat, Apr 18, 2009 at 6:47 AM, Jose Guzman  wrote:
>   
>> I am planning to set a Sage access to my Debian server, and I've in
>> download sage-3.4-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux.tar.gz
>> <http://sagemath.org/bin/linux/32bit/sage-3.4-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux.tar.gz>
>>
>> and after installation in my Debian GNU/Linux 5.0 server (kernel 2.6.18)
>> I've got the following warning
>>
>>
>> **
>> WARNING!  This Sage install was built on a machine that supports
>> instructions that are not available on this computer.  Sage will
>> likely fail with ILLEGAL INSTRUCTION errors! The following processor
>> flags were on the build machine but are not on this computer:
>>
>> sse4_1 sse2 pni sse
>>
>> Email http://groups.google.com/group/sage-support for help.
>> To remove this warning and make Sage start, just delete
>> /usr/local/Sage/local/lib/sage-flags.txt
>> **
>>
>> Would anybody assists me with that? Should I care about these packages?
>>
>> Thank you in advance.
>>
>> 
>
> You must build Sage from source, since the Sage binaries are built on
> a machine who *hardware* CPU has
> certain instruction sets, which your old hardware doesn't have.
>
> 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] Collaborate with Sage primers (Sage days 13).

2009-04-18 Thread Jose Guzman

After reading "The Sage Tutorial" carefully,  I realized that this 
manual, although extremely useful, is not for the absolute new comer (I 
am considering to add some more documentation in the near future to the 
Sage tutorial, if you allow me), I heard already a couple of times that 
with this guide alone is a little bit difficult to figure out how to do 
what one has in mind.

For that reason I decided to create "howto guides" in a sage worksheet 
format  to introduce the colleagues of my group into Sage, so that we 
can move from mathematica to Sage/Phyton. I tried a couple of examples, 
that you can visit here:

How to plot with Sage: http://sagenb.org/home/pub/399
How to solve limits with Sage: http://sagenb.org/home/pub/398

I found that the sage days 13 
(http://wiki.sagemath.org/days13/projects/sagenewbie) were actually 
doing something very similar applied to different topics that I want to 
cover too. I was wondering if any of you know about it. I would not mind 
to collaborate with that and share my worksheets to help other people to 
become more familiar with Sage.

Thanks for your suport!

Jose.

--~--~-~--~~~---~--~~
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 installing Sage in Debian

2009-04-18 Thread Jose Guzman

I am planning to set a Sage access to my Debian server, and I've in 
download sage-3.4-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux.tar.gz 


and after installation in my Debian GNU/Linux 5.0 server (kernel 2.6.18) 
I've got the following warning


**
WARNING!  This Sage install was built on a machine that supports
instructions that are not available on this computer.  Sage will
likely fail with ILLEGAL INSTRUCTION errors! The following processor
flags were on the build machine but are not on this computer:

sse4_1 sse2 pni sse

Email http://groups.google.com/group/sage-support for help.
To remove this warning and make Sage start, just delete
 /usr/local/Sage/local/lib/sage-flags.txt
**

Would anybody assists me with that? Should I care about these packages?

Thank you in advance.

Jose.

--~--~-~--~~~---~--~~
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: Plot a vertical label in the y axis and LaTeX typesetting.

2009-04-18 Thread Jose Guzman


>
> Yes.  In fact, the ability to look at the code is one of the main 
> reasons for Sage's existence!  The code for plotting is in the directory:
>
> $SAGE_ROOT/devel/sage/sage/plot/
>
> where $SAGE_ROOT is the directory that contains the sage binary.
>
> Thanks,
>
> Jason
>
>
>   
Dear Jason,

thank you very much for the information!!!. I've just took a look to the 
source code, and actually, much of what I wanted to do with the sage 
plot is described in the Graphics class. There are still some things 
which could be done (fonttype, log-scale, vertical ylabel, etc...) and I 
heard somebody is working on that for the version 4.0. In any case,  I 
will try first to become more familiar with that and try to implement 
some of my plot necessities after seen what is new for the new version.

Thank you very much for everything!!!

Jose.
> >
>   


--~--~-~--~~~---~--~~
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: Plot a vertical label in the y axis and LaTeX typesetting.

2009-04-17 Thread Jose Guzman

William Stein wrote:
> On Wed, Apr 15, 2009 at 10:56 AM, William Stein  wrote:
>   
>> On Wed, Apr 15, 2009 at 10:37 AM, Jose Guzman  wrote:
>> 
>>> William Stein wrote:
>>>   
>>>> 2009/4/15 William Stein :
>>>>
>>>> 
>>>>> 2009/4/15 Jose Guzman :
>>>>>
>>>>>   
>>>>>> Hi there
>>>>>>
>>>>>> I am trying to teach some simple principles of single compartment models
>>>>>> with sage and I plotted a couple of exponential equations in my notebook.
>>>>>>
>>>>>> Although I got a nice x-axis () and other labels and similar things, I
>>>>>> cannot find a way to plot the y-axis in the vertical axis. Is there
>>>>>> anyway to do it?
>>>>>>
>>>>>> You can take a look to my notebook to see what I mean
>>>>>> http://sagenb.org/home/pub/457
>>>>>>
>>>>>> Another additional problem is that the LaTeX fonts are pretty small, and
>>>>>> I  cannot represent Greek letters (like alpha, tau, pi,etc..) in the
>>>>>> labels (see the syntax bellow).
>>>>>>
>>>>>> xlabel = text('Time (Units of $\tau$)',(3,-.10), rgbcolor='black')
>>>>>>
>>>>>> This \tau does not show up in the graphic, but strange enough, this
>>>>>> works out of the box (pretty small though)
>>>>>>
>>>>>> lnlabel = text('Unrecoverable fraction ($f_{U} = 1 -
>>>>>> f_{S}$)',(4,FS+.05),rgbcolor='black')
>>>>>>
>>>>>> thank you very much in advance for your help and care!
>>>>>>
>>>>>> 
>>>>> Just one remar. There is a fontsize option to text:
>>>>>
>>>>>
>>>>> xlabel = text('Time (Units of $\tau$)',(3,-.10), rgbcolor='black', 
>>>>> fontsize=30)
>>>>>
>>>>> William
>>>>>
>>>>>   
>>>> The second remark is that backslash is an escape character for strings in
>>>> (almost) all programming languages.  You have to do \\ to get a single
>>>> backslash, so this works:
>>>>
>>>> xlabel = text('Time (Units of $\\tau$)',(3,-.10), rgbcolor='black', 
>>>> fontsize=30)
>>>>
>>>> Or you can do:
>>>>
>>>> xlabel = text(r'Time (Units of $\tau$)',(3,-.10), rgbcolor='black', 
>>>> fontsize=30)
>>>>
>>>>
>>>> 
>>> Thank you very much for your remarks, everything worked fine, except for
>>> that  I did not manage to create a vertical oriented y-axis label.
>>>   
>> That might not be implemented yet in Sage directly.
>>
>> 
>>>  I
>>> think the solution would be to import the matplotlib python module and
>>> use it under Sage, however I did not find a proper manual to follow.
>>>   
>> Here is how to use matplotlib directly in the Sage notebook:
>>
>> import pylab as p
>> p.figure()
>> t = p.arange(0.01, 2.0, 0.01)
>> s = p.sin(2 * p.pi * t)
>> s = p.array([float(f(x)) for x in t])
>> P = p.plot(t, s, linewidth=4)
>> p.xlabel('time (s)'); p.ylabel('voltage (mV)')
>> p.title('Matlab-style plotting in Sage')
>> p.grid(True)
>> p.savefig('sage.png')
>>
>> 
>
> The above example depends on a function f being defined, e.g.,
>
> x = var('x')
> f(x) = sin(3*x)*x+log(x) + 1/(x+1)^2
>
> >
>   
Thank you very much for your nice example. Actually I became confused 
with all the backend stuff, but this example I realize how to use 
matplotlib under Sage, although I have to admit I love the plotting 
capabilities of Sage. Is there any way I can have a look to the code so 
that I might try to implement some new characteristisc (like y-axis, 
fontsize of the axis, etc...)

Thank you very very much!

Jose.


--~--~-~--~~~---~--~~
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: Plot a vertical label in the y axis and LaTeX typesetting.

2009-04-15 Thread Jose Guzman

William Stein wrote:
> 2009/4/15 William Stein :
>   
>> 2009/4/15 Jose Guzman :
>> 
>>> Hi there
>>>
>>> I am trying to teach some simple principles of single compartment models
>>> with sage and I plotted a couple of exponential equations in my notebook.
>>>
>>> Although I got a nice x-axis () and other labels and similar things, I
>>> cannot find a way to plot the y-axis in the vertical axis. Is there
>>> anyway to do it?
>>>
>>> You can take a look to my notebook to see what I mean
>>> http://sagenb.org/home/pub/457
>>>
>>> Another additional problem is that the LaTeX fonts are pretty small, and
>>> I  cannot represent Greek letters (like alpha, tau, pi,etc..) in the
>>> labels (see the syntax bellow).
>>>
>>> xlabel = text('Time (Units of $\tau$)',(3,-.10), rgbcolor='black')
>>>
>>> This \tau does not show up in the graphic, but strange enough, this
>>> works out of the box (pretty small though)
>>>
>>> lnlabel = text('Unrecoverable fraction ($f_{U} = 1 -
>>> f_{S}$)',(4,FS+.05),rgbcolor='black')
>>>
>>> thank you very much in advance for your help and care!
>>>   
>> Just one remar. There is a fontsize option to text:
>>
>>
>> xlabel = text('Time (Units of $\tau$)',(3,-.10), rgbcolor='black', 
>> fontsize=30)
>>
>> William
>> 
>
> The second remark is that backslash is an escape character for strings in
> (almost) all programming languages.  You have to do \\ to get a single
> backslash, so this works:
>
> xlabel = text('Time (Units of $\\tau$)',(3,-.10), rgbcolor='black', 
> fontsize=30)
>
> Or you can do:
>
> xlabel = text(r'Time (Units of $\tau$)',(3,-.10), rgbcolor='black', 
> fontsize=30)
>
>   
Thank you very much for your remarks, everything worked fine, except for 
that  I did not manage to create a vertical oriented y-axis label. I 
think the solution would be to import the matplotlib python module and 
use it under Sage, however I did not find a proper manual to follow.

Thank you very much!

Jose.


--~--~-~--~~~---~--~~
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] Plot a vertical label in the y axis and LaTeX typesetting.

2009-04-15 Thread Jose Guzman

Hi there

I am trying to teach some simple principles of single compartment models 
with sage and I plotted a couple of exponential equations in my notebook.

Although I got a nice x-axis () and other labels and similar things, I 
cannot find a way to plot the y-axis in the vertical axis. Is there 
anyway to do it?

You can take a look to my notebook to see what I mean 
http://sagenb.org/home/pub/457

Another additional problem is that the LaTeX fonts are pretty small, and 
I  cannot represent Greek letters (like alpha, tau, pi,etc..) in the 
labels (see the syntax bellow).

xlabel = text('Time (Units of $\tau$)',(3,-.10), rgbcolor='black')

This \tau does not show up in the graphic, but strange enough, this 
works out of the box (pretty small though)

lnlabel = text('Unrecoverable fraction ($f_{U} = 1 - 
f_{S}$)',(4,FS+.05),rgbcolor='black')

thank you very much in advance for your help and care!


Jose.

--~--~-~--~~~---~--~~
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] plotjoined='True'

2009-04-04 Thread Jose Guzman

I am learning how to plot in sage and tried the following example:


x=srange(0, 4, 0.2)
y=srange(0, 4, 0.2)
xy = zip(x,y)

list_plot(xy,pointsize=40,faceted='True',rgbcolor='white')


This works perfect, but if I add the option plotjoined='True' I got a 
mistake and then I have to plot this option as unique parameter:


list_plot(xy,plotjoined='True')

Is there any way to plot the points joined with the line with an unique 
plot_list function?

I guess I could use matplotlib, but I have to get use to the easy way to 
plot just before start with

PS: list_plot()

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



  1   2   >