Re: [sage-support] Re: Error: LaTeX does not seem to be installed.

2011-08-17 Thread G B
Yep, that did it.  Comparing the path variables showed them to be quite 
different.  I've added the following to my init.sage:

os.environ["PATH"]+=":/usr/texbin:/usr/local/bin"

and everything runs happy.  Just adding /usr/texbin didn't work because Sage 
also needs to find 'convert' which I have in /usr/local/bin.

Thanks for the 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


Re: [sage-support] Re: Error: LaTeX does not seem to be installed.

2011-08-17 Thread G B
The paths are definitely different for terminal launched and app launched 
Sage, and app launched Sage doesn't include /usr/texbin.

Sorry to sound so helpless, but what syntax would I use to add it to my 
init.sage?  I don't currently have one, and I've come up blank searching for 
it in the documentation...

Thanks--
 Greg

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


[sage-support] Re: Error: LaTeX does not seem to be installed.

2011-08-16 Thread G B
I'm noticing that the problem only happens when launching Sage.app.  If I 
install the command line version, it detects Latex just fine.  Also, if I 
launch the sage binary from within the Sage.app package (the one in 
Contents/Resources/sage, not the one closer to the app root), it also seems 
to work fine, which is odd.  Something is getting disconnected when the GUI 
launches.

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


[sage-support] Re: Error: LaTeX does not seem to be installed.

2011-08-16 Thread G B
I've installed MacTex and I'm still having the same problem.  You won't see 
this problem for most typeset results because Sage attempts to use jsMath, 
but it turns up when typesetting a result that jsMath can't handle (or if 
you force it to use go straight to latex by using the jsmath_avoid_list).

Unfortunately running make in the root directory didn't fix my problem-- it 
still can't find Latex.


-- 
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: adding noise

2010-04-02 Thread G B
Thanks for the detailed response, Simon.  Please understand that I'm not
being critical of Sage-- quite the contrary, I'm excited about what it might
offer me once I master it.

I think you touch on one key to the problem-- I'm not a mathematician, I'm
an engineer.  While most of the world would certainly accuse us of being
sloppy dressers, mathematicians are one of the few groups that can
legitimately accuse us of being sloppy thinkers.  I think that brand of
sloppy thinking is what is at issue here, and when I say "work around" I
mean "become tolerant of".

Sage has already encouraged me to learn more about ring theory than I ever
would have needed otherwise, but getting completely different results when
executing plot(f(x),(x,0,2*pi)) vs. executing plot(f,(0,2*pi)) started
playing on my patience a bit and has me wondering if I'm simply using an
irreconcilably wrong tool for the job.  I think the intention of both of
those statements is the same, and thus should yield the same result, and my
suspicion is that the reason they don't is an artifact of the plumbing, but
I may be missing something.

It's not the f(x)=sin(x)+T.get_random_element() form that troubles me
though, for the record, I did try 'f(x)=sin(x)+T.get_random_element(x)'.
 Expectedly, it doesn't like having an unwanted argument shoved down its
throat.

What still feels awkward to me is how constructs like this behave:
var('x')
T=RealDistribution('gaussian',1)
f=lambda x: T.get_random_element()
g(x)=sin(x)+f(x)

To my mind, the way that is handled is particularly confusing.
[f(1),f(2),f(3)]  --> [-0.568652852118, 0.912307924442, 1.35997405644]

but,
[g(1),g(2),g(3)]  --> [sin(1) - 0.176035204293, sin(2) - 0.176035204293,
sin(3) - 0.176035204293]

In other words, calling f repeatedly gives different results each time, but
calling g repeatedly does not.

That may be a case where the parenthetical syntax conspires with the
overloaded meanings of "function" to expose my sloppy thinking, but it also
kind of looks like a trap waiting to be triggered.

If sin(x) and f(x) are fundamentally different entities, and my engineering
mind isn't completely convinced that they should be, then the syntax should
prevent the construction of g in such a manner.  Either execution of f
should be deferred until g is called with a parameter, as I would expect, or
an error should be thrown for providing illegal arguments to operator '+'.
 If I want g(x) defined as sin(x) plus the result of f(x) as x is defined at
the definition of g, then the syntax should highlight that by forcing
something like g(x)=sin(x) + `f(x)`


Am I making sense, or just digging my credibility hole deeper?  In my
defense, I've only had a couple days of playtime with the system so far...

Cheers--
 Greg

On Fri, Apr 2, 2010 at 5:42 PM, Simon King  wrote:

> Hi!
>
> On 3 Apr., 00:30, G B  wrote:
> > That did it.  I found the section in the tutorial explaining the
> > different interpretations of functions more fully, and while I don't
> > quite have my head around it, I think I understand the problem at a
> > basic level to be that my f(x) is a symbolic expression, but
> > get_random_element() is a Python function, and there's some odd
> > interaction under the hood.
>
> I think that's a wrong description of what is happening. You talk
> about the line
>   f(x)=sin(x)+T.get_random_element()
>
> In that line, f is to be defined (in particular, at that point, f(x)
> is not a symbolic expression, yet).
>
> So, let's look at the right hand side of it. sin(x) is a symbolic
> expressioon. T.get_random_element() is, in contrast to what you state,
> *not* a Python function --- T.get_random_element() is a number. And of
> course, when you add a number to a symbolic expression, you get a
> shift and not a noise.
>
> I don't find this an odd interaction at all.
>
> What you probably had in mind was that T.get_random_element *without*
> the brackets is a Python function (or actually a method). Adding an
> *unevaluated* Python function to a symbolic expression should result
> in an error - everything else would probably be a really odd
> interaction, because this means to add things that have a completely
> different meaning.
>
> > Is this something that will ever be able to be worked around...
>
> What do you mean by "work around" in this case?
>
> You seem to believe that "f(x)=sin(x)+T.get_random_element()" makes
> sense as a mathematical definition of adding noise to sin(x).
> But here I disagree: You can mathematically add functions that have
> the same range, but this is obviously not the case for sin(x) and
> T.get_random_element() (the latter is even not referring to x).
>
> But w

[sage-support] Re: adding noise

2010-04-02 Thread G B
Ok, I'll take that as an admonition to not give up too soon.  =)

It does feel like a toolset that would give me a lot of capability if
I can only learn to control it...

Thanks again for the help.

Cheers--
 Greg


On Apr 2, 4:31 pm, William Stein  wrote:
> On Fri, Apr 2, 2010 at 3:30 PM, G B  wrote:
> > That did it.  I found the section in the tutorial explaining the
> > different interpretations of functions more fully, and while I don't
> > quite have my head around it, I think I understand the problem at a
> > basic level to be that my f(x) is a symbolic expression, but
> > get_random_element() is a Python function, and there's some odd
> > interaction under the hood.
>
> > Is this something that will ever be able to be worked around
> > (excepting things like trying to symbolically integrate a Python
> > function)?  Is Sage doomed to have these similar but not quite
> > compatible entities interacting in strangely subtle ways, or is there
>
> Yep.  Except when you understand them, they do not seem similar or strange.
>
> William
>
>
>
>
>
> > the hope that as the package matures everything will begin to play
> > more nicely?
>
> > My concern is that, as a newbie, I'm carefully double checking each
> > step of my calculation because I know that I don't know what I'm
> > doing-- but eventually I'm liable to gain confidence, lose track of
> > these various function types, and not realize that the results I'm
> > getting are incorrect.
>
> > On Mar 30, 7:04 pm, William Stein  wrote:
> >> On Tue, Mar 30, 2010 at 7:01 PM, G B  wrote:
> >> > Apologies for being dense, but I'm missing something.  All three forms
> >> > ( f(x), def f(x) and f=lambda x: ) are giving the same results.
>
> >> > Trying:
> >> > -
> >> > var('x')
> >> > T=RealDistribution('gaussian',1)
> >> > def f(x):
> >> >    return sin(x)+ T.get_random_element()
> >> > plot(f(x),(x,0,2*pi))
> >> > -
>
> >> > and
> >> > 
> >> > var('x')
> >> > T=RealDistribution('gaussian',1)
> >> > f=lambda x: sin(x)+ T.get_random_element()
> >> > plot(f(x),(x,0,2*pi))
> >> > -
>
> >> > all give me a clean sine with a random offset, rather than sine
> >> > +noise...
>
> >> Use
>
> >>   plot(f, (0,2*pi))
>
> >> William
>
> >> > On Mar 30, 2:30 pm, William Stein  wrote:
> >> >> On Tue, Mar 30, 2010 at 2:21 PM, G B  wrote:
> >> >> > Hi--
>
> >> >> > I'm trying to figure out how to use RealDistributions to model noise.
> >> >> > For example, I would like to model a signal+noise and tried using this
> >> >> > construct:
>
> >> >> > T=RealDistribution('gaussian',1)
> >> >> > f(x)=sin(x)+T.get_random_element()
> >> >> > plot(f(x),(x,0,2*pi))
>
> >> >> > Unfortunately, that only calls get_random_element() once, at the
> >> >> > definition of f(x) and results in a perfect sinusoid offset by a
> >> >> > random value.
>
> >> >> def f(x):
> >> >>      return sin(x) + T.get_random_element()
>
> >> >> or
>
> >> >>  f = lambda x : sin(x) + T.get_random_element()
>
> >> >> William
>
> >> >> > How do I write this so that get_random_element() is called each time
> >> >> > f(x) is evaluated?  I would like to see a noisy sinusoid.
>
> >> >> > Thanks--
> >> >> >  Greg
>
> >> >> > --
> >> >> > 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 
> >> >> > athttp://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.
>
> >> >> --
> >> >> William Stein
> >> >> Associate Professor of Mathematics
> >> >> University of Washingtonhttp://wstein.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 
> >> > athttp://groups.google.com/group/sage-support
> >> > URL:http://www.sagemath.org
>
> >> --
> >> William Stein
> >> Associate Professor of Mathematics
> >> University of Washingtonhttp://wstein.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 
> > athttp://groups.google.com/group/sage-support
> > URL:http://www.sagemath.org
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washingtonhttp://wstein.org

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


[sage-support] Re: adding noise

2010-04-02 Thread G B
That did it.  I found the section in the tutorial explaining the
different interpretations of functions more fully, and while I don't
quite have my head around it, I think I understand the problem at a
basic level to be that my f(x) is a symbolic expression, but
get_random_element() is a Python function, and there's some odd
interaction under the hood.

Is this something that will ever be able to be worked around
(excepting things like trying to symbolically integrate a Python
function)?  Is Sage doomed to have these similar but not quite
compatible entities interacting in strangely subtle ways, or is there
the hope that as the package matures everything will begin to play
more nicely?

My concern is that, as a newbie, I'm carefully double checking each
step of my calculation because I know that I don't know what I'm
doing-- but eventually I'm liable to gain confidence, lose track of
these various function types, and not realize that the results I'm
getting are incorrect.


On Mar 30, 7:04 pm, William Stein  wrote:
> On Tue, Mar 30, 2010 at 7:01 PM, G B  wrote:
> > Apologies for being dense, but I'm missing something.  All three forms
> > ( f(x), def f(x) and f=lambda x: ) are giving the same results.
>
> > Trying:
> > -
> > var('x')
> > T=RealDistribution('gaussian',1)
> > def f(x):
> >    return sin(x)+ T.get_random_element()
> > plot(f(x),(x,0,2*pi))
> > -
>
> > and
> > 
> > var('x')
> > T=RealDistribution('gaussian',1)
> > f=lambda x: sin(x)+ T.get_random_element()
> > plot(f(x),(x,0,2*pi))
> > -
>
> > all give me a clean sine with a random offset, rather than sine
> > +noise...
>
> Use
>
>   plot(f, (0,2*pi))
>
> William
>
>
>
>
>
>
>
> > On Mar 30, 2:30 pm, William Stein  wrote:
> >> On Tue, Mar 30, 2010 at 2:21 PM, G B  wrote:
> >> > Hi--
>
> >> > I'm trying to figure out how to use RealDistributions to model noise.
> >> > For example, I would like to model a signal+noise and tried using this
> >> > construct:
>
> >> > T=RealDistribution('gaussian',1)
> >> > f(x)=sin(x)+T.get_random_element()
> >> > plot(f(x),(x,0,2*pi))
>
> >> > Unfortunately, that only calls get_random_element() once, at the
> >> > definition of f(x) and results in a perfect sinusoid offset by a
> >> > random value.
>
> >> def f(x):
> >>      return sin(x) + T.get_random_element()
>
> >> or
>
> >>  f = lambda x : sin(x) + T.get_random_element()
>
> >> William
>
> >> > How do I write this so that get_random_element() is called each time
> >> > f(x) is evaluated?  I would like to see a noisy sinusoid.
>
> >> > Thanks--
> >> >  Greg
>
> >> > --
> >> > 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 
> >> > athttp://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.
>
> >> --
> >> William Stein
> >> Associate Professor of Mathematics
> >> University of Washingtonhttp://wstein.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 
> > athttp://groups.google.com/group/sage-support
> > URL:http://www.sagemath.org
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washingtonhttp://wstein.org

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


[sage-support] Re: adding noise

2010-03-30 Thread G B
Should mention this is 4.3.3, 64 bit OS X 10.6.2


On Mar 30, 7:01 pm, G B  wrote:
> Apologies for being dense, but I'm missing something.  All three forms
> ( f(x), def f(x) and f=lambda x: ) are giving the same results.
>
> Trying:
> -
> var('x')
> T=RealDistribution('gaussian',1)
> def f(x):
>     return sin(x)+ T.get_random_element()
> plot(f(x),(x,0,2*pi))
> -
>
> and
> 
> var('x')
> T=RealDistribution('gaussian',1)
> f=lambda x: sin(x)+ T.get_random_element()
> plot(f(x),(x,0,2*pi))
> -
>
> all give me a clean sine with a random offset, rather than sine
> +noise...
>
> On Mar 30, 2:30 pm, William Stein  wrote:
>
>
>
> > On Tue, Mar 30, 2010 at 2:21 PM, G B  wrote:
> > > Hi--
>
> > > I'm trying to figure out how to use RealDistributions to model noise.
> > > For example, I would like to model a signal+noise and tried using this
> > > construct:
>
> > > T=RealDistribution('gaussian',1)
> > > f(x)=sin(x)+T.get_random_element()
> > > plot(f(x),(x,0,2*pi))
>
> > > Unfortunately, that only calls get_random_element() once, at the
> > > definition of f(x) and results in a perfect sinusoid offset by a
> > > random value.
>
> > def f(x):
> >      return sin(x) + T.get_random_element()
>
> > or
>
> >  f = lambda x : sin(x) + T.get_random_element()
>
> > William
>
> > > How do I write this so that get_random_element() is called each time
> > > f(x) is evaluated?  I would like to see a noisy sinusoid.
>
> > > Thanks--
> > >  Greg
>
> > > --
> > > 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 
> > > athttp://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.
>
> > --
> > William Stein
> > Associate Professor of Mathematics
> > University of Washingtonhttp://wstein.org

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


[sage-support] Re: adding noise

2010-03-30 Thread G B
Apologies for being dense, but I'm missing something.  All three forms
( f(x), def f(x) and f=lambda x: ) are giving the same results.


Trying:
-
var('x')
T=RealDistribution('gaussian',1)
def f(x):
return sin(x)+ T.get_random_element()
plot(f(x),(x,0,2*pi))
-

and

var('x')
T=RealDistribution('gaussian',1)
f=lambda x: sin(x)+ T.get_random_element()
plot(f(x),(x,0,2*pi))
-

all give me a clean sine with a random offset, rather than sine
+noise...



On Mar 30, 2:30 pm, William Stein  wrote:
> On Tue, Mar 30, 2010 at 2:21 PM, G B  wrote:
> > Hi--
>
> > I'm trying to figure out how to use RealDistributions to model noise.
> > For example, I would like to model a signal+noise and tried using this
> > construct:
>
> > T=RealDistribution('gaussian',1)
> > f(x)=sin(x)+T.get_random_element()
> > plot(f(x),(x,0,2*pi))
>
> > Unfortunately, that only calls get_random_element() once, at the
> > definition of f(x) and results in a perfect sinusoid offset by a
> > random value.
>
> def f(x):
>      return sin(x) + T.get_random_element()
>
> or
>
>  f = lambda x : sin(x) + T.get_random_element()
>
> William
>
>
>
> > How do I write this so that get_random_element() is called each time
> > f(x) is evaluated?  I would like to see a noisy sinusoid.
>
> > Thanks--
> >  Greg
>
> > --
> > 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 
> > athttp://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.
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washingtonhttp://wstein.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] adding noise

2010-03-30 Thread G B
Hi--

I'm trying to figure out how to use RealDistributions to model noise.
For example, I would like to model a signal+noise and tried using this
construct:

T=RealDistribution('gaussian',1)
f(x)=sin(x)+T.get_random_element()
plot(f(x),(x,0,2*pi))

Unfortunately, that only calls get_random_element() once, at the
definition of f(x) and results in a perfect sinusoid offset by a
random value.

How do I write this so that get_random_element() is called each time
f(x) is evaluated?  I would like to see a noisy sinusoid.

Thanks--
 Greg

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


[sage-support] Re: atan2 throws "divide by zero"

2010-03-30 Thread G B
For anyone interested, it looks as though the GiNaC project has
released a fix:
http://www.cebix.net/pipermail/ginac-devel/2010-March/001732.html

I've posted this to the dev list as well.

Cheers--
 Greg



On Mar 23, 7:00 pm, G B  wrote:
> I won't clutter the discussion with the full traceback unless someone
> would find it interesting, but the hg_sage command failed with:
>
> TypeError: 'NoneType' object is unsubscriptable.
>
> I did enter the entire URL, I didn't just paste the abbreviated URL
> displayed in the post.
>
> On Mar 23, 1:18 am, Ondrej Certik  wrote:
>
>
>
> > Hi Minh!
>
> > On Mon, Mar 22, 2010 at 8:55 PM, Minh Nguyen  wrote:
> > > Hi Greg,
>
> > > On Tue, Mar 23, 2010 at 9:35 AM, G B  wrote:
> > >> Hi Ondrej--
>
> > >> Sorry to turn helpless, but I'm not sure how to apply the patch.  I'm
> > >> working from a binary install for OS X.
>
> > > Here is a quick-and-dirty way. I assume that you are using Sage 4.3.3
> > > or Sage 4.3.4. From the Sage command line, you could issue the
> > > following command to apply the relevant patch:
>
> > > sage: 
> > > hg_sage.apply("http://trac.sagemath.org/sage_trac/raw-attachment/ticket/8564/sympy1";)
>
> > > After hitting the enter key, the relevant patch would be downloaded to
> > > your computer. A text editor would then load and you would be prompted
> > > to enter a "commit message". Just enter some text such as "fix atan2()
> > > conversions between Sage and SymPy", save your text, exit the text
> > > editor. If the editor is vi(m), enter the text, hit the ESC key, and
> > > type ":wq". If the editor is Emacs, enter the text, hold down the CTRL
> > > key, and type "xs" and "xc" in that order. Having exited the text
> > > editor, the relevant patch would be applied to your local copy of
> > > Sage. Now exit the Sage command line session. From the SAGE_ROOT
> > > directory of Sage, i.e. the Sage top-level directory, rebuild the Sage
> > > library as follows:
>
> > > $ ./sage -b main
>
> > > This would only rebuild the relevant parts that the patch changes.
> > > Most likely, the last command won't rebuild the whole Sage library.
>
> > >> Would I need to rebuild from
> > >> source,
>
> > > You don't need to rebuild Sage from source for this particular patch.
>
> > >> or can I apply the patch to one of the implementation files in
> > >> the bundle?
>
> > > Follow the direction as described above. If there is anything wrong,
> > > please let me know.
>
> > >> It looks like you've just changed a lookup table?
>
> > > The patch adds an entry to a dictionary, also known as a hash table or
> > > an associative array.
>
> > Thanks for all the detailed instructions. I also sent some patches
> > that we need to apply in sympy, fixing couple (related) bugs, so after
> > all is reviewed and in, I'll also update the whole sympy package and
> > ping you. But this patch above itself should imho fix the atan2 thing,
> > even with the current sympy in Sage.
>
> > Ondrej

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


[sage-support] Re: atan2 throws "divide by zero"

2010-03-23 Thread G B
I won't clutter the discussion with the full traceback unless someone
would find it interesting, but the hg_sage command failed with:

TypeError: 'NoneType' object is unsubscriptable.

I did enter the entire URL, I didn't just paste the abbreviated URL
displayed in the post.

On Mar 23, 1:18 am, Ondrej Certik  wrote:
> Hi Minh!
>
>
>
>
>
> On Mon, Mar 22, 2010 at 8:55 PM, Minh Nguyen  wrote:
> > Hi Greg,
>
> > On Tue, Mar 23, 2010 at 9:35 AM, G B  wrote:
> >> Hi Ondrej--
>
> >> Sorry to turn helpless, but I'm not sure how to apply the patch.  I'm
> >> working from a binary install for OS X.
>
> > Here is a quick-and-dirty way. I assume that you are using Sage 4.3.3
> > or Sage 4.3.4. From the Sage command line, you could issue the
> > following command to apply the relevant patch:
>
> > sage: 
> > hg_sage.apply("http://trac.sagemath.org/sage_trac/raw-attachment/ticket/8564/sympy1";)
>
> > After hitting the enter key, the relevant patch would be downloaded to
> > your computer. A text editor would then load and you would be prompted
> > to enter a "commit message". Just enter some text such as "fix atan2()
> > conversions between Sage and SymPy", save your text, exit the text
> > editor. If the editor is vi(m), enter the text, hit the ESC key, and
> > type ":wq". If the editor is Emacs, enter the text, hold down the CTRL
> > key, and type "xs" and "xc" in that order. Having exited the text
> > editor, the relevant patch would be applied to your local copy of
> > Sage. Now exit the Sage command line session. From the SAGE_ROOT
> > directory of Sage, i.e. the Sage top-level directory, rebuild the Sage
> > library as follows:
>
> > $ ./sage -b main
>
> > This would only rebuild the relevant parts that the patch changes.
> > Most likely, the last command won't rebuild the whole Sage library.
>
> >> Would I need to rebuild from
> >> source,
>
> > You don't need to rebuild Sage from source for this particular patch.
>
> >> or can I apply the patch to one of the implementation files in
> >> the bundle?
>
> > Follow the direction as described above. If there is anything wrong,
> > please let me know.
>
> >> It looks like you've just changed a lookup table?
>
> > The patch adds an entry to a dictionary, also known as a hash table or
> > an associative array.
>
> Thanks for all the detailed instructions. I also sent some patches
> that we need to apply in sympy, fixing couple (related) bugs, so after
> all is reviewed and in, I'll also update the whole sympy package and
> ping you. But this patch above itself should imho fix the atan2 thing,
> even with the current sympy in Sage.
>
> Ondrej

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


[sage-support] Re: atan2 throws "divide by zero"

2010-03-22 Thread G B
Hi Ondrej--

Sorry to turn helpless, but I'm not sure how to apply the patch.  I'm
working from a binary install for OS X.  Would I need to rebuild from
source, or can I apply the patch to one of the implementation files in
the bundle?  It looks like you've just changed a lookup table?

Thanks for following up.

Thanks--
 Greg


On Mar 19, 7:32 pm, Ondrej Certik  wrote:
> On Fri, Mar 19, 2010 at 7:03 PM, Ondrej Certik  wrote:
> > On Thu, Mar 18, 2010 at 5:10 PM, G B  wrote:
> >> Thanks.  I tried that but it's causing different problems:
> >> ---
> >> from sympy import atan2
> >> var('omega,t,x,y,r,Theta')
> >> Theta(t)=omega*t
> >> x(t)=r*cos(Theta(t))
> >> y(t)=r*sin(Theta(t))
> >> dx=diff(x,t)
> >> ddx=diff(dx,t)
> >> dy=diff(y,t)
> >> ddy=diff(dy,t)
> >> v_a(t)=atan2(dy(t),dx(t))
> >> v_a
> >> --
>
> >> I get: AttributeError: 'atan2' object has no attribute '_sage_'
>
> > This is a bug in sympy, I've fixed that in sympy, currently the
> > patches are waiting for a review. When we update the sympy package in
>
> Also a small fix to sage has to be done, I posted the patch here:
>
> http://trac.sagemath.org/sage_trac/ticket/8564
>
> Greg, could you please review it?
>
> Thanks,
> Ondrej

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


[sage-support] Re: atan2 throws "divide by zero"

2010-03-18 Thread G B
Thanks.  I tried that but it's causing different problems:
---
from sympy import atan2
var('omega,t,x,y,r,Theta')
Theta(t)=omega*t
x(t)=r*cos(Theta(t))
y(t)=r*sin(Theta(t))
dx=diff(x,t)
ddx=diff(dx,t)
dy=diff(y,t)
ddy=diff(dy,t)
v_a(t)=atan2(dy(t),dx(t))
v_a
--

I get: AttributeError: 'atan2' object has no attribute '_sage_'

My original code had this for that second last line:
v_a(t)=atan2(dy(t),dx(t)).substitute(r=10,omega=(2*pi/60))


and it throws: AttributeError: 'atan2' object has no attribute
'substitute'

The code with the .substitute line seems to work for (t%30 <> 0) so I
think I've formatted my equations properly.

Apologies if I'm doing something horribly hackish-- I'm new to Sage.

Any other ideas?

Thanks--
 Greg



On Mar 18, 1:40 pm, Alec Mihailovs  wrote:
> On Mar 17, 8:38 pm, G B  wrote:
>
> > atan2(-pi,0) -->  RuntimeError: power::eval(): division by zero
>
> > Any ideas how to get around this?
>
> A simple workaround is
>
> sage: from sympy import atan2
> sage: atan2(-pi,0)
>
> -pi/2
>
> Alec Mihaiovs

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


[sage-support] Re: atan2 throws "divide by zero"

2010-03-17 Thread G B
Should have also mentioned:

Sage 4.3.3
OS X 10.6.2
64bit Intel
MacBook Pro


On Mar 17, 5:38 pm, G B  wrote:
> While waiting to be approved, I think I narrowed this down to a very
> simple test case.
>
> atan2(3,0)   --> 1/2*pi
> atan2(-3,0)  --> -1/2*pi
> atan2(pi,0)  --> 1/2*pi
> atan2(-pi,0) -->  RuntimeError: power::eval(): division by zero
>
> Any ideas how to get around this?
>
> Thanks--
>  Greg
>
> Here's the full traceback:
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "_sage_input_34.py", line 9, in 
>     open("___code___.py","w").write("# -*- coding: utf-8 -*-\n" +
> _support_.preparse_worksheet_cell(base64.b64decode("YXRhbjIoLXBpLDAp"),glob 
> als())
> +"\n"); execfile(os.path.abspath("___code___.py"))
>   File "", line 1, in 
>
>   File "/private/var/folders/ol/olxcekVE2RWirE+1YxlblU+++TI/-Tmp-/
> tmphh0DH2/___code___.py", line 3, in 
>     atan2(-pi,_sage_const_0 )
>   File "", line 1, in 
>
>   File "function.pyx", line 709, in
> sage.symbolic.function.GinacFunction.__call__ (sage/symbolic/
> function.cpp:6394)
>   File "function.pyx", line 430, in
> sage.symbolic.function.Function.__call__ (sage/symbolic/function.cpp:
> 4448)
> RuntimeError: power::eval(): division by zero

-- 
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: newbie: plot() questions

2010-03-17 Thread G B
Try

plot(f(t), ymax=17, ymin=-12)



On Mar 17, 2:32 pm, 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


[sage-support] atan2 throws "divide by zero"

2010-03-17 Thread G B
While waiting to be approved, I think I narrowed this down to a very
simple test case.

atan2(3,0)   --> 1/2*pi
atan2(-3,0)  --> -1/2*pi
atan2(pi,0)  --> 1/2*pi
atan2(-pi,0) -->  RuntimeError: power::eval(): division by zero

Any ideas how to get around this?

Thanks--
 Greg



Here's the full traceback:

Traceback (most recent call last):
  File "", line 1, in 
  File "_sage_input_34.py", line 9, in 
open("___code___.py","w").write("# -*- coding: utf-8 -*-\n" +
_support_.preparse_worksheet_cell(base64.b64decode("YXRhbjIoLXBpLDAp"),globals())
+"\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in 

  File "/private/var/folders/ol/olxcekVE2RWirE+1YxlblU+++TI/-Tmp-/
tmphh0DH2/___code___.py", line 3, in 
atan2(-pi,_sage_const_0 )
  File "", line 1, in 

  File "function.pyx", line 709, in
sage.symbolic.function.GinacFunction.__call__ (sage/symbolic/
function.cpp:6394)
  File "function.pyx", line 430, in
sage.symbolic.function.Function.__call__ (sage/symbolic/function.cpp:
4448)
RuntimeError: power::eval(): division by zero

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