fricas
(1) -> As := matrix([ [-3,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)
Type: Matrix(Integer)
fricas
ob := orthonormalBasis(A)
Type: List(Matrix(Expression(Integer)))
fricas
P : Matrix(Expression Integer) := new(3,3,0)
Type: Matrix(Expression(Integer))
fricas
setsubMatrix!(P,1,1,ob.3)
Type: Matrix(Expression(Integer))
fricas
setsubMatrix!(P,1,2,ob.1)
Type: Matrix(Expression(Integer))
fricas
setsubMatrix!(P,1,3,ob.2)
Type: Matrix(Expression(Integer))
fricas
Pt := transpose(P)
Type: Matrix(Expression(Integer))
fricas
Ps : Matrix(Expression Integer) := new(4,4,0)
Type: Matrix(Expression(Integer))
fricas
Ps(1,1) := 1
Type: Expression(Integer)
fricas
setsubMatrix!(Ps,2,2,P)
Type: Matrix(Expression(Integer))
fricas
PsT := transpose(Ps)
Type: Matrix(Expression(Integer))
fricas
PsTAsPs := PsT * As * Ps
Type: Matrix(Expression(Integer))
fricas
b1 := PsTAsPs(2,1)
Type: Expression(Integer)
fricas
l1 := PsTAsPs(2,2)
Type: Expression(Integer)
fricas
Us : Matrix(Expression Integer) := new(4,4,0)
Type: Matrix(Expression(Integer))
fricas
Us(1,1) := 1
Type: Expression(Integer)
fricas
Us(2,2) := 1
Type: Expression(Integer)
fricas
Us(3,3) := 1
Type: Expression(Integer)
fricas
Us(4,4) := 1
Type: Expression(Integer)
fricas
Us(2,1) := -b1 / l1
Type: Expression(Integer)
fricas
Us
Type: Matrix(Expression(Integer))
fricas
PsUs := Ps * Us
Type: Matrix(Expression(Integer))
fricas
PsUsT := transpose(PsUs)
Type: Matrix(Expression(Integer))
fricas
PsUsTAsPsUs := PsUsT * As * PsUs
Type: Matrix(Expression(Integer))
fricas
C := inverse(PsUs)
Type: Union(Matrix(Expression(Integer)),...)
fricas
c := PsUsTAsPsUs(1,1)
Type: Expression(Integer)
fricas
gQ := PsUsTAsPsUs / c
Type: Matrix(Expression(Integer))
fricas
x1 := transpose(matrix([[1,2,3,4]]))
Type: Matrix(Integer)
fricas
v1 := transpose(x1) * As * x1
Type: Matrix(Integer)
fricas
x2 := C * x1
Type: Matrix(Expression(Integer))
fricas
v2 := transpose(x2) * PsUsTAsPsUs * x2
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]])
Type: Matrix(Polynomial(Integer))
fricas
A := subMatrix(As, 2,4,2,4)
Type: Matrix(Polynomial(Integer))
fricas
ob := orthonormalBasis(A)
Type: List(Matrix(Expression(Integer)))
fricas
P : Matrix(Expression Integer) := new(3,3,0)
Type: Matrix(Expression(Integer))
fricas
setsubMatrix!(P,1,1,ob.3)
Type: Matrix(Expression(Integer))
fricas
setsubMatrix!(P,1,2,ob.1)
Type: Matrix(Expression(Integer))
fricas
setsubMatrix!(P,1,3,ob.2)
Type: Matrix(Expression(Integer))
fricas
Pt := transpose(P)
Type: Matrix(Expression(Integer))
fricas
Ps : Matrix(Expression Integer) := new(4,4,0)
Type: Matrix(Expression(Integer))
fricas
Ps(1,1) := 1
Type: Expression(Integer)
fricas
setsubMatrix!(Ps,2,2,P)
Type: Matrix(Expression(Integer))
fricas
PsT := transpose(Ps)
Type: Matrix(Expression(Integer))
fricas
PsTAsPs := PsT * As * Ps
Type: Matrix(Expression(Integer))
fricas
Us : Matrix(Expression Integer) := new(4,4,0)
Type: Matrix(Expression(Integer))
fricas
Us(1,1) := 1
Type: Expression(Integer)
fricas
Us(2,2) := 1
Type: Expression(Integer)
fricas
Us(3,3) := 1
Type: Expression(Integer)
fricas
Us(4,4) := 1
Type: Expression(Integer)
fricas
Us(2,1) := -PsTAsPs(2,1) / PsTAsPs(2,2)
Type: Expression(Integer)
fricas
Us(3,1) := -PsTAsPs(3,1) / PsTAsPs(3,3)
Type: Expression(Integer)
fricas
Us(4,1) := -PsTAsPs(4,1) / PsTAsPs(4,4)
Type: Expression(Integer)
fricas
Us
Type: Matrix(Expression(Integer))
fricas
PsUs := Ps * Us
Type: Matrix(Expression(Integer))
fricas
PsUsT := transpose(PsUs)
Type: Matrix(Expression(Integer))
fricas
PsUsTAsPsUs := PsUsT * As * PsUs
Type: Matrix(Expression(Integer))
fricas
cc := PsUsTAsPsUs(1,1)
Type: Expression(Integer)
fricas
so := solve(cc = 0, c)
Type: List(Equation(Expression(Integer)))
fricas
c0 := rhs so.1
Type: Expression(Integer)
fricas
gQ := PsUsTAsPsUs / cc
Type: Matrix(Expression(Integer))
fricas
eval(PsUsTAsPsUs, c = c0)
Type: Matrix(Expression(Integer))