Code covered by the BSD License  

Highlights from
Chebpack

image thumbnail

Chebpack

by

 

15 Jul 2011 (Updated )

The MATLAB package Chebpack solves specific problems for differential or integral equations.

T=cpv(n,xc,dom)
function T=cpv(n,xc,dom)
% T=[T0/2,T1(csi),T2(csi),...,Tn(csi)]
% xc: an arbitrary vector in dom = [a,b]
% csi=2/(b-a)*(xc-(b+a)/2), -1<=csi<=1 column vector
% 
%    Written by Damian Trif, 2011
%
xc=xc(:)';
csi=2/(dom(2)-dom(1))*(xc-(dom(2)+dom(1))/2);
if n>=1, T(1,:)=ones(1,length(xc))/2;end;
if n>=2, T(2,:)=csi;end;
if n>=3, T(3,:)=2*csi.^2-1;end;
if n>=4, for i=4:n
            T(i,:)=2*csi.*T(i-1,:)-T(i-2,:);
         end;
end;
T=T';

Contact us