login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit
Download: pdf dvi ps src tex log


Some or all of this page may not have rendered properly, because of the following error:
dvips: cd '/var/zope2/var/LatexWiki/mathaction'; /usr/bin/dvips -z -o 'SandBoxComplementsdalgebrelineaire.ps' 'SandBoxComplementsdalgebrelineaire.dvi'
/root/.dvipsrc: Permission denied
/root/.dvipsrc: Permission denied
This is dvips(k) 5.96.1 Copyright 2007 Radical Eye Software (www.radicaleye.com)
/usr/bin/dvips: ! DVI file can't be opened.

axiom
---
--- 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
axiom
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
axiom
basisLV Lv ==
 null Lv => []
 not (sameSizeVectors? Lv) => error "vectors have not the same size"
 basis transpose matrix Lv
Type: Void
axiom
basisMat mat == basis mat
Type: Void
axiom
sumBasisLLV LLv == basisLV concat LLv
Type: Void
axiom
sumBasis2 (Lv1, Lv2) == basisLV concat (Lv1, Lv2)
Type: Void
axiom
kernelMat mat ==
 lv := nullSpace mat
 #lv = 1 and lv.1 = 0*lv.1 => []
 lv
Type: Void
axiom
subVector (v, a, b) == vector (elt (entries v, a..b))
Type: Void
axiom
linearVector (t, Lv) == reduce (+, [t.i*Lv.i for i in 1..#t])
Type: Void
axiom
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
axiom
intBasisLLV LLv ==
 #LLv = 0 => error "no space to intersect"
 #LLv = 1 => LLv.1
--reduce (intBasis2, LLv)
 intBasis2 (LLv.1, intBasisLLV rest LLv)
Type: Void

axiom
---
--- 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]]

\label{eq1}\left[ 
\begin{array}{cccc}
2 & 1 & - 1 & 1 
\
1 & 1 & 0 & 1 
\
3 & 2 & - 1 & 2 
(1)
Type: Matrix(Integer)
axiom
--- kerA est une base de ker f ou f est definie par la matrice A
KerA := kernelMat A
axiom
Compiling function kernelMat with type Matrix(Integer) -> List(
      Vector(Integer))

\label{eq2}\left[{\left[ 1, \: - 1, \: 1, \: 0 \right]}, \:{\left[ 0, \: - 1, \: 0, \: 1 \right]}\right](2)
Type: List(Vector(Integer))
axiom
--- 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

\label{eq3}\left[{\left[ - 1, \: 0, \: 1, \: 0 \right]}, \:{\left[ 1, \: 1, \: 0, \: 1 \right]}\right](3)
Type: List(Vector(Integer))
axiom
--- 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.

\label{eq4}\left[{\left[ 2, \: 1, \: 3 \right]}, \:{\left[ 1, \: 1, \: 2 \right]}\right](4)
Type: List(Vector(Integer))
axiom
--- 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

\label{eq5}\left[{\left[ - 1, \: - 1, \: 1 \right]}\right](5)
Type: List(Vector(Integer))
axiom
baseG2:= kernelMat matrix baseImA

\label{eq6}\left[{\left[ - 1, \: - 1, \: 1 \right]}\right](6)
Type: List(Vector(Integer))
axiom
--- 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

\label{eq7}\left[ 
\begin{array}{cc}
2 & 1 
\
1 & 1 
\
3 & 2 
(7)
Type: Matrix(Integer)
axiom
map (X +-> A*X, baseF)

\label{eq8}\left[{\left[ - 3, \: - 1, \: - 4 \right]}, \:{\left[ 4, \: 3, \: 7 \right]}\right](8)
Type: List(Vector(Integer))
axiom
map (X +-> particularSolution (MP, A*X), baseF)

\label{eq9}\left[{\left[ - 2, \: 1 \right]}, \:{\left[ 1, \: 2 \right]}\right](9)
Type: List(Union(Vector(Fraction(Integer)),"failed"))
axiom
B := transpose matrix map (X +-> particularSolution (MP, A*X), baseF)

\label{eq10}\left[ 
\begin{array}{cc}
- 2 & 1 
\
1 & 2 
(10)
Type: Matrix(Fraction(Integer))
axiom
--- La matrice C est celle de l'isomorphisme reciproque dans ces bases.
C := B^-1

\label{eq11}\left[ 
\begin{array}{cc}
-{2 \over 5}&{1 \over 5}
\
{1 \over 5}&{2 \over 5}
(11)
Type: Matrix(Fraction(Integer))
axiom
--- 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)

\label{eq12}\begin{array}{@{}l}
\displaystyle
\left[{\left[ 
\begin{array}{c}
-{{2 \ {\sqrt{14}}}\over{7 \ {\sqrt{3}}}}
\
{{5 \ {\sqrt{14}}}\over{{14}\ {\sqrt{3}}}}
\
{{\sqrt{14}}\over{{14}\ {\sqrt{3}}}}
(12)
Type: List(Matrix(Expression(Integer)))
axiom
bonImA := map (M +-> column (M, 1), GS)

\label{eq13}\left[{\left[ -{{2 \ {\sqrt{14}}}\over{7 \ {\sqrt{3}}}}, \:{{5 \ {\sqrt{14}}}\over{{14}\ {\sqrt{3}}}}, \:{{\sqrt{14}}\over{{1
4}\ {\sqrt{3}}}}\right]}, \:{\left[{2 \over{\sqrt{14}}}, \:{1 \over{\sqrt{14}}}, \:{3 \over{\sqrt{14}}}\right]}\right](13)
Type: List(Vector(Expression(Integer)))
axiom
projortho X ==
 reduce (+, map (V +-> dot (V, X::Vector Expression Integer) * V, bonImA))
Type: Void
axiom
--- exemple de projection orthogonale sur Im f.
projortho vector [1,2,4]
axiom
Compiling function projortho with type Vector(PositiveInteger) -> 
      Vector(Expression(Integer))

\label{eq14}\left[{4 \over 3}, \:{7 \over 3}, \:{{11}\over 3}\right](14)
Type: Vector(Expression(Integer))
axiom
--- 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]

\label{eq15}\left[ 
\begin{array}{ccc}
1 & 0 & 0 
\
0 & 1 & 0 
\
0 & 0 & 1 
(15)
Type: Matrix(Integer)
axiom
RES1 := [projortho column (Id3, i) for i in 1..3]
axiom
Compiling function projortho with type Vector(Integer) -> Vector(
      Expression(Integer))

\label{eq16}\left[{\left[{2 \over 3}, \: -{1 \over 3}, \:{1 \over 3}\right]}, \:{\left[ -{1 \over 3}, \:{2 \over 3}, \:{1 \over 3}\right]}, \:{\left[{1 \over 3}, \:{1 \over 3}, \:{2 \over 3}\right]}\right](16)
Type: List(Vector(Expression(Integer)))
axiom
RES2 := [X::Vector Fraction Integer for X in RES1]

\label{eq17}\left[{\left[{2 \over 3}, \: -{1 \over 3}, \:{1 \over 3}\right]}, \:{\left[ -{1 \over 3}, \:{2 \over 3}, \:{1 \over 3}\right]}, \:{\left[{1 \over 3}, \:{1 \over 3}, \:{2 \over 3}\right]}\right](17)
Type: List(Vector(Fraction(Integer)))
axiom
RES3 := [particularSolution (MP, X) for X in RES2]

\label{eq18}\left[{\left[ 1, \: -{4 \over 3}\right]}, \:{\left[ - 1, \:{5 \over 3}\right]}, \:{\left[ 0, \:{1 \over 3}\right]}\right](18)
Type: List(Union(Vector(Fraction(Integer)),"failed"))
axiom
RES := [C * X for X in RES3::List Vector Fraction Integer]

\label{eq19}\left[{\left[ -{2 \over 3}, \: -{1 \over 3}\right]}, \:{\left[{{1
1}\over{15}}, \:{7 \over{15}}\right]}, \:{\left[{1 \over{15}}, \:{2 \over{15}}\right]}\right](19)
Type: List(Vector(Fraction(Integer)))
axiom
AA := transpose matrix baseF * transpose matrix RES

\label{eq20}\left[ 
\begin{array}{ccc}
{1 \over 3}& -{4 \over{15}}&{1 \over{15}}
\
-{1 \over 3}&{7 \over{15}}&{2 \over{15}}
\
-{2 \over 3}&{{11}\over{15}}&{1 \over{15}}
\
-{1 \over 3}&{7 \over{15}}&{2 \over{15}}
(20)
Type: Matrix(Fraction(Integer))
axiom
--- 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

\label{eq21}\left[ 
\begin{array}{ccc}
0 & 0 & 0 
\
0 & 0 & 0 
\
0 & 0 & 0 
\
0 & 0 & 0 
(21)
Type: Matrix(Fraction(Integer))
axiom
A * AA * A - A

\label{eq22}\left[ 
\begin{array}{cccc}
0 & 0 & 0 & 0 
\
0 & 0 & 0 & 0 
\
0 & 0 & 0 & 0 
(22)
Type: Matrix(Fraction(Integer))
axiom
transpose (AA * A) - AA * A

\label{eq23}\left[ 
\begin{array}{cccc}
0 & 0 & 0 & 0 
\
0 & 0 & 0 & 0 
\
0 & 0 & 0 & 0 
\
0 & 0 & 0 & 0 
(23)
Type: Matrix(Fraction(Integer))
axiom
transpose (A * AA) - A * AA

\label{eq24}\left[ 
\begin{array}{ccc}
0 & 0 & 0 
\
0 & 0 & 0 
\
0 & 0 & 0 
(24)
Type: Matrix(Fraction(Integer))




  Subject:   Be Bold !!
  ( 13 subscribers )  
Please rate this page: