kill(all);

maxima:Gram-Schmidt Process ,orthogonal system,version 1.0.
peter.vlasschaert@gmail.com,20/11/2020

ref :The Gram-Schmidt Process (proof , below).
=============================================

general equation
=============

https://www.youtube.com/watch?v=zHbfZWZJTGc&t=435s

intro :
====

Gram Schmidt process 1,2,3
======================
-----------------------------------------------------------------------------------
→ https://www.youtube.com/watch?v=nAR0enu6X24
→https://www.youtube.com/watch?v=uMGRiifW1KY&t=103s
→https://www.youtube.com/watch?v=mj1kVkzByko&t=24s
------------------------------------------------------------------------------------

load packages,option
=================

load(lrats),ratprint:false;

→ non orthogonal set :{v(1),v(2),v(3),......v(N)}, vectors
→ orthogonal         set :{u(1),u(2),u(3),......u(N)},vectors
---------------------------------------------------------------
N:positive integer  : i=1,2,....,N

solve problem: N =3

rule :Gram -Schmidt 
================
orthogonality relation , 'p1'

p1:[u(1).u(2)=0,u(1).u(3)=0,u(2).u(3) = 0,
u(2).u(1)=0,u(3).u(1)=0,u(3).u(2) = 0];

declare([Q1,Q2],constant)$

find :u(1)
=======

p1a:u(1)=v(1);

find u(2)
=======

p1b:u(2)=v(2)-Q1*u(1);

p1b1:expand(u(1).p1b);

p1b2:lratsubst(p1,p1b1);

p1b3:solve(p1b2,Q1);

p1b4:subst(p1b3,p1b);

find u(3)
=======

p1c:u(3)=v(3)-Q1*u(1)-Q2*u(2);

→ multiplied by u(1)

p1c1:expand(u(1).p1c);

p1c2:lratsubst(p1,p1c1);

→ solve  : Q1

p1c3:solve(p1c2,Q1)[1];

→ multiplied by u(2)

p1c4:expand(u(2).p1c);

p1c5:lratsubst(p1,p1c4);

→ solve  : Q2

p1c6:solve(p1c5,Q2)[1];

→ subst :Q1,Q2

p1c7:[p1c3,p1c6];
p1c8:subst(p1c7,p1c);

powerdisp:true;

general equation : u(k)

p2:u(k)=v(k) - sum((u(j).v(k))/(u(j).u(j))*u(j),j,1,k-1);

→ find : u(1)

p2a:subst([k=1],p2);

→ find : u(2)

p2b:lratsubst([k=2],p2);

p2b1:ev(p2b,nouns);

ratsimp(sum((u(j)*(u(j) . v(2)))/u(j)^^2,j,1,1));

→ find : u(3)

p2c:lratsubst([k=3],p2);

p2c1:ev(p2c,nouns);

expand(sum((u(j)*(u(j) . v(3)))/u(j)^^2,j,1,2));