login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for ScreenShots revision 13 of 13

1 2 3 4 5 6 7 8 9 10 11 12 13
Editor: test1
Time: 2020/11/19 17:04:52 GMT+0
Note:

changed:
-A short demonstration of Axiom
-
-  An important thing: all objects in Axiom have a <em>type</em>.  This enables us to give a simple demonstration of the Cayley-Hamilton theorem. 
-
-Let n equal 4. The semicolon at the end of the input tells Axiom not to display the result.  Thus, only its type is shown:
A short demonstration

  An important thing: all objects in FriCAS have a <em>type</em>.  This enables us to give a simple demonstration of the Cayley-Hamilton theorem. 

Let n equal 4. The semicolon at the end of the input tells FriCAS not to display the result.  Thus, only its type is shown:

changed:
-Finally we evaluate this polynomial with the original matrix as argument.  In Axiom you do not need to use parenthesis if the function takes only one argument:
Finally we evaluate this polynomial with the original matrix as argument.  In FriCAS you do not need to use parenthesis if the function takes only one argument:

changed:
-Some matrix computations under <a href="http://texmacs.org/">OldTeXmacs</a>.
Some matrix computations under <a href="http://texmacs.org/">TeXmacs</a> (this is old screenshot from Axiom era).


changed:
-Notice the hierarchical editing capabilities of OldTeXmacs.
Notice the hierarchical editing capabilities of TeXmacs (again this is old screenshot from Axiom era).

added:


changed:
-Word := OrderedFreeMonoid(Symbol)
Word := FreeMonoid(Symbol)

A short demonstration

An important thing: all objects in FriCAS have a type. This enables us to give a simple demonstration of the Cayley-Hamilton theorem.

Let n equal 4. The semicolon at the end of the input tells FriCAS not to display the result. Thus, only its type is shown:

fricas
(1) -> n := 4;
Type: PositiveInteger?

We define an abbreviation: let SM be the ring of quadratic n\times n matrices with rational functions as entries:

fricas
SM ==> SquareMatrix(n, FRAC POLY INT)
Type: Void

Let M be a generic 4 \times 4 matrix:

fricas
M: SM := matrix [[a[i,j] for j in 1..n] for i in 1..n]

\label{eq1}\left[ 
\begin{array}{cccc}
{a_{1, \: 1}}&{a_{1, \: 2}}&{a_{1, \: 3}}&{a_{1, \: 4}}
\
{a_{2, \: 1}}&{a_{2, \: 2}}&{a_{2, \: 3}}&{a_{2, \: 4}}
\
{a_{3, \: 1}}&{a_{3, \: 2}}&{a_{3, \: 3}}&{a_{3, \: 4}}
\
{a_{4, \: 1}}&{a_{4, \: 2}}&{a_{4, \: 3}}&{a_{4, \: 4}}
(1)
Type: SquareMatrix?(4,Fraction(Polynomial(Integer)))

Compute the characteristis polynomial of 'M':

fricas
P := determinant (M - x * 1);
Type: Fraction(Polynomial(Integer))

We now interpret P as univariate polynomial in x, coefficients being from the 4 \times 4 matrices. The double colon performs this coercion:

fricas
Q := P::UP(x, SM);
Type: UnivariatePolynomial(x,SquareMatrix?(4,Fraction(Polynomial(Integer))))

Finally we evaluate this polynomial with the original matrix as argument. In FriCAS you do not need to use parenthesis if the function takes only one argument:

fricas
Q M

\label{eq2}\left[ 
\begin{array}{cccc}
0 & 0 & 0 & 0 
\
0 & 0 & 0 & 0 
\
0 & 0 & 0 & 0 
\
0 & 0 & 0 & 0 
(2)
Type: SquareMatrix?(4,Fraction(Polynomial(Integer)))

Some matrix computations under TeXmacs (this is old screenshot from Axiom era).

Notice the hierarchical editing capabilities of TeXmacs (again this is old screenshot from Axiom era).

Some more complicated computations:

fricas
)cl all
All user variables and function definitions have been cleared. Word := FreeMonoid(Symbol)

\label{eq3}\hbox{\axiomType{FreeMonoid}\ } \left({\hbox{\axiomType{Symbol}\ }}\right)(3)
Type: Type
fricas
poly:= XPR(Integer,Word)

\label{eq4}\hbox{\axiomType{XPolynomialRing}\ } \left({\hbox{\axiomType{Integer}\ } , \:{\hbox{\axiomType{FreeMonoid}\ } \left({\hbox{\axiomType{Symbol}\ }}\right)}}\right)(4)
Type: Type
fricas
p:poly := 2 * x - 3 * y + 1

\label{eq5}1 +{2 \  x}-{3 \  y}(5)
Type: XPolynomialRing?(Integer,FreeMonoid(Symbol))
fricas
q:poly := 2 * x + 1

\label{eq6}1 +{2 \  x}(6)
Type: XPolynomialRing?(Integer,FreeMonoid(Symbol))
fricas
p + q

\label{eq7}2 +{4 \  x}-{3 \  y}(7)
Type: XPolynomialRing?(Integer,FreeMonoid(Symbol))
fricas
p * q

\label{eq8}1 +{4 \  x}-{3 \  y}+{4 \ {{x}^{2}}}-{6 \  y \  x}(8)
Type: XPolynomialRing?(Integer,FreeMonoid(Symbol))
fricas
(p +q)^2 -p^2 -q^2 - 2*p*q

\label{eq9}-{6 \  x \  y}+{6 \  y \  x}(9)
Type: XPolynomialRing?(Integer,FreeMonoid(Symbol))
fricas
M := SquareMatrix(2,Fraction Integer)

\label{eq10}\hbox{\axiomType{SquareMatrix}\ } \left({2, \:{\hbox{\axiomType{Fraction}\ } \left({\hbox{\axiomType{Integer}\ }}\right)}}\right)(10)
Type: Type
fricas
poly1:= XPR(M,Word)

\label{eq11}\hbox{\axiomType{XPolynomialRing}\ } \left({{\hbox{\axiomType{SquareMatrix}\ } \left({2, \:{\hbox{\axiomType{Fraction}\ } \left({\hbox{\axiomType{Integer}\ }}\right)}}\right)}, \:{\hbox{\axiomType{FreeMonoid}\ } \left({\hbox{\axiomType{Symbol}\ }}\right)}}\right)(11)
Type: Type
fricas
m1:M := matrix [[i*j^2 for i in 1..2] for j in 1..2]

\label{eq12}\left[ 
\begin{array}{cc}
1 & 2 
\
4 & 8 
(12)
Type: SquareMatrix?(2,Fraction(Integer))
fricas
m2:M := m1 - 5/4

\label{eq13}\left[ 
\begin{array}{cc}
-{\frac{1}{4}}& 2 
\
4 &{\frac{27}{4}}
(13)
Type: SquareMatrix?(2,Fraction(Integer))
fricas
m3: M := m2^2

\label{eq14}\left[ 
\begin{array}{cc}
{\frac{129}{16}}&{13}
\
{26}&{\frac{857}{16}}
(14)
Type: SquareMatrix?(2,Fraction(Integer))
fricas
pm:poly1   := m1*x + m2*y + m3*z - 2/3

\label{eq15}\begin{array}{@{}l}
\displaystyle
{\left[ 
\begin{array}{cc}
-{\frac{2}{3}}& 0 
\
0 & -{\frac{2}{3}}
(15)
Type: XPolynomialRing?(SquareMatrix?(2,Fraction(Integer)),FreeMonoid(Symbol))
fricas
qm:poly1 := pm - m1*x

\label{eq16}\begin{array}{@{}l}
\displaystyle
{\left[ 
\begin{array}{cc}
-{\frac{2}{3}}& 0 
\
0 & -{\frac{2}{3}}
(16)
Type: XPolynomialRing?(SquareMatrix?(2,Fraction(Integer)),FreeMonoid(Symbol))
fricas
qm^3

\label{eq17}\begin{array}{@{}l}
\displaystyle
{\left[ 
\begin{array}{cc}
-{\frac{8}{27}}& 0 
\
0 & -{\frac{8}{27}}
(17)
Type: XPolynomialRing?(SquareMatrix?(2,Fraction(Integer)),FreeMonoid(Symbol))