[sage-support] Re: Bug in plot?

2009-03-18 Thread adrian

Yes, that solved it.

I don't understand what happened.

After saving, quitting and doing it again, all problems were solved.

Thanks.

On Mar 18, 2:11 pm, "ma...@mendelu.cz"  wrote:
> On 18 Bře, 20:23, adrian  wrote:
>
> > If i try to do
> > plot(cos(x),(x,-3,3))
>
> This command works in Internet versionwww.sagenb.org
> The same for sphere()
>
> Maybe something hangs from previous computation? Did the restart of
> worksheet not help?
>
> Robert
>
> > in sage 3.4 (through the internet version)
> > it brakes with the message
> > TypeError: a float is required
>
> > The command worked in sage 3.3
>
> > Also, in the notebook
>
> > sphere()
>
> > produces nothing; but
> > (sphere()).show()
> > launches the jmol applet as desired.
>
> > I don't know if that is the desired behaviour (It wasn't like that in
> > sage 3.3)
--~--~-~--~~~---~--~~
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: Bug in plot?

2009-03-18 Thread ma...@mendelu.cz



On 18 Bře, 20:23, adrian  wrote:
> If i try to do
> plot(cos(x),(x,-3,3))

This command works in Internet version www.sagenb.org
The same for sphere()

Maybe something hangs from previous computation? Did the restart of
worksheet not help?

Robert

> in sage 3.4 (through the internet version)
> it brakes with the message
> TypeError: a float is required
>
> The command worked in sage 3.3
>
> Also, in the notebook
>
> sphere()
>
> produces nothing; but
> (sphere()).show()
> launches the jmol applet as desired.
>
> I don't know if that is the desired behaviour (It wasn't like that in
> sage 3.3)
--~--~-~--~~~---~--~~
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: bug in plot? Global constants seen as variables.

2009-02-10 Thread Stan Schymanski

Dear Marshall,

Thanks a lot for your help. This should work in this case, but I don't
think I could get around using substitutions altogether (see, for
example, this thread:
http://groups.google.com/group/sage-support/browse_thread/thread/e62a83a6ac3c5d1d/e6e535972106bb15?lnk=gst&q=python+stan#e6e535972106bb15).
Should this be filed as a bug in subs?

Cheers
Stan




On Feb 9, 8:34 pm, Marshall Hampton  wrote:
> I would guess the problem stems from the
>
> sage: length = daylength.subs(locals()).n()
>
> line somehow.  I would recommend making daylength a function, instead
> of substituting.
>
> I am still not sure exactly what the problem is in the original code
> though.
>
> On Feb 9, 12:35 pm, Stan Schymanski  wrote:
>
> > Dear all,
>
> > For some reason, the meaning of the global constants pi and e (and
> > maybe others) becomes unavailable to the plot command in the following
> > example. Is this a bug?
>
> > --
> > | Sage Version 3.2, Release Date: 2008-11-20                         |
> > | Type notebook() for the GUI, and license() for information.        |
> > --
>
> > sage: var('h delta phi doy t')
> > (h, delta, phi, doy, t)
> > sage: h = 1/12*pi*(t-12)
> > sage: delta = -23.45*pi/180*cos(2*pi*(doy+10)/365)
> > sage: sinbeta = cos(h)*cos(delta)*cos(phi)+sin(delta)*sin(phi)
> > sage: daylength = 12+24/180*arcsin(tan(phi)*sin(delta)/cos(delta))*180/
> > pi
> > sage: plot(pi*x,x,0,1)
>
> > sage: plot(exp(x),x,0,1)
>
> > sage: doy = 180
> > sage: phi = (30*pi/180).n()
> > sage: length = daylength.subs(locals()).n()
> > sage: t0 = 12-0.5*length
> > sage: t1 = 12+0.5*length
> > sage: plot(pi*x,x,0,1)
> > ERROR: An unexpected error occurred while tokenizing input
> > The following traceback may be corrupted or invalid
> > The error message is: ('EOF in multi-line statement', (546, 0))
> > [...]
> > ValueError: free variable: pi
>
> > sage: plot(exp(x),x,0,1)
> > [...]
> > ValueError: free variable: e
>
> > Funnily enough, the following fixes the pi-problem for the time being:
>
> > sage: pi=pi.n()
>
> > But e=e.n() does not fix the e-problem.
>
> > Can anyone help?
>
> > Thanks a lot,
> > Stan
--~--~-~--~~~---~--~~
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: bug in plot? Global constants seen as variables.

2009-02-09 Thread Marshall Hampton

I would guess the problem stems from the

sage: length = daylength.subs(locals()).n()

line somehow.  I would recommend making daylength a function, instead
of substituting.

I am still not sure exactly what the problem is in the original code
though.

On Feb 9, 12:35 pm, Stan Schymanski  wrote:
> Dear all,
>
> For some reason, the meaning of the global constants pi and e (and
> maybe others) becomes unavailable to the plot command in the following
> example. Is this a bug?
>
> --
> | Sage Version 3.2, Release Date: 2008-11-20                         |
> | Type notebook() for the GUI, and license() for information.        |
> --
>
> sage: var('h delta phi doy t')
> (h, delta, phi, doy, t)
> sage: h = 1/12*pi*(t-12)
> sage: delta = -23.45*pi/180*cos(2*pi*(doy+10)/365)
> sage: sinbeta = cos(h)*cos(delta)*cos(phi)+sin(delta)*sin(phi)
> sage: daylength = 12+24/180*arcsin(tan(phi)*sin(delta)/cos(delta))*180/
> pi
> sage: plot(pi*x,x,0,1)
>
> sage: plot(exp(x),x,0,1)
>
> sage: doy = 180
> sage: phi = (30*pi/180).n()
> sage: length = daylength.subs(locals()).n()
> sage: t0 = 12-0.5*length
> sage: t1 = 12+0.5*length
> sage: plot(pi*x,x,0,1)
> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (546, 0))
> [...]
> ValueError: free variable: pi
>
> sage: plot(exp(x),x,0,1)
> [...]
> ValueError: free variable: e
>
> Funnily enough, the following fixes the pi-problem for the time being:
>
> sage: pi=pi.n()
>
> But e=e.n() does not fix the e-problem.
>
> Can anyone help?
>
> Thanks a lot,
> Stan
--~--~-~--~~~---~--~~
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: Bug in plot?

2008-09-26 Thread Jason Merrill

On Sep 27, 2:02 am, "Mike Hansen" <[EMAIL PROTECTED]> wrote:
> The patch at 4201 adds the features and the documentation back :-)
> Thanks for keeping an eye open.

Likewise :-).  Guess if I had read your ticket, I would have seen that
you were already on top of it.

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



[sage-support] Re: Bug in plot?

2008-09-26 Thread Mike Hansen

Hi Jason M.,

On Fri, Sep 26, 2008 at 10:58 PM, Jason Merrill <[EMAIL PROTECTED]> wrote:
> You may want to see http://trac.sagemath.org/sage_trac/ticket/4099 for
> reference.  I removed documentation for .options and .reset for
> several plot related functions, since I assumed these features were
> gone and not coming back.  The patch was merged into 3.1.3.alpha0

The patch at 4201 adds the features and the documentation back :-)
Thanks for keeping an eye open.

--Mike

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



[sage-support] Re: Bug in plot?

2008-09-26 Thread Jason Merrill

On Sep 26, 4:07 pm, "Mike Hansen" <[EMAIL PROTECTED]> wrote:
> Hi Jason,
>
> On Fri, Sep 26, 2008 at 9:05 AM, Jason Bandlow <[EMAIL PROTECTED]> wrote:
> > A student of mine noticed the following and it looks like a bug to me
> > (at least with the documentation).
>
> This was a regression caused by the reworking of plot.py in 3.1.2.
> I've added a patch athttp://trac.sagemath.org/sage_trac/ticket/4201
> which fixes so things so that the old behavior works.
>
> --Mike

You may want to see http://trac.sagemath.org/sage_trac/ticket/4099 for
reference.  I removed documentation for .options and .reset for
several plot related functions, since I assumed these features were
gone and not coming back.  The patch was merged into 3.1.3.alpha0

Regards,

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



[sage-support] Re: Bug in plot?

2008-09-26 Thread Mike Hansen

Hi Jason,

On Fri, Sep 26, 2008 at 9:05 AM, Jason Bandlow <[EMAIL PROTECTED]> wrote:
> A student of mine noticed the following and it looks like a bug to me
> (at least with the documentation).
>

This was a regression caused by the reworking of plot.py in 3.1.2.
I've added a patch at http://trac.sagemath.org/sage_trac/ticket/4201
which fixes so things so that the old behavior works.

--Mike

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



[sage-support] Re: bug in plot of 2^x?

2008-01-01 Thread William Stein

On Dec 30, 2007 9:11 AM, David Joyner <[EMAIL PROTECTED]> wrote:
>
> Hi:
>
> sage: P = plot(e^(ln(2)*x),-1,1)
>
> works fine (note: e^(ln(2)*x) = 2^x) but
>
> sage: P = plot(2^x,-1,1)
> WARNING: When plotting, failed to evaluate function at 201 points.
> Last error message: 'exponent (=1.0) must be an integer.
> Coerce your numbers to real or complex numbers first.'
> ---
> Traceback (most recent call last)
> ...
>
> returns an error.
>
> Seems like a bug. Should I create a track ticket for this?

Yes, that is *definitely* a bug:
http://modular.math.washington.edu:9002/sage_trac/ticket/1653

By the way, this works as a temporary workaround:

sage: show(plot(2.0^x,-1,1))

Perhaps the bug report would be clearer if it just pointed
out that this goes boom:

sage: 2^float(3.1)
---
 Traceback (most recent call last)

/Users/was/ in ()

/Users/was/integer.pyx in sage.rings.integer.Integer.__pow__()

: exponent (=3.1) must be an integer.
Coerce your numbers to real or complex numbers first.

Note:
sage: int(2)^float(3.1)
8.574187700290345
sage: (2/1)^float(3.1)
8.574187700290345


William

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