径向Kohn-Sham方程的谱有限元方法

来源:互联网 发布:忒修斯之船 知乎 编辑:程序博客网 时间:2024/06/05 18:24

径向Kohn-Sham方程的谱有限元方法

本文以Kohn-Sham方程为例,介绍了现在已发展成型的几种近似交换相关泛函和密度泛函理论的计算步骤,主要以代码的形式呈现。

径向密度泛函理论给出了求解下面一个Kohn-Sham方程的一套思路:
这里写图片描述
其中,Vxc是近似交换相关泛函,Vn(r)=Zr是来源于原子核库伦引力产生的势能,Vh是哈特里势能,哈特里势能满足这样一个径向泊松方程:
这里写图片描述



下面给出程序,后面再做解释:

  • 能量求解及其子函数:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % % Script file to run radialdft:%clc;clear all;close all%% Set timer%tstart  = cputime;% % ==========================================% Problem data (Chemistry part of the input)% ==========================================% % For benchmarking, check:% https://www.nist.gov/pml/data/atomic-total-energies-and-eigenvalues-html% % Set up Problem Parameters:% fprintf('\n');fprintf('----> Setting up the Problem Parameter . . .\n');fprintf('\n');Zion = 30; % Carbonqtot = 0.0;             % net charge; nonzero for ionic calculationnelec = Zion - qtot;problemdata = struct('Z',Zion, 'nelec',nelec);% % Domain:% rmin = 0.0;rmax = 10.0;%% Mesh:% domain      = [rmin rmax];toplot      = 'on';% % 1. Mesh for radial Schrodinger eq.:% meshtypeSch    = 1;       % type: 1 = uniform, 2 = logarithmic, 3 = exponentialaSch           = 10.0;pSch           = 8;numelSch       = 50;% meshoptsSch = struct('element_order',pSch, 'numel',numelSch, 'domain',domain, ...                     'verbose',toplot, 'element_type','spectral');%              meshdatainputSch = struct('meshtype',meshtypeSch, 'param',aSch, ...                          'meshopts',meshoptsSch);% % 2. Mesh for radial Poisson eq.:% meshtypePois    = meshtypeSch;       % type: 1 = uniform, 2 = logarithmic, 3 = exponentialaPois           = aSch;pPois           = pSch;numelPois       = numelSch;% meshoptsPois = struct('element_order',pPois, 'numel',numelPois, 'domain',domain, ...                      'verbose',toplot, 'element_type','spectral');%              meshdatainputPois = struct('meshtype',meshtypePois, 'param',aPois, ...                           'meshopts',meshoptsPois);                      % % Quadrature%global quadtype;quadtype = 1;          % Type of quadrature: 1 = Gauss, 2 = Lobatto% % 1. Quadrature for radial Schrodinger eq.:% nspSch   = pSch + 2;% nspSch   = pSch + 1; % Number of quadrature points/weights;                        % nsp = p + 1 => diagonal overlap (S)-matrix. This                        % leads to exact integration of H-matrix but                       % "underintegrates" S-matrix. Nonetheless,                        % optimal convergence is preserved%    quaddatainputSch = struct('quadtype',quadtype, 'nsp',nspSch);% % 2. Quadrature for radial Poisson eq.:% nspPois   = nspSch;% nspPois   = pPois + 1; % Number of quadrature points/weights;                          % nsp = p + 1 => diagonal overlap (S)-matrix. This                          % leads to exact integration of H-matrix but                         % "underintegrates" S-matrix. Nonetheless,                          % optimal convergence is preservedquaddatainputPois = struct('quadtype',quadtype, 'nsp',nspPois);% % SCF% maxscfiter  = 200;scftol      = 1.0E-6;scftolmax   = 5.0E-5;mixingparam = 0.7;scfopts = struct('maxiter',maxscfiter, 'scftol',scftol, 'scftolmax',scftolmax, ...                 'mixingparam',mixingparam);maxeigiter = 2000;eigtol = 1.0E-10;eigdisp = 0;eigopts = struct('maxit',maxeigiter, 'tol',eigtol, 'disp',eigdisp);[lam, u, scf_converged, Etot, Ekin, Ecoul, Eenuc, Exc, history, exitflag] = radialdft(problemdata, ...                                                   meshdatainputSch, meshdatainputPois, ...                                                   quaddatainputSch, quaddatainputPois, ...                                                   scfopts, eigopts);   if exitflag ~= 0    fprintf('\n');    fprintf('Radial Kohn-Sham Equation could not be solved because \n');    fprintf('MATLAB''s eigensolver (eigs) failed! \n');    fprintf('\n');    timetot = cputime - tstart;    fprintf('********************************************************* \n');    fprintf('\n');    fprintf(' Total Computing Time so far: %20.3e s \n', timetot);    fprintf('\n');    fprintf('********************************************************* \n');    error('spectatom Aborted!');endif scf_converged == 1    fprintf('\n')    fprintf('       ==========================      \n')    fprintf('       *** Converged Results  ***      \n')    fprintf('       ==========================      \n')    fprintf('\n')    fprintf('        Etot   = %-11.8e                \n', Etot);    fprintf('        Ekin   = %-11.8e                \n', Ekin);    fprintf('        Ecoul  = %-11.8e                \n', Ecoul);    fprintf('        Eenuc  = %-11.8e                \n', Eenuc);    fprintf('        Exc    = %-11.8e                \n', Exc);    fprintf('\n');   %     fprintf('The ground state energy is: %-11.8e Hartree \n', Etot(end));else    fprintf('\n')    fprintf('SCF did not converged. Maximum number of iterations (%-5d) reached \n', length(history));    fprintf('\n')endtimetot = cputime - tstart;fprintf('*************************************************************** \n');fprintf('\n');fprintf(' Time to complete the Simulation = %20.3e s\n', timetot);fprintf('\n');fprintf('*************************************************************** \n');
function rho = thomasfermidensity(r, Z)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % Generalized Thomas-Fermi density (charge)% Inputs% ====== % r(:)      : Radial grid% Z         : Atomic number% % Output% ======% rho(:)    : Thomas-Fermi charge density evaluated at the input grid pointsV = thomasfermipotential(r, Z, false);rho = -1.0./3.0/pi^2.*(-2.0*V).^(3.0/2.0);      % Charge densityreturnendfunction V = thomasfermipotential(r, Z, cut)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % Generalized Thomas-Fermi atomic potential% % Inputs% ====== % r(:)      : Radial grid% Z         : Atomic number% cut       : Cut the potential% % Output% ======% V(:)      : Thomas-Fermi potential evaluated at the input grid points% if nargin < 3    cut = true;endx = r.*(128.0*Z/9.0/pi^2).^(1.0/3.0);%  Z_eff(x) = Z * phi(x), where phi(x) satisfies the Thomas-Fermi equation:%                   phi'' = phi^(3/2) / sqrt(x)%  with boundary conditions:%    phi(0)  = 1%    phi(oo) = 0%  There is no analytic solution, but one can solve this approximately. We use:%  http://arxiv.org/abs/physics/0511017% Parameters:alpha =  0.7280642371;beta  = -0.5430794693;gamma =  0.3612163121;sqrtx = sqrt(x);Zeff = Z.*(1 + alpha*sqrtx + beta*x.*exp(-gamma*sqrtx)).^2.* ...           exp(-2.0*alpha*sqrtx);%  This keeps all the eigenvalues of the radial problem negative:if cut == 1    Zeff(Zeff < 1.0) = 1.0;endV = -Zeff./r;returnendfunction r = sphericalintegral(xe, xq, wtq, fq)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % Spherical integral of function f(r) (no \theta, \phi dependence) % defined by values [fq] at the quadrature points on mesh xe. % i.e., \int_0^rmax 4 pi r^2 f(r) dr, where rmax = max r value in meshr = integrateonmesh(xe, wtq, 4.0.*pi.*xq.^2.*fq);returnendfunction [lambda, eigv, eigsflag] = solveradialschroed(xe, connect, numel, ...                            nodaldofs, dofinfo, numdofs, ...                            Veffq, l, xq, xiq, wtq, phiq, dphiq, nbeigs, eigopts)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % Inputs% ====== % Veffq(:,:)     : quadrature-grid representatin of Veff - %                  Veffq(:,:) := VH[rhoq(:,:)] + Vxc[rhoq(:,:)] + Vext(:,:);%                  Veffq(:,:) = value at i-th quadrature point of j-th element% % phiq(:,:), dphiq(:,:)  : parent basis fn values at %                          quadrature points xiq; %                          phihq(i,j) = value of j-th func%                          at i-th quadrature point% xq(:,:)                : quadrature pts in physical space; %                          xq(i,j) = coordinate of i-th point in j-th element% Outputs% =======  %% global quadtype;m = 0; % size of index arraysfor e = 1:numel  conn = connect(e,:); sctr = [ nodaldofs(conn).list ];  m = m + (length(sctr))^2;endI = zeros(m,1); J = I; XH = I; XS = I;%% compute and assemble Hamiltonian matrix H and overlap matrix S%% loop over all the elements%ind = 1; % indices for arrays I, J, XH, XSfor e = 1:numel    conn = connect(e,:);    sctr = [nodaldofs(conn).list];    dofs_to_nodes = dofinfo(sctr);      % dofs = DOFs of the element                                        % global node Ids    detj = (xe(e+1) - xe(e))/2.0;    %    % compute element contributions to Stiffness matrix and load vector:    %                                        [he, se] = radialschroedingerelemeqns(conn, dofs_to_nodes, ...                                          Veffq(:,e), l, phiq, dphiq, ...                                          xq(:,e), wtq, detj);    %    % insert he, se into vector arrays    %    sctrlen = length(sctr);    temp = meshgrid(sctr);    I(ind:ind+sctrlen^2-1) = temp(:);    temp = temp';    J(ind:ind+sctrlen^2-1) = temp(:);    XH(ind:ind+sctrlen^2-1) = he(:);    XS(ind:ind+sctrlen^2-1) = se(:);    ind = ind + sctrlen^2;end%% Create H and S-matrices from the arrays%fprintf('Performing sparse assembly of system matrices (%d x %d) . . .\n\n',numdofs,numdofs);bigh = sparse(I, J, XH, numdofs, numdofs);bigs = sparse(I, J, XS, numdofs, numdofs);clear I; clear J; clear XH; clear XS;%% solve the eigen-problem (generalized/standard): H c = \lambda S c%% Symmetrize (in case bigs is nearly-symmetric due to round-off, etc.)bigs = 0.5*(bigs + bigs');% opt.TOLERANCE    = 1.0E-10;% opt.MAXITERATION = 1000;% opt.iluThresh    = 0.1; % % [lambda, eigv] = eigifp(bigh, bigs, nbeigs, opt);if (size(phiq,2) == length(xiq)) && (quadtype == 2)    % nsp = p + 1    % Call eigs as a standard eigenproblem solver:    fprintf('Solving standard eigenproblem: [H]{c} = e{c} . . .\n\n');%     [eigv, D, ~] = eigs(bigs\bigh, nbeigs , 'SA', opts);    [eigv, D, eigsflag] = eigs(bigs\bigh, nbeigs , 'SM', eigopts);else    % Call eigs as a generalized eigenproblem solver:    fprintf('Solving generalized eigenproblem: [H]{c} = e[S]{c} . . .\n\n');    [eigv, D, eigsflag] = eigs(bigh, bigs, nbeigs , 'SA', eigopts);endif eigsflag ~= 0    fprintf('\n')    fprintf('       **************************      \n')    fprintf('             FATAL ERROR! \n')    fprintf('       **************************      \n')    fprintf('\n')    fprintf('All the required eigenvalues did not converge! \n');    fprintf('\n')    fprintf('Consider changing eigopts.tol/eigopts.maxit and re-run. \n')    condbigs = condest(bigs);    condbigh = condest(bigh);    fprintf('\n')    fprintf('The Condition number of Overlap matrix at exit %-16.10e \n', condbigs)     fprintf('\n')    fprintf('and the Condition number of Hamiltonian matrix at exit %-16.10e \n', condbigh)    fprintf('\n')    fprintf('Aborting . . . \n');    fprintf('\n')    lambda = NaN;    returnelse    fprintf('\n')    fprintf('All the required eigenvalues converged within set tolerance. \n');    fprintf('\n')    lambda = diag(D);    returnendendfunction [Vh] = solveradialpoisson(xe, connect, numel, ...                                   nodaldofs, dofinfo, numdofs, ...                                   xq, wtq, phiq, dphiq, rhoq)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % Inputs% ====== % rhoq(:,)               : quadrature-grid representatin of electron density; %                          rho(i,j) = rho value at i-th quadrature point %                          of j-th element% phiq(:,:), dphiq(:,:)  : parent basis fn values at %                          quadrature points xiq; %                          phihq(i,j) = value of j-th func%                          at i-th quadrature point% % Outputs% =======  %m = 0;                      % size of index arraysfor e = 1:numel    conn = connect(e,:);     sctr = [ nodaldofs(conn).list ];    m = m + (length(sctr))^2;endI = zeros(m,1); J = I; XK = I; f = zeros(numdofs, 1);%% compute and assemble Stiffness matrix K and load vector f% ind = 1; % indices for arrays I, J, and XK%% loop over all the elements%for e = 1:numel    conn = connect(e,:);    sctr = [nodaldofs(conn).list];    dofs_to_nodes = dofinfo(sctr);      % dofs = DOFs of the element                                        % global node Ids     detj = (xe(e+1) - xe(e))/2.0;    %    % compute element contributions to Stiffness matrix and load vector:    %    [ke, fe] = radialpoissonelemeqns(conn, dofs_to_nodes, phiq, dphiq, ...                                     rhoq(:,e), xq(:,e), wtq, detj);    %    % insert ke, fe into vector arrays    %    sctrlen = length(sctr);    temp = meshgrid(sctr);    I(ind:ind+sctrlen^2-1) = temp(:);    temp = temp';    J(ind:ind+sctrlen^2-1) = temp(:);    XK(ind:ind+sctrlen^2-1) = ke(:);    f(sctr) = f(sctr) + fe;    ind = ind + sctrlen^2;end%% Create Stiffness matrix from the array%fprintf('Performing sparse assembly of Stiffness Matrix (%d x %d) . . .\n\n',numdofs,numdofs);bigk = sparse(I, J, XK, numdofs, numdofs);clear I; clear J; clear XK;%% solve the linear system Ku = f%fprintf('Solving the linear system [K]{u} = {b} . . .\n\n');Vh = bigk\f;returnend %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [NFE dNdxi] = shapefunctions(eorder,xi) % Purpose% =======% Compute the shape function and its local derivative at the Gauss point%function [NFE, dNdxi] = shapefunctions(eorder,xi) %% shape function%% nodes 1 to eorder+1%n = eorder+1;[NFE, dNdxi] = lagrange(xi,n);returnendfunction [he, se] = radialschroedingerelemeqns(nodes, dofs_to_nodes, ...                                               Veffelem, l, phiq, dphiq, ...                                               xqe, wtq, detj)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= %% Inputs% ======                               % rhoq(:)          : quadrature point values of the electron density.%                    rhoq(i) is the value of density at the i-th quadrature %                    point of the element under consideration                                           %                                            % Veff(:)          : VH[rho(:)] + Vxc[rho(:)] + Vext(:);%                    A vector of length nsp. The i-th elements of Veff%                    vector contains the sum of the values of VH, %                    Vxc, and Vext evaluated at  the i-th quadrature %                    point of the element under consideration %% Outputs% =======  %ndofs = length(dofs_to_nodes);dofs_to_locindices = zeros(1,ndofs);for i = 1:ndofs  dofs_to_locindices(i) = find(nodes == dofs_to_nodes(i));end%% initialize element Hamiltonian (he) and overlap (se) matrices to zero%he = zeros(ndofs,ndofs);se = zeros(ndofs,ndofs);%% loop over Gauss points in xi-direction%for i = 1:length(xqe)    r = xqe(i);        %    % FE shape functions and local derivatives    %    NFE = phiq(i,:);    dNFEdxi = dphiq(i,:);    N = NFE(dofs_to_locindices);    dNdxi = dNFEdxi(dofs_to_locindices);    % derivative of shape function with respect to global coordinate r    dNdr = dNdxi/detj;    %    % The element Hamiltonian (he) and overlap matrices (se)    %    mass = N'*N;    % Using u = P_{nl} = r * R_{nl} as the varibale to solve:    he = he + detj*wtq(i)*(0.5*(dNdr'*dNdr) + ...                          (Veffelem(i) + l*(l + 1)/2.0/r/r)*mass);    se = se + detj*wtq(i)*mass;endreturnend function [ke, fe] = radialpoissonelemeqns(nodes, dofs_to_nodes, ...                                          phiq, dphiq, rhoq, xqe, wtq, detj)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= %% Inputs% ======                               % rhoq(:)          : quadrature point values of the electron density.%                    rhoq(i) is the value of density at the i-th quadrature %                    point of the element under consideration%% Outputs% =======  %ndofs = length(dofs_to_nodes);dofs_to_locindices = zeros(1,ndofs);for i = 1:ndofs  dofs_to_locindices(i) = find(nodes == dofs_to_nodes(i));end%% initialize the stiffness matrix and load vector to zero%ke = zeros(ndofs,ndofs);fe = zeros(ndofs,1);%% loop over Gauss points in xi-direction%for i = 1:length(xqe)    r = xqe(i);    %    % FE shape functions and local derivatives    %    NFE     = phiq(i,:);    dNFEdxi = dphiq(i,:);    N = NFE(dofs_to_locindices);    dNdxi = dNFEdxi(dofs_to_locindices);    % derivative of shape function with respect to global coordinate r    dNdr = dNdxi/detj;    %    % The element Stiffness matrix (ke) and load vector (fe):    %        % Considering Vp = r * Vh as the varibale to solve:    ke = ke + detj*wtq(i)*(dNdr'*dNdr);    fe = fe + detj*wtq(i)*N'*r*rhoq(i);endreturnendfunction [lam, u, scf_converged, Etot, Ekin, Ecoul, Eenuc, Exc, history, exitflag] = radialdft(problemdata, ...                                                   meshdatainputSch, meshdatainputPois, ...                                                   quaddatainputSch, quaddatainputPois, ...                                                   scfopts, eigopts)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Subhajit Banerjee and N. Sukumar% July 2017% UC Davis% % Purpose% ======= % Solves single-atom, all-electron, radial Kohn-Sham equation by % self-consistent field interation (SCF) % % Inputs% ====== % % % Outputs% =======  % % Set up Mesh for Spectral FEM% fprintf('\n');fprintf('----> Constructing finite element mesh . . . \n');fprintf('\n');meshtypeSch = meshdatainputSch.meshtype;paramSch    = meshdatainputSch.param;  meshoptsSch = meshdatainputSch.meshopts;% meshsetupSch = mesher(meshtypeSch, paramSch, meshoptsSch);% meshtypePois = meshdatainputPois.meshtype;paramPois    = meshdatainputPois.param;  meshoptsPois = meshdatainputPois.meshopts;% meshsetupPois = mesher(meshtypePois, paramPois, meshoptsPois);% % Set up Quadrature% fprintf('\n');fprintf('----> Setting up quadrature options . . . \n');fprintf('\n');% quadtypeSch = quaddatainputSch.quadtype;nspSch      = quaddatainputSch.nsp;% quadsetupSch = getparentquadptswts(quadtypeSch, nspSch);% xiqSch = quadsetupSch.points;wtqSch = quadsetupSch.weights;% xeSch = meshsetupSch.elemendcoord;xqSch = getphysicalquadpts(xeSch, xiqSch);% quadtypePois = quaddatainputPois.quadtype;nspPois      = quaddatainputPois.nsp;% quadsetupPois = getparentquadptswts(quadtypePois, nspPois);% xiqPois = quadsetupPois.points;wtqPois = quadsetupPois.weights;% xePois = meshsetupPois.elemendcoord;xqPois = getphysicalquadpts(xePois, xiqPois);% % Initialize density% fprintf('\n');fprintf('----> Constructing initial density . . . \n');fprintf('\n');nelec = problemdata.nelec;% rhoqSch  = initialdensity(nelec, xeSch, xiqSch, wtqSch); % rhoqPois  = initialdensity(nelec, xePois, xiqPois, wtqPois); rhoqSch   = initialdensity(nelec, xeSch, xqSch, wtqSch); rhoqPois  = initialdensity(nelec, xePois, xqPois, wtqPois); % % Commence SCF Iterations% [lam, u, scf_converged, Etot, Ekin, Ecoul, Eenuc, Exc, history, exitflag] = KSscfiteration(problemdata, rhoqSch, rhoqPois, ...                                                         meshsetupSch, meshsetupPois, ...                                                         meshoptsSch, meshoptsPois, ...                                                         quadsetupSch, quadsetupPois, ...                                                         xqSch, xqPois, scfopts, eigopts);if exitflag ~= 0    fprintf('\n');    fprintf('SCF Iteration Aborted . . . \n');    fprintf('\n');    fprintf('Hit any key to Abort the Radial Kohn-Sham Equation Solver . . . \n');    pause;    returnelse    fprintf('\n');    fprintf('SCF Iterations Ended successfully . . . \n');    fprintf('\n');    returnendendfunction [nodaldofs, dofinfo, numdofs] = Poissetupdofs(numnod)isboundarynode = zeros(1,numnod);% Dirichlet BCs on boundary nodesisboundarynode(1) = 1; isboundarynode(numnod) = 1;nodaldofs(numnod).list = [];numdofs = 0;for n = 1:numnod  if (~isboundarynode(n))    numdofs = numdofs + 1;            % classical DOF    nodaldofs(n).list = [numdofs];    dofinfo(numdofs) = n;             % node number for dof equal to numdofs  endendreturnend%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Purpose% =======% Plot nodes%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function plotnodes(xe, coord) close all;x = coord(:,1);width = 6;     % Width in inchesheight = 4;    % Height in inchesalw = 5.0;     % AxesLineWidthfsz = 18;      % Fontsizelw = 2.0;      % LineWidthfigureset(gcf,'InvertHardcopy','on');set(gcf,'PaperUnits', 'inches');pos = get(gcf, 'Position');set(gcf, 'Position', [pos(1) pos(2) width*1000, height*1000]);set(gca, 'FontSize', fsz, 'LineWidth', alw);set(get(gca,'xlabel'),'FontSize', fsz, 'FontWeight', 'Bold');set(get(gca,'ylabel'),'FontSize', fsz, 'FontWeight', 'Bold');set(get(gca,'title'),'FontSize', fsz, 'FontWeight', 'Bold');hold on;axis([min(xe) max(xe) -1.0/5.0 1.0/5.0 ]);xlabel('x','FontSize', fsz);% plot(xe, zeros(length(xe),1), 'mo', 'LineWidth', lw, ...    'MarkerEdgeColor', 'k', 'MarkerFaceColor', [.49 1 .63], ...    'MarkerSize', 15);plot(x, zeros(length(x),1),'x','Linewidth', lw, ...    'MarkerEdgeColor','k','MarkerFaceColor','r','MarkerSize',15);legend('Element Boundary Nodes', 'FE Nodes')returnend%----------------------------------------------------------------------------% Function Syntax% ===============% function [coord,connect] = mesh(meshtype, param, options)%% Inputs% ======   % mesh generated on [rin rout]% mesh type: 1 = uniform, 2 = logarithmic, 3 = exponential% % options             : data structure with element information %% Outputs% =======        % coord(:)            : 1D array which stores the global coordinates of%                       the nodes; coord(I,1) : node I coordinates% connect(:,:)        : nodal connectivity; connect(i,j) = index of basis%                       node corresponding to local node j of element i% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function meshsetup = mesher(meshtype, param, meshopts)element_type = meshopts.element_type;switch element_type  case 'spectral'  otherwise    fprintf('Mesh generator not coded for element type = %s \n',element_type);    error('Aborting . .');endp      = meshopts.element_order;numel  = meshopts.numel;domain = meshopts.domain;plot   = meshopts.verbose;rmin   = domain(1);rmax = domain(2);xin = linspace(-1.0, 1.0, p+1);numnod = p*numel + 1;% Checks:if (rmax <= rmin)    error('Error! rmax <= rmin. Aborting . .'); endif (numel < 1)    error('Error! Number of elements < 1. Aborting . .');endswitch meshtype    case 1      % uniform        xe = linspace(rmin, rmax, numel+1);    case 2      % logarithmic        % using DOI: 10.1016/j.cpc.2013.02.014        % dx_Ne/dx_1 = mpars(1) = a;        % dx_{i+1}/dx_i = q, where dx_i = length of i-th element        % => r = mpars(1)^(1/(Ne - 1))        % x_i = (b - a)(q^i - 1)/(q^Ne - 1) + a,         % where x_i = right boundary of i-th element        % Some Checks:        if (numel < 2), error('Error! Logarithmic mesh requires numel >= 2. Aborting . . .'); end        a = param;        if (a == 1), error('Error! Logarithmic mesh requires a != 1. Aborting . . .'); end        % xe(i/i+1) = coord of left/right boundary of ith element        xe = zeros(numel+1, 1);        xe(1,1) = rmin; xe(end,1) = rmax;        q = a^(1/(numel - 1));        for i = 1:numel            xe(i+1,1) = (q^i - 1.0)/(q^numel - 1.0)*(rmax - rmin) + rmin;        end        disp(' ')         case 3      % exponential mesh (Not tested)              a = param;        if (a < 0)            error('Error! a > 0 required. Aborting . .');        elseif (a == 1)            alpha = (rmax - rmin)/numel;            for i = 1:numel+1                xe(i) = alpha*(i - 1.0) + rmin;            end        else                if (numel > 1)                xe = zeros(numel+1,1);                beta = log(a)/(numel - 1);                alpha = (rmax - rmin)/(exp(beta*numel) - 1.0);                for i = 1:numel+1                     xe(i) = alpha*(exp(beta*(i - 1)) - 1.0) + rmin;                end             elseif (numel == 1)                xe(1) = rmin;                xe(2) = rmax;            else                error('Error! numel >= 1 required. Aborting . .');            end        end    otherwise         error('More coming soon!');end% % Generate nodal coordinates in equi-spaced settings% coord  = zeros(numnod, 1);for e = 1:numel    coord((e-1)*(p+1)+1:e*(p+1),1) = linspace(xe(e), xe(e+1), p+1);end%% connectivity%connect = zeros(numel,p+1);for e = 1:numel  is = p*(e-1) + 1;   connect(e,:) = is:is+p;end%% modify nodal coordinates (Lobatto points)%if (p >= 2)  xin = lobatto_points(p+1);  for e = 1:numel    is = p*(e-1) + 1;     a = xe(e); b = xe(e+1);%     a = coord(is,:); b = coord(is+p,:);    for n = is:is+p      index = n-is+1;      coord(n,:) = 0.5*(b + a) + 0.5*(b - a).*xin(index);    end  endendmeshsetup = struct('elemendcoord',xe, 'parentnodecoord',xin, 'coord',coord, 'connect',connect);%-------------------------------------------------------------------% Mesh plotting%-------------------------------------------------------------------if (strcmp(plot,'on'))    if numel < 10 && p <= 5        plotnodes(xe, coord);        hold off;    endelse    fprintf('\n');    fprintf('Disabling mesh-plotting because of too many elements/basis functions. \n');    fprintf('\n');endreturnendfunction w = lobatto_weights(n)w = ones(1,n);switch n   case(2)      w(1)=1.0000000000000000000000000000000;      w(2)=1.0000000000000000000000000000000;   case(3)      w(1)=0.33333333333333333333333333333333;      w(2)=1.3333333333333333333333333333333;      w(3)=0.33333333333333333333333333333333;   case(4)      w(1)=0.16666666666666666666666666666667;      w(2)=0.83333333333333333333333333333333;      w(3)=0.83333333333333333333333333333333;      w(4)=0.16666666666666666666666666666667;   case(5)      w(1)=0.10000000000000000000000000000000;      w(2)=0.54444444444444444444444444444444;      w(3)=0.71111111111111111111111111111111;      w(4)=0.54444444444444444444444444444444;      w(5)=0.10000000000000000000000000000000;   case(6)      w(1)=0.066666666666666666666666666666667;      w(2)=0.37847495629784698031661280821202;      w(3)=0.55485837703548635301672052512131;      w(4)=0.55485837703548635301672052512131;      w(5)=0.37847495629784698031661280821202;      w(6)=0.066666666666666666666666666666667;   case(7)      w(1)=0.047619047619047619047619047619048;      w(2)=0.27682604736156594801070040629007;      w(3)=0.43174538120986262341787102228136;      w(4)=0.48761904761904761904761904761905;      w(5)=0.43174538120986262341787102228136;      w(6)=0.27682604736156594801070040629007;      w(7)=0.047619047619047619047619047619048;   case(8)      w(1)=0.035714285714285714285714285714286;      w(2)=0.21070422714350603938299206577576;      w(3)=0.34112269248350436476424067710775;      w(4)=0.41245879465870388156705297140221;      w(5)=0.41245879465870388156705297140221;      w(6)=0.34112269248350436476424067710775;      w(7)=0.21070422714350603938299206577576;      w(8)=0.035714285714285714285714285714286;   case(9)      w(1)=0.027777777777777777777777777777778;      w(2)=0.16549536156080552504633972002921;      w(3)=0.27453871250016173528070561857937;      w(4)=0.34642851097304634511513153213972;      w(5)=0.37151927437641723356009070294785;      w(6)=0.34642851097304634511513153213972;      w(7)=0.27453871250016173528070561857937;      w(8)=0.16549536156080552504633972002921;      w(9)=0.027777777777777777777777777777778;   case(10)      w(1)=0.022222222222222222222222222222222;      w(2)=0.13330599085107011112622717075539;      w(3)=0.22488934206312645211945782173105;      w(4)=0.29204268367968375787558225737444;      w(5)=0.32753976118389745665651052791689;      w(6)=0.32753976118389745665651052791689;      w(7)=0.29204268367968375787558225737444;      w(8)=0.22488934206312645211945782173105;      w(9)=0.13330599085107011112622717075539;      w(10)=0.022222222222222222222222222222222;   case(11)      w(1)=0.018181818181818181818181818181818;      w(2)=0.10961227326699486446140344958035;      w(3)=0.18716988178030520410814152189943;      w(4)=0.24804810426402831404008486642187;      w(5)=0.28687912477900808867922240333154;      w(6)=0.30021759545569069378593188116998;      w(7)=0.28687912477900808867922240333154;      w(8)=0.24804810426402831404008486642187;      w(9)=0.18716988178030520410814152189943;      w(10)=0.10961227326699486446140344958035;      w(11)=0.018181818181818181818181818181818;   case(12)      w(1)=0.015151515151515151515151515151515;      w(2)=0.091684517413196130668342594134079;      w(3)=0.15797470556437011516467106270034;      w(4)=0.21250841776102114535830207736687;      w(5)=0.25127560319920128029324441214760;      w(6)=0.27140524091069617700028833849960;      w(7)=0.27140524091069617700028833849960;      w(8)=0.25127560319920128029324441214760;      w(9)=0.21250841776102114535830207736687;      w(10)=0.15797470556437011516467106270034;      w(11)=0.091684517413196130668342594134079;      w(12)=0.015151515151515151515151515151515;   case(13)      w(1)=0.012820512820512820512820512820513;      w(2)=0.077801686746818927793588988333134;      w(3)=0.13498192668960834911991476258937;      w(4)=0.18364686520355009200749425874681;      w(5)=0.22076779356611008608553400837940;      w(6)=0.24401579030667635645857814836016;      w(7)=0.25193084933344673604413864154124;      w(8)=0.24401579030667635645857814836016;      w(9)=0.22076779356611008608553400837940;      w(10)=0.18364686520355009200749425874681;      w(11)=0.13498192668960834911991476258937;      w(12)=0.077801686746818927793588988333134;      w(13)=0.012820512820512820512820512820513;   case(14)      w(1)=0.010989010989010989010989010989011;      w(2)=0.066837284497681284634070660746053;      w(3)=0.11658665589871165154099667065465;      w(4)=0.16002185176295214241282099798759;      w(5)=0.19482614937341611864033177837588;      w(6)=0.21912625300977075487116252395417;      w(7)=0.23161279446845705888962835729264;      w(8)=0.23161279446845705888962835729264;      w(9)=0.21912625300977075487116252395417;      w(10)=0.19482614937341611864033177837588;      w(11)=0.16002185176295214241282099798759;      w(12)=0.11658665589871165154099667065465;      w(13)=0.066837284497681284634070660746053;      w(14)=0.010989010989010989010989010989011;   case(15)      w(1)=0.0095238095238095238095238095238095;      w(2)=0.058029893028601249096880584025282;      w(3)=0.10166007032571806760366617078880;      w(4)=0.14051169980242810946044680564367;      w(5)=0.17278964725360094905207709940835;      w(6)=0.19698723596461335609250034650741;      w(7)=0.21197358592682092012743007697722;      w(8)=0.21704811634881564951495021425091;      w(9)=0.21197358592682092012743007697722;      w(10)=0.19698723596461335609250034650741;      w(11)=0.17278964725360094905207709940835;      w(12)=0.14051169980242810946044680564367;      w(13)=0.10166007032571806760366617078880;      w(14)=0.058029893028601249096880584025282;      w(15)=0.0095238095238095238095238095238095;   case(16)      w(1)=0.0083333333333333333333333333333333;      w(2)=0.050850361005919905403244919565455;      w(3)=0.089393697325930800991052080166084;      w(4)=0.12425538213251409834953633265731;      w(5)=0.15402698080716428081564494048499;      w(6)=0.17749191339170412530107566952836;      w(7)=0.19369002382520358431691359885352;      w(8)=0.20195830817822987148919912541094;      w(9)=0.20195830817822987148919912541094;      w(10)=0.19369002382520358431691359885352;      w(11)=0.17749191339170412530107566952836;      w(12)=0.15402698080716428081564494048499;      w(13)=0.12425538213251409834953633265731;      w(14)=0.089393697325930800991052080166084;      w(15)=0.050850361005919905403244919565455;      w(16)=0.0083333333333333333333333333333333;   case(17)      w(1)=0.0073529411764705882352941176470588;      w(2)=0.044921940543254209647400954623212;      w(3)=0.079198270503687119190264429952835;      w(4)=0.11059290900702816137577270522008;      w(5)=0.13798774620192655905620157495403;      w(6)=0.16039466199762153951632836586475;      w(7)=0.17700425351565787043694574536329;      w(8)=0.18721633967761923589208848286062;      w(9)=0.19066187475346943329940724702825;      w(10)=0.18721633967761923589208848286062;      w(11)=0.17700425351565787043694574536329;      w(12)=0.16039466199762153951632836586475;      w(13)=0.13798774620192655905620157495403;      w(14)=0.11059290900702816137577270522008;      w(15)=0.079198270503687119190264429952835;      w(16)=0.044921940543254209647400954623212;      w(17)=0.0073529411764705882352941176470588;   case(18)      w(1)=0.0065359477124183006535947712418301;      w(2)=0.039970628810914066137599176410101;      w(3)=0.070637166885633664999222960167786;      w(4)=0.099016271717502802394423605318672;      w(5)=0.12421053313296710026339635889675;      w(6)=0.14541196157380226798300321049443;      w(7)=0.16193951723760248926432670670023;      w(8)=0.17326210948945622601061440382668;      w(9)=0.17901586343970308229381880694353;      w(10)=0.17901586343970308229381880694353;      w(11)=0.17326210948945622601061440382668;      w(12)=0.16193951723760248926432670670023;      w(13)=0.14541196157380226798300321049443;      w(14)=0.12421053313296710026339635889675;      w(15)=0.099016271717502802394423605318672;      w(16)=0.070637166885633664999222960167786;      w(17)=0.039970628810914066137599176410101;      w(18)=0.0065359477124183006535947712418301;   case(19)      w(1)=0.0058479532163742690058479532163743;      w(2)=0.035793365186176477115425569035122;      w(3)=0.063381891762629736851695690418317;      w(4)=0.089131757099207084448008790556153;      w(5)=0.11231534147730504407091001546378;      w(6)=0.13226728044875077692604673390973;      w(7)=0.14841394259593888500968064366841;      w(8)=0.16029092404406124197991096818359;      w(9)=0.16755658452714286727013727774026;      w(10)=0.17000191928482723464467271561652;      w(11)=0.16755658452714286727013727774026;      w(12)=0.16029092404406124197991096818359;      w(13)=0.14841394259593888500968064366841;      w(14)=0.13226728044875077692604673390973;      w(15)=0.11231534147730504407091001546378;      w(16)=0.089131757099207084448008790556153;      w(17)=0.063381891762629736851695690418317;      w(18)=0.035793365186176477115425569035122;      w(19)=0.0058479532163742690058479532163743;   case(20)      w(1)=0.0052631578947368421052631578947368;      w(2)=0.032237123188488941491605028117294;      w(3)=0.057181802127566826004753627173243;      w(4)=0.080631763996119603144776846113721;      w(5)=0.10199149969945081568378120573289;      w(6)=0.12070922762867472509942970500239;      w(7)=0.13630048235872418448978079298903;      w(8)=0.14836155407091682581471301373397;      w(9)=0.15658010264747548715816989679364;      w(10)=0.16074328638784574900772672644908;      w(11)=0.16074328638784574900772672644908;      w(12)=0.15658010264747548715816989679364;      w(13)=0.14836155407091682581471301373397;      w(14)=0.13630048235872418448978079298903;      w(15)=0.12070922762867472509942970500239;      w(16)=0.10199149969945081568378120573289;      w(17)=0.080631763996119603144776846113721;      w(18)=0.057181802127566826004753627173243;      w(19)=0.032237123188488941491605028117294;      w(20)=0.0052631578947368421052631578947368;   case(21)      w(1)=0.0047619047619047619047619047619048;      w(2)=0.029184840098505458609458543613171;      w(3)=0.051843169000849625072722971852830;      w(4)=0.073273918185074144252547861041894;      w(5)=0.092985467957886065301137664149214;      w(6)=0.11051708321912333526700048678439;      w(7)=0.12545812119086894801515753570800;      w(8)=0.13745846286004134358089961741515;      w(9)=0.14623686244797745926727053063439;      w(10)=0.15158757511168138445325068150529;      w(11)=0.15338519033217494855158440506754;      w(12)=0.15158757511168138445325068150529;      w(13)=0.14623686244797745926727053063439;      w(14)=0.13745846286004134358089961741515;      w(15)=0.12545812119086894801515753570800;      w(16)=0.11051708321912333526700048678439;      w(17)=0.092985467957886065301137664149214;      w(18)=0.073273918185074144252547861041894;      w(19)=0.051843169000849625072722971852830;      w(20)=0.029184840098505458609458543613171;      w(21)=0.0047619047619047619047619047619048;   case(22)      w(1)=0.0043290043290043290043290043290043;      w(2)=0.026545747682501757911627904520543;      w(3)=0.047214465293740752123775734864792;      w(4)=0.066865605864553076012404194157097;      w(5)=0.085090060391838447815711236095748;      w(6)=0.10150057480164767437243730374960;      w(7)=0.11574764465393906659003636772146;      w(8)=0.12752769665343027553084445930883;      w(9)=0.13658968861374142668617736220617;      w(10)=0.14274049227136140033623599356679;      w(11)=0.14584901944424179361642043947997;      w(12)=0.14584901944424179361642043947997;      w(13)=0.14274049227136140033623599356679;      w(14)=0.13658968861374142668617736220617;      w(15)=0.12752769665343027553084445930883;      w(16)=0.11574764465393906659003636772146;      w(17)=0.10150057480164767437243730374960;      w(18)=0.085090060391838447815711236095748;      w(19)=0.066865605864553076012404194157097;      w(20)=0.047214465293740752123775734864792;      w(21)=0.026545747682501757911627904520543;      w(22)=0.0043290043290043290043290043290043;   case(23)      w(1)=0.0039525691699604743083003952569170;      w(2)=0.024248600771531736517399658937097;      w(3)=0.043175871170241834748876465612042;      w(4)=0.061252477129554206381382847440355;      w(5)=0.078135449475569989741934255347965;      w(6)=0.093497246163512341833500706906697;      w(7)=0.10703910172433651153518362791547;      w(8)=0.11849751066274913130212600472426;      w(9)=0.12764947470175887663614855305567;      w(10)=0.13431687263860381990156489770071;      w(11)=0.13836993638580739452350273386294;      w(12)=0.13972978001274736514015970647975;      w(13)=0.13836993638580739452350273386294;      w(14)=0.13431687263860381990156489770071;      w(15)=0.12764947470175887663614855305567;      w(16)=0.11849751066274913130212600472426;      w(17)=0.10703910172433651153518362791547;      w(18)=0.093497246163512341833500706906697;      w(19)=0.078135449475569989741934255347965;      w(20)=0.061252477129554206381382847440355;      w(21)=0.043175871170241834748876465612042;      w(22)=0.024248600771531736517399658937097;      w(23)=0.0039525691699604743083003952569170;   case(24)      w(1)=0.0036231884057971014492753623188406;      w(2)=0.022236853464711208992960434817299;      w(3)=0.039631681333467809469262163363472;      w(4)=0.056309848724646199020948339678118;      w(5)=0.071981862055293982215639060668680;      w(6)=0.086369029967929068216562819306583;      w(7)=0.099214827684083587414149770995712;      w(8)=0.11029008689296860411042412302760;      w(9)=0.11939719370249131903229388835072;      w(10)=0.12637364202802080012724809069137;      w(11)=0.13109494187360394235445022581653;      w(12)=0.13347684386698637759678572096508;      w(13)=0.13347684386698637759678572096508;      w(14)=0.13109494187360394235445022581653;      w(15)=0.12637364202802080012724809069137;      w(16)=0.11939719370249131903229388835072;      w(17)=0.11029008689296860411042412302760;      w(18)=0.099214827684083587414149770995712;      w(19)=0.086369029967929068216562819306583;      w(20)=0.071981862055293982215639060668680;      w(21)=0.056309848724646199020948339678118;      w(22)=0.039631681333467809469262163363472;      w(23)=0.022236853464711208992960434817299;      w(24)=0.0036231884057971014492753623188406;   case(25)      w(1)=0.0033333333333333333333333333333333;      w(2)=0.020465168932974385308542471819163;      w(3)=0.036504738794271372032382988755110;      w(4)=0.051936228368491474643333889713489;      w(5)=0.066513728675312784693869993313599;      w(6)=0.079998774836292981801626436138836;      w(7)=0.092170139910620421912689622714049;      w(8)=0.10282803034795783082750364490713;      w(9)=0.11179746626832088815624423243104;      w(10)=0.11893117940681182540944424463419;      w(11)=0.12411203893795029069521531243930;      w(12)=0.12725497753833144701711441673876;      w(13)=0.12830838929866192833739882612401;      w(14)=0.12725497753833144701711441673876;      w(15)=0.12411203893795029069521531243930;      w(16)=0.11893117940681182540944424463419;      w(17)=0.11179746626832088815624423243104;      w(18)=0.10282803034795783082750364490713;      w(19)=0.092170139910620421912689622714049;      w(20)=0.079998774836292981801626436138836;      w(21)=0.066513728675312784693869993313599;      w(22)=0.051936228368491474643333889713489;      w(23)=0.036504738794271372032382988755110;      w(24)=0.020465168932974385308542471819163;      w(25)=0.0033333333333333333333333333333333;   case(26)      w(1)=0.0030769230769230769230769230769231;      w(2)=0.018896858024263465581352047676267;      w(3)=0.033732303685955999377522748582756;      w(4)=0.048048399081180627315979312780662;      w(5)=0.061635025142547402782180054104279;      w(6)=0.074287050122291137316084082986249;      w(7)=0.085812863980004362187481252359068;      w(8)=0.096037802353901310803697396370862;      w(9)=0.10480688623073705298990583689136;      w(10)=0.11198719411986033530021087987989;      w(11)=0.11746988409380900707669562029648;      w(12)=0.12117184628844334604428669570423;      w(13)=0.12303696380008287630152714929097;      w(14)=0.12303696380008287630152714929097;      w(15)=0.12117184628844334604428669570423;      w(16)=0.11746988409380900707669562029648;      w(17)=0.11198719411986033530021087987989;      w(18)=0.10480688623073705298990583689136;      w(19)=0.096037802353901310803697396370862;      w(20)=0.085812863980004362187481252359068;      w(21)=0.074287050122291137316084082986249;      w(22)=0.061635025142547402782180054104279;      w(23)=0.048048399081180627315979312780662;      w(24)=0.033732303685955999377522748582756;      w(25)=0.018896858024263465581352047676267;      w(26)=0.0030769230769230769230769230769231;   case(27)      w(1)=0.0028490028490028490028490028490028;      w(2)=0.017501974876065579019369734362719;      w(3)=0.031262951735202384324784990064795;      w(4)=0.044577657933061698744074742241386;      w(5)=0.057265569680162731739087228253941;      w(6)=0.069149342360043276280634735030127;      w(7)=0.080062321970538458168238070483950;      w(8)=0.089851365259290559972136301946063;      w(9)=0.098379074585952763179308931269989;      w(10)=0.10552574782125301121838198947990;      w(11)=0.11119106525743703292826195934215;      w(12)=0.11529550025465198281375333337473;      w(13)=0.11778143658595615906649907944836;      w(14)=0.11861397766276302708523980370575;      w(15)=0.11778143658595615906649907944836;      w(16)=0.11529550025465198281375333337473;      w(17)=0.11119106525743703292826195934215;      w(18)=0.10552574782125301121838198947990;      w(19)=0.098379074585952763179308931269989;      w(20)=0.089851365259290559972136301946063;      w(21)=0.080062321970538458168238070483950;      w(22)=0.069149342360043276280634735030127;      w(23)=0.057265569680162731739087228253941;      w(24)=0.044577657933061698744074742241386;      w(25)=0.031262951735202384324784990064795;      w(26)=0.017501974876065579019369734362719;      w(27)=0.0028490028490028490028490028490028;   case(28)      w(1)=0.0026455026455026455026455026455026;      w(2)=0.016255883957504218198990152897110;      w(3)=0.029054220677979144706852779823582;      w(4)=0.041466915243006721037985848778627;      w(5)=0.053338077047327488400325513471500;      w(6)=0.064513658080354538390245693462478;      w(7)=0.074848123509707702780567939143162;      w(8)=0.084206795121510325739491187797920;      w(9)=0.092467685997712175722035394699386;      w(10)=0.099523110412495672875945354750915;      w(11)=0.10528109376105589448237755179491;      w(12)=0.10966657379597662508858586379121;      w(13)=0.11262238007723901254063642411366;      w(14)=0.11410997967262783453331479283004;      w(15)=0.11410997967262783453331479283004;      w(16)=0.11262238007723901254063642411366;      w(17)=0.10966657379597662508858586379121;      w(18)=0.10528109376105589448237755179491;      w(19)=0.099523110412495672875945354750915;      w(20)=0.092467685997712175722035394699386;      w(21)=0.084206795121510325739491187797920;      w(22)=0.074848123509707702780567939143162;      w(23)=0.064513658080354538390245693462478;      w(24)=0.053338077047327488400325513471500;      w(25)=0.041466915243006721037985848778627;      w(26)=0.029054220677979144706852779823582;      w(27)=0.016255883957504218198990152897110;      w(28)=0.0026455026455026455026455026455026;   case(29)      w(1)=0.0024630541871921182266009852216749;      w(2)=0.015138169859967596790857926606856;      w(3)=0.027070806296824827540851425445026;      w(4)=0.038668439979712979747832574267124;      w(5)=0.049795809093237560922668341175478;      w(6)=0.060318503828522735028064463517634;      w(7)=0.070108938000597999185266858424014;      w(8)=0.079048313027885601784170232175109;      w(9)=0.087028133441135605637626155215633;      w(10)=0.093951542114796312497836506987570;      w(11)=0.099734501637149860653569177534068;      w(12)=0.10430681646367653742270711219124;      w(13)=0.10761298583356853937358685404661;      w(14)=0.10961287784589042013213241075660;      w(15)=0.11028221677968261011245795287074;      w(16)=0.10961287784589042013213241075660;      w(17)=0.10761298583356853937358685404661;      w(18)=0.10430681646367653742270711219124;      w(19)=0.099734501637149860653569177534068;      w(20)=0.093951542114796312497836506987570;      w(21)=0.087028133441135605637626155215633;      w(22)=0.079048313027885601784170232175109;      w(23)=0.070108938000597999185266858424014;      w(24)=0.060318503828522735028064463517634;      w(25)=0.049795809093237560922668341175478;      w(26)=0.038668439979712979747832574267124;      w(27)=0.027070806296824827540851425445026;      w(28)=0.015138169859967596790857926606856;      w(29)=0.0024630541871921182266009852216749;   case(30)      w(1)=0.0022988505747126436781609195402299;      w(2)=0.014131799327905387640732168668208;      w(3)=0.025283166740551402204268253850042;      w(4)=0.036142094199408535314732683123360;      w(5)=0.046590694533142927401880491446022;      w(6)=0.056511197923080383302193710472303;      w(7)=0.065791336397790054944101374593132;      w(8)=0.074326003324718253834067642000831;      w(9)=0.082018512833406914799721545527160;      w(10)=0.088781712319765210167256434455921;      w(11)=0.094538975193860891781132715364036;      w(12)=0.099225071004299830657675964954309;      w(13)=0.10278690530723498947028080833538;      w(14)=0.10518412159645464985621298085914;      w(15)=0.10638955872366792494758230680993;      w(16)=0.10638955872366792494758230680993;      w(17)=0.10518412159645464985621298085914;      w(18)=0.10278690530723498947028080833538;      w(19)=0.099225071004299830657675964954309;      w(20)=0.094538975193860891781132715364036;      w(21)=0.088781712319765210167256434455921;      w(22)=0.082018512833406914799721545527160;      w(23)=0.074326003324718253834067642000831;      w(24)=0.065791336397790054944101374593132;      w(25)=0.056511197923080383302193710472303;      w(26)=0.046590694533142927401880491446022;      w(27)=0.036142094199408535314732683123360;      w(28)=0.025283166740551402204268253850042;      w(29)=0.014131799327905387640732168668208;      w(30)=0.0022988505747126436781609195402299;   case(31)      w(1)=0.0021505376344086021505376344086022;      w(2)=0.013222471025464670302635629869835;      w(3)=0.023666433230270316730045782709426;      w(4)=0.033853940405224057629810846931873;      w(5)=0.043681818160066912829747288083268;      w(6)=0.053046465493448782774280860067640;      w(7)=0.061848741290454623390748584002232;      w(8)=0.069995377594100570450215353373140;      w(9)=0.077400032341475618634283878417423;      w(10)=0.083984220517529730665258108226376;      w(11)=0.089678151045260822248142932836209;      w(12)=0.094421468377857957432190489816534;      w(13)=0.098163893013712757119741879401421;      w(14)=0.10086575479865051339556259610285;      w(15)=0.10249841359547039767590565499043;      w(16)=0.10304456295320733314178496152549;      w(17)=0.10249841359547039767590565499043;      w(18)=0.10086575479865051339556259610285;      w(19)=0.098163893013712757119741879401421;      w(20)=0.094421468377857957432190489816534;      w(21)=0.089678151045260822248142932836209;      w(22)=0.083984220517529730665258108226376;      w(23)=0.077400032341475618634283878417423;      w(24)=0.069995377594100570450215353373140;      w(25)=0.061848741290454623390748584002232;      w(26)=0.053046465493448782774280860067640;      w(27)=0.043681818160066912829747288083268;      w(28)=0.033853940405224057629810846931873;      w(29)=0.023666433230270316730045782709426;      w(30)=0.013222471025464670302635629869835;      w(31)=0.0021505376344086021505376344086022   case(32)      w(1)=0.0020161290322580645161290322580645;      w(2)=0.012398106501373843788620349229117;      w(3)=0.022199552889291964623832171161080;      w(4)=0.031775135410915465781562278917906;      w(5)=0.041034201586062723330403841719016;      w(6)=0.049885271336221207011960153724443;      w(7)=0.058240497248055869550798929919204;      w(8)=0.066016877257154543932436331683494;      w(9)=0.073137139602679032640370983569209;      w(10)=0.079530525692106252292356728883049;      w(11)=0.085133497949668230527527658506617;      w(12)=0.089890372957357833072124789584664;      w(13)=0.093753875546813813565908354145794;      w(14)=0.096685608948002600560378147706395;      w(15)=0.098656436540761777170651164243408;      w(16)=0.099646771501276777634939084748541;      w(17)=0.099646771501276777634939084748541;      w(18)=0.098656436540761777170651164243408;      w(19)=0.096685608948002600560378147706395;      w(20)=0.093753875546813813565908354145794;      w(21)=0.089890372957357833072124789584664;      w(22)=0.085133497949668230527527658506617;      w(23)=0.079530525692106252292356728883049;      w(24)=0.073137139602679032640370983569209;      w(25)=0.066016877257154543932436331683494;      w(26)=0.058240497248055869550798929919204;      w(27)=0.049885271336221207011960153724443;      w(28)=0.041034201586062723330403841719016;      w(29)=0.031775135410915465781562278917906;      w(30)=0.022199552889291964623832171161080;      w(31)=0.012398106501373843788620349229117;      w(32)=0.0020161290322580645161290322580645;   case(33)      w(1)= 0.0018939393939393939393939393939394;      w(2)=0.011648448392267734651222179870285;      w(3)=0.020864609017603360095811664182613;      w(4)=0.029881045916746477519971156454995;      w(5)=0.038617814771813967563858875675217;      w(6)=0.046993850461024170547973112041225;      w(7)=0.054931059442626967951698841306657;      w(8)=0.062355367852465305441060959167732;      w(9)=0.069197469494016147559969796800326;      w(10)=0.075393486923973828507129918402909;      w(11)=0.080885572193455092179707696772196;      w(12)=0.085622448531813132550191963745865;      w(13)=0.089559889747077400661148462725561;      w(14)=0.092661133442241463529935120285105;      w(15)=0.094897224394591815824355414662604;      w(16)=0.096247284972985461996554494277935;      w(17)=0.096698710102716558960032808469672;      w(18)=0.096247284972985461996554494277935;      w(19)=0.094897224394591815824355414662604;      w(20)=0.092661133442241463529935120285105;      w(21)=0.089559889747077400661148462725561;      w(22)=0.085622448531813132550191963745865;      w(23)=0.080885572193455092179707696772196;      w(24)=0.075393486923973828507129918402909;      w(25)=0.069197469494016147559969796800326;      w(26)=0.062355367852465305441060959167732;      w(27)=0.054931059442626967951698841306657;      w(28)=0.046993850461024170547973112041225;      w(29)=0.038617814771813967563858875675217;      w(30)=0.029881045916746477519971156454995;      w(31)=0.020864609017603360095811664182613;      w(32)=0.011648448392267734651222179870285;      w(33)=0.0018939393939393939393939393939394;   otherwise      error('LOBATTO_WEIGHTS - Fatal error! Illegal value of n.');endreturnendfunction xi = lobatto_points(n)xi = ones(1,n);switch n   case(2)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=1.0000000000000000000000000000000;   case(3)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=0.0;      xi(3)=1.0000000000000000000000000000000;   case(4)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.44721359549995793928183473374626;      xi(3)=0.44721359549995793928183473374626;      xi(4)=1.0000000000000000000000000000000;   case(5)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.65465367070797714379829245624686;      xi(3)=0.0;      xi(4)=0.65465367070797714379829245624686;      xi(5)=1.0000000000000000000000000000000;   case(6)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.76505532392946469285100297395934;      xi(3)=-0.28523151648064509631415099404088;      xi(4)=0.28523151648064509631415099404088;      xi(5)=0.76505532392946469285100297395934;      xi(6)=1.0000000000000000000000000000000;   case(7)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.83022389627856692987203221396747;      xi(3)=-0.46884879347071421380377188190877;      xi(4)=0.0;      xi(5)=0.46884879347071421380377188190877;      xi(6)=0.83022389627856692987203221396747;      xi(7)=1.0000000000000000000000000000000;   case(8)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.87174014850960661533744576122066;      xi(3)=-0.59170018143314230214451073139795;      xi(4)=-0.20929921790247886876865726034535;      xi(5)=0.20929921790247886876865726034535;      xi(6)=0.59170018143314230214451073139795;      xi(7)=0.87174014850960661533744576122066;      xi(8)=1.0000000000000000000000000000000;   case(9)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.89975799541146015731234524441834;      xi(3)=-0.67718627951073775344588542709134;      xi(4)=-0.36311746382617815871075206870866;      xi(5)=0.0;      xi(6)=0.36311746382617815871075206870866;      xi(7)=0.67718627951073775344588542709134;      xi(8)=0.89975799541146015731234524441834;      xi(9)=1.0000000000000000000000000000000;   case(10)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.91953390816645881382893266082234;      xi(3)=-0.73877386510550507500310617485983;      xi(4)=-0.47792494981044449566117509273126;      xi(5)=-0.16527895766638702462621976595817;      xi(6)=0.16527895766638702462621976595817;      xi(7)=0.47792494981044449566117509273126;      xi(8)=0.73877386510550507500310617485983;      xi(9)=0.91953390816645881382893266082234;      xi(10)=1.0000000000000000000000000000000;   case(11)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.93400143040805913433227413609938;      xi(3)=-0.78448347366314441862241781610846;      xi(4)=-0.56523532699620500647096396947775;      xi(5)=-0.29575813558693939143191151555906;      xi(6)=0.0;      xi(7)=0.29575813558693939143191151555906;      xi(8)=0.56523532699620500647096396947775;      xi(9)=0.78448347366314441862241781610846;      xi(10)=0.93400143040805913433227413609938;      xi(11)=1.0000000000000000000000000000000;   case(12)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.94489927222288222340758013830322;      xi(3)=-0.81927932164400667834864158171690;      xi(4)=-0.63287615303186067766240485444366;      xi(5)=-0.39953094096534893226434979156697;      xi(6)=-0.13655293285492755486406185573969;      xi(7)=0.13655293285492755486406185573969;      xi(8)=0.39953094096534893226434979156697;      xi(9)=0.63287615303186067766240485444366;      xi(10)=0.81927932164400667834864158171690;      xi(11)=0.94489927222288222340758013830322;      xi(12)=1.0000000000000000000000000000000;   case(13)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.95330984664216391189690546475545;      xi(3)=-0.84634756465187231686592560709875;      xi(4)=-0.68618846908175742607275903956636;      xi(5)=-0.48290982109133620174693723363693;      xi(6)=-0.24928693010623999256867370037423;      xi(7)=0.0;      xi(8)=0.24928693010623999256867370037423;      xi(9)=0.48290982109133620174693723363693;      xi(10)=0.68618846908175742607275903956636;      xi(11)=0.84634756465187231686592560709875;      xi(12)=0.95330984664216391189690546475545;      xi(13)=1.0000000000000000000000000000000;   case(14)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.95993504526726090135510016201542;      xi(3)=-0.86780105383034725100022020290826;      xi(4)=-0.72886859909132614058467240052088;      xi(5)=-0.55063940292864705531662270585908;      xi(6)=-0.34272401334271284504390340364167;      xi(7)=-0.11633186888370386765877670973616;      xi(8)=0.11633186888370386765877670973616;      xi(9)=0.34272401334271284504390340364167;      xi(10)=0.55063940292864705531662270585908;      xi(11)=0.72886859909132614058467240052088;      xi(12)=0.86780105383034725100022020290826;      xi(13)=0.95993504526726090135510016201542;      xi(14)=1.0000000000000000000000000000000;   case(15)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.96524592650383857279585139206960;      xi(3)=-0.88508204422297629882540163148223;      xi(4)=-0.76351968995181520070411847597629;      xi(5)=-0.60625320546984571112352993863673;      xi(6)=-0.42063805471367248092189693873858;      xi(7)=-0.21535395536379423822567944627292;      xi(8)=0.0;      xi(9)=0.21535395536379423822567944627292;      xi(10)=0.42063805471367248092189693873858;      xi(11)=0.60625320546984571112352993863673;      xi(12)=0.76351968995181520070411847597629;      xi(13)=0.88508204422297629882540163148223;      xi(14)=0.96524592650383857279585139206960;      xi(15)=1.0000000000000000000000000000000;   case(16)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.96956804627021793295224273836746;      xi(3)=-0.89920053309347209299462826151985;      xi(4)=-0.79200829186181506393108827096315;      xi(5)=-0.65238870288249308946788321964058;      xi(6)=-0.48605942188713761178189078584687;      xi(7)=-0.29983046890076320809835345472230;      xi(8)=-0.10132627352194944784303300504592;      xi(9)=0.10132627352194944784303300504592;      xi(10)=0.29983046890076320809835345472230;      xi(11)=0.48605942188713761178189078584687;      xi(12)=0.65238870288249308946788321964058;      xi(13)=0.79200829186181506393108827096315;      xi(14)=0.89920053309347209299462826151985;      xi(15)=0.96956804627021793295224273836746;      xi(16)=1.0000000000000000000000000000000;   case(17)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.97313217663141831415697950187372;      xi(3)=-0.91087999591557359562380250639773;      xi(4)=-0.81569625122177030710675055323753;      xi(5)=-0.69102898062768470539491935737245;      xi(6)=-0.54138539933010153912373340750406;      xi(7)=-0.37217443356547704190723468073526;      xi(8)=-0.18951197351831738830426301475311;      xi(9)=0.0;      xi(10)=0.18951197351831738830426301475311;      xi(11)=0.37217443356547704190723468073526;      xi(12)=0.54138539933010153912373340750406;      xi(13)=0.69102898062768470539491935737245;      xi(14)=0.81569625122177030710675055323753;      xi(15)=0.91087999591557359562380250639773;      xi(16)=0.97313217663141831415697950187372;      xi(17)=1.0000000000000000000000000000000;   case(18)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.97610555741219854286451892434170;      xi(3)=-0.92064918534753387383785462543128;      xi(4)=-0.83559353521809021371364636232794;      xi(5)=-0.72367932928324268130621036530207;      xi(6)=-0.58850483431866176117353589319356;      xi(7)=-0.43441503691212397534228713674067;      xi(8)=-0.26636265287828098416766533202560;      xi(9)=-0.089749093484652111022645010088562;      xi(10)=0.089749093484652111022645010088562;      xi(11)=0.26636265287828098416766533202560;      xi(12)=0.43441503691212397534228713674067;      xi(13)=0.58850483431866176117353589319356;      xi(14)=0.72367932928324268130621036530207;      xi(15)=0.83559353521809021371364636232794;      xi(16)=0.92064918534753387383785462543128;      xi(17)=0.97610555741219854286451892434170;      xi(18)=1.0000000000000000000000000000000;   case(19)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.97861176622208009515263406311022;      xi(3)=-0.92890152815258624371794025879655;      xi(4)=-0.85246057779664609308595597004106;      xi(5)=-0.75149420255261301416363748963394;      xi(6)=-0.62890813726522049776683230622873;      xi(7)=-0.48822928568071350277790963762492;      xi(8)=-0.33350484782449861029850010384493;      xi(9)=-0.16918602340928157137515415344488;      xi(10)=0.0;      xi(11)=0.16918602340928157137515415344488;      xi(12)=0.33350484782449861029850010384493;      xi(13)=0.48822928568071350277790963762492;      xi(14)=0.62890813726522049776683230622873;      xi(15)=0.75149420255261301416363748963394;      xi(16)=0.85246057779664609308595597004106;      xi(17)=0.92890152815258624371794025879655;      xi(18)=0.97861176622208009515263406311022;      xi(19)=1.0000000000000000000000000000000;   case(20)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.98074370489391417192544643858423;      xi(3)=-0.93593449881266543571618158493063;      xi(4)=-0.86687797808995014130984721461629;      xi(5)=-0.77536826095205587041431752759469;      xi(6)=-0.66377640229031128984640332297116;      xi(7)=-0.53499286403188626164813596182898;      xi(8)=-0.39235318371390929938647470381582;      xi(9)=-0.23955170592298649518240135692709;      xi(10)=-0.080545937238821837975944518159554;      xi(11)=0.080545937238821837975944518159554;      xi(12)=0.23955170592298649518240135692709;      xi(13)=0.39235318371390929938647470381582;      xi(14)=0.53499286403188626164813596182898;      xi(15)=0.66377640229031128984640332297116;      xi(16)=0.77536826095205587041431752759469;      xi(17)=0.86687797808995014130984721461629;      xi(18)=0.93593449881266543571618158493063;      xi(19)=0.98074370489391417192544643858423;      xi(20)=1.0000000000000000000000000000000;   case(21)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.98257229660454802823448127655541;      xi(3)=-0.94197629695974553429610265066144;      xi(4)=-0.87929475532359046445115359630494;      xi(5)=-0.79600192607771240474431258966036;      xi(6)=-0.69405102606222323262731639319467;      xi(7)=-0.57583196026183068692702187033809;      xi(8)=-0.44411578327900210119451634960735;      xi(9)=-0.30198985650876488727535186785875;      xi(10)=-0.15278551580218546600635832848567;      xi(11)=0.0;      xi(12)=0.15278551580218546600635832848567;      xi(13)=0.30198985650876488727535186785875;      xi(14)=0.44411578327900210119451634960735;      xi(15)=0.57583196026183068692702187033809;      xi(16)=0.69405102606222323262731639319467;      xi(17)=0.79600192607771240474431258966036;      xi(18)=0.87929475532359046445115359630494;      xi(19)=0.94197629695974553429610265066144;      xi(20)=0.98257229660454802823448127655541;      xi(21)=1.0000000000000000000000000000000;   case(22)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.98415243845764617655228962221207;      xi(3)=-0.94720428399922868052421376661573;      xi(4)=-0.89006229019090447052965782577909;      xi(5)=-0.81394892761192113604544184805614;      xi(6)=-0.72048723996120215811988189639847;      xi(7)=-0.61166943828425897122621160586993;      xi(8)=-0.48981487518990234980875123568327;      xi(9)=-0.35752071013891953806095728024018;      xi(10)=-0.21760658515928504178795509346539;      xi(11)=-0.073054540010898334761088790464107;      xi(12)=0.073054540010898334761088790464107;      xi(13)=0.21760658515928504178795509346539;      xi(14)=0.35752071013891953806095728024018;      xi(15)=0.48981487518990234980875123568327;      xi(16)=0.61166943828425897122621160586993;      xi(17)=0.72048723996120215811988189639847;      xi(18)=0.81394892761192113604544184805614;      xi(19)=0.89006229019090447052965782577909;      xi(20)=0.94720428399922868052421376661573;      xi(21)=0.98415243845764617655228962221207;      xi(22)=1.0000000000000000000000000000000;   case(23)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.98552715587873257808146276673810;      xi(3)=-0.95175795571071020413563967985143;      xi(4)=-0.89945855804034501095016032034737;      xi(5)=-0.82965109665128588622320061929000;      xi(6)=-0.74369504117206068394516354306700;      xi(7)=-0.64326364446013620847614553360277;      xi(8)=-0.53031177113684416813011532015230;      xi(9)=-0.40703793791447482919595048821510;      xi(10)=-0.27584154894579306710687763267914;      xi(11)=-0.13927620404066839859186261298277;      xi(12)=0.0;      xi(13)=0.13927620404066839859186261298277;      xi(14)=0.27584154894579306710687763267914;      xi(15)=0.40703793791447482919595048821510;      xi(16)=0.53031177113684416813011532015230;      xi(17)=0.64326364446013620847614553360277;      xi(18)=0.74369504117206068394516354306700;      xi(19)=0.82965109665128588622320061929000;      xi(20)=0.89945855804034501095016032034737;      xi(21)=0.95175795571071020413563967985143;      xi(22)=0.98552715587873257808146276673810;      xi(23)=1.0000000000000000000000000000000;   case(24)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.98673055350516088355308673815447;      xi(3)=-0.95574822092988635802697713055064;      xi(4)=-0.90770567511350652199515299646621;      xi(5)=-0.84346407015487204062330503742334;      xi(6)=-0.76417048242049330778737528095229;      xi(7)=-0.67124010526412869983566485818701;      xi(8)=-0.56633135797929531218940954454228;      xi(9)=-0.45131637321432261824821849156962;      xi(10)=-0.32824761337551091203338917935961;      xi(11)=-0.19932125339083266723657253912499;      xi(12)=-0.066837993737228578113641808391677;      xi(13)=0.066837993737228578113641808391677;      xi(14)=0.19932125339083266723657253912499;      xi(15)=0.32824761337551091203338917935961;      xi(16)=0.45131637321432261824821849156962;      xi(17)=0.56633135797929531218940954454228;      xi(18)=0.67124010526412869983566485818701;      xi(19)=0.76417048242049330778737528095229;      xi(20)=0.84346407015487204062330503742334;      xi(21)=0.90770567511350652199515299646621;      xi(22)=0.95574822092988635802697713055064;      xi(23)=0.98673055350516088355308673815447;      xi(24)=1.0000000000000000000000000000000;   case(25)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.98778994493149370927180407087316;      xi(3)=-0.95926413825253447885984517883952;      xi(4)=-0.91498277073462257832314993373685;      xi(5)=-0.85567646583531657752381326017175;      xi(6)=-0.78231965924071678039918795222875;      xi(7)=-0.69611704881513436676036543378938;      xi(8)=-0.59848414727999326809762099718107;      xi(9)=-0.49102411481887838261895992256880;      xi(10)=-0.37550145785922723322871461226072;      xi(11)=-0.25381306416887658017988688168728;      xi(12)=-0.12795705948310697270898462509465;      xi(13)=0.0;      xi(14)=0.12795705948310697270898462509465;      xi(15)=0.25381306416887658017988688168728;      xi(16)=0.37550145785922723322871461226072;      xi(17)=0.49102411481887838261895992256880;      xi(18)=0.59848414727999326809762099718107;      xi(19)=0.69611704881513436676036543378938;      xi(20)=0.78231965924071678039918795222875;      xi(21)=0.85567646583531657752381326017175;      xi(22)=0.91498277073462257832314993373685;      xi(23)=0.95926413825253447885984517883952;      xi(24)=0.98778994493149370927180407087316;      xi(25)=1.0000000000000000000000000000000;   case(26)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.98872741231147565442924669037130;      xi(3)=-0.96237787476771732975066267128213;      xi(4)=-0.92143554681755734112513052174869;      xi(5)=-0.86652432395912357097445149780977;      xi(6)=-0.79847718310743743903678763857034;      xi(7)=-0.71832581636266508052540538790393;      xi(8)=-0.62728529949231688780051890716122;      xi(9)=-0.52673574202987854529824339438099;      xi(10)=-0.41820138706624678556368388233385;      xi(11)=-0.30332751285925272077404103790211;      xi(12)=-0.18385549527005490132120567188576;      xi(13)=-0.061596411781919728205487274781751;      xi(14)=0.061596411781919728205487274781751;      xi(15)=0.18385549527005490132120567188576;      xi(16)=0.30332751285925272077404103790211;      xi(17)=0.41820138706624678556368388233385;      xi(18)=0.52673574202987854529824339438099;      xi(19)=0.62728529949231688780051890716122;      xi(20)=0.71832581636266508052540538790393;      xi(21)=0.79847718310743743903678763857034;      xi(22)=0.86652432395912357097445149780977;      xi(23)=0.92143554681755734112513052174869;      xi(24)=0.96237787476771732975066267128213;      xi(25)=0.98872741231147565442924669037130;      xi(26)=1.0000000000000000000000000000000;   case(27)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.98956096372855062114887464005452;      xi(3)=-0.96514840245081891926426680312113;      xi(4)=-0.92718345872511577885974676407272;      xi(5)=-0.87620208621452247866654304919414;      xi(6)=-0.81292048689581228825809186475854;      xi(7)=-0.73822714984645991083942722574841;      xi(8)=-0.65317066369680951517870487518246;      xi(9)=-0.55894506094256118006266807486812;      xi(10)=-0.45687307561408240367861265083924;      xi(11)=-0.34838758198902867043708657858717;      xi(12)=-0.23501148310291813333680158051333;      xi(13)=-0.11833633389852104843870826827532;      xi(14)=0.0;      xi(15)=0.11833633389852104843870826827532;      xi(16)=0.23501148310291813333680158051333;      xi(17)=0.34838758198902867043708657858717;      xi(18)=0.45687307561408240367861265083924;      xi(19)=0.55894506094256118006266807486812;      xi(20)=0.65317066369680951517870487518246;      xi(21)=0.73822714984645991083942722574841;      xi(22)=0.81292048689581228825809186475854;      xi(23)=0.87620208621452247866654304919414;      xi(24)=0.92718345872511577885974676407272;      xi(25)=0.96514840245081891926426680312113;      xi(26)=0.98956096372855062114887464005452;      xi(27)=1.0000000000000000000000000000000;   case(28)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.99030540261845412551709291186460;      xi(3)=-0.96762428585713130434377087914347;      xi(4)=-0.93232516712155852492614241860899;      xi(5)=-0.88487101721130283841230633825725;      xi(6)=-0.82588097005633819604451442619660;      xi(7)=-0.75612419400556976515209572526619;      xi(8)=-0.67651012892957331771938124507339;      xi(9)=-0.58807668983717560647831207976171;      xi(10)=-0.49197675393157938042961668294448;      xi(11)=-0.38946313757636280793588415520411;      xi(12)=-0.28187226662160237195415250890933;      xi(13)=-0.17060675530800436088270267774877;      xi(14)=-0.057117121693512897626543651573747;      xi(15)=0.057117121693512897626543651573747;      xi(16)=0.17060675530800436088270267774877;      xi(17)=0.28187226662160237195415250890933;      xi(18)=0.38946313757636280793588415520411;      xi(19)=0.49197675393157938042961668294448;      xi(20)=0.58807668983717560647831207976171;      xi(21)=0.67651012892957331771938124507339;      xi(22)=0.75612419400556976515209572526619;      xi(23)=0.82588097005633819604451442619660;      xi(24)=0.88487101721130283841230633825725;      xi(25)=0.93232516712155852492614241860899;      xi(26)=0.96762428585713130434377087914347;      xi(27)=0.99030540261845412551709291186460;      xi(28)=1.0000000000000000000000000000000;   case(29)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.99097298826856981627874511329957;      xi(3)=-0.96984580728793629371240138788782;      xi(4)=-0.93694271852098251154203684828336;      xi(5)=-0.89266571997608827876422991405309;      xi(6)=-0.83755273628178656524207331618682;      xi(7)=-0.77227289720646874135417063413645;      xi(8)=-0.69761866135636798839397442857709;      xi(9)=-0.61449625220343294997090361742436;      xi(10)=-0.52391467437196908357881657312361;      xi(11)=-0.42697347171349438763757641096836;      xi(12)=-0.32484938284191100626001402307884;      xi(13)=-0.21878205828426101980905185232499;      xi(14)=-0.11005901339559210970778760225568;      xi(15)=0.0;      xi(16)=0.11005901339559210970778760225568;      xi(17)=0.21878205828426101980905185232499;      xi(18)=0.32484938284191100626001402307884;      xi(19)=0.42697347171349438763757641096836;      xi(20)=0.52391467437196908357881657312361;      xi(21)=0.61449625220343294997090361742436;      xi(22)=0.69761866135636798839397442857709;      xi(23)=0.77227289720646874135417063413645;      xi(24)=0.83755273628178656524207331618682;      xi(25)=0.89266571997608827876422991405309;      xi(26)=0.93694271852098251154203684828336;      xi(27)=0.96984580728793629371240138788782;      xi(28)=0.99097298826856981627874511329957;      xi(29)=1.0000000000000000000000000000000;   case(30)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.99157394284050029333881822590865;      xi(3)=-0.97184660316626924167659295220919;      xi(4)=-0.94110478095105708230718954941552;      xi(5)=-0.89969921819927685955334282314945;      xi(6)=-0.84809948718019810955142383218307;      xi(7)=-0.78689035723754708044995952059240;      xi(8)=-0.71676539863708513163379859612990;      xi(9)=-0.63851917580755840737109348270974;      xi(10)=-0.55303826009505285238455023004066;      xi(11)=-0.46129119016824068522655722110715;      xi(12)=-0.36431750042244899775598510555179;      xi(13)=-0.26321594371957379126709946900007;      xi(14)=-0.15913204262585046782494857709885;      xi(15)=-0.053245110485486669363007834451354;      xi(16)=0.053245110485486669363007834451354;      xi(17)=0.15913204262585046782494857709885;      xi(18)=0.26321594371957379126709946900007;      xi(19)=0.36431750042244899775598510555179;      xi(20)=0.46129119016824068522655722110715;      xi(21)=0.55303826009505285238455023004066;      xi(22)=0.63851917580755840737109348270974;      xi(23)=0.71676539863708513163379859612990;      xi(24)=0.78689035723754708044995952059240;      xi(25)=0.84809948718019810955142383218307;      xi(26)=0.89969921819927685955334282314945;      xi(27)=0.94110478095105708230718954941552;      xi(28)=0.97184660316626924167659295220919;      xi(29)=0.99157394284050029333881822590865;      xi(30)=1.0000000000000000000000000000000;   case(31)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.99211684434648108858932461564871;      xi(3)=-0.97365493581573647482606954847523;      xi(4)=-0.94486917020803922980640553764986;      xi(5)=-0.90606695144126981314451152324746;      xi(6)=-0.85765999529745561036700538239647;      xi(7)=-0.80016154319246298927233133398318;      xi(8)=-0.73418113630907524213414083483764;      xi(9)=-0.66041820261152552333704127459677;      xi(10)=-0.57965465720800191300329686219773;      xi(11)=-0.49274661909883240570380023307021;      xi(12)=-0.40061533828056180630266441939609;      xi(13)=-0.30423743127287262095945514762626;      xi(14)=-0.20463452924752450114109358572771;      xi(15)=-0.10286244876068227708911472330805;      xi(16)=0.0;      xi(17)=0.10286244876068227708911472330805;      xi(18)=0.20463452924752450114109358572771;      xi(19)=0.30423743127287262095945514762626;      xi(20)=0.40061533828056180630266441939609;      xi(21)=0.49274661909883240570380023307021;      xi(22)=0.57965465720800191300329686219773;      xi(23)=0.66041820261152552333704127459677;      xi(24)=0.73418113630907524213414083483764;      xi(25)=0.80016154319246298927233133398318;      xi(26)=0.85765999529745561036700538239647;      xi(27)=0.90606695144126981314451152324746;      xi(28)=0.94486917020803922980640553764986;      xi(29)=0.97365493581573647482606954847523;      xi(30)=0.99211684434648108858932461564871;      xi(31)=1.0000000000000000000000000000000;   case(32)      xi(1)=-1.0000000000000000000000000000000;      xi(2)=-0.99260893397276135937154131527745;      xi(3)=-0.97529469048270922806245595038815;      xi(4)=-0.94828483841723237808332824158843;      xi(5)=-0.91184993906373190407453145237407;      xi(6)=-0.86635247601267551983081476942454;      xi(7)=-0.81224473177744234454682178807258;      xi(8)=-0.75006449393667479771727596467830;      xi(9)=-0.68042975561555081594239575769885;      xi(10)=-0.60403258714842112613717291261189;      xi(11)=-0.52163226288156529060659257339202;      xi(12)=-0.43404771720184693960331935700639;      xi(13)=-0.34214940653888148625381222069872;      xi(14)=-0.24685065885020530441624143115887;      xi(15)=-0.14909859681364749491438187617004;      xi(16)=-0.049864725046593252306297744728426;      xi(17)=0.049864725046593252306297744728426;      xi(18)=0.14909859681364749491438187617004;      xi(19)=0.24685065885020530441624143115887;      xi(20)=0.34214940653888148625381222069872;      xi(21)=0.43404771720184693960331935700639;      xi(22)=0.52163226288156529060659257339202;      xi(23)=0.60403258714842112613717291261189;      xi(24)=0.68042975561555081594239575769885;      xi(25)=0.75006449393667479771727596467830;      xi(26)=0.81224473177744234454682178807258;      xi(27)=0.86635247601267551983081476942454;      xi(28)=0.91184993906373190407453145237407;       xi(29)=0.94828483841723237808332824158843;       xi(30)=0.97529469048270922806245595038815;       xi(31)=0.99260893397276135937154131527745;       xi(32)=1.0000000000000000000000000000000; case(33)       xi(1)=-1.0000000000000000000000000000000;       xi(2)=-0.99305635843365834366733608675624;       xi(3)=-0.97678616331690630148562760838132;       xi(4)=-0.95139345139699574337552441691356;       xi(5)=-0.91711730345094124082567906975682;       xi(6)=-0.87427810075056222064656062933034;       xi(7)=-0.82327592300406746955907131326671;       xi(8)=-0.76458700179352862800665848042309;       xi(9)=-0.69875931661816259569967724754442;      xi(10)=-0.62640749128126825726383134241071;      xi(11)=-0.54820705991911162311040471176063;      xi(12)=-0.46488816163210675597300372098526;      xi(13)=-0.37722872425339363504193466071800;      xi(14)=-0.2860472014876740416053445029630;      xi(15)=-0.19219493146747722574130699544116;      xi(16)=-0.096548188176107006316957788091625;      xi(17)=0.0;      xi(18)=0.096548188176107006316957788091625;      xi(19)=0.19219493146747722574130699544116;      xi(20)=0.28604720148767404160534450296304;      xi(21)=0.37722872425339363504193466071800;      xi(22)=0.46488816163210675597300372098526;      xi(23)=0.54820705991911162311040471176063;      xi(24)=0.62640749128126825726383134241071;      xi(25)=0.69875931661816259569967724754442;      xi(26)=0.76458700179352862800665848042309;      xi(27)=0.82327592300406746955907131326671;      xi(28)=0.87427810075056222064656062933034;      xi(29)=0.91711730345094124082567906975682;      xi(30)=0.95139345139699574337552441691356;      xi(31)=0.97678616331690630148562760838132;      xi(32)=0.99305635843365834366733608675624;      xi(33)=1.0000000000000000000000000000000;   otherwise      error('LOBATTO_POINTS - Fatal error! Illegal value of n.');endreturnendfunction [cdin] =  linearmix(cdin, cdout, linearmixing)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % % Inputs% ====== % cdin(:)         : input cd to current iteration%                   overwritten by next input% cdout(:)        : output cd from current iteration% linearmixing    : mixing parameter - 0.1 means%                   mix 10% or output with input%                   Check that linear mixing parameter is between 0 and 1 %                   and that input and output charge densities have the %                   same dimensionif(linearmixing <= 0.0 || linearmixing >= 1.0)   error(' Error in linearMix: linearmixing out of range');endif (size(cdin) ~= size(cdout) )   error(' error in linearMix: mixmatch in cd array dimensions');end% Now just mix them and we're donecdin = cdin + linearmixing*(cdout - cdin);end%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [phi dphi] = lagrange(xi,n)%% Purpose% =======% Compute the Lagrange shape functions and its derivatives for xi \in [-1,1]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function [phi, dphi] = lagrange(xi,n)% n = number of shape functions (n = order+1)xip = lobatto_points(n);xivec = xi*ones(1,n);vec = xivec - xip;phi  = zeros(1,n);dphi = zeros(1,n);denom = zeros(1,n);for i = 1:n  num = 1;  den = 1.;  for j = 1:n    if (j ~= i)      num = num*vec(j);      den = den*(xip(i) - xip(j));     end  end  denom(i) = den;  phi(i) = num/den;endfor i = 1:n  avec = vec; avec(i) = 1.;  num = 0.;  for j = 1:n    if (j ~= i)      bvec = avec; bvec(j) = 1.;      num = num + prod(bvec);    end  end  dphi(i) = num/denom(i);endreturnendfunction [nodaldofs, dofinfo, numdofs] = KSsetupdofs(numnod)isboundarynode = zeros(1,numnod);% Dirichlet BCs on boundary nodesisboundarynode(1) = 1; isboundarynode(numnod) = 1;nodaldofs(numnod).list = [];numdofs = 0;for n = 1:numnod  if (~isboundarynode(n))    numdofs = numdofs + 1;            % classical DOF    nodaldofs(n).list = [numdofs];    dofinfo(numdofs) = n;             % node number for dof equal to numdofs  endendreturnendfunction [lam, u, scf_converged, Etot, Ekin, Ecoul, Eenuc, Exc, history, eigsflag] = KSscfiteration(problemdata, rhoqSch, rhoqPois,  ...                                                   meshsetupSch, meshsetupPois, ...                                                   meshoptsSch, meshoptsPois, ...                                                   quadsetupSch, quadsetupPois, ...                                                    xqSch, xqPois, scfopts, eigopts)                                               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Purpose% ======= % Perform SCF iterations:% Inputs% ====== % % % Outputs% =======  global numdofsSch;% % Unpack:% Zion    = problemdata.Z;nelec   = problemdata.nelec;[~, ~, lo, fo] = getatomicstates(Zion);   % no(:), lo(:)  : quantum numbers "n" and "l"                                          % fo(:)         : occupancy of the (n, l) stateLmax = max(lo);xeSch      = meshsetupSch.elemendcoord;xinSch     = meshsetupSch.parentnodecoord;connectSch = meshsetupSch.connect;pSch       = meshoptsSch.element_order;numelSch   = meshoptsSch.numel;numnodSch  = pSch*numelSch + 1;% xePois      = meshsetupPois.elemendcoord;xinPois     = meshsetupPois.parentnodecoord;connectPois = meshsetupPois.connect;pPois       = meshoptsPois.element_order;numelPois   = meshoptsPois.numel;numnodPois  = pPois*numelPois + 1;% % Set up arrays for DOF related info% fprintf('\n');fprintf(' ----> Constructing arrays for DOF info \n');fprintf('\n');[nodaldofsSch, dofinfoSch, numdofsSch] = KSsetupdofs(numnodSch);[nodaldofsPois, dofinfoPois, numdofsPois] = Poissetupdofs(numnodPois);xiqSch = quadsetupSch.points;wtqSch = quadsetupSch.weights;xiqPois = quadsetupPois.points;wtqPois = quadsetupPois.weights;% % Set up basis functions in parent domain% fprintf('\n');fprintf('----> Constructing basis functions . . . \n');fprintf('\n');[phiqSch, dphiqSch] = getshapefunc(pSch, xiqSch);[phiqPois, dphiqPois] = getshapefunc(pPois, xiqPois);maxiter     = scfopts.maxiter;scftol      = scfopts.scftol;scftolmax   = scfopts.scftolmax;mixingparam = scfopts.mixingparam;% Initialization% lam = zeros(neigs,Lmax+1);% u = zeros(numdofs,neigs,Lmax+1);  lam = cell(Lmax+1,1);        % to store eigenvalues of H u = lam S u:                             % lam(i,j) = i-th eigenvalue of j-th                              % L-value, j=0..Lmaxu = cell(Lmax+1,1);          % to store eigenvectors of H u = lam S u;                             % u(i,j,k) = i-th component of j-th                              % vector of k-th L-value, k=0..Lmax% Computing the number of eigenvalues required as each l = 0, ..., Lmaxneigs = zeros(Lmax + 1,1);for l = 0:Lmax    neigs(l+1) = length(find(lo == l));endscf_converged = false;% SCF iterations beginsfprintf('\n');fprintf('----> SCF iterations begin . . . \n');fprintf('\n');for iter = 1:maxiter           fprintf('\n');    fprintf(' ----> Starting SCF Iteration # %-5d . . .\n', iter);    fprintf('\n');    % Normalize density on Poisson and K-S mesh:    rhointSch  = sphericalintegral(xeSch, xqSch, wtqSch, rhoqSch);    rhointPois = sphericalintegral(xePois, xqPois, wtqPois, rhoqPois);    fprintf('\n');    fprintf(' Integral of input density before normalization (on K-S Mesh): %-11.8e \n', rhointSch);    fprintf('\n');    fprintf(' Integral of input density before normalization (on Poisson Mesh): %-11.8e \n', rhointPois);    fprintf('\n');    rhoqSch = -rhoqSch./rhointSch*nelec;        % charge-density on K-S Mesh    rhoqPois = -rhoqPois./rhointPois*nelec;     % charge-density on Poisson Mesh    % Construct Potential:    fprintf('\n');    fprintf('----> Constructing Hartree potential . . . \n');    fprintf('\n');    % First get nodal solution for Vp(r) = r * Vh(r)    % -ve sign as Vp" = -4 * pi * n(r) * r    VpPois = solveradialpoisson(xePois, connectPois, numelPois, ...                                nodaldofsPois, dofinfoPois, numdofsPois, ...                                xqPois, wtqPois, phiqPois, dphiqPois, -4.0*pi*rhoqPois);                            % Transform to Poisson quadrature grid     VpqSch = fetoquadgen(xinPois, xiqSch, xePois, xeSch, connectPois, ...                         [0.0; VpPois; 0.0]);               % zero Dirichlet on the left                                                             % and zero Dirichlet on the right          % Construct solution satisfying the BC Vh(r=rmax) = Z/rmax, and we     % divide by "r" to obtain the Hartree potential.    % This is because we were solving for Vp(r) = r * Vh(r):    VhqSch = VpqSch./xqSch + Zion/xeSch(end);    % Vnq(:,:)      : quadrature-grid representatin of Vn(x) = -Z/(|x - R|);    %                 Vn(i,j) = value at i-th quadrature point of j-th element    %Vnq = computenuclearpotential(Zion, xqSch);     %Veffq = Vhq + Vnq;    VeffqSch = VhqSch - Zion./xqSch;        % Add Nuclear potential    [excqSch, VxcqSch] = exhangecorrelation('lda', -rhoqSch);     VeffqSch = VeffqSch + VxcqSch;    % Find eigenstates    fprintf('\n');    fprintf('----> Computing eigenstates . . . \n');    fprintf('\n');    for l = 0:Lmax        % u{l+1,1} = zeros(numdofs, neigs(l+1));        % lam{l+1,1} = zeros(neigs(l+1),1);        [lam{l+1,1}, u{l+1,1}, eigsflag] = solveradialschroed(xeSch, connectSch, numelSch, ...                                                    nodaldofsSch, dofinfoSch, numdofsSch, ...                                                    VeffqSch, l, xqSch, xiqSch, wtqSch, phiqSch, ...                                                    dphiqSch, neigs(l+1), eigopts);         if eigsflag ~= 0            break        else             continue        end    end    if eigsflag ~= 0        scf_converged = false;        Etot  = NaN;         Ekin  = NaN;        Ecoul  = NaN;        Eenuc  = NaN;         Exc  = NaN;         history  = NaN;        return    end    % Construct density:    fprintf('\n');    fprintf('----> Constructing output density . . . \n');    fprintf('\n');    rhooutqSch = 0.0;    rhooutqPois = 0.0;    Eband = 0.0;    for l = 0:Lmax        nbands = neigs(l+1);        U = reshape([u{l+1}(:,:)], [numdofsSch,nbands]);        LAM = reshape([lam{l+1,1}(:)], [nbands, 1]);%         occ = fo((fo(l+1) == fo));        occ = fo(lo == l);%         occ = fo(l+1);        for n = 1:nbands            % transform to quadrature grid            fullc = zeros(numdofsSch+2,1);            fullc(2:numdofsSch+1) = U(:,n);            % Generate quadrature point values of P_{nl} on Schrodinger mesh:            PqSch = fetoquad(xinSch, xiqSch, connectSch, fullc);            % Generate quadrature point values of P_{nl} on Poisson mesh:            PqPois = fetoquadgen(xinSch, xiqPois, xeSch, xePois, connectSch, fullc);            %            % Form density and accumulate            %            % On Schrodinger mesh:            rhooutqSch = rhooutqSch - occ(n)*PqSch.^2./(xqSch.^2)/(4.0*pi);            % On Poisson mesh:            rhooutqPois = rhooutqPois - occ(n)*PqPois.^2./(xqPois.^2)/(4.0*pi);            Eband = Eband + occ(n)*LAM(n);        end    end    [T_s(iter), E_ee(iter), E_en(iter), E_xc(iter), E_tot(iter)] = ...                computetotalenergy(xeSch, xqSch, wtqSch, rhooutqSch, VeffqSch, VhqSch, ...                                   excqSch, Zion, Eband);    history(iter) = iter;    rhointSch = sphericalintegral(xeSch, xqSch, wtqSch, rhooutqSch);    rhointPois = sphericalintegral(xePois, xqPois, wtqPois, rhooutqPois);    fprintf('\n');    fprintf(' Integral of input density before normalization: %-11.8e \n', rhointSch);    fprintf('\n');    rhooutqSch  = -rhooutqSch./rhointSch*nelec;    rhooutqPois = -rhooutqPois./rhointPois*nelec;    % Assess convergence, exit if achieved    fprintf('\n');    fprintf('----> Assessing convergence . . . \n');    fprintf('\n');    drhoq = norm((rhooutqSch - rhoqSch),'fro')/norm(rhoqSch,'fro');    fprintf('\n');    fprintf('Fractional difference of input and output densities = %-11.8e \n', drhoq);    fprintf('\n');    if (iter > 3)        Emax = max(E_tot(iter-3:iter));        Emin = min(E_tot(iter-3:iter));        if (drhoq < scftol && Emax-Emin < scftolmax)            fprintf('\n');            fprintf('Self-consistent convergence criterion achieved \n');            fprintf('\n');            fprintf('SCF Iteration: %-4d \n', iter);            fprintf('tolscf: %-11.8e \n', scftol);            fprintf('drhoq: %-11.8e \n', drhoq);            fprintf('tolscfmax: %-11.8e \n', scftolmax);            fprintf('Emax - Emin: %-11.8e \n', Emax-Emin);            fprintf('\n');            scf_converged = true;            break        end    end    fprintf('\n');    fprintf('----> SCF iterations end . . . \n');    fprintf('\n');   % if not converged, form new input density   scf_converged = false;   fprintf('\n');   fprintf('----> Forming new input density on Poisson mesh. . . \n');   fprintf('\n');   rhoqPois =  linearmix(rhoqPois, rhooutqPois, mixingparam);   rhoqSch  =  linearmix(rhoqSch, rhooutqSch, mixingparam);endEtot  = E_tot(end);Ekin  = T_s(end);Ecoul = E_ee(end);Eenuc = E_en(end);Exc   = E_xc(end);endfunction sm = integrateonmesh(xe, wtq, fq)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % Integral of function f(x) defined by values fq at quadrature points % on mesh xe, without additional factors; i.e., \int_xmin^xmax f(x) dx% % Inputs% ====== % xe(:)     : xe(i/i+1) = coord of left/right boundary of i-th element% wtq(:)    : quadrature weights% fq(:,:)   : integrand values at quadrature points; %             fq(i,j) = func. value at i-th quad pt in j-th element% % Output% ======% numel = length(xe) - 1;sm = 0;for e = 1:numel            % sum over elements    % Jacobian of affine transformation from parent coords    % xi in [-1,1] to coords x in element [xa,xb]:     % x = al xi + be, al=(xb-xa)/2, be=(xb+xa)/2         jac = 0.5*abs(xe(e+1) - xe(e));    sm = sm + sum(wtq'.*fq(:,e))*jac;   % dot(wtq, fq(:,e)*jac);endreturnendfunction rhoq = initialdensity(Q, xe, xq, wtq)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % Constructs localized charge density of total charge -Q at quadrature points% % Inputs% ====== % Q         : total charge; density of total charge -Q is constructed% xe(:)     : xe(i/i+1) = coord of left/right boundary of ith element% xiq(:)    : quadrature points% wtq(:)    : quadrature weights% xq(:,:)   : quadrature pts in physical space; %             xq(i,j) = coordinate of i-th point in j-th element% % Output% ======% rhoq(:,:) : radial charge density at quadrature points; %             rhoq(i,j) = value at i-th quadrature point of j-th element% numel = length(xe) - 1;rhoq = zeros(size(xq));% rhoq = zeros(length(xi),numel);for e = 1:numel          % tabulate over elements    xqe = xq(:,e);    % rhoq(:,e) = exp(-xqe.^2./4.0)                 % Gaussian    % rhoq(:,e) = 1.0./cosh(xqe).^2                 % 1/cosh^2    rhoq(:,e) = -thomasfermidensity(xqe, Q);         % Thomas-Fermi end% % The foloowing two operations are already being done outside at the % first SCF iteration step% integ = sphericalintegral(xe, xq, wtq, rhoq);rhoq = -rhoq./integ*Q;returnendfunction [phiq, dphiq] = getshapefunc(p, xiq)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % Tabulate parent basis at quadrature points:% % Inputs% ====== % % % Outputs% =======  nsp = length(xiq);phiq = zeros(nsp,p+1);    % parent basis fn values at %                           quadrature points xiq; %                           phihq(i,j) = value of j-th func%                           at i-th quadrature pointdphiq = zeros(nsp,p+1);   % derivative of the parent basis fn values at %                           quadrature points xiq; %                           dphihq(i,j) = value of j-th func%                           at i-th quadrature pointfor iq = 1:nsp    [phiq(iq,:), dphiq(iq,:)] = shapefunctions(p, xiq(iq)); % all the shapefunctionsendfunction xq = getphysicalquadpts(xe, xiq)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % Generates quadrature points xq in physical coordinate system via % affine mapping of parent quad points xiq to elements xe% % Inputs% ====== % xe(:)     : xe(i/i+1) = coord of left/right boundary of ith element% xiq(:)    : quadrature points in [-1, 1] (parent domain)% % Output% ======% xq(:,:)   : quadrature pts in physical space; %             xq(i,j) = coordinate of i-th point in j-th elementnumel = length(xe) - 1;     nsp = length(xiq);xq = zeros(nsp,numel);    % assumes same nsp for all the elementsfor e = 1:numel   xl = xe(e); xr = xe(e+1);   % affine transformation: [-1 1] --> [xl xr]   xq(:,e) = (xr - xl)/2.0*xiq + (xr + xl)/2.0;endfunction quadsetup = getparentquadptswts(quadtype, nsp)% Generate the quadrature points and weights in the biunit parent domainswitch quadtype    case 1      % Use Gauss quadrature        xiq = gausspoints(nsp);        wtq = gaussweights(nsp);    case 2      % Use Lobatto quadrature        xiq = lobatto_points(nsp);        wtq = lobatto_weights(nsp);endquadsetup = struct('points',xiq, 'weights',wtq);returnend function [n, no, lo, fo] = getatomicstates(Z)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% =======% Returns all electron states of the form (n, l, f) for a given Z% Note: sum(fo) == Z%% Inputs% ======% Z             : atomic number%% Output% ======% no(:), lo(:)  : quantum numbers "n" and "l"% fo(:)         : occupancy of the (n, l) stateswitch Z    case (1)        n = 1;        no = 1;        lo = 0;        fo = 1;    case (2)        n = 1;        no = 1;        lo = 0;        fo = 2;    case (3)        n = 2;        no = [ 1, 2 ];        lo = [ 0, 0 ];        fo = [ 2, 1 ];    case (4)        n = 2;        no = [ 1, 2 ];        lo = [ 0, 0 ];        fo = [ 2, 2 ];    case (5)        n = 3;        no = [ 1, 2, 2 ];        lo = [ 0, 0, 1 ];        fo = [ 2, 2, 1 ];    case (6)        n = 3;        no = [ 1, 2, 2 ];        lo = [ 0, 0, 1 ];        fo = [ 2, 2, 2 ];    case (7)        n = 3;        no = [ 1, 2, 2 ];        lo = [ 0, 0, 1 ];        fo = [ 2, 2, 3 ];    case (8)        n = 3;        no = [ 1, 2, 2 ];        lo = [ 0, 0, 1 ];        fo = [ 2, 2, 4 ];    case (9)        n = 3;        no = [ 1, 2, 2 ];        lo = [ 0, 0, 1 ];        fo = [ 2, 2, 5 ];    case (10)        n = 3;        no = [ 1, 2, 2 ];        lo = [ 0, 0, 1 ];        fo = [ 2, 2, 6 ];    case (11)        n = 4;        no = [ 1, 2, 2, 3 ];        lo = [ 0, 0, 1, 0 ];        fo = [ 2, 2, 6, 1 ];    case (12)        n = 4;        no = [ 1, 2, 2, 3 ];        lo = [ 0, 0, 1, 0 ];        fo = [ 2, 2, 6, 2 ];    case (13)        n = 5;        no = [ 1, 2, 2, 3, 3 ];        lo = [ 0, 0, 1, 0, 1 ];        fo = [ 2, 2, 6, 2, 1 ];    case (14)        n = 5;        no = [ 1, 2, 2, 3, 3 ];        lo = [ 0, 0, 1, 0, 1 ];        fo = [ 2, 2, 6, 2, 2 ];    case (15)        n = 5;        no = [ 1, 2, 2, 3, 3 ];        lo = [ 0, 0, 1, 0, 1 ];        fo = [ 2, 2, 6, 2, 3 ];    case (16)        n = 5;        no = [ 1, 2, 2, 3, 3 ];        lo = [ 0, 0, 1, 0, 1 ];        fo = [ 2, 2, 6, 2, 4 ];    case (17)        n = 5;        no = [ 1, 2, 2, 3, 3 ];        lo = [ 0, 0, 1, 0, 1 ];        fo = [ 2, 2, 6, 2, 5 ];    case (18)        n = 5;        no = [ 1, 2, 2, 3, 3 ];        lo = [ 0, 0, 1, 0, 1 ];        fo = [ 2, 2, 6, 2, 6 ];    case (19)        n = 6;        no = [ 1, 2, 2, 3, 3, 4 ];        lo = [ 0, 0, 1, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 1 ];    case (20)        n = 6;        no = [ 1, 2, 2, 3, 3, 4 ];        lo = [ 0, 0, 1, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 2 ];    case (21)        n = 7;        no = [ 1, 2, 2, 3, 3, 3, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 1, 2 ];    case (22)        n = 7;        no = [ 1, 2, 2, 3, 3, 3, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 2, 2 ];    case (23)        n = 7;        no = [ 1, 2, 2, 3, 3, 3, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 3, 2 ];    case (24)        n = 7;        no = [ 1, 2, 2, 3, 3, 3, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 5, 1 ];    case (25)        n = 7;        no = [ 1, 2, 2, 3, 3, 3, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 5, 2 ];    case (26)        n = 7;        no = [ 1, 2, 2, 3, 3, 3, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 6, 2 ];    case (27)        n = 7;        no = [ 1, 2, 2, 3, 3, 3, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 7, 2 ];    case (28)        n = 7;        no = [ 1, 2, 2, 3, 3, 3, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 8, 2 ];    case (29)        n = 7;        no = [ 1, 2, 2, 3, 3, 3, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 1 ];    case (30)        n = 7;        no = [ 1, 2, 2, 3, 3, 3, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2 ];    case (31)        n = 8;        no = [ 1, 2, 2, 3, 3, 3, 4, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 1 ];    case (32)        n = 8;        no = [ 1, 2, 2, 3, 3, 3, 4, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 2 ];    case (33)        n = 8;        no = [ 1, 2, 2, 3, 3, 3, 4, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 3 ];    case (34)        n = 8;        no = [ 1, 2, 2, 3, 3, 3, 4, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 4 ];    case (35)        n = 8;        no = [ 1, 2, 2, 3, 3, 3, 4, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 5 ];    case (36)        n = 8;        no = [ 1, 2, 2, 3, 3, 3, 4, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6 ];    case (37)        n = 9;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 1 ];    case (38)        n = 9;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 2 ];    case (39)        n = 10;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 1, 2 ];    case (40)        n = 10;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 2, 2 ];    case (41)        n = 10;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 4, 1 ];    case (42)        n = 10;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 5, 1 ];    case (43)        n = 10;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 5, 2 ];    case (44)        n = 10;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 7, 1 ];    case (45)        n = 10;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 8, 1 ];    case (46)        n = 9;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10 ];    case (47)        n = 10;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 1 ];    case (48)        n = 10;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 2 ];    case (49)        n = 11;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 2, 1 ];    case (50)        n = 11;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 2, 2 ];    case (51)        n = 11;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 2, 3 ];    case (52)        n = 11;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 2, 4 ];    case (53)        n = 11;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 2, 5 ];    case (54)        n = 11;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 2, 6 ];    case (55)        n = 12;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 2, 6, 1 ];    case (56)        n = 12;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 2, 6, 2 ];    case (57)        n = 13;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 2, 6, 1, 2 ];    case (58)        n = 14;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 1, 2, 6, 1, 2 ];    case (59)        n = 13;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 3, 2, 6, 2 ];    case (60)        n = 13;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 4, 2, 6, 2 ];    case (61)        n = 13;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 5, 2, 6, 2 ];    case (62)        n = 13;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 6, 2, 6, 2 ];    case (63)        n = 13;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 7, 2, 6, 2 ];    case (64)        n = 14;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 7, 2, 6, 1, 2 ];    case (65)        n = 13;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 9, 2, 6, 2 ];    case (66)        n = 13;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 10, 2, 6, 2 ];    case (67)        n = 13;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 11, 2, 6, 2 ];    case (68)        n = 13;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 12, 2, 6, 2 ];    case (69)        n = 13;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 13, 2, 6, 2 ];    case (70)        n = 13;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 2 ];    case (71)        n = 14;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 1, 2 ];    case (72)        n = 14;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 2, 2 ];    case (73)        n = 14;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 3, 2 ];    case (74)        n = 14;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 4, 2 ];    case (75)        n = 14;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 5, 2 ];    case (76)        n = 14;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 6, 2 ];    case (77)        n = 14;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 7, 2 ];    case (78)        n = 14;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 9, 1 ];    case (79)        n = 14;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 1 ];    case (80)        n = 14;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 2 ];    case (81)        n = 15;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 2, 1 ];    case (82)        n = 15;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 2, 2 ];    case (83)        n = 15;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 2, 3 ];    case (84)        n = 15;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 2, 4 ];    case (85)        n = 15;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 2, 5 ];    case (86)        n = 15;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0, 1 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 2, 6 ];    case (87)        n = 16;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 7 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 2, 6, 1 ];    case (88)        n = 16;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 7 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0, 1, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 2, 6, 2 ];    case (89)        n = 17;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 2, 6, 1, 2 ];    case (90)        n = 17;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 2, 6, 2, 2 ];    case (91)        n = 18;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 2, 2, 6, 1, 2 ];    case (92)        n = 18;        no = [ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7 ];        lo = [ 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 0 ];        fo = [ 2, 2, 6, 2, 6, 10, 2, 6, 10, 14, 2, 6, 10, 3, 2, 6, 1, 2 ];    otherwise        fprintf('Z = %-3d is an invalid Z-value\n', Z);        error('Z not supported. Aborting . . .')endend function w = gaussweights(n)%%  function w = gauss_weights_QUAD(n);%%  For 1 <= n <= 64, returns the weights w of an%  n point Gauss-Legendre quadrature rule over the interval [-1,1].%w = ones(1,n); switch n   case(1)      w(1)=2.0000000000000000;   case(2)      w(1)=1.0000000000000000;      w(2)=1.0000000000000000;   case(3)      w(1)=0.55555555555555556;      w(2)=0.88888888888888889;      w(3)=0.55555555555555556;   case(4)      w(1)=0.34785484513745386;      w(2)=0.65214515486254614;      w(3)=0.65214515486254614;      w(4)=0.34785484513745386;   case(5)      w(1)=0.23692688505618909;      w(2)=0.47862867049936647;      w(3)=0.56888888888888889;      w(4)=0.47862867049936647;      w(5)=0.23692688505618909;   case(6)      w(1)=0.17132449237917035;      w(2)=0.36076157304813861;      w(3)=0.46791393457269105;      w(4)=0.46791393457269105;      w(5)=0.36076157304813861;      w(6)=0.17132449237917035;   case(7)      w(1)=0.12948496616886969;      w(2)=0.27970539148927667;      w(3)=0.38183005050511894;      w(4)=0.41795918367346939;      w(5)=0.38183005050511894;      w(6)=0.27970539148927667;      w(7)=0.12948496616886969;   case(8)      w(1)=0.10122853629037626;      w(2)=0.22238103445337447;      w(3)=0.31370664587788729;      w(4)=0.36268378337836198;      w(5)=0.36268378337836198;      w(6)=0.31370664587788729;      w(7)=0.22238103445337447;      w(8)=0.10122853629037626;   case(9)      w(1)=0.081274388361574412;      w(2)=0.18064816069485740;      w(3)=0.26061069640293546;      w(4)=0.31234707704000284;      w(5)=0.33023935500125976;      w(6)=0.31234707704000284;      w(7)=0.26061069640293546;      w(8)=0.18064816069485740;      w(9)=0.081274388361574412;   case(10)      w(1)=0.066671344308688138;      w(2)=0.14945134915058059;      w(3)=0.21908636251598204;      w(4)=0.26926671930999636;      w(5)=0.29552422471475287;      w(6)=0.29552422471475287;      w(7)=0.26926671930999636;      w(8)=0.21908636251598204;      w(9)=0.14945134915058059;      w(10)=0.066671344308688138;   case(11)      w(1)=0.055668567116173666;      w(2)=0.12558036946490462;      w(3)=0.18629021092773425;      w(4)=0.23319376459199048;      w(5)=0.26280454451024666;      w(6)=0.27292508677790063;      w(7)=0.26280454451024666;      w(8)=0.23319376459199048;      w(9)=0.18629021092773425;      w(10)=0.12558036946490462;      w(11)=0.055668567116173666;   case(12)      w(1)=0.047175336386511827;      w(2)=0.10693932599531843;      w(3)=0.16007832854334623;      w(4)=0.20316742672306592;      w(5)=0.23349253653835481;      w(6)=0.24914704581340279;      w(7)=0.24914704581340279;      w(8)=0.23349253653835481;      w(9)=0.20316742672306592;      w(10)=0.16007832854334623;      w(11)=0.10693932599531843;      w(12)=0.047175336386511827;   case(13)      w(1)=0.040484004765315880;      w(2)=0.092121499837728448;      w(3)=0.13887351021978724;      w(4)=0.17814598076194574;      w(5)=0.20781604753688850;      w(6)=0.22628318026289724;      w(7)=0.23255155323087391;      w(8)=0.22628318026289724;      w(9)=0.20781604753688850;      w(10)=0.17814598076194574;      w(11)=0.13887351021978724;      w(12)=0.092121499837728448;      w(13)=0.040484004765315880;   case(14)      w(1)=0.035119460331751863;      w(2)=0.080158087159760210;      w(3)=0.12151857068790318;      w(4)=0.15720316715819353;      w(5)=0.18553839747793781;      w(6)=0.20519846372129560;      w(7)=0.21526385346315779;      w(8)=0.21526385346315779;      w(9)=0.20519846372129560;      w(10)=0.18553839747793781;      w(11)=0.15720316715819353;      w(12)=0.12151857068790318;      w(13)=0.080158087159760210;      w(14)=0.035119460331751863;   case(15)      w(1)=0.030753241996117268;      w(2)=0.070366047488108125;      w(3)=0.10715922046717194;      w(4)=0.13957067792615431;      w(5)=0.16626920581699393;      w(6)=0.18616100001556221;      w(7)=0.19843148532711158;      w(8)=0.20257824192556127;      w(9)=0.19843148532711158;      w(10)=0.18616100001556221;      w(11)=0.16626920581699393;      w(12)=0.13957067792615431;      w(13)=0.10715922046717194;      w(14)=0.070366047488108125;      w(15)=0.030753241996117268;   case(16)      w(1)=0.027152459411754095;      w(2)=0.062253523938647893;      w(3)=0.095158511682492785;      w(4)=0.12462897125553387;      w(5)=0.14959598881657673;      w(6)=0.16915651939500254;      w(7)=0.18260341504492359;      w(8)=0.18945061045506850;      w(9)=0.18945061045506850;      w(10)=0.18260341504492359;      w(11)=0.16915651939500254;      w(12)=0.14959598881657673;      w(13)=0.12462897125553387;      w(14)=0.095158511682492785;      w(15)=0.062253523938647893;      w(16)=0.027152459411754095;   case(17)      w(1)=0.024148302868547932;      w(2)=0.055459529373987201;      w(3)=0.085036148317179181;      w(4)=0.11188384719340397;      w(5)=0.13513636846852547;      w(6)=0.15404576107681029;      w(7)=0.16800410215645004;      w(8)=0.17656270536699265;      w(9)=0.17944647035620653;      w(10)=0.17656270536699265;      w(11)=0.16800410215645004;      w(12)=0.15404576107681029;      w(13)=0.13513636846852547;      w(14)=0.11188384719340397;      w(15)=0.085036148317179181;      w(16)=0.055459529373987201;      w(17)=0.024148302868547932;   case(18)      w(1)=0.021616013526483310;      w(2)=0.049714548894969796;      w(3)=0.076425730254889057;      w(4)=0.10094204410628717;      w(5)=0.12255520671147846;      w(6)=0.14064291467065065;      w(7)=0.15468467512626524;      w(8)=0.16427648374583272;      w(9)=0.16914238296314359;      w(10)=0.16914238296314359;      w(11)=0.16427648374583272;      w(12)=0.15468467512626524;      w(13)=0.14064291467065065;      w(14)=0.12255520671147846;      w(15)=0.10094204410628717;      w(16)=0.076425730254889057;      w(17)=0.049714548894969796;      w(18)=0.021616013526483310;   case(19)      w(1)=0.019461788229726477;      w(2)=0.044814226765699600;      w(3)=0.069044542737641227;      w(4)=0.091490021622449999;      w(5)=0.11156664554733399;      w(6)=0.12875396253933623;      w(7)=0.14260670217360661;      w(8)=0.15276604206585967;      w(9)=0.15896884339395435;      w(10)=0.16105444984878370;      w(11)=0.15896884339395435;      w(12)=0.15276604206585967;      w(13)=0.14260670217360661;      w(14)=0.12875396253933623;      w(15)=0.11156664554733399;      w(16)=0.091490021622449999;      w(17)=0.069044542737641227;      w(18)=0.044814226765699600;      w(19)=0.019461788229726477;   case(20)      w(1)=0.017614007139152118;      w(2)=0.040601429800386941;      w(3)=0.062672048334109064;      w(4)=0.083276741576704749;      w(5)=0.10193011981724044;      w(6)=0.11819453196151842;      w(7)=0.13168863844917663;      w(8)=0.14209610931838205;      w(9)=0.14917298647260375;      w(10)=0.15275338713072585;      w(11)=0.15275338713072585;      w(12)=0.14917298647260375;      w(13)=0.14209610931838205;      w(14)=0.13168863844917663;      w(15)=0.11819453196151842;      w(16)=0.10193011981724044;      w(17)=0.083276741576704749;      w(18)=0.062672048334109064;      w(19)=0.040601429800386941;      w(20)=0.017614007139152118;   case(21)      w(1)=0.016017228257774333;      w(2)=0.036953789770852494;      w(3)=0.057134425426857208;      w(4)=0.076100113628379302;      w(5)=0.093444423456033862;      w(6)=0.10879729916714838;      w(7)=0.12183141605372853;      w(8)=0.13226893863333746;      w(9)=0.13988739479107315;      w(10)=0.14452440398997006;      w(11)=0.14608113364969043;      w(12)=0.14452440398997006;      w(13)=0.13988739479107315;      w(14)=0.13226893863333746;      w(15)=0.12183141605372853;      w(16)=0.10879729916714838;      w(17)=0.093444423456033862;      w(18)=0.076100113628379302;      w(19)=0.057134425426857208;      w(20)=0.036953789770852494;      w(21)=0.016017228257774333;   case(22)      w(1)=0.014627995298272201;      w(2)=0.033774901584814155;      w(3)=0.052293335152683286;      w(4)=0.069796468424520488;      w(5)=0.085941606217067727;      w(6)=0.10041414444288096;      w(7)=0.11293229608053922;      w(8)=0.12325237681051242;      w(9)=0.13117350478706237;      w(10)=0.13654149834601517;      w(11)=0.13925187285563199;      w(12)=0.13925187285563199;      w(13)=0.13654149834601517;      w(14)=0.13117350478706237;      w(15)=0.12325237681051242;      w(16)=0.11293229608053922;      w(17)=0.10041414444288096;      w(18)=0.085941606217067727;      w(19)=0.069796468424520488;      w(20)=0.052293335152683286;      w(21)=0.033774901584814155;      w(22)=0.014627995298272201;   case(23)      w(1)=0.013411859487141772;      w(2)=0.030988005856979444;      w(3)=0.048037671731084669;      w(4)=0.064232421408525852;      w(5)=0.079281411776718955;      w(6)=0.092915766060035147;      w(7)=0.10489209146454141;      w(8)=0.11499664022241136;      w(9)=0.12304908430672953;      w(10)=0.12890572218808215;      w(11)=0.13246203940469662;      w(12)=0.13365457218610618;      w(13)=0.13246203940469662;      w(14)=0.12890572218808215;      w(15)=0.12304908430672953;      w(16)=0.11499664022241136;      w(17)=0.10489209146454141;      w(18)=0.092915766060035147;      w(19)=0.079281411776718955;      w(20)=0.064232421408525852;      w(21)=0.048037671731084669;      w(22)=0.030988005856979444;      w(23)=0.013411859487141772;   case(24)      w(1)=0.012341229799987200;      w(2)=0.028531388628933663;      w(3)=0.044277438817419806;      w(4)=0.059298584915436781;      w(5)=0.073346481411080306;      w(6)=0.086190161531953276;      w(7)=0.097618652104113888;      w(8)=0.10744427011596563;      w(9)=0.11550566805372560;      w(10)=0.12167047292780339;      w(11)=0.12583745634682830;      w(12)=0.12793819534675216;      w(13)=0.12793819534675216;      w(14)=0.12583745634682830;      w(15)=0.12167047292780339;      w(16)=0.11550566805372560;      w(17)=0.10744427011596563;      w(18)=0.097618652104113888;      w(19)=0.086190161531953276;      w(20)=0.073346481411080306;      w(21)=0.059298584915436781;      w(22)=0.044277438817419806;      w(23)=0.028531388628933663;      w(24)=0.012341229799987200;   case(25)      w(1)=0.011393798501026288;      w(2)=0.026354986615032137;      w(3)=0.040939156701306313;      w(4)=0.054904695975835192;      w(5)=0.068038333812356917;      w(6)=0.080140700335001018;      w(7)=0.091028261982963650;      w(8)=0.10053594906705064;      w(9)=0.10851962447426365;      w(10)=0.11485825914571165;      w(11)=0.11945576353578477;      w(12)=0.12224244299031004;      w(13)=0.12317605372671545;      w(14)=0.12224244299031004;      w(15)=0.11945576353578477;      w(16)=0.11485825914571165;      w(17)=0.10851962447426365;      w(18)=0.10053594906705064;      w(19)=0.091028261982963650;      w(20)=0.080140700335001018;      w(21)=0.068038333812356917;      w(22)=0.054904695975835192;      w(23)=0.040939156701306313;      w(24)=0.026354986615032137;      w(25)=0.011393798501026288;   case(26)      w(1)=0.010551372617343007;      w(2)=0.024417851092631909;      w(3)=0.037962383294362764;      w(4)=0.050975825297147812;      w(5)=0.063274046329574836;      w(6)=0.074684149765659746;      w(7)=0.085045894313485239;      w(8)=0.094213800355914148;      w(9)=0.10205916109442542;      w(10)=0.10847184052857659;      w(11)=0.11336181654631967;      w(12)=0.11666044348529658;      w(13)=0.11832141527926228;      w(14)=0.11832141527926228;      w(15)=0.11666044348529658;      w(16)=0.11336181654631967;      w(17)=0.10847184052857659;      w(18)=0.10205916109442542;      w(19)=0.094213800355914148;      w(20)=0.085045894313485239;      w(21)=0.074684149765659746;      w(22)=0.063274046329574836;      w(23)=0.050975825297147812;      w(24)=0.037962383294362764;      w(25)=0.024417851092631909;      w(26)=0.010551372617343007;   case(27)      w(1)=0.0097989960512943603;      w(2)=0.022686231596180623;      w(3)=0.035297053757419711;      w(4)=0.047449412520615063;      w(5)=0.058983536859833599;      w(6)=0.069748823766245593;      w(7)=0.079604867773057771;      w(8)=0.088423158543756950;      w(9)=0.096088727370028508;      w(10)=0.10250163781774580;      w(11)=0.10757828578853319;      w(12)=0.11125248835684519;      w(13)=0.11347634610896515;      w(14)=0.11422086737895699;      w(15)=0.11347634610896515;      w(16)=0.11125248835684519;      w(17)=0.10757828578853319;      w(18)=0.10250163781774580;      w(19)=0.096088727370028508;      w(20)=0.088423158543756950;      w(21)=0.079604867773057771;      w(22)=0.069748823766245593;      w(23)=0.058983536859833599;      w(24)=0.047449412520615063;      w(25)=0.035297053757419711;      w(26)=0.022686231596180623;      w(27)=0.0097989960512943603;   case(28)      w(1)=0.0091242825930945177;      w(2)=0.021132112592771260;      w(3)=0.032901427782304380;      w(4)=0.044272934759004228;      w(5)=0.055107345675716745;      w(6)=0.065272923966999596;      w(7)=0.074646214234568779;      w(8)=0.083113417228901218;      w(9)=0.090571744393032841;      w(10)=0.096930657997929916;      w(11)=0.10211296757806077;      w(12)=0.10605576592284642;      w(13)=0.10871119225829414;      w(14)=0.11004701301647520;      w(15)=0.11004701301647520;      w(16)=0.10871119225829414;      w(17)=0.10605576592284642;      w(18)=0.10211296757806077;      w(19)=0.096930657997929916;      w(20)=0.090571744393032841;      w(21)=0.083113417228901218;      w(22)=0.074646214234568779;      w(23)=0.065272923966999596;      w(24)=0.055107345675716745;      w(25)=0.044272934759004228;      w(26)=0.032901427782304380;      w(27)=0.021132112592771260;      w(28)=0.0091242825930945177;   case(29)      w(1)=0.0085169038787464097;      w(2)=0.019732085056122706;      w(3)=0.030740492202093623;      w(4)=0.041402062518682836;      w(5)=0.051594826902497924;      w(6)=0.061203090657079139;      w(7)=0.070117933255051279;      w(8)=0.078238327135763784;      w(9)=0.085472257366172528;      w(10)=0.091737757139258763;      w(11)=0.096963834094408606;      w(12)=0.10109127375991497;      w(13)=0.10407331007772937;      w(14)=0.10587615509732094;      w(15)=0.10647938171831424;      w(16)=0.10587615509732094;      w(17)=0.10407331007772937;      w(18)=0.10109127375991497;      w(19)=0.096963834094408606;      w(20)=0.091737757139258763;      w(21)=0.085472257366172528;      w(22)=0.078238327135763784;      w(23)=0.070117933255051279;      w(24)=0.061203090657079139;      w(25)=0.051594826902497924;      w(26)=0.041402062518682836;      w(27)=0.030740492202093623;      w(28)=0.019732085056122706;      w(29)=0.0085169038787464097;   case(30)      w(1)=0.0079681924961666056;      w(2)=0.018466468311090959;      w(3)=0.028784707883323369;      w(4)=0.038799192569627050;      w(5)=0.048402672830594053;      w(6)=0.057493156217619066;      w(7)=0.065974229882180495;      w(8)=0.073755974737705206;      w(9)=0.080755895229420215;      w(10)=0.086899787201082980;      w(11)=0.092122522237786129;      w(12)=0.096368737174644260;      w(13)=0.099593420586795267;      w(14)=0.10176238974840550;      w(15)=0.10285265289355884;      w(16)=0.10285265289355884;      w(17)=0.10176238974840550;      w(18)=0.099593420586795267;      w(19)=0.096368737174644260;      w(20)=0.092122522237786129;      w(21)=0.086899787201082980;      w(22)=0.080755895229420215;      w(23)=0.073755974737705206;      w(24)=0.065974229882180495;      w(25)=0.057493156217619066;      w(26)=0.048402672830594053;      w(27)=0.038799192569627050;      w(28)=0.028784707883323369;      w(29)=0.018466468311090959;      w(30)=0.0079681924961666056;   case(31)      w(1)=0.0074708315792487759;      w(2)=0.017318620790310582;      w(3)=0.027009019184979422;      w(4)=0.036432273912385464;      w(5)=0.045493707527201103;      w(6)=0.054103082424916854;      w(7)=0.062174786561028427;      w(8)=0.069628583235410366;      w(9)=0.076390386598776616;      w(10)=0.082392991761589264;      w(11)=0.087576740608477876;      w(12)=0.091890113893641478;      w(13)=0.095290242912319513;      w(14)=0.097743335386328725;      w(15)=0.099225011226672308;      w(16)=0.099720544793426451;      w(17)=0.099225011226672308;      w(18)=0.097743335386328725;      w(19)=0.095290242912319513;      w(20)=0.091890113893641478;      w(21)=0.087576740608477876;      w(22)=0.082392991761589264;      w(23)=0.076390386598776616;      w(24)=0.069628583235410366;      w(25)=0.062174786561028427;      w(26)=0.054103082424916854;      w(27)=0.045493707527201103;      w(28)=0.036432273912385464;      w(29)=0.027009019184979422;      w(30)=0.017318620790310582;      w(31)=0.0074708315792487759;   case(32)      w(1)=0.0070186100094700966;      w(2)=0.016274394730905671;      w(3)=0.025392065309262059;      w(4)=0.034273862913021433;      w(5)=0.042835898022226681;      w(6)=0.050998059262376176;      w(7)=0.058684093478535547;      w(8)=0.065822222776361847;      w(9)=0.072345794108848506;      w(10)=0.078193895787070306;      w(11)=0.083311924226946755;      w(12)=0.087652093004403811;      w(13)=0.091173878695763885;      w(14)=0.093844399080804566;      w(15)=0.095638720079274859;      w(16)=0.096540088514727801;      w(17)=0.096540088514727801;      w(18)=0.095638720079274859;      w(19)=0.093844399080804566;      w(20)=0.091173878695763885;      w(21)=0.087652093004403811;      w(22)=0.083311924226946755;      w(23)=0.078193895787070306;      w(24)=0.072345794108848506;      w(25)=0.065822222776361847;      w(26)=0.058684093478535547;      w(27)=0.050998059262376176;      w(28)=0.042835898022226681;      w(29)=0.034273862913021433;      w(30)=0.025392065309262059;      w(31)=0.016274394730905671;      w(32)=0.0070186100094700966;   case(33)      w(1)=0.0066062278475873781;      w(2)=0.015321701512934676;      w(3)=0.023915548101749480;      w(4)=0.032300358632328953;      w(5)=0.040401541331669592;      w(6)=0.048147742818711696;      w(7)=0.055470846631663561;      w(8)=0.062306482530317480;      w(9)=0.068594572818656713;      w(10)=0.074279854843954149;      w(11)=0.079312364794886738;      w(12)=0.083647876067038708;      w(13)=0.087248287618844338;      w(14)=0.090081958660638577;      w(15)=0.092123986643316846;      w(16)=0.093356426065596116;      w(17)=0.093768446160209997;      w(18)=0.093356426065596116;      w(19)=0.092123986643316846;      w(20)=0.090081958660638577;      w(21)=0.087248287618844338;      w(22)=0.083647876067038708;      w(23)=0.079312364794886738;      w(24)=0.074279854843954149;      w(25)=0.068594572818656713;      w(26)=0.062306482530317480;      w(27)=0.055470846631663561;      w(28)=0.048147742818711696;      w(29)=0.040401541331669592;      w(30)=0.032300358632328953;      w(31)=0.023915548101749480;      w(32)=0.015321701512934676;      w(33)=0.0066062278475873781;   case(34)      w(1)=0.0062291405559086847;      w(2)=0.014450162748595035;      w(3)=0.022563721985494970;      w(4)=0.030491380638446132;      w(5)=0.038166593796387516;      w(6)=0.045525611523353272;      w(7)=0.052507414572678106;      w(8)=0.059054135827524493;      w(9)=0.065111521554076411;      w(10)=0.070629375814255725;      w(11)=0.075561974660031931;      w(12)=0.079868444339771845;      w(13)=0.083513099699845655;      w(14)=0.086465739747035750;      w(15)=0.088701897835693869;      w(16)=0.090203044370640730;      w(17)=0.090956740330259874;      w(18)=0.090956740330259874;      w(19)=0.090203044370640730;      w(20)=0.088701897835693869;      w(21)=0.086465739747035750;      w(22)=0.083513099699845655;      w(23)=0.079868444339771845;      w(24)=0.075561974660031931;      w(25)=0.070629375814255725;      w(26)=0.065111521554076411;      w(27)=0.059054135827524493;      w(28)=0.052507414572678106;      w(29)=0.045525611523353272;      w(30)=0.038166593796387516;      w(31)=0.030491380638446132;      w(32)=0.022563721985494970;      w(33)=0.014450162748595035;      w(34)=0.0062291405559086847;   case(35)      w(1)=0.0058834334204430850;      w(2)=0.013650828348361492;      w(3)=0.021322979911483581;      w(4)=0.028829260108894254;      w(5)=0.036110115863463381;      w(6)=0.043108422326170219;      w(7)=0.049769370401353530;      w(8)=0.056040816212370129;      w(9)=0.061873671966080189;      w(10)=0.067222285269086904;      w(11)=0.072044794772560065;      w(12)=0.076303457155442054;      w(13)=0.079964942242324263;      w(14)=0.083000593728856588;      w(15)=0.085386653392099125;      w(16)=0.087104446997183534;      w(17)=0.088140530430275463;      w(18)=0.088486794907104291;      w(19)=0.088140530430275463;      w(20)=0.087104446997183534;      w(21)=0.085386653392099125;      w(22)=0.083000593728856588;      w(23)=0.079964942242324263;      w(24)=0.076303457155442054;      w(25)=0.072044794772560065;      w(26)=0.067222285269086904;      w(27)=0.061873671966080189;      w(28)=0.056040816212370129;      w(29)=0.049769370401353530;      w(30)=0.043108422326170219;      w(31)=0.036110115863463381;      w(32)=0.028829260108894254;      w(33)=0.021322979911483581;      w(34)=0.013650828348361492;      w(35)=0.0058834334204430850;   case(36)      w(1)=0.0055657196642450454;      w(2)=0.012915947284065574;      w(3)=0.020181515297735472;      w(4)=0.027298621498568779;      w(5)=0.034213810770307230;      w(6)=0.040875750923644895;      w(7)=0.047235083490265978;      w(8)=0.053244713977759919;      w(9)=0.058860144245324817;      w(10)=0.064039797355015490;      w(11)=0.068745323835736443;      w(12)=0.072941885005653061;      w(13)=0.076598410645870675;      w(14)=0.079687828912071602;      w(15)=0.082187266704339710;      w(16)=0.084078218979661935;      w(17)=0.085346685739338627;      w(18)=0.085983275670394747;      w(19)=0.085983275670394747;      w(20)=0.085346685739338627;      w(21)=0.084078218979661935;      w(22)=0.082187266704339710;      w(23)=0.079687828912071602;      w(24)=0.076598410645870675;      w(25)=0.072941885005653061;      w(26)=0.068745323835736443;      w(27)=0.064039797355015490;      w(28)=0.058860144245324817;      w(29)=0.053244713977759919;      w(30)=0.047235083490265978;      w(31)=0.040875750923644895;      w(32)=0.034213810770307230;      w(33)=0.027298621498568779;      w(34)=0.020181515297735472;      w(35)=0.012915947284065574;      w(36)=0.0055657196642450454;   case(37)      w(1)=0.0052730572794979394;      w(2)=0.012238780100307557;      w(3)=0.019129044489083966;      w(4)=0.025886036990558934;      w(5)=0.032461639847521481;      w(6)=0.038809602501934544;      w(7)=0.044885364662437167;      w(8)=0.050646297654824602;      w(9)=0.056051987998274918;      w(10)=0.061064516523225986;      w(11)=0.065648722872751249;      w(12)=0.069772451555700345;      w(13)=0.073406777248488173;      w(14)=0.076526207570529238;      w(15)=0.079108861837529381;      w(16)=0.081136624508465031;      w(17)=0.082595272236437251;      w(18)=0.083474573625862787;      w(19)=0.083768360993138905;      w(20)=0.083474573625862787;      w(21)=0.082595272236437251;      w(22)=0.081136624508465031;      w(23)=0.079108861837529381;      w(24)=0.076526207570529238;      w(25)=0.073406777248488173;      w(26)=0.069772451555700345;      w(27)=0.065648722872751249;      w(28)=0.061064516523225986;      w(29)=0.056051987998274918;      w(30)=0.050646297654824602;      w(31)=0.044885364662437167;      w(32)=0.038809602501934544;      w(33)=0.032461639847521481;      w(34)=0.025886036990558934;      w(35)=0.019129044489083966;      w(36)=0.012238780100307557;      w(37)=0.0052730572794979394;   case(38)      w(1)=0.0050028807496393457;      w(2)=0.011613444716468674;      w(3)=0.018156577709613237;      w(4)=0.024579739738232376;      w(5)=0.030839500545175055;      w(6)=0.036894081594024738;      w(7)=0.042703158504674434;      w(8)=0.048228061860758683;      w(9)=0.053432019910332320;      w(10)=0.058280399146997206;      w(11)=0.062740933392133054;      w(12)=0.066783937979140412;      w(13)=0.070382507066898955;      w(14)=0.073512692584743457;      w(15)=0.076153663548446396;      w(16)=0.078287844658210948;      w(17)=0.079901033243527822;      w(18)=0.080982493770597101;      w(19)=0.081525029280385787;      w(20)=0.081525029280385787;      w(21)=0.080982493770597101;      w(22)=0.079901033243527822;      w(23)=0.078287844658210948;      w(24)=0.076153663548446396;      w(25)=0.073512692584743457;      w(26)=0.070382507066898955;      w(27)=0.066783937979140412;      w(28)=0.062740933392133054;      w(29)=0.058280399146997206;      w(30)=0.053432019910332320;      w(31)=0.048228061860758683;      w(32)=0.042703158504674434;      w(33)=0.036894081594024738;      w(34)=0.030839500545175055;      w(35)=0.024579739738232376;      w(36)=0.018156577709613237;      w(37)=0.011613444716468674;      w(38)=0.0050028807496393457;   case(39)      w(1)=0.0047529446916351014;      w(2)=0.011034788939164594;      w(3)=0.017256229093724919;      w(4)=0.023369384832178165;      w(5)=0.029334955983903379;      w(6)=0.035115111498131331;      w(7)=0.040673276847933844;      w(8)=0.045974301108916632;      w(9)=0.050984665292129405;      w(10)=0.055672690340916300;      w(11)=0.060008736088596150;      w(12)=0.063965388138682389;      w(13)=0.067517630966231265;      w(14)=0.070643005970608761;      w(15)=0.073321753414268617;      w(16)=0.075536937322836058;      w(17)=0.077274552544682017;      w(18)=0.078523613287371177;      w(19)=0.079276222568368471;      w(20)=0.079527622139442852;      w(21)=0.079276222568368471;      w(22)=0.078523613287371177;      w(23)=0.077274552544682017;      w(24)=0.075536937322836058;      w(25)=0.073321753414268617;      w(26)=0.070643005970608761;      w(27)=0.067517630966231265;      w(28)=0.063965388138682389;      w(29)=0.060008736088596150;      w(30)=0.055672690340916300;      w(31)=0.050984665292129405;      w(32)=0.045974301108916632;      w(33)=0.040673276847933844;      w(34)=0.035115111498131331;      w(35)=0.029334955983903379;      w(36)=0.023369384832178165;      w(37)=0.017256229093724919;      w(38)=0.011034788939164594;      w(39)=0.0047529446916351014;   case(40)      w(1)=0.0045212770985331913;      w(2)=0.010498284531152814;      w(3)=0.016421058381907889;      w(4)=0.022245849194166957;      w(5)=0.027937006980023401;      w(6)=0.033460195282547847;      w(7)=0.038782167974472018;      w(8)=0.043870908185673272;      w(9)=0.048695807635072232;      w(10)=0.053227846983936824;      w(11)=0.057439769099391551;      w(12)=0.061306242492928939;      w(13)=0.064804013456601038;      w(14)=0.067912045815233904;      w(15)=0.070611647391286780;      w(16)=0.072886582395804059;      w(17)=0.074723169057968264;      w(18)=0.076110361900626242;      w(19)=0.077039818164247966;      w(20)=0.077505947978424811;      w(21)=0.077505947978424811;      w(22)=0.077039818164247966;      w(23)=0.076110361900626242;      w(24)=0.074723169057968264;      w(25)=0.072886582395804059;      w(26)=0.070611647391286780;      w(27)=0.067912045815233904;      w(28)=0.064804013456601038;      w(29)=0.061306242492928939;      w(30)=0.057439769099391551;      w(31)=0.053227846983936824;      w(32)=0.048695807635072232;      w(33)=0.043870908185673272;      w(34)=0.038782167974472018;      w(35)=0.033460195282547847;      w(36)=0.027937006980023401;      w(37)=0.022245849194166957;      w(38)=0.016421058381907889;      w(39)=0.010498284531152814;      w(40)=0.0045212770985331913;   case(41)      w(1)=0.0043061403581648877;      w(2)=0.0099999387739059453;      w(3)=0.015644938407818589;      w(4)=0.021201063368779553;      w(5)=0.026635899207110445;      w(6)=0.031918211731699282;      w(7)=0.037017716703507988;      w(8)=0.041905195195909689;      w(9)=0.046552648369014342;      w(10)=0.050933454294617495;      w(11)=0.055022519242578742;      w(12)=0.058796420949871945;      w(13)=0.062233542580966316;      w(14)=0.065314196453527410;      w(15)=0.068020736760876767;      w(16)=0.070337660620817497;      w(17)=0.072251696861023073;      w(18)=0.073751882027223470;      w(19)=0.074829623176221552;      w(20)=0.075478747092715824;      w(21)=0.075695535647298372;      w(22)=0.075478747092715824;      w(23)=0.074829623176221552;      w(24)=0.073751882027223470;      w(25)=0.072251696861023073;      w(26)=0.070337660620817497;      w(27)=0.068020736760876767;      w(28)=0.065314196453527410;      w(29)=0.062233542580966316;      w(30)=0.058796420949871945;      w(31)=0.055022519242578742;      w(32)=0.050933454294617495;      w(33)=0.046552648369014342;      w(34)=0.041905195195909689;      w(35)=0.037017716703507988;      w(36)=0.031918211731699282;      w(37)=0.026635899207110445;      w(38)=0.021201063368779553;      w(39)=0.015644938407818589;      w(40)=0.0099999387739059453;      w(41)=0.0043061403581648877;   case(42)      w(1)=0.0041059986046490846;      w(2)=0.0095362203017485024;      w(3)=0.014922443697357494;      w(4)=0.020227869569052645;      w(5)=0.025422959526113048;      w(6)=0.030479240699603468;      w(7)=0.035369071097592111;      w(8)=0.040065735180692262;      w(9)=0.044543577771965878;      w(10)=0.048778140792803245;      w(11)=0.052746295699174070;      w(12)=0.056426369358018382;      w(13)=0.059798262227586654;      w(14)=0.062843558045002576;      w(15)=0.065545624364908979;      w(16)=0.067889703376521945;      w(17)=0.069862992492594160;      w(18)=0.071454714265170983;      w(19)=0.072656175243804105;      w(20)=0.073460813453467528;      w(21)=0.073864234232172880;      w(22)=0.073864234232172880;      w(23)=0.073460813453467528;      w(24)=0.072656175243804105;      w(25)=0.071454714265170983;      w(26)=0.069862992492594160;      w(27)=0.067889703376521945;      w(28)=0.065545624364908979;      w(29)=0.062843558045002576;      w(30)=0.059798262227586654;      w(31)=0.056426369358018382;      w(32)=0.052746295699174070;      w(33)=0.048778140792803245;      w(34)=0.044543577771965878;      w(35)=0.040065735180692262;      w(36)=0.035369071097592111;      w(37)=0.030479240699603468;      w(38)=0.025422959526113048;      w(39)=0.020227869569052645;      w(40)=0.014922443697357494;      w(41)=0.0095362203017485024;      w(42)=0.0041059986046490846;   case(43)      w(1)=0.0039194902538441273;      w(2)=0.0091039966374014033;      w(3)=0.014248756431576486;      w(4)=0.019319901423683900;      w(5)=0.024290456613838816;      w(6)=0.029134413261498495;      w(7)=0.033826492086860292;      w(8)=0.038342222194132658;      w(9)=0.042658057197982084;      w(10)=0.046751494754346580;      w(11)=0.050601192784390157;      w(12)=0.054187080318881787;      w(13)=0.057490461956910519;      w(14)=0.060494115249991295;      w(15)=0.063182380449396112;      w(16)=0.065541242126322797;      w(17)=0.067558402229365169;      w(18)=0.069223344193656684;      w(19)=0.070527387765085028;      w(20)=0.071463734252514141;      w(21)=0.072027501971421974;      w(22)=0.072215751693798988;      w(23)=0.072027501971421974;      w(24)=0.071463734252514141;      w(25)=0.070527387765085028;      w(26)=0.069223344193656684;      w(27)=0.067558402229365169;      w(28)=0.065541242126322797;      w(29)=0.063182380449396112;      w(30)=0.060494115249991295;      w(31)=0.057490461956910519;      w(32)=0.054187080318881787;      w(33)=0.050601192784390157;      w(34)=0.046751494754346580;      w(35)=0.042658057197982084;      w(36)=0.038342222194132658;      w(37)=0.033826492086860292;      w(38)=0.029134413261498495;      w(39)=0.024290456613838816;      w(40)=0.019319901423683900;      w(41)=0.014248756431576486;      w(42)=0.0091039966374014033;      w(43)=0.0039194902538441273;   case(44)      w(1)=0.0037454048031127775;      w(2)=0.0087004813675248441;      w(3)=0.013619586755579986;      w(4)=0.018471481736814749;      w(5)=0.023231481902019211;      w(6)=0.027875782821281010;      w(7)=0.032381222812069821;      w(8)=0.036725347813808874;      w(9)=0.040886512310346219;      w(10)=0.044843984081970031;      w(11)=0.048578046448352038;      w(12)=0.052070096091704462;      w(13)=0.055302735563728053;      w(14)=0.058259859877595495;      w(15)=0.060926736701561968;      w(16)=0.063290079733203855;      w(17)=0.065338114879181435;      w(18)=0.067060638906293652;      w(19)=0.068449070269366661;      w(20)=0.069496491861572578;      w(21)=0.070197685473558213;      w(22)=0.070549157789354069;      w(23)=0.070549157789354069;      w(24)=0.070197685473558213;      w(25)=0.069496491861572578;      w(26)=0.068449070269366661;      w(27)=0.067060638906293652;      w(28)=0.065338114879181435;      w(29)=0.063290079733203855;      w(30)=0.060926736701561968;      w(31)=0.058259859877595495;      w(32)=0.055302735563728053;      w(33)=0.052070096091704462;      w(34)=0.048578046448352038;      w(35)=0.044843984081970031;      w(36)=0.040886512310346219;      w(37)=0.036725347813808874;      w(38)=0.032381222812069821;      w(39)=0.027875782821281010;      w(40)=0.023231481902019211;      w(41)=0.018471481736814749;      w(42)=0.013619586755579986;      w(43)=0.0087004813675248441;      w(44)=0.0037454048031127775;   case(45)      w(1)=0.0035826631552835589;      w(2)=0.0083231892962182416;      w(3)=0.013031104991582784;      w(4)=0.017677535257937591;      w(5)=0.022239847550578732;      w(6)=0.026696213967577665;      w(7)=0.031025374934515467;      w(8)=0.035206692201609016;      w(9)=0.039220236729302448;      w(10)=0.043046880709164971;      w(11)=0.046668387718373365;      w(12)=0.050067499237952030;      w(13)=0.053228016731268952;      w(14)=0.056134878759786477;      w(15)=0.058774232718841739;      w(16)=0.061133500831066523;      w(17)=0.063201440073819938;      w(18)=0.064968195750723431;      w(19)=0.066425348449842528;      w(20)=0.067565954163607536;      w(21)=0.068384577378669675;      w(22)=0.068877316977661323;      w(23)=0.069041824829232020;      w(24)=0.068877316977661323;      w(25)=0.068384577378669675;      w(26)=0.067565954163607536;      w(27)=0.066425348449842528;      w(28)=0.064968195750723431;      w(29)=0.063201440073819938;      w(30)=0.061133500831066523;      w(31)=0.058774232718841739;      w(32)=0.056134878759786477;      w(33)=0.053228016731268952;      w(34)=0.050067499237952030;      w(35)=0.046668387718373365;      w(36)=0.043046880709164971;      w(37)=0.039220236729302448;      w(38)=0.035206692201609016;      w(39)=0.031025374934515467;      w(40)=0.026696213967577665;      w(41)=0.022239847550578732;      w(42)=0.017677535257937591;      w(43)=0.013031104991582784;      w(44)=0.0083231892962182416;      w(45)=0.0035826631552835589;   case(46)      w(1)=0.0034303008681070483;      w(2)=0.0079698982297246225;      w(3)=0.012479883770988684;      w(4)=0.016933514007836238;      w(5)=0.021309998754136501;      w(6)=0.025589286397130011;      w(7)=0.029751829552202756;      w(8)=0.033778627999106897;      w(9)=0.037651305357386071;      w(10)=0.041352190109678730;      w(11)=0.044864395277318127;      w(12)=0.048171895101712201;      w(13)=0.051259598007143021;      w(14)=0.054113415385856754;      w(15)=0.056720325843991236;      w(16)=0.059068434595546315;      w(17)=0.061147027724650481;      w(18)=0.062946621064394508;      w(19)=0.064459003467139070;      w(20)=0.065677274267781207;      w(21)=0.066595874768454887;      w(22)=0.067210613600678176;      w(23)=0.067518685849036459;      w(24)=0.067518685849036459;      w(25)=0.067210613600678176;      w(26)=0.066595874768454887;      w(27)=0.065677274267781207;      w(28)=0.064459003467139070;      w(29)=0.062946621064394508;      w(30)=0.061147027724650481;      w(31)=0.059068434595546315;      w(32)=0.056720325843991236;      w(33)=0.054113415385856754;      w(34)=0.051259598007143021;      w(35)=0.048171895101712201;      w(36)=0.044864395277318127;      w(37)=0.041352190109678730;      w(38)=0.037651305357386071;      w(39)=0.033778627999106897;      w(40)=0.029751829552202756;      w(41)=0.025589286397130011;      w(42)=0.021309998754136501;      w(43)=0.016933514007836238;      w(44)=0.012479883770988684;      w(45)=0.0079698982297246225;      w(46)=0.0034303008681070483;   case(47)      w(1)=0.0032874538425280149;      w(2)=0.0076386162958488336;      w(3)=0.011962848464312321;      w(4)=0.016235333146433060;      w(5)=0.020436938147668428;      w(6)=0.024549211659658819;      w(7)=0.028554150700643387;      w(8)=0.032434235515184757;      w(9)=0.036172496584174952;      w(10)=0.039752586122531004;      w(11)=0.043158848648479538;      w(12)=0.046376389086505911;      w(13)=0.049391137747361170;      w(14)=0.052189911780057145;      w(15)=0.054760472781530226;      w(16)=0.057091580293231540;      w(17)=0.059173040942338876;      w(18)=0.060995753008739645;      w(19)=0.062551746220921663;      w(20)=0.063834216605717031;      w(21)=0.064837556238945727;      w(22)=0.065557377766549740;      w(23)=0.065990533588810475;      w(24)=0.066135129623655480;      w(25)=0.065990533588810475;      w(26)=0.065557377766549740;      w(27)=0.064837556238945727;      w(28)=0.063834216605717031;      w(29)=0.062551746220921663;      w(30)=0.060995753008739645;      w(31)=0.059173040942338876;      w(32)=0.057091580293231540;      w(33)=0.054760472781530226;      w(34)=0.052189911780057145;      w(35)=0.049391137747361170;      w(36)=0.046376389086505911;      w(37)=0.043158848648479538;      w(38)=0.039752586122531004;      w(39)=0.036172496584174952;      w(40)=0.032434235515184757;      w(41)=0.028554150700643387;      w(42)=0.024549211659658819;      w(43)=0.020436938147668428;      w(44)=0.016235333146433060;      w(45)=0.011962848464312321;      w(46)=0.0076386162958488336;      w(47)=0.0032874538425280149;   case(48)      w(1)=0.0031533460523058386;      w(2)=0.0073275539012762621;      w(3)=0.011477234579234539;      w(4)=0.015579315722943849;      w(5)=0.019616160457355528;      w(6)=0.023570760839324379;      w(7)=0.027426509708356948;      w(8)=0.031167227832798089;      w(9)=0.034777222564770439;      w(10)=0.038241351065830706;      w(11)=0.041545082943464749;      w(12)=0.044674560856694280;      w(13)=0.047616658492490475;      w(14)=0.050359035553854475;      w(15)=0.052890189485193667;      w(16)=0.055199503699984163;      w(17)=0.057277292100403216;      w(18)=0.059114839698395636;      w(19)=0.060704439165893880;      w(20)=0.062039423159892664;      w(21)=0.063114192286254026;      w(22)=0.063924238584648187;      w(23)=0.064466164435950082;      w(24)=0.064737696812683923;      w(25)=0.064737696812683923;      w(26)=0.064466164435950082;      w(27)=0.063924238584648187;      w(28)=0.063114192286254026;      w(29)=0.062039423159892664;      w(30)=0.060704439165893880;      w(31)=0.059114839698395636;      w(32)=0.057277292100403216;      w(33)=0.055199503699984163;      w(34)=0.052890189485193667;      w(35)=0.050359035553854475;      w(36)=0.047616658492490475;      w(37)=0.044674560856694280;      w(38)=0.041545082943464749;      w(39)=0.038241351065830706;      w(40)=0.034777222564770439;      w(41)=0.031167227832798089;      w(42)=0.027426509708356948;      w(43)=0.023570760839324379;      w(44)=0.019616160457355528;      w(45)=0.015579315722943849;      w(46)=0.011477234579234539;      w(47)=0.0073275539012762621;      w(48)=0.0031533460523058386;   case(49)      w(1)=0.0030272789889229051;      w(2)=0.0070350995900864515;      w(3)=0.011020551031593580;      w(4)=0.014962144935624651;      w(5)=0.018843595853089458;      w(6)=0.022649201587446676;      w(7)=0.026363618927066017;      w(8)=0.029971884620583825;      w(9)=0.033459466791622174;      w(10)=0.036812320963000690;      w(11)=0.040016945766373021;      w(12)=0.043060436981259598;      w(13)=0.045930539355595854;      w(14)=0.048615695887828240;      w(15)=0.051105094330144591;      w(16)=0.053388710708258969;      w(17)=0.055457349674803589;      w(18)=0.057302681530187475;      w(19)=0.058917275760027266;      w(20)=0.060294630953152017;      w(21)=0.061429200979192936;      w(22)=0.062316417320057267;      w(23)=0.062952707465195699;      w(24)=0.063335509296491749;      w(25)=0.063463281404790598;      w(26)=0.063335509296491749;      w(27)=0.062952707465195699;      w(28)=0.062316417320057267;      w(29)=0.061429200979192936;      w(30)=0.060294630953152017;      w(31)=0.058917275760027266;      w(32)=0.057302681530187475;      w(33)=0.055457349674803589;      w(34)=0.053388710708258969;      w(35)=0.051105094330144591;      w(36)=0.048615695887828240;      w(37)=0.045930539355595854;      w(38)=0.043060436981259598;      w(39)=0.040016945766373021;      w(40)=0.036812320963000690;      w(41)=0.033459466791622174;      w(42)=0.029971884620583825;      w(43)=0.026363618927066017;      w(44)=0.022649201587446676;      w(45)=0.018843595853089458;      w(46)=0.014962144935624651;      w(47)=0.011020551031593580;      w(48)=0.0070350995900864515;      w(49)=0.0030272789889229051;   case(50)      w(1)=0.0029086225531551410;      w(2)=0.0067597991957454015;      w(3)=0.010590548383650969;      w(4)=0.014380822761485574;      w(5)=0.018115560713489390;      w(6)=0.021780243170124793;      w(7)=0.025360673570012390;      w(8)=0.028842993580535198;      w(9)=0.032213728223578017;      w(10)=0.035459835615146154;      w(11)=0.038568756612587675;      w(12)=0.041528463090147697;      w(13)=0.044327504338803275;      w(14)=0.046955051303948433;      w(15)=0.049400938449466315;      w(16)=0.051655703069581138;      w(17)=0.053710621888996247;      w(18)=0.055557744806212518;      w(19)=0.057189925647728384;      w(20)=0.058600849813222446;      w(21)=0.059785058704265458;      w(22)=0.060737970841770216;      w(23)=0.061455899590316664;      w(24)=0.061936067420683243;      w(25)=0.062176616655347262;      w(26)=0.062176616655347262;      w(27)=0.061936067420683243;      w(28)=0.061455899590316664;      w(29)=0.060737970841770216;      w(30)=0.059785058704265458;      w(31)=0.058600849813222446;      w(32)=0.057189925647728384;      w(33)=0.055557744806212518;      w(34)=0.053710621888996247;      w(35)=0.051655703069581138;      w(36)=0.049400938449466315;      w(37)=0.046955051303948433;      w(38)=0.044327504338803275;      w(39)=0.041528463090147697;      w(40)=0.038568756612587675;      w(41)=0.035459835615146154;      w(42)=0.032213728223578017;      w(43)=0.028842993580535198;      w(44)=0.025360673570012390;      w(45)=0.021780243170124793;      w(46)=0.018115560713489390;      w(47)=0.014380822761485574;      w(48)=0.010590548383650969;      w(49)=0.0067597991957454015;      w(50)=0.0029086225531551410;   case(51)      w(1)=0.0027968071710898956;      w(2)=0.0065003377832526003;      w(3)=0.010185191297821730;      w(4)=0.013832634006477822;      w(5)=0.017428714723401052;      w(6)=0.020959988401703211;      w(7)=0.024413300573781434;      w(8)=0.027775798594162477;      w(9)=0.031034971290160008;      w(10)=0.034178693204188336;      w(11)=0.037195268923260293;      w(12)=0.040073476285496453;      w(13)=0.042802607997880087;      w(14)=0.045372511407650069;      w(15)=0.047773626240623102;      w(16)=0.049997020150057410;      w(17)=0.052034421936697088;      w(18)=0.053878252313045561;      w(19)=0.055521652095738693;      w(20)=0.056958507720258662;      w(21)=0.058183473982592141;      w(22)=0.059191993922961544;      w(23)=0.059980315777503252;      w(24)=0.060545506934737795;      w(25)=0.060885464844856344;      w(26)=0.060998924841205880;      w(27)=0.060885464844856344;      w(28)=0.060545506934737795;      w(29)=0.059980315777503252;      w(30)=0.059191993922961544;      w(31)=0.058183473982592141;      w(32)=0.056958507720258662;      w(33)=0.055521652095738693;      w(34)=0.053878252313045561;      w(35)=0.052034421936697088;      w(36)=0.049997020150057410;      w(37)=0.047773626240623102;      w(38)=0.045372511407650069;      w(39)=0.042802607997880087;      w(40)=0.040073476285496453;      w(41)=0.037195268923260293;      w(42)=0.034178693204188336;      w(43)=0.031034971290160008;      w(44)=0.027775798594162477;      w(45)=0.024413300573781434;      w(46)=0.020959988401703211;      w(47)=0.017428714723401052;      w(48)=0.013832634006477822;      w(49)=0.010185191297821730;      w(50)=0.0065003377832526003;      w(51)=0.0027968071710898956;   case(52)      w(1)=0.0026913169500471111;      w(2)=0.0062555239629732769;      w(3)=0.0098026345794627521;      w(4)=0.013315114982340961;      w(5)=0.016780023396300736;      w(6)=0.020184891507980792;      w(7)=0.023517513553984462;      w(8)=0.026765953746504013;      w(9)=0.029918581147143947;      w(10)=0.032964109089718798;      w(11)=0.035891634835097233;      w(12)=0.038690678310423979;      w(13)=0.041351219500560272;      w(14)=0.043863734259000408;      w(15)=0.046219228372784794;      w(16)=0.048409269744074897;      w(17)=0.050426018566342377;      w(18)=0.052262255383906993;      w(19)=0.053911406932757265;      w(20)=0.055367569669302653;      w(21)=0.056625530902368597;      w(22)=0.057680787452526828;      w(23)=0.058529561771813869;      w(24)=0.059168815466042970;      w(25)=0.059596260171248158;      w(26)=0.059810365745291860;      w(27)=0.059810365745291860;      w(28)=0.059596260171248158;      w(29)=0.059168815466042970;      w(30)=0.058529561771813869;      w(31)=0.057680787452526828;      w(32)=0.056625530902368597;      w(33)=0.055367569669302653;      w(34)=0.053911406932757265;      w(35)=0.052262255383906993;      w(36)=0.050426018566342377;      w(37)=0.048409269744074897;      w(38)=0.046219228372784794;      w(39)=0.043863734259000408;      w(40)=0.041351219500560272;      w(41)=0.038690678310423979;      w(42)=0.035891634835097233;      w(43)=0.032964109089718798;      w(44)=0.029918581147143947;      w(45)=0.026765953746504013;      w(46)=0.023517513553984462;      w(47)=0.020184891507980792;      w(48)=0.016780023396300736;      w(49)=0.013315114982340961;      w(50)=0.0098026345794627521;      w(51)=0.0062555239629732769;      w(52)=0.0026913169500471111;   case(53)      w(1)=0.0025916837205670318;      w(2)=0.0060242762269486733;      w(3)=0.0094412022849403444;      w(4)=0.012826026144240379;      w(5)=0.016166725256687464;      w(6)=0.019451721107636895;      w(7)=0.022669673057070208;      w(8)=0.025809482510757518;      w(9)=0.028860323617823736;      w(10)=0.031811678459019323;      w(11)=0.034653372583534238;      w(12)=0.037375609803482916;      w(13)=0.039969005843540382;      w(14)=0.042424620634520014;      w(15)=0.044733989103672810;      w(16)=0.046889150340750314;      w(17)=0.048882675032699140;      w(18)=0.050707691069292715;      w(19)=0.052357907229872718;      w(20)=0.053827634868731029;      w(21)=0.055111807523933599;      w(22)=0.056205998381739710;      w(23)=0.057106435536267192;      w(24)=0.057810014991713196;      w(25)=0.058314311362256008;      w(26)=0.058617586232720263;      w(27)=0.058718794151164365;      w(28)=0.058617586232720263;      w(29)=0.058314311362256008;      w(30)=0.057810014991713196;      w(31)=0.057106435536267192;      w(32)=0.056205998381739710;      w(33)=0.055111807523933599;      w(34)=0.053827634868731029;      w(35)=0.052357907229872718;      w(36)=0.050707691069292715;      w(37)=0.048882675032699140;      w(38)=0.046889150340750314;      w(39)=0.044733989103672810;      w(40)=0.042424620634520014;      w(41)=0.039969005843540382;      w(42)=0.037375609803482916;      w(43)=0.034653372583534238;      w(44)=0.031811678459019323;      w(45)=0.028860323617823736;      w(46)=0.025809482510757518;      w(47)=0.022669673057070208;      w(48)=0.019451721107636895;      w(49)=0.016166725256687464;      w(50)=0.012826026144240379;      w(51)=0.0094412022849403444;      w(52)=0.0060242762269486733;      w(53)=0.0025916837205670318;   case(54)      w(1)=0.0024974818357615858;      w(2)=0.0058056110152399849;      w(3)=0.0090993694555093969;      w(4)=0.012363328128847644;      w(5)=0.015586303035924132;      w(6)=0.018757527621469378;      w(7)=0.021866451422853086;      w(8)=0.024902741467208773;      w(9)=0.027856309310595870;      w(10)=0.030717342497870676;      w(11)=0.033476336464372646;      w(12)=0.036124125840383553;      w(13)=0.038651914782102517;      w(14)=0.041051306136644974;      w(15)=0.043314329309597015;      w(16)=0.045433466728276714;      w(17)=0.047401678806444991;      w(18)=0.049212427324528886;      w(19)=0.050859697146188144;      w(20)=0.052338016198298745;      w(21)=0.053642473647553611;      w(22)=0.054768736213057986;      w(23)=0.055713062560589988;      w(24)=0.056472315730625965;      w(25)=0.057043973558794599;      w(26)=0.057426137054112115;      w(27)=0.057617536707147025;      w(28)=0.057617536707147025;      w(29)=0.057426137054112115;      w(30)=0.057043973558794599;      w(31)=0.056472315730625965;      w(32)=0.055713062560589988;      w(33)=0.054768736213057986;      w(34)=0.053642473647553611;      w(35)=0.052338016198298745;      w(36)=0.050859697146188144;      w(37)=0.049212427324528886;      w(38)=0.047401678806444991;      w(39)=0.045433466728276714;      w(40)=0.043314329309597015;      w(41)=0.041051306136644974;      w(42)=0.038651914782102517;      w(43)=0.036124125840383553;      w(44)=0.033476336464372646;      w(45)=0.030717342497870676;      w(46)=0.027856309310595870;      w(47)=0.024902741467208773;      w(48)=0.021866451422853086;      w(49)=0.018757527621469378;      w(50)=0.015586303035924132;      w(51)=0.012363328128847644;      w(52)=0.0090993694555093969;      w(53)=0.0058056110152399849;      w(54)=0.0024974818357615858;   case(55)      w(1)=0.0024083236199797888;      w(2)=0.0055986322665607674;      w(3)=0.0087757461070585282;      w(4)=0.011925160719848612;      w(5)=0.015036458333511788;      w(6)=0.018099614520729062;      w(7)=0.021104801668016454;      w(8)=0.024042388009725622;      w(9)=0.026902961456396271;      w(10)=0.029677357765161041;      w(11)=0.032356689226185832;      w(12)=0.034932372873589887;      w(13)=0.037396157867965545;      w(14)=0.039740151874337180;      w(15)=0.041956846317718762;      w(16)=0.044039140421606590;      w(17)=0.045980363946283838;      w(18)=0.047774298551200696;      w(19)=0.049415197711551739;      w(20)=0.050897805124493979;      w(21)=0.052217371545632085;      w(22)=0.053369670001605473;      w(23)=0.054351009329911102;      w(24)=0.055158246002508688;      w(25)=0.055788794195284087;      w(26)=0.056240634071084368;      w(27)=0.056512318249772001;      w(28)=0.056602976444560425;      w(29)=0.056512318249772001;      w(30)=0.056240634071084368;      w(31)=0.055788794195284087;      w(32)=0.055158246002508688;      w(33)=0.054351009329911102;      w(34)=0.053369670001605473;      w(35)=0.052217371545632085;      w(36)=0.050897805124493979;      w(37)=0.049415197711551739;      w(38)=0.047774298551200696;      w(39)=0.045980363946283838;      w(40)=0.044039140421606590;      w(41)=0.041956846317718762;      w(42)=0.039740151874337180;      w(43)=0.037396157867965545;      w(44)=0.034932372873589887;      w(45)=0.032356689226185832;      w(46)=0.029677357765161041;      w(47)=0.026902961456396271;      w(48)=0.024042388009725622;      w(49)=0.021104801668016454;      w(50)=0.018099614520729062;      w(51)=0.015036458333511788;      w(52)=0.011925160719848612;      w(53)=0.0087757461070585282;      w(54)=0.0055986322665607674;      w(55)=0.0024083236199797888;   case(56)      w(1)=0.0023238553757732155;      w(2)=0.0054025222460153378;      w(3)=0.0084690631633078877;      w(4)=0.011509824340383382;      w(5)=0.014515089278021472;      w(6)=0.017475512911400947;      w(7)=0.020381929882402573;      w(8)=0.023225351562565317;      w(9)=0.025996987058391952;      w(10)=0.028688268473822742;      w(11)=0.031290876747310448;      w(12)=0.033796767115611761;      w(13)=0.036198193872315186;      w(14)=0.038487734259247662;      w(15)=0.040658311384744518;      w(16)=0.042703216084667087;      w(17)=0.044616127652692283;      w(18)=0.046391133373001897;      w(19)=0.048022746793600258;      w(20)=0.049505924683047579;      w(21)=0.050836082617798481;      w(22)=0.052009109151741400;      w(23)=0.053021378524010764;      w(24)=0.053869761865714486;      w(25)=0.054551636870889421;      w(26)=0.055064895901762426;      w(27)=0.055407952503245123;      w(28)=0.055579746306514396;      w(29)=0.055579746306514396;      w(30)=0.055407952503245123;      w(31)=0.055064895901762426;      w(32)=0.054551636870889421;      w(33)=0.053869761865714486;      w(34)=0.053021378524010764;      w(35)=0.052009109151741400;      w(36)=0.050836082617798481;      w(37)=0.049505924683047579;      w(38)=0.048022746793600258;      w(39)=0.046391133373001897;      w(40)=0.044616127652692283;      w(41)=0.042703216084667087;      w(42)=0.040658311384744518;      w(43)=0.038487734259247662;      w(44)=0.036198193872315186;      w(45)=0.033796767115611761;      w(46)=0.031290876747310448;      w(47)=0.028688268473822742;      w(48)=0.025996987058391952;      w(49)=0.023225351562565317;      w(50)=0.020381929882402573;      w(51)=0.017475512911400947;      w(52)=0.014515089278021472;      w(53)=0.011509824340383382;      w(54)=0.0084690631633078877;      w(55)=0.0054025222460153378;      w(56)=0.0023238553757732155;   case(57)      w(1)=0.0022437538722506629;      w(2)=0.0052165334747187794;      w(3)=0.0081781600678212326;      w(4)=0.011115763732335990;      w(5)=0.014020270790753556;      w(6)=0.016882959023441549;      w(7)=0.019695270699488520;      w(8)=0.022448807890776438;      w(9)=0.025135350990918123;      w(10)=0.027746881402180192;      w(11)=0.030275604842693999;      w(12)=0.032713974366371569;      w(13)=0.035054712782312618;      w(14)=0.037290834324417317;      w(15)=0.039415665475480114;      w(16)=0.041422864870801110;      w(17)=0.043306442216215197;      w(18)=0.045060776161381158;      w(19)=0.046680631073641504;      w(20)=0.048161172661687751;      w(21)=0.049497982402019679;      w(22)=0.050687070724927409;      w(23)=0.051724888920517825;      w(24)=0.052608339729177432;      w(25)=0.053334786584819158;      w(26)=0.053902061483298575;      w(27)=0.054308471452498643;      w(28)=0.054552803604761886;      w(29)=0.054634328756584024;      w(30)=0.054552803604761886;      w(31)=0.054308471452498643;      w(32)=0.053902061483298575;      w(33)=0.053334786584819158;      w(34)=0.052608339729177432;      w(35)=0.051724888920517825;      w(36)=0.050687070724927409;      w(37)=0.049497982402019679;      w(38)=0.048161172661687751;      w(39)=0.046680631073641504;      w(40)=0.045060776161381158;      w(41)=0.043306442216215197;      w(42)=0.041422864870801110;      w(43)=0.039415665475480114;      w(44)=0.037290834324417317;      w(45)=0.035054712782312618;      w(46)=0.032713974366371569;      w(47)=0.030275604842693999;      w(48)=0.027746881402180192;      w(49)=0.025135350990918123;      w(50)=0.022448807890776438;      w(51)=0.019695270699488520;      w(52)=0.016882959023441549;      w(53)=0.014020270790753556;      w(54)=0.011115763732335990;      w(55)=0.0081781600678212326;      w(56)=0.0052165334747187794;      w(57)=0.0022437538722506629;   case(58)      w(1)=0.0021677232496274499;      w(2)=0.0050399816126502431;      w(3)=0.0079019738499986748;      w(4)=0.010741553532878774;      w(5)=0.013550237112988812;      w(6)=0.016319874234970965;      w(7)=0.019042465461893409;      w(8)=0.021710156140146236;      w(9)=0.024315252724963953;      w(10)=0.026850243181981868;      w(11)=0.029307818044160491;      w(12)=0.031680891253809327;      w(13)=0.033962620493416011;      w(14)=0.036146426867087271;      w(15)=0.038226013845858433;      w(16)=0.040195385409867797;      w(17)=0.042048863329582126;      w(18)=0.043781103533640251;      w(19)=0.045387111514819803;      w(20)=0.046862256729026347;      w(21)=0.048202285945417748;      w(22)=0.049403335508962393;      w(23)=0.050461942479953125;      w(24)=0.051375054618285725;      w(25)=0.052140039183669819;      w(26)=0.052754690526370833;      w(27)=0.053217236446579014;      w(28)=0.053526343304058252;      w(29)=0.053681119863334849;      w(30)=0.053681119863334849;      w(31)=0.053526343304058252;      w(32)=0.053217236446579014;      w(33)=0.052754690526370833;      w(34)=0.052140039183669819;      w(35)=0.051375054618285725;      w(36)=0.050461942479953125;      w(37)=0.049403335508962393;      w(38)=0.048202285945417748;      w(39)=0.046862256729026347;      w(40)=0.045387111514819803;      w(41)=0.043781103533640251;      w(42)=0.042048863329582126;      w(43)=0.040195385409867797;      w(44)=0.038226013845858433;      w(45)=0.036146426867087271;      w(46)=0.033962620493416011;      w(47)=0.031680891253809327;      w(48)=0.029307818044160491;      w(49)=0.026850243181981868;      w(50)=0.024315252724963953;      w(51)=0.021710156140146236;      w(52)=0.019042465461893409;      w(53)=0.016319874234970965;      w(54)=0.013550237112988812;      w(55)=0.010741553532878774;      w(56)=0.0079019738499986748;      w(57)=0.0050399816126502431;      w(58)=0.0021677232496274499;   case(59)      w(1)=0.0020954922845412234;      w(2)=0.0048722391682652848;      w(3)=0.0076395294534875751;      w(4)=0.010385885500995862;      w(5)=0.013103366306345191;      w(6)=0.015784347313081466;      w(7)=0.018421342753610029;      w(8)=0.021006998288437187;      w(9)=0.023534105393713363;      w(10)=0.025995619731298500;      w(11)=0.028384680200534798;      w(12)=0.030694627836111683;      w(13)=0.032919024271045278;      w(14)=0.035051669636400109;      w(15)=0.037086619818870923;      w(16)=0.039018203016160010;      w(17)=0.040841035538686708;      w(18)=0.042550036811067639;      w(19)=0.044140443530297381;      w(20)=0.045607822940509770;      w(21)=0.046948085186962019;      w(22)=0.048157494714606440;      w(23)=0.049232680679361986;      w(24)=0.050170646342996903;      w(25)=0.050968777425393917;      w(26)=0.051624849390891482;      w(27)=0.052137033648375391;      w(28)=0.052503902647828739;      w(29)=0.052724433859127932;      w(30)=0.052798012621990421;      w(31)=0.052724433859127932;      w(32)=0.052503902647828739;      w(33)=0.052137033648375391;      w(34)=0.051624849390891482;      w(35)=0.050968777425393917;      w(36)=0.050170646342996903;      w(37)=0.049232680679361986;      w(38)=0.048157494714606440;      w(39)=0.046948085186962019;      w(40)=0.045607822940509770;      w(41)=0.044140443530297381;      w(42)=0.042550036811067639;      w(43)=0.040841035538686708;      w(44)=0.039018203016160010;      w(45)=0.037086619818870923;      w(46)=0.035051669636400109;      w(47)=0.032919024271045278;      w(48)=0.030694627836111683;      w(49)=0.028384680200534798;      w(50)=0.025995619731298500;      w(51)=0.023534105393713363;      w(52)=0.021006998288437187;      w(53)=0.018421342753610029;      w(54)=0.015784347313081466;      w(55)=0.013103366306345191;      w(56)=0.010385885500995862;      w(57)=0.0076395294534875751;      w(58)=0.0048722391682652848;      w(59)=0.0020954922845412234;   case(60)      w(1)=0.0020268119688737585;      w(2)=0.0047127299269535686;      w(3)=0.0073899311633454555;      w(4)=0.010047557182287984;      w(5)=0.012678166476815960;      w(6)=0.015274618596784799;      w(7)=0.017829901014207720;      w(8)=0.020337120729457287;      w(9)=0.022789516943997820;      w(10)=0.025180477621521248;      w(11)=0.027503556749924792;      w(12)=0.029752491500788945;      w(13)=0.031921219019296329;      w(14)=0.034003892724946423;      w(15)=0.035994898051084503;      w(16)=0.037888867569243444;      w(17)=0.039680695452380799;      w(18)=0.041365551235584756;      w(19)=0.042938892835935642;      w(20)=0.044396478795787113;      w(21)=0.045734379716114487;      w(22)=0.046948988848912205;      w(23)=0.048037031819971181;      w(24)=0.048995575455756835;      w(25)=0.049822035690550181;      w(26)=0.050514184532509375;      w(27)=0.051070156069855627;      w(28)=0.051488451500980934;      w(29)=0.051767943174910188;      w(30)=0.051907877631220640;      w(31)=0.051907877631220640;      w(32)=0.051767943174910188;      w(33)=0.051488451500980934;      w(34)=0.051070156069855627;      w(35)=0.050514184532509375;      w(36)=0.049822035690550181;      w(37)=0.048995575455756835;      w(38)=0.048037031819971181;      w(39)=0.046948988848912205;      w(40)=0.045734379716114487;      w(41)=0.044396478795787113;      w(42)=0.042938892835935642;      w(43)=0.041365551235584756;      w(44)=0.039680695452380799;      w(45)=0.037888867569243444;      w(46)=0.035994898051084503;      w(47)=0.034003892724946423;      w(48)=0.031921219019296329;      w(49)=0.029752491500788945;      w(50)=0.027503556749924792;      w(51)=0.025180477621521248;      w(52)=0.022789516943997820;      w(53)=0.020337120729457287;      w(54)=0.017829901014207720;      w(55)=0.015274618596784799;      w(56)=0.012678166476815960;      w(57)=0.010047557182287984;      w(58)=0.0073899311633454555;      w(59)=0.0047127299269535686;      w(60)=0.0020268119688737585;   case(61)      w(1)=0.0019614533616702827;      w(2)=0.0045609240060124172;      w(3)=0.0071523549917490896;      w(4)=0.0097254618303561337;      w(5)=0.012273263507812105;      w(6)=0.014789065884937915;      w(7)=0.017266292987613744;      w(8)=0.019698477746101181;      w(9)=0.022079273148319044;      w(10)=0.024402467187544203;      w(11)=0.026661998524150890;      w(12)=0.028851972088183402;      w(13)=0.030966674368397395;      w(14)=0.033000588275907411;      w(15)=0.034948407516533351;      w(16)=0.036805050423154817;      w(17)=0.038565673207008173;      w(18)=0.040225682590998247;      w(19)=0.041780747790888492;      w(20)=0.043226811812496098;      w(21)=0.044560102035083488;      w(22)=0.045777140053145959;      w(23)=0.046874750750809066;      w(24)=0.047850070585095607;      w(25)=0.048700555056411526;      w(26)=0.049423985346735590;      w(27)=0.050018474108178253;      w(28)=0.050482470386797405;      w(29)=0.050814763668818343;      w(30)=0.051014487038697264;      w(31)=0.051081119440786218;      w(32)=0.051014487038697264;      w(33)=0.050814763668818343;      w(34)=0.050482470386797405;      w(35)=0.050018474108178253;      w(36)=0.049423985346735590;      w(37)=0.048700555056411526;      w(38)=0.047850070585095607;      w(39)=0.046874750750809066;      w(40)=0.045777140053145959;      w(41)=0.044560102035083488;      w(42)=0.043226811812496098;      w(43)=0.041780747790888492;      w(44)=0.040225682590998247;      w(45)=0.038565673207008173;      w(46)=0.036805050423154817;      w(47)=0.034948407516533351;      w(48)=0.033000588275907411;      w(49)=0.030966674368397395;      w(50)=0.028851972088183402;      w(51)=0.026661998524150890;      w(52)=0.024402467187544203;      w(53)=0.022079273148319044;      w(54)=0.019698477746101181;      w(55)=0.017266292987613744;      w(56)=0.014789065884937915;      w(57)=0.012273263507812105;      w(58)=0.0097254618303561337;      w(59)=0.0071523549917490896;      w(60)=0.0045609240060124172;      w(61)=0.0019614533616702827;   case(62)      w(1)=0.0018992056795136905;      w(2)=0.0044163334569309048;      w(3)=0.0069260419018309609;      w(4)=0.0094185794284203876;      w(5)=0.011887390117010502;      w(6)=0.014326191823806518;      w(7)=0.016728811790177316;      w(8)=0.019089176658573199;      w(9)=0.021401322277669969;      w(10)=0.023659407208682793;      w(11)=0.025857726954024698;      w(12)=0.027990728163314638;      w(13)=0.030053022573989870;      w(14)=0.032039400581624678;      w(15)=0.033944844379410545;      w(16)=0.035764540622768141;      w(17)=0.037493892582280030;      w(18)=0.039128531751963084;      w(19)=0.040664328882417441;      w(20)=0.042097404410385097;      w(21)=0.043424138258047420;      w(22)=0.044641178977124414;      w(23)=0.045745452214570181;      w(24)=0.046734168478415525;      w(25)=0.047604830184101232;      w(26)=0.048355237963477673;      w(27)=0.048983496220517837;      w(28)=0.049488017919699293;      w(29)=0.049867528594952394;      w(30)=0.050121069569043288;      w(31)=0.050248000375256282;      w(32)=0.050248000375256282;      w(33)=0.050121069569043288;      w(34)=0.049867528594952394;      w(35)=0.049488017919699293;      w(36)=0.048983496220517837;      w(37)=0.048355237963477673;      w(38)=0.047604830184101232;      w(39)=0.046734168478415525;      w(40)=0.045745452214570181;      w(41)=0.044641178977124414;      w(42)=0.043424138258047420;      w(43)=0.042097404410385097;      w(44)=0.040664328882417441;      w(45)=0.039128531751963084;      w(46)=0.037493892582280030;      w(47)=0.035764540622768141;      w(48)=0.033944844379410545;      w(49)=0.032039400581624678;      w(50)=0.030053022573989870;      w(51)=0.027990728163314638;      w(52)=0.025857726954024698;      w(53)=0.023659407208682793;      w(54)=0.021401322277669969;      w(55)=0.019089176658573199;      w(56)=0.016728811790177316;      w(57)=0.014326191823806518;      w(58)=0.011887390117010502;      w(59)=0.0094185794284203876;      w(60)=0.0069260419018309609;      w(61)=0.0044163334569309048;      w(62)=0.0018992056795136905;   case(63)      w(1)=0.0018398745955770841;      w(2)=0.0042785083468637619;      w(3)=0.0067102917659601363;      w(4)=0.0091259686763266564;      w(5)=0.011519376076880042;      w(6)=0.013884612616115611;      w(7)=0.016215878410338339;      w(8)=0.018507464460161270;      w(9)=0.020753761258039091;      w(10)=0.022949271004889933;      w(11)=0.025088620553344987;      w(12)=0.027166574359097933;      w(13)=0.029178047208280527;      w(14)=0.031118116622219818;      w(15)=0.032982034883779342;      w(16)=0.034765240645355878;      w(17)=0.036463370085457290;      w(18)=0.038072267584349557;      w(19)=0.039587995891544094;      w(20)=0.041006845759666399;      w(21)=0.042325345020815823;      w(22)=0.043540267083027591;      w(23)=0.044648638825941395;      w(24)=0.045647747876292609;      w(25)=0.046535149245383697;      w(26)=0.047308671312268919;      w(27)=0.047966421137995131;      w(28)=0.048506789097883848;      w(29)=0.048928452820511990;      w(30)=0.049230380423747561;      w(31)=0.049411833039918179;      w(32)=0.049472366623931021;      w(33)=0.049411833039918179;      w(34)=0.049230380423747561;      w(35)=0.048928452820511990;      w(36)=0.048506789097883848;      w(37)=0.047966421137995131;      w(38)=0.047308671312268919;      w(39)=0.046535149245383697;      w(40)=0.045647747876292609;      w(41)=0.044648638825941395;      w(42)=0.043540267083027591;      w(43)=0.042325345020815823;      w(44)=0.041006845759666399;      w(45)=0.039587995891544094;      w(46)=0.038072267584349557;      w(47)=0.036463370085457290;      w(48)=0.034765240645355878;      w(49)=0.032982034883779342;      w(50)=0.031118116622219818;      w(51)=0.029178047208280527;      w(52)=0.027166574359097933;      w(53)=0.025088620553344987;      w(54)=0.022949271004889933;      w(55)=0.020753761258039091;      w(56)=0.018507464460161270;      w(57)=0.016215878410338339;      w(58)=0.013884612616115611;      w(59)=0.011519376076880042;      w(60)=0.0091259686763266564;      w(61)=0.0067102917659601363;      w(62)=0.0042785083468637619;      w(63)=0.0018398745955770841;   case(64)      w(1)=0.0017832807216964329;      w(2)=0.0041470332605624676;      w(3)=0.0065044579689783629;      w(4)=0.0088467598263639477;      w(5)=0.011168139460131129;      w(6)=0.013463047896718643;      w(7)=0.015726030476024719;      w(8)=0.017951715775697343;      w(9)=0.020134823153530209;      w(10)=0.022270173808383254;      w(11)=0.024352702568710873;      w(12)=0.026377469715054659;      w(13)=0.028339672614259483;      w(14)=0.030234657072402479;      w(15)=0.032057928354851554;      w(16)=0.033805161837141609;      w(17)=0.035472213256882384;      w(18)=0.037055128540240046;      w(19)=0.038550153178615629;      w(20)=0.039953741132720341;      w(21)=0.041262563242623529;      w(22)=0.042473515123653589;      w(23)=0.043583724529323453;      w(24)=0.044590558163756563;      w(25)=0.045491627927418144;      w(26)=0.046284796581314417;      w(27)=0.046968182816210017;      w(28)=0.047540165714830309;      w(29)=0.047999388596458308;      w(30)=0.048344762234802957;      w(31)=0.048575467441503427;      w(32)=0.048690957009139720;      w(33)=0.048690957009139720;      w(34)=0.048575467441503427;      w(35)=0.048344762234802957;      w(36)=0.047999388596458308;      w(37)=0.047540165714830309;      w(38)=0.046968182816210017;      w(39)=0.046284796581314417;      w(40)=0.045491627927418144;      w(41)=0.044590558163756563;      w(42)=0.043583724529323453;      w(43)=0.042473515123653589;      w(44)=0.041262563242623529;      w(45)=0.039953741132720341;      w(46)=0.038550153178615629;      w(47)=0.037055128540240046;      w(48)=0.035472213256882384;      w(49)=0.033805161837141609;      w(50)=0.032057928354851554;      w(51)=0.030234657072402479;      w(52)=0.028339672614259483;      w(53)=0.026377469715054659;      w(54)=0.024352702568710873;      w(55)=0.022270173808383254;      w(56)=0.020134823153530209;      w(57)=0.017951715775697343;      w(58)=0.015726030476024719;      w(59)=0.013463047896718643;      w(60)=0.011168139460131129;      w(61)=0.0088467598263639477;      w(62)=0.0065044579689783629;      w(63)=0.0041470332605624676;      w(64)=0.0017832807216964329;    otherwise        error('GAUSS_WEIGHTS - Fatal error! Illegal value of n.');end function x = gausspoints(n)%%  function x = gausspoints(n)%%  For 1 <= n <= 64, returns the abscissas x of an n point%  Gauss-Legendre quadrature rule over the interval [-1,1].%x = ones(1,n);switch n   case(1)      x(1)=0.0;   case(2)      x(1)=-0.57735026918962576;      x(2)=0.57735026918962576;   case(3)      x(1)=-0.77459666924148338;      x(2)=0.0;      x(3)=0.77459666924148338;   case(4)      x(1)=-0.86113631159405258;      x(2)=-0.33998104358485626;      x(3)=0.33998104358485626;      x(4)=0.86113631159405258;   case(5)      x(1)=-0.90617984593866399;      x(2)=-0.53846931010568309;      x(3)=0.0;      x(4)=0.53846931010568309;      x(5)=0.90617984593866399;   case(6)      x(1)=-0.93246951420315203;      x(2)=-0.66120938646626451;      x(3)=-0.23861918608319691;      x(4)=0.23861918608319691;      x(5)=0.66120938646626451;      x(6)=0.93246951420315203;   case(7)      x(1)=-0.94910791234275852;      x(2)=-0.74153118559939444;      x(3)=-0.40584515137739717;      x(4)=0.0;      x(5)=0.40584515137739717;      x(6)=0.74153118559939444;      x(7)=0.94910791234275852;   case(8)      x(1)=-0.96028985649753623;      x(2)=-0.79666647741362674;      x(3)=-0.52553240991632899;      x(4)=-0.18343464249564980;      x(5)=0.18343464249564980;      x(6)=0.52553240991632899;      x(7)=0.79666647741362674;      x(8)=0.96028985649753623;   case(9)      x(1)=-0.96816023950762609;      x(2)=-0.83603110732663579;      x(3)=-0.61337143270059040;      x(4)=-0.32425342340380893;      x(5)=0.0;      x(6)=0.32425342340380893;      x(7)=0.61337143270059040;      x(8)=0.83603110732663579;      x(9)=0.96816023950762609;   case(10)      x(1)=-0.97390652851717172;      x(2)=-0.86506336668898451;      x(3)=-0.67940956829902441;      x(4)=-0.43339539412924719;      x(5)=-0.14887433898163121;      x(6)=0.14887433898163121;      x(7)=0.43339539412924719;      x(8)=0.67940956829902441;      x(9)=0.86506336668898451;      x(10)=0.97390652851717172;   case(11)      x(1)=-0.97822865814605699;      x(2)=-0.88706259976809530;      x(3)=-0.73015200557404932;      x(4)=-0.51909612920681182;      x(5)=-0.26954315595234497;      x(6)=0.0;      x(7)=0.26954315595234497;      x(8)=0.51909612920681182;      x(9)=0.73015200557404932;      x(10)=0.88706259976809530;      x(11)=0.97822865814605699;   case(12)      x(1)=-0.98156063424671925;      x(2)=-0.90411725637047486;      x(3)=-0.76990267419430469;      x(4)=-0.58731795428661745;      x(5)=-0.36783149899818019;      x(6)=-0.12523340851146892;      x(7)=0.12523340851146892;      x(8)=0.36783149899818019;      x(9)=0.58731795428661745;      x(10)=0.76990267419430469;      x(11)=0.90411725637047486;      x(12)=0.98156063424671925;   case(13)      x(1)=-0.98418305471858815;      x(2)=-0.91759839922297797;      x(3)=-0.80157809073330991;      x(4)=-0.64234933944034022;      x(5)=-0.44849275103644685;      x(6)=-0.23045831595513479;      x(7)=0.0;      x(8)=0.23045831595513479;      x(9)=0.44849275103644685;      x(10)=0.64234933944034022;      x(11)=0.80157809073330991;      x(12)=0.91759839922297797;      x(13)=0.98418305471858815;   case(14)      x(1)=-0.98628380869681234;      x(2)=-0.92843488366357352;      x(3)=-0.82720131506976499;      x(4)=-0.68729290481168547;      x(5)=-0.51524863635815409;      x(6)=-0.31911236892788976;      x(7)=-0.10805494870734366;      x(8)=0.10805494870734366;      x(9)=0.31911236892788976;      x(10)=0.51524863635815409;      x(11)=0.68729290481168547;      x(12)=0.82720131506976499;      x(13)=0.92843488366357352;      x(14)=0.98628380869681234;   case(15)      x(1)=-0.98799251802048543;      x(2)=-0.93727339240070590;      x(3)=-0.84820658341042722;      x(4)=-0.72441773136017005;      x(5)=-0.57097217260853885;      x(6)=-0.39415134707756337;      x(7)=-0.20119409399743452;      x(8)=0.0;      x(9)=0.20119409399743452;      x(10)=0.39415134707756337;      x(11)=0.57097217260853885;      x(12)=0.72441773136017005;      x(13)=0.84820658341042722;      x(14)=0.93727339240070590;      x(15)=0.98799251802048543;   case(16)      x(1)=-0.98940093499164993;      x(2)=-0.94457502307323258;      x(3)=-0.86563120238783174;      x(4)=-0.75540440835500303;      x(5)=-0.61787624440264375;      x(6)=-0.45801677765722739;      x(7)=-0.28160355077925891;      x(8)=-0.095012509837637440;      x(9)=0.095012509837637440;      x(10)=0.28160355077925891;      x(11)=0.45801677765722739;      x(12)=0.61787624440264375;      x(13)=0.75540440835500303;      x(14)=0.86563120238783174;      x(15)=0.94457502307323258;      x(16)=0.98940093499164993;   case(17)      x(1)=-0.99057547531441734;      x(2)=-0.95067552176876776;      x(3)=-0.88023915372698590;      x(4)=-0.78151400389680141;      x(5)=-0.65767115921669077;      x(6)=-0.51269053708647697;      x(7)=-0.35123176345387632;      x(8)=-0.17848418149584786;      x(9)=0.0;      x(10)=0.17848418149584786;      x(11)=0.35123176345387632;      x(12)=0.51269053708647697;      x(13)=0.65767115921669077;      x(14)=0.78151400389680141;      x(15)=0.88023915372698590;      x(16)=0.95067552176876776;      x(17)=0.99057547531441734;   case(18)      x(1)=-0.99156516842093095;      x(2)=-0.95582394957139776;      x(3)=-0.89260246649755574;      x(4)=-0.80370495897252312;      x(5)=-0.69168704306035321;      x(6)=-0.55977083107394753;      x(7)=-0.41175116146284265;      x(8)=-0.25188622569150551;      x(9)=-0.084775013041735301;      x(10)=0.084775013041735301;      x(11)=0.25188622569150551;      x(12)=0.41175116146284265;      x(13)=0.55977083107394753;      x(14)=0.69168704306035321;      x(15)=0.80370495897252312;      x(16)=0.89260246649755574;      x(17)=0.95582394957139776;      x(18)=0.99156516842093095;   case(19)      x(1)=-0.99240684384358440;      x(2)=-0.96020815213483003;      x(3)=-0.90315590361481790;      x(4)=-0.82271465653714282;      x(5)=-0.72096617733522938;      x(6)=-0.60054530466168102;      x(7)=-0.46457074137596095;      x(8)=-0.31656409996362983;      x(9)=-0.16035864564022538;      x(10)=0.0;      x(11)=0.16035864564022538;      x(12)=0.31656409996362983;      x(13)=0.46457074137596095;      x(14)=0.60054530466168102;      x(15)=0.72096617733522938;      x(16)=0.82271465653714282;      x(17)=0.90315590361481790;      x(18)=0.96020815213483003;      x(19)=0.99240684384358440;   case(20)      x(1)=-0.99312859918509492;      x(2)=-0.96397192727791379;      x(3)=-0.91223442825132591;      x(4)=-0.83911697182221882;      x(5)=-0.74633190646015079;      x(6)=-0.63605368072651503;      x(7)=-0.51086700195082710;      x(8)=-0.37370608871541956;      x(9)=-0.22778585114164508;      x(10)=-0.076526521133497334;      x(11)=0.076526521133497334;      x(12)=0.22778585114164508;      x(13)=0.37370608871541956;      x(14)=0.51086700195082710;      x(15)=0.63605368072651503;      x(16)=0.74633190646015079;      x(17)=0.83911697182221882;      x(18)=0.91223442825132591;      x(19)=0.96397192727791379;      x(20)=0.99312859918509492;   case(21)      x(1)=-0.99375217062038950;      x(2)=-0.96722683856630629;      x(3)=-0.92009933415040083;      x(4)=-0.85336336458331728;      x(5)=-0.76843996347567791;      x(6)=-0.66713880419741232;      x(7)=-0.55161883588721981;      x(8)=-0.42434212020743878;      x(9)=-0.28802131680240110;      x(10)=-0.14556185416089509;      x(11)=0.0;      x(12)=0.14556185416089509;      x(13)=0.28802131680240110;      x(14)=0.42434212020743878;      x(15)=0.55161883588721981;      x(16)=0.66713880419741232;      x(17)=0.76843996347567791;      x(18)=0.85336336458331728;      x(19)=0.92009933415040083;      x(20)=0.96722683856630629;      x(21)=0.99375217062038950;   case(22)      x(1)=-0.99429458548239929;      x(2)=-0.97006049783542873;      x(3)=-0.92695677218717400;      x(4)=-0.86581257772030014;      x(5)=-0.78781680597920816;      x(6)=-0.69448726318668278;      x(7)=-0.58764040350691159;      x(8)=-0.46935583798675703;      x(9)=-0.34193582089208423;      x(10)=-0.20786042668822129;      x(11)=-0.069739273319722221;      x(12)=0.069739273319722221;      x(13)=0.20786042668822129;      x(14)=0.34193582089208423;      x(15)=0.46935583798675703;      x(16)=0.58764040350691159;      x(17)=0.69448726318668278;      x(18)=0.78781680597920816;      x(19)=0.86581257772030014;      x(20)=0.92695677218717400;      x(21)=0.97006049783542873;      x(22)=0.99429458548239929;   case(23)      x(1)=-0.99476933499755212;      x(2)=-0.97254247121811523;      x(3)=-0.93297108682601610;      x(4)=-0.87675235827044167;      x(5)=-0.80488840161883989;      x(6)=-0.71866136313195019;      x(7)=-0.61960987576364616;      x(8)=-0.50950147784600755;      x(9)=-0.39030103803029083;      x(10)=-0.26413568097034493;      x(11)=-0.13325682429846611;      x(12)=0.0;      x(13)=0.13325682429846611;      x(14)=0.26413568097034493;      x(15)=0.39030103803029083;      x(16)=0.50950147784600755;      x(17)=0.61960987576364616;      x(18)=0.71866136313195019;      x(19)=0.80488840161883989;      x(20)=0.87675235827044167;      x(21)=0.93297108682601610;      x(22)=0.97254247121811523;      x(23)=0.99476933499755212;   case(24)      x(1)=-0.99518721999702136;      x(2)=-0.97472855597130950;      x(3)=-0.93827455200273276;      x(4)=-0.88641552700440103;      x(5)=-0.82000198597390292;      x(6)=-0.74012419157855436;      x(7)=-0.64809365193697557;      x(8)=-0.54542147138883954;      x(9)=-0.43379350762604514;      x(10)=-0.31504267969616337;      x(11)=-0.19111886747361631;      x(12)=-0.064056892862605626;      x(13)=0.064056892862605626;      x(14)=0.19111886747361631;      x(15)=0.31504267969616337;      x(16)=0.43379350762604514;      x(17)=0.54542147138883954;      x(18)=0.64809365193697557;      x(19)=0.74012419157855436;      x(20)=0.82000198597390292;      x(21)=0.88641552700440103;      x(22)=0.93827455200273276;      x(23)=0.97472855597130950;      x(24)=0.99518721999702136;   case(25)      x(1)=-0.99555696979049810;      x(2)=-0.97666392145951751;      x(3)=-0.94297457122897434;      x(4)=-0.89499199787827537;      x(5)=-0.83344262876083400;      x(6)=-0.75925926303735763;      x(7)=-0.67356636847346836;      x(8)=-0.57766293024122297;      x(9)=-0.47300273144571496;      x(10)=-0.36117230580938784;      x(11)=-0.24386688372098843;      x(12)=-0.12286469261071040;      x(13)=0.0;      x(14)=0.12286469261071040;      x(15)=0.24386688372098843;      x(16)=0.36117230580938784;      x(17)=0.47300273144571496;      x(18)=0.57766293024122297;      x(19)=0.67356636847346836;      x(20)=0.75925926303735763;      x(21)=0.83344262876083400;      x(22)=0.89499199787827537;      x(23)=0.94297457122897434;      x(24)=0.97666392145951751;      x(25)=0.99555696979049810;   case(26)      x(1)=-0.99588570114561693;      x(2)=-0.97838544595647099;      x(3)=-0.94715906666171425;      x(4)=-0.90263786198430707;      x(5)=-0.84544594278849802;      x(6)=-0.77638594882067886;      x(7)=-0.69642726041995726;      x(8)=-0.60669229301761806;      x(9)=-0.50844071482450572;      x(10)=-0.40305175512348631;      x(11)=-0.29200483948595690;      x(12)=-0.17685882035689018;      x(13)=-0.059230093429313207;      x(14)=0.059230093429313207;      x(15)=0.17685882035689018;      x(16)=0.29200483948595690;      x(17)=0.40305175512348631;      x(18)=0.50844071482450572;      x(19)=0.60669229301761806;      x(20)=0.69642726041995726;      x(21)=0.77638594882067886;      x(22)=0.84544594278849802;      x(23)=0.90263786198430707;      x(24)=0.94715906666171425;      x(25)=0.97838544595647099;      x(26)=0.99588570114561693;   case(27)      x(1)=-0.99617926288898857;      x(2)=-0.97992347596150122;      x(3)=-0.95090055781470501;      x(4)=-0.90948232067749110;      x(5)=-0.85620790801829449;      x(6)=-0.79177163907050823;      x(7)=-0.71701347373942370;      x(8)=-0.63290797194649514;      x(9)=-0.54055156457945689;      x(10)=-0.44114825175002688;      x(11)=-0.33599390363850890;      x(12)=-0.22645936543953686;      x(13)=-0.11397258560952997;      x(14)=0.0;      x(15)=0.11397258560952997;      x(16)=0.22645936543953686;      x(17)=0.33599390363850890;      x(18)=0.44114825175002688;      x(19)=0.54055156457945689;      x(20)=0.63290797194649514;      x(21)=0.71701347373942370;      x(22)=0.79177163907050823;      x(23)=0.85620790801829449;      x(24)=0.90948232067749110;      x(25)=0.95090055781470501;      x(26)=0.97992347596150122;      x(27)=0.99617926288898857;   case(28)      x(1)=-0.99644249757395445;      x(2)=-0.98130316537087275;      x(3)=-0.95425928062893820;      x(4)=-0.91563302639213207;      x(5)=-0.86589252257439505;      x(6)=-0.80564137091717917;      x(7)=-0.73561087801363177;      x(8)=-0.65665109403886496;      x(9)=-0.56972047181140172;      x(10)=-0.47587422495511826;      x(11)=-0.37625151608907871;      x(12)=-0.27206162763517808;      x(13)=-0.16456928213338077;      x(14)=-0.055079289884034270;      x(15)=0.055079289884034270;      x(16)=0.16456928213338077;      x(17)=0.27206162763517808;      x(18)=0.37625151608907871;      x(19)=0.47587422495511826;      x(20)=0.56972047181140172;      x(21)=0.65665109403886496;      x(22)=0.73561087801363177;      x(23)=0.80564137091717917;      x(24)=0.86589252257439505;      x(25)=0.91563302639213207;      x(26)=0.95425928062893820;      x(27)=0.98130316537087275;      x(28)=0.99644249757395445;   case(29)      x(1)=-0.99667944226059659;      x(2)=-0.98254550526141317;      x(3)=-0.95728559577808773;      x(4)=-0.92118023295305879;      x(5)=-0.87463780492010279;      x(6)=-0.81818548761525244;      x(7)=-0.75246285173447713;      x(8)=-0.67821453760268652;      x(9)=-0.59628179713822782;      x(10)=-0.50759295512422764;      x(11)=-0.41315288817400866;      x(12)=-0.31403163786763993;      x(13)=-0.21135228616600107;      x(14)=-0.10627823013267923;      x(15)=0.0;      x(16)=0.10627823013267923;      x(17)=0.21135228616600107;      x(18)=0.31403163786763993;      x(19)=0.41315288817400866;      x(20)=0.50759295512422764;      x(21)=0.59628179713822782;      x(22)=0.67821453760268652;      x(23)=0.75246285173447713;      x(24)=0.81818548761525244;      x(25)=0.87463780492010279;      x(26)=0.92118023295305879;      x(27)=0.95728559577808773;      x(28)=0.98254550526141317;      x(29)=0.99667944226059659;   case(30)      x(1)=-0.99689348407464954;      x(2)=-0.98366812327974721;      x(3)=-0.96002186496830751;      x(4)=-0.92620004742927433;      x(5)=-0.88256053579205268;      x(6)=-0.82956576238276840;      x(7)=-0.76777743210482619;      x(8)=-0.69785049479331580;      x(9)=-0.62052618298924286;      x(10)=-0.53662414814201990;      x(11)=-0.44703376953808918;      x(12)=-0.35270472553087811;      x(13)=-0.25463692616788985;      x(14)=-0.15386991360858355;      x(15)=-0.051471842555317696;      x(16)=0.051471842555317696;      x(17)=0.15386991360858355;      x(18)=0.25463692616788985;      x(19)=0.35270472553087811;      x(20)=0.44703376953808918;      x(21)=0.53662414814201990;      x(22)=0.62052618298924286;      x(23)=0.69785049479331580;      x(24)=0.76777743210482619;      x(25)=0.82956576238276840;      x(26)=0.88256053579205268;      x(27)=0.92620004742927433;      x(28)=0.96002186496830751;      x(29)=0.98366812327974721;      x(30)=0.99689348407464954;   case(31)      x(1)=-0.99708748181947707;      x(2)=-0.98468590966515248;      x(3)=-0.96250392509294966;      x(4)=-0.93075699789664816;      x(5)=-0.88976002994827104;      x(6)=-0.83992032014626734;      x(7)=-0.78173314841662494;      x(8)=-0.71577678458685328;      x(9)=-0.64270672292426035;      x(10)=-0.56324916140714926;      x(11)=-0.47819378204490248;      x(12)=-0.38838590160823294;      x(13)=-0.29471806998170162;      x(14)=-0.19812119933557063;      x(15)=-0.099555312152341520;      x(16)=0.0;      x(17)=0.099555312152341520;      x(18)=0.19812119933557063;      x(19)=0.29471806998170162;      x(20)=0.38838590160823294;      x(21)=0.47819378204490248;      x(22)=0.56324916140714926;      x(23)=0.64270672292426035;      x(24)=0.71577678458685328;      x(25)=0.78173314841662494;      x(26)=0.83992032014626734;      x(27)=0.88976002994827104;      x(28)=0.93075699789664816;      x(29)=0.96250392509294966;      x(30)=0.98468590966515248;      x(31)=0.99708748181947707;   case(32)      x(1)=-0.99726386184948156;      x(2)=-0.98561151154526834;      x(3)=-0.96476225558750643;      x(4)=-0.93490607593773969;      x(5)=-0.89632115576605212;      x(6)=-0.84936761373256997;      x(7)=-0.79448379596794241;      x(8)=-0.73218211874028968;      x(9)=-0.66304426693021520;      x(10)=-0.58771575724076233;      x(11)=-0.50689990893222939;      x(12)=-0.42135127613063535;      x(13)=-0.33186860228212765;      x(14)=-0.23928736225213707;      x(15)=-0.14447196158279649;      x(16)=-0.048307665687738316;      x(17)=0.048307665687738316;      x(18)=0.14447196158279649;      x(19)=0.23928736225213707;      x(20)=0.33186860228212765;      x(21)=0.42135127613063535;      x(22)=0.50689990893222939;      x(23)=0.58771575724076233;      x(24)=0.66304426693021520;      x(25)=0.73218211874028968;      x(26)=0.79448379596794241;      x(27)=0.84936761373256997;      x(28)=0.89632115576605212;      x(29)=0.93490607593773969;      x(30)=0.96476225558750643;      x(31)=0.98561151154526834;      x(32)=0.99726386184948156;   case(33)      x(1)=-0.99742469424645522;      x(2)=-0.98645572623064249;      x(3)=-0.96682290968999277;      x(4)=-0.93869437261116835;      x(5)=-0.90231676774343358;      x(6)=-0.85800965267650406;      x(7)=-0.80616235627416659;      x(8)=-0.74723049644956216;      x(9)=-0.68173195996974279;      x(10)=-0.61024234583637903;      x(11)=-0.53338990478634764;      x(12)=-0.45185001727245070;      x(13)=-0.36633925774807334;      x(14)=-0.27760909715249703;      x(15)=-0.18643929882799157;      x(16)=-0.093631065854733386;      x(17)=0.0;      x(18)=0.093631065854733386;      x(19)=0.18643929882799157;      x(20)=0.27760909715249703;      x(21)=0.36633925774807334;      x(22)=0.45185001727245070;      x(23)=0.53338990478634764;      x(24)=0.61024234583637903;      x(25)=0.68173195996974279;      x(26)=0.74723049644956216;      x(27)=0.80616235627416659;      x(28)=0.85800965267650406;      x(29)=0.90231676774343358;      x(30)=0.93869437261116835;      x(31)=0.96682290968999277;      x(32)=0.98645572623064249;      x(33)=0.99742469424645522;   case(34)      x(1)=-0.99757175379084192;      x(2)=-0.98722781640630949;      x(3)=-0.96870826253334428;      x(4)=-0.94216239740510709;      x(5)=-0.90780967771832447;      x(6)=-0.86593463833456447;      x(7)=-0.81688422790093366;      x(8)=-0.76106487662987301;      x(9)=-0.69893911321626291;      x(10)=-0.63102172708052855;      x(11)=-0.55787550066974664;      x(12)=-0.48010654519032703;      x(13)=-0.39835927775864594;      x(14)=-0.31331108133946325;      x(15)=-0.22566669161644948;      x(16)=-0.13615235725918298;      x(17)=-0.045509821953102543;      x(18)=0.045509821953102543;      x(19)=0.13615235725918298;      x(20)=0.22566669161644948;      x(21)=0.31331108133946325;      x(22)=0.39835927775864594;      x(23)=0.48010654519032703;      x(24)=0.55787550066974664;      x(25)=0.63102172708052855;      x(26)=0.69893911321626291;      x(27)=0.76106487662987301;      x(28)=0.81688422790093366;      x(29)=0.86593463833456447;      x(30)=0.90780967771832447;      x(31)=0.94216239740510709;      x(32)=0.96870826253334428;      x(33)=0.98722781640630949;      x(34)=0.99757175379084192;   case(35)      x(1)=-0.99770656909960030;      x(2)=-0.98793576444385150;      x(3)=-0.97043761603922983;      x(4)=-0.94534514820782733;      x(5)=-0.91285426135931761;      x(6)=-0.87321912502522233;      x(7)=-0.82674989909222541;      x(8)=-0.77381025228691256;      x(9)=-0.71481450155662878;      x(10)=-0.65022436466589039;      x(11)=-0.58054534474976451;      x(12)=-0.50632277324148862;      x(13)=-0.42813754151781425;      x(14)=-0.34660155443081395;      x(15)=-0.26235294120929606;      x(16)=-0.17605106116598957;      x(17)=-0.088371343275659264;      x(18)=0.0;      x(19)=0.088371343275659264;      x(20)=0.17605106116598957;      x(21)=0.26235294120929606;      x(22)=0.34660155443081395;      x(23)=0.42813754151781425;      x(24)=0.50632277324148862;      x(25)=0.58054534474976451;      x(26)=0.65022436466589039;      x(27)=0.71481450155662878;      x(28)=0.77381025228691256;      x(29)=0.82674989909222541;      x(30)=0.87321912502522233;      x(31)=0.91285426135931761;      x(32)=0.94534514820782733;      x(33)=0.97043761603922983;      x(34)=0.98793576444385150;      x(35)=0.99770656909960030;   case(36)      x(1)=-0.99783046248408584;      x(2)=-0.98858647890221224;      x(3)=-0.97202769104969795;      x(4)=-0.94827298439950755;      x(5)=-0.91749777451565907;      x(6)=-0.87992980089039713;      x(7)=-0.83584716699247531;      x(8)=-0.78557623013220651;      x(9)=-0.72948917159355658;      x(10)=-0.66800123658552106;      x(11)=-0.60156765813598054;      x(12)=-0.53068028592624516;      x(13)=-0.45586394443342027;      x(14)=-0.37767254711968922;      x(15)=-0.29668499534402827;      x(16)=-0.21350089231686558;      x(17)=-0.12873610380938479;      x(18)=-0.043018198473708607;      x(19)=0.043018198473708607;      x(20)=0.12873610380938479;      x(21)=0.21350089231686558;      x(22)=0.29668499534402827;      x(23)=0.37767254711968922;      x(24)=0.45586394443342027;      x(25)=0.53068028592624516;      x(26)=0.60156765813598054;      x(27)=0.66800123658552106;      x(28)=0.72948917159355658;      x(29)=0.78557623013220651;      x(30)=0.83584716699247531;      x(31)=0.87992980089039713;      x(32)=0.91749777451565907;      x(33)=0.94827298439950755;      x(34)=0.97202769104969795;      x(35)=0.98858647890221224;      x(36)=0.99783046248408584;   case(37)      x(1)=-0.99794458247791365;      x(2)=-0.98918596321431919;      x(3)=-0.97349303005648574;      x(4)=-0.95097234326209482;      x(5)=-0.92178143741246374;      x(6)=-0.88612496215548608;      x(7)=-0.84425298734055597;      x(8)=-0.79645920050990229;      x(9)=-0.74307883398196526;      x(10)=-0.68448630913095936;      x(11)=-0.62109260840892448;      x(12)=-0.55334239186158178;      x(13)=-0.48171087780320555;      x(14)=-0.40670050931832611;      x(15)=-0.32883742988370700;      x(16)=-0.24866779279136576;      x(17)=-0.16675393023985198;      x(18)=-0.083670408954769902;      x(19)=0.0;      x(20)=0.083670408954769902;      x(21)=0.16675393023985198;      x(22)=0.24866779279136576;      x(23)=0.32883742988370700;      x(24)=0.40670050931832611;      x(25)=0.48171087780320555;      x(26)=0.55334239186158178;      x(27)=0.62109260840892448;      x(28)=0.68448630913095936;      x(29)=0.74307883398196526;      x(30)=0.79645920050990229;      x(31)=0.84425298734055597;      x(32)=0.88612496215548608;      x(33)=0.92178143741246374;      x(34)=0.95097234326209482;      x(35)=0.97349303005648574;      x(36)=0.98918596321431919;      x(37)=0.99794458247791365;   case(38)      x(1)=-0.99804993053568762;      x(2)=-0.98973945426638557;      x(3)=-0.97484632859015351;      x(4)=-0.95346633093352960;      x(5)=-0.92574133204858440;      x(6)=-0.89185573900463222;      x(7)=-0.85203502193236219;      x(8)=-0.80654416760531682;      x(9)=-0.75568590375397068;      x(10)=-0.69979868037918436;      x(11)=-0.63925441582968171;      x(12)=-0.57445602104780708;      x(13)=-0.50583471792793110;      x(14)=-0.43384716943237648;      x(15)=-0.35897244047943501;      x(16)=-0.28170880979016526;      x(17)=-0.20257045389211670;      x(18)=-0.12208402533786742;      x(19)=-0.040785147904578240;      x(20)=0.040785147904578240;      x(21)=0.12208402533786742;      x(22)=0.20257045389211670;      x(23)=0.28170880979016526;      x(24)=0.35897244047943501;      x(25)=0.43384716943237648;      x(26)=0.50583471792793110;      x(27)=0.57445602104780708;      x(28)=0.63925441582968171;      x(29)=0.69979868037918436;      x(30)=0.75568590375397068;      x(31)=0.80654416760531682;      x(32)=0.85203502193236219;      x(33)=0.89185573900463222;      x(34)=0.92574133204858440;      x(35)=0.95346633093352960;      x(36)=0.97484632859015351;      x(37)=0.98973945426638557;      x(38)=0.99804993053568762;   case(39)      x(1)=-0.99814738306643291;      x(2)=-0.99025153685468598;      x(3)=-0.97609870933347105;      x(4)=-0.95577521232465228;      x(5)=-0.92940914848673823;      x(6)=-0.89716711929299289;      x(7)=-0.85925293799990615;      x(8)=-0.81590629743014310;      x(9)=-0.76740124293106350;      x(10)=-0.71404443589453468;      x(11)=-0.65617321343201091;      x(12)=-0.59415345495727799;      x(13)=-0.52837726866043747;      x(14)=-0.45926051230913605;      x(15)=-0.38724016397156146;      x(16)=-0.31277155924818592;      x(17)=-0.23632551246183577;      x(18)=-0.15838533999783780;      x(19)=-0.079443804608755478;      x(20)=0.0;      x(21)=0.079443804608755478;      x(22)=0.15838533999783780;      x(23)=0.23632551246183577;      x(24)=0.31277155924818592;      x(25)=0.38724016397156146;      x(26)=0.45926051230913605;      x(27)=0.52837726866043747;      x(28)=0.59415345495727799;      x(29)=0.65617321343201091;      x(30)=0.71404443589453468;      x(31)=0.76740124293106350;      x(32)=0.81590629743014310;      x(33)=0.85925293799990615;      x(34)=0.89716711929299289;      x(35)=0.92940914848673823;      x(36)=0.95577521232465228;      x(37)=0.97609870933347105;      x(38)=0.99025153685468598;      x(39)=0.99814738306643291;   case(40)      x(1)=-0.99823770971055920;      x(2)=-0.99072623869945701;      x(3)=-0.97725994998377426;      x(4)=-0.95791681921379166;      x(5)=-0.93281280827867653;      x(6)=-0.90209880696887430;      x(7)=-0.86595950321225950;      x(8)=-0.82461223083331166;      x(9)=-0.77830565142651939;      x(10)=-0.72731825518992710;      x(11)=-0.67195668461417955;      x(12)=-0.61255388966798024;      x(13)=-0.54946712509512820;      x(14)=-0.48307580168617871;      x(15)=-0.41377920437160500;      x(16)=-0.34199409082575847;      x(17)=-0.26815218500725368;      x(18)=-0.19269758070137110;      x(19)=-0.11608407067525521;      x(20)=-0.038772417506050822;      x(21)=0.038772417506050822;      x(22)=0.11608407067525521;      x(23)=0.19269758070137110;      x(24)=0.26815218500725368;      x(25)=0.34199409082575847;      x(26)=0.41377920437160500;      x(27)=0.48307580168617871;      x(28)=0.54946712509512820;      x(29)=0.61255388966798024;      x(30)=0.67195668461417955;      x(31)=0.72731825518992710;      x(32)=0.77830565142651939;      x(33)=0.82461223083331166;      x(34)=0.86595950321225950;      x(35)=0.90209880696887430;      x(36)=0.93281280827867653;      x(37)=0.95791681921379166;      x(38)=0.97725994998377426;      x(39)=0.99072623869945701;      x(40)=0.99823770971055920;   case(41)      x(1)=-0.99832158857477144;      x(2)=-0.99116710969901631;      x(3)=-0.97833867356108338;      x(4)=-0.95990689173034623;      x(5)=-0.93597698749785383;      x(6)=-0.90668594475810117;      x(7)=-0.87220151169244141;      x(8)=-0.83272120040136133;      x(9)=-0.78847114504740937;      x(10)=-0.73970480306992618;      x(11)=-0.68670150203495129;      x(12)=-0.62976483907219632;      x(13)=-0.56922094161021587;      x(14)=-0.50541659919940603;      x(15)=-0.43871727705140709;      x(16)=-0.36950502264048144;      x(17)=-0.29817627734182487;      x(18)=-0.22513960563342278;      x(19)=-0.15081335486399216;      x(20)=-0.075623258989162997;      x(21)=0.0;      x(22)=0.075623258989162997;      x(23)=0.15081335486399216;      x(24)=0.22513960563342278;      x(25)=0.29817627734182487;      x(26)=0.36950502264048144;      x(27)=0.43871727705140709;      x(28)=0.50541659919940603;      x(29)=0.56922094161021587;      x(30)=0.62976483907219632;      x(31)=0.68670150203495129;      x(32)=0.73970480306992618;      x(33)=0.78847114504740937;      x(34)=0.83272120040136133;      x(35)=0.87220151169244141;      x(36)=0.90668594475810117;      x(37)=0.93597698749785383;      x(38)=0.95990689173034623;      x(39)=0.97833867356108338;      x(40)=0.99116710969901631;      x(41)=0.99832158857477144;   case(42)      x(1)=-0.99839961899006242;      x(2)=-0.99157728834086092;      x(3)=-0.97934250806374819;      x(4)=-0.96175936533820449;      x(5)=-0.93892355735498818;      x(6)=-0.91095972490412745;      x(7)=-0.87802056981217274;      x(8)=-0.84028598326181690;      x(9)=-0.79796205325548741;      x(10)=-0.75127993568948049;      x(11)=-0.70049459055617121;      x(12)=-0.64588338886924783;      x(13)=-0.58774459748510932;      x(14)=-0.52639574993119229;      x(15)=-0.46217191207042193;      x(16)=-0.39542385204297506;      x(17)=-0.32651612446541151;      x(18)=-0.25582507934287908;      x(19)=-0.18373680656485455;      x(20)=-0.11064502720851987;      x(21)=-0.036948943165351776;      x(22)=0.036948943165351776;      x(23)=0.11064502720851987;      x(24)=0.18373680656485455;      x(25)=0.25582507934287908;      x(26)=0.32651612446541151;      x(27)=0.39542385204297506;      x(28)=0.46217191207042193;      x(29)=0.52639574993119229;      x(30)=0.58774459748510932;      x(31)=0.64588338886924783;      x(32)=0.70049459055617121;      x(33)=0.75127993568948049;      x(34)=0.79796205325548741;      x(35)=0.84028598326181690;      x(36)=0.87802056981217274;      x(37)=0.91095972490412745;      x(38)=0.93892355735498818;      x(39)=0.96175936533820449;      x(40)=0.97934250806374819;      x(41)=0.99157728834086092;      x(42)=0.99839961899006242;   case(43)      x(1)=-0.99847233224250771;      x(2)=-0.99195955759324415;      x(3)=-0.98027822098025533;      x(4)=-0.96348661301407999;      x(5)=-0.94167195684763786;      x(6)=-0.91494790720613873;      x(7)=-0.88345376521861686;      x(8)=-0.84735371620931505;      x(9)=-0.80683596413693864;      x(10)=-0.76211174719495512;      x(11)=-0.71341423526895705;      x(12)=-0.66099731375149813;      x(13)=-0.60513425963960094;      x(14)=-0.54611631666008472;      x(15)=-0.48425117678573472;      x(16)=-0.41986137602926925;      x(17)=-0.35328261286430381;      x(18)=-0.28486199803291363;      x(19)=-0.21495624486051821;      x(20)=-0.14392980951071331;      x(21)=-0.072152990874586235;      x(22)=0.0;      x(23)=0.072152990874586235;      x(24)=0.14392980951071331;      x(25)=0.21495624486051821;      x(26)=0.28486199803291363;      x(27)=0.35328261286430381;      x(28)=0.41986137602926925;      x(29)=0.48425117678573472;      x(30)=0.54611631666008472;      x(31)=0.60513425963960094;      x(32)=0.66099731375149813;      x(33)=0.71341423526895705;      x(34)=0.76211174719495512;      x(35)=0.80683596413693864;      x(36)=0.84735371620931505;      x(37)=0.88345376521861686;      x(38)=0.91494790720613873;      x(39)=0.94167195684763786;      x(40)=0.96348661301407999;      x(41)=0.98027822098025533;      x(42)=0.99195955759324415;      x(43)=0.99847233224250771;   case(44)      x(1)=-0.99854020063677422;      x(2)=-0.99231639213851581;      x(3)=-0.98115183307791397;      x(4)=-0.96509965042249314;      x(5)=-0.94423950911819410;      x(6)=-0.91867525998417577;      x(7)=-0.88853423828604320;      x(8)=-0.85396659500471038;      x(9)=-0.81514453964513501;      x(10)=-0.77226147924875590;      x(11)=-0.72553105366071700;      x(12)=-0.67518607066612237;      x(13)=-0.62147734590357585;      x(14)=-0.56467245318547077;      x(15)=-0.50505439138820232;      x(16)=-0.44292017452541148;      x(17)=-0.37857935201470713;      x(18)=-0.31235246650278581;      x(19)=-0.24456945692820125;      x(20)=-0.17556801477551679;      x(21)=-0.10569190170865325;      x(22)=-0.035289236964135359;      x(23)=0.035289236964135359;      x(24)=0.10569190170865325;      x(25)=0.17556801477551679;      x(26)=0.24456945692820125;      x(27)=0.31235246650278581;      x(28)=0.37857935201470713;      x(29)=0.44292017452541148;      x(30)=0.50505439138820232;      x(31)=0.56467245318547077;      x(32)=0.62147734590357585;      x(33)=0.67518607066612237;      x(34)=0.72553105366071700;      x(35)=0.77226147924875590;      x(36)=0.81514453964513501;      x(37)=0.85396659500471038;      x(38)=0.88853423828604320;      x(39)=0.91867525998417577;      x(40)=0.94423950911819410;      x(41)=0.96509965042249314;      x(42)=0.98115183307791397;      x(43)=0.99231639213851581;      x(44)=0.99854020063677422;   case(45)      x(1)=-0.99860364518193664;      x(2)=-0.99264999844720374;      x(3)=-0.98196871503454057;      x(4)=-0.96660831039689460;      x(5)=-0.94664169099562906;      x(6)=-0.92216393671900039;      x(7)=-0.89329167175324174;      x(8)=-0.86016247596066423;      x(9)=-0.82293422050208634;      x(10)=-0.78178431259390629;      x(11)=-0.73690884894549035;      x(12)=-0.68852168077120053;      x(13)=-0.63685339445322336;      x(14)=-0.58215021256935319;      x(15)=-0.52467282046291607;      x(16)=-0.46469512391963510;      x(17)=-0.40250294385854191;      x(18)=-0.33839265425060216;      x(19)=-0.27266976975237756;      x(20)=-0.20564748978326375;      x(21)=-0.13764520598325303;      x(22)=-0.068986980163144172;      x(23)=0.0;      x(24)=0.068986980163144172;      x(25)=0.13764520598325303;      x(26)=0.20564748978326375;      x(27)=0.27266976975237756;      x(28)=0.33839265425060216;      x(29)=0.40250294385854191;      x(30)=0.46469512391963510;      x(31)=0.52467282046291607;      x(32)=0.58215021256935319;      x(33)=0.63685339445322336;      x(34)=0.68852168077120053;      x(35)=0.73690884894549035;      x(36)=0.78178431259390629;      x(37)=0.82293422050208634;      x(38)=0.86016247596066423;      x(39)=0.89329167175324174;      x(40)=0.92216393671900039;      x(41)=0.94664169099562906;      x(42)=0.96660831039689460;      x(43)=0.98196871503454057;      x(44)=0.99264999844720374;      x(45)=0.99860364518193664;   case(46)      x(1)=-0.99866304213381798;      x(2)=-0.99296234890617436;      x(3)=-0.98273366980416686;      x(4)=-0.96802139185399194;      x(5)=-0.94889236344608980;      x(6)=-0.92543379880675395;      x(7)=-0.89775271153394197;      x(8)=-0.86597539486685806;      x(9)=-0.83024683706606605;      x(10)=-0.79073005707527426;      x(11)=-0.74760535961566605;      x(12)=-0.70106951202040570;      x(13)=-0.65133484620199772;      x(14)=-0.59862828971271515;      x(15)=-0.54319033026180264;      x(16)=-0.48527391838816466;      x(17)=-0.42514331328282840;      x(18)=-0.36307287702099571;      x(19)=-0.29934582270187002;      x(20)=-0.23425292220626977;      x(21)=-0.16809117946710353;      x(22)=-0.10116247530558424;      x(23)=-0.033772190016052042;      x(24)=0.033772190016052042;      x(25)=0.10116247530558424;      x(26)=0.16809117946710353;      x(27)=0.23425292220626977;      x(28)=0.29934582270187002;      x(29)=0.36307287702099571;      x(30)=0.42514331328282840;      x(31)=0.48527391838816466;      x(32)=0.54319033026180264;      x(33)=0.59862828971271515;      x(34)=0.65133484620199772;      x(35)=0.70106951202040570;      x(36)=0.74760535961566605;      x(37)=0.79073005707527426;      x(38)=0.83024683706606605;      x(39)=0.86597539486685806;      x(40)=0.89775271153394197;      x(41)=0.92543379880675395;      x(42)=0.94889236344608980;      x(43)=0.96802139185399194;      x(44)=0.98273366980416686;      x(45)=0.99296234890617436;      x(46)=0.99866304213381798;   case(47)      x(1)=-0.99871872858421211;      x(2)=-0.99325521098776863;      x(3)=-0.98345100307162371;      x(4)=-0.96934678732656450;      x(5)=-0.95100396925770844;      x(6)=-0.92850269301236065;      x(7)=-0.90194132943852536;      x(8)=-0.87143601579689632;      x(9)=-0.83712013989990212;      x(10)=-0.79914375416774194;      x(11)=-0.75767291844543863;      x(12)=-0.71288897340906430;      x(13)=-0.66498774739033273;      x(14)=-0.61417869995637361;      x(15)=-0.56068400593466419;      x(16)=-0.50473758386357792;      x(17)=-0.44658407310485570;      x(18)=-0.38647776408466714;      x(19)=-0.32468148633773590;      x(20)=-0.26146545921497457;      x(21)=-0.19710611027911181;      x(22)=-0.13188486655451490;      x(23)=-0.066086923916355675;      x(24)=0.0;      x(25)=0.066086923916355675;      x(26)=0.13188486655451490;      x(27)=0.19710611027911181;      x(28)=0.26146545921497457;      x(29)=0.32468148633773590;      x(30)=0.38647776408466714;      x(31)=0.44658407310485570;      x(32)=0.50473758386357792;      x(33)=0.56068400593466419;      x(34)=0.61417869995637361;      x(35)=0.66498774739033273;      x(36)=0.71288897340906430;      x(37)=0.75767291844543863;      x(38)=0.79914375416774194;      x(39)=0.83712013989990212;      x(40)=0.87143601579689632;      x(41)=0.90194132943852536;      x(42)=0.92850269301236065;      x(43)=0.95100396925770844;      x(44)=0.96934678732656450;      x(45)=0.98345100307162371;      x(46)=0.99325521098776863;      x(47)=0.99871872858421211;   case(48)      x(1)=-0.99877100725242612;      x(2)=-0.99353017226635076;      x(3)=-0.98412458372282686;      x(4)=-0.97059159254624725;      x(5)=-0.95298770316043086;      x(6)=-0.93138669070655433;      x(7)=-0.90587913671556967;      x(8)=-0.87657202027424789;      x(9)=-0.84358826162439353;      x(10)=-0.80706620402944263;      x(11)=-0.76715903251574034;      x(12)=-0.72403413092381465;      x(13)=-0.67787237963266391;      x(14)=-0.62886739677651362;      x(15)=-0.57722472608397270;      x(16)=-0.52316097472223303;      x(17)=-0.46690290475095840;      x(18)=-0.40868648199071673;      x(19)=-0.34875588629216074;      x(20)=-0.28736248735545558;      x(21)=-0.22476379039468906;      x(22)=-0.16122235606889172;      x(23)=-0.097004699209462699;      x(24)=-0.032380170962869362;      x(25)=0.032380170962869362;      x(26)=0.097004699209462699;      x(27)=0.16122235606889172;      x(28)=0.22476379039468906;      x(29)=0.28736248735545558;      x(30)=0.34875588629216074;      x(31)=0.40868648199071673;      x(32)=0.46690290475095840;      x(33)=0.52316097472223303;      x(34)=0.57722472608397270;      x(35)=0.62886739677651362;      x(36)=0.67787237963266391;      x(37)=0.72403413092381465;      x(38)=0.76715903251574034;      x(39)=0.80706620402944263;      x(40)=0.84358826162439353;      x(41)=0.87657202027424789;      x(42)=0.90587913671556967;      x(43)=0.93138669070655433;      x(44)=0.95298770316043086;      x(45)=0.97059159254624725;      x(46)=0.98412458372282686;      x(47)=0.99353017226635076;      x(48)=0.99877100725242612;   case(49)      x(1)=-0.99882015060663538;      x(2)=-0.99378866194416779;      x(3)=-0.98475789591421300;      x(4)=-0.97176220090155538;      x(5)=-0.95485365867413723;      x(6)=-0.93410029475581015;      x(7)=-0.90958565582807329;      x(8)=-0.88140844557300891;      x(9)=-0.84968211984416570;      x(10)=-0.81453442735985543;      x(11)=-0.77610689434544664;      x(12)=-0.73455425423740270;      x(13)=-0.69004382442513211;      x(14)=-0.64275483241923766;      x(15)=-0.59287769410890071;      x(16)=-0.54061324699172607;      x(17)=-0.48617194145249204;      x(18)=-0.42977299334157652;      x(19)=-0.37164350126228489;      x(20)=-0.31201753211974876;      x(21)=-0.25113517861257727;      x(22)=-0.18924159246181359;      x(23)=-0.12658599726967205;      x(24)=-0.063420684982686786;      x(25)=0.0;      x(26)=0.063420684982686786;      x(27)=0.12658599726967205;      x(28)=0.18924159246181359;      x(29)=0.25113517861257727;      x(30)=0.31201753211974876;      x(31)=0.37164350126228489;      x(32)=0.42977299334157652;      x(33)=0.48617194145249204;      x(34)=0.54061324699172607;      x(35)=0.59287769410890071;      x(36)=0.64275483241923766;      x(37)=0.69004382442513211;      x(38)=0.73455425423740270;      x(39)=0.77610689434544664;      x(40)=0.81453442735985543;      x(41)=0.84968211984416570;      x(42)=0.88140844557300891;      x(43)=0.90958565582807329;      x(44)=0.93410029475581015;      x(45)=0.95485365867413723;      x(46)=0.97176220090155538;      x(47)=0.98475789591421300;      x(48)=0.99378866194416779;      x(49)=0.99882015060663538;   case(50)      x(1)=-0.99886640442007105;      x(2)=-0.99403196943209071;      x(3)=-0.98535408404800588;      x(4)=-0.97286438510669207;      x(5)=-0.95661095524280794;      x(6)=-0.93665661894487793;      x(7)=-0.91307855665579189;      x(8)=-0.88596797952361305;      x(9)=-0.85542976942994608;      x(10)=-0.82158207085933595;      x(11)=-0.78455583290039926;      x(12)=-0.74449430222606854;      x(13)=-0.70155246870682225;      x(14)=-0.65589646568543936;      x(15)=-0.60770292718495024;      x(16)=-0.55715830451465005;      x(17)=-0.50445814490746420;      x(18)=-0.44980633497403879;      x(19)=-0.39341431189756513;      x(20)=-0.33550024541943736;      x(21)=-0.27628819377953199;      x(22)=-0.21600723687604176;      x(23)=-0.15489058999814590;      x(24)=-0.093174701560086141;      x(25)=-0.031098338327188876;      x(26)=0.031098338327188876;      x(27)=0.093174701560086141;      x(28)=0.15489058999814590;      x(29)=0.21600723687604176;      x(30)=0.27628819377953199;      x(31)=0.33550024541943736;      x(32)=0.39341431189756513;      x(33)=0.44980633497403879;      x(34)=0.50445814490746420;      x(35)=0.55715830451465005;      x(36)=0.60770292718495024;      x(37)=0.65589646568543936;      x(38)=0.70155246870682225;      x(39)=0.74449430222606854;      x(40)=0.78455583290039926;      x(41)=0.82158207085933595;      x(42)=0.85542976942994608;      x(43)=0.88596797952361305;      x(44)=0.91307855665579189;      x(45)=0.93665661894487793;      x(46)=0.95661095524280794;      x(47)=0.97286438510669207;      x(48)=0.98535408404800588;      x(49)=0.99403196943209071;      x(50)=0.99886640442007105;   case(51)      x(1)=-0.99890999084890350;      x(2)=-0.99426126043675257;      x(3)=-0.98591599173590300;      x(4)=-0.97390336801932387;      x(5)=-0.95826784861390819;      x(6)=-0.93906754400296238;      x(7)=-0.91637386230978023;      x(8)=-0.89027121802952730;      x(9)=-0.86085671118229237;      x(10)=-0.82823976382306483;      x(11)=-0.79254171209938121;      x(12)=-0.75389535448537553;      x(13)=-0.71244445757703664;      x(14)=-0.66834322117537009;      x(15)=-0.62175570460072327;      x(16)=-0.57285521635130384;      x(17)=-0.52182366936618584;      x(18)=-0.46885090428604106;      x(19)=-0.41413398322630388;      x(20)=-0.35787645668840951;      x(21)=-0.30028760633533194;      x(22)=-0.24158166644779870;      x(23)=-0.18197702695707755;      x(24)=-0.12169542101888877;      x(25)=-0.060961100150578725;      x(26)=0.0;      x(27)=0.060961100150578725;      x(28)=0.12169542101888877;      x(29)=0.18197702695707755;      x(30)=0.24158166644779870;      x(31)=0.30028760633533194;      x(32)=0.35787645668840951;      x(33)=0.41413398322630388;      x(34)=0.46885090428604106;      x(35)=0.52182366936618584;      x(36)=0.57285521635130384;      x(37)=0.62175570460072327;      x(38)=0.66834322117537009;      x(39)=0.71244445757703664;      x(40)=0.75389535448537553;      x(41)=0.79254171209938121;      x(42)=0.82823976382306483;      x(43)=0.86085671118229237;      x(44)=0.89027121802952730;      x(45)=0.91637386230978023;      x(46)=0.93906754400296238;      x(47)=0.95826784861390819;      x(48)=0.97390336801932387;      x(49)=0.98591599173590300;      x(50)=0.99426126043675257;      x(51)=0.99890999084890350;   case(52)      x(1)=-0.99895111110395028;      x(2)=-0.99447759092921603;      x(3)=-0.98644619565154984;      x(4)=-0.97488388422174450;      x(5)=-0.95983182693308655;      x(6)=-0.94134385364135906;      x(7)=-0.91948612891642454;      x(8)=-0.89433689053449532;      x(9)=-0.86598616284606759;      x(10)=-0.83453543232673453;      x(11)=-0.80009728343046832;      x(12)=-0.76279499519374496;      x(13)=-0.72276209974998319;      x(14)=-0.68014190422716770;      x(15)=-0.63508697769524592;      x(16)=-0.58775860497957907;      x(17)=-0.53832620928582744;      x(18)=-0.48696674569809608;      x(19)=-0.43386406771876167;      x(20)=-0.37920826911609367;      x(21)=-0.32319500343480783;      x(22)=-0.26602478360500183;      x(23)=-0.20790226415636606;      x(24)=-0.14903550860694918;      x(25)=-0.089635244648900565;      x(26)=-0.029914109797338766;      x(27)=0.029914109797338766;      x(28)=0.089635244648900565;      x(29)=0.14903550860694918;      x(30)=0.20790226415636606;      x(31)=0.26602478360500183;      x(32)=0.32319500343480783;      x(33)=0.37920826911609367;      x(34)=0.43386406771876167;      x(35)=0.48696674569809608;      x(36)=0.53832620928582744;      x(37)=0.58775860497957907;      x(38)=0.63508697769524592;      x(39)=0.68014190422716770;      x(40)=0.72276209974998319;      x(41)=0.76279499519374496;      x(42)=0.80009728343046832;      x(43)=0.83453543232673453;      x(44)=0.86598616284606759;      x(45)=0.89433689053449532;      x(46)=0.91948612891642454;      x(47)=0.94134385364135906;      x(48)=0.95983182693308655;      x(49)=0.97488388422174450;      x(50)=0.98644619565154984;      x(51)=0.99447759092921603;      x(52)=0.99895111110395028;   case(53)      x(1)=-0.99898994777632823;      x(2)=-0.99468191930800708;      x(3)=-0.98694703502337152;      x(4)=-0.97581023371498458;      x(5)=-0.96130969462313633;      x(6)=-0.94349535346444188;      x(7)=-0.92242860304281213;      x(8)=-0.89818205787542663;      x(9)=-0.87083929755824135;      x(10)=-0.84049457654580138;      x(11)=-0.80725249841689548;      x(12)=-0.77122765492553231;      x(13)=-0.73254423080751025;      x(14)=-0.69133557560136672;      x(15)=-0.64774374391651007;      x(16)=-0.60191900571376933;      x(17)=-0.55401932827706788;      x(18)=-0.50420983165713344;      x(19)=-0.45266221946184579;      x(20)=-0.39955418695395298;      x(21)=-0.34506880849572236;      x(22)=-0.28939390645162621;      x(23)=-0.23272140372427259;      x(24)=-0.17524666215532575;      x(25)=-0.11716780907195515;      x(26)=-0.058685054300259465;      x(27)=0.0;      x(28)=0.058685054300259465;      x(29)=0.11716780907195515;      x(30)=0.17524666215532575;      x(31)=0.23272140372427259;      x(32)=0.28939390645162621;      x(33)=0.34506880849572236;      x(34)=0.39955418695395298;      x(35)=0.45266221946184579;      x(36)=0.50420983165713344;      x(37)=0.55401932827706788;      x(38)=0.60191900571376933;      x(39)=0.64774374391651007;      x(40)=0.69133557560136672;      x(41)=0.73254423080751025;      x(42)=0.77122765492553231;      x(43)=0.80725249841689548;      x(44)=0.84049457654580138;      x(45)=0.87083929755824135;      x(46)=0.89818205787542663;      x(47)=0.92242860304281213;      x(48)=0.94349535346444188;      x(49)=0.96130969462313633;      x(50)=0.97581023371498458;      x(51)=0.98694703502337152;      x(52)=0.99468191930800708;      x(53)=0.99898994777632823;   case(54)      x(1)=-0.99902666686734098;      x(2)=-0.99487511701833888;      x(3)=-0.98742063739734356;      x(4)=-0.97668632885790324;      x(5)=-0.96270764578592358;      x(6)=-0.94553097516499585;      x(7)=-0.92521335986665149;      x(8)=-0.90182228628470158;      x(9)=-0.87543545406556894;      x(10)=-0.84614051597077295;      x(11)=-0.81403478591356784;      x(12)=-0.77922491534625402;      x(13)=-0.74182653880918432;      x(14)=-0.70196388971917292;      x(15)=-0.65976938763198312;      x(16)=-0.61538319833112737;      x(17)=-0.56895276819520943;      x(18)=-0.52063233438593307;      x(19)=-0.47058241248138228;      x(20)=-0.41896926325520453;      x(21)=-0.36596434037219118;      x(22)=-0.31174372083446823;      x(23)=-0.25648752006999730;      x(24)=-0.20037929360621357;      x(25)=-0.14360542731625615;      x(26)=-0.086354518263248215;      x(27)=-0.028816748199341778;      x(28)=0.028816748199341778;      x(29)=0.086354518263248215;      x(30)=0.14360542731625615;      x(31)=0.20037929360621357;      x(32)=0.25648752006999730;      x(33)=0.31174372083446823;      x(34)=0.36596434037219118;      x(35)=0.41896926325520453;      x(36)=0.47058241248138228;      x(37)=0.52063233438593307;      x(38)=0.56895276819520943;      x(39)=0.61538319833112737;      x(40)=0.65976938763198312;      x(41)=0.70196388971917292;      x(42)=0.74182653880918432;      x(43)=0.77922491534625402;      x(44)=0.81403478591356784;      x(45)=0.84614051597077295;      x(46)=0.87543545406556894;      x(47)=0.90182228628470158;      x(48)=0.92521335986665149;      x(49)=0.94553097516499585;      x(50)=0.96270764578592358;      x(51)=0.97668632885790324;      x(52)=0.98742063739734356;      x(53)=0.99487511701833888;      x(54)=0.99902666686734098;   case(55)      x(1)=-0.99906141956481854;      x(2)=-0.99505797784741188;      x(3)=-0.98786894119888920;      x(4)=-0.97751573550398921;      x(5)=-0.96403132859313520;      x(6)=-0.94745886804121074;      x(7)=-0.92785142472079170;      x(8)=-0.90527180074400003;      x(9)=-0.87979232241989551;      x(10)=-0.85149460661715447;      x(11)=-0.82046929855932091;      x(12)=-0.78681578112762237;      x(13)=-0.75064185634802191;      x(14)=-0.71206339998663784;      x(15)=-0.67120399031982640;      x(16)=-0.62819451224992814;      x(17)=-0.58317273802603210;      x(18)=-0.53628288590834330;      x(19)=-0.48767515818747410;      x(20)=-0.43750526003717459;      x(21)=-0.38593390074097943;      x(22)=-0.33312627889002389;      x(23)=-0.27925155320080654;      x(24)=-0.22448230064784548;      x(25)=-0.16899396364687321;      x(26)=-0.11296428805932927;      x(27)=-0.056572753818336776;      x(28)=0.0;      x(29)=0.056572753818336776;      x(30)=0.11296428805932927;      x(31)=0.16899396364687321;      x(32)=0.22448230064784548;      x(33)=0.27925155320080654;      x(34)=0.33312627889002389;      x(35)=0.38593390074097943;      x(36)=0.43750526003717459;      x(37)=0.48767515818747410;      x(38)=0.53628288590834330;      x(39)=0.58317273802603210;      x(40)=0.62819451224992814;      x(41)=0.67120399031982640;      x(42)=0.71206339998663784;      x(43)=0.75064185634802191;      x(44)=0.78681578112762237;      x(45)=0.82046929855932091;      x(46)=0.85149460661715447;      x(47)=0.87979232241989551;      x(48)=0.90527180074400003;      x(49)=0.92785142472079170;      x(50)=0.94745886804121074;      x(51)=0.96403132859313520;      x(52)=0.97751573550398921;      x(53)=0.98786894119888920;      x(54)=0.99505797784741188;      x(55)=0.99906141956481854;   case(56)      x(1)=-0.99909434380146558;      x(2)=-0.99523122608106975;      x(3)=-0.98829371554016151;      x(4)=-0.97830170914025638;      x(5)=-0.96528590190549018;      x(6)=-0.94928647956196264;      x(7)=-0.93035288024749630;      x(8)=-0.90854362042065549;      x(9)=-0.88392610832782754;      x(10)=-0.85657643376274864;      x(11)=-0.82657913214288165;      x(12)=-0.79402692289386650;      x(13)=-0.75902042270512890;      x(14)=-0.72166783445018808;      x(15)=-0.68208461269447046;      x(16)=-0.64039310680700689;      x(17)=-0.59672218277066332;      x(18)=-0.55120682485553462;      x(19)=-0.50398771838438171;      x(20)=-0.45521081487845958;      x(21)=-0.40502688092709128;      x(22)=-0.35359103217495452;      x(23)=-0.30106225386722067;      x(24)=-0.24760290943433720;      x(25)=-0.19337823863527526;      x(26)=-0.13855584681037624;      x(27)=-0.083305186822435374;      x(28)=-0.027797035287275437;      x(29)=0.027797035287275437;      x(30)=0.083305186822435374;      x(31)=0.13855584681037624;      x(32)=0.19337823863527526;      x(33)=0.24760290943433720;      x(34)=0.30106225386722067;      x(35)=0.35359103217495452;      x(36)=0.40502688092709128;      x(37)=0.45521081487845958;      x(38)=0.50398771838438171;      x(39)=0.55120682485553462;      x(40)=0.59672218277066332;      x(41)=0.64039310680700689;      x(42)=0.68208461269447046;      x(43)=0.72166783445018808;      x(44)=0.75902042270512890;      x(45)=0.79402692289386650;      x(46)=0.82657913214288165;      x(47)=0.85657643376274864;      x(48)=0.88392610832782754;      x(49)=0.90854362042065549;      x(50)=0.93035288024749630;      x(51)=0.94928647956196264;      x(52)=0.96528590190549018;      x(53)=0.97830170914025638;      x(54)=0.98829371554016151;      x(55)=0.99523122608106975;      x(56)=0.99909434380146558;   case(57)      x(1)=-0.99912556562526285;      x(2)=-0.99539552367843031;      x(3)=-0.98869657765022205;      x(4)=-0.97904722670946871;      x(5)=-0.96647608517188668;      x(6)=-0.95102062644787674;      x(7)=-0.93272696106710170;      x(8)=-0.91164967852139121;      x(9)=-0.88785167888222133;      x(10)=-0.86140398326204694;      x(11)=-0.83238552115043912;      x(12)=-0.80088289454721824;      x(13)=-0.76699011935945020;      x(14)=-0.73080834474452332;      x(15)=-0.69244555119951774;      x(16)=-0.65201622828097689;      x(17)=-0.60964103290871537;      x(18)=-0.56544642926923676;      x(19)=-0.51956431139118761;      x(20)=-0.47213160951797571;      x(21)=-0.42328988145156395;      x(22)=-0.37318489008659446;      x(23)=-0.32196616839537864;      x(24)=-0.26978657316183877;      x(25)=-0.21680182879612404;      x(26)=-0.16317006259126425;      x(27)=-0.10905133280878780;      x(28)=-0.054607151001646824;      x(29)=0.0;      x(30)=0.054607151001646824;      x(31)=0.10905133280878780;      x(32)=0.16317006259126425;      x(33)=0.21680182879612404;      x(34)=0.26978657316183877;      x(35)=0.32196616839537864;      x(36)=0.37318489008659446;      x(37)=0.42328988145156395;      x(38)=0.47213160951797571;      x(39)=0.51956431139118761;      x(40)=0.56544642926923676;      x(41)=0.60964103290871537;      x(42)=0.65201622828097689;      x(43)=0.69244555119951774;      x(44)=0.73080834474452332;      x(45)=0.76699011935945020;      x(46)=0.80088289454721824;      x(47)=0.83238552115043912;      x(48)=0.86140398326204694;      x(49)=0.88785167888222133;      x(50)=0.91164967852139121;      x(51)=0.93272696106710170;      x(52)=0.95102062644787674;      x(53)=0.96647608517188668;      x(54)=0.97904722670946871;      x(55)=0.98869657765022205;      x(56)=0.99539552367843031;      x(57)=0.99912556562526285;   case(58)      x(1)=-0.99915520040738661;      x(2)=-0.99555147659729090;      x(3)=-0.98907900824844264;      x(4)=-0.97975501469435031;      x(5)=-0.96760620250292409;      x(6)=-0.95266755751886909;      x(7)=-0.93498213758825935;      x(8)=-0.91460092856435254;      x(9)=-0.89158269202203018;      x(10)=-0.86599379407480748;      x(11)=-0.83790801333937332;      x(12)=-0.80740632791308814;      x(13)=-0.77457668174965275;      x(14)=-0.73951373102004227;      x(15)=-0.70231857115390811;      x(16)=-0.66309844533212527;      x(17)=-0.62196643526307911;      x(18)=-0.57904113513022503;      x(19)=-0.53444630964884759;      x(20)=-0.48831053721671846;      x(21)=-0.44076683918683957;      x(22)=-0.39195229633075315;      x(23)=-0.34200765359799526;      x(24)=-0.29107691431110919;      x(25)=-0.23930692496615345;      x(26)=-0.18684695183576132;      x(27)=-0.13384825059546686;      x(28)=-0.080463630214142729;      x(29)=-0.026847012365942356;      x(30)=0.026847012365942356;      x(31)=0.080463630214142729;      x(32)=0.13384825059546686;      x(33)=0.18684695183576132;      x(34)=0.23930692496615345;      x(35)=0.29107691431110919;      x(36)=0.34200765359799526;      x(37)=0.39195229633075315;      x(38)=0.44076683918683957;      x(39)=0.48831053721671846;      x(40)=0.53444630964884759;      x(41)=0.57904113513022503;      x(42)=0.62196643526307911;      x(43)=0.66309844533212527;      x(44)=0.70231857115390811;      x(45)=0.73951373102004227;      x(46)=0.77457668174965275;      x(47)=0.80740632791308814;      x(48)=0.83790801333937332;      x(49)=0.86599379407480748;      x(50)=0.89158269202203018;      x(51)=0.91460092856435254;      x(52)=0.93498213758825935;      x(53)=0.95266755751886909;      x(54)=0.96760620250292409;      x(55)=0.97975501469435031;      x(56)=0.98907900824844264;      x(57)=0.99555147659729090;      x(58)=0.99915520040738661;   case(59)      x(1)=-0.99918335390929468;      x(2)=-0.99569964038324596;      x(3)=-0.98944236513373093;      x(4)=-0.98042757395671569;      x(5)=-0.96868022168178153;      x(6)=-0.95423300937695106;      x(7)=-0.93712619035345386;      x(8)=-0.91740743878815528;      x(9)=-0.89513171174347209;      x(10)=-0.87036109429288226;      x(11)=-0.84316462581687220;      x(12)=-0.81361810728821157;      x(13)=-0.78180388986236091;      x(14)=-0.74781064527864023;      x(15)=-0.71173311867719773;      x(16)=-0.67367186450493723;      x(17)=-0.63373296623885010;      x(18)=-0.59202774070403014;      x(19)=-0.54867242780839638;      x(20)=-0.50378786655771798;      x(21)=-0.45749915825326669;      x(22)=-0.40993531781041897;      x(23)=-0.36122891416979481;      x(24)=-0.31151570080301370;      x(25)=-0.26093423734281171;      x(26)=-0.20962550339203654;      x(27)=-0.15773250558785797;      x(28)=-0.10539987901634414;      x(29)=-0.052773484088310004;      x(30)=0.0;      x(31)=0.052773484088310004;      x(32)=0.10539987901634414;      x(33)=0.15773250558785797;      x(34)=0.20962550339203654;      x(35)=0.26093423734281171;      x(36)=0.31151570080301370;      x(37)=0.36122891416979481;      x(38)=0.40993531781041897;      x(39)=0.45749915825326669;      x(40)=0.50378786655771798;      x(41)=0.54867242780839638;      x(42)=0.59202774070403014;      x(43)=0.63373296623885010;      x(44)=0.67367186450493723;      x(45)=0.71173311867719773;      x(46)=0.74781064527864023;      x(47)=0.78180388986236091;      x(48)=0.81361810728821157;      x(49)=0.84316462581687220;      x(50)=0.87036109429288226;      x(51)=0.89513171174347209;      x(52)=0.91740743878815528;      x(53)=0.93712619035345386;      x(54)=0.95423300937695106;      x(55)=0.96868022168178153;      x(56)=0.98042757395671569;      x(57)=0.98944236513373093;      x(58)=0.99569964038324596;      x(59)=0.99918335390929468;   case(60)      x(1)=-0.99921012322743602;      x(2)=-0.99584052511883817;      x(3)=-0.98978789522222172;      x(4)=-0.98106720175259819;      x(5)=-0.96970178876505273;      x(6)=-0.95572225583999611;      x(7)=-0.93916627611642325;      x(8)=-0.92007847617762755;      x(9)=-0.89851031081004594;      x(10)=-0.87451992264689832;      x(11)=-0.84817198478592963;      x(12)=-0.81953752616214576;      x(13)=-0.78869373993226405;      x(14)=-0.75572377530658569;      x(15)=-0.72071651335573040;      x(16)=-0.68376632738135544;      x(17)=-0.64497282848947707;      x(18)=-0.60444059704851036;      x(19)=-0.56227890075394454;      x(20)=-0.51860140005856975;      x(21)=-0.47352584176170711;      x(22)=-0.42717374158307839;      x(23)=-0.37967005657679798;      x(24)=-0.33114284826844819;      x(25)=-0.28172293742326169;      x(26)=-0.23154355137602934;      x(27)=-0.18073996487342542;      x(28)=-0.12944913539694500;      x(29)=-0.077809333949536569;      x(30)=-0.025959772301247799;      x(31)=0.025959772301247799;      x(32)=0.077809333949536569;      x(33)=0.12944913539694500;      x(34)=0.18073996487342542;      x(35)=0.23154355137602934;      x(36)=0.28172293742326169;      x(37)=0.33114284826844819;      x(38)=0.37967005657679798;      x(39)=0.42717374158307839;      x(40)=0.47352584176170711;      x(41)=0.51860140005856975;      x(42)=0.56227890075394454;      x(43)=0.60444059704851036;      x(44)=0.64497282848947707;      x(45)=0.68376632738135544;      x(46)=0.72071651335573040;      x(47)=0.75572377530658569;      x(48)=0.78869373993226405;      x(49)=0.81953752616214576;      x(50)=0.84817198478592963;      x(51)=0.87451992264689832;      x(52)=0.89851031081004594;      x(53)=0.92007847617762755;      x(54)=0.93916627611642325;      x(55)=0.95572225583999611;      x(56)=0.96970178876505273;      x(57)=0.98106720175259819;      x(58)=0.98978789522222172;      x(59)=0.99584052511883817;      x(60)=0.99921012322743602;   case(61)      x(1)=-0.99923559763136347;      x(2)=-0.99597459981512023;      x(3)=-0.99011674523251705;      x(4)=-0.98167601128403708;      x(5)=-0.97067425883318291;      x(6)=-0.95714015191298409;      x(7)=-0.94110898668136115;      x(8)=-0.92262258138295526;      x(9)=-0.90172916247400117;      x(10)=-0.87848323721488103;      x(11)=-0.85294545084766345;      x(12)=-0.82518242810865995;      x(13)=-0.79526659928235965;      x(14)=-0.76327601117231220;      x(15)=-0.72929412344946511;      x(16)=-0.69340959089449116;      x(17)=-0.65571603209507087;      x(18)=-0.61631178519792172;      x(19)=-0.57529965135083062;      x(20)=-0.53278662650292527;      x(21)=-0.48888362226225212;      x(22)=-0.44370517653853160;      x(23)=-0.39736915472575661;      x(24)=-0.34999644220406683;      x(25)=-0.30171062896303071;      x(26)=-0.25263768716905350;      x(27)=-0.20290564251805850;      x(28)=-0.15264424023081530;      x(29)=-0.10198460656227407;      x(30)=-0.051058906707974349;      x(31)=0.0;      x(32)=0.051058906707974349;      x(33)=0.10198460656227407;      x(34)=0.15264424023081530;      x(35)=0.20290564251805850;      x(36)=0.25263768716905350;      x(37)=0.30171062896303071;      x(38)=0.34999644220406683;      x(39)=0.39736915472575661;      x(40)=0.44370517653853160;      x(41)=0.48888362226225212;      x(42)=0.53278662650292527;      x(43)=0.57529965135083062;      x(44)=0.61631178519792172;      x(45)=0.65571603209507087;      x(46)=0.69340959089449116;      x(47)=0.72929412344946511;      x(48)=0.76327601117231220;      x(49)=0.79526659928235965;      x(50)=0.82518242810865995;      x(51)=0.85294545084766345;      x(52)=0.87848323721488103;      x(53)=0.90172916247400117;      x(54)=0.92262258138295526;      x(55)=0.94110898668136115;      x(56)=0.95714015191298409;      x(57)=0.97067425883318291;      x(58)=0.98167601128403708;      x(59)=0.99011674523251705;      x(60)=0.99597459981512023;      x(61)=0.99923559763136347;   case(62)      x(1)=-0.99925985930877703;      x(2)=-0.99610229631626713;      x(3)=-0.99042997118929035;      x(4)=-0.98225594909723665;      x(5)=-0.97160072337165181;      x(6)=-0.95849117297392709;      x(7)=-0.94296040139232850;      x(8)=-0.92504763563620376;      x(9)=-0.90479812252109347;      x(10)=-0.88226301283189736;      x(11)=-0.85749923151207092;      x(12)=-0.83056933360400485;      x(13)=-0.80154134610397637;      x(14)=-0.77048859605541932;      x(15)=-0.73748952528315675;      x(16)=-0.70262749222229706;      x(17)=-0.66599056133547945;      x(18)=-0.62767128064688518;      x(19)=-0.58776644795308734;      x(20)=-0.54637686630025110;      x(21)=-0.50360708934475596;      x(22)=-0.45956515724011340;      x(23)=-0.41436232371712605;      x(24)=-0.36811277504656453;      x(25)=-0.32093334159419400;      x(26)=-0.27294320269672634;      x(27)=-0.22426358560416553;      x(28)=-0.17501745924901563;      x(29)=-0.12532922361589681;      x(30)=-0.075324395496234333;      x(31)=-0.025129291421820615;      x(32)=0.025129291421820615;      x(33)=0.075324395496234333;      x(34)=0.12532922361589681;      x(35)=0.17501745924901563;      x(36)=0.22426358560416553;      x(37)=0.27294320269672634;      x(38)=0.32093334159419400;      x(39)=0.36811277504656453;      x(40)=0.41436232371712605;      x(41)=0.45956515724011340;      x(42)=0.50360708934475596;      x(43)=0.54637686630025110;      x(44)=0.58776644795308734;      x(45)=0.62767128064688518;      x(46)=0.66599056133547945;      x(47)=0.70262749222229706;      x(48)=0.73748952528315675;      x(49)=0.77048859605541932;      x(50)=0.80154134610397637;      x(51)=0.83056933360400485;      x(52)=0.85749923151207092;      x(53)=0.88226301283189736;      x(54)=0.90479812252109347;      x(55)=0.92504763563620376;      x(56)=0.94296040139232850;      x(57)=0.95849117297392709;      x(58)=0.97160072337165181;      x(59)=0.98225594909723665;      x(60)=0.99042997118929035;      x(61)=0.99610229631626713;      x(62)=0.99925985930877703;   case(63)      x(1)=-0.99928298402912378;      x(2)=-0.99622401277797011;      x(3)=-0.99072854689218947;      x(4)=-0.98280881059372723;      x(5)=-0.97248403469757002;      x(6)=-0.95977944975894193;      x(7)=-0.94472613404100980;      x(8)=-0.92736092062184321;      x(9)=-0.90772630277853156;      x(10)=-0.88587032850785343;      x(11)=-0.86184648236412372;      x(12)=-0.83571355431950284;      x(13)=-0.80753549577345676;      x(14)=-0.77738126299037234;      x(15)=-0.74532464831784742;      x(16)=-0.71144409958484581;      x(17)=-0.67582252811498609;      x(18)=-0.63854710582136539;      x(19)=-0.59970905187762524;      x(20)=-0.55940340948628501;      x(21)=-0.51772881329003325;      x(22)=-0.47478724799480440;      x(23)=-0.43068379879511160;      x(24)=-0.38552639421224789;      x(25)=-0.33942554197458440;      x(26)=-0.29249405858625144;      x(27)=-0.24484679324595336;      x(28)=-0.19660034679150668;      x(29)=-0.14787278635787197;      x(30)=-0.098783356446945280;      x(31)=-0.049452187116159627;      x(32)=0.0;      x(33)=0.049452187116159627;      x(34)=0.098783356446945280;      x(35)=0.14787278635787197;      x(36)=0.19660034679150668;      x(37)=0.24484679324595336;      x(38)=0.29249405858625144;      x(39)=0.33942554197458440;      x(40)=0.38552639421224789;      x(41)=0.43068379879511160;      x(42)=0.47478724799480440;      x(43)=0.51772881329003325;      x(44)=0.55940340948628501;      x(45)=0.59970905187762524;      x(46)=0.63854710582136539;      x(47)=0.67582252811498609;      x(48)=0.71144409958484581;      x(49)=0.74532464831784742;      x(50)=0.77738126299037234;      x(51)=0.80753549577345676;      x(52)=0.83571355431950284;      x(53)=0.86184648236412372;      x(54)=0.88587032850785343;      x(55)=0.90772630277853156;      x(56)=0.92736092062184321;      x(57)=0.94472613404100980;      x(58)=0.95977944975894193;      x(59)=0.97248403469757002;      x(60)=0.98280881059372723;      x(61)=0.99072854689218947;      x(62)=0.99622401277797011;      x(63)=0.99928298402912378;   case(64)      x(1)=-0.99930504173577214;      x(2)=-0.99634011677195528;      x(3)=-0.99101337147674432;      x(4)=-0.98333625388462596;      x(5)=-0.97332682778991096;      x(6)=-0.96100879965205372;      x(7)=-0.94641137485840282;      x(8)=-0.92956917213193958;      x(9)=-0.91052213707850281;      x(10)=-0.88931544599511411;      x(11)=-0.86599939815409282;      x(12)=-0.84062929625258036;      x(13)=-0.81326531512279756;      x(14)=-0.78397235894334141;      x(15)=-0.75281990726053190;      x(16)=-0.71988185017161083;      x(17)=-0.68523631305423324;      x(18)=-0.64896547125465734;      x(19)=-0.61115535517239325;      x(20)=-0.57189564620263403;      x(21)=-0.53127946401989455;      x(22)=-0.48940314570705296;      x(23)=-0.44636601725346409;      x(24)=-0.40227015796399160;      x(25)=-0.35722015833766812;      x(26)=-0.31132287199021096;      x(27)=-0.26468716220876742;      x(28)=-0.21742364374000708;      x(29)=-0.16964442042399282;      x(30)=-0.12146281929612055;      x(31)=-0.072993121787799039;      x(32)=-0.024350292663424433;      x(33)=0.024350292663424433;      x(34)=0.072993121787799039;      x(35)=0.12146281929612055;      x(36)=0.16964442042399282;      x(37)=0.21742364374000708;      x(38)=0.26468716220876742;      x(39)=0.31132287199021096;      x(40)=0.35722015833766812;      x(41)=0.40227015796399160;      x(42)=0.44636601725346409;      x(43)=0.48940314570705296;      x(44)=0.53127946401989455;      x(45)=0.57189564620263403;      x(46)=0.61115535517239325;      x(47)=0.64896547125465734;      x(48)=0.68523631305423324;      x(49)=0.71988185017161083;      x(50)=0.75281990726053190;      x(51)=0.78397235894334141;      x(52)=0.81326531512279756;      x(53)=0.84062929625258036;      x(54)=0.86599939815409282;      x(55)=0.88931544599511411;      x(56)=0.91052213707850281;      x(57)=0.92956917213193958;      x(58)=0.94641137485840282;      x(59)=0.96100879965205372;      x(60)=0.97332682778991096;      x(61)=0.98333625388462596;      x(62)=0.99101337147674432;      x(63)=0.99634011677195528;      x(64)=0.99930504173577214;    otherwise        error('GAUSS_WEIGHTS - Fatal error! Illegal value of n.');endfunction uqII = fetoquadgen(xiI, xiqII, xeI, xeII, connectI, ufeI)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % transforms ufe from FE-coefficient of mesh-I to quadrature-grid % representation of mesh-II. % ufe is a full FE coefficient vector, having values for all nodes in % mesh-I, including the domain-boundary nodes% % Inputs% ======% ufeI(:)          : full FE coefficient vector, having values for all nodes %                    in a mesh-I, including domain-boundary nodes.% xiI(:)           : parent basis nodes; xi(i) = coordinate of i-th %                    parent basis node of mesh-I% xiqII(:)         : quadrature points of mesh-II% connect(:,:)     : nodal connectivity; connect(i,j) = index of basis node%                    corresponding to local node j of element i% xq(:,:)          : quadrature pts in physical space; %                    xq(i,j) = coordinate of i-th point in j-th element% % Output% ======        % uqII(:,:)          : quadrature-grid representatin of ufe on mesh-II;%                      uqII(i,j) = value at i-th quadrature point of %                      j-th element% Generate global coordinates of quadrature points of mesh-II:nspII = length(xiqII);          % # of quadrature points of mesh-II xqII = getphysicalquadpts(xeII, xiqII);numelI  = length(xeI) - 1;      % # of elements of mesh-InumelII = length(xeII) - 1;     % # of elements of mesh-IIpI = length(xiI) - 1;            % element order of mesh-I% Evaluate at quad points of mesh-II in each element% Initialize outputuqII = zeros(nspII,numelII);for eII = 1:numelII              % loop over elements of mesh-II    % Physical coordintaes of quadrature-points inside element eII in mesh-II    xqIIeII = xqII(:,eII);       % length nspII    for iqII = 1:length(xqIIeII) % loop over q-points of eII        xsampleII = xqIIeII(iqII);        % Now loop over elements of mesh-I to scan which element (can be        % only one) contains quadrature point xsampleII        for eI = 1:numelI                    if iswithin(xsampleII, xeI(eI), xeI(eI+1)) == 1                % get the FE-nodal solution for that element                ueI = ufeI(connectI(eI,:));                xl = xeI(eI);                 xr = xeI(eI+1);                l = xr - xl;                Nl = (xr - xsampleII)/l;                Nr = (xsampleII - xl)/l;                % affine transformation: [xl xr] --> [-1 1]                xisample = Nr - Nl;     % Nl*(-1) + Nr*(+1)                % Tabulate parent basis at quadrature point xsampleII:                [phi, ~] = getshapefunc(pI, xisample);                % Compute the FE solution at quadrature point xsampleII                uqII(iqII,eII) = dot(phi, ueI);                % since xsampleII can be contained by just one element.                 % Once found, hence just "break" the loop to move on                 % to the next quadrature point                break            else                continue            end        end    endendendfunction r = iswithin(x, low, hi)% returns logical true if low < x < hir = (x >= low) & (x <= hi);endfunction uq = fetoquad(xi, xiq, connect, ufe)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % transforms ufe from FE-coefficient to quadrature-grid representation% ufe is a full FE coefficient vector, having values for all nodes in % the mesh, including domain-boundary nodes% % Inputs% ======% ufe(:)           : full FE coefficient vector, having values for all nodes %                    in a mesh, including domain-boundary nodes.% xi(:)            : parent basis nodes; xi(i) = coordinate of i-th %                    parent basis node% xiq(:)           : quadrature points% connect(:,:)     : nodal connectivity; connect(i,j) = index of basis node%                    corresponding to local node j of element i% % Output% ======        % uq(:,:)          : quadrature-grid representatin of ufe;%                    uq(i,j) = value at i-th quadrature point of j-th element% Tabulate parent basis at quadrature points:nparntnodes = length(xi);p = nparntnodes - 1;nsp = length(xiq);numel = size(connect,1);[phiq, ~] = getshapefunc(p, xiq);%  Evaluate at quad points in each elementuq = zeros(nsp,numel);for e = 1:numel    ue = ufe(connect(e,:));    for iq = 1:nsp        uq(iq, e) = dot(phiq(iq,:), ue);    endendendfunction [excq, Vxcq] = exhangecorrelation(type, rhoq)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% ======= % Calculates exchange-correlation (LDA density and potential so far) % from the electron density rhoq. rhoq must be positive% %% Inputs% ======  % rhoq(:,:)    : quadrature-grid representatin of rho; %                rho(i,j) = rho value at i-th quadrature point %                of j-th element% Output% ======        % Vxcq(:,:)    : quadrature-grid representatin of Vxc;%                Vxc(i,j) = value at i-th quadrature point of j-th elementtype = lower(type);     % LDA density and potential so farswitch type    case 'lda'          % The Local Density Approximation (LDA)        % Parameters:        y0 = -0.10498;        b  = 3.72744;        c  = 12.9352;        A  = 0.0621814;        Q  = sqrt(4.0*c - b^2);        rs = (3.0./(4.0*pi*rhoq)).^(1.0/3.0);        y  = sqrt(rs);        Y  = computeY(y, b, c);        Y0 = computeY(y0, b, c);        % Vosko-Wilk-Nusair correlation term:        ec = A/2.0*(log(y.^2./Y) + 2.0*b/Q.*atan(Q./(2.0*y + b)) - ...             b*y0./Y0.*(log((y - y0).^2./Y) + 2.0*(b + 2.0*y0)./ ...             Q.*atan(Q./(2.0*y + b))));        Vc = ec - A/6.0*(c*(y - y0) - b*y0*y)./((y - y0).*Y);        % Electron gas exchange term:        ex = -3.0./(4.0*pi)*(3.0*pi^2*rhoq).^(1.0/3.0);        Vx = 4.0*ex./3.0;        excq = ex + ec;        Vxcq = Vx + Vc;    otherwise        error('Wrong exchange-correlation type entered. Use lda instead');endrhonegval = any(rhoq(:) < 0.0);if rhonegval    disp('Density is negative!');    indcs = find(rhoq(:) < 0.0);    excq(indcs) = 0.0;    Vxcq(indcs) = 0.0;endreturnendfunction Y = computeY(y, b, c)Y = y.^2 + b.*y + c;endfunction [T_s, E_ee, E_en, E_xc, E_tot] = computetotalenergy(xe, xq, wtq, ...                                          rhooutq, Veffq, Vhq, excq, ...                                          Z, E_band)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Purpose% =======      % Variational, quadratically convergent form of total energy% Returns the total energy as well as its parts%% Inputs% ======% xe(:)          : xe(i/i+1) = coord of left/right boundary of ith element% xq(:,:)        : quadrature pts in physical space; %                  xq(i,j) = coordinate of i-th point in j-th element% wtq(:)         : Quadrature weights% rhooutq(:,:)   : radial density at quadrature points; rhoq(i,j) = value%                  at i-th quadrature point of j-th element% veffq(:, :)    :% V_h_q(:, :)    :% e_xc_q(:, :)   :% E_band         :% Z              :% % Output% ======% xqsqrd = xq.^2;T_s = E_band + 4.0*pi*integrateonmesh(xe, wtq, Veffq.*rhooutq.*xqsqrd);E_ee = -2.0*pi*integrateonmesh(xe, wtq, Vhq.*rhooutq.*xqsqrd);E_en = 4.0*pi*Z*integrateonmesh(xe, wtq, rhooutq.*xq);E_xc = -4.0*pi*integrateonmesh(xe, wtq, excq.*rhooutq.*xqsqrd);E_tot = T_s + E_ee + E_en + E_xc;returnend

  • p收敛性分析:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% % Purpose% ========% % Script file to test convergence of ground state energy % with p-refinement of Spectral FEM basis functions%clc;clear all;close all%% Set timer%tstart  = cputime;% global numdofsSch;% ==========================================% Problem data (Chemistry part of the input)% ==========================================% % Set up Problem Parameters:% fprintf('\n');fprintf('----> Setting up the Problem Parameter . . .\n');fprintf('\n');Zion = 14;qtot = 0.0;             % net charge; nonzero for ionic calculationnelec = Zion - qtot;problemdata = struct('Z',Zion, 'nelec',nelec);% % Quadrature%global quadtype;quadtype = 1;          % Type of quadrature: 1 = Gauss, 2 = Lobatto% % 1. Quadrature for radial Schrodinger eq.:% nspSch   = 53;% nspSch   = pSch + 1;   % Number of quadrature points/weights;                        % nsp = p + 1 => diagonal overlap (S)-matrix. This                        % leads to exact integration of H-matrix but                       % "underintegrates" S-matrix. Nonetheless,                        % optimal convergence is preservedquaddatainputSch = struct('quadtype',quadtype, 'nsp',nspSch);% % 2. Quadrature for radial Poisson eq.:% nspPois   = nspSch;% nspPois   = pPois + 1;   % Number of quadrature points/weights;                          % nsp = p + 1 => diagonal overlap (S)-matrix. This                          % leads to exact integration of H-matrix but                         % "underintegrates" S-matrix. Nonetheless,                          % optimal convergence is preservedquaddatainputPois = struct('quadtype',quadtype, 'nsp',nspPois);% % SCF% maxscfiter  = 200;scftol      = 1.0E-6;scftolmax   = 5.0E-5;mixingparam = 0.5;scfopts = struct('maxiter',maxscfiter, 'scftol',scftol, 'scftolmax',scftolmax, ...                 'mixingparam',mixingparam);maxeigiter = 2000;eigtol = 1.0E-10;eigdisp = 0;eigopts = struct('maxit',maxeigiter, 'tol',eigtol, 'disp',eigdisp);% % Domain:% rmin = 0.0;rmax = 10.0;%% Mesh:% domain      = [rmin rmax];toplot      = 'on';% % 1. Mesh for radial Schrodinger eq.:% meshtypeSch    = 1;       % type: 1 = uniform, 2 = logarithmic, 3 = exponentialaSch           = 10.0;numelSch       = 40;pSch           = [1:10]';% % 2. Mesh for radial Poisson eq.:% meshtypePois    = meshtypeSch;       % type: 1 = uniform, 2 = logarithmic, 3 = exponentialaPois           = aSch;pPois           = pSch;numelPois       = numelSch;% % Initialize:% Etotp  = zeros(length(pSch),1);Ekinp  = zeros(length(pSch),1);Ecoulp = zeros(length(pSch),1);Eenucp = zeros(length(pSch),1); Excp   = zeros(length(pSch),1);totdof = zeros(length(pSch),1);for run = 1:length(pSch)    meshoptsSch = struct('element_order',pSch(run), 'numel',numelSch, 'domain',domain, ...                         'verbose',toplot, 'element_type','spectral');%                  meshdatainputSch = struct('meshtype',meshtypeSch, 'param',aSch, ...                              'meshopts',meshoptsSch);    meshoptsPois = struct('element_order',pPois(run), 'numel',numelPois, 'domain',domain, ...                          'verbose',toplot, 'element_type','spectral');%    meshdatainputPois = struct('meshtype',meshtypePois, 'param',aPois, ...                               'meshopts',meshoptsPois);     fprintf('\n');    fprintf('Solving Radial DFT problem for Polynomial Order: %-2d \n', pSch(run));    fprintf('\n')    [lam, u, scf_converged, Etotp(run), Ekinp(run), Ecoulp(run), Eenucp(run), Excp(run), history, exitflag] = radialdft(problemdata, ...                                                   meshdatainputSch, meshdatainputPois, ...                                                   quaddatainputSch, quaddatainputPois, ...                                                   scfopts, eigopts);    totdof(run) = numdofsSch;    if exitflag ~= 0        fprintf('\n');        fprintf('Radial Kohn-Sham Equation could not be solved with Polynomial Order: %-2d and %-5d elements \n', pSch(run), numelSch);        fprintf('because MATLAB''s eigensolver (eigs) failed! \n');        fprintf('\n');        fprintf('********************************************************* \n');        timetot = cputime - tstart;        fprintf('\n');        fprintf(' Total Computing Time so far: %20.3e s \n', timetot);        fprintf('\n');        fprintf('********************************************************* \n');        error('p-Convergence Test Aborted!');        else        fprintf('\n');        fprintf('Radial Kohn-Sham Equation Successfully solved with Polynomial Order: %-2d and %-5d elements \n', pSch(run), numelSch);        fprintf('p-Convergence Test Continuing . . . \n');        fprintf('\n');    endend% % Plot Total energy:%     width = 6;     % Width in inchesheight = 4;    % Height in inchesalw = 5.0;     % AxesLineWidthfsz = 18;      % Fontsizelw = 2.0;      % LineWidthfigureset(gcf,'InvertHardcopy','on');set(gcf,'PaperUnits', 'inches');pos = get(gcf, 'Position');set(gcf, 'Position', [pos(1) pos(2) width*1000, height*1000]);set(gca, 'FontSize', fsz, 'LineWidth', alw);set(get(gca,'xlabel'),'FontSize', fsz, 'FontWeight', 'Bold');set(get(gca,'ylabel'),'FontSize', fsz, 'FontWeight', 'Bold');set(get(gca,'title'),'FontSize', fsz, 'FontWeight', 'Bold');hold on;% plot(totdof, Etotp, 'r', 'LineWidth', 1.25)% xlabel('# of DOF (\equiv # of FE Basis Functions)','Interpreter','tex');ylabel('Converged Total Energy (Ha)','Interpreter','tex');box on; axis square;set(gca,'LineWidth',lw);set(gca,'FontSize',fsz);set(gca,'FontWeight','Bold');set(gcf,'color','w');timetot = cputime - tstart;fprintf('*************************************************************** \n');fprintf('\n');fprintf(' Time to complete the Simulation = %20.3e s\n', timetot);fprintf('\n');fprintf('*************************************************************** \n');
  • h收敛性分析:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Purpose% ========% % Script file to test convergence of ground state energy % with h-refinement of Spectral FEM basis functions%clc;clear all;close all%% Set timer%tstart  = cputime;% global numdofsSch;% ==========================================% Problem data (Chemistry part of the input)% ==========================================% % Set up Problem Parameters:% fprintf('\n');fprintf('----> Setting up the Problem Parameter . . .\n');fprintf('\n');Zion = 14;qtot = 0.0;             % net charge; nonzero for ionic calculationnelec = Zion - qtot;problemdata = struct('Z',Zion, 'nelec',nelec);% % Quadrature%global quadtype;quadtype = 1;          % Type of quadrature: 1 = Gauss, 2 = Lobatto% % 1. Quadrature for radial Schrodinger eq.:% nspSch   = 53;% nspSch   = pSch + 1;   % Number of quadrature points/weights;                        % nsp = p + 1 => diagonal overlap (S)-matrix. This                        % leads to exact integration of H-matrix but                       % "underintegrates" S-matrix. Nonetheless,                        % optimal convergence is preservedquaddatainputSch = struct('quadtype',quadtype, 'nsp',nspSch);% % 2. Quadrature for radial Poisson eq.:% nspPois   = nspSch;% nspPois   = pPois + 1;   % Number of quadrature points/weights;                          % nsp = p + 1 => diagonal overlap (S)-matrix. This                          % leads to exact integration of H-matrix but                         % "underintegrates" S-matrix. Nonetheless,                          % optimal convergence is preservedquaddatainputPois = struct('quadtype',quadtype, 'nsp',nspPois);% % SCF% maxscfiter  = 200;scftol      = 1.0E-6;scftolmax   = 5.0E-5;mixingparam = 0.7;scfopts = struct('maxiter',maxscfiter, 'scftol',scftol, 'scftolmax',scftolmax, ...                 'mixingparam',mixingparam);maxeigiter = 2000;eigtol = 1.0E-10;eigdisp = 0;eigopts = struct('maxit',maxeigiter, 'tol',eigtol, 'disp',eigdisp);% % Domain:% rmin = 0.0;rmax = 10.0;%% Mesh:% domain      = [rmin rmax];toplot      = 'on';% % 1. Mesh for radial Schrodinger eq.:% meshtypeSch    = 1;       % type: 1 = uniform, 2 = logarithmic, 3 = exponentialaSch           = 10.0;numelSch       = 5*(2.^[0:4]);pSch           = 10;% % 2. Mesh for radial Poisson eq.:% meshtypePois    = meshtypeSch;       % type: 1 = uniform, 2 = logarithmic, 3 = exponentialaPois           = aSch;pPois           = pSch;numelPois       = numelSch;% % Initialize:% Etoth  = zeros(length(numelSch),1);Ekinh  = zeros(length(numelSch),1);Ecoulh = zeros(length(numelSch),1);Eenuch = zeros(length(numelSch),1); Exch   = zeros(length(numelSch),1);totdof = zeros(length(numelSch),1); for run = 1:length(numelSch)    meshoptsSch = struct('element_order',pSch, 'numel',numelSch(run), 'domain',domain, ...                         'verbose',toplot, 'element_type','spectral');%                  meshdatainputSch = struct('meshtype',meshtypeSch, 'param',aSch, ...                              'meshopts',meshoptsSch);    meshoptsPois = struct('element_order',pPois, 'numel',numelPois(run), 'domain',domain, ...                          'verbose',toplot, 'element_type','spectral');%    meshdatainputPois = struct('meshtype',meshtypePois, 'param',aPois, ...                               'meshopts',meshoptsPois);     fprintf('\n');    fprintf('Solving Radial DFT problem for # of elements = %-5d \n', numelSch(run));    fprintf('\n')    [lam, u, scf_converged, Etoth(run), Ekinh(run), Ecoulh(run), Eenuch(run), Exch(run), history, exitflag] = radialdft(problemdata, ...                                                   meshdatainputSch, meshdatainputPois, ...                                                   quaddatainputSch, quaddatainputPois, ...                                                   scfopts, eigopts);    totdof(run) = numdofsSch;    if exitflag ~= 0        fprintf('\n');        fprintf('Radial Kohn-Sham Equation could not be solved with Polynomial Order: %-2d and %-5d elements \n', pSch, numelSch(run));        fprintf('because MATLAB''s eigensolver (eigs) failed! \n');        fprintf('\n');        timetot = cputime - tstart;        fprintf('********************************************************* \n');        fprintf('\n');        fprintf(' Total Computing Time so far: %20.3e s \n', timetot);        fprintf('\n');        fprintf('********************************************************* \n');        error('h-Convergence Test Aborted!');        else        fprintf('\n');        fprintf('Radial Kohn-Sham Equation Successfully solved with Polynomial Order: %-2d and %-5d elements \n', pSch, numelSch(run));        fprintf('h-Convergence Test Continuing . . . \n');        fprintf('\n');    endend% % Plot Total energy:%     width = 6;     % Width in inchesheight = 4;    % Height in inchesalw = 5.0;     % AxesLineWidthfsz = 18;      % Fontsizelw = 2.0;      % LineWidthfigureset(gcf,'InvertHardcopy','on');set(gcf,'PaperUnits', 'inches');pos = get(gcf, 'Position');set(gcf, 'Position', [pos(1) pos(2) width*1000, height*1000]);set(gca, 'FontSize', fsz, 'LineWidth', alw);set(get(gca,'xlabel'),'FontSize', fsz, 'FontWeight', 'Bold');set(get(gca,'ylabel'),'FontSize', fsz, 'FontWeight', 'Bold');set(get(gca,'title'),'FontSize', fsz, 'FontWeight', 'Bold');hold on;% plot(totdof, Etoth, 'r', 'LineWidth', 1.25)% xlabel('# of DOF (\equiv # of FE Basis Functions)','Interpreter','tex');ylabel('Converged Total Energy (Ha)','Interpreter','tex');box on; axis square;set(gca,'LineWidth',lw);set(gca,'FontSize',fsz);set(gca,'FontWeight','Bold');set(gcf,'color','w');timetot = cputime - tstart;fprintf('*************************************************************** \n');fprintf('\n');fprintf(' Time to complete the Simulation = %20.3e s\n', timetot);fprintf('\n');fprintf('*************************************************************** \n');


函数用法简介:

这是一个单原子径向Kohn-Sham方程matlab求解器。 主函数spectatom.m中的变量Zion表示原子序数(1-92)。
spectatom.m中设置网格参数和积分参数后调用radialdft.m函数。网格参数包括uniform/logarithmic/exponential三个选项,积分参数保括Gauss-Legendre/
Gauss-Legendre-Lobatto两个选项。
radialdft.m函数的初始化:电荷密度(每次托马斯费马近似),以及一些在KSscfiteration.m函数用到的参量的初始化。
KSscfiteration.m用于SCF迭代计算,在每一次迭代中,它首先要通过给定的密度解决径向泊松问题(泊松函数求解:solveradialpoisson.m和radialpoissonelemeqns.m),随后,这个解(哈里斯势能)被用于计算哈密顿矩阵。
函数radialschroedingerelemeqns.m和solveradialschroed.m分别构建和解决了径向Kohn-Sham特征值问题(本质上和径向薛定谔问题是一致的)。
被用于构建输出密度的特征对的计算在函数computetotalenergy.m中进行,并且通过计算输入和输出密度的的差距来评估收敛性。如果没有达到这一程度,那么SCF迭代就会继续。
可以尝试改变主函数spectatom.m中的原子序数Zion和函数getatomicstate.m中相应的基元配置(单元数目,形函数阶,网格类型),看看最后的结果有什么不同。
函数主要的输出就是基态能量,原子基态能量的标准数据可以在这个网页中查找:https://www.nist.gov/pml/data/atomic-total-energies-and-eigenvalues-html

参考文献:

  1. Ondrej Certik, et al., `dftatom: A robust and general Schrodinger and
    Dirac solver for atomic structure calculations,’ Computer Physics
    Communications; Volume 184, Issue 7, July 2013, Pages 1777-1791
    DOI: https://doi.org/10.1016/j.cpc.2013.02.014

  2. Chao Yang, et al., `KSSOLV - A MATLAB toolbox for solving the Kohn-Sham
    equations,’ ACM Transactions on Mathematical Software (TOMS),
    TOMS Homepage archive, Volume 36 Issue 2, March 2009, Article No. 10
    DOI: http://doi.acm.org/10.1145/1499096.1499099

原创粉丝点击