%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Math 3520: Differential Equations and Dynamical Systems % Complex dynamics, Julia and Fatou sets, Mandelbrot set. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Complex squaring map p(z)=z^2+a a=[-1,0]; % Example a=-1+0i, so p(z)=z^2-1 % Implement complex squaring in R^2: (z(i)+i*z(2))^2+a csqr = @(z) [z(1).*z(1)-z(2).*z(2)+a(1), 2*z(1).*z(2)+a(2)]; N = 10000; % Generate N pairs (xn,yn) for plotting as points X=[0,0]; % Initial values [x0,y0] used by Mandelbrot for(i=2:N) X(i,:) = csqr(X(i-1,:)); end figure; hold on; % New graph, accumulate points plot(X(:,1), X(:,2), "."); % plot trajectory title("Complex Squaring Map Iteration"); xlabel("Real Part"); ylabel("Imaginary Part");