Code covered by the BSD License  

Highlights from
LaguerreEig

image thumbnail
from LaguerreEig by Damian Trif
Calculates numerical eigenvalues and eigenfunctions of Schroedinger problems on (0,infinity).

[x,A,f,kont]=jacob(x)
function [x,A,f,kont]=jacob(x)
% calculates the critical points x and the corresponding Jacobian A
% the input x is the starting approximation of the critical point

A=zeros(3);x=x(:);i=sqrt(-1);err=1;kont=0;
while (err > 1.e-12)&&(kont<50),
    f=leucemia3d(0,x);
    x(1)=x(1)+i*1.e-20;A(:,1)=imag(leucemia3d(0,x))*1.e20;x(1)=x(1)-i*1.e-20;
    x(2)=x(2)+i*1.e-20;A(:,2)=imag(leucemia3d(0,x))*1.e20;x(2)=x(2)-i*1.e-20;
    x(3)=x(3)+i*1.e-20;A(:,3)=imag(leucemia3d(0,x))*1.e20;x(3)=x(3)-i*1.e-20;
    xn=x-A\f;err=norm(xn-x);x=xn;kont=kont+1;
end

Contact us at files@mathworks.com