% GRADAU_JACOBI Generalized Gauss-Radau quadrature formula % for Jacobi weight function % % Given the parameters al and be of the Jacobi measure % and the fixed node -1 of multiplicity r, this routine % generates the generalized Gauss-Radau quadrature rule % involving r-1 consecutive derivative values at the % point -1 and N interior points. The N interior nodes % and weights are stored in the last N rows of the % (N+r)x2 output array xw, and the fixed node -1 (repeated % r times) and the r weights associated with the r % derivative values in the first r rows of xw. % % The routine is designed to avoid breakdown at very large % values of N, as it would occur in the routine gradau for % ab=r_jacobi. % function xw=gradau_jacobi(N,al,be,r) % % internal nodes and weights % apb=al+be+r; ab1=r_jacobi(N,al,be+r); xw0=gauss(N,ab1); xw(r+1:N+r,:)=xw0; xw(r+1:N+r,2)=xw(r+1:N+r,2)./((xw(r+1:N+r,1)+1).^r); xw(1:r,1)=-ones(r,1); % % boundary weights % rs=zeros(r-1,1); A=zeros(r); b=zeros(r,1); x=zeros(r,1); for rho=1:r-1 rs(rho)=sum((xw0(:,1)+1).^(-rho)); end p=1; for n=1:N p=(1+(be+r)/n)*p; end for i=r:-1:1 A(i,i)=factorial(i-1)*p^2; if i