[melbourne-pug] functionality of Sage demo

NevilleDNZ NevilleD.python at sgr-a.net
Mon Jul 2 10:59:44 CEST 2007


Good to meet you all....


Tennessee Leeuwenburg-3 wrote:
> 
> It was pretty informal, but Neville demonstrated some of the functionality
> of Sage to a few of us...
> 

Apologies to anyone who got indigestion,  below is a cut an paste of the
demo...

As a python user I consider SAGE to be python with a warped sense of humor.

SAGE is a computer algebra system written in Python...  Once the equations
are solved, C-code can be emitted. 

I guess the best business application for SAGE is in optimising some process
in an organisation, either squeezing 3% saving from nowhere, our getting you
head around square-peg/round-hole problems.

Cheers
NevilleD

Here is the demo:

BEGINNING OF DEMO:
 ./sage
----------------------------------------------------------------------
| SAGE Version 2.4, Release Date: 2007-03-25 
| Type notebook() for the GUI, and license() for information. 
----------------------------------------------------------------------
>>> print [ i*i for i in range(10)]
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
>>> x=1.1
>>> y=2.3
>>> x+y
3.40000000000000

## SEE, it is python!! except....
>>> type(x+y)
<type 'sage.rings.real_mpfr.RealNumber'>

## Hmm...

## How about:
>>> x=1/2
>>> y=1/3
>>> x+y
5/6

## OK, lets see if it really knows what a REAL number is!!

>>> type(x+y)
<type 'sage.rings.rational.Rational'>

## Maybe that is actually rational.


OK... Can it handle algebra?

>>>  F.<x,y,z> = FreeAlgebra(GF(7),3) # a class?
>>> x=sin(z)
>>> y=1+cos(z)^2
>>> x+y
(sin(z) + (1 + (cos(z)^2)))

>>> type(x+y)
<class 'sage.functions.functions.Function_arith'>

## but can we integrate this?

>>> integral(x+y,z)
(sin(2*z)/2 + z)/2 - cos(z) + z

OK... at this point I have maxed out my high-school math... lucky I did some
more at Uni.

END OF DEMO

ps. it also can generate rather nice graphs.
http://en.wikipedia.org/wiki/Image:Sagescreenshotbluehat.jpg
http://en.wikipedia.org/wiki/Software_for_Algebra_and_Geometry_Experimentation
-- 
View this message in context: http://www.nabble.com/re%3A-functionality-of-Sage-demo-tf4011028.html#a11390718
Sent from the Python - melbourne-pug mailing list archive at Nabble.com.



More information about the melbourne-pug mailing list