 # MATLAB代做|FPGA代做|Python代做--Legendre-Gauss-Radau算法

### 时间：2019-1-19 23:33:13 点击： 核心提示： MATLAB代做|FPGA代做|Python代做--Legendre-Gauss-Radau算法...
%  function [x,w,P]=lglnodes(N)
N=100;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% lgrnodes.m
%
% Computes the Legendre-Gauss-Radau nodes, weights and the LGR Vandermonde
% matrix. The LGR nodes are the zeros of P_N(x)+P_{N+1}(x).
%
% References on LGR nodes and weights:
%   C. Canuto, M. Y. Hussaini, A. Quarteroni, T. A. Tang, "Spectral Methods
%   in Fluid Dynamics," Section 2.3. Springer-Verlag 1987
%
%   F. B. Hildebrand , "Introduction to Numerical Analysis," Section 8.11
%   Dover 1987
%
% Written by Greg von Winckel - 05/02/2004
% Contact: gregvw@chtm.unm.edu
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Truncation + 1
N1=N+1;

% Use Chebyshev-Gauss-Radau nodes as initial guess for LGR nodes
x=-cos(2*pi*(0:N)/(2*N+1))';

% The Legendre Vandermonde Matrix
P=zeros(N1,N1+1);

% Compute P_(N) using the recursion relation
% Compute its first and second derivatives and
% update x using the Newton-Raphson method.

xold=2;

% Free abscissae
free=2:N1;

while max(abs(x-xold))>eps

xold      = x;
P(1,:)    =(-1).^(0:N1);
P(free,1) = 1;
P(free,2) = x(free);

for k=2:N1
P(free,k+1)=( (2*k-1)*x(free).*P(free,k)-(k-1)*P(free,k-1) )/k;
end
x(free)=xold(free)-((1-xold(free))/N1).*(P(free,N1)+P(free,N1+1))./(P(free,N1)-P(free,N1+1));
end

% The Legendre-Gauss-Radau Vandermonde
P=P(1:N1,1:N1);

% Compute the weights
w=zeros(N1,1);
w(1)=2/N1^2;
w(free)=(1-x(free))./(N1*P(free,N1)).^2;

QQ ：1224848052 • ##### 您是如何找到本站的？
• 百度搜索
• Google搜索
• 查阅资料过程中
• 论坛发现
• 百度贴吧发现
• 朋友介绍 • 没有相关文章
###### 相关评论 ###### 发表我的评论                              • 大名：
• 内容： • matlab代做|matlab专业代做|matlab淘宝代做(www.hslogic.com) © 2019 版权所有 All Rights Reserved.
• Email:highspeed_logic@163.com 站长QQ: 1224848052

专业代做/代写/承接、MATLAB、SIMULINK、FPGA项目、博士/硕士/本科毕业设计、课题设计、论文，毕业论文，Coursework、Eassy、Assignment