home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 5.ddi / SPLINES.DI$ / DIFEQITE.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  632 b   |  26 lines

  1. % DIFEQITE    Used by DIFEQDEM.
  2. echo off
  3.                                         % latest change: December 24, 1989
  4. % Copyright (c) 1990-92 by Carl de Boor and The MathWorks, Inc.
  5. %
  6. echo on
  7. %  Here is the iteration:
  8.  
  9. while 1
  10.    vtau=fnval(y,colpnts);
  11.    weights=[0 1 0;
  12.             [2*vtau' zeros(n-2,1) epsilon*ones(n-2,1)];
  13.             1 0 0];
  14.    colloc=zeros(n,n);
  15.    for j=1:n
  16.     colloc(j,:)=weights(j,:)*colmat(3*(j-1)+[1:3],:);
  17.    end
  18.    coefs=colloc\[0 vtau.*vtau+1 0]';
  19.    z=spmak(knots,coefs');
  20.    fnplt(z);
  21.    maxdif=max(abs(z-y))
  22.    if (maxdif<tolerance), break, end
  23.    % now reiterate
  24.    y=z;
  25. end
  26.