axiom-math
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-math] Re: [fricas-devel] A presentation of Axiom-s


From: Martin Rubey
Subject: [Axiom-math] Re: [fricas-devel] A presentation of Axiom-s
Date: 14 Apr 2008 10:17:43 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Francois Maltey <address@hidden> writes:

> Hello,
> 
> I'll present Axiom to some mathematical teachers in undergraduate the 
> next month.

Do you happen to know the topics they like?

> So I'm writing/looking for slides for about 20 or 30 minutes. I discover 
> beamer.
> Do you know/see where I can find any ideas ?

I used the following input file for a demonstration for students, using fricas
though.  It runs well in gnu emacs, using my axiom mode, setting 
--text follows this line--
Francois Maltey <address@hidden> writes:

> Hello,
> 
> I'll present Axiom to some mathematical teachers in undergraduate the 
> next month.

Do you happen to know the topics they like?

> So I'm writing/looking for slides for about 20 or 30 minutes. I discover 
> beamer.
> Do you know/see where I can find any ideas ?

I used the following input file for a demonstration for students, using fricas
though.  It runs well in gnu emacs, using my axiom mode, setting font to
courier 14.  (the huge amounts of space are used so that pressing space shifts
the next example to the top line.)

I would strongly advise you to give a presentation that actually uses axiom
(life!).  It probably makes sense to point out some of the strengths of axiom,
in comparison with, say, Maple.  (mainly integration and Taylor series)

Finally, it probably makes sense to show off some "fun stuff".  I used the
guessing package for that purpose.  I attach some interesting sequences.  Don't
hesitate to ask for their meaning.

Martin


-------------------------------------------------------------------------------

)clear completely
pause() == systemCommand "sys echo -n _"(0) -> _"; read void"
mma(cmds: List String): Void == 
    cmd := reduce((a,b) +-> a "\n" b, cmds)
    systemCommand("sys echo -e '" cmd "' | math6")
mma [""]
pause()


















--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--
-- axiom im PC Labor starten:
--
--     boote Linux
--     drücke ALT-F2, 
--     tippe eaxiom und drücke Enter
--
--     zwei Fenster sollten erscheinen: 
--         ein weißes mit Titel HyperDoc
--         eines mit Titel emacs21
--
--     tippe in das emacs21 Fenster 1+1 und drücke Enter
--
-- mehr Info:
--
--     axiom-wiki.new-synthesis.org
--     address@hidden
--     address@hidden
--
--
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%








pause()









--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--                    Matrizen und Vektoren
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pause()
-- Wir wollen mit 2x2 Matrizen spielen:

SM2 ==> SquareMatrix(2, Fraction Polynomial Integer)
pause()
-- erzeuge eine Matrix:

M := [[a, b], [c, d]]::SM2

pause()
-- wie werden Matrizen multipliziert?

M*M

M^2
pause()
-- in Mathematica muß man aufpassen:

mma ["{{a,b}, {c, d}}*{{a,b}, {c, d}}//MatrixForm",  _
     "{{a,b}, {c, d}}.{{a,b}, {c, d}}//MatrixForm" , _
     "{{a,b}, {c, d}}^2//MatrixForm",                _
     "MatrixPower[{{a,b}, {c, d}}, 2]//MatrixForm"]
pause()
-- wir können mit Polynomen über quadratischen Matrizen spielen!
-- Definieren wir zunächst ein Polynom:

poly := (x^2 - (a+d)*x + a*d - b*c)::UnivariatePolynomial(x, SM2)

pause()
-- jetzt können wir auch eine Matrix einsetzen:

poly M

pause()
-- in Mathematica muß man aufpassen:

mma ["M := {{a,b}, {c, d}}",   _
     "poly := x^2 - (a+d)*x + a*d - b*c",  _
     "poly/.x->M"]
pause()
-- wenn die Determinante einer Matrix nicht 0 ist, 
-- kann man die Matrix invertieren:

SM3 ==> SquareMatrix(3, Fraction Integer)
M := [[1, 2, 4],[1, 3, 9], [1, 4, 16]]::SM3
determinant M
pause()
M^-1
pause()






--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--               axiom kann schöne Bilder malen
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

-- Legen wir eine Tangentialebene an eine Oberfläche!
-- Dazu brauchen wir ein Hilfsmittel - die totale Ableitung:
-- Das ist einfach der Vektor, in dem die Ableitungen nach den 
-- verschiedenen Variablen stehen:

-- totale Ableitung

totalD f == vector [D(f, v) for v in variables f];

-- Die Tangentialebene durch einen Punkt (x0, y0) in der Form 
-- f(x,y)=0 erhalten wir so: <Df(x0,y0),(x-x0, y-y0)> - f(x0,y0)

TangentialEbene(f, punkt) == 
      X: Vector Polynomial Integer := vector variables f
      X0 := eval(X, punkt)

      dot(eval(totalD f, punkt), X-X0) - eval(f, punkt)

pause()
-- Wir betrachten die Funktion (x,y) +-> x^2*y^3
-- und wollen die Tangentialebene an den Punkt x=1, y=-1 legen:

f := x^2*y^3
t := TangentialEbene(f, [x=1, y=-1])

pause()
-- Und jetzt schauen wir, ob wir richtig gerechnet haben...

color1(x,y,z)==0; color2(x,y,z)==z; sp := createThreeSpace();

v1 := draw(f, x=-2..2, y=-2..2, space==sp, colorFunction==color1)
v2 := draw(t, x=0.5..1.5, y=-1.5..-0.5, _
           space==sp, colorFunction==color2, style=="solid")
close v1; 

pause()






--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--                        Taylorreihen
--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

-- Axiom kann hervorragend mit Taylorreihen rechnen.  Wie in 
-- Mathematica kann man Taylorreihen mit dem Befehl 'series' 
-- erhalten.  ZB. können wir den Sinus um 0 entwickeln:

s := series(sin x, x=0)

pause()
-- es ist ganz leicht, den Koeffizienten von x^99 zu erhalten:

coefficient(s, 99)

pause()
-- in Mathematica muß man da sehr aufpassen:

mma ["s = Series[Sin[x], {x, 0, 10}]", _
     "Coefficient[s, x, 99]"]

pause()
-- Das beste ist aber: mit Taylorreihen kann man richtig rechnen!
-- Fangen wir mit einer ganz einfachen Taylorreihe an - 
-- dem Monom x:

r := x::UnivariateTaylorSeries(Fraction Integer, x, 0)

-- Was ist wohl der Sinus dieser Taylorreihe?
pause()
sin r
pause()
-- Und davon der Cosinus?
pause()
cos sin r

pause()
-- oder:

(cos r)^2 + (sin r)^2

pause()
-- Integrieren und differenzieren kann man Taylorreihen natürlich
-- auch:

D cos r

integrate cos r

-------------------------------------------------------------------------------
-- end of presentation
-------------------------------------------------------------------------------

SSOLVE ==> EXPRSOL(INT, EXPR INT, UFPS EXPR INT, UFPS SUPEXPR EXPR INT)
-- guessRat
-- squares
l1 := [0,1,4,9];
-- something with a pole
l1a := [3, 4, 7/2, 18/5, 11/3, 26/7];

-- guessPade
-- Fibonacci
l2 := [1,1,2,3,5];
-- guessPRec
-- Central binomial coefficients
l3 := [1,2,6,20,70,252,924];
-- guessHolo
-- coefficients of sin x
l4 := [0,1,0,-1/6,0,1/120];
-- guessADE  (GFUN cannot do this)
-- n^n/factorial n
l5 := [1,1,2,9/2,32/3,625/24,324/5];
-- Bell numbers / n!
l5a :=  [1, 1, 1, 5/6, 5/8, 13/30, 203/720, 877/5040, 23/224, _
    1007/17280, 4639/145152, 22619/1330560, 4213597/479001600];
-- guess a la Christian ou Robbins (GFUN cannot do this)
-- guess(l6, [guessRat], [guessProduct])
-- number of alternating sign matrices
l6 := [1,1,2,7,42,429,7436,218348];
-- guess a la Christian extended (only this package can do this)
-- guess(l7, [guessRat], [guessProduct, guessSum])
-- sum_k k!
l7 := [0,1,3,9,33];
-- guess an Abelian term (only this package can do this)
-- guessExpRat l8
-- n (n+2)^n
l8 := [0,3,32,375,5184];
-- guess a binomial term
-- guessBinRat l9
-- Fusz-Catalan numbers
l9 := [1,1,k+1,(3*k*k+5*k+2)/2,(8*k**3+18*k*k+13*k+3)/3];
-- guess q
-- guessADE(q)(l10, maxPower==2)
-- Carlitz q-Catalan numbers
l10 := [1, 1, q+1, q**3+q*q+2*q+1, q**6+q**5+2*q**4+3*q**3+3*q*q+3*q+1, _
        q**10+q**9+2*q**8+3*q**7+5*q**6+5*q**5+7*q**4+7*q**3+6*q*q+4*q+1];

-- solve a strange differential equation:
G := operator 'G;
eq := D(G x, x)-exp(-G(-x));

doit == (s := seriesSolve(eq, G, x, [log 2])$SSOLVE; entries complete 
first(rest coefficients(series(log(1+exp x), x=0)::UTS(EXPR INT, x, 0)), 
40)::List FRAC INT)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]