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

fricas
As := matrix([ [-3,1,1,1], [1,1,1,1], [1,1,1,1], [1,1,1,1]])
 (1)
Type: Matrix(Integer)
fricas
A := subMatrix(As, 2,4,2,4)
 (2)
Type: Matrix(Integer)
fricas
ob := orthonormalBasis(A)
 (3)
Type: List(Matrix(Expression(Integer)))
fricas
P : Matrix(Expression Integer) := new(3,3,0)
 (4)
Type: Matrix(Expression(Integer))
fricas
setsubMatrix!(P,1,1,ob.3)
 (5)
Type: Matrix(Expression(Integer))
fricas
setsubMatrix!(P,1,2,ob.1)
 (6)
Type: Matrix(Expression(Integer))
fricas
setsubMatrix!(P,1,3,ob.2)
 (7)
Type: Matrix(Expression(Integer))
fricas
Pt := transpose(P)
 (8)
Type: Matrix(Expression(Integer))
fricas
Ps : Matrix(Expression Integer) := new(4,4,0)
 (9)
Type: Matrix(Expression(Integer))
fricas
Ps(1,1) := 1
 (10)
Type: Expression(Integer)
fricas
setsubMatrix!(Ps,2,2,P)
 (11)
Type: Matrix(Expression(Integer))
fricas
PsT := transpose(Ps)
 (12)
Type: Matrix(Expression(Integer))
fricas
PsTAsPs := PsT * As * Ps
 (13)
Type: Matrix(Expression(Integer))
fricas
b1 := PsTAsPs(2,1)
 (14)
Type: Expression(Integer)
fricas
l1 := PsTAsPs(2,2)
 (15)
Type: Expression(Integer)
fricas
Us : Matrix(Expression Integer) := new(4,4,0)
 (16)
Type: Matrix(Expression(Integer))
fricas
Us(1,1) := 1
 (17)
Type: Expression(Integer)
fricas
Us(2,2) := 1
 (18)
Type: Expression(Integer)
fricas
Us(3,3) := 1
 (19)
Type: Expression(Integer)
fricas
Us(4,4) := 1
 (20)
Type: Expression(Integer)
fricas
Us(2,1) := -b1 / l1
 (21)
Type: Expression(Integer)
fricas
Us
 (22)
Type: Matrix(Expression(Integer))
fricas
PsUs := Ps * Us
 (23)
Type: Matrix(Expression(Integer))
fricas
PsUsT := transpose(PsUs)
 (24)
Type: Matrix(Expression(Integer))
fricas
PsUsTAsPsUs := PsUsT * As * PsUs
 (25)
Type: Matrix(Expression(Integer))
fricas
C := inverse(PsUs)
 (26)
Type: Union(Matrix(Expression(Integer)),...)
fricas
c := PsUsTAsPsUs(1,1)
 (27)
Type: Expression(Integer)
fricas
gQ := PsUsTAsPsUs / c
 (28)
Type: Matrix(Expression(Integer))
fricas
x1 := transpose(matrix([[1,2,3,4]]))
 (29)
Type: Matrix(Integer)
fricas
v1 := transpose(x1) * As * x1
 (30)
Type: Matrix(Integer)
fricas
x2 := C * x1
 (31)
Type: Matrix(Expression(Integer))
fricas
v2 := transpose(x2) * PsUsTAsPsUs * x2
 (32)
Type: Matrix(Expression(Integer))

fricas
)clear value c
As := matrix([ [-c,-1,-2,-1], [-1,3,-1,0], [-2,-1,3,0], [-1,0,0,-6]])
 (33)
Type: Matrix(Polynomial(Integer))
fricas
A := subMatrix(As, 2,4,2,4)
 (34)
Type: Matrix(Polynomial(Integer))
fricas
ob := orthonormalBasis(A)
 (35)
Type: List(Matrix(Expression(Integer)))
fricas
P : Matrix(Expression Integer) := new(3,3,0)
 (36)
Type: Matrix(Expression(Integer))
fricas
setsubMatrix!(P,1,1,ob.3)
 (37)
Type: Matrix(Expression(Integer))
fricas
setsubMatrix!(P,1,2,ob.1)
 (38)
Type: Matrix(Expression(Integer))
fricas
setsubMatrix!(P,1,3,ob.2)
 (39)
Type: Matrix(Expression(Integer))
fricas
Pt := transpose(P)
 (40)
Type: Matrix(Expression(Integer))
fricas
Ps : Matrix(Expression Integer) := new(4,4,0)
 (41)
Type: Matrix(Expression(Integer))
fricas
Ps(1,1) := 1
 (42)
Type: Expression(Integer)
fricas
setsubMatrix!(Ps,2,2,P)
 (43)
Type: Matrix(Expression(Integer))
fricas
PsT := transpose(Ps)
 (44)
Type: Matrix(Expression(Integer))
fricas
PsTAsPs := PsT * As * Ps
 (45)
Type: Matrix(Expression(Integer))
fricas
Us : Matrix(Expression Integer) := new(4,4,0)
 (46)
Type: Matrix(Expression(Integer))
fricas
Us(1,1) := 1
 (47)
Type: Expression(Integer)
fricas
Us(2,2) := 1
 (48)
Type: Expression(Integer)
fricas
Us(3,3) := 1
 (49)
Type: Expression(Integer)
fricas
Us(4,4) := 1
 (50)
Type: Expression(Integer)
fricas
Us(2,1) := -PsTAsPs(2,1) / PsTAsPs(2,2)
 (51)
Type: Expression(Integer)
fricas
Us(3,1) := -PsTAsPs(3,1) / PsTAsPs(3,3)
 (52)
Type: Expression(Integer)
fricas
Us(4,1) := -PsTAsPs(4,1) / PsTAsPs(4,4)
 (53)
Type: Expression(Integer)
fricas
Us
 (54)
Type: Matrix(Expression(Integer))
fricas
PsUs := Ps * Us
 (55)
Type: Matrix(Expression(Integer))
fricas
PsUsT := transpose(PsUs)
 (56)
Type: Matrix(Expression(Integer))
fricas
PsUsTAsPsUs := PsUsT * As * PsUs
 (57)
Type: Matrix(Expression(Integer))
fricas
cc := PsUsTAsPsUs(1,1)
 (58)
Type: Expression(Integer)
fricas
so := solve(cc = 0, c)
 (59)
Type: List(Equation(Expression(Integer)))
fricas
c0 := rhs so.1
 (60)
Type: Expression(Integer)
fricas
gQ := PsUsTAsPsUs / cc
 (61)
Type: Matrix(Expression(Integer))
fricas
eval(PsUsTAsPsUs, c = c0)
 (62)
Type: Matrix(Expression(Integer))

 Subject:   Be Bold !! ( 14 subscribers )