[sage-support] An abbreviation for lambda?

2009-12-13 Thread Alasdair
In some CAS's (Sage, Maxima), the "lambda" construct is used for an
anonymous function:

p=prime_range(30)
map(lambda x:x^2+1,p)

whereas in others, an arrow notation is used:

map(x->x^2+1,p) (Maple, MuPAD)
map(x+->x^2+1,p) (Axiom)

I'm very fond of the convenience of arrow notation.  Would it be very
hard to incorporate such a notation into the Sage parser?

Thanks,
Alasdair

-- 
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: Using The VirtualBox Image on Mac OS X

2009-12-13 Thread jason.t.stein
Here are the details of my machine.

Model Identifier:   MacBookPro4,1
Memory: 4 GB
System Version: Mac OS X 10.6.2 (10C540)

and I am using

VirtualBox Graphical User Interface Version 3.1.0 r55467

On Dec 13, 4:26 pm, William Stein  wrote:
> 2009/12/13 jason.t.stein :
>
> > I am working with sage-virtualbox-4.2.1.p1.zip
>
> I made that on OS X using the latest version of Virtualbox (version
> 3.1, I think).
> It should work fine -- I don't know why it wouldn't.  What version of
> virtualbox are
> you using?  Which mac exactly are you running it on?  Etc.
>
> William
>
>
>
>
>
>
>
> > On Dec 13, 12:40 pm, William Stein  wrote:
> >> On Sun, Dec 13, 2009 at 5:45 AM, jason.t.stein  
> >> wrote:
>
> >> > Is there any reason that the Virtual Box image shouldn't run using the
> >> > latest version of Virtual Box for Mac OS X?
>
> >> Is the virtualbox file that you downloaded named
> >> sage-virtualbox-4.2.1.p1.zip or         sage-virtualbox-4.2.1.zip
>
> >>  -- William
>
> >> > When I try to import the
> >> > appliance, I keep getting the error:
> >> > "Cannot unregister the machine 'Sage 4.2.1' because it has 2 medium
> >> > attachments."
> >> > The same "machine" works just fine on Windows.
>
> >> > Thanks for your thoughts.
>
> >> > --
> >> > 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


Re: [sage-support] Re: Using The VirtualBox Image on Mac OS X

2009-12-13 Thread William Stein
2009/12/13 jason.t.stein :
> I am working with sage-virtualbox-4.2.1.p1.zip

I made that on OS X using the latest version of Virtualbox (version
3.1, I think).
It should work fine -- I don't know why it wouldn't.  What version of
virtualbox are
you using?  Which mac exactly are you running it on?  Etc.

William

>
> On Dec 13, 12:40 pm, William Stein  wrote:
>> On Sun, Dec 13, 2009 at 5:45 AM, jason.t.stein  
>> wrote:
>>
>> > Is there any reason that the Virtual Box image shouldn't run using the
>> > latest version of Virtual Box for Mac OS X?
>>
>> Is the virtualbox file that you downloaded named
>> sage-virtualbox-4.2.1.p1.zip or         sage-virtualbox-4.2.1.zip
>>
>>  -- William
>>
>> > When I try to import the
>> > appliance, I keep getting the error:
>> > "Cannot unregister the machine 'Sage 4.2.1' because it has 2 medium
>> > attachments."
>> > The same "machine" works just fine on Windows.
>>
>> > Thanks for your thoughts.
>>
>> > --
>> > 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
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://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: Using The VirtualBox Image on Mac OS X

2009-12-13 Thread jason.t.stein
I am working with sage-virtualbox-4.2.1.p1.zip

On Dec 13, 12:40 pm, William Stein  wrote:
> On Sun, Dec 13, 2009 at 5:45 AM, jason.t.stein  
> wrote:
>
> > Is there any reason that the Virtual Box image shouldn't run using the
> > latest version of Virtual Box for Mac OS X?
>
> Is the virtualbox file that you downloaded named
> sage-virtualbox-4.2.1.p1.zip or         sage-virtualbox-4.2.1.zip
>
>  -- William
>
> > When I try to import the
> > appliance, I keep getting the error:
> > "Cannot unregister the machine 'Sage 4.2.1' because it has 2 medium
> > attachments."
> > The same "machine" works just fine on Windows.
>
> > Thanks for your thoughts.
>
> > --
> > 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: Integration of piecewise function

2009-12-13 Thread Paul Butler
David, thanks for making me aware of this, I wasn't following the
thread.

It looks like two things are happening.

First, the multiplication of piecewise functions results in some of
the elements (the 0's) of the piecewise function becoming
Polynomial_rational_dense instances. It looks like integration is
defined for Polynomial_rational_dense, but only indefinite integration
(the piecewise integration function relies on its pieces having
integral(variable, start, end) defined). There are a number of ways to
solve this, but I'm not sure which is the best until I have a better
chance to look at the polynomial code and piecewise multiplication.

Second, the issue of maxima not knowing the range of x. Adding assume
(start < x) to the piecewise integration function may be enough to
resolve this.

I have some time over the next few days to have a better look and put
together a patch.

-- Paul

On Dec 13, 3:39 pm, David Joyner  wrote:
> I'm cc'ing Paul Butler who wrote that method.
>
> Paul, are you following this thread?
>
>
>
> On Sun, Dec 13, 2009 at 3:32 PM, Eugene Goldberg  wrote:
> > So... There is no solution?
>
> > On Dec 9, 6:03 pm, Sand Wraith  wrote:
> >> Does anyone know is this issue only for newest version? (may be I
> >> should use older version of sage)
>
> >> On 8 дек, 21:47, David Joyner  wrote:
>
> >> > Unfortunately, the piecewise class was written before the symbolic
> >> > expressions class and has not kept pace.
>
> >> > The obvious solution produced this:
>
> >> > sage: signal = Piecewise([[(0,1),  cos(2*pi*1*x)], [(-1, 0), 0*x]])
> >> > sage: signal.integral(definite=True)
> >> > ---
> >> > TypeError                                 Traceback (most recent call 
> >> > last)
>
> >> > /Users/wdj/.sage/temp/jeeves.home/2806/_Users_wdj__sage_init_sage_0.py
> >> > in ()
>
> >> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/func
> >> >  tions/piecewise.pyc
> >> > in integral(self, x, a, b, definite)
> >> >     787                 fun_integrated = fun.integral(x, end, x)
> >> >     788             else:
> >> > --> 789                 fun_integrated = fun.integral(x, start, x) + area
> >> >     790                 if definite or end != infinity:
> >> >     791                     area += fun.integral(x, start, end)
>
> >> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/symb
> >> >  olic/expression.so
> >> > in sage.symbolic.expression.Expression.integral
> >> > (sage/symbolic/expression.cpp:25344)()
>
> >> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/calc
> >> >  ulus/calculus.pyc
> >> > in integral(expression, v, a, b, algorithm)
> >> >     635         else:
> >> >     636             try:
> >> > --> 637                 result = expression._maxima_().integrate(v, a, b)
> >> >     638             except TypeError, error:
> >> >     639                 s = str(error)
>
> >> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/inte
> >> >  rfaces/maxima.pyc
> >> > in integral(self, var, min, max)
> >> >    2023             if max is None:
> >> >    2024                 raise ValueError, "neither or both of min/max
> >> > must be specified."
> >> > -> 2025             return I(var, min, max)
> >> >    2026
> >> >    2027     integrate = integral
>
> >> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/inte
> >> >  rfaces/expect.pyc
> >> > in __call__(self, *args, **kwds)
> >> >    1402
> >> >    1403     def __call__(self, *args, **kwds):
> >> > -> 1404         return self._obj.parent().function_call(self._name,
> >> > [self._obj] + list(args), kwds)
> >> >    1405
> >> >    1406     def help(self):
>
> >> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/inte
> >> >  rfaces/expect.pyc
> >> > in function_call(self, function, args, kwds)
> >> >    1310                                        [s.name() for s in args],
> >> >    1311
> >> > ['%s=%s'%(key,value.name()) for key, value in kwds.items()])
> >> > -> 1312         return self.new(s)
> >> >    1313
> >> >    1314     def _function_call_string(self, function, args, kwds):
>
> >> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/inte
> >> >  rfaces/expect.pyc
> >> > in new(self, code)
> >> >    1094
> >> >    1095     def new(self, code):
> >> > -> 1096         return self(code)
> >> >    1097
> >> >    1098     
> >> > ###
>
> >> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/inte
> >> >  rfaces/expect.pyc
> >> > in __call__(self, x, name)
> >> >    1029
> >> >    1030         if isinstance(x, basestring):
> >> > -> 1031             return cls(self, x, name=name)
> >> >    1032         try:
> >> >    1033             return self._coerce_from_special_method(x)
>
> >> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/sit

Re: [sage-support] Re: Integration of piecewise function

2009-12-13 Thread David Joyner
I'm cc'ing Paul Butler who wrote that method.

Paul, are you following this thread?


On Sun, Dec 13, 2009 at 3:32 PM, Eugene Goldberg  wrote:
> So... There is no solution?
>
> On Dec 9, 6:03 pm, Sand Wraith  wrote:
>> Does anyone know is this issue only for newest version? (may be I
>> should use older version of sage)
>>
>> On 8 дек, 21:47, David Joyner  wrote:
>>
>> > Unfortunately, the piecewise class was written before the symbolic
>> > expressions class and has not kept pace.
>>
>> > The obvious solution produced this:
>>
>> > sage: signal = Piecewise([[(0,1),  cos(2*pi*1*x)], [(-1, 0), 0*x]])
>> > sage: signal.integral(definite=True)
>> > ---
>> > TypeError                                 Traceback (most recent call last)
>>
>> > /Users/wdj/.sage/temp/jeeves.home/2806/_Users_wdj__sage_init_sage_0.py
>> > in ()
>>
>> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/functions/piecewise.pyc
>> > in integral(self, x, a, b, definite)
>> >     787                 fun_integrated = fun.integral(x, end, x)
>> >     788             else:
>> > --> 789                 fun_integrated = fun.integral(x, start, x) + area
>> >     790                 if definite or end != infinity:
>> >     791                     area += fun.integral(x, start, end)
>>
>> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/symbolic/expression.so
>> > in sage.symbolic.expression.Expression.integral
>> > (sage/symbolic/expression.cpp:25344)()
>>
>> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/calculus/calculus.pyc
>> > in integral(expression, v, a, b, algorithm)
>> >     635         else:
>> >     636             try:
>> > --> 637                 result = expression._maxima_().integrate(v, a, b)
>> >     638             except TypeError, error:
>> >     639                 s = str(error)
>>
>> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/maxima.pyc
>> > in integral(self, var, min, max)
>> >    2023             if max is None:
>> >    2024                 raise ValueError, "neither or both of min/max
>> > must be specified."
>> > -> 2025             return I(var, min, max)
>> >    2026
>> >    2027     integrate = integral
>>
>> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
>> > in __call__(self, *args, **kwds)
>> >    1402
>> >    1403     def __call__(self, *args, **kwds):
>> > -> 1404         return self._obj.parent().function_call(self._name,
>> > [self._obj] + list(args), kwds)
>> >    1405
>> >    1406     def help(self):
>>
>> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
>> > in function_call(self, function, args, kwds)
>> >    1310                                        [s.name() for s in args],
>> >    1311
>> > ['%s=%s'%(key,value.name()) for key, value in kwds.items()])
>> > -> 1312         return self.new(s)
>> >    1313
>> >    1314     def _function_call_string(self, function, args, kwds):
>>
>> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
>> > in new(self, code)
>> >    1094
>> >    1095     def new(self, code):
>> > -> 1096         return self(code)
>> >    1097
>> >    1098     
>> > ###
>>
>> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
>> > in __call__(self, x, name)
>> >    1029
>> >    1030         if isinstance(x, basestring):
>> > -> 1031             return cls(self, x, name=name)
>> >    1032         try:
>> >    1033             return self._coerce_from_special_method(x)
>>
>> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
>> > in __init__(self, parent, value, is_name, name)
>> >    1445             except (TypeError, KeyboardInterrupt,
>> > RuntimeError, ValueError), x:
>> >    1446                 self._session_number = -1
>> > -> 1447                 raise TypeError, x
>> >    1448         self._session_number = parent._session_number
>> >    1449
>>
>> > TypeError: Computation failed since Maxima requested additional
>> > constraints (try the command 'assume(x>0)' before integral or limit
>> > evaluation, for example):
>> > Is  x  positive, negative, or zero?
>>
>> > On Tue, Dec 8, 2009 at 4:28 PM, Sand Wraith  wrote:
>> > > Hello,
>>
>> > > there is signal function:
>> > > signal = Piecewise([
>> > > [(0,5),  cos(2*pi*1*x) ],
>> > > [(5,10), cos(2*pi*2.5*x) ],
>> > > ])
>>
>> > > And window function:
>> > > window = Piecewise([[(-1,1),1]])
>>
>> > > And the result function:
>> > > r=window*signal
>>
>> > > How can I integrate it now? I'am trying:
>> > > r.integral(definite=True)
>>
>> > > but it leads to error: "TypeError: integral() takes no arguments (3
>> > > given)"
>>
>> > > --
>> > > To post to this group, send ema

[sage-support] Re: Integration of piecewise function

2009-12-13 Thread Eugene Goldberg
So... There is no solution?

On Dec 9, 6:03 pm, Sand Wraith  wrote:
> Does anyone know is this issue only for newest version? (may be I
> should use older version of sage)
>
> On 8 дек, 21:47, David Joyner  wrote:
>
> > Unfortunately, the piecewise class was written before the symbolic
> > expressions class and has not kept pace.
>
> > The obvious solution produced this:
>
> > sage: signal = Piecewise([[(0,1),  cos(2*pi*1*x)], [(-1, 0), 0*x]])
> > sage: signal.integral(definite=True)
> > ---
> > TypeError                                 Traceback (most recent call last)
>
> > /Users/wdj/.sage/temp/jeeves.home/2806/_Users_wdj__sage_init_sage_0.py
> > in ()
>
> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/functions/piecewise.pyc
> > in integral(self, x, a, b, definite)
> >     787                 fun_integrated = fun.integral(x, end, x)
> >     788             else:
> > --> 789                 fun_integrated = fun.integral(x, start, x) + area
> >     790                 if definite or end != infinity:
> >     791                     area += fun.integral(x, start, end)
>
> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/symbolic/expression.so
> > in sage.symbolic.expression.Expression.integral
> > (sage/symbolic/expression.cpp:25344)()
>
> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/calculus/calculus.pyc
> > in integral(expression, v, a, b, algorithm)
> >     635         else:
> >     636             try:
> > --> 637                 result = expression._maxima_().integrate(v, a, b)
> >     638             except TypeError, error:
> >     639                 s = str(error)
>
> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/maxima.pyc
> > in integral(self, var, min, max)
> >    2023             if max is None:
> >    2024                 raise ValueError, "neither or both of min/max
> > must be specified."
> > -> 2025             return I(var, min, max)
> >    2026
> >    2027     integrate = integral
>
> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
> > in __call__(self, *args, **kwds)
> >    1402
> >    1403     def __call__(self, *args, **kwds):
> > -> 1404         return self._obj.parent().function_call(self._name,
> > [self._obj] + list(args), kwds)
> >    1405
> >    1406     def help(self):
>
> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
> > in function_call(self, function, args, kwds)
> >    1310                                        [s.name() for s in args],
> >    1311
> > ['%s=%s'%(key,value.name()) for key, value in kwds.items()])
> > -> 1312         return self.new(s)
> >    1313
> >    1314     def _function_call_string(self, function, args, kwds):
>
> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
> > in new(self, code)
> >    1094
> >    1095     def new(self, code):
> > -> 1096         return self(code)
> >    1097
> >    1098     
> > ###
>
> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
> > in __call__(self, x, name)
> >    1029
> >    1030         if isinstance(x, basestring):
> > -> 1031             return cls(self, x, name=name)
> >    1032         try:
> >    1033             return self._coerce_from_special_method(x)
>
> > /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
> > in __init__(self, parent, value, is_name, name)
> >    1445             except (TypeError, KeyboardInterrupt,
> > RuntimeError, ValueError), x:
> >    1446                 self._session_number = -1
> > -> 1447                 raise TypeError, x
> >    1448         self._session_number = parent._session_number
> >    1449
>
> > TypeError: Computation failed since Maxima requested additional
> > constraints (try the command 'assume(x>0)' before integral or limit
> > evaluation, for example):
> > Is  x  positive, negative, or zero?
>
> > On Tue, Dec 8, 2009 at 4:28 PM, Sand Wraith  wrote:
> > > Hello,
>
> > > there is signal function:
> > > signal = Piecewise([
> > > [(0,5),  cos(2*pi*1*x) ],
> > > [(5,10), cos(2*pi*2.5*x) ],
> > > ])
>
> > > And window function:
> > > window = Piecewise([[(-1,1),1]])
>
> > > And the result function:
> > > r=window*signal
>
> > > How can I integrate it now? I'am trying:
> > > r.integral(definite=True)
>
> > > but it leads to error: "TypeError: integral() takes no arguments (3
> > > given)"
>
> > > --
> > > 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

-

Re: [sage-support] Re: Plot not working on Mac OS X 10.6.2

2009-12-13 Thread William Stein
On Sun, Dec 13, 2009 at 5:41 AM, jason.t.stein  wrote:
> Jason
>
> To answer your questions:
> • I installed from the binaries.
> • I was trying to plot from the local notebook
> • The output isn't hidden.
> • I just tried a similar plot from the command line and received the
> following error:
>  - /Applications/sage/local/bin/sage-sage: line 203:   815 Abort trap
> sage-ipython "$@" -i
>  which at least gives me a line number.
> As a sage newbie, don't know where to go from here.
>

(1) Every time you startup Sage you might notice this message:
"WARNING: There is one major unsolved bug in some versions of Sage on
OS X 10.6 that causes an 'Abort trap' crash when doing certain
symbolic computations.
See http://trac.sagemath.org/sage_trac/ticket/7095/.";

The subject of your email includes "OS X 10.6.2".   So the above
message actually applies to you.  Sage has not been fully ported to OS
X 10.6.  I worked for nearly a week and resolved all but one issue...
but evidently everybody who has tried has been stumped by the
remaining issue ever since.

There is one workaround -- download the OS X 10.5 32-bit binary.  That
may work for you.

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


Re: [sage-support] Using The VirtualBox Image on Mac OS X

2009-12-13 Thread William Stein
On Sun, Dec 13, 2009 at 5:45 AM, jason.t.stein  wrote:
>
> Is there any reason that the Virtual Box image shouldn't run using the
> latest version of Virtual Box for Mac OS X?

Is the virtualbox file that you downloaded named
sage-virtualbox-4.2.1.p1.zip or sage-virtualbox-4.2.1.zip

 -- William

> When I try to import the
> appliance, I keep getting the error:
> "Cannot unregister the machine 'Sage 4.2.1' because it has 2 medium
> attachments."
> The same "machine" works just fine on Windows.
>
> Thanks for your thoughts.
>
> --
> 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



--
William Stein
Associate Professor of Mathematics
University of Washington
http://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: problems with _tkagg in matplotlib

2009-12-13 Thread TDavis
Thanks -- I will try that.

I'm finding, as I work through all of this, that some of the Python
add-on packages (while excellent) are not trivial to install.

T. Davis

On Dec 10, 7:17 pm, William Stein  wrote:
> On Thu, Dec 10, 2009 at 4:10 PM, TDavis  wrote:
> > Hi, this is a follow-up to my original posting.
>
> > It turns out that the problem with TkAgg in 'matplotlib' isn't really
> > a sage-specific issue.  It is more a problem with the 'matplotlib'
> > installation scripts.
>
> > I tried a clean install of 'matplotlib' within a clean, stand-alone
> > Python 2.6 installation.  I did this completely outside 'sage'.  I had
> > exactly the same issue with TkAgg.  The problem is that my system has
> > Tcl and Tk installed in a non-standard place. The python installation
> > scripts for 'matplotlib' couldn't find them, and looked in a hard-
> > coded location as a last act of desperation.  I went into one of the
> > setup python scripts for 'matplotlib' and changed the two lines which
> > had hard-coded locations for Tcl and Tk, respectively.  Once I did
> > that, TkAgg built cleanly and my 'matplotlib' build/install went
> > fine.  I think the same thing would probably work inside sage if one
> > is willing to do some hand editing.
>
> > In my opinion, the problem is the inflexible installation process for
> > 'matplotlib'.  Couldn't the python setup scripts be given at least one
> > additional option that would allow the user to specify the locations
> > of Tcl and Tk?
>
> I strongly encourage you to post to the excellent matplotlib mailing
> list about this issue.
>
>  -- 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
URL: http://www.sagemath.org


[sage-support] Using The VirtualBox Image on Mac OS X

2009-12-13 Thread jason.t.stein
Is there any reason that the Virtual Box image shouldn't run using the
latest version of Virtual Box for Mac OS X? When I try to import the
appliance, I keep getting the error:
"Cannot unregister the machine 'Sage 4.2.1' because it has 2 medium
attachments."
The same "machine" works just fine on Windows.

Thanks for your thoughts.

-- 
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: Plot not working on Mac OS X 10.6.2

2009-12-13 Thread jason.t.stein
Jason

To answer your questions:
• I installed from the binaries.
• I was trying to plot from the local notebook
• The output isn't hidden.
• I just tried a similar plot from the command line and received the
following error:
  - /Applications/sage/local/bin/sage-sage: line 203:   815 Abort trap
sage-ipython "$@" -i
 which at least gives me a line number.
As a sage newbie, don't know where to go from here.

Thanks for any help.

On Dec 12, 4:32 pm, Jason Grout  wrote:
> jason.t.stein wrote:
> > I recently installed Sage Version 4.2.1 on my MacBook Pro and while
> > basic symbolic and numeric computation work, simple plots like plot
> > (x^2, -5, 5) do not work. They don't even produce an error. Any
> > suggestions?
>
> How are you running Sage (command line or in the notebook)?  Are you
> running the binary or did you compile from the source?  If you compiled
> it, were there any errors?  What operating system are you running (what
> version of OSX)?
>
> Did you try clicking just to the right of where the output should be?
>
> 
> |   input cell |
> 
>
> ##   blank space
>
> try clicking right where the "##" is above.
>
> Note to others: If this is the problem, we really ought to make
> something visible there that toggles the output.
>
> Jason

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


[sage-support] Re: LaTeX size/alignment in SAGE plots

2009-12-13 Thread ma...@mendelu.cz
No idea, but I observed also similar problems.

The first idea was that this is problem from mathplotlib, but I
followed the example at http://www.scipy.org/Cookbook/Matplotlib/UsingTex
and tried the following

P=plot(x^2,(x,-3,3))
T=text(r"$\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$",(0,0),
fontsize=16)
show(P+T)

this does not work because of displaystyle. Removing \displaystyle and
trying

P=plot(x^2,(x,-3,3))
T=text(r"$\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$",(0,0), fontsize=16)
show(P+T)

This gives a fraction which has far worse rendering than the rendering
via LaTeX and rendering which can be seen at 
http://www.scipy.org/Cookbook/Matplotlib/UsingTex

Tested now at sagenb.org

Robert



On 13 pro, 03:56, Greg Marks  wrote:
> When I include LaTeX using the text() command in a 2-D
> plot, the size of the text is not quite what I'd like.
> For example, on p. 3 of the document here:
>
>  http://gmarks.co.cc/math_142-02_fall_2009_exam_3_solutions.pdf
>
> the sizes of the fractions in the SAGE plot are quite
> different from the sizes LaTeX produces in the document
> itself (e.g. right above the plot).  The commands used in
> the plot were:
>
>  t1=text("$y=\\frac{1}{1+x^2}$", (2.2, 0.5),
>  rgbcolor='black', fontsize=18)
>  t2=text("$y=x^2\!+\\frac{5}{12}$", (-2.1, 1.8),
>  rgbcolor='black', fontsize=18)
>
> (I note also the strange need for \! for correct spacing
> in t2.)  I tried inserting \displaystyle and \\displaystyle
> in the fractions in t1 and t2, but got error messages.
>
> There is, of course, the obvious solution of creating
> a separate text element for the numerator, denominator,
> and line of the fraction, as well as the left-hand side
> of the equation $y = \frac{1}{\displaystyle 1 + x^2}$,
> and then tinkering with the sizes and alignment, but this
> seems extremely tedious.
>
> I admit this is a pretty minor issue, but I'd like to be
> able to fix it.
>
> Sincerely,
> Greg
>
>     
>    | Greg Marks                                     |
>    | Department of Mathematics and Computer Science |
>    | St. Louis University                           |
>    | St. Louis, MO 63103-2007                       |
>    | U.S.A.                                         |
>    |                                                |
>    | Phone: (314)977-7206                           |
>    | Fax: (314)977-1452                             |
>    | Web:http://math.slu.edu/~marks               |
>     

-- 
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: interrupting execution from the command line

2009-12-13 Thread Charles J. Daniels

On Dec 13, 1:54 am, Robert Bradshaw 
wrote:
> On Dec 13, 2009, at 1:46 AM, Charles J. Daniels wrote:
>
> >  I tried ctrl-c but no help.
>
> This should work. If it doesn't, it usually means we didn't wrap some  
> c call with the appropriate signal handlers, so please let us know  
> exactly what you were calling so we can fix it.
>
> - Robert

You are right, ctrl-c is working. My problem was due to virtualbox
(see, I thought that might matter =) - the right ctrl key is (by
default) used to redirect to your os, so alt-tab will cycle through
your native machice windows rather than the virtual, etc. It was
eating up my ctrl-c, so now I found I can use the left ctrl+c. Thanks
for the help! I wouldn't have thought to try that had you not ensured
me the key combo should work.

--charlie

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

2009-12-13 Thread marcW
hi,
I'm really surprised about the consideration for a remark like  a
newbie like me.
Of course computational precision is important, the little game i was
showing leads to a soluion
around 0.1 for ra and rb.
So that brings us to part 2: convert to string; works for an isolated
number, but not for mixtures of symbolic and numeric expressions I
would think.
Can the latex (or generic) output expression be parsed for pretty
printing (his means find the numbers in the expression and  put them
through %f% ?
thanks
m


 12 dec, 16:06, Jason Grout  wrote:
> Simon King wrote:
> > Hi Marc!
>
> > On 12 Dez., 15:48, Jason Grout  wrote:
> >> marcW wrote:
> > [...]
> >> If you don't care about precision (i.e., all numbers are rounded off to
> >> 2-3 digits), then you can declare your numbers this way:
>
> >> sage: R=RealField(15)
> >> sage: R(pi)
> > [...]
>
> > Or, if you *do* care about the precision in the computation, but don't
> > want to see more then 3 digits in the final result, you may do
> >   sage: print 1.0
> >   1.00
> >   sage: print '%.3f'%1.0
> >   1.000
>
> Hmmm.  Yeah, we probably ought to make this easier to just print the
> first n digits after the decimal by default for RR numbers, or to not
> print out the trailing zeros.  I can't imagine telling my students, for
> example, that they need to do '%.3f'%num every time they come across a
> number, especially since they just want to display the equation, not
> format it as a string.
>
> What do people think about this interface?
>
> sage: RR.print_digits=3
> sage: 3.09384
> 3.094
> sage: RR.print_trailing_zeros=False
> sage: RR.print_digits=None
> sage: 3.09384
> 3.09384
>
> Make it something like the RR.scientific_notation flag that is currently
> in use.
>
> Thanks,
>
> Jason
>
> --
> Jason Grout

-- 
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] interrupting execution from the command line

2009-12-13 Thread Robert Bradshaw
On Dec 13, 2009, at 1:46 AM, Charles J. Daniels wrote:

> I haven't gotten notebook running just yet, but I prefer command line
> anyway so far. The thing is, my computational eyes are larger than my
> processing ability's stomach, so I end up finding out it's going to
> take longer than I want to complete a command. How do I stop it from
> the command line? I tried ctrl-c but no help.

This should work. If it doesn't, it usually means we didn't wrap some  
c call with the appropriate signal handlers, so please let us know  
exactly what you were calling so we can fix it.

> I end up having to close
> out the command window. In case it matters, I'm running sage via
> virtualbox on windows. I've search all over for this info but cannot
> find it. Thanks for any help.

Another option is to do ctrl-z to sleep the process, then kill %1.  
Just as closing the window, however, this will kill your entire session.

- Robert

-- 
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] interrupting execution from the command line

2009-12-13 Thread Charles J. Daniels
I haven't gotten notebook running just yet, but I prefer command line
anyway so far. The thing is, my computational eyes are larger than my
processing ability's stomach, so I end up finding out it's going to
take longer than I want to complete a command. How do I stop it from
the command line? I tried ctrl-c but no help. I end up having to close
out the command window. In case it matters, I'm running sage via
virtualbox on windows. I've search all over for this info but cannot
find it. Thanks for any help.

--charlie

-- 
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] Try cvxopt.solvers.lp (Was Re: MixedIntegerLinearProgram solver)

2009-12-13 Thread rickhg12hs
You could also use the LP solver in cvxopt.

http://www.sagemath.org/doc/numerical_sage/cvxopt.html

For your example problem:

sage: RealNumber=float
sage: Integer=int
sage: from cvxopt.base import matrix as m
sage: from cvxopt import solvers
sage: c = m([-1., -5.])
sage: G = m([[1., 1.5, -1., 0.], [0.2, 3., 0., -1.]])
sage: h = m([4., 4., 0., 0.])
sage: sol = solvers.lp(c,G,h)
sage: print sol['x']
sage: print -c.trans() * sol['x']

HTH!
Rick

On Dec 9, 7:28 am, hassan  wrote:
> Hi all
> I need to solve a LP so I have installed 'csc':
>
> sage: p.solve(solver='cbc')
>
> and then copy and paste the example 
> inhttp://www.sagemath.org/doc/reference/sage/numerical/mip.htmthat is:
>
> sage: p = MixedIntegerLinearProgram(maximization=True)
> sage: x = p.new_variable()
> sage: p.set_objective(x[1] + 5*x[2])
> sage: p.add_constraint(x[1] + 0.2*x[2], max=4)
> sage: p.add_constraint(1.5*x[1] + 3*x[2], max=4)
> sage: p.solve()
>
> and the result is:
>
> ---
> AttributeError                            Traceback (most recent call
> last)
>
> /home/hassan/ in ()
>
> /home/hassan/Apps/sage-4.2.1/local/lib/python2.6/site-packages/sage/numerical/mip.so
>  in sage.numerical.mip.MixedIntegerLinearProgram.solve 
> (sage/numerical/mip.c:5059)()
>
> /home/hassan/Apps/sage-4.2.1/local/lib/python2.6/site-packages/sage/numerical/mipCoin.so
>  in sage.numerical.mipCoin.solveCoin (patch/mipCoin.cpp:595)()
>
> AttributeError: MixedIntegerLinearProgram instance has no attribute
> '_variables_type'
>
> Pleas 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