home *** CD-ROM | disk | FTP | other *** search
- % DIFEQITE Used by DIFEQDEM.
- echo off
- % latest change: December 24, 1989
- % Copyright (c) 1990-92 by Carl de Boor and The MathWorks, Inc.
- %
- echo on
- % Here is the iteration:
-
- while 1
- vtau=fnval(y,colpnts);
- weights=[0 1 0;
- [2*vtau' zeros(n-2,1) epsilon*ones(n-2,1)];
- 1 0 0];
- colloc=zeros(n,n);
- for j=1:n
- colloc(j,:)=weights(j,:)*colmat(3*(j-1)+[1:3],:);
- end
- coefs=colloc\[0 vtau.*vtau+1 0]';
- z=spmak(knots,coefs');
- fnplt(z);
- maxdif=max(abs(z-y))
- if (maxdif<tolerance), break, end
- % now reiterate
- y=z;
- end
-