Monthly Archives: July 2014

Least Squares in Euler Math Toolbox

For an over-determined linear system expressed in matrix form, the matrix A has more rows than columns.  Therefore the inverse of A cannot be found. The trick with least squares is to multiply both sides of the equation by transpose of A and then solve.  This makes the matrix square and invertible.  In Matlab the back slash operator will do matrix division, and if the matrix is over determined, it will attempt to do least squares.

So for the equation Ax = b, Matlab will give the least squares solution:

x = A\b

In Euler Math Toolbox (EMT) A\b will only work for invertible matrices.  So for EMT to do least squares I need to do the extra steps:

x = (A’.A)\(A’.b)

Rightmost points of the Mandelbrot Set

Using Euler Math Toolbox with the plotting function given at the end of this article, I did a search for the rightmost points of the Mandelbrot sets.  My candidate for the rightmost points are in the neighborhood of 0.4708247 + i*0.3478550 (and its conjugate).  Not sure what the significance of those values is.

right-most points of mandelbrot set zoomed in

function Mandelbrot(a,b,c,d,n=500,m=100)
z=linspace(a,b,n)+1i*linspace(c,d,n)’;
h=zeros(size(z));
loop 1 to m
h = z + (h)^2;
h=(abs(h)>10)*10+(abs(h)<=10)*h;
end
density(log(max(abs(h),1))>0.001);
setplot(a,b,c,d);
xplot();
return h;
endfunction