I'm trying to implement various kinds of pseudospectral methods for direct optimization in Matlab using IPOPT. I've got some working Legendre-Gauss-Lobatto code, but would like to use the flipped Radau method. What greatly helped me out writing the LGL code was having an example 6x6 differentiation matrix to test against until my code could reproduce it. What I could use is a similar LGR differentiation matrix for e.g. the N=6 case (a 6x7 "unsparse" matrix due to the addition of the uncollocated -1 point).
I'd also like to know if the flipped Radau points are literally just inverted around 0, or if the algorithm to determine the LGR points needs to be modified to find $P_N(x)-P_{N+1}(x)$ instead of $P_N(x)+P_{N+1}(x)$?
Alternatively pointers to any Matlab or Python code which can reproduce these differentiation matrices would be appreciated.
For background on LGR/LGL/LG methods:
x
is a vector of the roots of $P_N(x)+P_{N+1}(x)$ for N=5 thenlegendreP(5,x) + legendreP(6,x)
is the zero vector andlegendreP(5,-x) - legendreP(6,-x)
is also the zero vector, so I think that answers my question about generating the flipped LGR points. $\endgroup$dy=dy1+dy2; y=y1+y2;
tody=dy1-dy2; y=y1-y2;
-- still working on adding the noncollocated point. $\endgroup$