📄 lisc.m
字号:
function [lam,phi,phip,x,c,kod]=lisc(n,errtol,Lfun,m,Nfun,cinit)
%
% Solves two-point boundary value problems Lu=Nu
% using the Lyapunov-Schmidt method
% Reference:
% Trif, D., The Lyapunov-Schmidt method for two-point boundary value problems,
% Fixed Point Theory, 6,1,2005, pp. 119-132
%
disp('Linear part');
[lam,phi,phip,x,wint,wipr,dom]=sp(Lfun,n,errtol);
disp('Nonlinear part');
c0=zeros(size(lam));t=cputime;
if nargin==6
c0(1:length(cinit))=cinit;
end
for j=1:25
[c,rez,drez,kod]=as(lam,phi,phip,x,wint,wipr,dom,c0,m,errtol,Nfun);
if kod==-2 disp('No convergence in fixed point iterations; increase m or change c0');break;end
if kod==-1 disp('Slow convergence in fixed point iterations; increase m');break;end
if m==0 j=0;break;end;
difc=-drez\rez;cor(j)=norm(difc);
if cor(j)<errtol
if j<=2 break;
else figure(1);plot(cor(2:j)./cor(1:j-1));title('Newton iterations: corrections ratio');grid;break;
end
end
if (j>3 & cor(j)>=cor(j-1) & cor(j-1)>=cor(j-2))
kod=-4;disp('No convergence in Newton iterations; change c0');
figure(1);plot(cor(2:j)./cor(1:j-1));title('Newton iterations: corrections ratio');grid;
return
end
c0=c;c0(1:m)=c0(1:m)+difc(1:m);
end
disp([num2str(j),' Newton iterations computed by lisc in ',num2str(cputime-t),' sec']);
if j==25
disp('Slow convergence in Newton iterations; change c0');kod=-3;
figure(1);plot(cor(2:j)./cor(1:j-1));title('Newton iterations: corrections ratio');grid;
return;
end
if (kod<0) return;end
figure(2);plot(x,phi*c);title('Solution');grid;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -