Previous Up Next

6.60.5  Procédé de Gramschmidt : gramschmidt

gramschmidt a un ou deux paramètres :

gramschmidt donne une base orthonormale par rapport à ce produit scalaire.
On tape :

normal(gramschmidt([[1,1,1],[0,0,1],[0,1,0]]))

Ou on tape :

normal(gramschmidt([[1,1,1],[0,0,1],[0,1,0]],dot))

On obtient :

[[(sqrt(3))/3,(sqrt(3))/3,(sqrt(3))/3], [(-(sqrt(6)))/6,(-(sqrt(6)))/6,(sqrt(6))/3], [(-(sqrt(2)))/2,(sqrt(2))/2,0]]

Exemple
Pour les polynômes de degré <n, on considère le produit scalaire défini par :

P.Q=
1


−1
P(x).Q(x)dx 

On tape :

gramschmidt([1,1+x],(p,q)->integrate(p*q,x,-1,1))

Ou on écrit la fonction p_scal, on tape :
p_scal(p,q):=integrate(p*q,x,-1,1)
et on tape :

gramschmidt([1,1+x],p_scal)

On obtient :

[1/(sqrt(2)),(1+x-1)/sqrt(2/3)]

Previous Up Next