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

# Edit detail for SandBoxComplementsdalgebrelineaire revision 9 of 9

 1 2 3 4 5 6 7 8 9 Editor: Bill Page Time: 2008/02/01 11:30:09 GMT-8 Note: correction to [[ as advised by Martin

changed:
-A1 : MFI := matrix [[2,3,3],[3,4,5],[4,5,6]]
-A2 : MFI := matrix [[2,3,4],[3,4,5],[4,5,6]]
A1 : MFI := matrix @[[2,3,3],[3,4,5],[4,5,6]]
A2 : MFI := matrix @[[2,3,4],[3,4,5],[4,5,6]]

changed:
-       [[0,1,2,1,0,1],[0,0,1,0,0,1],[0,0,0,0,1,3],[0,0,0,0,0,0]]
@[[0,1,2,1,0,1],[0,0,1,0,0,1],[0,0,0,0,1,3],[0,0,0,0,0,0]]

changed:
-        [[1,- 2,1]]           Type: List Vector Fraction Integer
-        [[1,- 2,1]]           Type: List Vector Fraction Integer
@[[1,- 2,1]]           Type: List Vector Fraction Integer
@[[1,- 2,1]]           Type: List Vector Fraction Integer

changed:
-        [[1,0,0,0,0,0],[0,- 1,0,1,0,0],[0,1,- 1,0,- 3,1]]
@[[1,0,0,0,0,0],[0,- 1,0,1,0,0],[0,1,- 1,0,- 3,1]]

changed:
-A : MFI := matrix [[1,2],[2,1],[1,1]]
A : MFI := matrix @[[1,2],[2,1],[1,1]]

changed:
-        [[2,3,4],[3,4,5]]
-        [[1,0,0,0],[2,1,0,0],[0,0,1,0]]
@[[2,3,4],[3,4,5]]
@[[1,0,0,0],[2,1,0,0],[0,0,1,0]]

changed:
-         [[2,3,4]]            Type: List Vector Fraction Integer
@[[2,3,4]]            Type: List Vector Fraction Integer

changed:
-         [[- -,- -,-,1]]
@[[- -,- -,-,1]]

Some or all of this page may not have rendered properly, because of the following error:
dvips: cd '/var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/'; /usr/bin/dvips -z -o 'SandBoxComplementsdalgebrelineaire.ps' 'SandBoxComplementsdalgebrelineaire.dvi'
/usr/bin/dvips: ! DVI file can't be opened.

fricas
---
--- linalg.input
--- Francois Maltey - janvier 2008
---
---
--- A  partir de rowEchelon
---
sameSizeVectors? Lb ==
null Lb => true
n := #(first Lb)
every? (t +-> #t=n, rest Lb)
Type: Void
fricas
basis mat ==
mat2 := rowEchelon mat
basis := []
indrow : Integer := 1
n : Integer := ncols mat
m : Integer := nrows mat
for k in 1..n repeat
if indrow <= m and mat2.(indrow,k) ~= 0
then
basis := cons (column (mat, k), basis)
indrow := indrow + 1
reverse basis
Type: Void
fricas
basisLV Lv ==
null Lv => []
not (sameSizeVectors? Lv) => error "vectors have not the same size"
basis transpose matrix Lv
Type: Void
fricas
basisMat mat == basis mat
Type: Void
fricas
sumBasisLLV LLv == basisLV concat LLv
Type: Void
fricas
sumBasis2 (Lv1, Lv2) == basisLV concat (Lv1, Lv2)
Type: Void
fricas
kernelMat mat ==
lv := nullSpace mat
#lv = 1 and lv.1 = 0*lv.1 => []
lv
Type: Void
fricas
subVector (v, a, b) == vector (elt (entries v, a..b))
Type: Void
fricas
linearVector (t, Lv) == reduce (+, [t.i*Lv.i for i in 1..#t])
Type: Void
fricas
intBasis2 (Lv1, Lv2) ==
Lb1 := basisLV Lv1
Lb2 := basisLV Lv2
null Lb1 => []
null Lb2 => []
#(first Lb1) ~= #(first Lb2) => error "vectors have not the same size"
lkv := kernelMat transpose matrix concat (Lb2, Lb1)
d1 := #Lb1
d2 := #Lb2
LcoeffV1 := [subVector (kv, d2+1, d1+d2) for kv in lkv]
[linearVector (cc, Lb1) for cc in LcoeffV1]
Type: Void
fricas
intBasisLLV LLv ==
#LLv = 0 => error "no space to intersect"
#LLv = 1 => LLv.1
--reduce (intBasis2, LLv)
intBasis2 (LLv.1, intBasisLLV rest LLv)
Type: Void

fricas
---
--- inversegeneralisee.input
--- Francois Maltey - janvier 2008
---
--- inverse generalisee
---
--- a partir du livre Algebre lineaire par Joseph Grifone p.375
--- applique pas à pas la méthode du livre à l'exemple
A := matrix [[2,1,-1,1],[1,1,0,1],[3,2,-1,2]]
 (1)
Type: Matrix(Integer)
fricas
--- kerA est une base de ker f ou f est definie par la matrice A
KerA := kernelMat A
fricas
Compiling function kernelMat with type Matrix(Integer) -> List(
Vector(Integer))
 (2)
Type: List(Vector(Integer))
fricas
--- Le noyau de la matrice dont les lignes sont des vecteurs generateurs
--- d'un sev est le sev orthogonal. C'est un sous-espace supplementaire.
--- baseF est une base d'un sous-espace supplémentaire de ker f
baseF := kernelMat matrix KerA
 (3)
Type: List(Vector(Integer))
fricas
--- les vecteurs colonnes de A engendre l'image Im f.
--- baseImA est une base de l'image de f calculee a partir de la matrice A
baseImA := basis A
Function definition for basis is being overwritten. The type of the local variable basis has changed in the computation. We will attempt to interpret the code. Compiled code for basis has been cleared.
 (4)
Type: List(Vector(Integer))
fricas
--- baseG et baseG2 sont deux bases d'un sous-espace supplementaire de Im f
--- l'une calculee a partir de la matrice A, l'autre d'une base de Im f.
baseG := kernelMat transpose A
 (5)
Type: List(Vector(Integer))
fricas
baseG2:= kernelMat matrix baseImA
 (6)
Type: List(Vector(Integer))
fricas
--- La restriction g de f est un isomorphisme du supplementaire F de ker f
--- dans Im f. La matrice de g dans les bases de F et de Im f est obtenue
--- en decomposant dans Im f les images des vecteurs de la base de F.
--- La commande particularSolution effectue cette decomposition.
MP := transpose matrix baseImA
 (7)
Type: Matrix(Integer)
fricas
map (X +-> A*X, baseF)
 (8)
Type: List(Vector(Integer))
fricas
map (X +-> particularSolution (MP, A*X), baseF)
 (9)
Type: List(Union(Vector(Fraction(Integer)),"failed"))
fricas
B := transpose matrix map (X +-> particularSolution (MP, A*X), baseF)
 (10)
Type: Matrix(Fraction(Integer))
fricas
--- La matrice C est celle de l'isomorphisme reciproque dans ces bases.
C := B^-1
 (11)
Type: Matrix(Fraction(Integer))
fricas
--- la projection orthogonale de E' sur Im f peut être obtenue
--- à partir d'une base orthonormee de Im f.
--- baseImA est une base de Im f, la fonction gramschmidt construit
--- la bon associee.
GS := gramschmidt (baseImA::List Vector Expression Integer)
 (12)
Type: List(Matrix(Expression(Integer)))
fricas
bonImA := map (M +-> column (M, 1), GS)
 (13)
Type: List(Vector(Expression(Integer)))
fricas
projortho X ==
reduce (+, map (V +-> dot (V, X::Vector Expression Integer) * V, bonImA))
Type: Void
fricas
--- exemple de projection orthogonale sur Im f.
projortho vector [1,2,4]
fricas
Compiling function projortho with type Vector(PositiveInteger) ->
Vector(Expression(Integer))
 (14)
Type: Vector(Expression(Integer))
fricas
--- construction de la composition g^-1 o p de E' dans E
--- en calculant les images des vecteurs de la base canonique de E'
--- puis passage des coordonnees de g^-1 o p de la base de F
--- à la base canonique de E.
Id3 := diagonalMatrix [1 for i in 1..3]
 (15)
Type: Matrix(Integer)
fricas
RES1 := [projortho column (Id3, i) for i in 1..3]
fricas
Compiling function projortho with type Vector(Integer) -> Vector(
Expression(Integer))
 (16)
Type: List(Vector(Expression(Integer)))
fricas
RES2 := [X::Vector Fraction Integer for X in RES1]
 (17)
Type: List(Vector(Fraction(Integer)))
fricas
RES3 := [particularSolution (MP, X) for X in RES2]
 (18)
Type: List(Union(Vector(Fraction(Integer)),"failed"))
fricas
RES := [C * X for X in RES3::List Vector Fraction Integer]
 (19)
Type: List(Vector(Fraction(Integer)))
fricas
AA := transpose matrix baseF * transpose matrix RES
 (20)
Type: Matrix(Fraction(Integer))
fricas
--- vérifications de quelques propriétés : A AA A = A et AA A AA = AA
--- transpose (A AA) = A AA : car les sev choisis sont des orthogonaux
AA * A * AA - AA
 (21)
Type: Matrix(Fraction(Integer))
fricas
A * AA * A - A
 (22)
Type: Matrix(Fraction(Integer))
fricas
transpose (AA * A) - AA * A
 (23)
Type: Matrix(Fraction(Integer))
fricas
transpose (A * AA) - A * AA
 (24)
Type: Matrix(Fraction(Integer))