Your improvements and suggestions are welcome. Write me an e-mail if you find a better solution or a part of it.
After download, change the name of the file to markov.m
span style="color: #228B22;">% solves QMQ^-1 v = l*v for lambda - dominating eigenvalue % it is equivalent to MQ^-1v = l*Q^-1 v or My = l * y with v = Q*y % if, of course, Q is nonsingular; % note that usually Q will be singular so our reformulation makes the problem well posed even for singular Q % check if Q is singular... (if someone insists, because this takes both time and memory!) % extract diagonal only % note that computing the norm of an eigenvector is a NONSENSE!
After download, change the name of the file to threebody.m
span style="color: #228B22;">% these are squares of dist % compute omega at rectangular gridpoints (x,y) (e.g. returned by meshgrid) % for FD approx only % exact formula: takes effort to derive % quick and dirty approximation % for FD approx only % plot % restiricting to 1-D problem: %g can be inaccurate: fsolve exit code: %d\n', x(1), info));