[sage-support] Re: Maxima default mode

2015-05-30 Thread kcrisman



 It says there the language can be selected by a long tap on the 'sage' 
 button in the cell, or in the app settings. 

 This did not register with me when I first read it! 

 Apologies for wasting people's time, 


Not at all, others will search for this and find the answer! 

-- 
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: Maxima-in-Sage versus plain Maxima

2013-03-05 Thread Jeroen Demeyer
On 2013-03-04 17:30, William Stein wrote:
 sage: sage.calculus.all.maxima_calculus('domain: real')
Thanks, that helps but it's not really something you want to tell your
students using Sage...

-- 
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] Re: Maxima-in-Sage versus plain Maxima

2013-03-04 Thread kcrisman


On Monday, March 4, 2013 9:26:47 AM UTC-5, Jeroen Demeyer wrote:

 It seems that Maxima in Sage doesn't do some simplifications that plain 
 Maxima does, why is this and how can this be fixed? 


 Distributed under the GNU Public License. See the file COPYING. 
 Dedicated to the memory of William Schelter. 
 The function bug_report() provides bug reporting information. 
 (%i1) abs(cos(t))^2; 
2 
 (%o1)   cos (t) 



(%i1) domain:complex;
(%o1)   complex
(%i2) abs(cos(t))^2
;
2
(%o2)abs(cos(t))


versus

(%i1) abs(cos(t))^2;
   2
(%o1)   cos (t)


 

 -- 
 | Sage Version 5.7, Release Date: 2013-02-19 | 
 | Type notebook() for the browser-based notebook interface.| 
 | Type help() for help.| 
 -- 
 sage: maxima('abs(cos(t))^2;') 
 abs(cos(t))^2 


-- 
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] Re: Maxima-in-Sage versus plain Maxima

2013-03-04 Thread Jeroen Demeyer
Fair enough, but what if I want the domain: real behaviour in Sage? In
other words, what should do to have (abs(cos(t))^2).simplify() return
cos(t)^2?

sage: maxima('domain: real;')
real
sage: var(t)
t
sage: assume(t, real)
sage: (abs(cos(t))^2).simplify()
abs(cos(t))^2

-- 
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] Re: Maxima-in-Sage versus plain Maxima

2013-03-04 Thread William Stein
On Mon, Mar 4, 2013 at 8:10 AM, Jeroen Demeyer jdeme...@cage.ugent.be wrote:
 Fair enough, but what if I want the domain: real behaviour in Sage? In
 other words, what should do to have (abs(cos(t))^2).simplify() return
 cos(t)^2?

 sage: maxima('domain: real;')

Use the maxima that the sage symbolics use:

wstein@01salvus:~/explicit$ sage
--
| Sage Version 5.3, Release Date: 2012-09-08 |
| Type notebook() for the browser-based notebook interface.|
| Type help() for help.|
--
sage: sage.calculus.all.maxima_calculus('domain: real')
real
sage: var(t)
t
sage: assume(t, real)
sage: (abs(cos(t))^2).simplify()
cos(t)^2

 real
 sage: var(t)
 t
 sage: assume(t, real)
 sage: (abs(cos(t))^2).simplify()
 abs(cos(t))^2

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





-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
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] Re: Maxima-in-Sage versus plain Maxima

2013-03-04 Thread Michael Orlitzky
On 03/04/2013 11:10 AM, Jeroen Demeyer wrote:
 Fair enough, but what if I want the domain: real behaviour in Sage? In
 other words, what should do to have (abs(cos(t))^2).simplify() return
 cos(t)^2?
 
 sage: maxima('domain: real;')
 real
 sage: var(t)
 t
 sage: assume(t, real)
 sage: (abs(cos(t))^2).simplify()
 abs(cos(t))^2
 

This is what I use in my ~/.sage, without any error checking:

def set_simplification_domain(d):

Set Maxima's simplification domain.

INPUT:

  - ``d`` -- The domain, either 'real' or 'complex'.

TESTS:

With the default 'complex' domain, we don't simplify this::

sage: (abs(x)^2).simplify()
abs(x)^2

But in the 'real' domain, we do::

sage: set_simplification_domain('real')
'real'
sage: (abs(x)^2).simplify()
x^2
sage: set_simplification_domain('complex')
'complex'


cmd = 'domain: %s;' % d
result = maxima_lib._eval_line(cmd)
return result


At some point, I had a patch that made this available through e.g.,

sage: maxima_lib.domain = 'real'

with appropriate error checking. But I couldn't figure out how to
document the property, which does one thing as a getter and another as a
setter.

Plus, fooling with the maxima domain feels kind of hacky. Users
shouldn't have to configure the underlying libraries that sage uses,
although it would be nice to have the option in the meantime.

The super-feature that would obviate twiddling the domain would be to
determine whether or not all terms in an expression are real, and set
the maxima domain automatically when manipulating pure-real expressions.

-- 
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] Re: Maxima problem?

2011-06-10 Thread NigelSmart
Hi

Thanks for the help re distributions.

My sage version is 4.7 as I downloaded a new version two days ago to
try and
see whether the problem had been corrected in a newer version.

Cheers

Nigel

-- 
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: Maxima problem?

2011-06-10 Thread Jean-Pierre Flori
FYI, the interface to Maxima changed in 4.7.1.alpha0 IIRC, so you
could also try one of the more recent alphas available at:
http://sage.math.washington.edu/home/release/
The things with MARKER are not involved in that new interface.

On 10 juin, 08:34, NigelSmart ni...@cs.bris.ac.uk wrote:
 Hi

 Thanks for the help re distributions.

 My sage version is 4.7 as I downloaded a new version two days ago to
 try and
 see whether the problem had been corrected in a newer version.

 Cheers

 Nigel

-- 
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: Maxima problem?

2011-06-10 Thread kcrisman


On Jun 10, 6:40 am, Jean-Pierre Flori jpfl...@gmail.com wrote:
 FYI, the interface to Maxima changed in 4.7.1.alpha0 IIRC, so you
 could also try one of the more recent alphas available 
 at:http://sage.math.washington.edu/home/release/
 The things with MARKER are not involved in that new interface.


Thanks, JP - that was what I was referring to, but didn't know whether
this problem would be fixed or not.

-- 
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: Maxima problem?

2011-06-09 Thread kcrisman
Dear Nigel,

There are two questions here.

1) How to get distributions in Sage.

2) How to get Maxima to not crash.

The second one is harder than the first.But if your Sage is not
quite new, we have a different interface to Maxima that might (only
might) help.  What version do you have?  (Type version().)

As to the first, the RealDistribution command might help you.
Assuming that normal=Gaussian, then from the doc:

   The gaussian distribution takes 1 parameter ``sigma``. The
standard
   gaussian distribution has ``sigma = 1``:

  sage: sigma = 1
  sage: T = RealDistribution('gaussian', sigma)
  sage: T.get_random_element() # random
  0.818610064197
  sage: T.distribution_function(0)
  0.398942280401
  sage: T.cum_distribution_function(1)
  0.841344746069
  sage: T.cum_distribution_function_inv(.5)
  0.0

Unfortunately, the many many ways of getting distributions and
statistics in Sage are not always very easy to find.

- kcrisman

On Jun 9, 1:34 pm, NigelSmart ni...@cs.bris.ac.uk wrote:
 Hi

 First let me say I am a python and sage novice, but I seem to have a
 problem in using
 maxima within sage. My sage installation is on a CentOS linux
 distribution and I just
 unpacked the Redhat distribution and run it. So no clever installation
 things done.

 Now I have a medium'ish program (1500 lines) which at one point needs
 access to
 normal variates. I see maxima has this so I define a function

   maxima(load(distrib));

   def MultiVarNormal(n,r):
     s=maxima(random_normal(0,%s,%s)%(r,n));
     return s;

 and run my program. Firstly the above function creates a significant
 slow down (compared to the dummy code I give later) and eventually I
 get a crash with the following error message

 /home/crypto/linux.x86_64/sage/local/lib/python2.6/site-packages/sage/
 structure/parent.so in sage.structure.parent.Parent.__call__ (sage/
 structure/parent.c:6820)()

 /home/crypto/linux.x86_64/sage/local/lib/python2.6/site-packages/sage/
 structure/coerce_maps.so in
 sage.structure.coerce_maps.NamedConvertMap._call_ (sage/structure/
 coerce_maps.c:4221)()

 /home/crypto/linux.x86_64/sage/local/lib/python2.6/site-packages/sage/
 interfaces/maxima.pyc in _real_double_(self, R)
    1896             2.41421356237
    1897         
 - 1898         return R(self._sage_())
    1899
    1900     def real(self):

 /home/crypto/linux.x86_64/sage/local/lib/python2.6/site-packages/sage/
 interfaces/maxima.pyc in _sage_(self)
    1822         import sage.calculus.calculus as calculus
    1823         return
 calculus.symbolic_expression_from_maxima_string(self.name(),
 - 1824                 maxima=self.parent())
    1825
    1826     def _symbolic_(self, R):

 /home/crypto/linux.x86_64/sage/local/lib/python2.6/site-packages/sage/
 calculus/calculus.pyc in symbolic_expression_from_maxima_string(x,
 equals_sub, maxima)
    1652         return symbolic_expression_from_string(s, syms,
 accept_sequence=True)
    1653     except SyntaxError:
 - 1654         raise TypeError, unable to make sense of Maxima
 expression '%s' in Sage%s
    1655     finally:
    1656         is_simplified = False

 TypeError: unable to make sense of Maxima expression
 '__SAGE_SYNCHRO_MARKER_135903684' in Sage

 Now as a test that it is the above maxima function causing the
 problems I replace the
 above code with

   def MultiVarNormal_V2(n,r):
     s=[1..n];
     for i in range(0,n):
       s[i]=randint(-r,r);
     return s;

 OK Its no longer a normal distribution, but this is just a testing
 idea.  The code now runs very fast and does not produce the crash. So
 this leads me to think it is the above function causing the problems.

 One initially suspects it could be some form of memory leak/corruption
 as when I move to a bigger machine the original version takes longer
 to crash (it still crashes). However, running top whilst the program
 runs does not seem to reveal a huge increase in memory. So

 I have been unable to produce a small code snippett which produces the
 crash since running MultiVarNormal a gazillion times does not seem to
 crash.

 I am therefore stuck as to how to proceed. Any ideas would be most
 welcome. And please remember I really am a python/sage idiot at this
 stage.

 Yours

 Nigel

-- 
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: Maxima matrix vs Sage matrix

2011-06-02 Thread iDan



 On Thu, Jun 2, 2011 at 7:57 AM, iDan idans...@live.fr wrote:
  I obtain a Maxima matrix. How can I transform it into a Sage
  Matrix

On 2 juin, 11:48, William Stein wst...@gmail.com wrote:
 Use Mat.sage():

So elegant and so obvious :-)

Thanks!!!
Daniel

-- 
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: maxima cli compatability

2011-05-13 Thread Daniel Harris
resent after correcting mistake

On Fri, May 13, 2011 at 12:53 PM, Daniel Harris
mail.dhar...@googlemail.com wrote:
 Hello

 1.  In maxima it is possible to use % variable (o1%, o2%, etc) to
 access previous commands is that also possible in sage (cli and
 notebook mode).

 Thanks

 Dan


-- 
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: maxima called by solve() occasionally hangs

2011-03-16 Thread kcrisman


On Mar 16, 4:06 pm, tvn nguyenthanh...@gmail.com wrote:
 I call the function solve() many times in my program and occasionally I
 notice that the it just stops responding  (not frozen,  it's just doing
 nothing).   Control + C  stops the process which returns error such as
 Interrupting Maxima. Please wait a few seconds...  Usually things will
 work fine if I just rerun the program again  (but then it might hang at a
 different call to solve()).   This happens all the times -  is this a known
 issue ?    what can I do to avoid this ?  

Yes, it's known.  Solving large problems uses some pretty intense
resources in Maxima trying to go a number of recursion levels deep.
See the Maxima documentation for algsys, which is usually where this
ends up happening.

I don't think there is a fix, unfortunately - I've tried!  Unless we
were to have a way to indicate an interrupt interval to Maxima - which
is conceivable, but would have to alter the interface, and so one
would have to do it on one's own using the interface class
initialization, I guess, if that's possible there.

- kcrisman

-- 
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: maxima called by solve() occasionally hangs

2011-03-16 Thread tvn
that's really bad --  I rather have something less efficient (assuming the 
linear algebra solver in Maximum is fast) but at least deterministic in 
terms of termination than something perform randomly.   In fact I would just 
rather have it somehow timeouts, returns error rather than just hangs in 
there.   


-- 
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: maxima-great stats

2009-11-17 Thread Harald Schilly
On Nov 17, 10:10 pm, Mikie thephantom6...@hotmail.com wrote:
 student tTest

Hi, do you know that there is R inside Sage? An example right from
sagenb.org:

import rpy2.robjects as robjects
data = robjects.IntVector([44,55,56,14*2])
ttest = robjects.r['t.test']
print ttest(data)

gives:

One Sample t-test

data:  c(44L, 55L, 56L, 28L)
t = 7.0263, df = 3, p-value = 0.005922
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
 25.02843 66.47157
sample estimates:
mean of x
45.75

-- 
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: maxima-great stats

2009-11-17 Thread Mikie
Hi Harald,
No I don't have R.
I did convert the list(str) to a real list and did a trap on that and
it did work.
How do I get R into Sage?
Thanx

On Nov 17, 2:58 pm, Harald Schilly harald.schi...@gmail.com wrote:
 On Nov 17, 10:10 pm, Mikie thephantom6...@hotmail.com wrote:

  student tTest

 Hi, do you know that there is R inside Sage? An example right from
 sagenb.org:

 import rpy2.robjects as robjects
 data = robjects.IntVector([44,55,56,14*2])
 ttest = robjects.r['t.test']
 print ttest(data)

 gives:

 One Sample t-test

 data:  c(44L, 55L, 56L, 28L)
 t = 7.0263, df = 3, p-value = 0.005922
 alternative hypothesis: true mean is not equal to 0
 95 percent confidence interval:
  25.02843 66.47157
 sample estimates:
 mean of x
     45.75

-- 
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: maxima-great stats

2009-11-17 Thread Jason Grout
Mikie wrote:
 Hi Harald,
 No I don't have R.
 I did convert the list(str) to a real list and did a trap on that and
 it did work.
 How do I get R into Sage?


R comes with every Sage install, by default.  You don't have to do anything.

-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] Re: maxima-great stats

2009-11-17 Thread William Stein
On Tue, Nov 17, 2009 at 2:58 PM, Mikie thephantom6...@hotmail.com wrote:
 Hi Harald,
 No I don't have R.
 I did convert the list(str) to a real list and did a trap on that and
 it did work.
 How do I get R into Sage?

Every copy of Sage comes with R.

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] Re: maxima

2009-11-04 Thread kcrisman

There are several ways to do this.

sage: maxima_console()

gives you a fully functioning version of Maxima, just as if you
downloaded it yourself.

Or you can use Maxima one thing at a time:

sage: from sage.calculus.calculus import maxima
sage: maxima.eval('integrate(cos(x),x)')
'sin(x)'

Usually it is helpful to import the calculus copy of Maxima, as I
have done.

There are also other interfaces, but they boil down to these, which
should be sufficient.  Good luck!

- kcrisman


On Nov 4, 10:22 am, Mikie thephantom6...@hotmail.com wrote:
 Is the Maxima that Sage uses a full version?  Where is Maxima in the
 Sage directory?  Can I load Maxima and do some command line work?
 Thanx
--~--~-~--~~~---~--~~
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: maxima

2009-11-04 Thread William Stein

On Wed, Nov 4, 2009 at 7:22 AM, Mikie thephantom6...@hotmail.com wrote:

 Is the Maxima that Sage uses a full version?

Yes

 Where is Maxima in the
 Sage directory?  Can I load Maxima and do some command line work?

sage -maxima

 Thanx
 




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

2009-11-04 Thread Mikie

Willian, Thanks, I found it.  How do I start it.

On Nov 4, 8:35 am, William Stein wst...@gmail.com wrote:
 On Wed, Nov 4, 2009 at 7:22 AM, Mikie thephantom6...@hotmail.com wrote:

  Is the Maxima that Sage uses a full version?

 Yes

  Where is Maxima in the
  Sage directory?  Can I load Maxima and do some command line work?

 sage -maxima

  Thanx

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

2009-11-04 Thread Mikie

Willian, I found it.  In  /local/bin/

On Nov 4, 9:26 am, William Stein wst...@gmail.com wrote:
 On Wed, Nov 4, 2009 at 8:24 AM, Mikie thephantom6...@hotmail.com wrote:

  Willian, Thanks, I found it.  How do I start it.

 Type

    ./sage -maxima

 from the root of your Sage install.

  -- william







  On Nov 4, 8:35 am, William Stein wst...@gmail.com wrote:
  On Wed, Nov 4, 2009 at 7:22 AM, Mikie thephantom6...@hotmail.com wrote:

   Is the Maxima that Sage uses a full version?

  Yes

   Where is Maxima in the
   Sage directory?  Can I load Maxima and do some command line work?

  sage -maxima

   Thanx

  --
  William Stein
  Associate Professor of Mathematics
  University of Washingtonhttp://wstein.org

 --
 William Stein
 Associate Professor of Mathematics
 University of Washingtonhttp://wstein.org- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: maxima to sage

2009-11-03 Thread Mikie

Yes, David, thanks.  I fixed it with repr and SR.

On Nov 3, 1:38 pm, David Joyner wdjoy...@gmail.com wrote:
 Does this help?

 sage: f = maxima(x^2-1)
 sage: type(f)
 class 'sage.interfaces.maxima.MaximaElement'
 sage: ff = f.sage()
 sage: type(ff)
 type 'sage.symbolic.expression.Expression'
 sage: ff.factor()
 (x - 1)*(x + 1)



 On Tue, Nov 3, 2009 at 3:28 PM, Mikie thephantom6...@hotmail.com wrote:

  Is there anyway to convert a maxima expression
  ('sage.interfaces.maxima.MaximaElement') to
  ('sage.calculus.SymbolicArithmetic')?

  I need to use Sage's factor instead of Maxima's.
  Thanx- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: maxima to sage

2009-11-03 Thread David Joyner

Does this help?


sage: f = maxima(x^2-1)
sage: type(f)
class 'sage.interfaces.maxima.MaximaElement'
sage: ff = f.sage()
sage: type(ff)
type 'sage.symbolic.expression.Expression'
sage: ff.factor()
(x - 1)*(x + 1)



On Tue, Nov 3, 2009 at 3:28 PM, Mikie thephantom6...@hotmail.com wrote:

 Is there anyway to convert a maxima expression
 ('sage.interfaces.maxima.MaximaElement') to
 ('sage.calculus.SymbolicArithmetic')?

 I need to use Sage's factor instead of Maxima's.
 Thanx
 


--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-03 Thread Mikie

JSmath is basically a bunch of javacript routines that takes latex
created from sage and displays in the html file.  The html is
generated in my Python script(server,html).  When I call JSmath the
first routine is loaded.  In the first script it calls another and
this is where the problem occurs.  One of the problems is that I am
calling the JSmath from a server.  It is a path problem.  I can insert
images in the html file.

On Sep 2, 11:10 am, Robert Bradshaw rober...@math.washington.edu
wrote:
 On Wed, 2 Sep 2009, Mikie wrote:

  Didn't you create the API using the notebook?

 Yes, I created the simple server, but you can think of that more as
 reaching under the html/javascript/jsmath layer and exposing the raw
 computatinal elements themsleves, rather than building on top of that nice
 GUI.

 - Robert





  On Sep 1, 10:02 pm, Robert Bradshaw rober...@math.washington.edu
  wrote:
  On Sep 1, 2009, at 12:16 PM, Mikie wrote:

  I took out the eval and for some reason it is working.
  Robert, this is function in my API (AlgCalc)
 http://pirsqrt.com:1843/
  If I would give it to you would you show me how to get JSmath to
  work?  I have talked to you before.  You said you were too busy.  I
  have loaded load.js, but when it goes for another .js file it cannot
  find.

  You're probably thinking about another Robert--I don't know anything  
  about jsmath. What I would do is look for instructions on their site.

  - Robert (Bradshaw)

  On Sep 1, 12:37 pm, Mikie thephantom6...@hotmail.com wrote:
  Yes, Robert eval is doing the rounding.  How do I fix it?

  On Sep 1, 12:31 pm, Mikie thephantom6...@hotmail.com wrote:

  I have tried SR.  I get a malformed value.  Yes, I understand the
  problem with eval.  Do you have any suggestions on how to get the
  right value into maxima.solve?

  On Sep 1, 11:32 am, Robert Bradshaw rober...@math.washington.edu
  wrote:

  On Tue, 1 Sep 2009, Mikie wrote:

  When I run the server with the function above and the following  
  string
  from a text box I get
  [y=-1,x=0].  The string is [3*x-y-1,x+(1/3)*y]

  It is changing the input value to [3*x-y-1,x]

  1/3 = 0 in Python. Also, I hope you realize how dangerous

  eval(random string someone gave you from the web) is!

  - Robert

  On Sep 1, 10:38 am, Mikie thephantom6...@hotmail.com wrote:
  Sorry, wrong function

  def MSolveSys(syss):
     eqns=eval(syss)
     solns=maxima.solve(eqns)
     return solns

  On Sep 1, 10:31 am, Jason Grout jason-s...@creativetrax.com  
  wrote:

  Robert Bradshaw wrote:
  On Sep 1, 2009, at 9:17 AM, Mikie wrote:

  Here is function I am using to solve systems of linear  
  equations.

  def MSolveSys(syss):
     eqns=eval(syss)
     solns=maxima.solve(syss)
     return solns

  Works great in the notebook, but when I put it in a Python  
  script it
  rounds the coeficients of the variables and thus produces bad
  solutions.

  Perhaps eval here is the culprit. You might have to parse it  
  a bit
  yourself. SR(...) will parse expressions.

  Mikie effectively isn't using eval, right?  That line (and  
  the eqns
  variable) is not being used.

  Jason

  --
  Jason Grout- Hide quoted text -

  - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-02 Thread Mikie

Didn't you create the API using the notebook?

On Sep 1, 10:02 pm, Robert Bradshaw rober...@math.washington.edu
wrote:
 On Sep 1, 2009, at 12:16 PM, Mikie wrote:

  I took out the eval and for some reason it is working.
  Robert, this is function in my API (AlgCalc)
 http://pirsqrt.com:1843/
  If I would give it to you would you show me how to get JSmath to
  work?  I have talked to you before.  You said you were too busy.  I
  have loaded load.js, but when it goes for another .js file it cannot
  find.

 You're probably thinking about another Robert--I don't know anything  
 about jsmath. What I would do is look for instructions on their site.

 - Robert (Bradshaw)





  On Sep 1, 12:37 pm, Mikie thephantom6...@hotmail.com wrote:
  Yes, Robert eval is doing the rounding.  How do I fix it?

  On Sep 1, 12:31 pm, Mikie thephantom6...@hotmail.com wrote:

  I have tried SR.  I get a malformed value.  Yes, I understand the
  problem with eval.  Do you have any suggestions on how to get the
  right value into maxima.solve?

  On Sep 1, 11:32 am, Robert Bradshaw rober...@math.washington.edu
  wrote:

  On Tue, 1 Sep 2009, Mikie wrote:

  When I run the server with the function above and the following  
  string
  from a text box I get
  [y=-1,x=0].  The string is [3*x-y-1,x+(1/3)*y]

  It is changing the input value to [3*x-y-1,x]

  1/3 = 0 in Python. Also, I hope you realize how dangerous

  eval(random string someone gave you from the web) is!

  - Robert

  On Sep 1, 10:38 am, Mikie thephantom6...@hotmail.com wrote:
  Sorry, wrong function

  def MSolveSys(syss):
     eqns=eval(syss)
     solns=maxima.solve(eqns)
     return solns

  On Sep 1, 10:31 am, Jason Grout jason-s...@creativetrax.com  
  wrote:

  Robert Bradshaw wrote:
  On Sep 1, 2009, at 9:17 AM, Mikie wrote:

  Here is function I am using to solve systems of linear  
  equations.

  def MSolveSys(syss):
     eqns=eval(syss)
     solns=maxima.solve(syss)
     return solns

  Works great in the notebook, but when I put it in a Python  
  script it
  rounds the coeficients of the variables and thus produces bad
  solutions.

  Perhaps eval here is the culprit. You might have to parse it  
  a bit
  yourself. SR(...) will parse expressions.

  Mikie effectively isn't using eval, right?  That line (and  
  the eqns
  variable) is not being used.

  Jason

  --
  Jason Grout- Hide quoted text -

  - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-02 Thread Robert Bradshaw
On Wed, 2 Sep 2009, Mikie wrote:


 Didn't you create the API using the notebook?

Yes, I created the simple server, but you can think of that more as 
reaching under the html/javascript/jsmath layer and exposing the raw 
computatinal elements themsleves, rather than building on top of that nice 
GUI.

- Robert


 On Sep 1, 10:02 pm, Robert Bradshaw rober...@math.washington.edu
 wrote:
 On Sep 1, 2009, at 12:16 PM, Mikie wrote:

 I took out the eval and for some reason it is working.
 Robert, this is function in my API (AlgCalc)
 http://pirsqrt.com:1843/
 If I would give it to you would you show me how to get JSmath to
 work?  I have talked to you before.  You said you were too busy.  I
 have loaded load.js, but when it goes for another .js file it cannot
 find.

 You're probably thinking about another Robert--I don't know anything  
 about jsmath. What I would do is look for instructions on their site.

 - Robert (Bradshaw)





 On Sep 1, 12:37 pm, Mikie thephantom6...@hotmail.com wrote:
 Yes, Robert eval is doing the rounding.  How do I fix it?

 On Sep 1, 12:31 pm, Mikie thephantom6...@hotmail.com wrote:

 I have tried SR.  I get a malformed value.  Yes, I understand the
 problem with eval.  Do you have any suggestions on how to get the
 right value into maxima.solve?

 On Sep 1, 11:32 am, Robert Bradshaw rober...@math.washington.edu
 wrote:

 On Tue, 1 Sep 2009, Mikie wrote:

 When I run the server with the function above and the following  
 string
 from a text box I get
 [y=-1,x=0].  The string is [3*x-y-1,x+(1/3)*y]

 It is changing the input value to [3*x-y-1,x]

 1/3 = 0 in Python. Also, I hope you realize how dangerous

 eval(random string someone gave you from the web) is!

 - Robert

 On Sep 1, 10:38 am, Mikie thephantom6...@hotmail.com wrote:
 Sorry, wrong function

 def MSolveSys(syss):
    eqns=eval(syss)
    solns=maxima.solve(eqns)
    return solns

 On Sep 1, 10:31 am, Jason Grout jason-s...@creativetrax.com  
 wrote:

 Robert Bradshaw wrote:
 On Sep 1, 2009, at 9:17 AM, Mikie wrote:

 Here is function I am using to solve systems of linear  
 equations.

 def MSolveSys(syss):
    eqns=eval(syss)
    solns=maxima.solve(syss)
    return solns

 Works great in the notebook, but when I put it in a Python  
 script it
 rounds the coeficients of the variables and thus produces bad
 solutions.

 Perhaps eval here is the culprit. You might have to parse it  
 a bit
 yourself. SR(...) will parse expressions.

 Mikie effectively isn't using eval, right?  That line (and  
 the eqns
 variable) is not being used.

 Jason

 --
 Jason Grout- Hide quoted text -

 - Show quoted text -- Hide quoted text -

 - Show quoted text -- Hide quoted text -

 - Show quoted text -- Hide quoted text -

 - Show quoted text -- Hide quoted text -

 - Show quoted text -- Hide quoted text -

 - Show quoted text -
 

--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Robert Bradshaw

On Sep 1, 2009, at 9:17 AM, Mikie wrote:


 Here is function I am using to solve systems of linear equations.

 def MSolveSys(syss):
eqns=eval(syss)
solns=maxima.solve(syss)
return solns

 Works great in the notebook, but when I put it in a Python script it
 rounds the coeficients of the variables and thus produces bad
 solutions.

Perhaps eval here is the culprit. You might have to parse it a bit  
yourself. SR(...) will parse expressions.

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



[sage-support] Re: Maxima Solve sys

2009-09-01 Thread Jason Grout

Mikie wrote:
 Here is function I am using to solve systems of linear equations.
 
 def MSolveSys(syss):
eqns=eval(syss)
solns=maxima.solve(syss)
return solns
 
 Works great in the notebook, but when I put it in a Python script it
 rounds the coeficients of the variables and thus produces bad
 solutions.
 
 Is it possible to fix it?


Can you post a complete example (with the equations you are using and
the call to MSolveSys) that we can paste into our sage session to see
this problem?

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



[sage-support] Re: Maxima Solve sys

2009-09-01 Thread Jason Grout

Robert Bradshaw wrote:
 On Sep 1, 2009, at 9:17 AM, Mikie wrote:
 
 Here is function I am using to solve systems of linear equations.

 def MSolveSys(syss):
eqns=eval(syss)
solns=maxima.solve(syss)
return solns

 Works great in the notebook, but when I put it in a Python script it
 rounds the coeficients of the variables and thus produces bad
 solutions.
 
 Perhaps eval here is the culprit. You might have to parse it a bit  
 yourself. SR(...) will parse expressions.
 

Mikie effectively isn't using eval, right?  That line (and the eqns 
variable) is not being used.

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



[sage-support] Re: Maxima Solve sys

2009-09-01 Thread Mikie

Sorry, wrong function

def MSolveSys(syss):
   eqns=eval(syss)
   solns=maxima.solve(eqns)
   return solns

On Sep 1, 10:31 am, Jason Grout jason-s...@creativetrax.com wrote:
 Robert Bradshaw wrote:
  On Sep 1, 2009, at 9:17 AM, Mikie wrote:

  Here is function I am using to solve systems of linear equations.

  def MSolveSys(syss):
     eqns=eval(syss)
     solns=maxima.solve(syss)
     return solns

  Works great in the notebook, but when I put it in a Python script it
  rounds the coeficients of the variables and thus produces bad
  solutions.

  Perhaps eval here is the culprit. You might have to parse it a bit  
  yourself. SR(...) will parse expressions.

 Mikie effectively isn't using eval, right?  That line (and the eqns
 variable) is not being used.

 Jason

 --
 Jason Grout- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Mikie

When I run the server with the function above and the following string
from a text box I get
[y=-1,x=0].  The string is [3*x-y-1,x+(1/3)*y]

It is changing the input value to [3*x-y-1,x]

On Sep 1, 10:38 am, Mikie thephantom6...@hotmail.com wrote:
 Sorry, wrong function

 def MSolveSys(syss):
    eqns=eval(syss)
    solns=maxima.solve(eqns)
    return solns

 On Sep 1, 10:31 am, Jason Grout jason-s...@creativetrax.com wrote:



  Robert Bradshaw wrote:
   On Sep 1, 2009, at 9:17 AM, Mikie wrote:

   Here is function I am using to solve systems of linear equations.

   def MSolveSys(syss):
      eqns=eval(syss)
      solns=maxima.solve(syss)
      return solns

   Works great in the notebook, but when I put it in a Python script it
   rounds the coeficients of the variables and thus produces bad
   solutions.

   Perhaps eval here is the culprit. You might have to parse it a bit  
   yourself. SR(...) will parse expressions.

  Mikie effectively isn't using eval, right?  That line (and the eqns
  variable) is not being used.

  Jason

  --
  Jason Grout- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Robert Bradshaw
On Tue, 1 Sep 2009, Mikie wrote:


 When I run the server with the function above and the following string
 from a text box I get
 [y=-1,x=0].  The string is [3*x-y-1,x+(1/3)*y]

 It is changing the input value to [3*x-y-1,x]

1/3 = 0 in Python. Also, I hope you realize how dangerous

eval(random string someone gave you from the web) is!

- Robert


 On Sep 1, 10:38 am, Mikie thephantom6...@hotmail.com wrote:
 Sorry, wrong function

 def MSolveSys(syss):
    eqns=eval(syss)
    solns=maxima.solve(eqns)
    return solns

 On Sep 1, 10:31 am, Jason Grout jason-s...@creativetrax.com wrote:



 Robert Bradshaw wrote:
 On Sep 1, 2009, at 9:17 AM, Mikie wrote:

 Here is function I am using to solve systems of linear equations.

 def MSolveSys(syss):
    eqns=eval(syss)
    solns=maxima.solve(syss)
    return solns

 Works great in the notebook, but when I put it in a Python script it
 rounds the coeficients of the variables and thus produces bad
 solutions.

 Perhaps eval here is the culprit. You might have to parse it a bit  
 yourself. SR(...) will parse expressions.

 Mikie effectively isn't using eval, right?  That line (and the eqns
 variable) is not being used.

 Jason

 --
 Jason Grout- Hide quoted text -

 - Show quoted text -- Hide quoted text -

 - Show quoted text -
 

--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Mikie

I have tried SR.  I get a malformed value.  Yes, I understand the
problem with eval.  Do you have any suggestions on how to get the
right value into maxima.solve?

On Sep 1, 11:32 am, Robert Bradshaw rober...@math.washington.edu
wrote:
 On Tue, 1 Sep 2009, Mikie wrote:

  When I run the server with the function above and the following string
  from a text box I get
  [y=-1,x=0].  The string is [3*x-y-1,x+(1/3)*y]

  It is changing the input value to [3*x-y-1,x]

 1/3 = 0 in Python. Also, I hope you realize how dangerous

 eval(random string someone gave you from the web) is!

 - Robert





  On Sep 1, 10:38 am, Mikie thephantom6...@hotmail.com wrote:
  Sorry, wrong function

  def MSolveSys(syss):
     eqns=eval(syss)
     solns=maxima.solve(eqns)
     return solns

  On Sep 1, 10:31 am, Jason Grout jason-s...@creativetrax.com wrote:

  Robert Bradshaw wrote:
  On Sep 1, 2009, at 9:17 AM, Mikie wrote:

  Here is function I am using to solve systems of linear equations.

  def MSolveSys(syss):
     eqns=eval(syss)
     solns=maxima.solve(syss)
     return solns

  Works great in the notebook, but when I put it in a Python script it
  rounds the coeficients of the variables and thus produces bad
  solutions.

  Perhaps eval here is the culprit. You might have to parse it a bit  
  yourself. SR(...) will parse expressions.

  Mikie effectively isn't using eval, right?  That line (and the eqns
  variable) is not being used.

  Jason

  --
  Jason Grout- Hide quoted text -

  - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Mikie

I took out the eval and for some reason it is working.
Robert, this is function in my API (AlgCalc)
http://pirsqrt.com:1843/
If I would give it to you would you show me how to get JSmath to
work?  I have talked to you before.  You said you were too busy.  I
have loaded load.js, but when it goes for another .js file it cannot
find.

On Sep 1, 12:37 pm, Mikie thephantom6...@hotmail.com wrote:
 Yes, Robert eval is doing the rounding.  How do I fix it?

 On Sep 1, 12:31 pm, Mikie thephantom6...@hotmail.com wrote:



  I have tried SR.  I get a malformed value.  Yes, I understand the
  problem with eval.  Do you have any suggestions on how to get the
  right value into maxima.solve?

  On Sep 1, 11:32 am, Robert Bradshaw rober...@math.washington.edu
  wrote:

   On Tue, 1 Sep 2009, Mikie wrote:

When I run the server with the function above and the following string
from a text box I get
[y=-1,x=0].  The string is [3*x-y-1,x+(1/3)*y]

It is changing the input value to [3*x-y-1,x]

   1/3 = 0 in Python. Also, I hope you realize how dangerous

   eval(random string someone gave you from the web) is!

   - Robert

On Sep 1, 10:38 am, Mikie thephantom6...@hotmail.com wrote:
Sorry, wrong function

def MSolveSys(syss):
   eqns=eval(syss)
   solns=maxima.solve(eqns)
   return solns

On Sep 1, 10:31 am, Jason Grout jason-s...@creativetrax.com wrote:

Robert Bradshaw wrote:
On Sep 1, 2009, at 9:17 AM, Mikie wrote:

Here is function I am using to solve systems of linear equations.

def MSolveSys(syss):
   eqns=eval(syss)
   solns=maxima.solve(syss)
   return solns

Works great in the notebook, but when I put it in a Python script it
rounds the coeficients of the variables and thus produces bad
solutions.

Perhaps eval here is the culprit. You might have to parse it a bit  
yourself. SR(...) will parse expressions.

Mikie effectively isn't using eval, right?  That line (and the 
eqns
variable) is not being used.

Jason

--
Jason Grout- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -- Hide quoted text -

   - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: Maxima Solve sys

2009-09-01 Thread Robert Bradshaw

On Sep 1, 2009, at 12:16 PM, Mikie wrote:

 I took out the eval and for some reason it is working.
 Robert, this is function in my API (AlgCalc)
 http://pirsqrt.com:1843/
 If I would give it to you would you show me how to get JSmath to
 work?  I have talked to you before.  You said you were too busy.  I
 have loaded load.js, but when it goes for another .js file it cannot
 find.

You're probably thinking about another Robert--I don't know anything  
about jsmath. What I would do is look for instructions on their site.

- Robert (Bradshaw)


 On Sep 1, 12:37 pm, Mikie thephantom6...@hotmail.com wrote:
 Yes, Robert eval is doing the rounding.  How do I fix it?

 On Sep 1, 12:31 pm, Mikie thephantom6...@hotmail.com wrote:



 I have tried SR.  I get a malformed value.  Yes, I understand the
 problem with eval.  Do you have any suggestions on how to get the
 right value into maxima.solve?

 On Sep 1, 11:32 am, Robert Bradshaw rober...@math.washington.edu
 wrote:

 On Tue, 1 Sep 2009, Mikie wrote:

 When I run the server with the function above and the following  
 string
 from a text box I get
 [y=-1,x=0].  The string is [3*x-y-1,x+(1/3)*y]

 It is changing the input value to [3*x-y-1,x]

 1/3 = 0 in Python. Also, I hope you realize how dangerous

 eval(random string someone gave you from the web) is!

 - Robert

 On Sep 1, 10:38 am, Mikie thephantom6...@hotmail.com wrote:
 Sorry, wrong function

 def MSolveSys(syss):
eqns=eval(syss)
solns=maxima.solve(eqns)
return solns

 On Sep 1, 10:31 am, Jason Grout jason-s...@creativetrax.com  
 wrote:

 Robert Bradshaw wrote:
 On Sep 1, 2009, at 9:17 AM, Mikie wrote:

 Here is function I am using to solve systems of linear  
 equations.

 def MSolveSys(syss):
eqns=eval(syss)
solns=maxima.solve(syss)
return solns

 Works great in the notebook, but when I put it in a Python  
 script it
 rounds the coeficients of the variables and thus produces bad
 solutions.

 Perhaps eval here is the culprit. You might have to parse it  
 a bit
 yourself. SR(...) will parse expressions.

 Mikie effectively isn't using eval, right?  That line (and  
 the eqns
 variable) is not being used.

 Jason

 --
 Jason Grout- Hide quoted text -

 - Show quoted text -- Hide quoted text -

 - Show quoted text -- Hide quoted text -

 - Show quoted text -- Hide quoted text -

 - Show quoted text -- Hide quoted text -

 - Show quoted text -
 


--~--~-~--~~~---~--~~
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: Maxima not able to multiply functions with complex numbers

2009-03-11 Thread Simon King

Dear Mani chandra,

something really weird seems to be going on. This is a fresh session
of Sage 3.3:

sage: complex(0,1)*spherical_bessel_J(1,1)
---
TypeError Traceback (most recent call
last)

/home/king/.sage/temp/mpc739/24191/_home_king__sage_init_sage_0.py in
module()

/home/king/SAGE/devel/sage-3.2.3/local/lib/python2.5/site-packages/
sage/structure/element.so in
sage.structure.element.RingElement.__mul__ (sage/structure/element.c:
8632)()

/home/king/SAGE/devel/sage-3.2.3/local/lib/python2.5/site-packages/
sage/structure/coerce.so in
sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/
coerce.c:5847)()

TypeError: unsupported operand parent(s) for '*': 'type 'complex''
and 'Symbolic Ring'
sage: complex(0,1)*spherical_bessel_J(1,1)
1.0*(sin(1) - cos(1))*I



In other words, calling complex(0,1)*spherical_bessel_J(1,1) for the
first time yields a bug. Calling it the second time yields a result.

Do people agree that this is a bug? Shall I open a ticket?


I guess that, as a work-around, you should consider using a different
implementation of the complex unit in Sage.
There are (at least):
 * complex(0,1), which AFAIK is a Python builtin
 * I, which belongs to the Symbolic Ring:
sage: I^2
-1
sage: I.parent()
Symbolic Ring
 * The imaginary unit in the complex double field:
sage: CDF(0,1)
1.0*I
sage: CDF(0,1)^2
-1.0 + 1.22464679915e-16*I
As you can see, CDF is numeric with the usual errors of numerical data
types.

Since spherical_bessel_J lives in the Symbolic world, i guess that
using I would work around the error.

Cheers,
   Simon
--~--~-~--~~~---~--~~
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: Maxima not able to multiply functions with complex numbers

2009-03-11 Thread Robert Bradshaw


On Mar 11, 2009, at 4:56 AM, Mani chandra wrote:


 Hi,

 The following function gives me an error.

  def test(l, r):
return complex(0, 1)**l*spherical_bessel_J(l, r)

[...]


 TypeError: unsupported operand parent(s) for '*': 'type  
 'complex'' and
 'Symbolic Ring'


 Help appreciated. Thank you

This was fixed in http://trac.sagemath.org/sage_trac/ticket/5423 . E.g.

sage: complex(3,1) * SR(I)
I*(1.0*I + 3.0)

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



[sage-support] Re: Maxima requested additional constraints in solve()

2007-06-12 Thread Ted Kosan

On 6/9/07, William Stein [EMAIL PROTECTED] wrote:

 QUESTION:  What notation in SAGE would you like for assuming
 that n is an integer?  Would this be OK?

 {{{
 assume(n, ZZ)
 }}}

 This would just call
   calcmaxima.eval('declare(n,integer)')

 {{{
 forget()
 }}}

I have been thinking about this for the past few days and I cannot
think of a better notation than the one you have presented here.

Thanks :-)

Ted

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



[sage-support] Re: Maxima requested additional constraints in solve()

2007-06-09 Thread William Stein

On 6/9/07, Ted Kosan [EMAIL PROTECTED] wrote:
 When I use the solve() function with this code:

 var('r2')
 c = P*e^(r*n)
 d = P*(1+r2)^n
 solve(c==d,r2)

 I receive the following exception:
...
 TypeError: Computation failed since Maxima requested additional
 constraints (use assume):
 Is n an integer?
 

 Does anyone have any thoughts on ways to fix this problem?

 Thanks in advance :-)

SAGE has an assume command for this purpose, but unfortunately
so far we've only implemented assuming inequalities.   However,
if you type the following you can directly tell maxima that n is an integer
and solve the above (this is how we'll implement assume n is an integer
in SAGE):


{{{
from sage.calculus.calculus import maxima as calcmaxima
calcmaxima.eval('declare(n,integer)')

var('r2')
c = P*e^(r*n)
d = P*(1+r2)^n
solve(c==d,r2)
///
[r2 == (e^r - 1)]
}}}

QUESTION:  What notation in SAGE would you like for assuming
that n is an integer?  Would this be OK?

{{{
assume(n, ZZ)
}}}

This would just call
  calcmaxima.eval('declare(n,integer)')

{{{
forget()
}}}

would then forget that assumption, etc.

It would be more natural to write assume(n in ZZ), but this won't work,
since n in ZZ gets evaluated to false be Python before it gets passed
to the assume command.

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



[sage-support] Re: Maxima requested additional constraints in solve()

2007-06-09 Thread William Stein

On 6/9/07, Joel B. Mohler [EMAIL PROTECTED] wrote:
 On Saturday 09 June 2007 13:16, William Stein wrote:
  It would be more natural to write assume(n in ZZ), but this won't work,
  since n in ZZ gets evaluated to false be Python before it gets passed
  to the assume command.

 This was exactly what I tried when the original e-mail was sent out and
 realized that it was immediately evaluated.  I write this so people don't get
 the same erroneous idea that I had.  I assumed that you could redefine
 __contains__ to return a symbolic constraint just like was done with the
 __ge__ and similar operators.  But you can't and here's why:

  Here's box.py
 class Test:
 pass

 class Box:
 def __contains__(self, x):
 return Test()
 

 sage: import box
 sage: type(n)
 class 'sage.calculus.calculus.SymbolicVariable'
 sage: t = box.Box()
 sage: n in t
 True
 sage: t.__contains__(n)
 box.Test instance at 0xaf45688c

 That's really pathetic that the 'in' operator always coerces stuff to a
 boolean.  It seems like a useless feature to me and (IMO) is a bug or
 mis-feature in python.

There is probably a *lot* more behind that design choice that you know,
especially from the point of view of efficiency.   In any case, it's the way
it is; I'm glad you posted the above example since I didn't know that.

I do not think
   assume(n, ZZ)
is that confusing or hard to use if it is very clearly documented with
examples in the assume command?  What do you think?

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



[sage-support] Re: Maxima (hence calculus) issues

2007-06-04 Thread William Stein

On 6/4/07, Brandon Weeks [EMAIL PROTECTED] wrote:

 I had this same problem on a Intel Mac (Macbook), running 10.4.9.


(1) I've put the relevant files for intel here:

  http://sage.math.washington.edu/home/was/tmp/libintl/

Put them in SAGE_ROOT/local/lib/

(2) I've changed the clisp package in SAGE to build
--without-libintl, so hopefully this problem won't
happen in the future.

(3) I've put the libintl libraries in my
SAGE_ROOT/local/lib/ for my binary build,
just in case, and will post a new binary when
it's done building.

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



[sage-support] Re: Maxima (hence calculus) issues

2007-05-23 Thread kcrisman

Sorry  - Google groups told me to try again.


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



[sage-support] Re: Maxima (hence calculus) issues

2007-05-23 Thread William Stein

On 5/23/07, kcrisman [EMAIL PROTECTED] wrote:


  Please start SAGE, type
sage: !maxima
  then send the output.
 

 sage: !maxima
 dyld: Library not loaded: /usr/local/lib/libintl.3.dylib
   Referenced from: /Applications/sage-2.5.3-powerpc-osx-PowerMacintosh-
 Darwin/local/lib/maxima/5.12.0/binary-clisp/lisp.run
   Reason: image not found


Now I understand what is happening.  I don't own a PPC OS X machine,
so I have to build everything on an account on some random very
non-minimally configured PPC machine.  Evidently it now has
some library -- libintl.3.dylib, which the Maxima build is picking up.
Your options include:
   (1) Try putting the libintl files from
   http://sage.math.washington.edu/home/was/tmp/libintl/
in /usr/local/lib/ on computer or in SAGE_ROOT/local/lib/,
and let me know what happens, or
   (2) Wait until I either get a PPC OS X machine (which is something
   I have no big desire to do), or
   (3) Build SAGE from source yourself.  Just get xcode, extract the
SAGE tarball, type make, and wait.



 I get the same message when I try to run the Sage maxima directly from
 the shell.

 This makes a little sense, since the contents of my /usr/local/lib
 directory is

 libhistory.5.0.dyliblibhistory.alynx
 libhistory.5.dylib  libhistory.dyliblynx.cfg

 which doesn't include this file.  But then the question arises, why
 did Maxima (and its functions) work before (as well as, where do I get
 libintl.3.dylib)?

 I suspect that there is something related in the following issue.
 Typing divisors?? works fine, typing plot? works fine, but when I try

 plot??

 I get a long error message (relevant parts below).  Then when I retry
 divisors??, I get a very similar error message.
 In both cases it seems like there is a call to a 'NoneType' object
 when trying to call a definition, and it propogates somehow.  Could I
 be missing a library or other file for this too, which then makes an
 object go missing?  I have never been able to run plot?? properly, in
 any version of Sage, unfortunately, though this error is new.

 I'll also mention that I get a similar library missing message,
 looking for a file in /Users/was/, which I definitely will never have,
 when I try to run gp directly from the shell:

 dyld: Library not loaded: /Users/was/sage-2.5.rc2/local/lib/
 libreadline.5.2.dylib
   Referenced from: /Applications/sage-2.5.3-powerpc-osx-PowerMacintosh-
 Darwin/local/bin/gp
   Reason: image not found
 Trace/BPT trap

 Thanks and I hope this helps in development, as well as (potential)
 use in calculus this fall.

 Error getting source: arg is not a module, class, method, function,
 traceback, frame, or code object
 ---
 type 'exceptions.TypeError' Traceback (most recent call
 last)
 and ending with 483 else:
 -- 484 out.write(header('Call def:\t')
 +self.format(call_def))
 485 call_ds = getdoc(obj.__call__)
 486 if call_ds:

 type 'exceptions.TypeError': cannot concatenate 'str' and 'NoneType'
 objects]
 divisors?? [same type of error message
 411 if defln:
 -- 412 out.write(header('Definition:\t')
 +self.format(defln))
 413
 414 # Docstrings only in detail 0 mode, since source
 contains them (we

 type 'exceptions.TypeError': cannot concatenate 'str' and 'NoneType'
 objects]


 



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://www.williamstein.org

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



[sage-support] Re: maxima fails on OS X

2006-12-25 Thread Comeon Fhqwhgads


Justin C. Walker wrote:

1) what sage version?


1.5.0.2


2) did you install or upgrade to get to this version?


I installed, which is to say I downloaded the above-mentioned tarball
and unpacked it.


3) look in 'install.log' and see what the result of the maxima
installation really was (it precedes genus2reduction-0.3 for sage
1.5).  Find the 'sage-spkg' line for maxima, and then find the next
'sage-spkg' line.  The stuff preceding this latter line should tell
you what happened to maxima.


At this point I'm confused because the tarball was advertised as a
pre-built binary for OS X.  All the instructions at
http://sage.math.washington.edu/SAGEbin/apple_osx/ (which seems to be
offline now) mention are unpacking the tarball, and sage itself does
work without running the makefile.  So there was no install.log to
speak of.

In the interest of getting an install.log, I ran the makefile, but it
crapped out at a not very interesting part, since
sage.math.washington.edu is offiline:

beginning excerpt of install.log
Deleting directories from past builds of previous/current versions of
sage-1.5.0.2
Extracting package
/Users/ageller/Documents/school/sage-1.5.0.2-PowerMacintosh-Darwin/spkg/standard/sage-1.5.0.2.spkg
...
-rw-r--r--1 ageller  ageller   107 Dec 14 10:56
/Users/ageller/Documents/school/sage-1.5.0.2-PowerMacintosh-
Darwin/spkg/standard/sage-1.5.0.2.spkg
Finished extraction
sage: After decompressing the directory sage-1.5.0.2 does not exist
This means that the corresponding .spkg needs to be downloaded
again.
http://sage.math.washington.edu/sage//packages/optional/sage-1.5.0.2.spkg
-- sage-1.5.0.2.spkg
...
IOError: [Errno socket error] (65, 'No route to host')
/Users/ageller/Documents/school/sage-1.5.0.2-PowerMacintosh-Darwin/spkg/build
bunzip2: Can't open input file sage-1.5.0.2.spkg: No such file or
directory.
tar: sage-1.5.0.2.spkg: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
end of excerpt

In short, I'm very confused about what is included in the
sage-1.5.0.2-PowerMacintosh-Darwin.tar.gz tarball, and what one needs
to do with it once one has it.

Thanks alot for your time and help.

Aaron


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



[sage-support] Re: maxima fails on OS X

2006-12-25 Thread Justin C. Walker



On Dec 25, 2006, at 10:30 , Comeon Fhqwhgads wrote:



Justin C. Walker wrote:

1) what sage version?


1.5.0.2


Hmmm...




2) did you install or upgrade to get to this version?


I installed, which is to say I downloaded the above-mentioned tarball
and unpacked it.


Ah!  You used a binary installation, not a 'build from scratch'  
version.  I've not used the former, and it appears that access to the  
binaries is on hold, pending William's return next year (so I can't  
double-check what that looks like).


In the meantime, if you have the space, go to a temp directory and  
unpack the 1.5.0.2 tarball again, and see whether 'maxima' shows up  
in the directory 'local/bin'.  Also, verify that the unpacking  
proceeds without error.



At this point I'm confused because the tarball was advertised as a
pre-built binary for OS X.  All the instructions at
http://sage.math.washington.edu/SAGEbin/apple_osx/ (which seems to be
offline now) mention are unpacking the tarball, and sage itself does
work without running the makefile.  So there was no install.log to
speak of.


You have a right to be confused, since I confused you (more evidence  
of my effectiveness).



In the interest of getting an install.log, I ran the makefile, but it


That won't work, for several reasons.  The most immediate is the one  
you found (sage.math is dead).  The other is that the tarball you  
started with is not the one I thought you had.


You can (if you are up for new adventures!) fetch the source from a  
sage mirror:

   http://sage.scipy.org/sage/download.html
Get 1.5.1.2 if you try this.

Once you unpack the source tarball (which creates the directory  
'sage-1.5.1.2' in your current working directory), change to the new  
directory and *then* invoke 'make'.  It should build everything from  
scratch with no problems (all pieces are included in the tarball).


Justin

--
Justin C. Walker, Curmudgeon at Large
Institute for the Absorption of Federal Funds
---
I'm beginning to like the cut of his jibberish.
---




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