kill(all)$

ortho collocation method :  shifted legendre polynomials, version 1.0, part1
peter.vlasschaert@gmail.com,02/09/2019

load packages.
===========

load(orthopoly);

load(lrats);

see : help maxima.

 shifted_legendre_p (n, x) := legendre_p (n, 2*x - 1)$

Legendre polynomials
=================

a) shifted legendre polynomials
========================

n=0
-----

p1:shifted_legendre_p (0, rat(x));

n=1
-----

p2:shifted_legendre_p (1, rat(x));

n=2
-----

p3:shifted_legendre_p (2, rat(x));

n=3
-----

p4:shifted_legendre_p (3, rat(x));

p5:[p1,p2,p3,p4];

integration : 0 to 1 , ortho poly 'legendre: 'shited'
P: polynomial
l : legendre shifted
s: shifted

definition : shifted legendre polynomial

P_ls(n,x):=legendre_p (n, 2*x - 1)$

P_ls(n,x):=legendre_p (n, 2*x - 1)$

p6::integrate('P_ls(n,x)*'P_ls(m,x),x,0,1) ;

m=1,n=2
-------------

p6v:integrate('P_ls(1,x)*'P_ls(2,x),x,0,1) ;

p6v1:p6v = ev(p6v,nouns);

m=3,n=3
-------------

p6w:integrate('P_ls(3,x)*'P_ls(3,x),x,0,1) ;
p6w1:p6w = ev(p6w,nouns);

relation : n=3  = >  1/7

p6x:integrate('P_ls(4,x)*'P_ls(4,x),x,0,1) ;
p6x1:p6x = ev(p6x,nouns);

relation : n=4 = >  1/7

p6y:integrate('P_ls(5,x)*'P_ls(5,x),x,0,1) ;
p6y1:p6y = ev(p6y,nouns);

relation : n=5 = >  1/11

m =  n   =>  real number: integration 0 => 1
m <>n   =>   zero            : integration 0 => 1

 real number : ?
=============
relation : n = m =>  1/(2*m+1)

p7a:subst([n=m],p6)=1/(2*m+1);

relation : n ≠m =>  0

p7b:p6=0;

b)  legendre polynomials
========================

 p1a:legendre_p(0,x);

p2a:legendre_p(1,x);

p3a:legendre_p(2,rat(x));

p4a:legendre_p(3,rat(x));

p5a:[p1a,p2a,p3a,p4a];

rem :orthopolynomial relation for legendre

definition : legendre polynomial
========================
see above : symbols

P_l(n,x):=legendre_p (n, x);

n=m    =>  2/(2m+1)

'integrate('P_l(5,x)*'P_l(5,x),x,-1,1)  = ev(integrate('P_l(5,x)*'P_l(5,x),x,-1,1),nouns);

'integrate('P_l(6,x)*'P_l(6,x),x,-1,1)  = ev(integrate('P_l(6,x)*'P_l(6,x),x,-1,1),nouns);

n≠m   =>  0

'integrate('P_l(6,x)*'P_l(5,x),x,-1,1)  = ev(integrate('P_l(6,x)*'P_l(5,x),x,-1,1),nouns);

we need collocation points of : shifted legendre polynomials
==============================================

roots : P_ls(n,x), n=0,1,2,3

internal collocation points  (number of collocation points)
-----------------------------------

how to use : maplist ?

p8:maplist(allroots,p5);

n=0             (no point)

p8a:p8[1];

n=1            (only one point)

p8b:p8[2];

n=2            (two point)

p8c:p8[3];

n=3           (three  points)

p8d:p8[4];

boundary points :[0,.....,1]
-----------------------------------
begin :0
end   : 1

p9:[0,1];

plot functions : shifted legendre polynomials
==================================

wxplot2d([p5], [x,0,1])$

n=0,1,2,3
-------------

see : above for the values (collocation points interval  0 to 1)
linear , quadratic,cubic,.......

wx :prefix result inline function in maxima(plot2d).

wxplot2d([p5[1],p5[2],p5[3],p5[4]], [x,0,1],[y,-1.2,2])$